Changeset 45 for mso


Ignore:
Timestamp:
Nov 7, 2006, 2:11:10 PM (16 years ago)
Author:
gerson bicca
Message:

updated heat exchanger model

Location:
mso
Files:
25 edited

Legend:

Unmodified
Added
Removed
  • mso/eml/heat_exchangers/HEX_Engine.mso

    r26 r45  
    147147#===================================================================== 
    148148VARIABLES
    149 Re                      as positive                     (Brief="Tube Side Reynolds Number",Default=1000,Lower=1);
    150 htube           as heat_trans_coeff     (Brief="Tube Side Film Coefficient",Default=1,Lower=1e-12, Upper=1e6);
    151 PR                      as positive                     (Brief="Tube Side Prandtl Number",Default=0.5,Lower=1e-8);
    152 PRw             as positive                     (Brief="Tube Side Prandtl Number at Wall Temperature",Default=0.5,Lower=1e-8);
    153 Phi             as positive                     (Brief="Phi Correction",Default=1,Lower=1e-3);
    154 Vtube           as velocity                     (Brief="Tube Side Velocity",Lower=1e-8);
     149Re        as positive             (Brief="Tube Side Reynolds Number",Default=1000,Lower=1);
     150htube as heat_trans_coeff (Brief="Tube Side Film Coefficient",Default=1,Lower=1e-12, Upper=1e6);
     151PR        as positive             (Brief="Tube Side Prandtl Number",Default=0.5,Lower=1e-8);
     152PRw   as positive                 (Brief="Tube Side Prandtl Number at Wall Temperature",Default=0.5,Lower=1e-8);
     153Phi   as positive                 (Brief="Phi Correction",Default=1,Lower=1e-3);
     154Vtube as velocity                 (Brief="Tube Side Velocity",Lower=1e-8);
    155155end
    156156
  • mso/eml/heat_exchangers/HeatExchangerDetailed.mso

    r26 r45  
    88
    99#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
    10 #       Basic Model for Detailed Heat Exchangers
     10#       Basic Model for Detailed Shell and Tubes Heat Exchangers
    1111#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
    1212
     
    1616
    1717ext PP          as CalcObject   (Brief="External Physical Properties");
    18 ext HE          as CalcObject   (Brief="STHE Calculations",     File="heatex");
    1918ext NComp       as Integer      (Brief="Number of Components");
    20   M(NComp)      as molweight    (Brief="Component Mol Weight");
     19        HE              as CalcObject   (Brief="STHE Calculations",File="heatex");
     20        M(NComp)        as molweight    (Brief="Component Mol Weight");
    2121       
    2222VARIABLES
     23
    2324in  Inlet               as Inlet_Main_Stream;   
    2425out Outlet              as Outlet_Main_Stream; 
     
    3940#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
    4041
    41 "HotStream Stream Average Temperature"
     42"Hot Stream Average Temperature"
    4243        Properties.Hot.Average.T = 0.5*Inlet.Hot.T + 0.5*Outlet.Hot.T;
    4344       
     
    4546        Properties.Cold.Average.T = 0.5*Inlet.Cold.T + 0.5*Outlet.Cold.T;
    4647       
    47 "HotStream Stream Average Pressure"
     48"Hot Stream Average Pressure"
    4849        Properties.Hot.Average.P = 0.5*Inlet.Hot.P+0.5*Outlet.Hot.P;
    4950       
     
    6263        then   
    6364       
    64 "Heat Capacity Cold Stream"
     65"Cold Stream Average Heat Capacity"
    6566        Properties.Cold.Average.Cp      =       PP.LiquidCp(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
     67
     68"Cold Stream Inlet Heat Capacity"
    6669        Properties.Cold.Inlet.Cp        =       PP.LiquidCp(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
     70
     71"Cold Stream Outlet Heat Capacity"
    6772        Properties.Cold.Outlet.Cp       =       PP.LiquidCp(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
    6873
    69 "Mass Density Cold Stream"
     74"Cold Stream Average Mass Density"
    7075        Properties.Cold.Average.rho =   PP.LiquidDensity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
     76
     77"Cold Stream Inlet Mass Density"
    7178        Properties.Cold.Inlet.rho       =       PP.LiquidDensity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
     79
     80"Cold Stream Outlet Mass Density"
    7281        Properties.Cold.Outlet.rho      =       PP.LiquidDensity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
    7382
    74 "Viscosity Cold Stream"
     83"Cold Stream Average Viscosity"
    7584        Properties.Cold.Average.Mu      =       PP.LiquidViscosity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
     85
     86"Cold Stream inlet Viscosity"
    7687        Properties.Cold.Inlet.Mu        =       PP.LiquidViscosity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
     88       
     89"Cold Stream Outlet Viscosity"
    7790        Properties.Cold.Outlet.Mu       =       PP.LiquidViscosity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
    7891
    79 "Conductivity Cold Stream"
     92"Cold Stream Average Conductivity"
    8093        Properties.Cold.Average.K       =       PP.LiquidThermalConductivity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
     94
     95"Cold Stream Inlet Conductivity"       
    8196        Properties.Cold.Inlet.K         =       PP.LiquidThermalConductivity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
     97
     98"Cold Stream Outlet Conductivity"
    8299        Properties.Cold.Outlet.K        =       PP.LiquidThermalConductivity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
    83100
    84 "Heat Capacity Cold Stream"
     101"Cold Stream Heat Capacity at Wall Temperature"
    85102        Properties.Cold.Wall.Cp         =       PP.LiquidCp(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
    86103       
    87 "Viscosity Cold Stream"
     104"Cold Stream Viscosity at Wall Temperature"
    88105        Properties.Cold.Wall.Mu         =       PP.LiquidViscosity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
    89106
    90 "Conductivity Cold Stream"
     107"Cold Stream Conductivity at Wall Temperature"
    91108        Properties.Cold.Wall.K          =       PP.LiquidThermalConductivity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
    92109
     
    94111        else
    95112
    96 "Heat Capacity Cold Stream"
     113"Cold Stream Average Heat Capacity"
    97114        Properties.Cold.Average.Cp      =       PP.VapourCp(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
     115
     116"Cold Stream Inlet Heat Capacity"       
    98117        Properties.Cold.Inlet.Cp        =       PP.VapourCp(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
     118
     119"Cold Stream Outlet Heat Capacity"     
    99120        Properties.Cold.Outlet.Cp       =       PP.VapourCp(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
    100121
    101 "Mass Density Cold Stream"
     122"Cold Stream Average Mass Density"
    102123        Properties.Cold.Average.rho =   PP.VapourDensity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
     124
     125"Cold Stream Inlet Mass Density"
    103126        Properties.Cold.Inlet.rho       =       PP.VapourDensity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
     127
     128"Cold Stream Outlet Mass Density"       
    104129        Properties.Cold.Outlet.rho      =       PP.VapourDensity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
    105130
    106 "Viscosity Cold Stream"
     131"Cold Stream Average Viscosity "
    107132        Properties.Cold.Average.Mu      =       PP.VapourViscosity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
     133
     134"Cold Stream Inlet Viscosity " 
    108135        Properties.Cold.Inlet.Mu        =       PP.VapourViscosity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
     136
     137"Cold Stream Outlet Viscosity "
    109138        Properties.Cold.Outlet.Mu       =       PP.VapourViscosity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
    110139
    111 "Conductivity Cold Stream"
     140"Cold Stream Average Conductivity "
    112141        Properties.Cold.Average.K       =       PP.VapourThermalConductivity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
     142
     143"Cold Stream Inlet Conductivity "
    113144        Properties.Cold.Inlet.K         =       PP.VapourThermalConductivity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
     145
     146"Cold Stream Outlet Conductivity "
    114147        Properties.Cold.Outlet.K        =       PP.VapourThermalConductivity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
    115148       
    116 "Heat Capacity Cold Stream"
     149"Cold Stream Heat Capacity at Wall Temperature"
    117150        Properties.Cold.Wall.Cp         =       PP.VapourCp(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
    118151
    119152
    120 "Viscosity Cold Stream"
     153"Cold Stream Viscosity at Wall Temperature"
    121154        Properties.Cold.Wall.Mu         =       PP.VapourViscosity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
    122155
    123 "Conductivity Cold Stream"
     156"Cold Stream Conductivity at Wall Temperature"
    124157        Properties.Cold.Wall.K          =       PP.VapourThermalConductivity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
    125158       
     
    271304#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
    272305ext PP          as CalcObject   (Brief="External Physical Properties");
    273 ext     HE              as CalcObject   (Brief="STHE Calculations",File="heatex");
    274306side        as Integer          (Brief="Fluid Alocation Flag",Lower=0,Upper=1);
    275307Pi                      as constant     (Brief="Pi Number",Default=3.14159265);
    276 
    277308#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
    278309#                               Shell Geometrical Parameters                                            #
     
    417448        then
    418449       
    419 "Wall Temperature"
    420 #       Properties.Hot.Wall.Twall = HE.WallTemperature(Properties.Hot.Average.T,Properties.Cold.Average.T,Tubes.HeatTransfer.htube,Shell.HeatTransfer.hshell);
    421 
    422 #       Properties.Cold.Wall.Twall = HE.WallTemperature(Properties.Cold.Average.T,Properties.Hot.Average.T,Tubes.HeatTransfer.htube,Shell.HeatTransfer.hshell);
    423 
    424 Properties.Hot.Wall.Twall  = (Properties.Hot.Average.T+Properties.Cold.Average.T)/2;
    425 
    426 Properties.Cold.Wall.Twall  = (Properties.Hot.Average.T+Properties.Cold.Average.T)/2;
     450"Hot Wall Temperature"
     451        Properties.Hot.Wall.Twall  = (Properties.Hot.Average.T+Properties.Cold.Average.T)/2;
     452
     453"ColdWall Temperature"
     454        Properties.Cold.Wall.Twall  = (Properties.Hot.Average.T+Properties.Cold.Average.T)/2;
    427455
    428456"Tube Side Velocity"
    429         Tubes.HeatTransfer.Vtube  = HE.TubeVelocity(Properties.Cold.Inlet.Fw,Properties.Cold.Average.rho);
     457        Tubes.HeatTransfer.Vtube  = Properties.Cold.Inlet.Fw*Tpass/((Pi*Ditube*Ditube/4)*Properties.Cold.Average.rho*Ntt);
    430458
    431459"Tube Side Reynolds Number"
    432         Tubes.HeatTransfer.Re = HE.TubeReynoldsNumber(Properties.Cold.Average.rho,Tubes.HeatTransfer.Vtube,Properties.Cold.Average.Mu);
     460        Tubes.HeatTransfer.Re     =     (Properties.Cold.Average.rho*Tubes.HeatTransfer.Vtube*Ditube)/Properties.Cold.Average.Mu;
    433461       
    434462"Tube Side Prandtl Number"
    435         Tubes.HeatTransfer.PR = HE.PrandtlNumber(Properties.Cold.Average.K,Properties.Cold.Average.Cp,Properties.Cold.Average.Mw,Properties.Cold.Average.Mu);
     463        Tubes.HeatTransfer.PR = ((Properties.Cold.Average.Cp/Properties.Cold.Average.Mw)*Properties.Cold.Average.Mu)/Properties.Cold.Average.K;
    436464
    437465"Tube Side Prandtl Number at Wall Temperature"
    438         Tubes.HeatTransfer.PRw = HE.PrandtlNumber(Properties.Cold.Wall.K,Properties.Cold.Wall.Cp,Properties.Cold.Average.Mw,Properties.Cold.Wall.Mu);
     466        Tubes.HeatTransfer.PRw = ((Properties.Cold.Wall.Cp/Properties.Cold.Average.Mw)*Properties.Cold.Wall.Mu)/Properties.Cold.Wall.K;
    439467
    440468"Tube Side Film Coefficient"
    441         Tubes.HeatTransfer.htube= HE.TubeFilmCoeff(Tubes.HeatTransfer.Re,Tubes.HeatTransfer.PR,Properties.Cold.Average.K,Tubes.HeatTransfer.Phi);
    442        
     469        Tubes.HeatTransfer.htube= HE.TubeFilmCoeff(Tubes.HeatTransfer.Re,Tubes.HeatTransfer.PR,Properties.Cold.Average.K)*Tubes.HeatTransfer.Phi;
     470
    443471"Shell Side Prandtl Number"
    444         Shell.HeatTransfer.PR=HE.PrandtlNumber(Properties.Hot.Average.K,Properties.Hot.Average.Cp,Properties.Hot.Average.Mw,Properties.Hot.Average.Mu);
     472        Shell.HeatTransfer.PR = ((Properties.Hot.Average.Cp/Properties.Hot.Average.Mw)*Properties.Hot.Average.Mu)/Properties.Hot.Average.K;
    445473
    446474"Shell Side Prandtl Number at Wall Temperature"
    447         Shell.HeatTransfer.PRw = HE.PrandtlNumber(Properties.Hot.Wall.K,Properties.Hot.Wall.Cp,Properties.Hot.Average.Mw,Properties.Hot.Wall.Mu);       
     475        Shell.HeatTransfer.PRw = ((Properties.Hot.Wall.Cp/Properties.Hot.Average.Mw)*Properties.Hot.Wall.Mu)/Properties.Hot.Wall.K;
    448476
    449477"Tube Side Pressure Drop"
     
    483511        else
    484512
    485 "Wall Temperature"
    486 #       Properties.Cold.Wall.Twall = HE.WallTemperature(Properties.Cold.Average.T,Properties.Hot.Average.T,Tubes.HeatTransfer.htube,Shell.HeatTransfer.hshell);
    487 
    488 #       Properties.Hot.Wall.Twall = HE.WallTemperature(Properties.Hot.Average.T,Properties.Cold.Average.T,Tubes.HeatTransfer.htube,Shell.HeatTransfer.hshell);
    489 
    490 
    491 Properties.Hot.Wall.Twall  = (Properties.Hot.Average.T+Properties.Cold.Average.T)/2;
    492 
    493 Properties.Cold.Wall.Twall  = (Properties.Hot.Average.T+Properties.Cold.Average.T)/2;
     513"Hot Wall Temperature"
     514        Properties.Hot.Wall.Twall  = (Properties.Hot.Average.T+Properties.Cold.Average.T)/2;
     515
     516"Cold Wall Temperature"
     517        Properties.Cold.Wall.Twall  = (Properties.Hot.Average.T+Properties.Cold.Average.T)/2;
    494518
    495519"Tube Side Velocity"
    496         Tubes.HeatTransfer.Vtube=HE.TubeVelocity(Properties.Hot.Inlet.Fw,Properties.Hot.Average.rho);
     520        Tubes.HeatTransfer.Vtube  = Properties.Hot.Inlet.Fw*Tpass/((Pi*Ditube*Ditube/4)*Properties.Hot.Average.rho*Ntt);
    497521
    498522"Tube Side Reynolds Number"
    499         Tubes.HeatTransfer.Re=HE.TubeReynoldsNumber(Properties.Hot.Average.rho,Tubes.HeatTransfer.Vtube,Properties.Hot.Average.Mu);
    500        
     523        Tubes.HeatTransfer.Re=(Properties.Hot.Average.rho*Tubes.HeatTransfer.Vtube*Ditube)/Properties.Hot.Average.Mu;
     524
    501525"Tube Side Prandtl Number"
    502         Tubes.HeatTransfer.PR=HE.PrandtlNumber(Properties.Hot.Average.K,Properties.Hot.Average.Cp,Properties.Hot.Average.Mw,Properties.Hot.Average.Mu);
     526        Tubes.HeatTransfer.PR = ((Properties.Hot.Average.Cp/Properties.Hot.Average.Mw)*Properties.Hot.Average.Mu)/Properties.Hot.Average.K;
    503527
    504528"Tube Side Prandtl Number at Wall"
    505         Tubes.HeatTransfer.PRw=HE.PrandtlNumber(Properties.Hot.Wall.K,Properties.Hot.Wall.Cp,Properties.Hot.Average.Mw,Properties.Hot.Wall.Mu);
     529        Tubes.HeatTransfer.PRw = ((Properties.Hot.Wall.Cp/Properties.Hot.Average.Mw)*Properties.Hot.Wall.Mu)/Properties.Hot.Wall.K;
    506530
    507531"Tube Side Film Coefficient"
    508         Tubes.HeatTransfer.htube= HE.TubeFilmCoeff(Tubes.HeatTransfer.Re,Tubes.HeatTransfer.PR,Properties.Hot.Average.K,Tubes.HeatTransfer.Phi);
     532        Tubes.HeatTransfer.htube= HE.TubeFilmCoeff(Tubes.HeatTransfer.Re,Tubes.HeatTransfer.PR,Properties.Hot.Average.K)*Tubes.HeatTransfer.Phi;
    509533       
    510534"Shell Side Prandtl Number"
    511         Shell.HeatTransfer.PR=HE.PrandtlNumber(Properties.Cold.Average.K,Properties.Cold.Average.Cp,Properties.Cold.Average.Mw,Properties.Cold.Average.Mu);
     535        Shell.HeatTransfer.PR = ((Properties.Cold.Average.Cp/Properties.Cold.Average.Mw)*Properties.Cold.Average.Mu)/Properties.Cold.Average.K;
    512536
    513537"Shell Side Prandtl Number at Wall"
    514         Shell.HeatTransfer.PRw=HE.PrandtlNumber(Properties.Cold.Wall.K,Properties.Cold.Wall.Cp,Properties.Cold.Average.Mw,Properties.Cold.Wall.Mu);
     538        Shell.HeatTransfer.PRw=((Properties.Cold.Wall.Cp/Properties.Cold.Average.Mw)*Properties.Cold.Wall.Mu)/Properties.Cold.Wall.K;
    515539
    516540"Tube Side Pressure Drop"
     
    546570"Pressure Drop Cold Stream"
    547571        Outlet.Cold.P  = Inlet.Cold.P - Shell.PressureDrop.Pdtotal;
    548 
    549572
    550573end
     
    598621       
    599622VARIABLES
    600 LMTD            as temp_delta   (Brief="Logarithmic Mean Temperature Difference",Lower=5);
    601 Fc                      as positive             (Brief="LMTD Correction Factor",Lower=0.4);
    602 MTD                     as temp_delta   (Brief="Mean Temperature Difference",Lower=5);
     623DT0     as temp_delta   (Brief="Temperature Difference at Inlet",Lower=1);
     624DTL             as temp_delta   (Brief="Temperature Difference at Outlet",Lower=1);
     625LMTD    as temp_delta   (Brief="Logarithmic Mean Temperature Difference",Lower=5);
     626Fc              as positive             (Brief="LMTD Correction Factor",Lower=0.4);
     627MTD             as temp_delta   (Brief="Mean Temperature Difference",Lower=5);
    603628
    604629EQUATIONS
     630#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
     631#                       Log Mean Temperature Difference
     632#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
     633if abs(DT0 - DTL) > 0.05*max(abs([DT0,DTL]))
     634       
     635        then
     636"Log Mean Temperature Difference"
     637        LMTD= (DT0-DTL)/ln(DT0/DTL);
     638
     639        else
     640       
     641if DT0*DTL equal 0
     642       
     643        then
     644"Log Mean Temperature Difference"
     645        LMTD = 0.5*(DT0+DTL);
     646       
     647        else
     648"Log Mean Temperature Difference"
     649        LMTD = 0.5*(DT0+DTL)*(1-(DT0-DTL)^2/(DT0*DTL)*(1+(DT0-DTL)^2/(DT0*DTL)/2)/12);
     650       
     651end
     652       
     653end
    605654
    606655"Exchange Surface Area"
     
    608657       
    609658"Mean Temperature Difference"   
    610         MTD   = Fc*LMTD;
     659        MTD = Fc*LMTD;
    611660       
    612661end
     
    630679       
    631680"Shell Side Reynolds Number"
    632         Shell.HeatTransfer.Re=HE.ShellReynoldsNumber(Properties.Hot.Inlet.Fw,Shell.HeatTransfer.Sm,Properties.Hot.Average.Mu);
     681        Shell.HeatTransfer.Re=(Dotube*Properties.Hot.Inlet.Fw/Shell.HeatTransfer.Sm)/Properties.Hot.Average.Mu;
    633682
    634683"Shell Heat Transfer Coefficient"
    635         Shell.HeatTransfer.hshell=HE.ShellFilmCoeff(Shell.HeatTransfer.Ji,Properties.Hot.Average.Cp,Properties.Hot.Average.Mw,Properties.Hot.Inlet.Fw,Shell.HeatTransfer.Sm,Shell.HeatTransfer.PR,Shell.HeatTransfer.Jtotal,Shell.HeatTransfer.Phi);
     684        Shell.HeatTransfer.hshell=Shell.HeatTransfer.Ji*(Properties.Hot.Average.Cp/Properties.Hot.Average.Mw)*(Properties.Hot.Inlet.Fw/Shell.HeatTransfer.Sm)*(Shell.HeatTransfer.PR^(-2/3))*Shell.HeatTransfer.Jtotal*Shell.HeatTransfer.Phi;
    636685
    637686"Shell Pressure Drop Cross Flow"
     
    648697
    649698"Shell Side Reynolds Number"
    650         Shell.HeatTransfer.Re=HE.ShellReynoldsNumber(Properties.Cold.Inlet.Fw,Shell.HeatTransfer.Sm,Properties.Cold.Average.Mu);
     699        Shell.HeatTransfer.Re=(Dotube*Properties.Cold.Inlet.Fw/Shell.HeatTransfer.Sm)/Properties.Cold.Average.Mu;
    651700
    652701"Shell Heat Transfer Coefficient"
    653         Shell.HeatTransfer.hshell=HE.ShellFilmCoeff(Shell.HeatTransfer.Ji,Properties.Cold.Average.Cp,Properties.Cold.Average.Mw,Properties.Cold.Inlet.Fw,Shell.HeatTransfer.Sm,Shell.HeatTransfer.PR,Shell.HeatTransfer.Jtotal,Shell.HeatTransfer.Phi);
     702        Shell.HeatTransfer.hshell=Shell.HeatTransfer.Ji*(Properties.Cold.Average.Cp/Properties.Cold.Average.Mw)*(Properties.Cold.Inlet.Fw/Shell.HeatTransfer.Sm)*(Shell.HeatTransfer.PR^(-2/3))*Shell.HeatTransfer.Jtotal*Shell.HeatTransfer.Phi;
    654703
    655704"Shell Pressure Drop Cross Flow"
     
    691740       
    692741"Shell Side Reynolds Number"
    693         Shell.HeatTransfer.Re= HE.ShellReynoldsNumber(Properties.Hot.Inlet.Fw,Shell.HeatTransfer.Sm,Properties.Hot.Average.Mu);
     742        Shell.HeatTransfer.Re=(Dotube*Properties.Hot.Inlet.Fw/Shell.HeatTransfer.Sm)/Properties.Hot.Average.Mu;
    694743
    695744"Shell Heat Transfer Coefficient"
    696         Shell.HeatTransfer.hshell= HE.ShellFilmCoeff(Shell.HeatTransfer.Ji,Properties.Hot.Average.Cp,Properties.Hot.Average.Mw,Properties.Hot.Inlet.Fw,Shell.HeatTransfer.Sm,Shell.HeatTransfer.PR,Shell.HeatTransfer.Jtotal,Shell.HeatTransfer.Phi);
     745        Shell.HeatTransfer.hshell= Shell.HeatTransfer.Ji*(Properties.Hot.Average.Cp/Properties.Hot.Average.Mw)*(Properties.Hot.Inlet.Fw/Shell.HeatTransfer.Sm)*(Shell.HeatTransfer.PR^(-2/3))*Shell.HeatTransfer.Jtotal*Shell.HeatTransfer.Phi;
    697746
    698747"Shell Pressure Drop Cross Flow"
     
    709758
    710759"Shell Side Reynolds Number"
    711         Shell.HeatTransfer.Re=HE.ShellReynoldsNumber(Properties.Cold.Inlet.Fw,Shell.HeatTransfer.Sm,Properties.Cold.Average.Mu);
     760        Shell.HeatTransfer.Re=(Dotube*Properties.Cold.Inlet.Fw/Shell.HeatTransfer.Sm)/Properties.Cold.Average.Mu;
    712761
    713762"Shell Heat Transfer Coefficient"
    714         Shell.HeatTransfer.hshell=HE.ShellFilmCoeff(Shell.HeatTransfer.Ji,Properties.Cold.Average.Cp,Properties.Cold.Average.Mw,Properties.Cold.Inlet.Fw,Shell.HeatTransfer.Sm,Shell.HeatTransfer.PR,Shell.HeatTransfer.Jtotal,Shell.HeatTransfer.Phi);
     763        Shell.HeatTransfer.hshell=Shell.HeatTransfer.Ji*(Properties.Cold.Average.Cp/Properties.Cold.Average.Mw)*(Properties.Cold.Inlet.Fw/Shell.HeatTransfer.Sm)*(Shell.HeatTransfer.PR^(-2/3))*Shell.HeatTransfer.Jtotal*Shell.HeatTransfer.Phi;
    715764
    716765"Shell Pressure Drop Cross Flow"
     
    735784PARAMETERS
    736785
    737 Nshell          as Integer              (Brief="N Shell in Series",Default=2);
    738 ext     HE              as CalcObject   (Brief="STHE Calculations",File="heatex.dll");
    739 ext PP          as CalcObject   (Brief="External Physical Properties");
    740 side        as Integer          (Brief="Fluid Alocation",Lower=0,Upper=1);
    741 Pi                      as constant     (Brief="Pi Number",Default=3.14159265);
     786        Nshell          as Integer              (Brief="N Shell in Series",Default=2);
     787ext PP                  as CalcObject   (Brief="External Physical Properties");
     788        HE                      as CalcObject   (Brief="heatex Calculations", File="heatex");
     789        side        as Integer          (Brief="Fluid Alocation",Lower=0,Upper=1);
     790        Pi                      as constant     (Brief="Pi Number",Default=3.14159265);
    742791
    743792#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
     
    780829
    781830Unity([1:Nshell-1]).Outlet.Hot  to Unity([2:Nshell]).Inlet.Hot;
    782 Unity([2:Nshell]).Outlet.Cold to Unity([1:Nshell-1]).Inlet.Cold;
     831Unity([2:Nshell]).Outlet.Cold   to Unity([1:Nshell-1]).Inlet.Cold;
    783832
    784833EQUATIONS
     
    790839
    791840"Ji Factor"
    792         Unity(i).Shell.HeatTransfer.Ji = HE.JiFactor(Unity(i).Shell.HeatTransfer.Re);
     841        Unity(i).Shell.HeatTransfer.Ji =HE.JiFactor(Unity(i).Shell.HeatTransfer.Re);
    793842
    794843"Jc Factor"
     
    841890
    842891"Tube Side Velocity"
    843         Unity(i).Tubes.HeatTransfer.Vtube  = HE.TubeVelocity(Unity(i).Properties.Cold.Inlet.Fw,Unity(i).Properties.Cold.Average.rho);
     892        Unity(i).Tubes.HeatTransfer.Vtube  = Unity(i).Properties.Cold.Inlet.Fw*Tpass/((Pi*Ditube*Ditube/4)*Unity(i).Properties.Cold.Average.rho*Ntt);
    844893
    845894"Tube Side Reynolds Number"
    846         Unity(i).Tubes.HeatTransfer.Re = HE.TubeReynoldsNumber(Unity(i).Properties.Cold.Average.rho,Unity(i).Tubes.HeatTransfer.Vtube,Unity(i).Properties.Cold.Average.Mu);
    847        
     895        Unity(i).Tubes.HeatTransfer.Re=(Unity(i).Properties.Cold.Average.rho*Unity(i).Tubes.HeatTransfer.Vtube*Ditube)/Unity(i).Properties.Cold.Average.Mu;
     896
    848897"Tube Side Prandtl Number"
    849         Unity(i).Tubes.HeatTransfer.PR = HE.PrandtlNumber(Unity(i).Properties.Cold.Average.K,Unity(i).Properties.Cold.Average.Cp,Unity(i).Properties.Cold.Average.Mw,Unity(i).Properties.Cold.Average.Mu);
     898        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;
    850899
    851900"Tube Side Prandtl Number at Wall Temperature"
    852         Unity(i).Tubes.HeatTransfer.PRw = HE.PrandtlNumber(Unity(i).Properties.Cold.Wall.K,Unity(i).Properties.Cold.Wall.Cp,Unity(i).Properties.Cold.Average.Mw,Unity(i).Properties.Cold.Wall.Mu);
     901        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;
    853902
    854903"Tube Side Film Coefficient"
    855         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);
     904        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;
    856905       
    857906"Shell Side Prandtl Number"
    858         Unity(i).Shell.HeatTransfer.PR=HE.PrandtlNumber(Unity(i).Properties.Hot.Average.K,Unity(i).Properties.Hot.Average.Cp,Unity(i).Properties.Hot.Average.Mw,Unity(i).Properties.Hot.Average.Mu);   
     907        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
    859908
    860909"Shell Side Prandtl Number at Wall Temperature"
    861         Unity(i).Shell.HeatTransfer.PRw = HE.PrandtlNumber(Unity(i).Properties.Hot.Wall.K,Unity(i).Properties.Hot.Wall.Cp,Unity(i).Properties.Hot.Average.Mw,Unity(i).Properties.Hot.Wall.Mu)
     910        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;       
    862911
    863912"Tube Side Pressure Drop"
     
    904953
    905954"Tube Side Velocity"
    906         Unity(i).Tubes.HeatTransfer.Vtube       =       HE.TubeVelocity(Unity(i).Properties.Hot.Inlet.Fw,Unity(i).Properties.Hot.Average.rho);
     955        Unity(i).Tubes.HeatTransfer.Vtube  = Unity(i).Properties.Hot.Inlet.Fw*Tpass/((Pi*Ditube*Ditube/4)*Unity(i).Properties.Hot.Average.rho*Ntt);
    907956
    908957"Tube Side Reynolds Number"
    909         Unity(i).Tubes.HeatTransfer.Re          =       HE.TubeReynoldsNumber(Unity(i).Properties.Hot.Average.rho,Unity(i).Tubes.HeatTransfer.Vtube,Unity(i).Properties.Hot.Average.Mu);
     958        Unity(i).Tubes.HeatTransfer.Re          =       (Unity(i).Properties.Hot.Average.rho*Unity(i).Tubes.HeatTransfer.Vtube*Ditube)/Unity(i).Properties.Hot.Average.Mu;
    910959       
    911960"Tube Side Prandtl Number"
    912         Unity(i).Tubes.HeatTransfer.PR          =       HE.PrandtlNumber(Unity(i).Properties.Hot.Average.K,Unity(i).Properties.Hot.Average.Cp,Unity(i).Properties.Hot.Average.Mw,Unity(i).Properties.Hot.Average.Mu);
     961        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;
    913962       
    914963"Tube Side Prandtl Number at Wall"
    915         Unity(i).Tubes.HeatTransfer.PRw     =  HE.PrandtlNumber(Unity(i).Properties.Hot.Wall.K,Unity(i).Properties.Hot.Wall.Cp,Unity(i).Properties.Hot.Average.Mw,Unity(i).Properties.Hot.Wall.Mu);
     964        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;
    916965
    917966"Tube Side Film Coefficient"
    918         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);
     967        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;
    919968       
    920969"Shell Side Prandtl Number"
    921         Unity(i).Shell.HeatTransfer.PR          =       HE.PrandtlNumber(Unity(i).Properties.Cold.Average.K,Unity(i).Properties.Cold.Average.Cp,Unity(i).Properties.Cold.Average.Mw,Unity(i).Properties.Cold.Average.Mu);
     970        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;
    922971       
    923972"Shell Side Prandtl Number at Wall"
    924         Unity(i).Shell.HeatTransfer.PRw     =   HE.PrandtlNumber(Unity(i).Properties.Cold.Wall.K,Unity(i).Properties.Cold.Wall.Cp,Unity(i).Properties.Cold.Average.Mw,Unity(i).Properties.Cold.Wall.Mu);
     973        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;
    925974
    926975"Tube Side Pressure Drop"
     
    10091058       
    10101059"Shell Side Reynolds Number"
    1011         Unity(i).Shell.HeatTransfer.Re=HE.ShellReynoldsNumber(Unity(i).Properties.Hot.Inlet.Fw,Unity(i).Shell.HeatTransfer.Sm,Unity(i).Properties.Hot.Average.Mu);
     1060        Unity(i).Shell.HeatTransfer.Re=(Dotube*Unity(i).Properties.Hot.Inlet.Fw/Unity(i).Shell.HeatTransfer.Sm)/Unity(i).Properties.Hot.Average.Mu;
    10121061
    10131062"Shell Heat Transfer Coefficient"
    1014         Unity(i).Shell.HeatTransfer.hshell=HE.ShellFilmCoeff(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,Unity(i).Shell.HeatTransfer.Jtotal,Unity(i).Shell.HeatTransfer.Phi);
     1063        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;
    10151064
    10161065"Shell Pressure Drop Cross Flow"
     
    10271076
    10281077"Shell Side Reynolds Number"
    1029         Unity(i).Shell.HeatTransfer.Re=HE.ShellReynoldsNumber(Unity(i).Properties.Cold.Inlet.Fw,Unity(i).Shell.HeatTransfer.Sm,Unity(i).Properties.Cold.Average.Mu);
     1078        Unity(i).Shell.HeatTransfer.Re=(Dotube*Unity(i).Properties.Cold.Inlet.Fw/Unity(i).Shell.HeatTransfer.Sm)/Unity(i).Properties.Cold.Average.Mu;
    10301079
    10311080"Shell Heat Transfer Coefficient"
    1032         Unity(i).Shell.HeatTransfer.hshell=HE.ShellFilmCoeff(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,Unity(i).Shell.HeatTransfer.Jtotal,Unity(i).Shell.HeatTransfer.Phi);
     1081        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;
    10331082
    10341083"Shell Pressure Drop Cross Flow"
     
    10871136        Fc = HE.EshellCorrectionFactor(Inlet.Hot.T,Outlet.Hot.T,Inlet.Cold.T,Outlet.Cold.T);
    10881137
    1089 "Counter Flow LMTD"
    1090         LMTD = HE.CounterLMTD(Inlet.Hot.T,Outlet.Hot.T,Inlet.Cold.T,Outlet.Cold.T);
    1091 
     1138"Temperature Difference at Inlet"
     1139        DT0 = Inlet.Hot.T - Outlet.Cold.T;
     1140
     1141"Temperature Difference at Outlet"
     1142        DTL = Outlet.Hot.T - Inlet.Cold.T;
     1143       
    10921144"Js Factor"     
    10931145        Shell.HeatTransfer.Js = HE.JsFactor(Shell.HeatTransfer.Re,Baffles.Lsi,Baffles.Lso,Baffles.Ls);
     
    10981150       
    10991151"Shell Side Reynolds Number"
    1100         Shell.HeatTransfer.Re=HE.ShellReynoldsNumber(Properties.Hot.Inlet.Fw,Shell.HeatTransfer.Sm,Properties.Hot.Average.Mu);
     1152        Shell.HeatTransfer.Re=(Dotube*Properties.Hot.Inlet.Fw/Shell.HeatTransfer.Sm)/Properties.Hot.Average.Mu;
    11011153
    11021154"Shell Heat Transfer Coefficient"
    1103         Shell.HeatTransfer.hshell=HE.ShellFilmCoeff(Shell.HeatTransfer.Ji,Properties.Hot.Average.Cp,Properties.Hot.Average.Mw,Properties.Hot.Inlet.Fw,Shell.HeatTransfer.Sm,Shell.HeatTransfer.PR,Shell.HeatTransfer.Jtotal,Shell.HeatTransfer.Phi);
     1155        Shell.HeatTransfer.hshell=Shell.HeatTransfer.Ji*(Properties.Hot.Average.Cp/Properties.Hot.Average.Mw)*(Properties.Hot.Inlet.Fw/Shell.HeatTransfer.Sm)*(Shell.HeatTransfer.PR^(-2/3))*Shell.HeatTransfer.Jtotal*Shell.HeatTransfer.Phi;
    11041156
    11051157"Shell Pressure Drop Cross Flow"
     
    11161168
    11171169"Shell Side Reynolds Number"
    1118         Shell.HeatTransfer.Re=HE.ShellReynoldsNumber(Properties.Cold.Inlet.Fw,Shell.HeatTransfer.Sm,Properties.Cold.Average.Mu);
     1170        Shell.HeatTransfer.Re=(Dotube*Properties.Cold.Inlet.Fw/Shell.HeatTransfer.Sm)/Properties.Cold.Average.Mu;
    11191171
    11201172"Shell Heat Transfer Coefficient"
    1121         Shell.HeatTransfer.hshell=HE.ShellFilmCoeff(Shell.HeatTransfer.Ji,Properties.Cold.Average.Cp,Properties.Cold.Average.Mw,Properties.Cold.Inlet.Fw,Shell.HeatTransfer.Sm,Shell.HeatTransfer.PR,Shell.HeatTransfer.Jtotal,Shell.HeatTransfer.Phi);
     1173        Shell.HeatTransfer.hshell=Shell.HeatTransfer.Ji*(Properties.Cold.Average.Cp/Properties.Cold.Average.Mw)*(Properties.Cold.Inlet.Fw/Shell.HeatTransfer.Sm)*(Shell.HeatTransfer.PR^(-2/3))*Shell.HeatTransfer.Jtotal*Shell.HeatTransfer.Phi;
    11221174
    11231175"Shell Pressure Drop Cross Flow"
     
    11471199        Fc = HE.FshellCorrectionFactor(Inlet.Hot.T,Outlet.Hot.T,Inlet.Cold.T,Outlet.Cold.T);
    11481200
    1149 "Counter Flow LMTD"
    1150         LMTD = HE.CounterLMTD(Inlet.Hot.T,Outlet.Hot.T,Inlet.Cold.T,Outlet.Cold.T);
    1151 
     1201"Temperature Difference at Inlet"
     1202        DT0 = Inlet.Hot.T - Outlet.Cold.T;
     1203
     1204"Temperature Difference at Outlet"
     1205        DTL = Outlet.Hot.T - Inlet.Cold.T;
     1206       
    11521207"Js Factor"     
    11531208        Shell.HeatTransfer.Js = HE.JsFactor(Shell.HeatTransfer.Re,Baffles.Lsi,Baffles.Lso,Baffles.Ls);
     
    11581213       
    11591214"Shell Side Reynolds Number"
    1160         Shell.HeatTransfer.Re=HE.ShellReynoldsNumber(Properties.Hot.Inlet.Fw,Shell.HeatTransfer.Sm,Properties.Hot.Average.Mu);
     1215        Shell.HeatTransfer.Re=(Dotube*Properties.Hot.Inlet.Fw/Shell.HeatTransfer.Sm)/Properties.Hot.Average.Mu;
    11611216
    11621217"Shell Heat Transfer Coefficient"
    1163         Shell.HeatTransfer.hshell=HE.ShellFilmCoeff(Shell.HeatTransfer.Ji,Properties.Hot.Average.Cp,Properties.Hot.Average.Mw,Properties.Hot.Inlet.Fw,Shell.HeatTransfer.Sm,Shell.HeatTransfer.PR,Shell.HeatTransfer.Jtotal,Shell.HeatTransfer.Phi);
     1218        Shell.HeatTransfer.hshell=Shell.HeatTransfer.Ji*(Properties.Hot.Average.Cp/Properties.Hot.Average.Mw)*(Properties.Hot.Inlet.Fw/Shell.HeatTransfer.Sm)*(Shell.HeatTransfer.PR^(-2/3))*Shell.HeatTransfer.Jtotal*Shell.HeatTransfer.Phi;
    11641219
    11651220"Shell Pressure Drop Cross Flow"
     
    11761231
    11771232"Shell Side Reynolds Number"
    1178         Shell.HeatTransfer.Re=HE.ShellReynoldsNumber(Properties.Cold.Inlet.Fw,Shell.HeatTransfer.Sm,Properties.Cold.Average.Mu);
     1233        Shell.HeatTransfer.Re=(Dotube*Properties.Cold.Inlet.Fw/Shell.HeatTransfer.Sm)/Properties.Cold.Average.Mu;
    11791234
    11801235"Shell Heat Transfer Coefficient"
    1181         Shell.HeatTransfer.hshell=HE.ShellFilmCoeff(Shell.HeatTransfer.Ji,Properties.Cold.Average.Cp,Properties.Cold.Average.Mw,Properties.Cold.Inlet.Fw,Shell.HeatTransfer.Sm,Shell.HeatTransfer.PR,Shell.HeatTransfer.Jtotal,Shell.HeatTransfer.Phi);
     1236        Shell.HeatTransfer.hshell=Shell.HeatTransfer.Ji*(Properties.Cold.Average.Cp/Properties.Cold.Average.Mw)*(Properties.Cold.Inlet.Fw/Shell.HeatTransfer.Sm)*(Shell.HeatTransfer.PR^(-2/3))*Shell.HeatTransfer.Jtotal*Shell.HeatTransfer.Phi;
    11821237
    11831238"Shell Pressure Drop Cross Flow"
     
    11931248end
    11941249
    1195 
    1196 
    11971250end
    11981251
     
    12041257
    12051258Nshell          as Integer              (Brief="N Shell in Series",Default=2);
    1206 ext     HE              as CalcObject   (Brief="STHE Calculations",File="heatex.dll");
     1259        HE              as CalcObject   (Brief="STHE Calculations",File="heatex");
    12071260ext PP          as CalcObject   (Brief="External Physical Properties");
    12081261side        as Integer          (Brief="Fluid Alocation",Lower=0,Upper=1);
     
    13131366
    13141367"Tube Side Velocity"
    1315         Unity(i).Tubes.HeatTransfer.Vtube  = HE.TubeVelocity(Unity(i).Properties.Cold.Inlet.Fw,Unity(i).Properties.Cold.Average.rho);
     1368        Unity(i).Tubes.HeatTransfer.Vtube  = Unity(i).Properties.Cold.Inlet.Fw*Tpass/((Pi*Ditube*Ditube/4)*Unity(i).Properties.Cold.Average.rho*Ntt);
    13161369
    13171370"Tube Side Reynolds Number"
    1318         Unity(i).Tubes.HeatTransfer.Re = HE.TubeReynoldsNumber(Unity(i).Properties.Cold.Average.rho,Unity(i).Tubes.HeatTransfer.Vtube,Unity(i).Properties.Cold.Average.Mu);
    1319        
     1371        Unity(i).Tubes.HeatTransfer.Re=(Unity(i).Properties.Cold.Average.rho*Unity(i).Tubes.HeatTransfer.Vtube*Ditube)/Unity(i).Properties.Cold.Average.Mu;
     1372
    13201373"Tube Side Prandtl Number"
    1321         Unity(i).Tubes.HeatTransfer.PR = HE.PrandtlNumber(Unity(i).Properties.Cold.Average.K,Unity(i).Properties.Cold.Average.Cp,Unity(i).Properties.Cold.Average.Mw,Unity(i).Properties.Cold.Average.Mu);
     1374        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;
    13221375
    13231376"Tube Side Prandtl Number at Wall"
    1324         Unity(i).Tubes.HeatTransfer.PRw = HE.PrandtlNumber(Unity(i).Properties.Cold.Wall.K,Unity(i).Properties.Cold.Wall.Cp,Unity(i).Properties.Cold.Average.Mw,Unity(i).Properties.Cold.Wall.Mu);
     1377        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;
    13251378
    13261379"Tube Side Film Coefficient"
    1327         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);
     1380        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;
    13281381       
    13291382"Shell Side Prandtl Number"
    1330         Unity(i).Shell.HeatTransfer.PR=HE.PrandtlNumber(Unity(i).Properties.Hot.Average.K,Unity(i).Properties.Hot.Average.Cp,Unity(i).Properties.Hot.Average.Mw,Unity(i).Properties.Hot.Average.Mu);   
     1383        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
    13311384
    13321385"Shell Side Prandtl Number at Wall"
    1333         Unity(i).Shell.HeatTransfer.PRw=HE.PrandtlNumber(Unity(i).Properties.Hot.Wall.K,Unity(i).Properties.Hot.Wall.Cp,Unity(i).Properties.Hot.Average.Mw,Unity(i).Properties.Hot.Wall.Mu);   
     1386        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
    13341387
    13351388"Tube Side Pressure Drop"
     
    13761429
    13771430"Tube Side Velocity"
    1378         Unity(i).Tubes.HeatTransfer.Vtube=HE.TubeVelocity(Unity(i).Properties.Hot.Inlet.Fw,Unity(i).Properties.Hot.Average.rho);
     1431        Unity(i).Tubes.HeatTransfer.Vtube  = Unity(i).Properties.Hot.Inlet.Fw*Tpass/((Pi*Ditube*Ditube/4)*Unity(i).Properties.Hot.Average.rho*Ntt);
    13791432
    13801433"Tube Side Reynolds Number"
    1381         Unity(i).Tubes.HeatTransfer.Re=HE.TubeReynoldsNumber(Unity(i).Properties.Hot.Average.rho,Unity(i).Tubes.HeatTransfer.Vtube,Unity(i).Properties.Hot.Average.Mu);
     1434        Unity(i).Tubes.HeatTransfer.Re=(Unity(i).Properties.Hot.Average.rho*Unity(i).Tubes.HeatTransfer.Vtube*Ditube)/Unity(i).Properties.Hot.Average.Mu;
    13821435       
    13831436"Tube Side Prandtl Number"
    1384         Unity(i).Tubes.HeatTransfer.PR=HE.PrandtlNumber(Unity(i).Properties.Hot.Average.K,Unity(i).Properties.Hot.Average.Cp,Unity(i).Properties.Hot.Average.Mw,Unity(i).Properties.Hot.Average.Mu);
     1437        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;
    13851438
    13861439"Tube Side Prandtl Number at Wall"
    1387         Unity(i).Tubes.HeatTransfer.PRw=HE.PrandtlNumber(Unity(i).Properties.Hot.Wall.K,Unity(i).Properties.Hot.Wall.Cp,Unity(i).Properties.Hot.Average.Mw,Unity(i).Properties.Hot.Wall.Mu);
     1440        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;
    13881441
    13891442"Tube Side Film Coefficient"
    1390         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);
     1443        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;
    13911444       
    13921445"Shell Side Prandtl Number"
    1393         Unity(i).Shell.HeatTransfer.PR=HE.PrandtlNumber(Unity(i).Properties.Cold.Average.K,Unity(i).Properties.Cold.Average.Cp,Unity(i).Properties.Cold.Average.Mw,Unity(i).Properties.Cold.Average.Mu);
     1446        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;
    13941447
    13951448"Shell Side Prandtl Number at Wall"
    1396         Unity(i).Shell.HeatTransfer.PRw=HE.PrandtlNumber(Unity(i).Properties.Cold.Wall.K,Unity(i).Properties.Cold.Wall.Cp,Unity(i).Properties.Cold.Average.Mw,Unity(i).Properties.Cold.Wall.Mu);
     1449        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;
    13971450
    13981451"Tube Side Pressure Drop"
     
    14321485end
    14331486
     1487if side equal 1
     1488       
     1489        then
     1490
     1491"Shell Side inlet Nozzle rho-V^2"
     1492        Unity(i).Shell.PressureDrop.RVsquare_in = Unity(i).Properties.Hot.Inlet.rho*(Unity(i).Shell.PressureDrop.Vnozzle_in)^2;
     1493
     1494"Shell Side Outlet Nozzle rho-V^2"
     1495        Unity(i).Shell.PressureDrop.RVsquare_out = Unity(i).Properties.Hot.Outlet.rho*(Unity(i).Shell.PressureDrop.Vnozzle_out)^2;
     1496       
     1497        else
     1498       
     1499"Shell Side inlet Nozzle rho-V^2"
     1500        Unity(i).Shell.PressureDrop.RVsquare_in = Unity(i).Properties.Cold.Inlet.rho*(Unity(i).Shell.PressureDrop.Vnozzle_in)^2;
     1501
     1502"Shell Side Outlet Nozzle rho-V^2"
     1503        Unity(i).Shell.PressureDrop.RVsquare_out = Unity(i).Properties.Cold.Outlet.rho*(Unity(i).Shell.PressureDrop.Vnozzle_out)^2;
     1504
     1505end
     1506
    14341507"Tube Resistance"       
    14351508        Unity(i).Resistances.Rtube*(Unity(i).Tubes.HeatTransfer.htube*Ditube) = Dotube;
     
    14641537       
    14651538"Shell Side Reynolds Number"
    1466         Unity(i).Shell.HeatTransfer.Re=HE.ShellReynoldsNumber(Unity(i).Properties.Hot.Inlet.Fw,Unity(i).Shell.HeatTransfer.Sm,Unity(i).Properties.Hot.Average.Mu);
     1539        Unity(i).Shell.HeatTransfer.Re=(Dotube*Unity(i).Properties.Hot.Inlet.Fw/Unity(i).Shell.HeatTransfer.Sm)/Unity(i).Properties.Hot.Average.Mu;
    14671540
    14681541"Shell Heat Transfer Coefficient"
    1469         Unity(i).Shell.HeatTransfer.hshell=HE.ShellFilmCoeff(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,Unity(i).Shell.HeatTransfer.Jtotal,Unity(i).Shell.HeatTransfer.Phi);
     1542        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;
    14701543
    14711544"Shell Pressure Drop Cross Flow"
     
    14821555
    14831556"Shell Side Reynolds Number"
    1484         Unity(i).Shell.HeatTransfer.Re=HE.ShellReynoldsNumber(Unity(i).Properties.Cold.Inlet.Fw,Unity(i).Shell.HeatTransfer.Sm,Unity(i).Properties.Cold.Average.Mu);
     1557        Unity(i).Shell.HeatTransfer.Re=(Dotube*Unity(i).Properties.Cold.Inlet.Fw/Unity(i).Shell.HeatTransfer.Sm)/Unity(i).Properties.Cold.Average.Mu;
    14851558
    14861559"Shell Heat Transfer Coefficient"
    1487         Unity(i).Shell.HeatTransfer.hshell=HE.ShellFilmCoeff(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,Unity(i).Shell.HeatTransfer.Jtotal,Unity(i).Shell.HeatTransfer.Phi);
     1560        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;
    14881561
    14891562"Shell Pressure Drop Cross Flow"
  • mso/eml/heat_exchangers/HeatExchangerDiscretized.mso

    r26 r45  
    1616
    1717ext PP      as CalcObject(Brief="External Physical Properties");
    18 ext HE      as CalcObject(Brief="STHE Calculations",File="heatex");
     18        HE          as CalcObject(Brief="STHE Calculations",File="heatex");
    1919ext NComp   as Integer   (Brief="Number of Components");
    2020  M(NComp)  as molweight (Brief="Component Mol Weight");
     
    279279       
    280280VARIABLES
    281 LMTD            as temp_delta   (Brief="Logarithmic Mean Temperature Difference",Lower=5);
    282 Fc                      as positive             (Brief="LMTD Correction Factor",Lower=0.5);
    283 MTD                     as temp_delta   (Brief="Mean Temperature Difference",Lower=1);
     281DT0     as temp_delta   (Brief="Temperature Difference at Inlet",Lower=1);
     282DTL             as temp_delta   (Brief="Temperature Difference at Outlet",Lower=1);
     283LMTD    as temp_delta   (Brief="Logarithmic Mean Temperature Difference",Lower=5);
     284Fc              as positive             (Brief="LMTD Correction Factor",Lower=0.5);
     285MTD             as temp_delta   (Brief="Mean Temperature Difference",Lower=1);
    284286
    285287EQUATIONS
     
    290292        MTD   = Fc*LMTD;
    291293       
    292 "LMTD Correction Factor"
    293         Fc = HE.EshellCorrectionFactor(Inlet.Hot.T,Outlet.Hot.T,Inlet.Cold.T,Outlet.Cold.T);
    294 
    295 "LMTD"
    296         LMTD = HE.CounterLMTD(Inlet.Hot.T,Outlet.Hot.T,Inlet.Cold.T,Outlet.Cold.T);
    297 
     294#"LMTD Correction Factor"
     295#       Fc = HE.EshellCorrectionFactor(Inlet.Hot.T,Outlet.Hot.T,Inlet.Cold.T,Outlet.Cold.T);
     296
     297"Temperature Difference at Inlet"
     298        DT0 = Inlet.Hot.T - Outlet.Cold.T;
     299
     300"Temperature Difference at Outlet"
     301        DTL = Outlet.Hot.T - Inlet.Cold.T;
     302#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
     303#                       Log Mean Temperature Difference
     304#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
     305if abs(DT0 - DTL) > 0.05*max(abs([DT0,DTL]))
     306       
     307        then
     308"Log Mean Temperature Difference"
     309        LMTD= (DT0-DTL)/ln(DT0/DTL);
     310
     311        else
     312       
     313if DT0*DTL equal 0
     314       
     315        then
     316"Log Mean Temperature Difference"
     317        LMTD = 0.5*(DT0+DTL);
     318       
     319        else
     320"Log Mean Temperature Difference"
     321        LMTD = 0.5*(DT0+DTL)*(1-(DT0-DTL)^2/(DT0*DTL)*(1+(DT0-DTL)^2/(DT0*DTL)/2)/12);
     322       
     323end
     324       
     325end
     326
     327       
    298328end
    299329
     
    332362PARAMETERS
    333363
    334 ext     HE      as CalcObject   (Brief="STHE Calculations",File="heatex.dll");
     364        HE      as CalcObject   (Brief="STHE Calculations",File="heatex");
    335365ext PP  as CalcObject   (Brief="External Physical Properties");
    336366side    as Integer              (Brief="Fluid Alocation",Lower=0,Upper=1);
     
    601631       
    602632"Shell Side Reynolds Number"
    603         Unity(i).Shell.HeatTransfer.Re                          =       HE.ShellReynoldsNumber(Unity(i).Properties.Hot.Inlet.Fw,Unity(i).Shell.HeatTransfer.Sm,Unity(i).Properties.Hot.Average.Mu);
     633        Unity(i).Shell.HeatTransfer.Re=(Dotube*Unity(i).Properties.Hot.Inlet.Fw/Unity(i).Shell.HeatTransfer.Sm)/Unity(i).Properties.Hot.Average.Mu;
    604634
    605635"Shell Heat Transfer Coefficient"
    606         Unity(i).Shell.HeatTransfer.hshell                      =       HE.ShellFilmCoeff(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,Unity(i).Shell.HeatTransfer.Jtotal,Unity(i).Shell.HeatTransfer.Phi);
     636        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;
    607637
    608638
     
    617647
    618648"Tube Side Velocity"
    619         Unity(i).Tubes.HeatTransfer.Vtube       =       HE.TubeVelocity(Unity(i).Properties.Cold.Inlet.Fw,Unity(i).Properties.Cold.Average.rho);
     649        Unity(i).Tubes.HeatTransfer.Vtube  = Unity(i).Properties.Cold.Inlet.Fw*Tpass/((Pi*Ditube*Ditube/4)*Unity(i).Properties.Cold.Average.rho*Ntt);
    620650
    621651"Tube Side Reynolds Number"
    622         Unity(i).Tubes.HeatTransfer.Re          =       HE.TubeReynoldsNumber(Unity(i).Properties.Cold.Average.rho,Unity(i).Tubes.HeatTransfer.Vtube,Unity(i).Properties.Cold.Average.Mu);
     652        Unity(i).Tubes.HeatTransfer.Re          =       (Unity(i).Properties.Cold.Average.rho*Unity(i).Tubes.HeatTransfer.Vtube*Ditube)/Unity(i).Properties.Cold.Average.Mu;
    623653       
    624654"Tube Side Prandtl Number"
    625         Unity(i).Tubes.HeatTransfer.PR          =       HE.PrandtlNumber(Unity(i).Properties.Cold.Average.K,Unity(i).Properties.Cold.Average.Cp,Unity(i).Properties.Cold.Average.Mw,Unity(i).Properties.Cold.Average.Mu);
     655        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;
    626656
    627657"Tube Side Prandtl Number at Wall"
    628         Unity(i).Tubes.HeatTransfer.PRw         =       HE.PrandtlNumber(Unity(i).Properties.Cold.Wall.K,Unity(i).Properties.Cold.Wall.Cp,Unity(i).Properties.Cold.Average.Mw,Unity(i).Properties.Cold.Wall.Mu);
     658        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;
    629659
    630660"Tube Side Film Coefficient"
    631         Unity(i).Tubes.HeatTransfer.htube       =       HE.TubeFilmCoeffIncremental(Unity(i).Tubes.HeatTransfer.Re,Unity(i).Tubes.HeatTransfer.PR,Unity(i).Properties.Cold.Average.K,
    632         Unity(i).Tubes.HeatTransfer.Phi,Sumary.Lz(i));
     661        Unity(i).Tubes.HeatTransfer.htube       =       HE.TubeFilmCoeffIncremental(Unity(i).Tubes.HeatTransfer.Re,Unity(i).Tubes.HeatTransfer.PR,Unity(i).Properties.Cold.Average.K,Sumary.Lz(i))*Unity(i).Tubes.HeatTransfer.Phi;
    633662       
    634663"Shell Side Prandtl Number"
    635         Unity(i).Shell.HeatTransfer.PR          =       HE.PrandtlNumber(Unity(i).Properties.Hot.Average.K,Unity(i).Properties.Hot.Average.Cp,Unity(i).Properties.Hot.Average.Mw,Unity(i).Properties.Hot.Average.Mu);   
     664        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;
    636665
    637666"Shell Side Prandtl Number at Wall"
    638         Unity(i).Shell.HeatTransfer.PRw         =       HE.PrandtlNumber(Unity(i).Properties.Hot.Wall.K,Unity(i).Properties.Hot.Wall.Cp,Unity(i).Properties.Hot.Average.Mw,Unity(i).Properties.Hot.Wall.Mu);   
     667        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
    639668
    640669"Tube Side Pressure Drop"
     
    657686       
    658687"Shell Side Reynolds Number"
    659         Unity(i).Shell.HeatTransfer.Re                  =       HE.ShellReynoldsNumber(Unity(i).Properties.Cold.Inlet.Fw,Unity(i).Shell.HeatTransfer.Sm,Unity(i).Properties.Cold.Average.Mu);
     688        Unity(i).Shell.HeatTransfer.Re=(Dotube*Unity(i).Properties.Cold.Inlet.Fw/Unity(i).Shell.HeatTransfer.Sm)/Unity(i).Properties.Cold.Average.Mu;
    660689
    661690"Shell Heat Transfer Coefficient"
    662         Unity(i).Shell.HeatTransfer.hshell              =       HE.ShellFilmCoeff(Unity(i).Shell.HeatTransfer.Ji,Unity(i).Properties.Cold.Average.Cp,Unity(i).Properties.Cold.Average.Mw,
    663         Unity(i).Properties.Cold.Inlet.Fw,Unity(i).Shell.HeatTransfer.Sm,Unity(i).Shell.HeatTransfer.PR,Unity(i).Shell.HeatTransfer.Jtotal,Unity(i).Shell.HeatTransfer.Phi);
     691        Unity(i).Shell.HeatTransfer.hshell      =Unity(i).Shell.HeatTransfer.Ji*(Unity(i).Properties.Cold.Average.Cp/Unity(i).Properties.Cold.Average.Mw)*
     692        (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;
    664693
    665694
     
    667696        Unity(i).Shell.PressureDrop.Pdwindow    =       HE.DeltaPwindowIncremental(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);
    668697
    669 
    670698"Hot Wall Temperature"
    671699        Unity(i).Properties.Hot.Wall.Twall      =       (Unity(i).Properties.Hot.Average.T+Unity(i).Properties.Cold.Average.T)/2;
     
    675703
    676704"Tube Side Velocity"
    677         Unity(i).Tubes.HeatTransfer.Vtube               =       HE.TubeVelocity(Unity(i).Properties.Hot.Inlet.Fw,Unity(i).Properties.Hot.Average.rho);
     705        Unity(i).Tubes.HeatTransfer.Vtube               = Unity(i).Properties.Hot.Inlet.Fw*Tpass/((Pi*Ditube*Ditube/4)*Unity(i).Properties.Hot.Average.rho*Ntt);
    678706
    679707"Tube Side Reynolds Number"
    680         Unity(i).Tubes.HeatTransfer.Re                  =       HE.TubeReynoldsNumber(Unity(i).Properties.Hot.Average.rho,Unity(i).Tubes.HeatTransfer.Vtube,Unity(i).Properties.Hot.Average.Mu);
     708        Unity(i).Tubes.HeatTransfer.Re                  =       (Unity(i).Properties.Hot.Average.rho*Unity(i).Tubes.HeatTransfer.Vtube*Ditube)/Unity(i).Properties.Hot.Average.Mu;
    681709       
    682710"Tube Side Prandtl Number"
    683         Unity(i).Tubes.HeatTransfer.PR                  =       HE.PrandtlNumber(Unity(i).Properties.Hot.Average.K,Unity(i).Properties.Hot.Average.Cp,Unity(i).Properties.Hot.Average.Mw,Unity(i).Properties.Hot.Average.Mu);
     711        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;
    684712       
    685713"Tube Side Prandtl Number at Wall"
    686         Unity(i).Tubes.HeatTransfer.PRw                 =       HE.PrandtlNumber(Unity(i).Properties.Hot.Wall.K,Unity(i).Properties.Hot.Wall.Cp,Unity(i).Properties.Hot.Average.Mw,Unity(i).Properties.Hot.Wall.Mu);
    687        
     714        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;
    688715       
    689716"Tube Side Film Coefficient"
    690         Unity(i).Tubes.HeatTransfer.htube               =       HE.TubeFilmCoeffIncremental(Unity(i).Tubes.HeatTransfer.Re,Unity(i).Tubes.HeatTransfer.PR,Unity(i).Properties.Hot.Average.K,
    691         Unity(i).Tubes.HeatTransfer.Phi,Sumary.Lz(i));
     717        Unity(i).Tubes.HeatTransfer.htube               =       HE.TubeFilmCoeffIncremental(Unity(i).Tubes.HeatTransfer.Re,Unity(i).Tubes.HeatTransfer.PR,Unity(i).Properties.Hot.Average.K,Sumary.Lz(i))*Unity(i).Tubes.HeatTransfer.Phi;
    692718       
    693719"Shell Side Prandtl Number"
    694         Unity(i).Shell.HeatTransfer.PR                  =       HE.PrandtlNumber(Unity(i).Properties.Cold.Average.K,Unity(i).Properties.Cold.Average.Cp,Unity(i).Properties.Cold.Average.Mw,Unity(i).Properties.Cold.Average.Mu);
     720        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;
    695721
    696722"Shell Side Prandtl Number at Wall"
    697         Unity(i).Shell.HeatTransfer.PRw                 =       HE.PrandtlNumber(Unity(i).Properties.Cold.Wall.K,Unity(i).Properties.Cold.Wall.Cp,Unity(i).Properties.Cold.Average.Mw,Unity(i).Properties.Cold.Wall.Mu);
     723        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;
    698724
    699725"Tube Side Pressure Drop"
     
    821847PARAMETERS
    822848
    823 ext     HE      as CalcObject   (Brief="STHE Calculations",File="heatex.dll");
     849        HE      as CalcObject   (Brief="STHE Calculations",File="heatex");
    824850ext PP  as CalcObject   (Brief="External Physical Properties");
    825851side    as Integer              (Brief="Fluid Alocation",Lower=0,Upper=1);
     
    929955        Unity(Nb+1).Shell.HeatTransfer.Sm = HE.CrossFlowArea(Unity(Nb+1).Baffles.Lso);
    930956
     957"LMTD Correction Factor"
     958        Unity.Fc = HE.EshellCorrectionFactor(Unity(1).Inlet.Hot.T,Unity(Nb+1).Outlet.Hot.T,Unity(Nb+1).Inlet.Cold.T,Unity(1).Outlet.Cold.T);
    931959
    932960if side equal 1
     
    10791107
    10801108for i in [1:Nb+1]
    1081        
     1109
     1110
    10821111if side equal 1
    10831112       
     
    10901119       
    10911120"Shell Side Reynolds Number"
    1092         Unity(i).Shell.HeatTransfer.Re                          =       HE.ShellReynoldsNumber(Unity(i).Properties.Hot.Inlet.Fw,Unity(i).Shell.HeatTransfer.Sm,Unity(i).Properties.Hot.Average.Mu);
     1121        Unity(i).Shell.HeatTransfer.Re=(Dotube*Unity(i).Properties.Hot.Inlet.Fw/Unity(i).Shell.HeatTransfer.Sm)/Unity(i).Properties.Hot.Average.Mu;
    10931122
    10941123"Shell Heat Transfer Coefficient"
    1095         Unity(i).Shell.HeatTransfer.hshell                      =       HE.ShellFilmCoeff(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,Unity(i).Shell.HeatTransfer.Jtotal,Unity(i).Shell.HeatTransfer.Phi);
    1096 
     1124        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;
    10971125
    10981126"Shell Pressure Baffle Window"
     
    11061134
    11071135"Tube Side Velocity"
    1108         Unity(i).Tubes.HeatTransfer.Vtube       =       HE.TubeVelocity(Unity(i).Properties.Cold.Inlet.Fw,Unity(i).Properties.Cold.Average.rho);
     1136        Unity(i).Tubes.HeatTransfer.Vtube       =       Unity(i).Properties.Cold.Inlet.Fw*Tpass/((Pi*Ditube*Ditube/4)*Unity(i).Properties.Cold.Average.rho*Ntt);
    11091137
    11101138"Tube Side Reynolds Number"
    1111         Unity(i).Tubes.HeatTransfer.Re          =       HE.TubeReynoldsNumber(Unity(i).Properties.Cold.Average.rho,Unity(i).Tubes.HeatTransfer.Vtube,Unity(i).Properties.Cold.Average.Mu);
     1139        Unity(i).Tubes.HeatTransfer.Re          =       (Unity(i).Properties.Cold.Average.rho*Unity(i).Tubes.HeatTransfer.Vtube*Ditube)/Unity(i).Properties.Cold.Average.Mu;
    11121140       
    11131141"Tube Side Prandtl Number"
    1114         Unity(i).Tubes.HeatTransfer.PR          =       HE.PrandtlNumber(Unity(i).Properties.Cold.Average.K,Unity(i).Properties.Cold.Average.Cp,Unity(i).Properties.Cold.Average.Mw,Unity(i).Properties.Cold.Average.Mu);
     1142        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;
    11151143
    11161144"Tube Side Prandtl Number at Wall"
    1117         Unity(i).Tubes.HeatTransfer.PRw         =       HE.PrandtlNumber(Unity(i).Properties.Cold.Wall.K,Unity(i).Properties.Cold.Wall.Cp,Unity(i).Properties.Cold.Average.Mw,Unity(i).Properties.Cold.Wall.Mu);
     1145        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;
    11181146
    11191147"Tube Side Film Coefficient"
    1120         Unity(i).Tubes.HeatTransfer.htube       =       HE.TubeFilmCoeffIncremental(Unity(i).Tubes.HeatTransfer.Re,Unity(i).Tubes.HeatTransfer.PR,Unity(i).Properties.Cold.Average.K,
    1121         Unity(i).Tubes.HeatTransfer.Phi,Sumary.Lz(i));
     1148        Unity(i).Tubes.HeatTransfer.htube       =       HE.TubeFilmCoeffIncremental(Unity(i).Tubes.HeatTransfer.Re,Unity(i).Tubes.HeatTransfer.PR,Unity(i).Properties.Cold.Average.K,Sumary.Lz(i))*Unity(i).Tubes.HeatTransfer.Phi;
    11221149       
    11231150"Shell Side Prandtl Number"
    1124         Unity(i).Shell.HeatTransfer.PR          =       HE.PrandtlNumber(Unity(i).Properties.Hot.Average.K,Unity(i).Properties.Hot.Average.Cp,Unity(i).Properties.Hot.Average.Mw,Unity(i).Properties.Hot.Average.Mu);   
     1151        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;
    11251152
    11261153"Shell Side Prandtl Number at Wall"
    1127         Unity(i).Shell.HeatTransfer.PRw         =       HE.PrandtlNumber(Unity(i).Properties.Hot.Wall.K,Unity(i).Properties.Hot.Wall.Cp,Unity(i).Properties.Hot.Average.Mw,Unity(i).Properties.Hot.Wall.Mu);   
     1154        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
    11281155
    11291156"Tube Side Pressure Drop"
     
    11461173       
    11471174"Shell Side Reynolds Number"
    1148         Unity(i).Shell.HeatTransfer.Re                  =       HE.ShellReynoldsNumber(Unity(i).Properties.Cold.Inlet.Fw,Unity(i).Shell.HeatTransfer.Sm,Unity(i).Properties.Cold.Average.Mu);
     1175        Unity(i).Shell.HeatTransfer.Re=(Dotube*Unity(i).Properties.Cold.Inlet.Fw/Unity(i).Shell.HeatTransfer.Sm)/Unity(i).Properties.Cold.Average.Mu;
    11491176
    11501177"Shell Heat Transfer Coefficient"
    1151         Unity(i).Shell.HeatTransfer.hshell              =       HE.ShellFilmCoeff(Unity(i).Shell.HeatTransfer.Ji,Unity(i).Properties.Cold.Average.Cp,Unity(i).Properties.Cold.Average.Mw,
    1152         Unity(i).Properties.Cold.Inlet.Fw,Unity(i).Shell.HeatTransfer.Sm,Unity(i).Shell.HeatTransfer.PR,Unity(i).Shell.HeatTransfer.Jtotal,Unity(i).Shell.HeatTransfer.Phi);
     1178        Unity(i).Shell.HeatTransfer.hshell      =Unity(i).Shell.HeatTransfer.Ji*(Unity(i).Properties.Cold.Average.Cp/Unity(i).Properties.Cold.Average.Mw)*
     1179        (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;
    11531180
    11541181
     
    11641191
    11651192"Tube Side Velocity"
    1166         Unity(i).Tubes.HeatTransfer.Vtube               =       HE.TubeVelocity(Unity(i).Properties.Hot.Inlet.Fw,Unity(i).Properties.Hot.Average.rho);
     1193        Unity(i).Tubes.HeatTransfer.Vtube               = Unity(i).Properties.Hot.Inlet.Fw*Tpass/((Pi*Ditube*Ditube/4)*Unity(i).Properties.Hot.Average.rho*Ntt);
    11671194
    11681195"Tube Side Reynolds Number"
    1169         Unity(i).Tubes.HeatTransfer.Re                  =       HE.TubeReynoldsNumber(Unity(i).Properties.Hot.Average.rho,Unity(i).Tubes.HeatTransfer.Vtube,Unity(i).Properties.Hot.Average.Mu);
     1196        Unity(i).Tubes.HeatTransfer.Re                  =       (Unity(i).Properties.Hot.Average.rho*Unity(i).Tubes.HeatTransfer.Vtube*Ditube)/Unity(i).Properties.Hot.Average.Mu;
    11701197       
    11711198"Tube Side Prandtl Number"
    1172         Unity(i).Tubes.HeatTransfer.PR                  =       HE.PrandtlNumber(Unity(i).Properties.Hot.Average.K,Unity(i).Properties.Hot.Average.Cp,Unity(i).Properties.Hot.Average.Mw,Unity(i).Properties.Hot.Average.Mu);
     1199        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;
    11731200       
    11741201"Tube Side Prandtl Number at Wall"
    1175         Unity(i).Tubes.HeatTransfer.PRw                 =       HE.PrandtlNumber(Unity(i).Properties.Hot.Wall.K,Unity(i).Properties.Hot.Wall.Cp,Unity(i).Properties.Hot.Average.Mw,Unity(i).Properties.Hot.Wall.Mu);
     1202        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;
    11761203       
    11771204       
    11781205"Tube Side Film Coefficient"
    1179         Unity(i).Tubes.HeatTransfer.htube               =       HE.TubeFilmCoeffIncremental(Unity(i).Tubes.HeatTransfer.Re,Unity(i).Tubes.HeatTransfer.PR,Unity(i).Properties.Hot.Average.K,
    1180         Unity(i).Tubes.HeatTransfer.Phi,Sumary.Lz(i));
     1206        Unity(i).Tubes.HeatTransfer.htube               =       HE.TubeFilmCoeffIncremental(Unity(i).Tubes.HeatTransfer.Re,Unity(i).Tubes.HeatTransfer.PR,Unity(i).Properties.Hot.Average.K,Sumary.Lz(i))*Unity(i).Tubes.HeatTransfer.Phi;
    11811207       
    11821208"Shell Side Prandtl Number"
    1183         Unity(i).Shell.HeatTransfer.PR                  =       HE.PrandtlNumber(Unity(i).Properties.Cold.Average.K,Unity(i).Properties.Cold.Average.Cp,Unity(i).Properties.Cold.Average.Mw,Unity(i).Properties.Cold.Average.Mu);
     1209        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;
    11841210
    11851211"Shell Side Prandtl Number at Wall"
    1186         Unity(i).Shell.HeatTransfer.PRw                 =       HE.PrandtlNumber(Unity(i).Properties.Cold.Wall.K,Unity(i).Properties.Cold.Wall.Cp,Unity(i).Properties.Cold.Average.Mw,Unity(i).Properties.Cold.Wall.Mu);
     1212        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;
    11871213
    11881214"Tube Side Pressure Drop"
  • mso/eml/heat_exchangers/HeatExchangerSimplified.mso

    r26 r45  
    1  
     1#--------------------------------------------------------------------
     2# Author: Gerson Balbueno Bicca
     3# $Id$
     4#--------------------------------------------------------------------
    25using "HEX_Engine";
    36#=====================================================================
     
    710PARAMETERS
    811ext PP          as CalcObject   (Brief="External Physical Properties");
    9 ext HE          as CalcObject   (Brief="STHE Calculations",File="heatex.dll");
     12        HE              as CalcObject   (Brief="STHE Calculations",File="heatex");
    1013ext NComp       as Integer      (Brief="Number of Components");
    1114        M(NComp)        as molweight    (Brief="Component Mol Weight");
     
    5457        then   
    5558"Heat Capacity Cold Stream"
    56         Properties.Cold.Average.Cp      =       PP.LiquidCp(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
     59        Properties.Cold.Average.Cp              =       PP.LiquidCp(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
    5760        Properties.Cold.Inlet.Cp                =       PP.LiquidCp(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
    5861        Properties.Cold.Outlet.Cp               =       PP.LiquidCp(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
     
    6164        Properties.Cold.Average.rho     =       PP.LiquidDensity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
    6265        Properties.Cold.Inlet.rho               =       PP.LiquidDensity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
    63         Properties.Cold.Outlet.rho      =       PP.LiquidDensity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
     66        Properties.Cold.Outlet.rho              =       PP.LiquidDensity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
    6467
    6568"Viscosity Cold Stream"
    66         Properties.Cold.Average.Mu =    PP.LiquidViscosity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
    67         Properties.Cold.Inlet.Mu                =               PP.LiquidViscosity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
    68         Properties.Cold.Outlet.Mu       =       PP.LiquidViscosity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
     69        Properties.Cold.Average.Mu              =       PP.LiquidViscosity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
     70        Properties.Cold.Inlet.Mu                =       PP.LiquidViscosity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
     71        Properties.Cold.Outlet.Mu               =       PP.LiquidViscosity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
    6972
    7073"Conductivity Cold Stream"
    71         Properties.Cold.Average.K        =      PP.LiquidThermalConductivity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
    72         Properties.Cold.Inlet.K                         =               PP.LiquidThermalConductivity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
    73         Properties.Cold.Outlet.K                =               PP.LiquidThermalConductivity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
     74        Properties.Cold.Average.K               =       PP.LiquidThermalConductivity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
     75        Properties.Cold.Inlet.K                 =       PP.LiquidThermalConductivity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
     76        Properties.Cold.Outlet.K                =       PP.LiquidThermalConductivity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
    7477
    7578"Heat Capacity Cold Stream"
     
    7780       
    7881"Viscosity Cold Stream"
    79         Properties.Cold.Wall.Mu =       PP.LiquidViscosity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
     82        Properties.Cold.Wall.Mu                 =       PP.LiquidViscosity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
    8083
    8184"Conductivity Cold Stream"
    82         Properties.Cold.Wall.K =        PP.LiquidThermalConductivity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
     85        Properties.Cold.Wall.K                  =       PP.LiquidThermalConductivity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
    8386
    8487
     
    9295"Mass Density Cold Stream"
    9396        Properties.Cold.Average.rho     =       PP.VapourDensity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
    94         Properties.Cold.Inlet.rho       =       PP.VapourDensity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
    95         Properties.Cold.Outlet.rho      =       PP.VapourDensity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
     97        Properties.Cold.Inlet.rho               =       PP.VapourDensity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
     98        Properties.Cold.Outlet.rho              =       PP.VapourDensity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
    9699
    97100"Viscosity Cold Stream"
    98         Properties.Cold.Average.Mu =    PP.VapourViscosity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
    99         Properties.Cold.Inlet.Mu =              PP.VapourViscosity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
    100         Properties.Cold.Outlet.Mu =             PP.VapourViscosity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
     101        Properties.Cold.Average.Mu              =       PP.VapourViscosity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
     102        Properties.Cold.Inlet.Mu                =       PP.VapourViscosity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
     103        Properties.Cold.Outlet.Mu               =       PP.VapourViscosity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
    101104
    102105"Conductivity Cold Stream"
    103         Properties.Cold.Average.K =     PP.VapourThermalConductivity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
    104         Properties.Cold.Inlet.K =               PP.VapourThermalConductivity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
    105         Properties.Cold.Outlet.K =              PP.VapourThermalConductivity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
     106        Properties.Cold.Average.K               =       PP.VapourThermalConductivity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
     107        Properties.Cold.Inlet.K                 =       PP.VapourThermalConductivity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
     108        Properties.Cold.Outlet.K                =       PP.VapourThermalConductivity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
    106109       
    107110"Heat Capacity Cold Stream"
    108         Properties.Cold.Wall.Cp         =       PP.VapourCp(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
     111        Properties.Cold.Wall.Cp                 =       PP.VapourCp(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
    109112
    110113
    111114"Viscosity Cold Stream"
    112         Properties.Cold.Wall.Mu =       PP.VapourViscosity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
     115        Properties.Cold.Wall.Mu                 =       PP.VapourViscosity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
    113116
    114117"Conductivity Cold Stream"
    115         Properties.Cold.Wall.K =        PP.VapourThermalConductivity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
     118        Properties.Cold.Wall.K                  =       PP.VapourThermalConductivity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
    116119       
    117120       
     
    140143"Conductivity Hot Stream"
    141144        Properties.Hot.Average.K        =               PP.LiquidThermalConductivity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);   
    142         Properties.Hot.Inlet.K  =               PP.LiquidThermalConductivity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);     
     145        Properties.Hot.Inlet.K          =               PP.LiquidThermalConductivity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);     
    143146        Properties.Hot.Outlet.K         =               PP.LiquidThermalConductivity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);   
    144147
    145148"Heat Capacity Hot Stream"
    146         Properties.Hot.Wall.Cp  =               PP.LiquidCp(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);
     149        Properties.Hot.Wall.Cp          =               PP.LiquidCp(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);
    147150
    148151"Viscosity Hot Stream"
    149         Properties.Hot.Wall.Mu  =               PP.LiquidViscosity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);     
     152        Properties.Hot.Wall.Mu          =               PP.LiquidViscosity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);     
    150153
    151154"Conductivity Hot Stream"
    152         Properties.Hot.Wall.K   =               PP.LiquidThermalConductivity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);   
     155        Properties.Hot.Wall.K           =               PP.LiquidThermalConductivity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);   
    153156       
    154157
     
    172175"Conductivity Hot Stream"
    173176        Properties.Hot.Average.K        =               PP.VapourThermalConductivity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);   
    174         Properties.Hot.Inlet.K  =               PP.VapourThermalConductivity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);     
     177        Properties.Hot.Inlet.K          =               PP.VapourThermalConductivity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);     
    175178        Properties.Hot.Outlet.K         =               PP.VapourThermalConductivity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);   
    176179
    177180"Heat Capacity Hot Stream"
    178         Properties.Hot.Wall.Cp  =               PP.VapourCp(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);
     181        Properties.Hot.Wall.Cp          =               PP.VapourCp(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);
    179182
    180183"Viscosity Hot Stream"
    181         Properties.Hot.Wall.Mu  =               PP.VapourViscosity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);
     184        Properties.Hot.Wall.Mu          =               PP.VapourViscosity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);
    182185
    183186"Conductivity Hot Stream"
    184         Properties.Hot.Wall.K   =               PP.VapourThermalConductivity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);   
     187        Properties.Hot.Wall.K           =               PP.VapourThermalConductivity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);   
    185188
    186189
     
    195198"Cold Stream Heat Capacity"
    196199        Details.Cc =Inlet.Cold.F*Properties.Cold.Average.Cp;
    197        
    198 "Heat Capacity Ratio"
    199 
    200 Details.Cmin  = min([Details.Ch,Details.Cc]);
    201 Details.Cmax  = max([Details.Ch,Details.Cc]);
    202 Details.Cr    = Details.Cmin/Details.Cmax;
     200
     201"Minimum Heat Capacity"
     202        Details.Cmin  = min([Details.Ch,Details.Cc]);
     203
     204"Maximum Heat Capacity"
     205        Details.Cmax  = max([Details.Ch,Details.Cc]);
     206
     207"Heat Capacity Ratio"   
     208        Details.Cr    = Details.Cmin/Details.Cmax;
    203209#=====================================================================
    204210#       Energy Balance
     
    285291#       Basic Model for Heat Exchangers - LMTD Method
    286292#=====================================================================
    287 
    288293VARIABLES
    289294
     295DT0     as temp_delta   (Brief="Temperature Difference at Inlet",Lower=1);
     296DTL             as temp_delta   (Brief="Temperature Difference at Outlet",Lower=1);
    290297LMTD    as temp_delta   (Brief="Logarithmic Mean Temperature Difference",Lower=1);
    291298Fc              as positive             (Brief="LMTD Correction Factor",Lower=0.5);
    292 MTD             as temp_delta   (Brief="Mean Temperature Difference");
    293 
    294 EQUATIONS
     299MTD             as temp_delta   (Brief="Mean Temperature Difference",Lower=1);
     300
     301EQUATIONS
     302#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
     303#                       Log Mean Temperature Difference
     304#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
     305if abs(DT0 - DTL) > 0.05*max(abs([DT0,DTL]))
     306       
     307        then
     308"Log Mean Temperature Difference"
     309        LMTD= (DT0-DTL)/ln(DT0/DTL);
     310
     311        else
     312       
     313if DT0*DTL equal 0
     314       
     315        then
     316"Log Mean Temperature Difference"
     317        LMTD = 0.5*(DT0+DTL);
     318       
     319        else
     320"Log Mean Temperature Difference"
     321        LMTD = 0.5*(DT0+DTL)*(1-(DT0-DTL)^2/(DT0*DTL)*(1+(DT0-DTL)^2/(DT0*DTL)/2)/12);
     322       
     323end
     324       
     325end
    295326
    296327"Exchange Surface Area"
     
    313344Model HeatExchanger_LMTD        as Heatex_Basic_LMTD
    314345
    315 EQUATIONS
    316 
    317 "Cocurrent Flow LMTD"
    318         LMTD = HE.LogMeanTemperature(Inlet.Hot.T,Outlet.Hot.T,Inlet.Cold.T,Outlet.Cold.T);
     346PARAMETERS
     347
     348        Side as Integer         (Brief="Flow Direction",Lower=0,Upper=1);
     349
     350SET
     351
     352Side = HE.FlowDir(); # Return Flow Direction
     353
     354EQUATIONS
     355#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
     356#       Flow Direction
     357#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
     358if Side equal 0
     359#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
     360#       Cocurrent Flow
     361#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#   
     362        then
     363"Temperature Difference at Inlet"
     364        DT0 = Inlet.Hot.T - Inlet.Cold.T;
     365
     366"Temperature Difference at Outlet"
     367        DTL = Outlet.Hot.T - Outlet.Cold.T;
     368
     369        else
     370#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
     371#       Counter Flow
     372#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#           
     373"Temperature Difference at Inlet"
     374        DT0 = Inlet.Hot.T - Outlet.Cold.T;
     375
     376"Temperature Difference at Outlet"
     377        DTL = Outlet.Hot.T - Inlet.Cold.T;
     378end
    319379
    320380end
     
    325385#===================================================================== 
    326386EQUATIONS
    327 
    328 "Counter Flow LMTD"
    329         LMTD = HE.CounterLMTD(Inlet.Hot.T,Outlet.Hot.T,Inlet.Cold.T,Outlet.Cold.T);
    330 
     387"Temperature Difference at Inlet"
     388        DT0 = Inlet.Hot.T - Outlet.Cold.T;
     389
     390"Temperature Difference at Outlet"
     391        DTL = Outlet.Hot.T - Inlet.Cold.T;
     392       
    331393"LMTD Correction Factor"
    332394        Fc = HE.EshellCorrectionFactor(Inlet.Hot.T,Outlet.Hot.T,Inlet.Cold.T,Outlet.Cold.T);
     
    339401#=====================================================================
    340402EQUATIONS
    341 
    342 "Counter Flow LMTD"
    343         LMTD = HE.CounterLMTD(Inlet.Hot.T,Outlet.Hot.T,Inlet.Cold.T,Outlet.Cold.T);
    344 
     403"Temperature Difference at Inlet"
     404        DT0 = Inlet.Hot.T - Outlet.Cold.T;
     405
     406"Temperature Difference at Outlet"
     407        DTL = Outlet.Hot.T - Inlet.Cold.T;
     408       
    345409"LMTD Correction Factor"
    346410        Fc = HE.FshellCorrectionFactor(Inlet.Hot.T,Outlet.Hot.T,Inlet.Cold.T,Outlet.Cold.T);
  • mso/eml/heat_exchangers/Mheatex.mso

    r26 r45  
    1313* $Id$
    1414*--------------------------------------------------------------------*#
     15
    1516using "streams.mso";
    1617
    17 Model Parameters
    18 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
    19 #       Heat Exchanger External Parameters
    20 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
    21 PARAMETERS
    22        
    23 ext PP                  as CalcObject   (Brief="Physical Properties");
    24 ext     NComp           as Integer              (Brief="Number of Components");
    25 ext     Ncold           as Integer              (Brief="Number of Inlet Cold Streams",Lower=1);
    26 ext     Nhot            as Integer              (Brief="Number of Inlet Hot Streams",Lower=1);
    27        
    28 end     
    29 
    30 Model Inlet_Main_Stream         as Parameters
     18Model Inlet_Main_Stream         
    3119#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
    3220#       Inlet Streams
    3321#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
     22PARAMETERS
     23
     24        Ncold   as Integer      (Brief="Number of Inlet Cold Streams",Lower=1);
     25        Nhot    as Integer      (Brief="Number of Inlet Hot Streams",Lower=1);
     26       
    3427VARIABLES
    3528
    36 Hot(Nhot)               as stream;# Inlet Hot Streams
    37 Cold(Ncold)     as stream;# Inlet Cold Streams
     29        Hot  (Nhot)     as stream;# Inlet Hot Streams
     30        Cold (Ncold)    as stream;# Inlet Cold Streams
    3831       
    3932end
    4033
    41 Model Outlet_Main_Stream        as Parameters
     34Model Outlet_Main_Stream       
    4235#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
    4336#       Outlet Streams
    4437#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
     38PARAMETERS
     39
     40        Ncold   as Integer      (Brief="Number of Inlet Cold Streams",Lower=1);
     41        Nhot    as Integer      (Brief="Number of Inlet Hot Streams",Lower=1);
     42       
    4543VARIABLES
    4644
    47 Hot(Nhot)               as stream_therm;# Outlet Hot Streams
    48 Cold(Ncold)     as stream_therm;# Outlet Cold Streams
     45        Hot  (Nhot)     as stream_therm;# Outlet Hot Streams
     46        Cold (Ncold)    as stream_therm;# Outlet Cold Streams
    4947       
    5048end
     
    5654PARAMETERS
    5755
    58 ext     HE              as CalcObject   (Brief="Cold Box Calculations",File="Heatex.dll");
     56ext PP          as CalcObject   (Brief="Physical Properties");
     57ext     NComp   as Integer              (Brief="Number of Components");
     58        HE              as CalcObject   (Brief="Cold Box Calculations",File="heatex");
    5959        Side    as Integer              (Brief="Flow Direction",Lower=0,Upper=1);
    60 
    61 SET
    62 
    63 Side = HE.FlowDir();
    64 
     60        Ncold   as Integer              (Brief="Number of Inlet Cold Streams",Lower=1);
     61        Nhot    as Integer              (Brief="Number of Inlet Hot Streams",Lower=1);
     62       
    6563VARIABLES
    6664
     
    7169        LMTD    as temp_delta   (Brief="Logarithmic Mean Temperature Difference");
    7270        UA      as positive     (Unit="W/K");
    73        
     71
     72SET
     73
     74Side = HE.FlowDir();
     75
     76Inlet.Ncold  = Ncold;
     77Outlet.Ncold = Ncold;
     78
     79Inlet.Nhot  = Nhot ;
     80Outlet.Nhot = Nhot ;
     81
     82
    7483EQUATIONS
    7584
  • mso/eml/heat_exchangers/heater.mso

    r26 r45  
    2222#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#   
    2323PARAMETERS
    24         ext PP                  as CalcObject   (Brief="Physical Properties");
    25         ext     NComp           as Integer              (Brief="Number of Components");
    26         ext     Ninlet      as Integer          (Brief="Number of Inlet Streams",Lower=1);
     24        ext PP          as CalcObject(Brief="Physical Properties");
     25        ext     NComp   as Integer       (Brief="Number of Components");       
     26                Ninlet  as Integer       (Brief="Number of Inlet Streams",Lower=1);
    2727       
    2828VARIABLES
    2929        in  Inlet(Ninlet)       as stream;              #(Brief="Inlet Streams")
    3030        out Outlet              as stream_therm;#(Brief="Outlet Stream")
    31         Q                               as power                (Brief="Heat Transfer");
     31        Q                               as power                (Brief = "Heat Transfer");
    3232        Vfrac                           as fraction     (Brief = "Vapor fraction Outlet Stream");
    3333        Lfrac                           as fraction     (Brief = "Liquid fraction Outlet Stream");
     
    4545end
    4646
    47 
    4847"Outlet Vapourisation Fraction"
    4948        Outlet.v = PP.VapourFraction(Outlet.T,Outlet.P,Outlet.z);
     
    5857
    5958Model Heater            as Heater_Cooler_Basic
    60 
     59#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
     60#       Heater
     61#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#   
    6162EQUATIONS
    6263
     
    6768
    6869Model Cooler            as Heater_Cooler_Basic
    69 
     70#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
     71#       Cooler
     72#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#   
    7073EQUATIONS
    7174
  • mso/sample/heat_exchangers/Eshell_Detailed_LMTD.mso

    r26 r45  
     1
     2#===============================================================
     3#   Heat Exchanger TEMA E Shell - LMTD Method
     4#  converge após várias tentativas
     5#===============================================================
    16
    27using "Heat_exchangers/HeatExchangerDetailed.mso";
    38
    4 #===============================================================
    5 #   Heat Exchanger TEMA E Shell - LMTD Method
    6 #===============================================================       
    79FlowSheet Exchanger_E_shell_Detailed_LMTD
    810       
    911DEVICES
     12
    1013        exchanger               as E_Shell_LMTD_Det;
    1114        streamhot_in    as streamTP;
     
    1316       
    1417CONNECTIONS
     18
    1519        streamhot_in    to exchanger.Inlet.Hot;
    1620        streamcold_in   to exchanger.Inlet.Cold;
    1721       
    1822PARAMETERS
     23
    1924        PP                      as CalcObject   (File="vrpp");
    2025        NComp           as Integer;
    21         HE                      as CalcObject   (File="Heatex");
    2226
    2327SET
    24 
     28#===============================================================
     29#   Heat Exchanger Options
     30#===============================================================       
    2531        PP.Components           = ["water"];
    26         HE.HotSide              = "Shell";
    27         HE.LMTDcorrection       = "Bowmann";
    28 #       HE.LMTDcorrection       = "Fakeri";
    2932        PP.LiquidModel          = "RK";
    3033        PP.VapourModel          = "RK";
    3134        NComp                           = PP.NumberOfComponents;
     35       
     36        exchanger.HE.HotSide            = "Shell";
     37
     38#   LMTD Correction Factor
     39        exchanger.HE.LMTDcorrection     = "Fakeri";
     40#       exchanger.HE.LMTDcorrection     = "Bowmann";
     41
     42#   Heat Transfer Correlation
     43#       exchanger.HE.LaminarFlow                = "Schlunder";
     44#       exchanger.HE.TurbulentFlow              = "SiederTate";
     45#       exchanger.HE.TransitionFlow     = "GnielinskiII";
     46
    3247#=====================================================================
    3348#       Shell Geometrical Parameters
    3449#=====================================================================       
    35 exchanger.Tpass                         = 2;
     50exchanger.Tpass                         = 4;
    3651exchanger.Dishell               = 0.75  *"m";
    3752exchanger.Lcf                   = 0.043  *"m";
     
    8095#       Baffle Spacing
    8196#=====================================================================
    82         exchanger.Baffles.Ls    = 0.622         *"m";
     97        exchanger.Baffles.Ls    = 0.622  *"m";
    8398        exchanger.Baffles.Lsi   = 0.807  *"m";
    8499
    85100OPTIONS
    86  mode                           = "steady";
    87  relativeAccuracy       = 1e-6;
     101
     102 mode = "steady";
    88103
    89104end
  • mso/sample/heat_exchangers/Eshell_Detailed_NTU.mso

    r26 r45  
    11
    22using "Heat_exchangers/HeatExchangerDetailed.mso";
    3 
    43#===============================================================
    54#   Heat Exchanger TEMA E Shell - NTU Method
     5#   erro ao trocar de modelo termodinamico
    66#===============================================================
    77FlowSheet Exchanger_E_shell_Detailed_NTU
     
    1919        PP                      as CalcObject   (File="vrpp");
    2020        NComp           as Integer;
    21         HE                      as CalcObject   (File="Heatex");
     21
     22SET
     23        PP.Components                   = ["benzene","toluene"];
     24        exchanger.HE.HotSide    = "Shell";
     25        PP.LiquidModel                  = "PR";
     26        PP.VapourModel                  = "PR";
     27        NComp                                   = PP.NumberOfComponents;
    2228       
    23 SET
    24         PP.Components           = ["benzene","toluene"];
    25         HE.HotSide              = "Shell";
    26         PP.LiquidModel          = "PR";
    27         PP.VapourModel          = "PR";
    28         NComp                           = PP.NumberOfComponents;
     29#   Heat Transfer Correlation
     30        exchanger.HE.LaminarFlow                = "Schlunder";
     31        exchanger.HE.TurbulentFlow              = "SiederTate";
     32        exchanger.HE.TransitionFlow     = "GnielinskiII";
     33
    2934#=====================================================================
    3035#       Shell Geometrical Parameters
    3136#=====================================================================   
    32 exchanger.Tpass                         = 4;
     37exchanger.Tpass                         = 2;
    3338exchanger.Dishell               = 0.75  *"m";
    3439exchanger.Lcf                   = 0.043 *"m";
     
    8186
    8287OPTIONS
    83  mode                           = "steady";
    84  relativeAccuracy       = 1e-6;
     88
     89 mode   = "steady";
    8590
    8691end
  • mso/sample/heat_exchangers/Eshell_Discretized_LMTD.mso

    r26 r45  
    2424#    Parâmetros
    2525#===============================================================
    26         PP                      as CalcObject   (File="vrpp.dll");
     26        PP                      as CalcObject   (File="vrpp");
    2727        NComp           as Integer;
    28         HE                      as CalcObject   (File="Heatex.dll");
    2928       
    3029SET
     
    3332#===============================================================
    3433        PP.Components           = ["benzene","toluene"];
    35         HE.HotSide              = "Shell";
    36         HE.LMTDcorrection       = "Fakeri";
     34        exchanger.HE.HotSide            = "Shell";
    3735        PP.LiquidModel          = "PR";
    3836        PP.VapourModel          = "PR";
    3937        NComp                           = PP.NumberOfComponents;
     38       
     39        exchanger.HE.LMTDcorrection     = "Fakeri";
     40#       exchanger.HE.LaminarFlow        = "Schlunder";
     41#       exchanger.HE.TurbulentFlow      = "SiederTate";
     42#       exchanger.HE.TransitionFlow     = "GnielinskiII";
    4043#=====================================================================
    4144#       Parâmetros geométricos do casco
     
    7679        streamhot_in.F  = 40    * "mol/s";
    7780        streamhot_in.T  = 393.15* "K";
    78         streamhot_in.v  = 0    ;
    7981        streamhot_in.z  = [1,0]     ;
     82        streamhot_in.v  = 0     ;
    8083        streamhot_in.P  = 740     * "kPa";
    8184#============================================
     
    8487        streamcold_in.F  = 122                  * "mol/s";
    8588        streamcold_in.T  = 333.15   * "K";
     89        streamcold_in.z  = [0,1];
    8690        streamcold_in.v  = 0;
    87         streamcold_in.z  = [0,1];
    8891        streamcold_in.P  = 2210*"kPa";
    8992#=====================================================================
     
    98101#============================================
    99102 mode                   = "steady";
    100  relativeAccuracy = 1e-6;
    101103
    102104end
  • mso/sample/heat_exchangers/Eshell_Discretized_NTU.mso

    r26 r45  
    2424#    Parâmetros
    2525#===============================================================
    26         PP                      as CalcObject   (File="vrpp.dll");
     26        PP                      as CalcObject   (File="vrpp");
    2727        NComp           as Integer;
    28         HE                      as CalcObject   (File="Heatex.dll");
    2928       
    3029SET
     
    3332#===============================================================
    3433        PP.Components           = ["benzene","toluene"];
    35         HE.HotSide              = "Shell";
    36 #       HE.TurbulentFlow        = "SiederTate";
    37         PP.LiquidModel          = "PR";
    38         PP.VapourModel          = "PR";
     34        exchanger.HE.HotSide            = "Shell";
     35        exchanger.HE.TurbulentFlow      = "SiederTate";
     36        PP.LiquidModel          = "RK";
     37        PP.VapourModel          = "RK";
    3938        NComp                           = PP.NumberOfComponents;
    4039#=====================================================================
     
    9796#   Simulation Options
    9897#============================================
    99  mode                   = "steady";
    100  relativeAccuracy = 1e-6;
     98 mode = "steady";
    10199
    102100end
  • mso/sample/heat_exchangers/MheaterTeste.mso

    r26 r45  
    2929        streamcold2             as stream_therm;
    3030       
     31PARAMETERS
     32
     33        PP                      as CalcObject   (File="vrpp");
     34        NComp           as Integer              (Brief="Number Components");
     35       
     36SET
     37
     38        PP.LiquidModel  = "RK";
     39        PP.VapourModel  = "RK";
     40        PP.Components   = ["water","methanol","benzene"];
     41        NComp                   = PP.NumberOfComponents;
     42       
     43       
     44        Mheater.HE.FlowDirection  = "Cocurrent";
     45        Mheater.Ncold = 2;
     46        Mheater.Nhot  = 2;
     47       
    3148CONNECTIONS
    3249
     
    3653        streamcold2     to Mheater.Inlet.Cold(2);
    3754       
    38 PARAMETERS
    3955
    40         PP                      as CalcObject   (File="vrpp.dll");
    41         HE                      as CalcObject   (File="heatex.dll");
    42         NComp           as Integer              (Brief="Number Components");
    43         Ncold           as Integer              (Brief="Number of Inlet Cold Streams");
    44         Nhot            as Integer              (Brief="Number of Inlet Hot Streams");
    45        
    46 SET
    47 
    48         PP.LiquidModel  = "RK";
    49         PP.VapourModel  = "RK";
    50         PP.Components   = ["water","methanol","benzene"];
    51         NComp                   = PP.NumberOfComponents;
    52         Nhot            = 2;
    53     Ncold               = 2;
    54 #       HE.FlowDirection      = "Cocurrent";
    55         HE.FlowDirection      = "Counter";
    5656
    5757       
     
    104104OPTIONS
    105105 
    106         mode                    = "steady";
    107         relativeAccuracy        = 1e-8;
     106mode    = "steady";
    108107       
    109108end
  • mso/sample/heat_exchangers/Mheater_project.mso

    r1 r45  
    3838PARAMETERS
    3939
    40         PP                      as CalcObject   (File="vrpp.dll");
    41         HE                      as CalcObject   (File="heatex.dll");
     40        PP                      as CalcObject   (File="vrpp");
     41#       HE                      as CalcObject   (File="heatex");
    4242        NComp           as Integer              (Brief="Number Components");
    4343        Ncold           as Integer              (Brief="Number of Inlet Cold Streams");
     
    5050        PP.Components   = ["water","methanol","benzene"];
    5151        NComp                   = PP.NumberOfComponents;
    52         Nhot            = 2;
    53     Ncold               = 2;
    54         HE.FlowDirection      = "Cocurrent";
     52        Mheater.Nhot            = 2;
     53    Mheater.Ncold               = 2;
     54        Mheater.HE.FlowDirection      = "Cocurrent";
    5555#       HE.FlowDirection      = "Counter";
    5656
     
    105105 
    106106        mode                    = "steady";
    107         outputLevel             = "all";
    108107        relativeAccuracy        = 1e-8;
    109108       
  • mso/sample/heat_exchangers/Multipass_Detailed.mso

    r26 r45  
    2424#    Parâmetros
    2525#===============================================================
    26         PP                      as CalcObject   (File="vrpp.dll");
     26        PP                      as CalcObject   (File="vrpp");
    2727        NComp           as Integer;
    28         HE                      as CalcObject   (File="Heatex.dll");
    2928       
    3029SET
     
    3332#===============================================================
    3433        PP.Components           = ["benzene","toluene"];
    35         HE.HotSide              = "Shell";
    36 #       HE.TurbulentFlow        = "SiederTate";
     34        exchanger.HE.HotSide            = "Shell";
     35        exchanger.HE.TurbulentFlow      = "SiederTate";
    3736        PP.LiquidModel          = "PR";
    3837        PP.VapourModel          = "PR";
     
    10099#============================================
    101100 mode                   = "steady";
    102  relativeAccuracy = 1e-6;
    103101
    104102end
  • mso/sample/heat_exchangers/NTU_Method.mso

    r40 r45  
    2020PARAMETERS
    2121
    22         PP                      as CalcObject   (File="vrpp");
    23         HE                      as CalcObject   (File="heatex");
     22        PP                      as CalcObject   (File="vrpp.dll");
     23        HE                      as CalcObject   (File="heatex.dll");
    2424        NComp           as Integer;
    2525       
  • mso/sample/heat_exchangers/Sample_Simplified.mso

    r7 r45  
    1616PARAMETERS
    1717        PP                      as CalcObject   (File="vrpp");
    18         HE              as CalcObject   (File="Heatex");
    1918        NComp           as Integer;
    2019SET
     
    2524        NComp                           = PP.NumberOfComponents;
    2625       
    27 #       HE.FlowDirection      = "Cocurrent";
    28         HE.FlowDirection      = "Counter";
     26#       exchanger.HE.FlowDirection      = "Cocurrent";
     27        exchanger.HE.FlowDirection      = "Counter";
    2928
    3029SPECIFY
     
    6867PARAMETERS
    6968        PP                      as CalcObject   (File="vrpp");
    70         HE              as CalcObject   (File="Heatex");
    7169        NComp           as Integer;
    7270SET
     
    7775        NComp                           = PP.NumberOfComponents;
    7876       
    79 #       HE.FlowDirection      = "Cocurrent";
    80         HE.FlowDirection      = "Counter";
     77        exchanger.HE.FlowDirection      = "Cocurrent";
     78#       exchanger.HE.FlowDirection      = "Counter";
    8179
    8280SPECIFY
     
    10098       
    10199OPTIONS
    102  mode                     = "steady";
    103  relativeAccuracy = 1e-6;
    104 
     100 mode  = "steady";
    105101end
    106102
  • mso/sample/heat_exchangers/heater_project.mso

    r1 r45  
    2525PARAMETERS
    2626
    27         PP                      as CalcObject (File="vrpp.dll");
     27        PP                      as CalcObject (File="vrpp");
    2828        NComp           as Integer;
    29         Ninlet      as Integer     (Brief="Number of Inlet Streams");
    3029       
    3130SET
     
    3635        PP.Components   = ["water"];
    3736        NComp                   = PP.NumberOfComponents;
    38         Ninlet          = 1;
     37        heater.Ninlet          = 1;
    3938
    4039SPECIFY
     
    5554 
    5655        mode                    = "steady";
    57         relativeAccuracy        = 1e-8;
    58        
    5956       
    6057end
     
    7774        PP                      as CalcObject (File="vrpp.dll");
    7875        NComp   as Integer;
    79         Ninlet      as Integer     (Brief="Number of Inlet Streams");
    8076       
    8177SET
     
    8581        PP.Components   = ["water"];
    8682        NComp                   = PP.NumberOfComponents;
    87         Ninlet          = 1;
     83        cooler.Ninlet          = 1;
    8884
    8985SPECIFY
     
    10399OPTIONS
    104100 
    105         mode                    = "steady";
    106         relativeAccuracy        = 1e-8;
     101        mode    = "steady";
    107102       
    108103       
  • mso/sample/heat_exchangers/sampleEshell.mso

    r26 r45  
    77
    88PP               as CalcObject (Brief="Physical Properties",File="vrpp");
    9 HE           as CalcObject (Brief="Heat Exchangers Calculations",File="Heatex");
    10 NComp as Integer;
     9NComp    as Integer;
    1110       
    1211SET
     
    4039streamcold.T            = 300 * "K";   
    4140streamcold.z            = [0,0.5, 0.1, 0.4];
    42 exchanger.Outlet.Cold.T = 350*"K";
     41exchanger.Outlet.Cold.T = 347*"K";
    4342       
    4443OPTIONS
  • mso/sample/heat_exchangers/sampleEshell_LMTD.mso

    r26 r45  
    66PARAMETERS
    77
    8 PP               as CalcObject (Brief="Physical Properties",File="vrpp");
    9 HE           as CalcObject (Brief="Heat Exchangers Calculations",File="Heatex");
    10 NComp as Integer;
     8PP              as CalcObject (Brief="Physical Properties",File="vrpp");
     9NComp   as Integer;
    1110       
    12 SET
    13 
    14 PP.LiquidModel          = "PR";
    15 PP.VapourModel          = "PR";
    16 PP.Components   = ["water","n-butane", "benzene", "n-octane" ];
    17 NComp                                           = PP.NumberOfComponents;
    1811
    1912DEVICES
     
    2114streamhot       as streamTP;
    2215streamcold  as streamTP;
     16
     17SET
     18
     19PP.LiquidModel  = "PR";
     20PP.VapourModel  = "PR";
     21PP.Components   = ["water","n-butane", "benzene", "n-octane" ];
     22NComp                   = PP.NumberOfComponents;
     23
     24        exchanger.HE.LMTDcorrection     = "Bowmann";
     25#       HE.LMTDcorrection       = "Fakeri";
    2326       
     27
    2428CONNECTIONS
    2529
    26 streamhot               to exchanger.Inlet.Hot;
     30streamhot       to exchanger.Inlet.Hot;
    2731streamcold      to exchanger.Inlet.Cold;
    2832       
     
    3236exchanger.PressureDrop.Hot.Pdrop        = 0.1*"kPa";
    3337exchanger.PressureDrop.Cold.Pdrop   = 0.2*"kPa";
     38
    3439streamhot.F             = 20    * "kmol/h";
    3540streamhot.T             = 450     * "K";
    3641streamhot.P             = 120    * "kPa";
    3742streamhot.z             = [1,0,0,0];
     43
    3844streamcold.F            = 10 * "kmol/h";
    3945streamcold.P            = 120 * "kPa";
    4046streamcold.T            = 300 * "K";   
    4147streamcold.z            = [0,0.5, 0.1, 0.4];
    42 exchanger.Outlet.Cold.T = 350*"K";
     48
     49exchanger.Outlet.Cold.T = 330*"K";
    4350       
    4451OPTIONS
    45  mode                     = "steady";
     52 mode   = "steady";
    4653 end
  • mso/sample/heat_exchangers/sampleLMTD.mso

    r26 r45  
    77
    88PP               as CalcObject (Brief="Physical Properties",File="vrpp");
    9 HE           as CalcObject (Brief="Heat Exchangers Calculations",File="Heatex");
    10 NComp as Integer;
     9NComp   as Integer;
    1110       
    12 SET
    1311
    14 PP.LiquidModel          = "PR";
    15 PP.VapourModel          = "PR";
    16 PP.Components   = ["water","n-butane", "benzene", "n-octane" ];
    17 NComp                                           = PP.NumberOfComponents;
    18 HE.FlowDirection    = "Cocurrent";
    1912       
    2013DEVICES
     
    2215streamhot       as streamTP;
    2316streamcold  as streamTP;
    24        
     17SET
     18
     19PP.LiquidModel          = "PR";
     20PP.VapourModel          = "PR";
     21PP.Components           = ["water","n-butane", "benzene", "n-octane" ];
     22NComp                           = PP.NumberOfComponents;
     23exchanger.HE.FlowDirection    = "Cocurrent";   
    2524CONNECTIONS
    2625
    27 streamhot               to exchanger.Inlet.Hot;
     26streamhot       to exchanger.Inlet.Hot;
    2827streamcold      to exchanger.Inlet.Cold;
    2928       
    3029SPECIFY
    3130
    32 exchanger.Fc                                                                            = 1;
    33 exchanger.Details.U                                                             = 210*"W/(m^2*K)";
     31"LMTD Correction Factor"
     32        exchanger.Fc = 1;
     33       
     34"Overall Heat Transfer Coefficient"     
     35        exchanger.Details.U = 210*"W/(m^2*K)";
     36
    3437exchanger.PressureDrop.Hot.Pdrop        = 0.1*"kPa";
    3538exchanger.PressureDrop.Cold.Pdrop   = 0.2*"kPa";
    36 streamhot.F                                                                                     = 20    * "kmol/h";
    37 streamhot.T                                                                                     = 450     * "K";
     39
     40streamhot.F             = 20    * "kmol/h";
     41streamhot.T             = 450     * "K";
    3842streamhot.P             = 120    * "kPa";
    3943streamhot.z             = [1,0,0,0];
     44
    4045streamcold.F            = 10 * "kmol/h";
    4146streamcold.P            = 120 * "kPa";
    4247streamcold.T            = 300 * "K";   
    4348streamcold.z            = [0,0.5, 0.1, 0.4];
    44 exchanger.Outlet.Cold.T = 350*"K";
     49
     50exchanger.Outlet.Cold.T = 340*"K";
    4551       
    4652OPTIONS
  • mso/sample/heat_exchangers/sampleNTU.mso

    r26 r45  
    66PARAMETERS
    77
    8 PP               as CalcObject (Brief="Physical Properties",File="vrpp");
    9 HE           as CalcObject (Brief="Heat Exchangers Calculations",File="Heatex");
     8PP        as CalcObject (Brief="Physical Properties",File="vrpp");
    109NComp as Integer;
    1110       
     11
     12       
     13DEVICES
     14exchanger       as HeatExchanger_NTU;
     15streamhot       as streamTP;
     16streamcold  as streamTP;
     17
    1218SET
    1319
     
    1622PP.Components   = ["water","n-butane", "benzene", "n-octane" ];
    1723NComp                                           = PP.NumberOfComponents;
    18 HE.FlowDirection    = "Cocurrent";
    19        
    20 DEVICES
    21 exchanger       as HeatExchanger_NTU;
    22 streamhot       as streamTP;
    23 streamcold  as streamTP;
    24        
     24exchanger.HE.FlowDirection    = "Cocurrent";
     25
    2526CONNECTIONS
    2627
    2728streamhot               to exchanger.Inlet.Hot;
    28 streamcold      to exchanger.Inlet.Cold;
     29streamcold              to exchanger.Inlet.Cold;
    2930       
    3031SPECIFY
     
    4142streamcold.T            = 300 * "K";   
    4243streamcold.z            = [0,0.5, 0.1, 0.4];
    43 exchanger.Outlet.Cold.T = 350*"K";
     44exchanger.Outlet.Cold.T = 340*"K";
    4445       
    4546OPTIONS
    46  mode                     = "steady";
     47 mode   = "steady";
    4748 end
  • mso/sample/heat_exchangers/sample_cooler.mso

    r26 r45  
    1414DEVICES
    1515
     16
    1617        cooler                  as Cooler;
    1718        streamcold1     as stream_therm;
     
    2728        PP                      as CalcObject (File="vrpp");
    2829        NComp           as Integer;
    29         Ninlet      as Integer     (Brief="Number of Inlet Streams");
    3030       
    3131SET
     
    3636        PP.Components   = ["water","methanol"];
    3737        NComp                   = PP.NumberOfComponents;
    38         Ninlet          = 2;
     38        cooler.Ninlet   = 2;
    3939
    4040SPECIFY
     
    5555        cooler.Outlet.P         = 1 * "atm";
    5656
    57        
    58        
    5957OPTIONS
    60  
    61         mode                    = "steady";
     58        mode                    = "steady";
    6259        relativeAccuracy        = 1e-8;
    6360       
  • mso/sample/heat_exchangers/sample_heater.mso

    r1 r45  
    2525PARAMETERS
    2626
    27         PP                      as CalcObject (File="vrpp");
    28         NComp           as Integer;
    29         Ninlet      as Integer     (Brief="Number of Inlet Streams");
     27        PP              as CalcObject (File="vrpp");
     28        NComp   as Integer;
    3029       
    3130SET
     
    3635        PP.Components   = ["water"];
    3736        NComp                   = PP.NumberOfComponents;
    38         Ninlet          = 1;
     37        heater.Ninlet   = 1;
    3938
    4039SPECIFY
     
    5049        heater.Outlet.T         = 363*"K";
    5150        heater.Outlet.P         = 1 * "atm";
     51
    5252       
    5353       
     
    5555 
    5656        mode                    = "steady";
    57         outputLevel             = "all";
    58         relativeAccuracy        = 1e-8;
    59        
    6057       
    6158end
     
    7875        PP                      as CalcObject (File="vrpp");
    7976        NComp   as Integer;
    80         Ninlet      as Integer     (Brief="Number of Inlet Streams");
    8177       
    8278SET
     
    8682        PP.Components   = ["water"];
    8783        NComp                   = PP.NumberOfComponents;
    88         Ninlet          = 1;
     84        cooler.Ninlet   = 1;
    8985
    9086SPECIFY
     
    105101 
    106102        mode                    = "steady";
    107         outputLevel             = "all";
    108         relativeAccuracy        = 1e-8;
    109        
    110103       
    111104end
  • mso/sample/heat_exchangers/samples1.mso

    r1 r45  
    2020PARAMETERS
    2121
    22         PP                      as CalcObject   (File="vrpp.dll");
     22        PP                      as CalcObject   (File="vrpp");
    2323        NComp           as Integer;
    24         HE              as CalcObject   (File="Heatex.dll");
    2524       
    2625SET
     
    3029        PP.Components           = ["water"];
    3130        NComp                           = PP.NumberOfComponents;
    32         HE.FlowDirection      = "Counter";
     31        exchanger.HE.FlowDirection      = "Counter";
    3332       
    3433SPECIFY
     
    6463#============================================
    6564 mode                   = "steady";
    66  outputLevel    = "high";
    67  relativeAccuracy = 1e-8;
    6865
    6966end
  • mso/sample/heat_exchangers/samples2.mso

    r26 r45  
    2020PARAMETERS
    2121
    22         PP                      as CalcObject   (File="vrpp.dll");
    23         HE                      as CalcObject   (File="heatex.dll");
     22        PP              as CalcObject   (File="vrpp");
    2423        NComp   as Integer;
    2524       
     
    6564#============================================
    6665 mode                   = "steady";
    67  outputLevel    = "all";
    68  relativeAccuracy = 1e-8;
    6966
    7067end
Note: See TracChangeset for help on using the changeset viewer.