source: trunk/eml/heat_exchangers/heater.mso @ 632

Last change on this file since 632 was 632, checked in by gerson bicca, 14 years ago

updates

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.5 KB
Line 
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.
14*----------------------------------------------------------------------
15* Author: Gerson Balbueno Bicca
16* $Id: heater.mso 632 2008-09-23 22:20:38Z bicca $
17*--------------------------------------------------------------------*#
18
19using "streams";
20
21Model heater_basic
22
23 ATTRIBUTES
24        Pallete         = false;
25        Brief   = "Basic model for Heater or Cooler Operation";
26        Info            =
27"Determines thermal and phase conditions of an outlet stream.
28";
29
30 PARAMETERS
31        outer PP        as Plugin       (Brief="Physical Properties", Type="PP");
32        outer NComp     as Integer      (Brief="Number of Components");
33        Kvalues         as Switcher (Brief="Option for Display Phase Equilibrium K-values",Valid=["yes","no"], Default="yes");
34
35 VARIABLES
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}");
45       
46 EQUATIONS
47
48 "Flow"
49        Outlet.F = Inlet.F;     
50
51 for j in [1 : NComp]
52       
53 "Composition"
54        Outlet.F*Outlet.z(j) = Inlet.F*Inlet.z(j);     
55       
56 end
57
58 "Vapor fraction Outlet Stream"
59        Vfrac = Outlet.v;
60
61 "Liquid fraction Outlet Stream"
62        Lfrac = 1-Vfrac;
63
64 "Heat Duty"
65        Duty = Outlet.F*Outlet.h - Inlet.F*Inlet.h;
66
67 "Pressure Drop"
68        Outlet.P = Inlet.P - Pdrop;
69
70 "Pressure Ratio"
71        Outlet.P = Inlet.P * Pratio;
72       
73 switch Kvalues # Fix for better convergence !!!
74
75        case "yes":
76 "K-values Phase Equilibrium"
77        Kvalue*Outlet.x = Outlet.y;
78
79        case "no":
80 "K-values Phase Equilibrium"
81        Kvalue = 1;
82
83 end
84
85end
86
87Model 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
106in  Heat                as energy_stream        (Brief ="Inlet Heat Stream", PosX=0.5, PosY=1, Symbol="_{out}");
107
108 EQUATIONS
109
110 "Duty Specification"
111        Heat.Q = Duty;
112
113end
114
115Model cooler as heater_basic
116
117 ATTRIBUTES
118        Pallete         = true;
119        Icon            = "icon/cooler";       
120        Brief   = "Cooler";
121        Info            =
122"Determines thermal and phase conditions of an outlet stream.
123
124== Specify ==
125* The Inlet stream
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
132 VARIABLES
133
134in  Heat                as energy_stream        (Brief ="Inlet Heat Stream", PosX=0.5, PosY=1, Symbol="_{out}");
135
136 EQUATIONS
137
138 "Duty Specification"
139        Heat.Q = -Duty;
140
141end
Note: See TracBrowser for help on using the repository browser.