#*------------------------------------------------------------------- * EMSO Model Library (EML) Copyright (C) 2004 - 2007 ALSOC. * * This LIBRARY is free software; you can distribute it and/or modify * it under the therms of the ALSOC FREE LICENSE as available at * http://www.enq.ufrgs.br/alsoc. * * EMSO Copyright (C) 2004 - 2007 ALSOC, original code * from http://www.rps.eng.br Copyright (C) 2002-2004. * All rights reserved. * * EMSO is distributed under the therms of the ALSOC LICENSE as * available at http://www.enq.ufrgs.br/alsoc. * * *--------------------------------------------------------------------- * Model of a Multistream Heat Exchanger * * Streams: * * Hot Inlet streams .... at least one Hot material stream * * Cold Inlet streams .... at least one Cold material stream * * Hot Outlet streams .... one material stream for each Hot Inlet * * Cold Outlet streams .... one material stream for each Cold Inlet * * Purpose: * * Heat Transfer between multiple hot and cold streams. * *---------------------------------------------------------------------- * Author: Gerson Balbueno Bicca * $Id: Mheatex.mso 147 2007-01-31 19:02:46Z bicca $ *--------------------------------------------------------------------*# using "streams.mso"; Model Inlet_Main_Stream ATTRIBUTES Pallete = false; Brief = "Inlet material streams for Hot and Cold side"; Info = "write some information"; PARAMETERS outer Ncold as Integer (Brief="Number of Inlet Cold Streams",Lower=1); outer Nhot as Integer (Brief="Number of Inlet Hot Streams",Lower=1); VARIABLES Hot (Nhot) as stream (Brief="Inlet Hot Streams"); Cold (Ncold) as stream (Brief="Inlet Cold Streams"); end Model Outlet_Main_Stream ATTRIBUTES Pallete = false; Brief = "Outlet material streams for Hot and Cold side"; Info = "write some information"; PARAMETERS outer Ncold as Integer (Brief="Number of Outlet Cold Streams",Lower=1); outer Nhot as Integer (Brief="Number of Outlet Hot Streams",Lower=1); VARIABLES Hot (Nhot) as streamPH (Brief="Outlet Hot Streams"); Cold (Ncold) as streamPH (Brief="Outlet Cold Streams"); end Model Mheatex ATTRIBUTES Pallete = true; Brief = "Multistream heat exchangers"; Info = "Heat Transfer between multiple hot and cold streams"; PARAMETERS outer PP as Plugin (Brief="Physical Properties"); outer NComp as Integer (Brief="Number of Components"); FlowDirection as Switcher(Brief="Flow Direction",Valid=["counter","cocurrent"],Default="cocurrent"); Ncold as Integer (Brief="Number of Inlet Cold Streams",Lower=1); Nhot as Integer (Brief="Number of Inlet Hot Streams",Lower=1); VARIABLES in Inlet as Inlet_Main_Stream (Brief="Inlet Streams"); out Outlet as Outlet_Main_Stream (Brief="Outlet Streams"); Q as power (Brief="Heat Transfer"); LMTD as temp_delta (Brief="Logarithmic Mean Temperature Difference"); UA as positive (Brief="UA product",Unit="W/K"); DT0 as temp_delta (Brief="Temperature Difference at Inlet",Lower=1); DTL as temp_delta (Brief="Temperature Difference at Outlet",Lower=1); EQUATIONS "Hot Flow" Outlet.Hot.F = Inlet.Hot.F; "Cold Flow" Outlet.Cold.F = Inlet.Cold.F; "Hot Composition" Outlet.Hot.z = Inlet.Hot.z; "Cold Composition" Outlet.Cold.z = Inlet.Cold.z; "Heat Duty Hot Stream" Q = sum(Inlet.Hot.F*(Inlet.Hot.h- Outlet.Hot.h)); "Heat Duty Cold Stream" Q = -sum(Inlet.Cold.F*(Inlet.Cold.h- Outlet.Cold.h)); "Heat Duty" Q=UA*LMTD; if abs(DT0 - DTL) > 0.05*max(abs([DT0,DTL])) then "Log Mean Temperature Difference" LMTD= (DT0-DTL)/ln(DT0/DTL); else if DT0*DTL equal 0 then "Log Mean Temperature Difference" LMTD = 0.5*(DT0+DTL); else "Log Mean Temperature Difference" LMTD = 0.5*(DT0+DTL)*(1-(DT0-DTL)^2/(DT0*DTL)*(1+(DT0-DTL)^2/(DT0*DTL)/2)/12); end end switch FlowDirection case "cocurrent": "Temperature Difference at Inlet" DT0 = max(Inlet.Hot.T) - min(Inlet.Cold.T); "Temperature Difference at Outlet" DTL = min(Outlet.Hot.T) - max(Outlet.Cold.T); case "counter": "Temperature Difference at Inlet" DT0 = max(Inlet.Hot.T) - max(Outlet.Cold.T); "Temperature Difference at Outlet" DTL = min(Outlet.Hot.T) - min(Inlet.Cold.T); end end