#*------------------------------------------------------------------- * 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 149 2007-02-05 11:31:00Z bicca $ *--------------------------------------------------------------------*# using "HEX_Engine"; Model HeatExchangerSimplified_Basic ATTRIBUTES Pallete = false; Brief = "Basic Models for Simplified Heat Exchangers"; Info = "write some information"; PARAMETERS outer PP as Plugin (Brief="External Physical Properties"); outer NComp as Integer (Brief="Number of Components"); M(NComp) as molweight (Brief="Component Mol Weight"); VARIABLES in Inlet as Inlet_Main_Stream (Brief="Hot and Cold Inlets"); out Outlet as Outlet_Main_Stream (Brief="Hot and Cold Outlets"); Properties as Main_Properties (Brief="Hot and Cold Properties"); Details as Details_Main (Brief="Heat Exchanger Details"); PressureDrop as Main_Pdrop (Brief="Heat Exchanger Pressure Drop"); 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; #====================================== # 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 ATTRIBUTES Pallete = false; Brief = "Basic Model for Heat Exchangers - NTU Method"; Info = "write some information"; VARIABLES Eft as positive (Brief="Effectiveness",Default=0.05,Lower=1e-8, Upper=1); EQUATIONS "Energy Balance" Details.Q = Eft*Details.Cmin*(Inlet.Hot.T-Inlet.Cold.T); end Model Heatex_Basic_LMTD as HeatExchangerSimplified_Basic ATTRIBUTES Pallete = false; Brief = "Basic Model for Heat Exchangers - LMTD Method"; Info = "write some information"; 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 Model HeatExchanger_LMTD as Heatex_Basic_LMTD ATTRIBUTES Pallete = true; Brief = "Heat Exchanger Block - LMTD Method"; Info = "write some information"; PARAMETERS FlowDirection as Switcher(Brief="Flow Direction",Valid=["counter","cocurrent"],Default="cocurrent"); EQUATIONS switch FlowDirection case "cocurrent": "Temperature Difference at Inlet" DT0 = Inlet.Hot.T - Inlet.Cold.T; "Temperature Difference at Outlet" DTL = Outlet.Hot.T - Outlet.Cold.T; case "counter": "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 Shell_and_Tubes_LMTD as Heatex_Basic_LMTD ATTRIBUTES Pallete = true; Brief = "Shell and Tubes Heat Exchanger with 1 or 2 shell pass - LMTD Method"; Info = "write some information"; PARAMETERS LMTDcorrection as Switcher(Brief="LMTD Correction Factor Model",Valid=["Bowmann","Fakeri"],Default="Bowmann"); ShellType as Switcher(Brief="TEMA Designation",Valid=["Eshell","Fshell"],Default="Eshell"); VARIABLES 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); lambdaN as Real (Brief="Non - Dimensional Variable for LMTD Correction Fator in Fakeri Equation when 2 Pass Shell Side"); lambda1 as Real (Brief="Non - Dimensional Variable for LMTD Correction Fator in Fakeri Equationwhen 2 Pass Shell Side"); EQUATIONS "R: Capacity Ratio for LMTD Correction Fator" R*(Outlet.Cold.T - Inlet.Cold.T ) = (Inlet.Hot.T-Outlet.Hot.T); "P: Non - Dimensional Variable for LMTD Correction Fator" P*(Inlet.Hot.T- Inlet.Cold.T)= (Outlet.Cold.T-Inlet.Cold.T); "Temperature Difference at Inlet" DT0 = Inlet.Hot.T - Outlet.Cold.T; "Temperature Difference at Outlet" DTL = Outlet.Hot.T - Inlet.Cold.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" 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" 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(((Inlet.Hot.T - Outlet.Hot.T)*(Inlet.Hot.T- Outlet.Hot.T))+((Outlet.Cold.T - Inlet.Cold.T)*(Outlet.Cold.T - Inlet.Cold.T))))/(2*((Inlet.Hot.T + Outlet.Hot.T)-( Inlet.Cold.T + Outlet.Cold.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" 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" 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" 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" 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(((Inlet.Hot.T- Outlet.Hot.T)*(Inlet.Hot.T- Outlet.Hot.T))+((Outlet.Cold.T - Inlet.Cold.T)*(Outlet.Cold.T - Inlet.Cold.T))))/(2*((Inlet.Hot.T+ Outlet.Hot.T)-(Inlet.Cold.T+ Outlet.Cold.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" Fc = (4*Phi)/(ln(abs((1+2*Phi)/(1-2*Phi)))); else "LMTD Correction Fator when 1 Pass Shell Side" 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 Heatex_Basic_NTU ATTRIBUTES Pallete = true; Brief = "Heat Exchanger Block - NTU Method"; Info = "write some information"; PARAMETERS FlowDirection as Switcher(Brief="Flow Direction",Valid=["counter","cocurrent"],Default="cocurrent"); EQUATIONS if Details.Cr equal 0 then Eft = 1-exp(-Details.NTU); else switch FlowDirection case "cocurrent": "Effectiveness in Cocurrent Flow" Eft = (1-exp(-Details.NTU*(1+Details.Cr)))/(1+Details.Cr); case "counter": 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 Shell_and_Tubes_NTU as Heatex_Basic_NTU ATTRIBUTES Pallete = true; Brief = "Shell and Tubes Heat Exchanger with 1 or 2 shell pass - NTU Method"; Info = "write some information"; PARAMETERS ShellType as Switcher(Brief="TEMA Designation",Valid=["Eshell","Fshell"],Default="Eshell"); VARIABLES Eft1 as positive (Brief="Effectiveness Correction",Lower=0.01,Upper=1,Default=0.5); EQUATIONS switch ShellType case "Fshell": "Effectiveness Correction for 2 pass shell side" 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; case "Eshell": "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; "Variable not in use when 1 Pass Shell Side" Eft1 = Eft; end end