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

Last change on this file since 419 was 372, checked in by Argimiro Resende Secchi, 16 years ago

Adding pressure drop variable (Pdrop) and pressure ratio (Pratio) in some models. Need to do the same for other models.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.6 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 372 2007-09-21 22:17:36Z arge $
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        Ninlet          as Integer      (Brief="Number of Inlet Streams");
34        Kvalues         as Switcher (Brief="Option for Display Phase Equilibrium K-values",Valid=["yes","no"], Default="yes");
35
36 VARIABLES
37        QDuty                   as power                        (Brief = "Actual Duty",Symbol="Q_{Duty}");
38        Vfrac                   as fraction             (Brief = "Vapor fraction Outlet Stream",Symbol="V_{frac}");
39        Lfrac                   as fraction             (Brief = "Liquid fraction Outlet Stream",Symbol="L_{frac}");
40        Kvalue(NComp)   as Real                         (Brief = "Phase Equilibrium K-values",Symbol="K_{value}");
41        Pratio                  as positive                     (Brief = "Pressure Ratio", Symbol ="P_{ratio}");       
42        Pdrop                   as press_delta          (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P");
43in  Inlet(Ninlet )  as stream                   (Brief = "Inlet Streams", PosX=0, PosY=0.4833, Symbol="^{in}");
44out Outlet              as streamPH                     (Brief = "Outlet Stream", PosX=1, PosY=0.4782, Symbol="^{out}");
45       
46 EQUATIONS
47
48 "Flow"
49        Outlet.F = sum(Inlet.F);       
50
51 for j in [1 : NComp]
52       
53 "Composition"
54        Outlet.F*Outlet.z(j) = sum(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        QDuty = Outlet.F*Outlet.h - sum(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        case "yes":
75 "K-values Phase Equilibrium"
76        Kvalue*Outlet.x = Outlet.y;
77
78        case "no":
79 "K-values Phase Equilibrium"
80        Kvalue = 1;
81
82 end
83end
84
85Model heater as heater_basic
86
87 ATTRIBUTES
88        Pallete         = true;
89        Icon            = "icon/heater";       
90        Brief   = "Heater";
91        Info            =
92"Determines thermal and phase conditions of an outlet stream.
93
94== Specify ==
95* The Inlet streams: Any Number
96* Specify:
97**The outlet temperature and the outlet pressure or
98** The outlet temperature and the inlet energy stream or
99** The outlet pressure and the inlet energy stream
100";
101
102 VARIABLES
103in  InletQ              as energy_stream        (Brief ="Inlet Heat Stream", PosX=0.1662, PosY=1, Symbol="_{out}");
104
105 EQUATIONS
106 "Net Duty"
107        InletQ.Q = QDuty;
108end
109
110Model cooler as heater_basic
111
112 ATTRIBUTES
113        Pallete         = true;
114        Icon            = "icon/cooler";       
115        Brief   = "Cooler";
116        Info            =
117"Determines thermal and phase conditions of an outlet stream.
118
119== Specify ==
120* The Inlet streams: Any Number
121* Specify:
122**The outlet temperature and the outlet pressure or
123** The outlet temperature and the inlet energy stream or
124** The outlet pressure and the inlet energy stream
125";
126
127 VARIABLES
128in  InletQ              as energy_stream        (Brief ="Inlet Heat Stream", PosX=0.8245, PosY=1, Symbol="_{out}");
129
130 EQUATIONS
131 "Net Duty"
132        InletQ.Q = -QDuty;
133end
Note: See TracBrowser for help on using the repository browser.