# Changeset 110

Ignore:
Timestamp:
Jan 12, 2007, 4:44:02 PM (15 years ago)
Message:

modified some equations

Location:
mso
Files:
8 edited

Unmodified
Removed
• ## mso/eml/heat_exchangers/DoublePipe.mso

 r105 "Heat Capacity Ratio" Details.Cr*Details.Cmax   = Details.Cmin; #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# #-------------------------------------------------------------------- #       Energy Balance #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# #-------------------------------------------------------------------- "Energy Balance Hot Stream" Details.Q = Inlet.Hot.F*(Inlet.Hot.h-Outlet.Hot.h); #       Material Balance #-------------------------------------------------------------------- "Flow Mass Inlet Cold Stream" Properties.Cold.Inlet.Fw        =  sum(M*Inlet.Cold.z)*Inlet.Cold.F; "Inner Pipe Resistance" Unity(i).Resistances.Rtube = DoInner/(Unity(i).Inner.HeatTransfer.hcoeff*DiInner); Unity(i).Resistances.Rtube*(Unity(i).Inner.HeatTransfer.hcoeff*DiInner) = DoInner; "Wall Resistance"
• ## mso/eml/heat_exchangers/HEX_Engine.mso

 r100 Hot     as stream; # Inlet Hot Stream Cold    as stream; # Inlet Cold Stream end Hot     as stream_therm;  # Outlet Hot Stream Cold    as stream_therm;  # Outlet Cold Stream end rho             as dens_mass            (Brief="Stream Density" ,Default=1000, Lower=1e-3, Upper=5e5); Mu              as viscosity            (Brief="Stream Viscosity",Lower=0.0001); Cp              as cp_mol                       (Brief="Stream Molar Heat Capacity", Upper=10e10); Cp              as cp_mol                       (Brief="Stream Molar Heat Capacity", Upper=1e10); K               as conductivity         (Brief="Stream Thermal Conductivity", Default=1.0, Lower=1e-5, Upper=500); end rho             as dens_mass    (Brief="Stream Density" ,Default=1000, Lower=1e-3, Upper=5e5); Mu              as viscosity    (Brief="Stream Viscosity",Default=1, Lower=1e-5, Upper=1e5); Cp              as cp_mol               (Brief="Stream Molar Heat Capacity", Upper=10e10); Cp              as cp_mol               (Brief="Stream Molar Heat Capacity", Upper=1e10); K               as conductivity (Brief="Stream Thermal Conductivity", Default=1.0, Lower=1e-5, Upper=500); end VARIABLES Mu              as viscosity    (Brief="Stream Viscosity",Default=1, Lower=1e-5, Upper=1e5); Cp              as cp_mol               (Brief="Stream Molar Heat Capacity", Upper=10e10); Cp              as cp_mol               (Brief="Stream Molar Heat Capacity", Upper=1e10); K               as conductivity (Brief="Stream Thermal Conductivity", Default=1.0, Lower=1e-5, Upper=500); Twall   as temperature  (Brief="Wall Temperature",Lower=50); end Outlet          as Properties_In_Out;           # Properties at Outlet Stream Wall            as Properties_Wall;                     # Properties at Wall Temperature end Phi   as positive                 (Brief="Phi Correction",Default=1,Lower=1e-3); Vtube as velocity                 (Brief="Tube Side Velocity",Lower=1e-8); end #===================================================================== VARIABLES Rtube   as positive     (Brief="Tube Resistance",Unit="m^2*K/kW",Lower=1e-6); Rwall   as positive     (Brief="Wall Resistance",Unit="m^2*K/kW",Lower=1e-6); Rfi             as positive     (Brief="Inside Fouling Resistance",Unit="m^2*K/kW",Default=1e-6,Lower=0); Rfo             as positive     (Brief="Outside Fouling Resistance",Unit="m^2*K/kW",Default=1e-6,Lower=0); end "Number of Units Transference" NTU*Cmin = Ud*A; end PressureDrop    as Tube_Pdrop;                  #Tube Side Pressure Drop HeatTransfer    as Tube_Heat_Transfer;  #Tube Side Heat Transfer end PressureDrop    as Shell_Pdrop;                 # Shell Side Pressure Drop HeatTransfer    as Shell_Heat_Transfer; # Shell Side Heat Transfer end Pdrop   as press_delta  (Brief="Pressure Drop",Default=0.01, Lower=0); FPdrop  as Real                 (Brief="Pressure Drop : Fraction of Inlet",Lower=0,Upper=0.8); end Hot     as Basic_Pdrop;# Hot Stream Cold    as Basic_Pdrop;# Cold Stream end Phi     as positive                     (Brief="Phi Correction",Default=1,Lower=1e-3); Vmean   as velocity                     (Brief="Tube Velocity",Lower=1e-8); end fi      as fricfactor   (Brief="Friction Factor", Default=0.05, Lower=1e-10, Upper=2000); Re              as positive             (Brief="Reynolds Number",Default=100,Lower=1); end HeatTransfer as DoublePipe_HeatTransfer; PressureDrop as DoublePipe_PressureDrop; end end
