Ignore:
Timestamp:
Feb 27, 2009, 1:26:23 AM (15 years ago)
Author:
gerson bicca
Message:

adjust in model (heater/cooler)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/gui/eml/heat_exchangers/heater.mso

    r656 r738  
    1919using "streams";
    2020
    21 Model heater_basic
     21Model heater
    2222
    2323 ATTRIBUTES
    24         Pallete         = false;
    25         Brief   = "Basic model for Heater or Cooler Operation";
     24        Pallete         = true;
     25        Icon            = "icon/heater";       
     26        Brief   = "Heater";
    2627        Info            =
    2728"Determines thermal and phase conditions of an outlet stream.
     29
     30== Specify ==
     31* The Inlet stream
     32* Specify:
     33**The outlet temperature and the outlet pressure or
     34** The outlet temperature and the inlet energy stream or
     35** The outlet pressure and the inlet energy stream
    2836";
    2937
     
    4149        Pdrop                   as press_delta  (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P");
    4250
    43 in  Inlet                       as stream               (Brief = "Inlet Stream", PosX=0, PosY=0.45, Symbol="^{in}");
    44 out Outlet              as streamPH             (Brief = "Outlet Stream", PosX=1, PosY=0.45, Symbol="^{out}");
    45        
     51in  Inlet                       as stream               (Brief = "Inlet Stream", PosX=0, PosY=0.40, Symbol="^{in}");
     52out Outlet              as streamPH             (Brief = "Outlet Stream", PosX=1, PosY=0.40, Symbol="^{out}");
     53in  Heat                as power        (Brief ="Inlet Heat Stream", PosX=0.5, PosY=1, Symbol="_{out}");
     54
    4655 EQUATIONS
    4756
     
    8392 end
    8493
    85 end
    86 
    87 Model heater as heater_basic
    88 
    89  ATTRIBUTES
    90         Pallete         = true;
    91         Icon            = "icon/heater";       
    92         Brief   = "Heater";
    93         Info            =
    94 "Determines thermal and phase conditions of an outlet stream.
    95 
    96 == Specify ==
    97 * The Inlet stream
    98 * Specify:
    99 **The outlet temperature and the outlet pressure or
    100 ** The outlet temperature and the inlet energy stream or
    101 ** The outlet pressure and the inlet energy stream
    102 ";
    103 
    104  VARIABLES
    105 
    106 in  Heat                as power        (Brief ="Inlet Heat Stream", PosX=0.5, PosY=1, Symbol="_{out}");
    107 
    108  EQUATIONS
    109 
    11094 "Duty Specification"
    11195        Heat = Duty;
     
    11397end
    11498
    115 Model cooler as heater_basic
     99Model cooler
    116100
    117101 ATTRIBUTES
     
    130114";
    131115
     116 PARAMETERS
     117        outer PP        as Plugin       (Brief="Physical Properties", Type="PP");
     118        outer NComp     as Integer      (Brief="Number of Components");
     119        Kvalues         as Switcher (Brief="Option for Display Phase Equilibrium K-values",Valid=["yes","no"], Default="yes");
     120
    132121 VARIABLES
     122        Duty                    as power                (Brief = "Actual Duty",Symbol="Q_{Duty}");
     123        Vfrac                   as fraction     (Brief = "Vapor fraction Outlet Stream",Symbol="V_{frac}");
     124        Lfrac                   as fraction     (Brief = "Liquid fraction Outlet Stream",Symbol="L_{frac}");
     125        Kvalue(NComp)   as Real                 (Brief = "Phase Equilibrium K-values",Lower=1E-30,Upper=1E30,Symbol="K_{value}");
     126        Pratio                  as positive             (Brief = "Pressure Ratio", Symbol ="P_{ratio}");       
     127        Pdrop                   as press_delta  (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P");
    133128
     129in  Inlet                       as stream               (Brief = "Inlet Stream", PosX=0, PosY=0.615, Symbol="^{in}");
     130out Outlet              as streamPH             (Brief = "Outlet Stream", PosX=1, PosY=0.615, Symbol="^{out}");
    134131out  Heat               as power        (Brief ="Inlet Heat Stream", PosX=0.5, PosY=0, Symbol="_{out}");
    135132
    136133 EQUATIONS
     134
     135 "Flow"
     136        Outlet.F = Inlet.F;     
     137
     138 for j in [1 : NComp] do
     139       
     140 "Composition"
     141        Outlet.F*Outlet.z(j) = Inlet.F*Inlet.z(j);     
     142       
     143 end
     144
     145 "Vapor fraction Outlet Stream"
     146        Vfrac = Outlet.v;
     147
     148 "Liquid fraction Outlet Stream"
     149        Lfrac = 1-Vfrac;
     150
     151 "Heat Duty"
     152        Duty = Outlet.F*Outlet.h - Inlet.F*Inlet.h;
     153
     154 "Pressure Drop"
     155        Outlet.P = Inlet.P - Pdrop;
     156
     157 "Pressure Ratio"
     158        Outlet.P = Inlet.P * Pratio;
     159       
     160 switch Kvalues # Fix for better convergence !!!
     161
     162        case "yes":
     163 "K-values Phase Equilibrium"
     164        Kvalue*Outlet.x = Outlet.y;
     165
     166        case "no":
     167 "K-values Phase Equilibrium"
     168        Kvalue = 1;
     169
     170 end
     171
    137172
    138173 "Duty Specification"
Note: See TracChangeset for help on using the changeset viewer.