#*------------------------------------------------------------------- * 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. * *-------------------------------------------------------------------- * Author: Gerson Balbueno Bicca * $Id: HeatExchangerSimplified.mso 160 2007-02-08 18:37:44Z bicca $ *--------------------------------------------------------------------*# using "heat_exchangers/HEX_Engine"; Model HeatExchangerSimplified_Basic ATTRIBUTES Pallete = false; Brief = "Basic Models for Simplified Heat Exchangers"; Info = "to be documented."; PARAMETERS outer PP as Plugin (Brief="External Physical Properties", Type="PP"); outer NComp as Integer (Brief="Number of Components"); M(NComp) as molweight (Brief="Component Mol Weight"); VARIABLES in InletHot as stream (Brief="Inlet Hot Stream", PosX=0, PosY=0.4915, Symbol="^{inHot}"); out OutletHot as streamPH (Brief="Outlet Hot Stream", PosX=1, PosY=0.4915, Symbol="^{outHot}"); in InletCold as stream (Brief="Inlet Cold Stream", PosX=0.5237, PosY=1, Symbol="^{inCold}"); out OutletCold as streamPH (Brief="Outlet Cold Stream", PosX=0.5237, PosY=0, Symbol="^{outCold}"); xh(NComp) as fraction (Brief = "Liquid Molar Fraction in Hot Side"); yh(NComp) as fraction (Brief = "Vapour Molar Fraction in Hot Side"); vh as fraction (Brief = "Vapour Molar Fraction in Hot Side"); xc(NComp) as fraction (Brief = "Liquid Molar Fraction in Cold Side"); yc(NComp) as fraction (Brief = "Vapour Molar Fraction in Cold Side"); vc as fraction (Brief = "Vapour Molar Fraction in Cold Side"); Details as Details_Main (Brief="Heat Exchanger Details", Symbol=" "); HotSide as Main_Simplified (Brief="Heat Exchanger Hot Side", Symbol="_{hot}"); ColdSide as Main_Simplified (Brief="Heat Exchanger Cold Side", Symbol="_{cold}"); SET #"Component Molecular Weight" M = PP.MolecularWeight(); EQUATIONS "Flash Calculation in Hot Side" [vh, xh, yh] = PP.Flash(InletHot.T, InletHot.P, InletHot.z); "Flash Calculation in Cold Side" [vc, xc, yc] = PP.Flash(InletCold.T, InletCold.P, InletCold.z); "Hot Stream Average Temperature" HotSide.Properties.Average.T = 0.5*InletHot.T + 0.5*OutletHot.T; "Cold Stream Average Temperature" ColdSide.Properties.Average.T = 0.5*InletCold.T + 0.5*OutletCold.T; "Hot Stream Average Pressure" HotSide.Properties.Average.P = 0.5*InletHot.P+0.5*OutletHot.P; "Cold Stream Average Pressure" ColdSide.Properties.Average.P = 0.5*InletCold.P+0.5*OutletCold.P; "Cold Stream Wall Temperature" ColdSide.Properties.Wall.Twall = 0.5*HotSide.Properties.Average.T + 0.5*ColdSide.Properties.Average.T; "Hot Stream Wall Temperature" HotSide.Properties.Wall.Twall = 0.5*HotSide.Properties.Average.T + 0.5*ColdSide.Properties.Average.T; "Hot Stream Average Molecular Weight" HotSide.Properties.Average.Mw = sum(M*InletHot.z); "Cold Stream Average Molecular Weight" ColdSide.Properties.Average.Mw = sum(M*InletCold.z); "Cold Stream Average Heat Capacity" ColdSide.Properties.Average.Cp = (1-InletCold.v)*PP.LiquidCp(ColdSide.Properties.Average.T,ColdSide.Properties.Average.P,xc) + InletCold.v*PP.VapourCp(ColdSide.Properties.Average.T,ColdSide.Properties.Average.P,yc); "Cold Stream Average Mass Density" ColdSide.Properties.Average.rho = (1-InletCold.v)*PP.LiquidDensity(ColdSide.Properties.Average.T,ColdSide.Properties.Average.P,xc)+ InletCold.v*PP.VapourDensity(ColdSide.Properties.Average.T,ColdSide.Properties.Average.P,yc); "Cold Stream Inlet Mass Density" ColdSide.Properties.Inlet.rho = (1-InletCold.v)*PP.LiquidDensity(InletCold.T,InletCold.P,xc)+ InletCold.v*PP.VapourDensity(InletCold.T,InletCold.P,yc); "Cold Stream Outlet Mass Density" ColdSide.Properties.Outlet.rho = (1-OutletCold.v)*PP.LiquidDensity(OutletCold.T,OutletCold.P,OutletCold.x)+ OutletCold.v*PP.VapourDensity(OutletCold.T,OutletCold.P,OutletCold.y); "Cold Stream Average Viscosity" ColdSide.Properties.Average.Mu = (1-InletCold.v)*PP.LiquidViscosity(ColdSide.Properties.Average.T,ColdSide.Properties.Average.P,xc)+ InletCold.v*PP.VapourViscosity(ColdSide.Properties.Average.T,ColdSide.Properties.Average.P,yc); "Cold Stream Average Conductivity" ColdSide.Properties.Average.K = (1-InletCold.v)*PP.LiquidThermalConductivity(ColdSide.Properties.Average.T,ColdSide.Properties.Average.P,xc)+ InletCold.v*PP.VapourThermalConductivity(ColdSide.Properties.Average.T,ColdSide.Properties.Average.P,yc); "Cold Stream Viscosity at Wall Temperature" ColdSide.Properties.Wall.Mu = (1-InletCold.v)*PP.LiquidViscosity(ColdSide.Properties.Wall.Twall,ColdSide.Properties.Average.P,xc)+ InletCold.v*PP.VapourViscosity(ColdSide.Properties.Wall.Twall,ColdSide.Properties.Average.P,yc); "Hot Stream Average Heat Capacity" HotSide.Properties.Average.Cp = (1-InletHot.v)*PP.LiquidCp(HotSide.Properties.Average.T,HotSide.Properties.Average.P,xc) + InletHot.v*PP.VapourCp(HotSide.Properties.Average.T,HotSide.Properties.Average.P,yc); "Hot Stream Average Mass Density" HotSide.Properties.Average.rho = (1-InletHot.v)*PP.LiquidDensity(HotSide.Properties.Average.T,HotSide.Properties.Average.P,xc)+ InletHot.v*PP.VapourDensity(HotSide.Properties.Average.T,HotSide.Properties.Average.P,yc); "Hot Stream Inlet Mass Density" HotSide.Properties.Inlet.rho = (1-InletHot.v)*PP.LiquidDensity(InletHot.T,InletHot.P,xc)+ InletHot.v*PP.VapourDensity(InletHot.T,InletHot.P,yc); "Hot Stream Outlet Mass Density" HotSide.Properties.Outlet.rho = (1-OutletHot.v)*PP.LiquidDensity(OutletHot.T,OutletHot.P,OutletHot.x)+ OutletHot.v*PP.VapourDensity(OutletHot.T,OutletHot.P,OutletHot.y); "Hot Stream Average Viscosity" HotSide.Properties.Average.Mu = (1-InletHot.v)*PP.LiquidViscosity(HotSide.Properties.Average.T,HotSide.Properties.Average.P,xc)+ InletHot.v*PP.VapourViscosity(HotSide.Properties.Average.T,HotSide.Properties.Average.P,yc); "Hot Stream Average Conductivity" HotSide.Properties.Average.K = (1-InletHot.v)*PP.LiquidThermalConductivity(HotSide.Properties.Average.T,HotSide.Properties.Average.P,xc)+ InletHot.v*PP.VapourThermalConductivity(HotSide.Properties.Average.T,HotSide.Properties.Average.P,yc); "Hot Stream Viscosity at Wall Temperature" HotSide.Properties.Wall.Mu = (1-InletHot.v)*PP.LiquidViscosity(HotSide.Properties.Wall.Twall,HotSide.Properties.Average.P,xc)+ InletHot.v*PP.VapourViscosity(HotSide.Properties.Wall.Twall,HotSide.Properties.Average.P,yc); "Energy Balance Hot Stream" Details.Q = InletHot.F*(InletHot.h-OutletHot.h); "Energy Balance Cold Stream" Details.Q =-InletCold.F*(InletCold.h-OutletCold.h); "Flow Mass Inlet Cold Stream" ColdSide.Properties.Inlet.Fw = sum(M*InletCold.z)*InletCold.F; "Flow Mass Outlet Cold Stream" ColdSide.Properties.Outlet.Fw = sum(M*OutletCold.z)*OutletCold.F; "Flow Mass Inlet Hot Stream" HotSide.Properties.Inlet.Fw = sum(M*InletHot.z)*InletHot.F; "Flow Mass Outlet Hot Stream" HotSide.Properties.Outlet.Fw = sum(M*OutletHot.z)*OutletHot.F; "Molar Balance Hot Stream" InletHot.F = OutletHot.F; "Molar Balance Cold Stream" InletCold.F = OutletCold.F; "Hot Stream Molar Fraction Constraint" OutletHot.z = InletHot.z; "Cold Stream Molar Fraction Constraint" OutletCold.z = InletCold.z; "Pressure Drop Hot Stream" OutletHot.P = InletHot.P - HotSide.PressureDrop.Pdrop; "Pressure Drop Cold Stream" OutletCold.P = InletCold.P - ColdSide.PressureDrop.Pdrop; "Fraction of Inlet Pressure : Hot Stream" HotSide.PressureDrop.Pdrop = InletHot.P*HotSide.PressureDrop.FPdrop; "Fraction of Inlet Pressure : Cold Stream" ColdSide.PressureDrop.Pdrop = InletCold.P*ColdSide.PressureDrop.FPdrop; end Model HeatExchanger_LMTD as HeatExchangerSimplified_Basic ATTRIBUTES Pallete = true; Icon = "icon/HeatExchanger_LMTD"; Brief = "Heat Exchanger Block - LMTD Method"; Info = "to be documented."; PARAMETERS FlowDirection as Switcher (Brief="Flow Direction",Valid=["counter","cocurrent"],Default="cocurrent"); VARIABLES Method as LMTD_Basic (Brief="LMTD Method of Calculation", Symbol =" "); EQUATIONS "Exchange Surface Area" Details.Q = Details.Ud*Details.A*Method.LMTD*Method.Fc; switch FlowDirection case "cocurrent": "Temperature Difference at Inlet" Method.DT0 = InletHot.T - InletCold.T; "Temperature Difference at Outlet" Method.DTL = OutletHot.T - OutletCold.T; case "counter": "Temperature Difference at Inlet" Method.DT0 = InletHot.T - OutletCold.T; "Temperature Difference at Outlet" Method.DTL = OutletHot.T - InletCold.T; end end Model Shell_and_Tubes_LMTD as HeatExchangerSimplified_Basic ATTRIBUTES Pallete = true; Icon = "icon/Shell_and_Tubes_LMTD"; Brief = "Shell and Tubes Heat Exchanger with 1 or 2 shell pass - LMTD Method"; Info = "to be documented."; PARAMETERS LMTDcorrection as Switcher(Brief="LMTD Correction Factor Model",Valid=["Bowmann","Fakeri"],Default="Bowmann"); ShellType as Switcher(Brief="TEMA Designation for Shell Type",Valid=["Eshell","Fshell"],Default="Eshell"); VARIABLES Method as LMTD_Basic (Brief="LMTD Method of Calculation", Symbol =" "); R as positive (Brief=" Capacity Ratio for LMTD Correction Fator",Lower=1e-6); P as positive (Brief="Non - Dimensional Variable for LMTD Correction Fator ",Lower=1e-6); Pc as positive (Brief="Non - Dimensional Variable for LMTD Correction Fator when 2 Pass Shell Side",Lower=1e-6); Rho as positive (Brief="Non - Dimensional Variable for LMTD Correction Fator in Fakeri Equation",Lower=1e-6); Phi as positive (Brief="Non - Dimensional Variable for LMTD Correction Fator in Fakeri Equation",Lower=1e-6, Symbol ="\phi"); lambdaN as Real (Brief="Non - Dimensional Variable for LMTD Correction Fator in Fakeri Equation when 2 Pass Shell Side", Symbol ="\lambda _{N}"); lambda1 as Real (Brief="Non - Dimensional Variable for LMTD Correction Fator in Fakeri Equationwhen 2 Pass Shell Side", Symbol ="\lambda _{1}"); EQUATIONS "Exchange Surface Area" Details.Q = Details.Ud*Details.A*Method.LMTD*Method.Fc; "R: Capacity Ratio for LMTD Correction Fator" R*(OutletCold.T - InletCold.T ) = (InletHot.T-OutletHot.T); "P: Non - Dimensional Variable for LMTD Correction Fator" P*(InletHot.T- InletCold.T)= (OutletCold.T-InletCold.T); "Temperature Difference at Inlet" Method.DT0 = InletHot.T - OutletCold.T; "Temperature Difference at Outlet" Method.DTL = OutletHot.T - InletCold.T; switch ShellType case "Fshell": switch LMTDcorrection case "Bowmann": " Variable not in use with Bowmann equation" lambdaN =1; " Variable not in use with Bowmann equation" lambda1 =1; " Variable not in use with Bowmann equation" Phi = 1; " Variable not in use with Bowmann equation" Rho =1; if R equal 1 then "Non Dimensional Variable for LMTD Correction Fator when 2 Pass Shell Side" Pc*(2-P)= P; "LMTD Correction Fator when 2 Pass Shell Side" Method.Fc= (sqrt(2)*Pc)/((1-Pc)*ln( abs( ( 2-Pc*0.585786)/( 2-Pc*3.414214)))); else "Non Dimensional Variable for LMTD Correction Fator when 2 Pass Shell Side" Pc = (sqrt(abs(( 1-P*R)/(1-P)))-1)/(sqrt(abs(( 1-P*R)/(1-P)))-R); "LMTD Correction Fator when 2 Pass Shell Side" Method.Fc = sqrt(R*R+1)*ln(abs((1-Pc*R)/(1-Pc)))/((1-R)*ln( abs( ( 2-Pc*(R+1-sqrt(R*R+1)))/ ( 2-Pc*(R + 1 + sqrt(R*R+1)))))); end case "Fakeri": " Variable not in use with Fakeri equation" Pc = P; "Non Dimensional Variable for LMTD Correction Fator in Fakeri Equation" Rho*(1-P*R) = (1-P); "Non Dimensional Variable for LMTD Correction Fator in Fakeri Equation " Phi = (sqrt(((InletHot.T - OutletHot.T)*(InletHot.T- OutletHot.T))+((OutletCold.T - InletCold.T)*(OutletCold.T - InletCold.T))))/(2*((InletHot.T + OutletHot.T)-( InletCold.T + OutletCold.T))); if Rho equal 1 then " Variable not in use when Rho = 1" lambdaN = 1; " Variable not in use when Rho = 1" lambda1 = 1; "LMTD Correction Fator when 2 Pass Shell Side" Method.Fc = (2*Phi )/(ln(abs((1+Phi )/(1-Phi )))); else "Non Dimensional Variable for LMTD Correction Fator in Fakeri Equation" lambdaN = (1/ln(sqrt(abs(Rho))))*((2*sqrt(abs(Rho))-2)/(sqrt(abs(Rho))+1)); "Non Dimensional Variable for LMTD Correction Fator in Fakeri Equation" lambda1 = (1/ln(abs(Rho)))*((2*Rho-2)/(Rho+1)); "LMTD Correction Fator when 2 Pass Shell Side" Method.Fc = ((2*Phi *(lambdaN/lambda1))/(ln(abs((1+Phi *(lambdaN/lambda1))/(1-Phi *(lambdaN/lambda1))))))*(1/lambdaN); end end case "Eshell": " Variable not in use when 1 Pass Shell Side" lambdaN =1; " Variable not in use when 1 Pass Shell Side" lambda1 =1; " Variable not in use when 1 Pass Shell Side" Pc = P; switch LMTDcorrection case "Bowmann": " Variable not in use with Bowmann equation" Phi = 1; " Variable not in use with Bowmann equation" Rho = 1; if R equal 1 then "LMTD Correction Fator when 1 Pass Shell Side" Method.Fc = (sqrt(2)*P)/((1-P)*ln( abs( ( 2-P*0.585786)/( 2-P*3.414214)))); else "LMTD Correction Fator when 1 Pass Shell Side" Method.Fc = sqrt(R*R+1)*ln(abs((1-P*R)/(1-P)))/((1-R)*ln( abs( ( 2-P*(R+1-sqrt(R*R+1)))/ ( 2-P*(R + 1 + sqrt(R*R+1)))))); end case "Fakeri": "Non Dimensional Variable for LMTD Correction Fator in Fakeri Equation " Phi = (sqrt(((InletHot.T- OutletHot.T)*(InletHot.T- OutletHot.T))+((OutletCold.T - InletCold.T)*(OutletCold.T - InletCold.T))))/(2*((InletHot.T+ OutletHot.T)-(InletCold.T+ OutletCold.T))); "Non Dimensional Variable for LMTD Correction Fator in Fakeri Equation" Rho*(1-P*R) = (1-P); if Rho equal 1 then "LMTD Correction Fator when 1 Pass Shell Side" Method.Fc = (4*Phi)/(ln(abs((1+2*Phi)/(1-2*Phi)))); else "LMTD Correction Fator when 1 Pass Shell Side" Method.Fc = (2*Phi*(Rho+1)*ln(abs(Rho)))/( ln(abs((1+2*Phi)/(1-2*Phi)))*(Rho-1)); end end end end Model HeatExchanger_NTU as HeatExchangerSimplified_Basic ATTRIBUTES Pallete = true; Icon = "icon/HeatExchanger_NTU"; Brief = "Heat Exchanger Block - NTU Method"; Info = "to be documented."; PARAMETERS FlowDirection as Switcher (Brief="Flow Direction",Valid=["counter","cocurrent"],Default="cocurrent"); VARIABLES Method as NTU_Basic (Brief="NTU Method of Calculation", Symbol =" "); EQUATIONS "Number of Units Transference" Method.NTU*Method.Cmin = Details.Ud*Details.A; "Minimum Heat Capacity" Method.Cmin = min([Method.Ch,Method.Cc]); "Maximum Heat Capacity" Method.Cmax = max([Method.Ch,Method.Cc]); "Thermal Capacity Ratio" Method.Cr = Method.Cmin/Method.Cmax; "Duty" Details.Q = Method.Eft*Method.Cmin*(InletHot.T-InletCold.T); "Hot Stream Heat Capacity" Method.Ch = InletHot.F*HotSide.Properties.Average.Cp; "Cold Stream Heat Capacity" Method.Cc = InletCold.F*ColdSide.Properties.Average.Cp; "Effectiveness Correction" Method.Eft1 = 1; if Method.Cr equal 0 then "Effectiveness" Method.Eft = 1-exp(-Method.NTU); else switch FlowDirection case "cocurrent": "Effectiveness in Cocurrent Flow" Method.Eft = (1-exp(-Method.NTU*(1+Method.Cr)))/(1+Method.Cr); case "counter": if Method.Cr equal 1 then "Effectiveness in Counter Flow" Method.Eft = Method.NTU/(1+Method.NTU); else "Effectiveness in Counter Flow" Method.Eft = (1-exp(-Method.NTU*(1-Method.Cr)))/(1-Method.Cr*exp(-Method.NTU*(1-Method.Cr))); end end end end Model Shell_and_Tubes_NTU as HeatExchangerSimplified_Basic ATTRIBUTES Pallete = true; Icon = "icon/Shell_and_Tubes_NTU"; Brief = "Shell and Tubes Heat Exchanger with 1 or 2 shell pass - NTU Method"; Info = "to be documented."; PARAMETERS ShellType as Switcher (Brief="TEMA Designation",Valid=["Eshell","Fshell"],Default="Eshell"); VARIABLES Method as NTU_Basic (Brief="NTU Method of Calculation" , Symbol =" "); EQUATIONS "Number of Units Transference" Method.NTU*Method.Cmin = Details.Ud*Details.A; "Minimum Heat Capacity" Method.Cmin = min([Method.Ch,Method.Cc]); "Maximum Heat Capacity" Method.Cmax = max([Method.Ch,Method.Cc]); "Thermal Capacity Ratio" Method.Cr = Method.Cmin/Method.Cmax; "Duty" Details.Q = Method.Eft*Method.Cmin*(InletHot.T-InletCold.T); "Hot Stream Heat Capacity" Method.Ch = InletHot.F*HotSide.Properties.Average.Cp; "Cold Stream Heat Capacity" Method.Cc = InletCold.F*ColdSide.Properties.Average.Cp; switch ShellType case "Fshell": "Effectiveness Correction for 2 pass shell side" Method.Eft1 = 2*(1+Method.Cr+sqrt(1+Method.Cr^2)*((1+exp(-Method.NTU*sqrt(1+Method.Cr^2)))/(1-exp(-Method.NTU*sqrt(1+Method.Cr^2)))) )^-1; "TEMA F Shell Effectiveness" Method.Eft = ( ((1-Method.Eft1*Method.Cr)/(1-Method.Eft1))^2 -1 )*( ((1-Method.Eft1*Method.Cr)/(1-Method.Eft1))^2 - Method.Cr )^-1; case "Eshell": "TEMA E Shell Effectiveness" Method.Eft = 2*(1+Method.Cr+sqrt(1+Method.Cr^2)*((1+exp(-Method.NTU*sqrt(1+Method.Cr^2)))/(1-exp(-Method.NTU*sqrt(1+Method.Cr^2)))) )^-1; "Variable not in use when 1 Pass Shell Side" Method.Eft1 = 1; end end