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

Last change on this file since 574 was 574, checked in by Rafael de Pelegrini Soares, 14 years ago

Updated the models to work with some language constraints

  • 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 574 2008-07-25 14:18:50Z rafael $
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(Ninlet )                 as positive                     (Brief = "Pressure Ratio for each stream", Symbol ="P_{ratio}");       
42        Pdrop(Ninlet )          as press_delta          (Brief = "Pressure Drop for each stream", 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] do
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
103
104in  Heat                as power        (Brief ="Inlet Heat Stream", PosX=0.5, PosY=1, Symbol="_{out}");
105
106 EQUATIONS
107 "Net Duty"
108        Heat = QDuty;
109
110end
111
112Model cooler as heater_basic
113
114 ATTRIBUTES
115        Pallete         = true;
116        Icon            = "icon/cooler";       
117        Brief   = "Cooler";
118        Info            =
119"Determines thermal and phase conditions of an outlet stream.
120
121== Specify ==
122* The Inlet streams: Any Number
123* Specify:
124**The outlet temperature and the outlet pressure or
125** The outlet temperature and the inlet energy stream or
126** The outlet pressure and the inlet energy stream
127";
128
129 VARIABLES
130
131in  Heat                as power        (Brief ="Inlet Heat Stream", PosX=0.5, PosY=1, Symbol="_{out}");
132
133 EQUATIONS
134 "Net Duty"
135        Heat = -QDuty;
136
137end
Note: See TracBrowser for help on using the repository browser.