• ## mso/eml/heat_exchangers/HeatExchangerDetailed.mso

 r100 Donozzle_Shell  as length               (Brief="Shell Outlet Nozzle Diameter",Lower=10e-6); Dinozzle_Shell  as length               (Brief="Shell Inlet Nozzle Diameter",Lower=10e-6); Aonozzle_Shell  as area                 (Brief="Shell Outlet Nozzle Area",Lower=10e-6); Ainozzle_Shell  as area                 (Brief="Shell Inlet Nozzle Area",Lower=10e-6); Aeonozzle_Shell as area                 (Brief="Shell Outlet Escape Area Under Nozzle",Lower=10e-6); Aeinozzle_Shell as area                 (Brief="Shell Inlet Escape Area Under Nozzle",Lower=10e-6); Hinozzle_Shell  as length               (Brief="Height Under Shell Inlet Nozzle",Lower=10e-6); Honozzle_Shell  as length               (Brief="Height Under Shell Outlet Nozzle",Lower=10e-6); Ditube            as length                     (Brief="Tube Inside Diameter",Lower=10e-6); Donozzle_Tube as length                 (Brief="Tube Outlet Nozzle Diameter",Lower=10e-6); Dinozzle_Tube as length                 (Brief="Tube Inlett Nozzle Diameter",Lower=10e-6); Dinozzle_Tube as length                 (Brief="Tube Inlet Nozzle Diameter",Lower=10e-6); Aonozzle_Tube as area                   (Brief="Tube Outlet Nozzle Area",Lower=10e-6); Ainozzle_Tube as area                   (Brief="Tube Inlet Nozzle Area",Lower=10e-6); Kinlet_Tube   as positive               (Brief="Tube Inlet Nozzle Pressure Loss Coeff",Default=1.1); Koutlet_Tube  as positive               (Brief="Tube Outlet Nozzle Pressure Loss Coeff",Default=0.7); #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# side                            = HE.FluidAlocation(); #"Tube Side Inlet Nozzle Area" Ainozzle_Tube = (Pi*Dinozzle_Tube*Dinozzle_Tube)/4; #"Tube Side Outlet Nozzle Area" Aonozzle_Tube = (Pi*Donozzle_Tube*Donozzle_Tube)/4; #"Tube Inlet Nozzle Pressure Loss Coeff" Kinlet_Tube   = 1.1; #"Tube Outlet Nozzle Pressure Loss Coeff" Koutlet_Tube  = 0.7; #"Shell Outlet Nozzle Area" Aonozzle_Shell  = (Pi*Donozzle_Shell*Donozzle_Shell)/4; #"Shell Inlet Nozzle Area" Ainozzle_Shell  = (Pi*Dinozzle_Shell*Dinozzle_Shell)/4; #"Shell Outlet Escape Area Under Nozzle" Aeonozzle_Shell = Pi*Donozzle_Shell*Honozzle_Shell + 0.6*Aonozzle_Shell*(1-Dotube/pitch); #"Shell Inlet Escape Area Under Nozzle" Aeinozzle_Shell = Pi*Dinozzle_Shell*Hinozzle_Shell + 0.6*Ainozzle_Shell*(1-Dotube/pitch); EQUATIONS #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# #                                        Nozzles rho-V^2                                                                # #                               Pressure Drop and Velocities                                    # #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# if side equal 1 then "Tube Side Pressure Drop" Tubes.PressureDrop.PdTube               = HE.DeltaPtube(Tubes.HeatTransfer.Re,Properties.Cold.Average.rho,Tubes.HeatTransfer.Vtube,Tubes.HeatTransfer.Phi); "Pressure Drop Tube Side Inlet Nozzle" Tubes.PressureDrop.Pdnozzle_in  = 0.5*Kinlet_Tube*Properties.Cold.Inlet.rho*Tubes.PressureDrop.Vnozzle_in^2; "Velocity Tube Side Inlet Nozzle" Tubes.PressureDrop.Vnozzle_in   = Properties.Cold.Inlet.Fw/(Properties.Cold.Inlet.rho*Ainozzle_Tube); "Pressure Drop Tube Side Outlet Nozzle" Tubes.PressureDrop.Pdnozzle_out = 0.5*Koutlet_Tube*Properties.Cold.Outlet.rho*Tubes.PressureDrop.Vnozzle_out^2; "Velocity Tube Side Outlet Nozzle" Tubes.PressureDrop.Vnozzle_out  = Properties.Cold.Inlet.Fw/(Properties.Cold.Outlet.rho*Aonozzle_Tube); "Shell Pressure Drop Inlet Nozzle" Shell.PressureDrop.Pdnozzle_in  = (0.5*Properties.Hot.Inlet.Fw^2/Properties.Hot.Inlet.rho)*((1/Ainozzle_Shell^2)+(1/Aeinozzle_Shell^2)); "Velocity Shell Side Inlet Nozzle" Shell.PressureDrop.Vnozzle_in   = Properties.Hot.Inlet.Fw/(Properties.Hot.Inlet.rho*Ainozzle_Shell); "Shell Pressure Drop Outlet Nozzle" Shell.PressureDrop.Pdnozzle_out = (0.5*Properties.Hot.Outlet.Fw^2/Properties.Hot.Outlet.rho)*((1/Ainozzle_Shell^2)+(1/Aeinozzle_Shell^2)); "Velocity Shell Side Outlet Nozzle" Shell.PressureDrop.Vnozzle_out  = Properties.Hot.Outlet.Fw/(Properties.Hot.Outlet.rho*Aonozzle_Shell); "Pressure Drop Hot Stream" Outlet.Hot.P  = Inlet.Hot.P - Shell.PressureDrop.Pdtotal; "Pressure Drop Cold Stream" Outlet.Cold.P  = Inlet.Cold.P - Tubes.PressureDrop.Pdtotal; else "Tube Side Pressure Drop" Tubes.PressureDrop.PdTube               = HE.DeltaPtube(Tubes.HeatTransfer.Re,Properties.Hot.Average.rho,Tubes.HeatTransfer.Vtube,Tubes.HeatTransfer.Phi); "Pressure Drop Tube Side Inlet Nozzle" Tubes.PressureDrop.Pdnozzle_in  = 0.5*Kinlet_Tube*Properties.Hot.Inlet.rho*Tubes.PressureDrop.Vnozzle_in^2; "Velocity Tube Side Inlet Nozzle" Tubes.PressureDrop.Vnozzle_in   = Properties.Hot.Inlet.Fw/(Properties.Hot.Inlet.rho*Ainozzle_Tube); "Pressure Drop Tube Side Outlet Nozzle" Tubes.PressureDrop.Pdnozzle_out = 0.5*Koutlet_Tube*Properties.Hot.Outlet.rho*Tubes.PressureDrop.Vnozzle_out^2; "Velocity Tube Side Outlet Nozzle" Tubes.PressureDrop.Vnozzle_out  = Properties.Hot.Inlet.Fw/(Properties.Hot.Outlet.rho*Aonozzle_Tube); "Shell Pressure Drop Inlet Nozzle" Shell.PressureDrop.Pdnozzle_in  = (0.5*Properties.Cold.Inlet.Fw^2/Properties.Cold.Inlet.rho)*((1/Ainozzle_Shell^2)+(1/Aeinozzle_Shell^2)); "Velocity Shell Side Inlet Nozzle" Shell.PressureDrop.Vnozzle_in   = Properties.Cold.Inlet.Fw/(Properties.Cold.Inlet.rho*Ainozzle_Shell); "Shell Pressure Drop Outlet Nozzle" Shell.PressureDrop.Pdnozzle_out = (0.5*Properties.Cold.Outlet.Fw^2/Properties.Cold.Outlet.rho)*((1/Ainozzle_Shell^2)+(1/Aeinozzle_Shell^2)); "Velocity Shell Side Outlet Nozzle" Shell.PressureDrop.Vnozzle_out  = Properties.Cold.Outlet.Fw/(Properties.Cold.Outlet.rho*Ainozzle_Shell); "Pressure Drop Hot Stream" Outlet.Hot.P  = Inlet.Hot.P- Tubes.PressureDrop.Pdtotal; "Pressure Drop Cold Stream" Outlet.Cold.P  = Inlet.Cold.P - Shell.PressureDrop.Pdtotal; end #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# #                               Nozzles rho-V^2                                                                 # #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# #                                        Phi correction                                                                 # #                               Phi correction                                                                  # #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# end #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# #                                                                                                                                       # #                                                                                                                                       # #                                                                                                                                       # #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#                                                                                                                                   # #                               Heat Transfer                                                                           #                                                                                                                                       # #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# Shell.HeatTransfer.PRw          = ((Properties.Hot.Wall.Cp/Properties.Hot.Average.Mw)*Properties.Hot.Wall.Mu)/Properties.Hot.Wall.K; "Tube Side Pressure Drop" Tubes.PressureDrop.PdTube               = HE.DeltaPtube(Tubes.HeatTransfer.Re,Properties.Cold.Average.rho,Tubes.HeatTransfer.Vtube,Tubes.HeatTransfer.Phi); "Pressure Drop Tube Side Inlet Nozzle" Tubes.PressureDrop.Pdnozzle_in  = HE.DeltaPtubeNozzlein(Properties.Cold.Inlet.rho,Properties.Cold.Inlet.Fw); "Velocity Tube Side Inlet Nozzle" Tubes.PressureDrop.Vnozzle_in   = HE.TubeVelocityNozzlein(Properties.Cold.Inlet.rho,Properties.Cold.Inlet.Fw); "Pressure Drop Tube Side Outlet Nozzle" Tubes.PressureDrop.Pdnozzle_out = HE.DeltaPtubeNozzleout(Properties.Cold.Outlet.rho,Properties.Cold.Inlet.Fw); "Velocity Tube Side Outlet Nozzle" Tubes.PressureDrop.Vnozzle_out  = HE.TubeVelocityNozzleout(Properties.Cold.Outlet.rho,Properties.Cold.Inlet.Fw); "Shell Pressure Drop Inlet Nozzle" Shell.PressureDrop.Pdnozzle_in  = HE.DeltaPshellNozzleIn(Properties.Hot.Inlet.rho,Properties.Hot.Inlet.Fw); "Velocity Shell Side Inlet Nozzle" Shell.PressureDrop.Vnozzle_in   = HE.ShellVelocityNozzleIn(Properties.Hot.Inlet.rho,Properties.Hot.Inlet.Fw); "Shell Pressure Drop Outlet Nozzle" Shell.PressureDrop.Pdnozzle_out = HE.DeltaPshellNozzleOut(Properties.Hot.Outlet.rho,Properties.Hot.Inlet.Fw); "Velocity Shell Side Outlet Nozzle" Shell.PressureDrop.Vnozzle_out  =HE.ShellVelocityNozzleOut(Properties.Hot.Outlet.rho,Properties.Hot.Inlet.Fw); "Pressure Drop Hot Stream" Outlet.Hot.P  = Inlet.Hot.P- Shell.PressureDrop.Pdtotal; "Pressure Drop Cold Stream" Outlet.Cold.P  = Inlet.Cold.P - Tubes.PressureDrop.Pdtotal; else "Tube Side Velocity" Tubes.HeatTransfer.Vtube  = Properties.Hot.Inlet.Fw*Tpass/((Pi*Ditube*Ditube/4)*Properties.Hot.Average.rho*Ntt); Tubes.HeatTransfer.Vtube        =       Properties.Hot.Inlet.Fw*Tpass/((Pi*Ditube*Ditube/4)*Properties.Hot.Average.rho*Ntt); "Tube Side Reynolds Number" Tubes.HeatTransfer.Re=(Properties.Hot.Average.rho*Tubes.HeatTransfer.Vtube*Ditube)/Properties.Hot.Average.Mu; Tubes.HeatTransfer.Re           =       (Properties.Hot.Average.rho*Tubes.HeatTransfer.Vtube*Ditube)/Properties.Hot.Average.Mu; "Tube Side Prandtl Number" Shell.HeatTransfer.PRw=((Properties.Cold.Wall.Cp/Properties.Cold.Average.Mw)*Properties.Cold.Wall.Mu)/Properties.Cold.Wall.K; "Tube Side Pressure Drop" Tubes.PressureDrop.PdTube               = HE.DeltaPtube(Tubes.HeatTransfer.Re,Properties.Hot.Average.rho,Tubes.HeatTransfer.Vtube,Tubes.HeatTransfer.Phi); "Pressure Drop Tube Side Inlet Nozzle" Tubes.PressureDrop.Pdnozzle_in  = HE.DeltaPtubeNozzlein(Properties.Hot.Inlet.rho,Properties.Hot.Inlet.Fw); "Velocity Tube Side Inlet Nozzle" Tubes.PressureDrop.Vnozzle_in   = HE.TubeVelocityNozzlein(Properties.Hot.Inlet.rho,Properties.Hot.Inlet.Fw); "Pressure Drop Tube Side Outlet Nozzle" Tubes.PressureDrop.Pdnozzle_out = HE.DeltaPtubeNozzleout(Properties.Hot.Outlet.rho,Properties.Hot.Inlet.Fw); "Velocity Tube Side Outlet Nozzle" Tubes.PressureDrop.Vnozzle_out  = HE.TubeVelocityNozzleout(Properties.Hot.Outlet.rho,Properties.Hot.Inlet.Fw); "Shell Pressure Drop Inlet Nozzle" Shell.PressureDrop.Pdnozzle_in  = HE.DeltaPshellNozzleIn(Properties.Cold.Inlet.rho,Properties.Cold.Inlet.Fw); "Velocity Shell Side Inlet Nozzle" Shell.PressureDrop.Vnozzle_in   = HE.ShellVelocityNozzleIn(Properties.Cold.Inlet.rho,Properties.Cold.Inlet.Fw); "Shell Pressure Drop Outlet Nozzle" Shell.PressureDrop.Pdnozzle_out = HE.DeltaPshellNozzleOut(Properties.Cold.Outlet.rho,Properties.Cold.Inlet.Fw); "Velocity Shell Side Outlet Nozzle" Shell.PressureDrop.Vnozzle_out  = HE.ShellVelocityNozzleOut(Properties.Cold.Outlet.rho,Properties.Cold.Inlet.Fw); "Pressure Drop Hot Stream" Outlet.Hot.P  = Inlet.Hot.P- Tubes.PressureDrop.Pdtotal; "Pressure Drop Cold Stream" Outlet.Cold.P  = Inlet.Cold.P - Shell.PressureDrop.Pdtotal; end #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# #                                               Resistances                                                                     # #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# end "Tube Resistance" "Shell Resistance" Resistances.Rshell*(Shell.HeatTransfer.hshell)=1; #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# #                                                                                                                                       # #                                                                                                                                       # #                                                                                                                                       # #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# "Shell Side Cross Flow Area" Hinozzle_Shell  as length               (Brief="Height Under Shell Inlet Nozzle",Lower=10e-6); Honozzle_Shell  as length               (Brief="Height Under Shell Outlet Nozzle",Lower=10e-6); Aonozzle_Shell  as area                 (Brief="Shell Outlet Nozzle Area",Lower=10e-6); Ainozzle_Shell  as area                 (Brief="Shell Inlet Nozzle Area",Lower=10e-6); Aeonozzle_Shell as area                 (Brief="Shell Outlet Escape Area Under Nozzle",Lower=10e-6); Aeinozzle_Shell as area                 (Brief="Shell Inlet Escape Area Under Nozzle",Lower=10e-6); Lcf                     as length               (Brief="Bundle-to-Shell Clearance",Lower=10e-8); #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# Donozzle_Tube   as length               (Brief="Tube Outlet Nozzle Diameter",Lower=10e-6); Dinozzle_Tube   as length               (Brief="Tube Inlett Nozzle Diameter",Lower=10e-6); Aonozzle_Tube   as area                 (Brief="Tube Outlet Nozzle Area",Lower=10e-6); Ainozzle_Tube   as area                 (Brief="Tube Inlet Nozzle Area",Lower=10e-6); Kinlet_Tube     as positive             (Brief="Tube Inlet Nozzle Pressure Loss Coeff",Default=1.1); Koutlet_Tube    as positive             (Brief="Tube Outlet Nozzle Pressure Loss Coeff",Default=0.7); #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# #       Baffles Geometrical Parameters Unity(Nshell) as HeatExchangerDetailed_Basic;# "Shell in Series" CONNECTIONS Unity([1:Nshell-1]).Outlet.Hot  to Unity([2:Nshell]).Inlet.Hot; Unity([2:Nshell]).Outlet.Cold   to Unity([1:Nshell-1]).Inlet.Cold; EQUATIONS for i in [1:Nshell] "Shell Side Cross Flow Area" Unity(i).Shell.HeatTransfer.Sm = HE.CrossFlowArea(Unity(i).Baffles.Ls); "Ji Factor" Unity(i).Shell.HeatTransfer.Ji =HE.JiFactor(Unity(i).Shell.HeatTransfer.Re); "Jc Factor" Unity(i).Shell.HeatTransfer.Jc = HE.JcFactor(); "Jl Factor" Unity(i).Shell.HeatTransfer.Jl = HE.JlFactor(Unity(i).Shell.HeatTransfer.Sm); "Jb Factor" Unity(i).Shell.HeatTransfer.Jb = HE.JbFactor(Unity(i).Shell.HeatTransfer.Re,Unity(i).Baffles.Ls,Unity(i).Shell.HeatTransfer.Sm); "Jr Factor" Unity(i).Shell.HeatTransfer.Jr = HE.JrFactor(Unity(i).Shell.HeatTransfer.Re); "Total J Factor" Unity(i).Shell.HeatTransfer.Jtotal=Unity(i).Shell.HeatTransfer.Jc*Unity(i).Shell.HeatTransfer.Jl*Unity(i).Shell.HeatTransfer.Jb*Unity(i).Shell.HeatTransfer.Jr*Unity(i).Shell.HeatTransfer.Js; #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# #  Fluid Alocation #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# if side equal 1 then "Shell Side Phi correction for viscosity" Unity(i).Shell.HeatTransfer.Phi = HE.PhiCorrection(Unity(i).Properties.Hot.Average.Mu,Unity(i).Properties.Hot.Wall.Mu); "Tube Side Phi correction for viscosity" Unity(i).Tubes.HeatTransfer.Phi  = HE.PhiCorrection(Unity(i).Properties.Cold.Average.Mu,Unity(i).Properties.Cold.Wall.Mu); else "Shell Side Phi correction for viscosity" Unity(i).Shell.HeatTransfer.Phi = HE.PhiCorrection(Unity(i).Properties.Cold.Average.Mu,Unity(i).Properties.Cold.Wall.Mu); "Tube Side Phi correction for viscosity" Unity(i).Tubes.HeatTransfer.Phi  = HE.PhiCorrection(Unity(i).Properties.Hot.Average.Mu,Unity(i).Properties.Hot.Average.Mu); end if side equal 1 then "Hot Wall Temperature" Unity(i).Properties.Hot.Wall.Twall  = (Unity(i).Properties.Hot.Average.T+Unity(i).Properties.Cold.Average.T)/2; "Cold Wall Temperature" Unity(i).Properties.Cold.Wall.Twall  = (Unity(i).Properties.Hot.Average.T+Unity(i).Properties.Cold.Average.T)/2; "Tube Side Velocity" Unity(i).Tubes.HeatTransfer.Vtube  = Unity(i).Properties.Cold.Inlet.Fw*Tpass/((Pi*Ditube*Ditube/4)*Unity(i).Properties.Cold.Average.rho*Ntt); "Tube Side Reynolds Number" Unity(i).Tubes.HeatTransfer.Re=(Unity(i).Properties.Cold.Average.rho*Unity(i).Tubes.HeatTransfer.Vtube*Ditube)/Unity(i).Properties.Cold.Average.Mu; "Tube Side Prandtl Number" Unity(i).Tubes.HeatTransfer.PR = ((Unity(i).Properties.Cold.Average.Cp/Unity(i).Properties.Cold.Average.Mw)*Unity(i).Properties.Cold.Average.Mu)/Unity(i).Properties.Cold.Average.K; "Tube Side Prandtl Number at Wall Temperature" Unity(i).Tubes.HeatTransfer.PRw = ((Unity(i).Properties.Cold.Wall.Cp/Unity(i).Properties.Cold.Average.Mw)*Unity(i).Properties.Cold.Wall.Mu)/Unity(i).Properties.Cold.Wall.K; "Tube Side Film Coefficient" Unity(i).Tubes.HeatTransfer.htube= HE.TubeFilmCoeff(Unity(i).Tubes.HeatTransfer.Re,Unity(i).Tubes.HeatTransfer.PR,Unity(i).Properties.Cold.Average.K)*Unity(i).Tubes.HeatTransfer.Phi; "Shell Side Prandtl Number" Unity(i).Shell.HeatTransfer.PR=((Unity(i).Properties.Hot.Average.Cp/Unity(i).Properties.Hot.Average.Mw)*Unity(i).Properties.Hot.Average.Mu)/Unity(i).Properties.Hot.Average.K; "Shell Side Prandtl Number at Wall Temperature" Unity(i).Shell.HeatTransfer.PRw = ((Unity(i).Properties.Hot.Wall.Cp/Unity(i).Properties.Hot.Average.Mw)*Unity(i).Properties.Hot.Wall.Mu)/Unity(i).Properties.Hot.Wall.K; "Tube Side Pressure Drop" Unity(i).Tubes.PressureDrop.PdTube              = HE.DeltaPtube(Unity(i).Tubes.HeatTransfer.Re,Unity(i).Properties.Cold.Average.rho,Unity(i).Tubes.HeatTransfer.Vtube,Unity(i).Tubes.HeatTransfer.Phi); "Pressure Drop Tube Side Inlet Nozzle" Unity(i).Tubes.PressureDrop.Pdnozzle_in = HE.DeltaPtubeNozzlein(Unity(i).Properties.Cold.Inlet.rho,Unity(i).Properties.Cold.Inlet.Fw); "Velocity Tube Side Inlet Nozzle" Unity(i).Tubes.PressureDrop.Vnozzle_in  = HE.TubeVelocityNozzlein(Unity(i).Properties.Cold.Inlet.rho,Unity(i).Properties.Cold.Inlet.Fw); "Pressure Drop Tube Side Outlet Nozzle" Unity(i).Tubes.PressureDrop.Pdnozzle_out        = HE.DeltaPtubeNozzleout(Unity(i).Properties.Cold.Outlet.rho,Unity(i).Properties.Cold.Inlet.Fw); "Velocity Tube Side Outlet Nozzle" Unity(i).Tubes.PressureDrop.Vnozzle_out = HE.TubeVelocityNozzleout(Unity(i).Properties.Cold.Outlet.rho,Unity(i).Properties.Cold.Inlet.Fw); "Shell Pressure Drop Inlet Nozzle" Unity(i).Shell.PressureDrop.Pdnozzle_in = HE.DeltaPshellNozzleIn(Unity(i).Properties.Hot.Inlet.rho,Unity(i).Properties.Hot.Inlet.Fw); "Velocity Shell Side Inlet Nozzle" Unity(i).Shell.PressureDrop.Vnozzle_in  = HE.ShellVelocityNozzleIn(Unity(i).Properties.Hot.Inlet.rho,Unity(i).Properties.Hot.Inlet.Fw); "Shell Pressure Drop Outlet Nozzle" Unity(i).Shell.PressureDrop.Pdnozzle_out        =HE.DeltaPshellNozzleOut(Unity(i).Properties.Hot.Outlet.rho,Unity(i).Properties.Hot.Inlet.Fw); "Velocity Shell Side Outlet Nozzle" Unity(i).Shell.PressureDrop.Vnozzle_out =HE.ShellVelocityNozzleOut(Unity(i).Properties.Hot.Outlet.rho,Unity(i).Properties.Hot.Inlet.Fw); "Pressure Drop Hot Stream" Unity(i).Outlet.Hot.P  = Unity(i).Inlet.Hot.P- Unity(i).Shell.PressureDrop.Pdtotal; "Pressure Drop Cold Stream" Unity(i).Outlet.Cold.P  = Unity(i).Inlet.Cold.P - Unity(i).Tubes.PressureDrop.Pdtotal; else "Hot Wall Temperature" Unity(i).Properties.Hot.Wall.Twall  = (Unity(i).Properties.Hot.Average.T+Unity(i).Properties.Cold.Average.T)/2; "Cold Wall Temperature" Unity(i).Properties.Cold.Wall.Twall  = (Unity(i).Properties.Hot.Average.T+Unity(i).Properties.Cold.Average.T)/2; "Tube Side Velocity" Unity(i).Tubes.HeatTransfer.Vtube  = Unity(i).Properties.Hot.Inlet.Fw*Tpass/((Pi*Ditube*Ditube/4)*Unity(i).Properties.Hot.Average.rho*Ntt); "Tube Side Reynolds Number" Unity(i).Tubes.HeatTransfer.Re          =       (Unity(i).Properties.Hot.Average.rho*Unity(i).Tubes.HeatTransfer.Vtube*Ditube)/Unity(i).Properties.Hot.Average.Mu; "Tube Side Prandtl Number" Unity(i).Tubes.HeatTransfer.PR          =       ((Unity(i).Properties.Hot.Average.Cp/Unity(i).Properties.Hot.Average.Mw)*Unity(i).Properties.Hot.Average.Mu)/Unity(i).Properties.Hot.Average.K; "Tube Side Prandtl Number at Wall" Unity(i).Tubes.HeatTransfer.PRw     =  ((Unity(i).Properties.Hot.Wall.Cp/Unity(i).Properties.Hot.Average.Mw)*Unity(i).Properties.Hot.Wall.Mu)/Unity(i).Properties.Hot.Wall.K; "Tube Side Film Coefficient" Unity(i).Tubes.HeatTransfer.htube       =       HE.TubeFilmCoeff(Unity(i).Tubes.HeatTransfer.Re,Unity(i).Tubes.HeatTransfer.PR,Unity(i).Properties.Hot.Average.K)*Unity(i).Tubes.HeatTransfer.Phi; "Shell Side Prandtl Number" Unity(i).Shell.HeatTransfer.PR          =       ((Unity(i).Properties.Cold.Average.Cp/Unity(i).Properties.Cold.Average.Mw)*Unity(i).Properties.Cold.Average.Mu)/Unity(i).Properties.Cold.Average.K; "Shell Side Prandtl Number at Wall" Unity(i).Shell.HeatTransfer.PRw     =   ((Unity(i).Properties.Cold.Wall.Cp/Unity(i).Properties.Cold.Average.Mw)*Unity(i).Properties.Cold.Wall.Mu)/Unity(i).Properties.Cold.Wall.K; "Tube Side Pressure Drop" Unity(i).Tubes.PressureDrop.PdTube      =       HE.DeltaPtube(Unity(i).Tubes.HeatTransfer.Re,Unity(i).Properties.Hot.Average.rho,Unity(i).Tubes.HeatTransfer.Vtube,Unity(i).Tubes.HeatTransfer.Phi); "Pressure Drop Tube Side Inlet Nozzle" Unity(i).Tubes.PressureDrop.Pdnozzle_in = HE.DeltaPtubeNozzlein(Unity(i).Properties.Hot.Inlet.rho,Unity(i).Properties.Hot.Inlet.Fw); "Velocity Tube Side Inlet Nozzle" Unity(i).Tubes.PressureDrop.Vnozzle_in  = HE.TubeVelocityNozzlein(Unity(i).Properties.Hot.Inlet.rho,Unity(i).Properties.Hot.Inlet.Fw); "Pressure Drop Tube Side Outlet Nozzle" Unity(i).Tubes.PressureDrop.Pdnozzle_out        = HE.DeltaPtubeNozzleout(Unity(i).Properties.Hot.Outlet.rho,Unity(i).Properties.Hot.Inlet.Fw); "Velocity Tube Side Outlet Nozzle" Unity(i).Tubes.PressureDrop.Vnozzle_out = HE.TubeVelocityNozzleout(Unity(i).Properties.Hot.Outlet.rho,Unity(i).Properties.Hot.Inlet.Fw); "Shell Pressure Drop Inlet Nozzle" Unity(i).Shell.PressureDrop.Pdnozzle_in = HE.DeltaPshellNozzleIn(Unity(i).Properties.Cold.Inlet.rho,Unity(i).Properties.Cold.Inlet.Fw); "Velocity Shell Side Inlet Nozzle" Unity(i).Shell.PressureDrop.Vnozzle_in  = HE.ShellVelocityNozzleIn(Unity(i).Properties.Cold.Inlet.rho,Unity(i).Properties.Cold.Inlet.Fw); "Shell Pressure Drop Outlet Nozzle" Unity(i).Shell.PressureDrop.Pdnozzle_out = HE.DeltaPshellNozzleOut(Unity(i).Properties.Cold.Outlet.rho,Unity(i).Properties.Cold.Inlet.Fw); "Velocity Shell Side Outlet Nozzle" Unity(i).Shell.PressureDrop.Vnozzle_out  = HE.ShellVelocityNozzleOut(Unity(i).Properties.Cold.Outlet.rho,Unity(i).Properties.Cold.Inlet.Fw); "Pressure Drop Hot Stream" Unity(i).Outlet.Hot.P  = Unity(i).Inlet.Hot.P- Unity(i).Tubes.PressureDrop.Pdtotal; "Pressure Drop Cold Stream" Unity(i).Outlet.Cold.P  = Unity(i).Inlet.Cold.P - Unity(i).Shell.PressureDrop.Pdtotal; end if side equal 1 then "Shell Side inlet Nozzle rho-V^2" Unity(i).Shell.PressureDrop.RVsquare_in = Unity(i).Properties.Hot.Inlet.rho*(Unity(i).Shell.PressureDrop.Vnozzle_in)^2; "Shell Side Outlet Nozzle rho-V^2" Unity(i).Shell.PressureDrop.RVsquare_out = Unity(i).Properties.Hot.Outlet.rho*(Unity(i).Shell.PressureDrop.Vnozzle_out)^2; else "Shell Side inlet Nozzle rho-V^2" Unity(i).Shell.PressureDrop.RVsquare_in = Unity(i).Properties.Cold.Inlet.rho*(Unity(i).Shell.PressureDrop.Vnozzle_in)^2; "Shell Side Outlet Nozzle rho-V^2" Unity(i).Shell.PressureDrop.RVsquare_out = Unity(i).Properties.Cold.Outlet.rho*(Unity(i).Shell.PressureDrop.Vnozzle_out)^2; end "Tube Resistance" Unity(i).Resistances.Rtube*(Unity(i).Tubes.HeatTransfer.htube*Ditube) = Dotube; "Wall Resistance" Unity(i).Resistances.Rwall=Dotube*ln(Dotube/Ditube)/(2*Kwall); "Shell Resistance" Unity(i).Resistances.Rshell*(Unity(i).Shell.HeatTransfer.hshell)=1; "Overall Heat Transfer Coefficient Clean" Unity(i).Details.Uc=1/(Dotube/(Unity(i).Tubes.HeatTransfer.htube*Ditube)+(Dotube*ln(Dotube/Ditube)/(2*Kwall))+(1/(Unity(i).Shell.HeatTransfer.hshell))); "Overall Heat Transfer Coefficient Dirty" (1/Unity(i).Details.Ud)=(1/Unity(i).Details.Uc)+Unity(i).Resistances.Rfo+Unity(i).Resistances.Rfi*(Dotube/Ditube); "Exchange Surface Area" Unity(i).Details.A=Pi*Dotube*Ntt*Ltube; "Baffles Spacing" Ltube = Unity(i).Baffles.Lsi+Unity(i).Baffles.Lso+Unity(i).Baffles.Ls*(Nb-1); "TEMA E Shell Effectiveness" Eft(i) = 2*(1+Unity(i).Details.Cr+sqrt(1+Unity(i).Details.Cr^2)*((1+exp(-Unity(i).Details.NTU*sqrt(1+Unity(i).Details.Cr^2)))/(1-exp(-Unity(i).Details.NTU*sqrt(1+Unity(i).Details.Cr^2)))) )^-1; "Js Factor" Unity(i).Shell.HeatTransfer.Js = HE.JsFactor(Unity(i).Shell.HeatTransfer.Re,Unity(i).Baffles.Lsi,Unity(i).Baffles.Lso,Unity(i).Baffles.Ls); if side equal 1 then "Shell Side Reynolds Number" Unity(i).Shell.HeatTransfer.Re=(Dotube*Unity(i).Properties.Hot.Inlet.Fw/Unity(i).Shell.HeatTransfer.Sm)/Unity(i).Properties.Hot.Average.Mu; "Shell Heat Transfer Coefficient" Unity(i).Shell.HeatTransfer.hshell=Unity(i).Shell.HeatTransfer.Ji*(Unity(i).Properties.Hot.Average.Cp/Unity(i).Properties.Hot.Average.Mw)*(Unity(i).Properties.Hot.Inlet.Fw/Unity(i).Shell.HeatTransfer.Sm)*(Unity(i).Shell.HeatTransfer.PR^(-2/3))*Unity(i).Shell.HeatTransfer.Jtotal*Unity(i).Shell.HeatTransfer.Phi; "Shell Pressure Drop Cross Flow" Unity(i).Shell.PressureDrop.PdCross             = HE.DeltaPcross(Unity(i).Shell.HeatTransfer.Re,Unity(i).Baffles.Ls,Unity(i).Baffles.Lso,Unity(i).Baffles.Lsi,Unity(i).Properties.Hot.Inlet.Fw,Unity(i).Shell.HeatTransfer.Phi,Unity(i).Properties.Hot.Average.rho); "Shell Pressure Baffle Window" Unity(i).Shell.PressureDrop.Pdwindow            = HE.DeltaPwindow(Unity(i).Properties.Hot.Inlet.Fw,Unity(i).Shell.HeatTransfer.Sm,Unity(i).Properties.Hot.Average.rho,Unity(i).Properties.Hot.Average.Mu,Unity(i).Baffles.Ls); "Shell Pressure End Zones" Unity(i).Shell.PressureDrop.PdEndZones  = HE.DeltaPendZones(Unity(i).Shell.HeatTransfer.Re,Unity(i).Baffles.Ls,Unity(i).Baffles.Lso,Unity(i).Baffles.Lsi,Unity(i).Properties.Hot.Inlet.Fw,Unity(i).Shell.HeatTransfer.Phi,Unity(i).Properties.Hot.Average.rho); else "Shell Side Reynolds Number" Unity(i).Shell.HeatTransfer.Re=(Dotube*Unity(i).Properties.Cold.Inlet.Fw/Unity(i).Shell.HeatTransfer.Sm)/Unity(i).Properties.Cold.Average.Mu; "Shell Heat Transfer Coefficient" Unity(i).Shell.HeatTransfer.hshell=Unity(i).Shell.HeatTransfer.Ji*(Unity(i).Properties.Cold.Average.Cp/Unity(i).Properties.Cold.Average.Mw)*(Unity(i).Properties.Cold.Inlet.Fw/Unity(i).Shell.HeatTransfer.Sm)*(Unity(i).Shell.HeatTransfer.PR^(-2/3))*Unity(i).Shell.HeatTransfer.Jtotal*Unity(i).Shell.HeatTransfer.Phi; "Shell Pressure Drop Cross Flow" Unity(i).Shell.PressureDrop.PdCross      = HE.DeltaPcross(Unity(i).Shell.HeatTransfer.Re,Unity(i).Baffles.Ls,Unity(i).Baffles.Lso,Unity(i).Baffles.Lsi,Unity(i).Properties.Cold.Inlet.Fw,Unity(i).Shell.HeatTransfer.Phi,Unity(i).Properties.Cold.Average.rho); "Shell Pressure Baffle Window" Unity(i).Shell.PressureDrop.Pdwindow     = HE.DeltaPwindow(Unity(i).Properties.Cold.Inlet.Fw,Unity(i).Shell.HeatTransfer.Sm,Unity(i).Properties.Cold.Average.rho,Unity(i).Properties.Cold.Average.Mu,Unity(i).Baffles.Ls); "Shell Pressure End Zones" Unity(i).Shell.PressureDrop.PdEndZones  = HE.DeltaPendZones(Unity(i).Shell.HeatTransfer.Re,Unity(i).Baffles.Ls,Unity(i).Baffles.Lso,Unity(i).Baffles.Lsi,Unity(i).Properties.Cold.Inlet.Fw,Unity(i).Shell.HeatTransfer.Phi,Unity(i).Properties.Cold.Average.rho); end "Duty" Unity(i).Details.Q      = Eft(i)*Unity(i).Details.Cmin*(Unity(i).Inlet.Hot.T-Unity(i).Inlet.Cold.T); end SET SET #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# #  Set Parameters for heatex Calculation HE.Ltd                          = Ltd; side                            = HE.FluidAlocation(); #"Tube Side Inlet Nozzle Area" Ainozzle_Tube = (Pi*Dinozzle_Tube*Dinozzle_Tube)/4; #"Tube Side Outlet Nozzle Area" Aonozzle_Tube = (Pi*Donozzle_Tube*Donozzle_Tube)/4; #"Tube Inlet Nozzle Pressure Loss Coeff" Kinlet_Tube   = 1.1; #"Tube Outlet Nozzle Pressure Loss Coeff" Koutlet_Tube  = 0.7; #"Shell Outlet Nozzle Area" Aonozzle_Shell  = (Pi*Donozzle_Shell*Donozzle_Shell)/4; #"Shell Inlet Nozzle Area" Ainozzle_Shell  = (Pi*Dinozzle_Shell*Dinozzle_Shell)/4; #"Shell Outlet Escape Area Under Nozzle" Aeonozzle_Shell = Pi*Donozzle_Shell*Honozzle_Shell + 0.6*Aonozzle_Shell*(1-Dotube/pitch); #"Shell Inlet Escape Area Under Nozzle" Aeinozzle_Shell = Pi*Dinozzle_Shell*Hinozzle_Shell + 0.6*Ainozzle_Shell*(1-Dotube/pitch); CONNECTIONS Unity([1:Nshell-1]).Outlet.Hot  to Unity([2:Nshell]).Inlet.Hot; Unity([2:Nshell]).Outlet.Cold   to Unity([1:Nshell-1]).Inlet.Cold; EQUATIONS for i in [1:Nshell] "Shell Side Cross Flow Area" Unity(i).Shell.HeatTransfer.Sm = HE.CrossFlowArea(Unity(i).Baffles.Ls); "Ji Factor" Unity(i).Shell.HeatTransfer.Ji =HE.JiFactor(Unity(i).Shell.HeatTransfer.Re); "Jc Factor" Unity(i).Shell.HeatTransfer.Jc = HE.JcFactor(); "Jl Factor" Unity(i).Shell.HeatTransfer.Jl = HE.JlFactor(Unity(i).Shell.HeatTransfer.Sm); "Jb Factor" Unity(i).Shell.HeatTransfer.Jb = HE.JbFactor(Unity(i).Shell.HeatTransfer.Re,Unity(i).Baffles.Ls,Unity(i).Shell.HeatTransfer.Sm); "Jr Factor" Unity(i).Shell.HeatTransfer.Jr = HE.JrFactor(Unity(i).Shell.HeatTransfer.Re); "Total J Factor" Unity(i).Shell.HeatTransfer.Jtotal=Unity(i).Shell.HeatTransfer.Jc*Unity(i).Shell.HeatTransfer.Jl*Unity(i).Shell.HeatTransfer.Jb*Unity(i).Shell.HeatTransfer.Jr*Unity(i).Shell.HeatTransfer.Js; #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# #               Pressure Drop and Velocities #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# if side equal 1 then "Tube Side Pressure Drop" Unity(i).Tubes.PressureDrop.PdTube              = HE.DeltaPtube(Unity(i).Tubes.HeatTransfer.Re,Unity(i).Properties.Cold.Average.rho,Unity(i).Tubes.HeatTransfer.Vtube,Unity(i).Tubes.HeatTransfer.Phi); "Pressure Drop Tube Side Inlet Nozzle" Unity(i).Tubes.PressureDrop.Pdnozzle_in = 0.5*Kinlet_Tube*Unity(i).Properties.Cold.Inlet.rho*Unity(i).Tubes.PressureDrop.Vnozzle_in^2; "Velocity Tube Side Inlet Nozzle" Unity(i).Tubes.PressureDrop.Vnozzle_in  = Unity(i).Properties.Cold.Inlet.Fw/(Unity(i).Properties.Cold.Inlet.rho*Ainozzle_Tube); "Pressure Drop Tube Side Outlet Nozzle" Unity(i).Tubes.PressureDrop.Pdnozzle_out        = 0.5*Koutlet_Tube*Unity(i).Properties.Cold.Outlet.rho*Unity(i).Tubes.PressureDrop.Vnozzle_out^2; "Velocity Tube Side Outlet Nozzle" Unity(i).Tubes.PressureDrop.Vnozzle_out = Unity(i).Properties.Cold.Inlet.Fw/(Unity(i).Properties.Cold.Outlet.rho*Aonozzle_Tube); "Shell Pressure Drop Inlet Nozzle" Unity(i).Shell.PressureDrop.Pdnozzle_in = (0.5*Unity(i).Properties.Hot.Inlet.Fw^2/Unity(i).Properties.Hot.Inlet.rho)*((1/Ainozzle_Shell^2)+(1/Aeinozzle_Shell^2)); "Velocity Shell Side Inlet Nozzle" Unity(i).Shell.PressureDrop.Vnozzle_in  = Unity(i).Properties.Hot.Inlet.Fw/(Unity(i).Properties.Hot.Inlet.rho*Ainozzle_Shell); "Shell Pressure Drop Outlet Nozzle" Unity(i).Shell.PressureDrop.Pdnozzle_out        = (0.5*Unity(i).Properties.Hot.Outlet.Fw^2/Unity(i).Properties.Hot.Outlet.rho)*((1/Ainozzle_Shell^2)+(1/Aeinozzle_Shell^2)); "Velocity Shell Side Outlet Nozzle" Unity(i).Shell.PressureDrop.Vnozzle_out = Unity(i).Properties.Hot.Outlet.Fw/(Unity(i).Properties.Hot.Outlet.rho*Aonozzle_Shell); "Pressure Drop Hot Stream" Unity(i).Outlet.Hot.P  = Unity(i).Inlet.Hot.P - Unity(i).Shell.PressureDrop.Pdtotal; "Pressure Drop Cold Stream" Unity(i).Outlet.Cold.P  = Unity(i).Inlet.Cold.P - Unity(i).Tubes.PressureDrop.Pdtotal; else "Tube Side Pressure Drop" Unity(i).Tubes.PressureDrop.PdTube              = HE.DeltaPtube(Unity(i).Tubes.HeatTransfer.Re,Unity(i).Properties.Hot.Average.rho,Unity(i).Tubes.HeatTransfer.Vtube,Unity(i).Tubes.HeatTransfer.Phi); "Pressure Drop Tube Side Inlet Nozzle" Unity(i).Tubes.PressureDrop.Pdnozzle_in = 0.5*Kinlet_Tube*Unity(i).Properties.Hot.Inlet.rho*Unity(i).Tubes.PressureDrop.Vnozzle_in^2; "Velocity Tube Side Inlet Nozzle" Unity(i).Tubes.PressureDrop.Vnozzle_in  = Unity(i).Properties.Hot.Inlet.Fw/(Unity(i).Properties.Hot.Inlet.rho*Ainozzle_Tube); "Pressure Drop Tube Side Outlet Nozzle" Unity(i).Tubes.PressureDrop.Pdnozzle_out        = 0.5*Koutlet_Tube*Unity(i).Properties.Hot.Outlet.rho*Unity(i).Tubes.PressureDrop.Vnozzle_out^2; "Velocity Tube Side Outlet Nozzle" Unity(i).Tubes.PressureDrop.Vnozzle_out = Unity(i).Properties.Hot.Inlet.Fw/(Unity(i).Properties.Hot.Outlet.rho*Aonozzle_Tube); "Shell Pressure Drop Inlet Nozzle" Unity(i).Shell.PressureDrop.Pdnozzle_in = (0.5*Unity(i).Properties.Cold.Inlet.Fw^2/Unity(i).Properties.Cold.Inlet.rho)*((1/Ainozzle_Shell^2)+(1/Aeinozzle_Shell^2)); "Velocity Shell Side Inlet Nozzle" Unity(i).Shell.PressureDrop.Vnozzle_in  = Unity(i).Properties.Cold.Inlet.Fw/(Unity(i).Properties.Cold.Inlet.rho*Ainozzle_Shell); "Shell Pressure Drop Outlet Nozzle" Unity(i).Shell.PressureDrop.Pdnozzle_out = (0.5*Unity(i).Properties.Cold.Outlet.Fw^2/Unity(i).Properties.Cold.Outlet.rho)*((1/Ainozzle_Shell^2)+(1/Aeinozzle_Shell^2)); "Velocity Shell Side Outlet Nozzle" Unity(i).Shell.PressureDrop.Vnozzle_out  = Unity(i).Properties.Cold.Outlet.Fw/(Unity(i).Properties.Cold.Outlet.rho*Ainozzle_Shell); "Pressure Drop Hot Stream" Unity(i).Outlet.Hot.P  = Unity(i).Inlet.Hot.P- Unity(i).Tubes.PressureDrop.Pdtotal; "Pressure Drop Cold Stream" Unity(i).Outlet.Cold.P  = Unity(i).Inlet.Cold.P - Unity(i).Shell.PressureDrop.Pdtotal; end #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# #               Phi correction #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# if side equal 1 then "Shell Side Phi correction for viscosity" Unity(i).Shell.HeatTransfer.Phi = HE.PhiCorrection(Unity(i).Properties.Hot.Average.Mu,Unity(i).Properties.Hot.Wall.Mu); "Tube Side Phi correction for viscosity" Unity(i).Tubes.HeatTransfer.Phi  = HE.PhiCorrection(Unity(i).Properties.Cold.Average.Mu,Unity(i).Properties.Cold.Wall.Mu); else "Shell Side Phi correction for viscosity" Unity(i).Shell.HeatTransfer.Phi = HE.PhiCorrection(Unity(i).Properties.Cold.Average.Mu,Unity(i).Properties.Cold.Wall.Mu); "Tube Side Phi correction for viscosity" Unity(i).Tubes.HeatTransfer.Phi  = HE.PhiCorrection(Unity(i).Properties.Hot.Average.Mu,Unity(i).Properties.Hot.Average.Mu); end if side equal 1 then "Shell Side inlet Nozzle rho-V^2" Unity(i).Shell.PressureDrop.RVsquare_in = Unity(i).Properties.Hot.Inlet.rho*(Unity(i).Shell.PressureDrop.Vnozzle_in)^2; "Shell Side Outlet Nozzle rho-V^2" Unity(i).Shell.PressureDrop.RVsquare_out = Unity(i).Properties.Hot.Outlet.rho*(Unity(i).Shell.PressureDrop.Vnozzle_out)^2; else "Shell Side inlet Nozzle rho-V^2" Unity(i).Shell.PressureDrop.RVsquare_in = Unity(i).Properties.Cold.Inlet.rho*(Unity(i).Shell.PressureDrop.Vnozzle_in)^2; "Shell Side Outlet Nozzle rho-V^2" Unity(i).Shell.PressureDrop.RVsquare_out = Unity(i).Properties.Cold.Outlet.rho*(Unity(i).Shell.PressureDrop.Vnozzle_out)^2; end if side equal 1 then "Hot Wall Temperature" Unity(i).Properties.Hot.Wall.Twall      = (Unity(i).Properties.Hot.Average.T+Unity(i).Properties.Cold.Average.T)/2; "ColdWall Temperature" Unity(i).Properties.Cold.Wall.Twall  = (Unity(i).Properties.Hot.Average.T+Unity(i).Properties.Cold.Average.T)/2; "Tube Side Velocity" Unity(i).Tubes.HeatTransfer.Vtube       = Unity(i).Properties.Cold.Inlet.Fw*Tpass/((Pi*Ditube*Ditube/4)*Unity(i).Properties.Cold.Average.rho*Ntt); "Tube Side Reynolds Number" Unity(i).Tubes.HeatTransfer.Re          = (Unity(i).Properties.Cold.Average.rho*Unity(i).Tubes.HeatTransfer.Vtube*Ditube)/Unity(i).Properties.Cold.Average.Mu; "Tube Side Prandtl Number" Unity(i).Tubes.HeatTransfer.PR          = ((Unity(i).Properties.Cold.Average.Cp/Unity(i).Properties.Cold.Average.Mw)*Unity(i).Properties.Cold.Average.Mu)/Unity(i).Properties.Cold.Average.K; "Tube Side Prandtl Number at Wall Temperature" Unity(i).Tubes.HeatTransfer.PRw                 = ((Unity(i).Properties.Cold.Wall.Cp/Unity(i).Properties.Cold.Average.Mw)*Unity(i).Properties.Cold.Wall.Mu)/Unity(i).Properties.Cold.Wall.K; "Tube Side Film Coefficient" Unity(i).Tubes.HeatTransfer.htube       = HE.TubeFilmCoeff(Unity(i).Tubes.HeatTransfer.Re,Unity(i).Tubes.HeatTransfer.PR,Unity(i).Properties.Cold.Average.K)*Unity(i).Tubes.HeatTransfer.Phi; "Shell Side Prandtl Number" Unity(i).Shell.HeatTransfer.PR          = ((Unity(i).Properties.Hot.Average.Cp/Unity(i).Properties.Hot.Average.Mw)*Unity(i).Properties.Hot.Average.Mu)/Unity(i).Properties.Hot.Average.K; "Shell Side Prandtl Number at Wall Temperature" Unity(i).Shell.HeatTransfer.PRw                 = ((Unity(i).Properties.Hot.Wall.Cp/Unity(i).Properties.Hot.Average.Mw)*Unity(i).Properties.Hot.Wall.Mu)/Unity(i).Properties.Hot.Wall.K; else "Hot Wall Temperature" Unity(i).Properties.Hot.Wall.Twall  = (Unity(i).Properties.Hot.Average.T+Unity(i).Properties.Cold.Average.T)/2; "Cold Wall Temperature" Unity(i).Properties.Cold.Wall.Twall  = (Unity(i).Properties.Hot.Average.T+Unity(i).Properties.Cold.Average.T)/2; "Tube Side Velocity" Unity(i).Tubes.HeatTransfer.Vtube       =       Unity(i).Properties.Hot.Inlet.Fw*Tpass/((Pi*Ditube*Ditube/4)*Unity(i).Properties.Hot.Average.rho*Ntt); "Tube Side Reynolds Number" Unity(i).Tubes.HeatTransfer.Re          =       (Unity(i).Properties.Hot.Average.rho*Unity(i).Tubes.HeatTransfer.Vtube*Ditube)/Unity(i).Properties.Hot.Average.Mu; "Tube Side Prandtl Number" Unity(i).Tubes.HeatTransfer.PR = ((Unity(i).Properties.Hot.Average.Cp/Unity(i).Properties.Hot.Average.Mw)*Unity(i).Properties.Hot.Average.Mu)/Unity(i).Properties.Hot.Average.K; "Tube Side Prandtl Number at Wall" Unity(i).Tubes.HeatTransfer.PRw = ((Unity(i).Properties.Hot.Wall.Cp/Unity(i).Properties.Hot.Average.Mw)*Unity(i).Properties.Hot.Wall.Mu)/Unity(i).Properties.Hot.Wall.K; "Tube Side Film Coefficient" Unity(i).Tubes.HeatTransfer.htube= HE.TubeFilmCoeff(Unity(i).Tubes.HeatTransfer.Re,Unity(i).Tubes.HeatTransfer.PR,Unity(i).Properties.Hot.Average.K)*Unity(i).Tubes.HeatTransfer.Phi; "Shell Side Prandtl Number" Unity(i).Shell.HeatTransfer.PR = ((Unity(i).Properties.Cold.Average.Cp/Unity(i).Properties.Cold.Average.Mw)*Unity(i).Properties.Cold.Average.Mu)/Unity(i).Properties.Cold.Average.K; "Shell Side Prandtl Number at Wall" Unity(i).Shell.HeatTransfer.PRw=((Unity(i).Properties.Cold.Wall.Cp/Unity(i).Properties.Cold.Average.Mw)*Unity(i).Properties.Cold.Wall.Mu)/Unity(i).Properties.Cold.Wall.K; end "Tube Resistance" Unity(i).Resistances.Rtube*(Unity(i).Tubes.HeatTransfer.htube*Ditube) = Dotube; "Wall Resistance" Unity(i).Resistances.Rwall=Dotube*ln(Dotube/Ditube)/(2*Kwall); "Shell Resistance" Unity(i).Resistances.Rshell*(Unity(i).Shell.HeatTransfer.hshell)=1; "Overall Heat Transfer Coefficient Clean" Unity(i).Details.Uc=1/(Dotube/(Unity(i).Tubes.HeatTransfer.htube*Ditube)+(Dotube*ln(Dotube/Ditube)/(2*Kwall))+(1/(Unity(i).Shell.HeatTransfer.hshell))); "Overall Heat Transfer Coefficient Dirty" (1/Unity(i).Details.Ud)=(1/Unity(i).Details.Uc)+Unity(i).Resistances.Rfo+Unity(i).Resistances.Rfi*(Dotube/Ditube); "Exchange Surface Area" Unity(i).Details.A=Pi*Dotube*Ntt*Ltube; "Baffles Spacing" Ltube = Unity(i).Baffles.Lsi+Unity(i).Baffles.Lso+Unity(i).Baffles.Ls*(Nb-1); "TEMA E Shell Effectiveness" Eft(i) = 2*(1+Unity(i).Details.Cr+sqrt(1+Unity(i).Details.Cr^2)*((1+exp(-Unity(i).Details.NTU*sqrt(1+Unity(i).Details.Cr^2)))/(1-exp(-Unity(i).Details.NTU*sqrt(1+Unity(i).Details.Cr^2)))) )^-1; "Js Factor" Unity(i).Shell.HeatTransfer.Js = HE.JsFactor(Unity(i).Shell.HeatTransfer.Re,Unity(i).Baffles.Lsi,Unity(i).Baffles.Lso,Unity(i).Baffles.Ls); if side equal 1 then "Shell Side Reynolds Number" Unity(i).Shell.HeatTransfer.Re=(Dotube*Unity(i).Properties.Hot.Inlet.Fw/Unity(i).Shell.HeatTransfer.Sm)/Unity(i).Properties.Hot.Average.Mu; "Shell Heat Transfer Coefficient" Unity(i).Shell.HeatTransfer.hshell=Unity(i).Shell.HeatTransfer.Ji*(Unity(i).Properties.Hot.Average.Cp/Unity(i).Properties.Hot.Average.Mw)*(Unity(i).Properties.Hot.Inlet.Fw/Unity(i).Shell.HeatTransfer.Sm)*(Unity(i).Shell.HeatTransfer.PR^(-2/3))*Unity(i).Shell.HeatTransfer.Jtotal*Unity(i).Shell.HeatTransfer.Phi; "Shell Pressure Drop Cross Flow" Unity(i).Shell.PressureDrop.PdCross             = HE.DeltaPcross(Unity(i).Shell.HeatTransfer.Re,Unity(i).Baffles.Ls,Unity(i).Baffles.Lso,Unity(i).Baffles.Lsi,Unity(i).Properties.Hot.Inlet.Fw,Unity(i).Shell.HeatTransfer.Phi,Unity(i).Properties.Hot.Average.rho); "Shell Pressure Baffle Window" Unity(i).Shell.PressureDrop.Pdwindow            = HE.DeltaPwindow(Unity(i).Properties.Hot.Inlet.Fw,Unity(i).Shell.HeatTransfer.Sm,Unity(i).Properties.Hot.Average.rho,Unity(i).Properties.Hot.Average.Mu,Unity(i).Baffles.Ls); "Shell Pressure End Zones" Unity(i).Shell.PressureDrop.PdEndZones  = HE.DeltaPendZones(Unity(i).Shell.HeatTransfer.Re,Unity(i).Baffles.Ls,Unity(i).Baffles.Lso,Unity(i).Baffles.Lsi,Unity(i).Properties.Hot.Inlet.Fw,Unity(i).Shell.HeatTransfer.Phi,Unity(i).Properties.Hot.Average.rho); else "Shell Side Reynolds Number" Unity(i).Shell.HeatTransfer.Re=(Dotube*Unity(i).Properties.Cold.Inlet.Fw/Unity(i).Shell.HeatTransfer.Sm)/Unity(i).Properties.Cold.Average.Mu; "Shell Heat Transfer Coefficient" Unity(i).Shell.HeatTransfer.hshell=Unity(i).Shell.HeatTransfer.Ji*(Unity(i).Properties.Cold.Average.Cp/Unity(i).Properties.Cold.Average.Mw)*(Unity(i).Properties.Cold.Inlet.Fw/Unity(i).Shell.HeatTransfer.Sm)*(Unity(i).Shell.HeatTransfer.PR^(-2/3))*Unity(i).Shell.HeatTransfer.Jtotal*Unity(i).Shell.HeatTransfer.Phi; "Shell Pressure Drop Cross Flow" Unity(i).Shell.PressureDrop.PdCross      = HE.DeltaPcross(Unity(i).Shell.HeatTransfer.Re,Unity(i).Baffles.Ls,Unity(i).Baffles.Lso,Unity(i).Baffles.Lsi,Unity(i).Properties.Cold.Inlet.Fw,Unity(i).Shell.HeatTransfer.Phi,Unity(i).Properties.Cold.Average.rho); "Shell Pressure Baffle Window" Unity(i).Shell.PressureDrop.Pdwindow     = HE.DeltaPwindow(Unity(i).Properties.Cold.Inlet.Fw,Unity(i).Shell.HeatTransfer.Sm,Unity(i).Properties.Cold.Average.rho,Unity(i).Properties.Cold.Average.Mu,Unity(i).Baffles.Ls); "Shell Pressure End Zones" Unity(i).Shell.PressureDrop.PdEndZones  = HE.DeltaPendZones(Unity(i).Shell.HeatTransfer.Re,Unity(i).Baffles.Ls,Unity(i).Baffles.Lso,Unity(i).Baffles.Lsi,Unity(i).Properties.Cold.Inlet.Fw,Unity(i).Shell.HeatTransfer.Phi,Unity(i).Properties.Cold.Average.rho); end "Duty" Unity(i).Details.Q      = Eft(i)*Unity(i).Details.Cmin*(Unity(i).Inlet.Hot.T-Unity(i).Inlet.Cold.T); end end Hinozzle_Shell  as length               (Brief="Height Under Shell Inlet Nozzle",Lower=10e-6); Honozzle_Shell  as length               (Brief="Height Under Shell Outlet Nozzle",Lower=10e-6); Aonozzle_Shell  as area                 (Brief="Shell Outlet Nozzle Area",Lower=10e-6); Ainozzle_Shell  as area                 (Brief="Shell Inlet Nozzle Area",Lower=10e-6); Aeonozzle_Shell as area                 (Brief="Shell Outlet Escape Area Under Nozzle",Lower=10e-6); Aeinozzle_Shell as area                 (Brief="Shell Inlet Escape Area Under Nozzle",Lower=10e-6); Lcf                     as length               (Brief="Bundle-to-Shell Clearance",Lower=10e-8); #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# Donozzle_Tube   as length               (Brief="Tube Outlet Nozzle Diameter",Lower=10e-6); Dinozzle_Tube   as length               (Brief="Tube Inlett Nozzle Diameter",Lower=10e-6); Aonozzle_Tube   as area                 (Brief="Tube Outlet Nozzle Area",Lower=10e-6); Ainozzle_Tube   as area                 (Brief="Tube Inlet Nozzle Area",Lower=10e-6); Kinlet_Tube     as positive             (Brief="Tube Inlet Nozzle Pressure Loss Coeff",Default=1.1); Koutlet_Tube    as positive             (Brief="Tube Outlet Nozzle Pressure Loss Coeff",Default=0.7); #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# #       Baffles Geometrical Parameters Unity(Nshell)           as HeatExchangerDetailed_Basic; CONNECTIONS Unity([1:Nshell-1]).Outlet.Hot  to Unity([2:Nshell]).Inlet.Hot; Unity([2:Nshell]).Outlet.Cold to Unity([1:Nshell-1]).Inlet.Cold; EQUATIONS for i in [1:Nshell] "Shell Side Cross Flow Area" Unity(i).Shell.HeatTransfer.Sm = HE.CrossFlowArea(Unity(i).Baffles.Ls); "Ji Factor" Unity(i).Shell.HeatTransfer.Ji = HE.JiFactor(Unity(i).Shell.HeatTransfer.Re); "Jc Factor" Unity(i).Shell.HeatTransfer.Jc = HE.JcFactor(); "Jl Factor" Unity(i).Shell.HeatTransfer.Jl = HE.JlFactor(Unity(i).Shell.HeatTransfer.Sm); "Jb Factor" Unity(i).Shell.HeatTransfer.Jb = HE.JbFactor(Unity(i).Shell.HeatTransfer.Re,Unity(i).Baffles.Ls,Unity(i).Shell.HeatTransfer.Sm); "Jr Factor" Unity(i).Shell.HeatTransfer.Jr = HE.JrFactor(Unity(i).Shell.HeatTransfer.Re); "Total J Factor" Unity(i).Shell.HeatTransfer.Jtotal=Unity(i).Shell.HeatTransfer.Jc*Unity(i).Shell.HeatTransfer.Jl*Unity(i).Shell.HeatTransfer.Jb*Unity(i).Shell.HeatTransfer.Jr*Unity(i).Shell.HeatTransfer.Js; #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# #  Fluid Alocation #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# if side equal 1 then "Shell Side Phi correction for viscosity" Unity(i).Shell.HeatTransfer.Phi = HE.PhiCorrection(Unity(i).Properties.Hot.Average.Mu,Unity(i).Properties.Hot.Wall.Mu); "Tube Side Phi correction for viscosity" Unity(i).Tubes.HeatTransfer.Phi  = HE.PhiCorrection(Unity(i).Properties.Cold.Average.Mu,Unity(i).Properties.Cold.Wall.Mu); else "Shell Side Phi correction for viscosity" Unity(i).Shell.HeatTransfer.Phi = HE.PhiCorrection(Unity(i).Properties.Cold.Average.Mu,Unity(i).Properties.Cold.Wall.Mu); "Tube Side Phi correction for viscosity" Unity(i).Tubes.HeatTransfer.Phi  = HE.PhiCorrection(Unity(i).Properties.Hot.Average.Mu,Unity(i).Properties.Hot.Wall.Mu); end if side equal 1 then "Cold Wall Temperature" Unity(i).Properties.Cold.Wall.Twall  = (Unity(i).Properties.Hot.Average.T+Unity(i).Properties.Cold.Average.T)/2; "Hot Wall Temperature" Unity(i).Properties.Hot.Wall.Twall  = (Unity(i).Properties.Hot.Average.T+Unity(i).Properties.Cold.Average.T)/2; "Tube Side Velocity" Unity(i).Tubes.HeatTransfer.Vtube  = Unity(i).Properties.Cold.Inlet.Fw*Tpass/((Pi*Ditube*Ditube/4)*Unity(i).Properties.Cold.Average.rho*Ntt); "Tube Side Reynolds Number" Unity(i).Tubes.HeatTransfer.Re=(Unity(i).Properties.Cold.Average.rho*Unity(i).Tubes.HeatTransfer.Vtube*Ditube)/Unity(i).Properties.Cold.Average.Mu; "Tube Side Prandtl Number" Unity(i).Tubes.HeatTransfer.PR = ((Unity(i).Properties.Cold.Average.Cp/Unity(i).Properties.Cold.Average.Mw)*Unity(i).Properties.Cold.Average.Mu)/Unity(i).Properties.Cold.Average.K; "Tube Side Prandtl Number at Wall" Unity(i).Tubes.HeatTransfer.PRw = ((Unity(i).Properties.Cold.Wall.Cp/Unity(i).Properties.Cold.Average.Mw)*Unity(i).Properties.Cold.Wall.Mu)/Unity(i).Properties.Cold.Wall.K; "Tube Side Film Coefficient" Unity(i).Tubes.HeatTransfer.htube= HE.TubeFilmCoeff(Unity(i).Tubes.HeatTransfer.Re,Unity(i).Tubes.HeatTransfer.PR,Unity(i).Properties.Cold.Average.K)*Unity(i).Tubes.HeatTransfer.Phi; "Shell Side Prandtl Number" Unity(i).Shell.HeatTransfer.PR=((Unity(i).Properties.Hot.Average.Cp/Unity(i).Properties.Hot.Average.Mw)*Unity(i).Properties.Hot.Average.Mu)/Unity(i).Properties.Hot.Average.K; "Shell Side Prandtl Number at Wall" Unity(i).Shell.HeatTransfer.PRw=((Unity(i).Properties.Hot.Wall.Cp/Unity(i).Properties.Hot.Average.Mw)*Unity(i).Properties.Hot.Wall.Mu)/Unity(i).Properties.Hot.Wall.K; "Tube Side Pressure Drop" Unity(i).Tubes.PressureDrop.PdTube              = HE.DeltaPtube(Unity(i).Tubes.HeatTransfer.Re,Unity(i).Properties.Cold.Average.rho,Unity(i).Tubes.HeatTransfer.Vtube,Unity(i).Tubes.HeatTransfer.Phi); "Pressure Drop Tube Side Inlet Nozzle" Unity(i).Tubes.PressureDrop.Pdnozzle_in = HE.DeltaPtubeNozzlein(Unity(i).Properties.Cold.Inlet.rho,Unity(i).Properties.Cold.Inlet.Fw); "Velocity Tube Side Inlet Nozzle" Unity(i).Tubes.PressureDrop.Vnozzle_in  = HE.TubeVelocityNozzlein(Unity(i).Properties.Cold.Inlet.rho,Unity(i).Properties.Cold.Inlet.Fw); "Pressure Drop Tube Side Outlet Nozzle" Unity(i).Tubes.PressureDrop.Pdnozzle_out        = HE.DeltaPtubeNozzleout(Unity(i).Properties.Cold.Outlet.rho,Unity(i).Properties.Cold.Inlet.Fw); "Velocity Tube Side Outlet Nozzle" Unity(i).Tubes.PressureDrop.Vnozzle_out = HE.TubeVelocityNozzleout(Unity(i).Properties.Cold.Outlet.rho,Unity(i).Properties.Cold.Inlet.Fw); "Shell Pressure Drop Inlet Nozzle" Unity(i).Shell.PressureDrop.Pdnozzle_in = HE.DeltaPshellNozzleIn(Unity(i).Properties.Hot.Inlet.rho,Unity(i).Properties.Hot.Inlet.Fw); "Velocity Shell Side Inlet Nozzle" Unity(i).Shell.PressureDrop.Vnozzle_in  = HE.ShellVelocityNozzleIn(Unity(i).Properties.Hot.Inlet.rho,Unity(i).Properties.Hot.Inlet.Fw); "Shell Pressure Drop Outlet Nozzle" Unity(i).Shell.PressureDrop.Pdnozzle_out        =HE.DeltaPshellNozzleOut(Unity(i).Properties.Hot.Outlet.rho,Unity(i).Properties.Hot.Inlet.Fw); "Velocity Shell Side Outlet Nozzle" Unity(i).Shell.PressureDrop.Vnozzle_out =HE.ShellVelocityNozzleOut(Unity(i).Properties.Hot.Outlet.rho,Unity(i).Properties.Hot.Inlet.Fw); "Pressure Drop Hot Stream" Unity(i).Outlet.Hot.P  = Unity(i).Inlet.Hot.P- Unity(i).Shell.PressureDrop.Pdtotal; "Pressure Drop Cold Stream" Unity(i).Outlet.Cold.P  = Unity(i).Inlet.Cold.P - Unity(i).Tubes.PressureDrop.Pdtotal; else "Cold Wall Temperature" Unity(i).Properties.Cold.Wall.Twall  = (Unity(i).Properties.Hot.Average.T+Unity(i).Properties.Cold.Average.T)/2; "Hot Wall Temperature" Unity(i).Properties.Hot.Wall.Twall  = (Unity(i).Properties.Hot.Average.T+Unity(i).Properties.Cold.Average.T)/2; "Tube Side Velocity" Unity(i).Tubes.HeatTransfer.Vtube  = Unity(i).Properties.Hot.Inlet.Fw*Tpass/((Pi*Ditube*Ditube/4)*Unity(i).Properties.Hot.Average.rho*Ntt); "Tube Side Reynolds Number" Unity(i).Tubes.HeatTransfer.Re=(Unity(i).Properties.Hot.Average.rho*Unity(i).Tubes.HeatTransfer.Vtube*Ditube)/Unity(i).Properties.Hot.Average.Mu; "Tube Side Prandtl Number" Unity(i).Tubes.HeatTransfer.PR=((Unity(i).Properties.Hot.Average.Cp/Unity(i).Properties.Hot.Average.Mw)*Unity(i).Properties.Hot.Average.Mu)/Unity(i).Properties.Hot.Average.K; "Tube Side Prandtl Number at Wall" Unity(i).Tubes.HeatTransfer.PRw=((Unity(i).Properties.Hot.Wall.Cp/Unity(i).Properties.Hot.Average.Mw)*Unity(i).Properties.Hot.Wall.Mu)/Unity(i).Properties.Hot.Wall.K; "Tube Side Film Coefficient" Unity(i).Tubes.HeatTransfer.htube= HE.TubeFilmCoeff(Unity(i).Tubes.HeatTransfer.Re,Unity(i).Tubes.HeatTransfer.PR,Unity(i).Properties.Hot.Average.K)*Unity(i).Tubes.HeatTransfer.Phi; "Shell Side Prandtl Number" Unity(i).Shell.HeatTransfer.PR=((Unity(i).Properties.Cold.Average.Cp/Unity(i).Properties.Cold.Average.Mw)*Unity(i).Properties.Cold.Average.Mu)/Unity(i).Properties.Cold.Average.K; "Shell Side Prandtl Number at Wall" Unity(i).Shell.HeatTransfer.PRw=((Unity(i).Properties.Cold.Wall.Cp/Unity(i).Properties.Cold.Average.Mw)*Unity(i).Properties.Cold.Wall.Mu)/Unity(i).Properties.Cold.Wall.K; "Tube Side Pressure Drop" Unity(i).Tubes.PressureDrop.PdTube              = HE.DeltaPtube(Unity(i).Tubes.HeatTransfer.Re,Unity(i).Properties.Hot.Average.rho,Unity(i).Tubes.HeatTransfer.Vtube,Unity(i).Tubes.HeatTransfer.Phi); "Pressure Drop Tube Side Inlet Nozzle" Unity(i).Tubes.PressureDrop.Pdnozzle_in = HE.DeltaPtubeNozzlein(Unity(i).Properties.Hot.Inlet.rho,Unity(i).Properties.Hot.Inlet.Fw); "Velocity Tube Side Inlet Nozzle" Unity(i).Tubes.PressureDrop.Vnozzle_in  = HE.TubeVelocityNozzlein(Unity(i).Properties.Hot.Inlet.rho,Unity(i).Properties.Hot.Inlet.Fw); "Pressure Drop Tube Side Outlet Nozzle" Unity(i).Tubes.PressureDrop.Pdnozzle_out        = HE.DeltaPtubeNozzleout(Unity(i).Properties.Hot.Outlet.rho,Unity(i).Properties.Hot.Inlet.Fw); "Velocity Tube Side Outlet Nozzle" Unity(i).Tubes.PressureDrop.Vnozzle_out = HE.TubeVelocityNozzleout(Unity(i).Properties.Hot.Outlet.rho,Unity(i).Properties.Hot.Inlet.Fw); "Shell Pressure Drop Inlet Nozzle" Unity(i).Shell.PressureDrop.Pdnozzle_in = HE.DeltaPshellNozzleIn(Unity(i).Properties.Cold.Inlet.rho,Unity(i).Properties.Cold.Inlet.Fw); "Velocity Shell Side Inlet Nozzle" Unity(i).Shell.PressureDrop.Vnozzle_in  = HE.ShellVelocityNozzleIn(Unity(i).Properties.Cold.Inlet.rho,Unity(i).Properties.Cold.Inlet.Fw); "Shell Pressure Drop Outlet Nozzle" Unity(i).Shell.PressureDrop.Pdnozzle_out = HE.DeltaPshellNozzleOut(Unity(i).Properties.Cold.Outlet.rho,Unity(i).Properties.Cold.Inlet.Fw); "Velocity Shell Side Outlet Nozzle" Unity(i).Shell.PressureDrop.Vnozzle_out  = HE.ShellVelocityNozzleOut(Unity(i).Properties.Cold.Outlet.rho,Unity(i).Properties.Cold.Inlet.Fw); "Pressure Drop Hot Stream" Unity(i).Outlet.Hot.P  = Unity(i).Inlet.Hot.P- Unity(i).Tubes.PressureDrop.Pdtotal; "Pressure Drop Cold Stream" Unity(i).Outlet.Cold.P  = Unity(i).Inlet.Cold.P - Unity(i).Shell.PressureDrop.Pdtotal; end if side equal 1 then "Shell Side inlet Nozzle rho-V^2" Unity(i).Shell.PressureDrop.RVsquare_in = Unity(i).Properties.Hot.Inlet.rho*(Unity(i).Shell.PressureDrop.Vnozzle_in)^2; "Shell Side Outlet Nozzle rho-V^2" Unity(i).Shell.PressureDrop.RVsquare_out = Unity(i).Properties.Hot.Outlet.rho*(Unity(i).Shell.PressureDrop.Vnozzle_out)^2; else "Shell Side inlet Nozzle rho-V^2" Unity(i).Shell.PressureDrop.RVsquare_in = Unity(i).Properties.Cold.Inlet.rho*(Unity(i).Shell.PressureDrop.Vnozzle_in)^2; "Shell Side Outlet Nozzle rho-V^2" Unity(i).Shell.PressureDrop.RVsquare_out = Unity(i).Properties.Cold.Outlet.rho*(Unity(i).Shell.PressureDrop.Vnozzle_out)^2; end "Tube Resistance" Unity(i).Resistances.Rtube*(Unity(i).Tubes.HeatTransfer.htube*Ditube) = Dotube; "Wall Resistance" Unity(i).Resistances.Rwall=Dotube*ln(Dotube/Ditube)/(2*Kwall); "Shell Resistance" Unity(i).Resistances.Rshell*(Unity(i).Shell.HeatTransfer.hshell)=1; "Overall Heat Transfer Coefficient Clean" Unity(i).Details.Uc*(Dotube/(Unity(i).Tubes.HeatTransfer.htube*Ditube)+(Dotube*ln(Dotube/Ditube)/(2*Kwall))+(1/(Unity(i).Shell.HeatTransfer.hshell)))=1; "Overall Heat Transfer Coefficient Dirty" (1/Unity(i).Details.Ud)=(1/Unity(i).Details.Uc)+Unity(i).Resistances.Rfo+Unity(i).Resistances.Rfi*(Dotube/Ditube); "Exchange Surface Area" Unity(i).Details.A=Pi*Dotube*Ntt*Ltube; "Baffles Spacing" Ltube = Unity(i).Baffles.Lsi+Unity(i).Baffles.Lso+Unity(i).Baffles.Ls*(Nb-1); "LMTD Correction Factor" Fc(i) = HE.EshellCorrectionFactor(Unity(i).Inlet.Hot.T,Unity(i).Outlet.Hot.T,Unity(i).Inlet.Cold.T,Unity(i).Outlet.Cold.T); "Counter Flow LMTD" LMTD(i) = HE.CounterLMTD(Unity(i).Inlet.Hot.T,Unity(i).Outlet.Hot.T,Unity(i).Inlet.Cold.T,Unity(i).Outlet.Cold.T); "Js Factor" Unity(i).Shell.HeatTransfer.Js = HE.JsFactor(Unity(i).Shell.HeatTransfer.Re,Unity(i).Baffles.Lsi,Unity(i).Baffles.Lso,Unity(i).Baffles.Ls); if side equal 1 then "Shell Side Reynolds Number" Unity(i).Shell.HeatTransfer.Re=(Dotube*Unity(i).Properties.Hot.Inlet.Fw/Unity(i).Shell.HeatTransfer.Sm)/Unity(i).Properties.Hot.Average.Mu; "Shell Heat Transfer Coefficient" Unity(i).Shell.HeatTransfer.hshell=Unity(i).Shell.HeatTransfer.Ji*(Unity(i).Properties.Hot.Average.Cp/Unity(i).Properties.Hot.Average.Mw)*(Unity(i).Properties.Hot.Inlet.Fw/Unity(i).Shell.HeatTransfer.Sm)*(Unity(i).Shell.HeatTransfer.PR^(-2/3))*Unity(i).Shell.HeatTransfer.Jtotal*Unity(i).Shell.HeatTransfer.Phi; "Shell Pressure Drop Cross Flow" Unity(i).Shell.PressureDrop.PdCross             = HE.DeltaPcross(Unity(i).Shell.HeatTransfer.Re,Unity(i).Baffles.Ls,Unity(i).Baffles.Lso,Unity(i).Baffles.Lsi,Unity(i).Properties.Hot.Inlet.Fw,Unity(i).Shell.HeatTransfer.Phi,Unity(i).Properties.Hot.Average.rho); "Shell Pressure Baffle Window" Unity(i).Shell.PressureDrop.Pdwindow            = HE.DeltaPwindow(Unity(i).Properties.Hot.Inlet.Fw,Unity(i).Shell.HeatTransfer.Sm,Unity(i).Properties.Hot.Average.rho,Unity(i).Properties.Hot.Average.Mu,Unity(i).Baffles.Ls); "Shell Pressure End Zones" Unity(i).Shell.PressureDrop.PdEndZones  = HE.DeltaPendZones(Unity(i).Shell.HeatTransfer.Re,Unity(i).Baffles.Ls,Unity(i).Baffles.Lso,Unity(i).Baffles.Lsi,Unity(i).Properties.Hot.Inlet.Fw,Unity(i).Shell.HeatTransfer.Phi,Unity(i).Properties.Hot.Average.rho); else "Shell Side Reynolds Number" Unity(i).Shell.HeatTransfer.Re=(Dotube*Unity(i).Properties.Cold.Inlet.Fw/Unity(i).Shell.HeatTransfer.Sm)/Unity(i).Properties.Cold.Average.Mu; "Shell Heat Transfer Coefficient" Unity(i).Shell.HeatTransfer.hshell=Unity(i).Shell.HeatTransfer.Ji*(Unity(i).Properties.Cold.Average.Cp/Unity(i).Properties.Cold.Average.Mw)*(Unity(i).Properties.Cold.Inlet.Fw/Unity(i).Shell.HeatTransfer.Sm)*(Unity(i).Shell.HeatTransfer.PR^(-2/3))*Unity(i).Shell.HeatTransfer.Jtotal*Unity(i).Shell.HeatTransfer.Phi; "Shell Pressure Drop Cross Flow" Unity(i).Shell.PressureDrop.PdCross      = HE.DeltaPcross(Unity(i).Shell.HeatTransfer.Re,Unity(i).Baffles.Ls,Unity(i).Baffles.Lso,Unity(i).Baffles.Lsi,Unity(i).Properties.Cold.Inlet.Fw,Unity(i).Shell.HeatTransfer.Phi,Unity(i).Properties.Cold.Average.rho); "Shell Pressure Baffle Window" Unity(i).Shell.PressureDrop.Pdwindow     = HE.DeltaPwindow(Unity(i).Properties.Cold.Inlet.Fw,Unity(i).Shell.HeatTransfer.Sm,Unity(i).Properties.Cold.Average.rho,Unity(i).Properties.Cold.Average.Mu,Unity(i).Baffles.Ls); "Shell Pressure End Zones" Unity(i).Shell.PressureDrop.PdEndZones  = HE.DeltaPendZones(Unity(i).Shell.HeatTransfer.Re,Unity(i).Baffles.Ls,Unity(i).Baffles.Lso,Unity(i).Baffles.Lsi,Unity(i).Properties.Cold.Inlet.Fw,Unity(i).Shell.HeatTransfer.Phi,Unity(i).Properties.Cold.Average.rho); end "Exchange Surface Area" Unity(i).Details.Q   = Unity(i).Details.Ud*Pi*Dotube*Ntt*Ltube*Fc(i)*LMTD(i); "Mean Temperature Difference" MTD(i)   = Fc(i)*LMTD(i); end SET SET #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# #  Set Parameters for heatex Calculation HE.Ltd                          = Ltd; side                            = HE.FluidAlocation(); end #"Tube Side Inlet Nozzle Area" Ainozzle_Tube = (Pi*Dinozzle_Tube*Dinozzle_Tube)/4; #"Tube Side Outlet Nozzle Area" Aonozzle_Tube = (Pi*Donozzle_Tube*Donozzle_Tube)/4; #"Tube Inlet Nozzle Pressure Loss Coeff" Kinlet_Tube   = 1.1; #"Tube Outlet Nozzle Pressure Loss Coeff" Koutlet_Tube  = 0.7; #"Shell Outlet Nozzle Area" Aonozzle_Shell  = (Pi*Donozzle_Shell*Donozzle_Shell)/4; #"Shell Inlet Nozzle Area" Ainozzle_Shell  = (Pi*Dinozzle_Shell*Dinozzle_Shell)/4; #"Shell Outlet Escape Area Under Nozzle" Aeonozzle_Shell = Pi*Donozzle_Shell*Honozzle_Shell + 0.6*Aonozzle_Shell*(1-Dotube/pitch); #"Shell Inlet Escape Area Under Nozzle" Aeinozzle_Shell = Pi*Dinozzle_Shell*Hinozzle_Shell + 0.6*Ainozzle_Shell*(1-Dotube/pitch); CONNECTIONS Unity([1:Nshell-1]).Outlet.Hot  to Unity([2:Nshell]).Inlet.Hot; Unity([2:Nshell]).Outlet.Cold to Unity([1:Nshell-1]).Inlet.Cold; EQUATIONS for i in [1:Nshell] "Shell Side Cross Flow Area" Unity(i).Shell.HeatTransfer.Sm = HE.CrossFlowArea(Unity(i).Baffles.Ls); "Ji Factor" Unity(i).Shell.HeatTransfer.Ji = HE.JiFactor(Unity(i).Shell.HeatTransfer.Re); "Jc Factor" Unity(i).Shell.HeatTransfer.Jc = HE.JcFactor(); "Jl Factor" Unity(i).Shell.HeatTransfer.Jl = HE.JlFactor(Unity(i).Shell.HeatTransfer.Sm); "Jb Factor" Unity(i).Shell.HeatTransfer.Jb = HE.JbFactor(Unity(i).Shell.HeatTransfer.Re,Unity(i).Baffles.Ls,Unity(i).Shell.HeatTransfer.Sm); "Jr Factor" Unity(i).Shell.HeatTransfer.Jr = HE.JrFactor(Unity(i).Shell.HeatTransfer.Re); "Total J Factor" Unity(i).Shell.HeatTransfer.Jtotal=Unity(i).Shell.HeatTransfer.Jc*Unity(i).Shell.HeatTransfer.Jl*Unity(i).Shell.HeatTransfer.Jb*Unity(i).Shell.HeatTransfer.Jr*Unity(i).Shell.HeatTransfer.Js; if side equal 1 then "Tube Side Pressure Drop" Unity(i).Tubes.PressureDrop.PdTube              = HE.DeltaPtube(Unity(i).Tubes.HeatTransfer.Re,Unity(i).Properties.Cold.Average.rho,Unity(i).Tubes.HeatTransfer.Vtube,Unity(i).Tubes.HeatTransfer.Phi); "Pressure Drop Tube Side Inlet Nozzle" Unity(i).Tubes.PressureDrop.Pdnozzle_in = 0.5*Kinlet_Tube*Unity(i).Properties.Cold.Inlet.rho*Unity(i).Tubes.PressureDrop.Vnozzle_in^2; "Velocity Tube Side Inlet Nozzle" Unity(i).Tubes.PressureDrop.Vnozzle_in  = Unity(i).Properties.Cold.Inlet.Fw/(Unity(i).Properties.Cold.Inlet.rho*Ainozzle_Tube); "Pressure Drop Tube Side Outlet Nozzle" Unity(i).Tubes.PressureDrop.Pdnozzle_out        = 0.5*Koutlet_Tube*Unity(i).Properties.Cold.Outlet.rho*Unity(i).Tubes.PressureDrop.Vnozzle_out^2; "Velocity Tube Side Outlet Nozzle" Unity(i).Tubes.PressureDrop.Vnozzle_out = Unity(i).Properties.Cold.Inlet.Fw/(Unity(i).Properties.Cold.Outlet.rho*Aonozzle_Tube); "Shell Pressure Drop Inlet Nozzle" Unity(i).Shell.PressureDrop.Pdnozzle_in = (0.5*Unity(i).Properties.Hot.Inlet.Fw^2/Unity(i).Properties.Hot.Inlet.rho)*((1/Ainozzle_Shell^2)+(1/Aeinozzle_Shell^2)); "Velocity Shell Side Inlet Nozzle" Unity(i).Shell.PressureDrop.Vnozzle_in  = Unity(i).Properties.Hot.Inlet.Fw/(Unity(i).Properties.Hot.Inlet.rho*Ainozzle_Shell); "Shell Pressure Drop Outlet Nozzle" Unity(i).Shell.PressureDrop.Pdnozzle_out        = (0.5*Unity(i).Properties.Hot.Outlet.Fw^2/Unity(i).Properties.Hot.Outlet.rho)*((1/Ainozzle_Shell^2)+(1/Aeinozzle_Shell^2)); "Velocity Shell Side Outlet Nozzle" Unity(i).Shell.PressureDrop.Vnozzle_out = Unity(i).Properties.Hot.Outlet.Fw/(Unity(i).Properties.Hot.Outlet.rho*Aonozzle_Shell); "Pressure Drop Hot Stream" Unity(i).Outlet.Hot.P  = Unity(i).Inlet.Hot.P - Unity(i).Shell.PressureDrop.Pdtotal; "Pressure Drop Cold Stream" Unity(i).Outlet.Cold.P  = Unity(i).Inlet.Cold.P - Unity(i).Tubes.PressureDrop.Pdtotal; else "Tube Side Pressure Drop" Unity(i).Tubes.PressureDrop.PdTube              = HE.DeltaPtube(Unity(i).Tubes.HeatTransfer.Re,Unity(i).Properties.Hot.Average.rho,Unity(i).Tubes.HeatTransfer.Vtube,Unity(i).Tubes.HeatTransfer.Phi); "Pressure Drop Tube Side Inlet Nozzle" Unity(i).Tubes.PressureDrop.Pdnozzle_in = 0.5*Kinlet_Tube*Unity(i).Properties.Hot.Inlet.rho*Unity(i).Tubes.PressureDrop.Vnozzle_in^2; "Velocity Tube Side Inlet Nozzle" Unity(i).Tubes.PressureDrop.Vnozzle_in  = Unity(i).Properties.Hot.Inlet.Fw/(Unity(i).Properties.Hot.Inlet.rho*Ainozzle_Tube); "Pressure Drop Tube Side Outlet Nozzle" Unity(i).Tubes.PressureDrop.Pdnozzle_out        = 0.5*Koutlet_Tube*Unity(i).Properties.Hot.Outlet.rho*Unity(i).Tubes.PressureDrop.Vnozzle_out^2; "Velocity Tube Side Outlet Nozzle" Unity(i).Tubes.PressureDrop.Vnozzle_out = Unity(i).Properties.Hot.Inlet.Fw/(Unity(i).Properties.Hot.Outlet.rho*Aonozzle_Tube); "Shell Pressure Drop Inlet Nozzle" Unity(i).Shell.PressureDrop.Pdnozzle_in = (0.5*Unity(i).Properties.Cold.Inlet.Fw^2/Unity(i).Properties.Cold.Inlet.rho)*((1/Ainozzle_Shell^2)+(1/Aeinozzle_Shell^2)); "Velocity Shell Side Inlet Nozzle" Unity(i).Shell.PressureDrop.Vnozzle_in  = Unity(i).Properties.Cold.Inlet.Fw/(Unity(i).Properties.Cold.Inlet.rho*Ainozzle_Shell); "Shell Pressure Drop Outlet Nozzle" Unity(i).Shell.PressureDrop.Pdnozzle_out = (0.5*Unity(i).Properties.Cold.Outlet.Fw^2/Unity(i).Properties.Cold.Outlet.rho)*((1/Ainozzle_Shell^2)+(1/Aeinozzle_Shell^2)); "Velocity Shell Side Outlet Nozzle" Unity(i).Shell.PressureDrop.Vnozzle_out  = Unity(i).Properties.Cold.Outlet.Fw/(Unity(i).Properties.Cold.Outlet.rho*Ainozzle_Shell); "Pressure Drop Hot Stream" Unity(i).Outlet.Hot.P  = Unity(i).Inlet.Hot.P- Unity(i).Tubes.PressureDrop.Pdtotal; "Pressure Drop Cold Stream" Unity(i).Outlet.Cold.P  = Unity(i).Inlet.Cold.P - Unity(i).Shell.PressureDrop.Pdtotal; end if side equal 1 then "Shell Side Phi correction for viscosity" Unity(i).Shell.HeatTransfer.Phi = HE.PhiCorrection(Unity(i).Properties.Hot.Average.Mu,Unity(i).Properties.Hot.Wall.Mu); "Tube Side Phi correction for viscosity" Unity(i).Tubes.HeatTransfer.Phi  = HE.PhiCorrection(Unity(i).Properties.Cold.Average.Mu,Unity(i).Properties.Cold.Wall.Mu); else "Shell Side Phi correction for viscosity" Unity(i).Shell.HeatTransfer.Phi = HE.PhiCorrection(Unity(i).Properties.Cold.Average.Mu,Unity(i).Properties.Cold.Wall.Mu); "Tube Side Phi correction for viscosity" Unity(i).Tubes.HeatTransfer.Phi  = HE.PhiCorrection(Unity(i).Properties.Hot.Average.Mu,Unity(i).Properties.Hot.Wall.Mu); end if side equal 1 then "Shell Side inlet Nozzle rho-V^2" Unity(i).Shell.PressureDrop.RVsquare_in = Unity(i).Properties.Hot.Inlet.rho*(Unity(i).Shell.PressureDrop.Vnozzle_in)^2; "Shell Side Outlet Nozzle rho-V^2" Unity(i).Shell.PressureDrop.RVsquare_out = Unity(i).Properties.Hot.Outlet.rho*(Unity(i).Shell.PressureDrop.Vnozzle_out)^2; else "Shell Side inlet Nozzle rho-V^2" Unity(i).Shell.PressureDrop.RVsquare_in = Unity(i).Properties.Cold.Inlet.rho*(Unity(i).Shell.PressureDrop.Vnozzle_in)^2; "Shell Side Outlet Nozzle rho-V^2" Unity(i).Shell.PressureDrop.RVsquare_out = Unity(i).Properties.Cold.Outlet.rho*(Unity(i).Shell.PressureDrop.Vnozzle_out)^2; end if side equal 1 then "Hot Wall Temperature" Unity(i).Properties.Hot.Wall.Twall      = (Unity(i).Properties.Hot.Average.T+Unity(i).Properties.Cold.Average.T)/2; "ColdWall Temperature" Unity(i).Properties.Cold.Wall.Twall  = (Unity(i).Properties.Hot.Average.T+Unity(i).Properties.Cold.Average.T)/2; "Tube Side Velocity" Unity(i).Tubes.HeatTransfer.Vtube       = Unity(i).Properties.Cold.Inlet.Fw*Tpass/((Pi*Ditube*Ditube/4)*Unity(i).Properties.Cold.Average.rho*Ntt); "Tube Side Reynolds Number" Unity(i).Tubes.HeatTransfer.Re          = (Unity(i).Properties.Cold.Average.rho*Unity(i).Tubes.HeatTransfer.Vtube*Ditube)/Unity(i).Properties.Cold.Average.Mu; "Tube Side Prandtl Number" Unity(i).Tubes.HeatTransfer.PR          = ((Unity(i).Properties.Cold.Average.Cp/Unity(i).Properties.Cold.Average.Mw)*Unity(i).Properties.Cold.Average.Mu)/Unity(i).Properties.Cold.Average.K; "Tube Side Prandtl Number at Wall Temperature" Unity(i).Tubes.HeatTransfer.PRw                 = ((Unity(i).Properties.Cold.Wall.Cp/Unity(i).Properties.Cold.Average.Mw)*Unity(i).Properties.Cold.Wall.Mu)/Unity(i).Properties.Cold.Wall.K; "Tube Side Film Coefficient" Unity(i).Tubes.HeatTransfer.htube       = HE.TubeFilmCoeff(Unity(i).Tubes.HeatTransfer.Re,Unity(i).Tubes.HeatTransfer.PR,Unity(i).Properties.Cold.Average.K)*Unity(i).Tubes.HeatTransfer.Phi; "Shell Side Prandtl Number" Unity(i).Shell.HeatTransfer.PR          = ((Unity(i).Properties.Hot.Average.Cp/Unity(i).Properties.Hot.Average.Mw)*Unity(i).Properties.Hot.Average.Mu)/Unity(i).Properties.Hot.Average.K; "Shell Side Prandtl Number at Wall Temperature" Unity(i).Shell.HeatTransfer.PRw                 = ((Unity(i).Properties.Hot.Wall.Cp/Unity(i).Properties.Hot.Average.Mw)*Unity(i).Properties.Hot.Wall.Mu)/Unity(i).Properties.Hot.Wall.K; else "Hot Wall Temperature" Unity(i).Properties.Hot.Wall.Twall  = (Unity(i).Properties.Hot.Average.T+Unity(i).Properties.Cold.Average.T)/2; "Cold Wall Temperature" Unity(i).Properties.Cold.Wall.Twall  = (Unity(i).Properties.Hot.Average.T+Unity(i).Properties.Cold.Average.T)/2; "Tube Side Velocity" Unity(i).Tubes.HeatTransfer.Vtube       =       Unity(i).Properties.Hot.Inlet.Fw*Tpass/((Pi*Ditube*Ditube/4)*Unity(i).Properties.Hot.Average.rho*Ntt); "Tube Side Reynolds Number" Unity(i).Tubes.HeatTransfer.Re          =       (Unity(i).Properties.Hot.Average.rho*Unity(i).Tubes.HeatTransfer.Vtube*Ditube)/Unity(i).Properties.Hot.Average.Mu; "Tube Side Prandtl Number" Unity(i).Tubes.HeatTransfer.PR = ((Unity(i).Properties.Hot.Average.Cp/Unity(i).Properties.Hot.Average.Mw)*Unity(i).Properties.Hot.Average.Mu)/Unity(i).Properties.Hot.Average.K; "Tube Side Prandtl Number at Wall" Unity(i).Tubes.HeatTransfer.PRw = ((Unity(i).Properties.Hot.Wall.Cp/Unity(i).Properties.Hot.Average.Mw)*Unity(i).Properties.Hot.Wall.Mu)/Unity(i).Properties.Hot.Wall.K; "Tube Side Film Coefficient" Unity(i).Tubes.HeatTransfer.htube= HE.TubeFilmCoeff(Unity(i).Tubes.HeatTransfer.Re,Unity(i).Tubes.HeatTransfer.PR,Unity(i).Properties.Hot.Average.K)*Unity(i).Tubes.HeatTransfer.Phi; "Shell Side Prandtl Number" Unity(i).Shell.HeatTransfer.PR = ((Unity(i).Properties.Cold.Average.Cp/Unity(i).Properties.Cold.Average.Mw)*Unity(i).Properties.Cold.Average.Mu)/Unity(i).Properties.Cold.Average.K; "Shell Side Prandtl Number at Wall" Unity(i).Shell.HeatTransfer.PRw=((Unity(i).Properties.Cold.Wall.Cp/Unity(i).Properties.Cold.Average.Mw)*Unity(i).Properties.Cold.Wall.Mu)/Unity(i).Properties.Cold.Wall.K; end "Tube Resistance" Unity(i).Resistances.Rtube*(Unity(i).Tubes.HeatTransfer.htube*Ditube) = Dotube; "Wall Resistance" Unity(i).Resistances.Rwall=Dotube*ln(Dotube/Ditube)/(2*Kwall); "Shell Resistance" Unity(i).Resistances.Rshell*(Unity(i).Shell.HeatTransfer.hshell)=1; "Overall Heat Transfer Coefficient Clean" Unity(i).Details.Uc*(Dotube/(Unity(i).Tubes.HeatTransfer.htube*Ditube)+(Dotube*ln(Dotube/Ditube)/(2*Kwall))+(1/(Unity(i).Shell.HeatTransfer.hshell)))=1; "Overall Heat Transfer Coefficient Dirty" (1/Unity(i).Details.Ud)=(1/Unity(i).Details.Uc)+Unity(i).Resistances.Rfo+Unity(i).Resistances.Rfi*(Dotube/Ditube); "Exchange Surface Area" Unity(i).Details.A=Pi*Dotube*Ntt*Ltube; "Baffles Spacing" Ltube = Unity(i).Baffles.Lsi+Unity(i).Baffles.Lso+Unity(i).Baffles.Ls*(Nb-1); "LMTD Correction Factor" Fc(i) = HE.EshellCorrectionFactor(Unity(i).Inlet.Hot.T,Unity(i).Outlet.Hot.T,Unity(i).Inlet.Cold.T,Unity(i).Outlet.Cold.T); "Counter Flow LMTD" LMTD(i) = HE.CounterLMTD(Unity(i).Inlet.Hot.T,Unity(i).Outlet.Hot.T,Unity(i).Inlet.Cold.T,Unity(i).Outlet.Cold.T); "Js Factor" Unity(i).Shell.HeatTransfer.Js = HE.JsFactor(Unity(i).Shell.HeatTransfer.Re,Unity(i).Baffles.Lsi,Unity(i).Baffles.Lso,Unity(i).Baffles.Ls); if side equal 1 then "Shell Side Reynolds Number" Unity(i).Shell.HeatTransfer.Re=(Dotube*Unity(i).Properties.Hot.Inlet.Fw/Unity(i).Shell.HeatTransfer.Sm)/Unity(i).Properties.Hot.Average.Mu; "Shell Heat Transfer Coefficient" Unity(i).Shell.HeatTransfer.hshell=Unity(i).Shell.HeatTransfer.Ji*(Unity(i).Properties.Hot.Average.Cp/Unity(i).Properties.Hot.Average.Mw)*(Unity(i).Properties.Hot.Inlet.Fw/Unity(i).Shell.HeatTransfer.Sm)*(Unity(i).Shell.HeatTransfer.PR^(-2/3))*Unity(i).Shell.HeatTransfer.Jtotal*Unity(i).Shell.HeatTransfer.Phi; "Shell Pressure Drop Cross Flow" Unity(i).Shell.PressureDrop.PdCross             = HE.DeltaPcross(Unity(i).Shell.HeatTransfer.Re,Unity(i).Baffles.Ls,Unity(i).Baffles.Lso,Unity(i).Baffles.Lsi,Unity(i).Properties.Hot.Inlet.Fw,Unity(i).Shell.HeatTransfer.Phi,Unity(i).Properties.Hot.Average.rho); "Shell Pressure Baffle Window" Unity(i).Shell.PressureDrop.Pdwindow            = HE.DeltaPwindow(Unity(i).Properties.Hot.Inlet.Fw,Unity(i).Shell.HeatTransfer.Sm,Unity(i).Properties.Hot.Average.rho,Unity(i).Properties.Hot.Average.Mu,Unity(i).Baffles.Ls); "Shell Pressure End Zones" Unity(i).Shell.PressureDrop.PdEndZones  = HE.DeltaPendZones(Unity(i).Shell.HeatTransfer.Re,Unity(i).Baffles.Ls,Unity(i).Baffles.Lso,Unity(i).Baffles.Lsi,Unity(i).Properties.Hot.Inlet.Fw,Unity(i).Shell.HeatTransfer.Phi,Unity(i).Properties.Hot.Average.rho); else "Shell Side Reynolds Number" Unity(i).Shell.HeatTransfer.Re=(Dotube*Unity(i).Properties.Cold.Inlet.Fw/Unity(i).Shell.HeatTransfer.Sm)/Unity(i).Properties.Cold.Average.Mu; "Shell Heat Transfer Coefficient" Unity(i).Shell.HeatTransfer.hshell=Unity(i).Shell.HeatTransfer.Ji*(Unity(i).Properties.Cold.Average.Cp/Unity(i).Properties.Cold.Average.Mw)*(Unity(i).Properties.Cold.Inlet.Fw/Unity(i).Shell.HeatTransfer.Sm)*(Unity(i).Shell.HeatTransfer.PR^(-2/3))*Unity(i).Shell.HeatTransfer.Jtotal*Unity(i).Shell.HeatTransfer.Phi; "Shell Pressure Drop Cross Flow" Unity(i).Shell.PressureDrop.PdCross      = HE.DeltaPcross(Unity(i).Shell.HeatTransfer.Re,Unity(i).Baffles.Ls,Unity(i).Baffles.Lso,Unity(i).Baffles.Lsi,Unity(i).Properties.Cold.Inlet.Fw,Unity(i).Shell.HeatTransfer.Phi,Unity(i).Properties.Cold.Average.rho); "Shell Pressure Baffle Window" Unity(i).Shell.PressureDrop.Pdwindow     = HE.DeltaPwindow(Unity(i).Properties.Cold.Inlet.Fw,Unity(i).Shell.HeatTransfer.Sm,Unity(i).Properties.Cold.Average.rho,Unity(i).Properties.Cold.Average.Mu,Unity(i).Baffles.Ls); "Shell Pressure End Zones" Unity(i).Shell.PressureDrop.PdEndZones  = HE.DeltaPendZones(Unity(i).Shell.HeatTransfer.Re,Unity(i).Baffles.Ls,Unity(i).Baffles.Lso,Unity(i).Baffles.Lsi,Unity(i).Properties.Cold.Inlet.Fw,Unity(i).Shell.HeatTransfer.Phi,Unity(i).Properties.Cold.Average.rho); end "Exchange Surface Area" Unity(i).Details.Q   = Unity(i).Details.Ud*Pi*Dotube*Ntt*Ltube*Fc(i)*LMTD(i); "Mean Temperature Difference" MTD(i)   = Fc(i)*LMTD(i); end end
