#*------------------------------------------------------------------- * 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 $ *--------------------------------------------------------------------*# using "heat_exchangers/HEX_Engine"; Model Heatex_Basic ATTRIBUTES Pallete = false; Brief = "Basic Model 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 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 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 Heatex_LMTD as Heatex_Basic ATTRIBUTES Pallete = true; Icon = "icon/HeatExchanger_LMTD"; Brief = "Simplified model for Heat Exchangers"; Info = "to be documented."; PARAMETERS ExchangerType as Switcher (Brief="Type of Heat Exchanger",Valid=["Counter Flow","Cocurrent Flow", "Shell and Tube"],Default="Cocurrent Flow"); LMTDcorrection as Switcher (Brief="LMTD Correction Factor Model",Valid=["Bowmann","Fakheri"],Default="Bowmann"); 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); Rho as positive (Brief="Non - Dimensional Variable for LMTD Correction Fator in Fakheri Equation",Lower=1e-6); Phi as positive (Brief="Non - Dimensional Variable for LMTD Correction Fator in Fakheri Equation",Lower=1e-6, Symbol ="\phi"); EQUATIONS "Duty" Details.Q = Details.Ud*Details.A*Method.LMTD*Method.Fc; switch ExchangerType case "Cocurrent Flow": "Temperature Difference at Inlet" Method.DT0 = InletHot.T - InletCold.T; "Temperature Difference at Outlet" Method.DTL = OutletHot.T - OutletCold.T; "R: Capacity Ratio for LMTD Correction Fator" R=1; "P: Non - Dimensional Variable for LMTD Correction Fator" P=1; " Variable useless with this model" Phi = 1; " Variable useless with this model" Rho = 1; "LMTD Correction Factor in Cocurrent Flow" Method.Fc = 1; case "Counter Flow": "Temperature Difference at Inlet" Method.DT0 = InletHot.T - OutletCold.T; "Temperature Difference at Outlet" Method.DTL = OutletHot.T - InletCold.T; "R: Capacity Ratio for LMTD Correction Fator" R=1; "P: Non - Dimensional Variable for LMTD Correction Fator" P=1; " Variable useless with this model" Phi = 1; " Variable useless with this model" Rho = 1; "LMTD Correction Factor in Counter Flow" Method.Fc = 1; case "Shell and Tube": "Temperature Difference at Inlet" Method.DT0 = InletHot.T - OutletCold.T; "Temperature Difference at Outlet" Method.DTL = OutletHot.T - InletCold.T; switch LMTDcorrection case "Bowmann": " Variable not in use with Bowmann equation" Phi = 1; " Variable not in use with Bowmann equation" Rho = 1; "R: Capacity Ratio for LMTD Correction Fator when Shell and Tube" R*(OutletCold.T - InletCold.T ) = (InletHot.T-OutletHot.T); "P: Non - Dimensional Variable for LMTD Correction Fator when Shell and Tube" P*(InletHot.T- InletCold.T)= (OutletCold.T-InletCold.T); 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 "Fakheri": "R: Capacity Ratio for LMTD Correction Fator when Shell and Tube" R*(OutletCold.T - InletCold.T ) = (InletHot.T-OutletHot.T); "P: Non - Dimensional Variable for LMTD Correction Fator when Shell and Tube" P*(InletHot.T- InletCold.T)= (OutletCold.T-InletCold.T); "Non Dimensional Variable for LMTD Correction Fator in Fakheri 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 Fakheri 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 Heatex_NTU as Heatex_Basic ATTRIBUTES Pallete = true; Icon = "icon/HeatExchanger_NTU"; Brief = "Simplified model for Heat Exchangers"; Info = "to be documented."; PARAMETERS ExchangerType as Switcher (Brief="Type of Heat Exchanger",Valid=["Counter Flow","Cocurrent Flow", "Shell and Tube"],Default="Cocurrent Flow"); 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 ExchangerType case "Cocurrent Flow": "Effectiveness in Cocurrent Flow" Method.Eft = (1-exp(-Method.NTU*(1+Method.Cr)))/(1+Method.Cr); case "Counter Flow": 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 case "Shell and Tube": "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; end end end