Ignore:
File:
1 edited

Legend:

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

    r45 r1  
    11#*---------------------------------------------------------------------
    2 * Model of a Multistream Heat Exchanger
     2* This file is property of the author and cannot be used, copyed
     3* or modified without permission.
    34*
    4 *       Streams:
    5 *               * Inlet(Ninlet) streams ....    at least one material stream
    6 *               * Outlet stream             ....        one material stream
     5* Copyright (C) 2004-2006  the author
    76*
    8 *       Purpose:
    9 *               * Determines thermal and phase conditions of outlet stream
    107*
     8*               Multistream Heat Exchanger                                                     
     9*               Cocurrent and Counter Flow
     10
    1111*----------------------------------------------------------------------
    1212* Author: Gerson Balbueno Bicca
     
    1616using "streams.mso";
    1717
    18 Model Inlet_Main_Stream         
    19 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
     18Model Parameters
     19#=====================================================================
     20#       Heat Exchanger Parameters
     21#===================================================================== 
     22PARAMETERS
     23       
     24ext PP                  as CalcObject;
     25ext     NComp           as Integer              (Brief="Number of Components");
     26ext     Ncold           as Integer              (Brief="Number of Inlet Cold Streams",Lower=1,Default=1);
     27ext     Nhot            as Integer              (Brief="Number of Inlet Hot Streams",Lower=1,Default=1);
     28       
     29end     
     30
     31Model Inlet_Main_Stream         as Parameters
     32#=====================================================================
    2033#       Inlet Streams
    21 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
    22 PARAMETERS
     34#===================================================================== 
    2335
    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        
    2736VARIABLES
    2837
    29         Hot  (Nhot)     as stream;# Inlet Hot Streams
    30         Cold (Ncold)    as stream;# Inlet Cold Streams
     38Hot(Nhot)               as stream;# Inlet Hot Streams
     39Cold(Ncold)     as stream;# Inlet Cold Streams
    3140       
    3241end
    3342
    34 Model Outlet_Main_Stream       
    35 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
     43Model Outlet_Main_Stream        as Parameters
     44#=====================================================================
    3645#       Outlet Streams
    37 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
    38 PARAMETERS
     46#===================================================================== 
    3947
    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        
    4348VARIABLES
    4449
    45         Hot  (Nhot)     as stream_therm;# Outlet Hot Streams
    46         Cold (Ncold)    as stream_therm;# Outlet Cold Streams
     50Hot(Nhot)               as stream_therm;# Outlet Hot Streams
     51Cold(Ncold)     as stream_therm;# Outlet Cold Streams
    4752       
    4853end
    4954
    5055Model Mheatex
    51 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
     56#=====================================================================
    5257#       Multistream Heat Exchanger Basic Calculation
    53 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
     58#=====================================================================         
    5459PARAMETERS
    5560
    56 ext PP          as CalcObject   (Brief="Physical Properties");
    57 ext     NComp   as Integer              (Brief="Number of Components");
    58         HE              as CalcObject   (Brief="Cold Box Calculations",File="heatex");
     61ext     HE              as CalcObject   (Brief="Cold Box Calculations",File="Heatex.dll");
    5962        Side    as Integer              (Brief="Flow Direction",Lower=0,Upper=1);
    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        
     63
     64SET
     65
     66Side = HE.FlowDirection();
     67
    6368VARIABLES
    6469
     
    6974        LMTD    as temp_delta   (Brief="Logarithmic Mean Temperature Difference");
    7075        UA      as positive     (Unit="W/K");
    71 
    72 SET
    73 
    74 Side = HE.FlowDir();
    75 
    76 Inlet.Ncold  = Ncold;
    77 Outlet.Ncold = Ncold;
    78 
    79 Inlet.Nhot  = Nhot ;
    80 Outlet.Nhot = Nhot ;
    81 
    82 
     76       
    8377EQUATIONS
    8478
     
    110104        Q=UA*LMTD;
    111105
    112 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
     106#===================================================================
    113107#       Flow Direction
    114 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
    115 
     108#===================================================================
    116109if Side equal 0
    117110       
    118111        then
     112#=====================================================================
     113#       Cocurrent Flow Multistream Heat Exchanger
     114#===================================================================
    119115"Cocurrent Flow LMTD"
    120116        LMTD = HE.CocurrentLMTD(max(Inlet.Hot.T),min(Outlet.Hot.T),min(Inlet.Cold.T),max(Outlet.Cold.T));
    121117       
    122118        else
     119#=====================================================================
     120#       Counter Flow Multistream Heat Exchanger
     121#=====================================================================
    123122"Counter Flow LMTD"
    124123        LMTD = HE.CounterLMTD(max(Inlet.Hot.T),min(Outlet.Hot.T),max(Inlet.Cold.T),min(Outlet.Cold.T));
Note: See TracChangeset for help on using the changeset viewer.