#*------------------------------------------------------------------- * 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 100 2007-01-09 14:15:56Z bicca $ *--------------------------------------------------------------------*# using "HEX_Engine"; #===================================================================== # Basic Models for Simplified Heat Exchangers #===================================================================== Model HeatExchangerSimplified_Basic PARAMETERS ext PP as CalcObject (Brief="External Physical Properties"); HE as CalcObject (Brief="STHE Calculations",File="heatex"); ext NComp as Integer (Brief="Number of Components"); M(NComp) as molweight (Brief="Component Mol Weight"); VARIABLES in Inlet as Inlet_Main_Stream; # Hot and Cold Inlets out Outlet as Outlet_Main_Stream; # Hot and Cold Outlets Properties as Main_Properties; # Hot and Cold Properties Details as Details_Main; PressureDrop as Main_Pdrop; SET M = PP.MolecularWeight(); EQUATIONS "Hot Stream Average Temperature" Properties.Hot.Average.T = 0.5*Inlet.Hot.T + 0.5*Outlet.Hot.T; "Cold Stream Average Temperature" Properties.Cold.Average.T = 0.5*Inlet.Cold.T + 0.5*Outlet.Cold.T; "Hot Stream Average Pressure" Properties.Hot.Average.P = 0.5*Inlet.Hot.P+0.5*Outlet.Hot.P; "Cold Stream Average Pressure" Properties.Cold.Average.P = 0.5*Inlet.Cold.P+0.5*Outlet.Cold.P; "Cold Stream Wall Temperature" Properties.Cold.Wall.Twall = 0.5*Properties.Hot.Average.T + 0.5*Properties.Cold.Average.T; "Hot Stream Wall Temperature" Properties.Hot.Wall.Twall = 0.5*Properties.Hot.Average.T + 0.5*Properties.Cold.Average.T; "Hot Stream Average Molecular Weight" Properties.Hot.Average.Mw = sum(M*Inlet.Hot.z); "Cold Stream Average Molecular Weight" Properties.Cold.Average.Mw = sum(M*Inlet.Cold.z); if Inlet.Cold.v equal 0 then "Cold Stream Average Heat Capacity" Properties.Cold.Average.Cp = PP.LiquidCp(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z); "Cold Stream Inlet Heat Capacity" Properties.Cold.Inlet.Cp = PP.LiquidCp(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z); "Cold Stream Outlet Heat Capacity" Properties.Cold.Outlet.Cp = PP.LiquidCp(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z); "Cold Stream Average Mass Density" Properties.Cold.Average.rho = PP.LiquidDensity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z); "Cold Stream Inlet Mass Density" Properties.Cold.Inlet.rho = PP.LiquidDensity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z); "Cold Stream Outlet Mass Density" Properties.Cold.Outlet.rho = PP.LiquidDensity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z); "Cold Stream Average Viscosity" Properties.Cold.Average.Mu = PP.LiquidViscosity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z); "Cold Stream inlet Viscosity" Properties.Cold.Inlet.Mu = PP.LiquidViscosity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z); "Cold Stream Outlet Viscosity" Properties.Cold.Outlet.Mu = PP.LiquidViscosity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z); "Cold Stream Average Conductivity" Properties.Cold.Average.K = PP.LiquidThermalConductivity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z); "Cold Stream Inlet Conductivity" Properties.Cold.Inlet.K = PP.LiquidThermalConductivity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z); "Cold Stream Outlet Conductivity" Properties.Cold.Outlet.K = PP.LiquidThermalConductivity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z); "Cold Stream Heat Capacity at Wall Temperature" Properties.Cold.Wall.Cp = PP.LiquidCp(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z); "Cold Stream Viscosity at Wall Temperature" Properties.Cold.Wall.Mu = PP.LiquidViscosity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z); "Cold Stream Conductivity at Wall Temperature" Properties.Cold.Wall.K = PP.LiquidThermalConductivity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z); else "Cold Stream Average Heat Capacity" Properties.Cold.Average.Cp = PP.VapourCp(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z); "Cold Stream Inlet Heat Capacity" Properties.Cold.Inlet.Cp = PP.VapourCp(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z); "Cold Stream Outlet Heat Capacity" Properties.Cold.Outlet.Cp = PP.VapourCp(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z); "Cold Stream Average Mass Density" Properties.Cold.Average.rho = PP.VapourDensity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z); "Cold Stream Inlet Mass Density" Properties.Cold.Inlet.rho = PP.VapourDensity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z); "Cold Stream Outlet Mass Density" Properties.Cold.Outlet.rho = PP.VapourDensity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z); "Cold Stream Average Viscosity " Properties.Cold.Average.Mu = PP.VapourViscosity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z); "Cold Stream Inlet Viscosity " Properties.Cold.Inlet.Mu = PP.VapourViscosity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z); "Cold Stream Outlet Viscosity " Properties.Cold.Outlet.Mu = PP.VapourViscosity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z); "Cold Stream Average Conductivity " Properties.Cold.Average.K = PP.VapourThermalConductivity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z); "Cold Stream Inlet Conductivity " Properties.Cold.Inlet.K = PP.VapourThermalConductivity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z); "Cold Stream Outlet Conductivity " Properties.Cold.Outlet.K = PP.VapourThermalConductivity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z); "Cold Stream Heat Capacity at Wall Temperature" Properties.Cold.Wall.Cp = PP.VapourCp(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z); "Cold Stream Viscosity at Wall Temperature" Properties.Cold.Wall.Mu = PP.VapourViscosity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z); "Cold Stream Conductivity at Wall Temperature" Properties.Cold.Wall.K = PP.VapourThermalConductivity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z); end if Inlet.Hot.v equal 0 then "Hot Stream Average Heat Capacity" Properties.Hot.Average.Cp = PP.LiquidCp(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z); "Hot Stream Inlet Heat Capacity" Properties.Hot.Inlet.Cp = PP.LiquidCp(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z); "Hot Stream Outlet Heat Capacity" Properties.Hot.Outlet.Cp = PP.LiquidCp(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z); "Hot Stream Average Mass Density" Properties.Hot.Average.rho = PP.LiquidDensity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z); "Hot Stream Inlet Mass Density" Properties.Hot.Inlet.rho = PP.LiquidDensity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z); "Hot Stream Outlet Mass Density" Properties.Hot.Outlet.rho = PP.LiquidDensity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z); "Hot Stream Average Viscosity" Properties.Hot.Average.Mu = PP.LiquidViscosity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z); "Hot Stream Inlet Viscosity" Properties.Hot.Inlet.Mu = PP.LiquidViscosity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z); "Hot Stream Outlet Viscosity" Properties.Hot.Outlet.Mu = PP.LiquidViscosity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z); "Hot Stream Average Conductivity" Properties.Hot.Average.K = PP.LiquidThermalConductivity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z); "Hot Stream Inlet Conductivity" Properties.Hot.Inlet.K = PP.LiquidThermalConductivity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z); "Hot Stream Outlet Conductivity" Properties.Hot.Outlet.K = PP.LiquidThermalConductivity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z); "Hot Stream Heat Capacity at Wall Temperature" Properties.Hot.Wall.Cp = PP.LiquidCp(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z); "Hot Stream Viscosity at Wall Temperature" Properties.Hot.Wall.Mu = PP.LiquidViscosity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z); "Hot Stream Conductivity at Wall Temperature" Properties.Hot.Wall.K = PP.LiquidThermalConductivity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z); else "Hot Stream Average Heat Capacity" Properties.Hot.Average.Cp = PP.VapourCp(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z); "Hot Stream Inlet Heat Capacity" Properties.Hot.Inlet.Cp = PP.VapourCp(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z); "Hot Stream Outlet Heat Capacity" Properties.Hot.Outlet.Cp = PP.VapourCp(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z); "Hot Stream Average Mass Density" Properties.Hot.Average.rho = PP.VapourDensity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z); "Hot Stream Inlet Mass Density" Properties.Hot.Inlet.rho = PP.VapourDensity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z); "Hot Stream Outlet Mass Density" Properties.Hot.Outlet.rho = PP.VapourDensity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z); "Hot Stream Average Viscosity" Properties.Hot.Average.Mu = PP.VapourViscosity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z); "Hot Stream Inlet Viscosity" Properties.Hot.Inlet.Mu = PP.VapourViscosity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z); "Hot Stream Outlet Viscosity" Properties.Hot.Outlet.Mu = PP.VapourViscosity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z); "Hot Stream Average Conductivity" Properties.Hot.Average.K = PP.VapourThermalConductivity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z); "Hot Stream Inlet Conductivity" Properties.Hot.Inlet.K = PP.VapourThermalConductivity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z); "Hot Stream Outlet Conductivity" Properties.Hot.Outlet.K = PP.VapourThermalConductivity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z); "Hot Stream Heat Capacity at Wall Temperature" Properties.Hot.Wall.Cp = PP.VapourCp(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z); "Hot Stream Viscosity at Wall Temperature" Properties.Hot.Wall.Mu = PP.VapourViscosity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z); "Hot Stream Conductivity at Wall Temperature" Properties.Hot.Wall.K = PP.VapourThermalConductivity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z); end #===================================================================== # Thermal Details #===================================================================== "Hot Stream Heat Capacity" Details.Ch =Inlet.Hot.F*Properties.Hot.Average.Cp; "Cold Stream Heat Capacity" Details.Cc =Inlet.Cold.F*Properties.Cold.Average.Cp; "Minimum Heat Capacity" Details.Cmin = min([Details.Ch,Details.Cc]); "Maximum Heat Capacity" Details.Cmax = max([Details.Ch,Details.Cc]); "Heat Capacity Ratio" Details.Cr = Details.Cmin/Details.Cmax; #===================================================================== # Energy Balance #===================================================================== "Energy Balance Hot Stream" Details.Q = Inlet.Hot.F*(Inlet.Hot.h-Outlet.Hot.h); "Energy Balance Cold Stream" Details.Q =-Inlet.Cold.F*(Inlet.Cold.h-Outlet.Cold.h); #===================================================================== # Material Balance #===================================================================== "Flow Mass Inlet Cold Stream" Properties.Cold.Inlet.Fw = sum(M*Inlet.Cold.z)*Inlet.Cold.F; "Flow Mass Outlet Cold Stream" Properties.Cold.Outlet.Fw = sum(M*Outlet.Cold.z)*Outlet.Cold.F; "Flow Mass Inlet Hot Stream" Properties.Hot.Inlet.Fw = sum(M*Inlet.Hot.z)*Inlet.Hot.F; "Flow Mass Outlet Hot Stream" Properties.Hot.Outlet.Fw = sum(M*Outlet.Hot.z)*Outlet.Hot.F; "Molar Balance Hot Stream" Inlet.Hot.F = Outlet.Hot.F; "Molar Balance Cold Stream" Inlet.Cold.F = Outlet.Cold.F; #====================================== # Constraints #====================================== "Hot Stream Molar Fraction Constraint" Outlet.Hot.z=Inlet.Hot.z; "Cold Stream Molar Fraction Constraint" Outlet.Cold.z=Inlet.Cold.z; "No Phase Change In Cold Stream" Inlet.Cold.v=Outlet.Cold.v; "No Phase Change In Hot Stream" Inlet.Hot.v=Outlet.Hot.v; #====================================== # Pressure Drop #====================================== "Pressure Drop Hot Stream" Outlet.Hot.P = Inlet.Hot.P - PressureDrop.Hot.Pdrop; "Pressure Drop Cold Stream" Outlet.Cold.P = Inlet.Cold.P - PressureDrop.Cold.Pdrop; "Fraction of Inlet Pressure : Hot Stream" PressureDrop.Hot.Pdrop = Inlet.Hot.P*PressureDrop.Hot.FPdrop; "Fraction of Inlet Pressure : Cold Stream" PressureDrop.Cold.Pdrop = Inlet.Cold.P*PressureDrop.Cold.FPdrop; end Model Heatex_Basic_NTU as HeatExchangerSimplified_Basic #===================================================================== # Basic Model for Heat Exchangers - NTU Method #===================================================================== VARIABLES Eft as positive (Brief="Effectiveness",Default=0.05,Lower=1e-8); EQUATIONS "Energy Balance" Details.Q = Eft*Details.Cmin*(Inlet.Hot.T-Inlet.Cold.T); end Model Heatex_Basic_LMTD as HeatExchangerSimplified_Basic #===================================================================== # Basic Model for Heat Exchangers - LMTD Method #===================================================================== VARIABLES DT0 as temp_delta (Brief="Temperature Difference at Inlet",Lower=1); DTL as temp_delta (Brief="Temperature Difference at Outlet",Lower=1); LMTD as temp_delta (Brief="Logarithmic Mean Temperature Difference",Lower=1); Fc as positive (Brief="LMTD Correction Factor",Lower=0.5); MTD as temp_delta (Brief="Mean Temperature Difference",Lower=1); EQUATIONS #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# # Log Mean Temperature Difference #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# 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 "Exchange Surface Area" Details.Q = Details.Ud*Details.A*MTD; "Mean Temperature Difference" MTD = Fc*LMTD; end #===================================================================== # Concrete Models for Simplified Heat Exchangers #===================================================================== #===================================================================== # LMTD Method #===================================================================== Model HeatExchanger_LMTD as Heatex_Basic_LMTD PARAMETERS Side as Integer (Brief="Flow Direction",Lower=0,Upper=1); SET Side = HE.FlowDir(); # Return Flow Direction EQUATIONS #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# # Flow Direction #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# if Side equal 0 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# # Cocurrent Flow #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# then "Temperature Difference at Inlet" DT0 = Inlet.Hot.T - Inlet.Cold.T; "Temperature Difference at Outlet" DTL = Outlet.Hot.T - Outlet.Cold.T; else #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# # Counter Flow #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# "Temperature Difference at Inlet" DT0 = Inlet.Hot.T - Outlet.Cold.T; "Temperature Difference at Outlet" DTL = Outlet.Hot.T - Inlet.Cold.T; end end Model E_Shell_LMTD as Heatex_Basic_LMTD #===================================================================== # Shell and Tubes Heat Exchanger with 1 shell pass - LMTD Method #===================================================================== EQUATIONS "Temperature Difference at Inlet" DT0 = Inlet.Hot.T - Outlet.Cold.T; "Temperature Difference at Outlet" DTL = Outlet.Hot.T - Inlet.Cold.T; "LMTD Correction Factor" Fc = HE.EshellCorrectionFactor(Inlet.Hot.T,Outlet.Hot.T,Inlet.Cold.T,Outlet.Cold.T); end Model F_Shell_LMTD as Heatex_Basic_LMTD #===================================================================== # Shell and Tubes Heat Exchanger with 2 shell passes - LMTD Method #===================================================================== EQUATIONS "Temperature Difference at Inlet" DT0 = Inlet.Hot.T - Outlet.Cold.T; "Temperature Difference at Outlet" DTL = Outlet.Hot.T - Inlet.Cold.T; "LMTD Correction Factor" Fc = HE.FshellCorrectionFactor(Inlet.Hot.T,Outlet.Hot.T,Inlet.Cold.T,Outlet.Cold.T); end #===================================================================== # NTU Method #===================================================================== Model HeatExchanger_NTU as Heatex_Basic_NTU PARAMETERS Side as Integer (Brief="Flow Direction",Lower=0,Upper=1); SET Side = HE.FlowDir(); # Return Flow Direction EQUATIONS if Details.Cr equal 0 then "Effectiveness" Eft = 1-exp(-Details.NTU); else if Side equal 0 then "Effectiveness in Cocurrent Flow" Eft = (1-exp(-Details.NTU*(1+Details.Cr)))/(1+Details.Cr); else if Details.Cr equal 1 then "Effectiveness in Counter Flow" Eft = Details.NTU/(1+Details.NTU); else "Effectiveness in Counter Flow" Eft*(1-Details.Cr*exp(-Details.NTU*(1-Details.Cr))) = (1-exp(-Details.NTU*(1-Details.Cr))); end end end end Model E_Shell_NTU as Heatex_Basic_NTU #===================================================================== # Shell and Tubes Heat Exchanger with 1 shell pass - NTU Method #===================================================================== EQUATIONS "TEMA E Shell Effectiveness" Eft = 2*(1+Details.Cr+sqrt(1+Details.Cr^2)*((1+exp(-Details.NTU*sqrt(1+Details.Cr^2)))/(1-exp(-Details.NTU*sqrt(1+Details.Cr^2)))) )^-1; end Model F_Shell_NTU as Heatex_Basic_NTU #===================================================================== # Shell and Tubes Heat Exchanger with 2 shell passes - NTU Method #===================================================================== VARIABLES Eft1 as positive (Brief="Effectiveness Correction",Lower=0.01,Upper=1,Default=0.5); EQUATIONS "Effectiveness Correction" Eft1 = 2*(1+Details.Cr+sqrt(1+Details.Cr^2)*((1+exp(-Details.NTU*sqrt(1+Details.Cr^2)))/(1-exp(-Details.NTU*sqrt(1+Details.Cr^2)))) )^-1; "TEMA F Shell Effectiveness" Eft = ( ((1-Eft1*Details.Cr)/(1-Eft1))^2 -1 )*( ((1-Eft1*Details.Cr)/(1-Eft1))^2 - Details.Cr )^-1; end