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

Last change on this file since 358 was 358, checked in by gerson bicca, 16 years ago

added documentation for the Heater and Cooler operation

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.3 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 358 2007-08-31 20:14:40Z 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        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}");
41in  Inlet(Ninlet )  as stream                   (Brief="Inlet Streams", PosX=0, PosY=0.4833, Symbol="^{in}");
42out Outlet              as streamPH                     (Brief="Outlet Stream", PosX=1, PosY=0.4782, Symbol="^{out}");
43       
44 EQUATIONS
45
46 "Flow"
47        Outlet.F = sum(Inlet.F);       
48
49 for j in [1 : NComp]
50       
51 "Composition"
52        Outlet.F*Outlet.z(j) = sum(Inlet.F*Inlet.z(j));
53       
54 end
55
56 "Vapor fraction Outlet Stream"
57        Vfrac = Outlet.v;
58
59 "Liquid fraction Outlet Stream"
60        Lfrac = 1-Vfrac;
61
62 "Heat Duty"
63        QDuty = Outlet.F*Outlet.h - sum(Inlet.F*Inlet.h);
64
65 switch Kvalues # Fix for better convergence !!!
66        case "yes":
67 "K-values Phase Equilibrium"
68        Kvalue*Outlet.x = Outlet.y;
69
70        case "no":
71 "K-values Phase Equilibrium"
72        Kvalue = 1;
73
74 end
75end
76
77Model heater as heater_basic
78
79 ATTRIBUTES
80        Pallete         = true;
81        Icon            = "icon/heater";       
82        Brief   = "Heater";
83        Info            =
84"Determines thermal and phase conditions of an outlet stream.
85
86== Specify ==
87* The Inlet streams: Any Number
88* Specify:
89**The outlet temperature and the outlet pressure or
90** The outlet temperature and the inlet energy stream or
91** The outlet pressure and the inlet energy stream
92";
93
94 VARIABLES
95in  InletQ              as energy_stream        (Brief ="Inlet Heat Stream", PosX=0.1662, PosY=1, Symbol="_{out}");
96
97 EQUATIONS
98 "Net Duty"
99        InletQ.Q = QDuty;
100end
101
102Model cooler as heater_basic
103
104 ATTRIBUTES
105        Pallete         = true;
106        Icon            = "icon/cooler";       
107        Brief   = "Cooler";
108        Info            =
109"Determines thermal and phase conditions of an outlet stream.
110
111== Specify ==
112* The Inlet streams: Any Number
113* Specify:
114**The outlet temperature and the outlet pressure or
115** The outlet temperature and the inlet energy stream or
116** The outlet pressure and the inlet energy stream
117";
118
119 VARIABLES
120in  InletQ              as energy_stream        (Brief ="Inlet Heat Stream", PosX=0.8245, PosY=1, Symbol="_{out}");
121
122 EQUATIONS
123 "Net Duty"
124        InletQ.Q = -QDuty;
125end
Note: See TracBrowser for help on using the repository browser.