Ignore:
File:
1 edited

Legend:

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

    r45 r1  
    1 #--------------------------------------------------------------------
    2 # Author: Gerson Balbueno Bicca
    3 # $Id$
    4 #--------------------------------------------------------------------
     1 #*--------------------------------------------------------------------*
     2*
     3*
     4*
     5*
     6*
     7*
     8*               
     9*                                               
     10*
     11*
     12*----------------------------------------------------------------------
     13* Author: Gerson Balbueno Bicca
     14* $Id$
     15*--------------------------------------------------------------------*#
     16
    517using "HEX_Engine";
     18
    619#=====================================================================
    720#       Basic Models for Simplified Heat Exchangers
    821#=====================================================================
     22
    923Model HeatExchangerSimplified_Basic
     24
    1025PARAMETERS
    11 ext PP          as CalcObject   (Brief="External Physical Properties");
    12         HE              as CalcObject   (Brief="STHE Calculations",File="heatex");
    13 ext NComp       as Integer      (Brief="Number of Components");
    14         M(NComp)        as molweight    (Brief="Component Mol Weight");
     26
     27ext PP      as CalcObject(Brief="External Physical Properties");
     28ext HE      as CalcObject(Brief="STHE Calculations",File="heatex.dll");
     29ext NComp   as Integer   (Brief="Number of Components");
     30  M(NComp)  as molweight (Brief="Component Mol Weight");
    1531       
    1632VARIABLES
     
    5571
    5672if Inlet.Cold.v equal 0
     73       
    5774        then   
     75       
    5876"Heat Capacity Cold Stream"
    59         Properties.Cold.Average.Cp              =       PP.LiquidCp(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
    60         Properties.Cold.Inlet.Cp                =       PP.LiquidCp(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
    61         Properties.Cold.Outlet.Cp               =       PP.LiquidCp(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
     77        Properties.Cold.Average.Cp      =       PP.LiquidCp(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
     78        Properties.Cold.Inlet.Cp        =       PP.LiquidCp(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
     79        Properties.Cold.Outlet.Cp       =       PP.LiquidCp(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
    6280
    6381"Mass Density Cold Stream"
    6482        Properties.Cold.Average.rho     =       PP.LiquidDensity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
    65         Properties.Cold.Inlet.rho               =       PP.LiquidDensity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
    66         Properties.Cold.Outlet.rho              =       PP.LiquidDensity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
     83        Properties.Cold.Inlet.rho       =       PP.LiquidDensity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
     84        Properties.Cold.Outlet.rho      =       PP.LiquidDensity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
    6785
    6886"Viscosity Cold Stream"
    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);
     87        Properties.Cold.Average.Mu =    PP.LiquidViscosity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
     88        Properties.Cold.Inlet.Mu =              PP.LiquidViscosity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
     89        Properties.Cold.Outlet.Mu =     PP.LiquidViscosity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
    7290
    7391"Conductivity Cold Stream"
    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);
     92        Properties.Cold.Average.K =     PP.LiquidThermalConductivity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
     93        Properties.Cold.Inlet.K =               PP.LiquidThermalConductivity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
     94        Properties.Cold.Outlet.K =              PP.LiquidThermalConductivity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
    7795
    7896"Heat Capacity Cold Stream"
    79         Properties.Cold.Wall.Cp                 =       PP.LiquidCp(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
     97        Properties.Cold.Wall.Cp         =       PP.LiquidCp(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
    8098       
    8199"Viscosity Cold Stream"
    82         Properties.Cold.Wall.Mu                 =       PP.LiquidViscosity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
     100        Properties.Cold.Wall.Mu =       PP.LiquidViscosity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
    83101
    84102"Conductivity Cold Stream"
    85         Properties.Cold.Wall.K                  =       PP.LiquidThermalConductivity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
     103        Properties.Cold.Wall.K =        PP.LiquidThermalConductivity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
    86104
    87105
     
    95113"Mass Density Cold Stream"
    96114        Properties.Cold.Average.rho     =       PP.VapourDensity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.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);
     115        Properties.Cold.Inlet.rho       =       PP.VapourDensity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
     116        Properties.Cold.Outlet.rho      =       PP.VapourDensity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
    99117
    100118"Viscosity Cold Stream"
    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);
     119        Properties.Cold.Average.Mu =    PP.VapourViscosity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
     120        Properties.Cold.Inlet.Mu =              PP.VapourViscosity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
     121        Properties.Cold.Outlet.Mu =             PP.VapourViscosity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
    104122
    105123"Conductivity Cold Stream"
    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);
     124        Properties.Cold.Average.K =     PP.VapourThermalConductivity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
     125        Properties.Cold.Inlet.K =               PP.VapourThermalConductivity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
     126        Properties.Cold.Outlet.K =              PP.VapourThermalConductivity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
    109127       
    110128"Heat Capacity Cold Stream"
    111         Properties.Cold.Wall.Cp                 =       PP.VapourCp(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
     129        Properties.Cold.Wall.Cp         =       PP.VapourCp(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
    112130
    113131
    114132"Viscosity Cold Stream"
    115         Properties.Cold.Wall.Mu                 =       PP.VapourViscosity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
     133        Properties.Cold.Wall.Mu =       PP.VapourViscosity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
    116134
    117135"Conductivity Cold Stream"
    118         Properties.Cold.Wall.K                  =       PP.VapourThermalConductivity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
     136        Properties.Cold.Wall.K =        PP.VapourThermalConductivity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
    119137       
    120138       
     
    143161"Conductivity Hot Stream"
    144162        Properties.Hot.Average.K        =               PP.LiquidThermalConductivity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);   
    145         Properties.Hot.Inlet.K          =               PP.LiquidThermalConductivity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);     
     163        Properties.Hot.Inlet.K  =               PP.LiquidThermalConductivity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);     
    146164        Properties.Hot.Outlet.K         =               PP.LiquidThermalConductivity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);   
    147165
    148166"Heat Capacity Hot Stream"
    149         Properties.Hot.Wall.Cp          =               PP.LiquidCp(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);
     167        Properties.Hot.Wall.Cp  =               PP.LiquidCp(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);
    150168
    151169"Viscosity Hot Stream"
    152         Properties.Hot.Wall.Mu          =               PP.LiquidViscosity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);     
     170        Properties.Hot.Wall.Mu  =               PP.LiquidViscosity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);     
    153171
    154172"Conductivity Hot Stream"
    155         Properties.Hot.Wall.K           =               PP.LiquidThermalConductivity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);   
     173        Properties.Hot.Wall.K   =               PP.LiquidThermalConductivity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);   
    156174       
    157175
     
    175193"Conductivity Hot Stream"
    176194        Properties.Hot.Average.K        =               PP.VapourThermalConductivity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);   
    177         Properties.Hot.Inlet.K          =               PP.VapourThermalConductivity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);     
     195        Properties.Hot.Inlet.K  =               PP.VapourThermalConductivity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);     
    178196        Properties.Hot.Outlet.K         =               PP.VapourThermalConductivity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);   
    179197
    180198"Heat Capacity Hot Stream"
    181         Properties.Hot.Wall.Cp          =               PP.VapourCp(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);
     199        Properties.Hot.Wall.Cp  =               PP.VapourCp(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);
    182200
    183201"Viscosity Hot Stream"
    184         Properties.Hot.Wall.Mu          =               PP.VapourViscosity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);
     202        Properties.Hot.Wall.Mu  =               PP.VapourViscosity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);
    185203
    186204"Conductivity Hot Stream"
    187         Properties.Hot.Wall.K           =               PP.VapourThermalConductivity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);   
     205        Properties.Hot.Wall.K   =               PP.VapourThermalConductivity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);   
    188206
    189207
     
    198216"Cold Stream Heat Capacity"
    199217        Details.Cc =Inlet.Cold.F*Properties.Cold.Average.Cp;
    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;
     218       
     219"Heat Capacity Ratio"
     220        [Details.Cmin,Details.Cmax,Details.Cr]  = HE.HeatCapacityRatio(Details.Ch,Details.Cc);
     221
    209222#=====================================================================
    210223#       Energy Balance
     
    291304#       Basic Model for Heat Exchangers - LMTD Method
    292305#=====================================================================
     306
    293307VARIABLES
    294308
    295 DT0     as temp_delta   (Brief="Temperature Difference at Inlet",Lower=1);
    296 DTL             as temp_delta   (Brief="Temperature Difference at Outlet",Lower=1);
    297 LMTD    as temp_delta   (Brief="Logarithmic Mean Temperature Difference",Lower=1);
    298 Fc              as positive             (Brief="LMTD Correction Factor",Lower=0.5);
    299 MTD             as temp_delta   (Brief="Mean Temperature Difference",Lower=1);
    300 
    301 EQUATIONS
    302 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
    303 #                       Log Mean Temperature Difference
    304 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
    305 if 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        
    313 if 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        
    323 end
    324        
    325 end
     309LMTD                    as temp_delta   (Brief="Logarithmic Mean Temperature Difference");
     310Fc                              as positive             (Brief="LMTD Correction Factor",Lower=0.75);
     311MTD                             as temp_delta   (Brief="Mean Temperature Difference");
     312
     313EQUATIONS
    326314
    327315"Exchange Surface Area"
    328         Details.Q = Details.U*Details.A*MTD;   
     316        Details.Q = Details.U*Details.A*Fc*LMTD;       
    329317       
    330318"Mean Temperature Difference"   
     
    344332Model HeatExchanger_LMTD        as Heatex_Basic_LMTD
    345333
    346 PARAMETERS
    347 
    348         Side as Integer         (Brief="Flow Direction",Lower=0,Upper=1);
    349 
    350 SET
    351 
    352 Side = HE.FlowDir(); # Return Flow Direction
    353 
    354 EQUATIONS
    355 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
    356 #       Flow Direction
    357 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
    358 if 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;
    378 end
     334EQUATIONS
     335
     336"Cocurrent Flow LMTD"
     337        LMTD = HE.LogMeanTemperature(Inlet.Hot.T,Outlet.Hot.T,Inlet.Cold.T,Outlet.Cold.T);
    379338
    380339end
     
    385344#===================================================================== 
    386345EQUATIONS
    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        
     346
     347"Counter Flow LMTD"
     348        LMTD = HE.CounterLMTD(Inlet.Hot.T,Outlet.Hot.T,Inlet.Cold.T,Outlet.Cold.T);
     349
    393350"LMTD Correction Factor"
    394351        Fc = HE.EshellCorrectionFactor(Inlet.Hot.T,Outlet.Hot.T,Inlet.Cold.T,Outlet.Cold.T);
     
    401358#=====================================================================
    402359EQUATIONS
    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        
     360
     361"Counter Flow LMTD"
     362        LMTD = HE.CounterLMTD(Inlet.Hot.T,Outlet.Hot.T,Inlet.Cold.T,Outlet.Cold.T);
     363
    409364"LMTD Correction Factor"
    410365        Fc = HE.FshellCorrectionFactor(Inlet.Hot.T,Outlet.Hot.T,Inlet.Cold.T,Outlet.Cold.T);
     
    412367end
    413368
     369Model Multipass_LMTD            as Heatex_Basic_LMTD
     370#============================================================================
     371#       Shell and Tubes Heat Exchanger In Series with 1 shell pass - LMTD Method
     372#============================================================================
     373PARAMETERS
     374
     375Nshell  as Integer      (Brief="N Shell in Series",Lower=2);
     376
     377EQUATIONS
     378
     379"Counter Flow LMTD"
     380        LMTD = HE.CounterLMTD(Inlet.Hot.T,Outlet.Hot.T,Inlet.Cold.T,Outlet.Cold.T);
     381
     382"LMTD Correction Factor"
     383        Fc = HE.MpassCorrectionFactor(Inlet.Hot.T,Outlet.Hot.T,Inlet.Cold.T,Outlet.Cold.T,Nshell);
     384
     385end
     386
     387
    414388#=====================================================================
    415389# NTU Method
     
    419393
    420394EQUATIONS
     395
    421396"Effectiveness"
    422397        Eft=HE.Effectiveness(Details.Cr,Details.NTU);
     
    429404#=====================================================================
    430405EQUATIONS
     406
    431407"TEMA E Shell Effectiveness"
    432408        Eft = 2*(1+Details.Cr+sqrt(1+Details.Cr^2)*((1+exp(-Details.NTU*sqrt(1+Details.Cr^2)))/(1-exp(-Details.NTU*sqrt(1+Details.Cr^2)))) )^-1;
Note: See TracChangeset for help on using the changeset viewer.