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 316 2007-07-18 18:50:58Z bicca $ |
---|
17 | *--------------------------------------------------------------------*# |
---|
18 | |
---|
19 | using "streams.mso"; |
---|
20 | |
---|
21 | Model heater |
---|
22 | |
---|
23 | ATTRIBUTES |
---|
24 | Pallete = true; |
---|
25 | Icon = "icon/heater"; |
---|
26 | Brief = "Heater or Cooler"; |
---|
27 | Info = |
---|
28 | "Determines thermal and phase conditions of an outlet stream"; |
---|
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 | |
---|
35 | SUBMODELS |
---|
36 | in Inlet(Ninlet ) as stream (Brief="Inlet Streams"); |
---|
37 | out Outlet as streamPH (Brief="Outlet Stream"); |
---|
38 | in InletHeat as energy_stream (Brief ="Inlet Heat Stream"); |
---|
39 | out OutletHeat as energy_stream (Brief ="Outlet Heat Stream"); |
---|
40 | |
---|
41 | VARIABLES |
---|
42 | QDuty as power (Brief = "Actual Duty"); |
---|
43 | Vfrac as fraction (Brief = "Vapor fraction Outlet Stream"); |
---|
44 | Lfrac as fraction (Brief = "Liquid fraction Outlet Stream"); |
---|
45 | Kvalue(NComp) as Real (Brief = "Phase Equilibrium K-values"); |
---|
46 | |
---|
47 | EQUATIONS |
---|
48 | |
---|
49 | "Flow" |
---|
50 | Outlet.F = sum(Inlet.F); |
---|
51 | |
---|
52 | for j in [1 : NComp] |
---|
53 | |
---|
54 | "Composition" |
---|
55 | Outlet.F*Outlet.z(j) = sum(Inlet.F*Inlet.z(j)); |
---|
56 | |
---|
57 | end |
---|
58 | |
---|
59 | "Vapor fraction Outlet Stream" |
---|
60 | Vfrac = Outlet.v; |
---|
61 | |
---|
62 | "Liquid fraction Outlet Stream" |
---|
63 | Lfrac = 1-Vfrac; |
---|
64 | |
---|
65 | "Heat Duty" |
---|
66 | QDuty = Outlet.F*Outlet.h - sum(Inlet.F*Inlet.h); |
---|
67 | |
---|
68 | "Net Duty" |
---|
69 | OutletHeat.Q = InletHeat.Q - QDuty; |
---|
70 | |
---|
71 | "Phase Equilibrium" |
---|
72 | Kvalue*(Outlet.x) = Outlet.y; |
---|
73 | |
---|
74 | end |
---|
75 | |
---|