• ## mso/eml/heat_exchangers/HeatExchangerDiscretized.mso

 r100 Donozzle_Shell  as length               (Brief="Shell Outlet Nozzle Diameter",Lower=10e-6); Dinozzle_Shell  as length               (Brief="Shell Inlet Nozzle Diameter",Lower=10e-6); Aonozzle_Shell  as area                 (Brief="Shell Outlet Nozzle Area",Lower=10e-6); Ainozzle_Shell  as area                 (Brief="Shell Inlet Nozzle Area",Lower=10e-6); Aeonozzle_Shell as area                 (Brief="Shell Outlet Escape Area Under Nozzle",Lower=10e-6); Aeinozzle_Shell as area                 (Brief="Shell Inlet Escape Area Under Nozzle",Lower=10e-6); Hinozzle_Shell  as length               (Brief="Height Under Shell Inlet Nozzle",Lower=10e-6); Honozzle_Shell  as length               (Brief="Height Under Shell Outlet Nozzle",Lower=10e-6); Lcf                     as length               (Brief="Bundle-to-Shell Clearance",Lower=10e-8); #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# #       Tubes Geometrical Parameters #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# Ntt                             as Integer              (Brief="Total Number of Tubes in Shell",Default=100,Lower=1); Pattern         as Integer              (Brief="Tube Layout Characteristic Angle",Lower=30); Ltube                   as length               (Brief="Effective Tube Length",Lower=0.1); pitch                   as length               (Brief="Tube Pitch",Lower=1e-8); Kwall                   as conductivity (Brief="Tube Wall Material Thermal Conductivity"); Dotube                  as length               (Brief="Tube Outside Diameter",Lower=10e-6); Ditube                  as length               (Brief="Tube Inside Diameter",Lower=10e-6); Donozzle_Tube   as length               (Brief="Tube Outlet Nozzle Diameter",Lower=10e-6); Dinozzle_Tube   as length               (Brief="Tube Inlett Nozzle Diameter",Lower=10e-6); #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# #                               Tubes Geometrical Parameters                                            # #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# Ntt                       as Integer            (Brief="Total Number of Tubes in Shell",Default=100,Lower=1); Pattern       as Integer                (Brief="Tube Layout Characteristic Angle",Lower=30); Ltube             as length                     (Brief="Effective Tube Length",Lower=0.1); pitch             as length                     (Brief="Tube Pitch",Lower=1e-8); Kwall             as conductivity       (Brief="Tube Wall Material Thermal Conductivity"); Dotube            as length                     (Brief="Tube Outside Diameter",Lower=10e-6); Ditube            as length                     (Brief="Tube Inside Diameter",Lower=10e-6); Donozzle_Tube as length                 (Brief="Tube Outlet Nozzle Diameter",Lower=10e-6); Dinozzle_Tube as length                 (Brief="Tube Inlet Nozzle Diameter",Lower=10e-6); Aonozzle_Tube as area                   (Brief="Tube Outlet Nozzle Area",Lower=10e-6); Ainozzle_Tube as area                   (Brief="Tube Inlet Nozzle Area",Lower=10e-6); Kinlet_Tube   as positive               (Brief="Tube Inlet Nozzle Pressure Loss Coeff",Default=1.1); Koutlet_Tube  as positive               (Brief="Tube Outlet Nozzle Pressure Loss Coeff",Default=0.7); #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# #       Baffles Geometrical Parameters "Pressure Drop Tube Side Inlet Nozzle" Unity(1).Tubes.PressureDrop.Pdnozzle_in = HE.DeltaPtubeNozzlein(Unity(1).Properties.Cold.Inlet.rho,Unity(1).Properties.Cold.Inlet.Fw); Unity(1).Tubes.PressureDrop.Pdnozzle_in = 0.5*Kinlet_Tube*Unity(1).Properties.Cold.Inlet.rho*Unity(1).Tubes.PressureDrop.Vnozzle_in^2; "Velocity Tube Side Inlet Nozzle" Unity(1).Tubes.PressureDrop.Vnozzle_in  = HE.TubeVelocityNozzlein(Unity(1).Properties.Cold.Inlet.rho,Unity(1).Properties.Cold.Inlet.Fw); Unity(1).Tubes.PressureDrop.Vnozzle_in  = Unity(1).Properties.Cold.Inlet.Fw/(Unity(1).Properties.Cold.Inlet.rho*Ainozzle_Tube); "Pressure Drop Tube Side Outlet Nozzle" Unity(Nb+1).Tubes.PressureDrop.Pdnozzle_out     = HE.DeltaPtubeNozzleout(Unity(Nb+1).Properties.Cold.Outlet.rho,Unity(Nb+1).Properties.Cold.Inlet.Fw); Unity(Nb+1).Tubes.PressureDrop.Pdnozzle_out     = 0.5*Koutlet_Tube*Unity(Nb+1).Properties.Cold.Outlet.rho*Unity(Nb+1).Tubes.PressureDrop.Vnozzle_out^2; "Velocity Tube Side Outlet Nozzle" Unity(Nb+1).Tubes.PressureDrop.Vnozzle_out      = HE.TubeVelocityNozzleout(Unity(Nb+1).Properties.Cold.Outlet.rho,Unity(Nb+1).Properties.Cold.Inlet.Fw); Unity(Nb+1).Tubes.PressureDrop.Vnozzle_out      = Unity(Nb+1).Properties.Cold.Inlet.Fw/(Unity(Nb+1).Properties.Cold.Outlet.rho*Aonozzle_Tube); "Shell Pressure Drop Inlet Nozzle" Unity(1).Shell.PressureDrop.Pdnozzle_in = HE.DeltaPshellNozzleIn(Unity(1).Properties.Hot.Inlet.rho,Unity(1).Properties.Hot.Inlet.Fw); Unity(1).Shell.PressureDrop.Pdnozzle_in = (0.5*Unity(1).Properties.Hot.Inlet.Fw^2/Unity(1).Properties.Hot.Inlet.rho)*((1/Ainozzle_Shell^2)+(1/Aeinozzle_Shell^2)); "Velocity Shell Side Inlet Nozzle" Unity(1).Shell.PressureDrop.Vnozzle_in  = HE.ShellVelocityNozzleIn(Unity(1).Properties.Hot.Inlet.rho,Unity(1).Properties.Hot.Inlet.Fw); Unity(1).Shell.PressureDrop.Vnozzle_in  = Unity(1).Properties.Hot.Inlet.Fw/(Unity(1).Properties.Hot.Inlet.rho*Ainozzle_Shell); "Shell Pressure Drop Outlet Nozzle" Unity(Nb+1).Shell.PressureDrop.Pdnozzle_out     =HE.DeltaPshellNozzleOut(Unity(Nb+1).Properties.Hot.Outlet.rho,Unity(Nb+1).Properties.Hot.Inlet.Fw); Unity(Nb+1).Shell.PressureDrop.Pdnozzle_out     = (0.5*Unity(Nb+1).Properties.Hot.Outlet.Fw^2/Unity(Nb+1).Properties.Hot.Outlet.rho)*((1/Ainozzle_Shell^2)+(1/Aeinozzle_Shell^2)); "Velocity Shell Side Outlet Nozzle" Unity(Nb+1).Shell.PressureDrop.Vnozzle_out      =HE.ShellVelocityNozzleOut(Unity(Nb+1).Properties.Hot.Outlet.rho,Unity(Nb+1).Properties.Hot.Inlet.Fw); Unity(Nb+1).Shell.PressureDrop.Vnozzle_out      = Unity(Nb+1).Properties.Hot.Outlet.Fw/(Unity(Nb+1).Properties.Hot.Outlet.rho*Aonozzle_Shell); else Unity(Nb+1).Baffles.Lsi,Unity(Nb+1).Properties.Cold.Inlet.Fw,Unity(Nb+1).Shell.HeatTransfer.Phi,Unity(Nb+1).Properties.Cold.Average.rho); "Pressure Drop Tube Side Inlet Nozzle" Unity(1).Tubes.PressureDrop.Pdnozzle_in = HE.DeltaPtubeNozzlein(Unity(1).Properties.Hot.Inlet.rho,Unity(1).Properties.Hot.Inlet.Fw); Unity(1).Tubes.PressureDrop.Pdnozzle_in = 0.5*Kinlet_Tube*Unity(1).Properties.Hot.Inlet.rho*Unity(1).Tubes.PressureDrop.Vnozzle_in^2; "Velocity Tube Side Inlet Nozzle" Unity(1).Tubes.PressureDrop.Vnozzle_in  = HE.TubeVelocityNozzlein(Unity(1).Properties.Hot.Inlet.rho,Unity(1).Properties.Hot.Inlet.Fw); Unity(1).Tubes.PressureDrop.Vnozzle_in  = Unity(1).Properties.Hot.Inlet.Fw/(Unity(1).Properties.Hot.Inlet.rho*Ainozzle_Tube); "Pressure Drop Tube Side Outlet Nozzle" Unity(Nb+1).Tubes.PressureDrop.Pdnozzle_out     = HE.DeltaPtubeNozzleout(Unity(Nb+1).Properties.Hot.Outlet.rho,Unity(Nb+1).Properties.Hot.Inlet.Fw); Unity(Nb+1).Tubes.PressureDrop.Pdnozzle_out     = 0.5*Koutlet_Tube*Unity(Nb+1).Properties.Hot.Outlet.rho*Unity(Nb+1).Tubes.PressureDrop.Vnozzle_out^2; "Velocity Tube Side Outlet Nozzle" Unity(Nb+1).Tubes.PressureDrop.Vnozzle_out      = HE.TubeVelocityNozzleout(Unity(Nb+1).Properties.Hot.Outlet.rho,Unity(Nb+1).Properties.Hot.Inlet.Fw); Unity(Nb+1).Tubes.PressureDrop.Vnozzle_out      = Unity(Nb+1).Properties.Hot.Inlet.Fw/(Unity(Nb+1).Properties.Hot.Outlet.rho*Aonozzle_Tube); "Shell Pressure Drop Inlet Nozzle" Unity(1).Shell.PressureDrop.Pdnozzle_in = HE.DeltaPshellNozzleIn(Unity(1).Properties.Cold.Inlet.rho,Unity(1).Properties.Cold.Inlet.Fw); Unity(1).Shell.PressureDrop.Pdnozzle_in = (0.5*Unity(1).Properties.Cold.Inlet.Fw^2/Unity(1).Properties.Cold.Inlet.rho)*((1/Ainozzle_Shell^2)+(1/Aeinozzle_Shell^2)); "Velocity Shell Side Inlet Nozzle" Unity(1).Shell.PressureDrop.Vnozzle_in  = HE.ShellVelocityNozzleIn(Unity(1).Properties.Cold.Inlet.rho,Unity(1).Properties.Cold.Inlet.Fw); Unity(1).Shell.PressureDrop.Vnozzle_in  = Unity(1).Properties.Cold.Inlet.Fw/(Unity(1).Properties.Cold.Inlet.rho*Ainozzle_Shell); "Shell Pressure Drop Outlet Nozzle" Unity(Nb+1).Shell.PressureDrop.Pdnozzle_out = HE.DeltaPshellNozzleOut(Unity(Nb+1).Properties.Cold.Outlet.rho,Unity(Nb+1).Properties.Cold.Inlet.Fw); Unity(Nb+1).Shell.PressureDrop.Pdnozzle_out = (0.5*Unity(Nb+1).Properties.Cold.Outlet.Fw^2/Unity(Nb+1).Properties.Cold.Outlet.rho)*((1/Ainozzle_Shell^2)+(1/Aeinozzle_Shell^2)); "Velocity Shell Side Outlet Nozzle" Unity(Nb+1).Shell.PressureDrop.Vnozzle_out  = HE.ShellVelocityNozzleOut(Unity(Nb+1).Properties.Cold.Outlet.rho,Unity(Nb+1).Properties.Cold.Inlet.Fw); Unity(Nb+1).Shell.PressureDrop.Vnozzle_out  = Unity(Nb+1).Properties.Cold.Outlet.Fw/(Unity(Nb+1).Properties.Cold.Outlet.rho*Ainozzle_Shell); end HE.Ltd                          = Ltd; side                            = HE.FluidAlocation(); #"Tube Side Inlet Nozzle Area" Ainozzle_Tube = (Pi*Dinozzle_Tube*Dinozzle_Tube)/4; #"Tube Side Outlet Nozzle Area" Aonozzle_Tube = (Pi*Donozzle_Tube*Donozzle_Tube)/4; #"Tube Inlet Nozzle Pressure Loss Coeff" Kinlet_Tube   = 1.1; #"Tube Outlet Nozzle Pressure Loss Coeff" Koutlet_Tube  = 0.7; #"Shell Outlet Nozzle Area" Aonozzle_Shell  = (Pi*Donozzle_Shell*Donozzle_Shell)/4; #"Shell Inlet Nozzle Area" Ainozzle_Shell  = (Pi*Dinozzle_Shell*Dinozzle_Shell)/4; #"Shell Outlet Escape Area Under Nozzle" Aeonozzle_Shell = Pi*Donozzle_Shell*Honozzle_Shell + 0.6*Aonozzle_Shell*(1-Dotube/pitch); #"Shell Inlet Escape Area Under Nozzle" Aeinozzle_Shell = Pi*Dinozzle_Shell*Hinozzle_Shell + 0.6*Ainozzle_Shell*(1-Dotube/pitch); end Donozzle_Shell  as length               (Brief="Shell Outlet Nozzle Diameter",Lower=10e-6); Dinozzle_Shell  as length               (Brief="Shell Inlet Nozzle Diameter",Lower=10e-6); Aonozzle_Shell  as area                 (Brief="Shell Outlet Nozzle Area",Lower=10e-6); Ainozzle_Shell  as area                 (Brief="Shell Inlet Nozzle Area",Lower=10e-6); Aeonozzle_Shell as area                 (Brief="Shell Outlet Escape Area Under Nozzle",Lower=10e-6); Aeinozzle_Shell as area                 (Brief="Shell Inlet Escape Area Under Nozzle",Lower=10e-6); Hinozzle_Shell  as length               (Brief="Height Under Shell Inlet Nozzle",Lower=10e-6); Honozzle_Shell  as length               (Brief="Height Under Shell Outlet Nozzle",Lower=10e-6); Lcf                     as length               (Brief="Bundle-to-Shell Clearance",Lower=10e-8); #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# #       Tubes Geometrical Parameters #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# Ntt                             as Integer              (Brief="Total Number of Tubes in Shell",Default=100,Lower=1); Pattern         as Integer              (Brief="Tube Layout Characteristic Angle",Lower=30); Ltube                   as length               (Brief="Effective Tube Length",Lower=0.1); pitch                   as length               (Brief="Tube Pitch",Lower=1e-8); Kwall                   as conductivity (Brief="Tube Wall Material Thermal Conductivity"); Dotube                  as length               (Brief="Tube Outside Diameter",Lower=10e-6); Ditube                  as length               (Brief="Tube Inside Diameter",Lower=10e-6); Donozzle_Tube   as length               (Brief="Tube Outlet Nozzle Diameter",Lower=10e-6); Dinozzle_Tube   as length               (Brief="Tube Inlett Nozzle Diameter",Lower=10e-6); #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# #                               Tubes Geometrical Parameters                                            # #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# Ntt                       as Integer            (Brief="Total Number of Tubes in Shell",Default=100,Lower=1); Pattern       as Integer                (Brief="Tube Layout Characteristic Angle",Lower=30); Ltube             as length                     (Brief="Effective Tube Length",Lower=0.1); pitch             as length                     (Brief="Tube Pitch",Lower=1e-8); Kwall             as conductivity       (Brief="Tube Wall Material Thermal Conductivity"); Dotube            as length                     (Brief="Tube Outside Diameter",Lower=10e-6); Ditube            as length                     (Brief="Tube Inside Diameter",Lower=10e-6); Donozzle_Tube as length                 (Brief="Tube Outlet Nozzle Diameter",Lower=10e-6); Dinozzle_Tube as length                 (Brief="Tube Inlet Nozzle Diameter",Lower=10e-6); Aonozzle_Tube as area                   (Brief="Tube Outlet Nozzle Area",Lower=10e-6); Ainozzle_Tube as area                   (Brief="Tube Inlet Nozzle Area",Lower=10e-6); Kinlet_Tube   as positive               (Brief="Tube Inlet Nozzle Pressure Loss Coeff",Default=1.1); Koutlet_Tube  as positive               (Brief="Tube Outlet Nozzle Pressure Loss Coeff",Default=0.7); #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# #       Baffles Geometrical Parameters then "Shell Side inlet Nozzle rho-V^2" Unity(1).Shell.PressureDrop.RVsquare_in = Unity(1).Properties.Hot.Inlet.rho*(Unity(1).Shell.PressureDrop.Vnozzle_in)^2; "Pressure Drop Tube Side Inlet Nozzle" Unity(1).Tubes.PressureDrop.Pdnozzle_in = HE.DeltaPtubeNozzlein(Unity(1).Properties.Cold.Inlet.rho,Unity(1).Properties.Cold.Inlet.Fw); Unity(1).Tubes.PressureDrop.Pdnozzle_in = 0.5*Kinlet_Tube*Unity(1).Properties.Cold.Inlet.rho*Unity(1).Tubes.PressureDrop.Vnozzle_in^2; "Velocity Tube Side Inlet Nozzle" Unity(1).Tubes.PressureDrop.Vnozzle_in  = HE.TubeVelocityNozzlein(Unity(1).Properties.Cold.Inlet.rho,Unity(1).Properties.Cold.Inlet.Fw); Unity(1).Tubes.PressureDrop.Vnozzle_in  = Unity(1).Properties.Cold.Inlet.Fw/(Unity(1).Properties.Cold.Inlet.rho*Ainozzle_Tube); "Pressure Drop Tube Side Outlet Nozzle" Unity(Nb+1).Tubes.PressureDrop.Pdnozzle_out     = HE.DeltaPtubeNozzleout(Unity(Nb+1).Properties.Cold.Outlet.rho,Unity(Nb+1).Properties.Cold.Inlet.Fw); Unity(Nb+1).Tubes.PressureDrop.Pdnozzle_out     = 0.5*Koutlet_Tube*Unity(Nb+1).Properties.Cold.Outlet.rho*Unity(Nb+1).Tubes.PressureDrop.Vnozzle_out^2; "Velocity Tube Side Outlet Nozzle" Unity(Nb+1).Tubes.PressureDrop.Vnozzle_out      = HE.TubeVelocityNozzleout(Unity(Nb+1).Properties.Cold.Outlet.rho,Unity(Nb+1).Properties.Cold.Inlet.Fw); Unity(Nb+1).Tubes.PressureDrop.Vnozzle_out      = Unity(Nb+1).Properties.Cold.Inlet.Fw/(Unity(Nb+1).Properties.Cold.Outlet.rho*Aonozzle_Tube); "Shell Pressure Drop Inlet Nozzle" Unity(1).Shell.PressureDrop.Pdnozzle_in = HE.DeltaPshellNozzleIn(Unity(1).Properties.Hot.Inlet.rho,Unity(1).Properties.Hot.Inlet.Fw); Unity(1).Shell.PressureDrop.Pdnozzle_in = (0.5*Unity(1).Properties.Hot.Inlet.Fw^2/Unity(1).Properties.Hot.Inlet.rho)*((1/Ainozzle_Shell^2)+(1/Aeinozzle_Shell^2)); "Velocity Shell Side Inlet Nozzle" Unity(1).Shell.PressureDrop.Vnozzle_in  = HE.ShellVelocityNozzleIn(Unity(1).Properties.Hot.Inlet.rho,Unity(1).Properties.Hot.Inlet.Fw); Unity(1).Shell.PressureDrop.Vnozzle_in  = Unity(1).Properties.Hot.Inlet.Fw/(Unity(1).Properties.Hot.Inlet.rho*Ainozzle_Shell); "Shell Pressure Drop Outlet Nozzle" Unity(Nb+1).Shell.PressureDrop.Pdnozzle_out     =HE.DeltaPshellNozzleOut(Unity(Nb+1).Properties.Hot.Outlet.rho,Unity(Nb+1).Properties.Hot.Inlet.Fw); Unity(Nb+1).Shell.PressureDrop.Pdnozzle_out     = (0.5*Unity(Nb+1).Properties.Hot.Outlet.Fw^2/Unity(Nb+1).Properties.Hot.Outlet.rho)*((1/Ainozzle_Shell^2)+(1/Aeinozzle_Shell^2)); "Velocity Shell Side Outlet Nozzle" Unity(Nb+1).Shell.PressureDrop.Vnozzle_out      =HE.ShellVelocityNozzleOut(Unity(Nb+1).Properties.Hot.Outlet.rho,Unity(Nb+1).Properties.Hot.Inlet.Fw); Unity(Nb+1).Shell.PressureDrop.Vnozzle_out      = Unity(Nb+1).Properties.Hot.Outlet.Fw/(Unity(Nb+1).Properties.Hot.Outlet.rho*Aonozzle_Shell); else "Shell Side inlet Nozzle rho-V^2" Unity(1).Shell.PressureDrop.RVsquare_in = Unity(1).Properties.Cold.Inlet.rho*(Unity(1).Shell.PressureDrop.Vnozzle_in)^2; Unity(Nb+1).Baffles.Lsi,Unity(Nb+1).Properties.Cold.Inlet.Fw,Unity(Nb+1).Shell.HeatTransfer.Phi,Unity(Nb+1).Properties.Cold.Average.rho); "Pressure Drop Tube Side Inlet Nozzle" Unity(1).Tubes.PressureDrop.Pdnozzle_in = HE.DeltaPtubeNozzlein(Unity(1).Properties.Hot.Inlet.rho,Unity(1).Properties.Hot.Inlet.Fw); Unity(1).Tubes.PressureDrop.Pdnozzle_in = 0.5*Kinlet_Tube*Unity(1).Properties.Hot.Inlet.rho*Unity(1).Tubes.PressureDrop.Vnozzle_in^2; "Velocity Tube Side Inlet Nozzle" Unity(1).Tubes.PressureDrop.Vnozzle_in  = HE.TubeVelocityNozzlein(Unity(1).Properties.Hot.Inlet.rho,Unity(1).Properties.Hot.Inlet.Fw); Unity(1).Tubes.PressureDrop.Vnozzle_in  = Unity(1).Properties.Hot.Inlet.Fw/(Unity(1).Properties.Hot.Inlet.rho*Ainozzle_Tube); "Pressure Drop Tube Side Outlet Nozzle" Unity(Nb+1).Tubes.PressureDrop.Pdnozzle_out     = HE.DeltaPtubeNozzleout(Unity(Nb+1).Properties.Hot.Outlet.rho,Unity(Nb+1).Properties.Hot.Inlet.Fw); Unity(Nb+1).Tubes.PressureDrop.Pdnozzle_out     = 0.5*Koutlet_Tube*Unity(Nb+1).Properties.Hot.Outlet.rho*Unity(Nb+1).Tubes.PressureDrop.Vnozzle_out^2; "Velocity Tube Side Outlet Nozzle" Unity(Nb+1).Tubes.PressureDrop.Vnozzle_out      = HE.TubeVelocityNozzleout(Unity(Nb+1).Properties.Hot.Outlet.rho,Unity(Nb+1).Properties.Hot.Inlet.Fw); Unity(Nb+1).Tubes.PressureDrop.Vnozzle_out      = Unity(Nb+1).Properties.Hot.Inlet.Fw/(Unity(Nb+1).Properties.Hot.Outlet.rho*Aonozzle_Tube); "Shell Pressure Drop Inlet Nozzle" Unity(1).Shell.PressureDrop.Pdnozzle_in = HE.DeltaPshellNozzleIn(Unity(1).Properties.Cold.Inlet.rho,Unity(1).Properties.Cold.Inlet.Fw); Unity(1).Shell.PressureDrop.Pdnozzle_in = (0.5*Unity(1).Properties.Cold.Inlet.Fw^2/Unity(1).Properties.Cold.Inlet.rho)*((1/Ainozzle_Shell^2)+(1/Aeinozzle_Shell^2)); "Velocity Shell Side Inlet Nozzle" Unity(1).Shell.PressureDrop.Vnozzle_in  = HE.ShellVelocityNozzleIn(Unity(1).Properties.Cold.Inlet.rho,Unity(1).Properties.Cold.Inlet.Fw); Unity(1).Shell.PressureDrop.Vnozzle_in  = Unity(1).Properties.Cold.Inlet.Fw/(Unity(1).Properties.Cold.Inlet.rho*Ainozzle_Shell); "Shell Pressure Drop Outlet Nozzle" Unity(Nb+1).Shell.PressureDrop.Pdnozzle_out = HE.DeltaPshellNozzleOut(Unity(Nb+1).Properties.Cold.Outlet.rho,Unity(Nb+1).Properties.Cold.Inlet.Fw); Unity(Nb+1).Shell.PressureDrop.Pdnozzle_out = (0.5*Unity(Nb+1).Properties.Cold.Outlet.Fw^2/Unity(Nb+1).Properties.Cold.Outlet.rho)*((1/Ainozzle_Shell^2)+(1/Aeinozzle_Shell^2)); "Velocity Shell Side Outlet Nozzle" Unity(Nb+1).Shell.PressureDrop.Vnozzle_out  = HE.ShellVelocityNozzleOut(Unity(Nb+1).Properties.Cold.Outlet.rho,Unity(Nb+1).Properties.Cold.Inlet.Fw); Unity(Nb+1).Shell.PressureDrop.Vnozzle_out  = Unity(Nb+1).Properties.Cold.Outlet.Fw/(Unity(Nb+1).Properties.Cold.Outlet.rho*Ainozzle_Shell); HE.Ltd                          = Ltd; side                            = HE.FluidAlocation(); end #"Tube Side Inlet Nozzle Area" Ainozzle_Tube = (Pi*Dinozzle_Tube*Dinozzle_Tube)/4; #"Tube Side Outlet Nozzle Area" Aonozzle_Tube = (Pi*Donozzle_Tube*Donozzle_Tube)/4; #"Tube Inlet Nozzle Pressure Loss Coeff" Kinlet_Tube   = 1.1; #"Tube Outlet Nozzle Pressure Loss Coeff" Koutlet_Tube  = 0.7; #"Shell Outlet Nozzle Area" Aonozzle_Shell  = (Pi*Donozzle_Shell*Donozzle_Shell)/4; #"Shell Inlet Nozzle Area" Ainozzle_Shell  = (Pi*Dinozzle_Shell*Dinozzle_Shell)/4; #"Shell Outlet Escape Area Under Nozzle" Aeonozzle_Shell = Pi*Donozzle_Shell*Honozzle_Shell + 0.6*Aonozzle_Shell*(1-Dotube/pitch); #"Shell Inlet Escape Area Under Nozzle" Aeinozzle_Shell = Pi*Dinozzle_Shell*Hinozzle_Shell + 0.6*Ainozzle_Shell*(1-Dotube/pitch); end
