source: branches/gui/eml/heat_exchangers/heater.mso @ 602

Last change on this file since 602 was 602, checked in by gerson bicca, 15 years ago

updates

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.5 KB
RevLine 
[78]1#*-------------------------------------------------------------------
2* EMSO Model Library (EML) Copyright (C) 2004 - 2007 ALSOC.
3*
4* This LIBRARY is free software; you can distribute it and/or modify
5* it under the therms of the ALSOC FREE LICENSE as available at
6* http://www.enq.ufrgs.br/alsoc.
7*
8* EMSO Copyright (C) 2004 - 2007 ALSOC, original code
9* from http://www.rps.eng.br Copyright (C) 2002-2004.
10* All rights reserved.
11*
12* EMSO is distributed under the therms of the ALSOC LICENSE as
13* available at http://www.enq.ufrgs.br/alsoc.
[1]14*----------------------------------------------------------------------
15* Author: Gerson Balbueno Bicca
16* $Id: heater.mso 602 2008-08-17 23:19:15Z bicca $
17*--------------------------------------------------------------------*#
18
[325]19using "streams";
[1]20
[325]21Model heater_basic
[139]22
[325]23 ATTRIBUTES
24        Pallete         = false;
[358]25        Brief   = "Basic model for Heater or Cooler Operation";
[139]26        Info            =
[358]27"Determines thermal and phase conditions of an outlet stream.
28";
[316]29
[325]30 PARAMETERS
[602]31        outer PP        as Plugin       (Brief="Physical Properties", Type="PP");
[325]32        outer NComp     as Integer      (Brief="Number of Components");
[602]33        Kvalues         as Switcher (Brief="Option for Display Phase Equilibrium K-values",Valid=["yes","no"], Default="yes");
[325]34
35 VARIABLES
[602]36        Duty                    as power                (Brief = "Actual Duty",Symbol="Q_{Duty}");
37        Vfrac                   as fraction     (Brief = "Vapor fraction Outlet Stream",Symbol="V_{frac}");
38        Lfrac                   as fraction     (Brief = "Liquid fraction Outlet Stream",Symbol="L_{frac}");
39        Kvalue(NComp)   as Real                 (Brief = "Phase Equilibrium K-values",Lower=1E-30,Upper=1E30,Symbol="K_{value}");
40        Pratio                  as positive             (Brief = "Pressure Ratio", Symbol ="P_{ratio}");       
41        Pdrop                   as press_delta  (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P");
42
43in  Inlet                       as stream               (Brief = "Inlet Stream", PosX=0, PosY=0.45, Symbol="^{in}");
44out Outlet              as streamPH             (Brief = "Outlet Stream", PosX=1, PosY=0.45, Symbol="^{out}");
[1]45       
[325]46 EQUATIONS
[1]47
[325]48 "Flow"
[602]49        Outlet.F = Inlet.F;     
[316]50
[574]51 for j in [1 : NComp] do
[1]52       
[325]53 "Composition"
[602]54        Outlet.F*Outlet.z(j) = Inlet.F*Inlet.z(j);     
[1]55       
[325]56 end
[1]57
[325]58 "Vapor fraction Outlet Stream"
[135]59        Vfrac = Outlet.v;
[26]60
[325]61 "Liquid fraction Outlet Stream"
[26]62        Lfrac = 1-Vfrac;
[1]63
[325]64 "Heat Duty"
[602]65        Duty = Outlet.F*Outlet.h - Inlet.F*Inlet.h;
[139]66
[372]67 "Pressure Drop"
68        Outlet.P = Inlet.P - Pdrop;
69
70 "Pressure Ratio"
71        Outlet.P = Inlet.P * Pratio;
72       
[325]73 switch Kvalues # Fix for better convergence !!!
[602]74
[319]75        case "yes":
[325]76 "K-values Phase Equilibrium"
[326]77        Kvalue*Outlet.x = Outlet.y;
[316]78
[319]79        case "no":
[325]80 "K-values Phase Equilibrium"
[319]81        Kvalue = 1;
82
[325]83 end
[602]84
[1]85end
[325]86
87Model heater as heater_basic
88
89 ATTRIBUTES
90        Pallete         = true;
91        Icon            = "icon/heater";       
92        Brief   = "Heater";
93        Info            =
[358]94"Determines thermal and phase conditions of an outlet stream.
[325]95
[358]96== Specify ==
[602]97* The Inlet stream
[358]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
[325]104 VARIABLES
105
[561]106in  Heat                as power        (Brief ="Inlet Heat Stream", PosX=0.5, PosY=1, Symbol="_{out}");
[546]107
[325]108 EQUATIONS
[546]109
[602]110 "Duty Specification"
111        Heat = Duty;
112
[319]113end
[1]114
[325]115Model cooler as heater_basic
116
117 ATTRIBUTES
118        Pallete         = true;
119        Icon            = "icon/cooler";       
120        Brief   = "Cooler";
121        Info            =
[358]122"Determines thermal and phase conditions of an outlet stream.
[325]123
[358]124== Specify ==
[602]125* The Inlet stream
[358]126* Specify:
127**The outlet temperature and the outlet pressure or
128** The outlet temperature and the inlet energy stream or
129** The outlet pressure and the inlet energy stream
130";
131
[325]132 VARIABLES
133
[561]134in  Heat                as power        (Brief ="Inlet Heat Stream", PosX=0.5, PosY=1, Symbol="_{out}");
[546]135
[325]136 EQUATIONS
[546]137
[602]138 "Duty Specification"
139        Heat = -Duty;
140
[325]141end
Note: See TracBrowser for help on using the repository browser.