#*------------------------------------------------------------------- * 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 122 2007-01-18 16:06:09Z bicca $ *--------------------------------------------------------------------*# using "streams.mso"; Model Inlet_Main_Stream #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# # Inlet Streams #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# PARAMETERS Ncold as Integer (Brief="Number of Inlet Cold Streams",Lower=1); Nhot as Integer (Brief="Number of Inlet Hot Streams",Lower=1); VARIABLES Hot (Nhot) as stream;# Inlet Hot Streams Cold (Ncold) as stream;# Inlet Cold Streams end Model Outlet_Main_Stream #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# # Outlet Streams #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# PARAMETERS Ncold as Integer (Brief="Number of Inlet Cold Streams",Lower=1); Nhot as Integer (Brief="Number of Inlet Hot Streams",Lower=1); VARIABLES Hot (Nhot) as stream_therm;# Outlet Hot Streams Cold (Ncold) as stream_therm;# Outlet Cold Streams end Model Mheatex #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# # Multistream Heat Exchanger Basic Calculation #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# PARAMETERS ext PP as CalcObject (Brief="Physical Properties"); ext NComp as Integer (Brief="Number of Components"); HE as CalcObject (Brief="Cold Box Calculations",File="heatex"); Side as Integer (Brief="Flow Direction",Lower=0,Upper=1); 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; # Inlet Hot Streams out Outlet as Outlet_Main_Stream; # Outlet Hot Streams Q as power (Brief="Heat Transfer"); LMTD as temp_delta (Brief="Logarithmic Mean Temperature Difference"); UA as positive (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); SET # Flow Direction Side = HE.FlowDir(); # Inlet Ncold Parameters Inlet.Ncold = Ncold; # Outlet Ncold Parameters Outlet.Ncold = Ncold; # Inlet Nhot Parameters Inlet.Nhot = Nhot; # Outlet Nhot Parameters Outlet.Nhot = Nhot ; 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; for i in [1:Nhot] "Vapourisation Fraction Hot Stream" Outlet.Hot(i).v = PP.VapourFraction(Outlet.Hot(i).T,Outlet.Hot(i).P,Outlet.Hot(i).z); end for j in [1:Ncold] "Vapourisation Fraction Cold Stream" Outlet.Cold(j).v = PP.VapourFraction(Outlet.Cold(j).T,Outlet.Cold(j).P,Outlet.Cold(j).z); end "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 if Side equal 0 then "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); else "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