• ## mso/sample/heat_exchangers/Eshell_Detailed_LMTD.mso

 r100 exchanger.Pattern               = 30; exchanger.pitch                 = 0.0254        *"m"; exchanger.Ltube                 = 5.5   *"m"; exchanger.Ltube                 = 5.5           *"m"; exchanger.Ditube                = 0.013395  *"m"; exchanger.Dotube                = 0.015875      *"m"; exchanger.Dotube                = 0.015875  *"m"; exchanger.Kwall                         = 0.057         *"kW/m/K"; exchanger.Donozzle_Tube     = 0.203     *"m";
• ## mso/sample/heat_exchangers/Multipass_Detailed.mso

 r100 #   Simulation Options #============================================ mode                   = "steady"; mode      = "steady"; guessFile  = "Multipass_LMTD"; end
• ## mso/sample/heat_exchangers/Sample_DoublePipe.mso

 r100 DEVICES exchanger       as DoublePipe_NTU; exchanger       as DoublePipe_LMTD; streamhot       as streamTP; streamcold      as streamTP;
• ## mso/sample/heat_exchangers/Sample_Multitubular.mso

 r100 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ streamcold.F = 5                        * "kmol/h"; streamcold.F = 5                        * "kmol/h"; streamcold.P = 5                * "bar"; streamcold.T = (25+273.15)      * "K"; streamcold.z = [0,1]; #===================================================================== #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #       Fouling #===================================================================== #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Pipe.Unity.Resistances.Rfi = 0*"m^2*K/kW"; Pipe.Unity.Resistances.Rfo = 0*"m^2*K/kW"; OPTIONS mode            = "steady"; mode    = "steady"; end
Note: See TracChangeset for help on using the changeset viewer.