Changeset 131 for branches/newlanguage


Ignore:
Timestamp:
Jan 24, 2007, 11:39:47 AM (16 years ago)
Author:
gerson bicca
Message:

updated

Location:
branches/newlanguage
Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • branches/newlanguage/eml/heat_exchangers/Mheatex.mso

    r100 r131  
    1818*
    1919*       Streams:
    20 *               * Inlet(Ninlet) streams ....    at least one material stream
    21 *               * Outlet stream             ....        one material stream
     20*               * Hot Inlet streams ....        at least one Hot material stream
     21*               * Cold Inlet streams ....       at least one Cold material stream
     22*               * Hot Outlet streams  ....      one material stream for each Hot Inlet
     23*               * Cold Outlet streams  ....     one material stream for each Cold Inlet
    2224*
    2325*       Purpose:
    24 *               * Determines thermal and phase conditions of outlet stream
     26*               * Heat Transfer between multiple hot and cold streams.
    2527*
    2628*----------------------------------------------------------------------
     
    5860VARIABLES
    5961
    60         Hot  (Nhot)     as stream_therm;# Outlet Hot Streams
    61         Cold (Ncold)    as stream_therm;# Outlet Cold Streams
     62        Hot  (Nhot)     as liquid_stream;# Outlet Hot Streams
     63        Cold (Ncold)    as liquid_stream;# Outlet Cold Streams
    6264       
    6365end
     
    6971PARAMETERS
    7072
    71 ext PP          as CalcObject   (Brief="Physical Properties");
    72 ext     NComp   as Integer              (Brief="Number of Components");
    73         HE              as CalcObject   (Brief="Cold Box Calculations",File="heatex");
     73outer PP                as Plugin       (Brief="Physical Properties");
     74outer   NComp   as Integer              (Brief="Number of Components");
     75#       HE              as Plugin       (Brief="Cold Box Calculations",File="heatex");
    7476        Side    as Integer              (Brief="Flow Direction",Lower=0,Upper=1);
    7577        Ncold   as Integer              (Brief="Number of Inlet Cold Streams",Lower=1);
     
    8486        LMTD    as temp_delta   (Brief="Logarithmic Mean Temperature Difference");
    8587        UA      as positive     (Unit="W/K");
    86 
     88        DT0     as temp_delta   (Brief="Temperature Difference at Inlet",Lower=1);
     89        DTL             as temp_delta   (Brief="Temperature Difference at Outlet",Lower=1);
     90       
    8791SET
    8892
    8993# Flow Direction
    90         Side = HE.FlowDir();
     94#       Side = HE.FlowDir();
    9195
    9296# Inlet Ncold Parameters
     
    116120        Outlet.Cold.z = Inlet.Cold.z;
    117121       
     122
     123
     124for i in [1:Nhot]
     125
    118126"Vapourisation Fraction Hot Stream"
    119         Outlet.Hot.v = Inlet.Hot.v;             
     127        Outlet.Hot(i).v = PP.VapourFraction(Outlet.Hot(i).T,Outlet.Hot(i).P,Outlet.Hot(i).z);           
     128       
     129end     
     130
     131
     132for j in [1:Ncold]
    120133       
    121134"Vapourisation Fraction Cold Stream"
    122         Outlet.Cold.v = Inlet.Cold.v;   
     135        Outlet.Cold(j).v = PP.VapourFraction(Outlet.Cold(j).T,Outlet.Cold(j).P,Outlet.Cold(j).z);
    123136       
     137end
     138       
     139
    124140"Heat Duty Hot Stream"
    125141        Q =  sum(Inlet.Hot.F*(Inlet.Hot.h- Outlet.Hot.h));
     
    131147        Q=UA*LMTD;
    132148
    133 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
    134 #       Flow Direction
    135 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
     149       
     150if abs(DT0 - DTL) > 0.05*max(abs([DT0,DTL]))
     151       
     152        then
     153"Log Mean Temperature Difference"
     154        LMTD= (DT0-DTL)/ln(DT0/DTL);
     155
     156        else
     157       
     158if DT0*DTL equal 0
     159       
     160        then
     161"Log Mean Temperature Difference"
     162        LMTD = 0.5*(DT0+DTL);
     163       
     164        else
     165"Log Mean Temperature Difference"
     166        LMTD = 0.5*(DT0+DTL)*(1-(DT0-DTL)^2/(DT0*DTL)*(1+(DT0-DTL)^2/(DT0*DTL)/2)/12);
     167       
     168end
     169       
     170end     
     171
    136172
    137173if Side equal 0
    138174       
    139175        then
    140 "Cocurrent Flow LMTD"
    141         LMTD = HE.CocurrentLMTD(max(Inlet.Hot.T),min(Outlet.Hot.T),min(Inlet.Cold.T),max(Outlet.Cold.T));
     176       
     177"Temperature Difference at Inlet"
     178        DT0 = max(Inlet.Hot.T) - min(Inlet.Cold.T);
     179
     180"Temperature Difference at Outlet"
     181        DTL = min(Outlet.Hot.T) - max(Outlet.Cold.T);
    142182       
    143183        else
    144 "Counter Flow LMTD"
    145         LMTD = HE.CounterLMTD(max(Inlet.Hot.T),min(Outlet.Hot.T),max(Inlet.Cold.T),min(Outlet.Cold.T));
     184       
     185"Temperature Difference at Inlet"
     186        DT0 = max(Inlet.Hot.T) - max(Outlet.Cold.T);
     187
     188"Temperature Difference at Outlet"
     189        DTL = min(Outlet.Hot.T) - min(Inlet.Cold.T);
    146190       
    147191end
Note: See TracChangeset for help on using the changeset viewer.