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

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

adjust in model (heater/cooler)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.7 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 738 2009-02-27 04:26:23Z bicca $
17*--------------------------------------------------------------------*#
18
19using "streams";
20
21Model heater
22
23 ATTRIBUTES
24        Pallete         = true;
25        Icon            = "icon/heater";       
26        Brief   = "Heater";
27        Info            =
28"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
36";
37
38 PARAMETERS
39        outer PP        as Plugin       (Brief="Physical Properties", Type="PP");
40        outer NComp     as Integer      (Brief="Number of Components");
41        Kvalues         as Switcher (Brief="Option for Display Phase Equilibrium K-values",Valid=["yes","no"], Default="yes");
42
43 VARIABLES
44        Duty                    as power                (Brief = "Actual Duty",Symbol="Q_{Duty}");
45        Vfrac                   as fraction     (Brief = "Vapor fraction Outlet Stream",Symbol="V_{frac}");
46        Lfrac                   as fraction     (Brief = "Liquid fraction Outlet Stream",Symbol="L_{frac}");
47        Kvalue(NComp)   as Real                 (Brief = "Phase Equilibrium K-values",Lower=1E-30,Upper=1E30,Symbol="K_{value}");
48        Pratio                  as positive             (Brief = "Pressure Ratio", Symbol ="P_{ratio}");       
49        Pdrop                   as press_delta  (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P");
50
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
55 EQUATIONS
56
57 "Flow"
58        Outlet.F = Inlet.F;     
59
60 for j in [1 : NComp] do
61       
62 "Composition"
63        Outlet.F*Outlet.z(j) = Inlet.F*Inlet.z(j);     
64       
65 end
66
67 "Vapor fraction Outlet Stream"
68        Vfrac = Outlet.v;
69
70 "Liquid fraction Outlet Stream"
71        Lfrac = 1-Vfrac;
72
73 "Heat Duty"
74        Duty = Outlet.F*Outlet.h - Inlet.F*Inlet.h;
75
76 "Pressure Drop"
77        Outlet.P = Inlet.P - Pdrop;
78
79 "Pressure Ratio"
80        Outlet.P = Inlet.P * Pratio;
81       
82 switch Kvalues # Fix for better convergence !!!
83
84        case "yes":
85 "K-values Phase Equilibrium"
86        Kvalue*Outlet.x = Outlet.y;
87
88        case "no":
89 "K-values Phase Equilibrium"
90        Kvalue = 1;
91
92 end
93
94 "Duty Specification"
95        Heat = Duty;
96
97end
98
99Model cooler
100
101 ATTRIBUTES
102        Pallete         = true;
103        Icon            = "icon/cooler";       
104        Brief   = "Cooler";
105        Info            =
106"Determines thermal and phase conditions of an outlet stream.
107
108== Specify ==
109* The Inlet stream
110* Specify:
111**The outlet temperature and the outlet pressure or
112** The outlet temperature and the inlet energy stream or
113** The outlet pressure and the inlet energy stream
114";
115
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
121 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");
128
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}");
131out  Heat               as power        (Brief ="Inlet Heat Stream", PosX=0.5, PosY=0, Symbol="_{out}");
132
133 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
172
173 "Duty Specification"
174        Heat = -Duty;
175
176end
Note: See TracBrowser for help on using the repository browser.