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 284 2007-06-16 22:23:13Z bicca $ |
---|
17 | *--------------------------------------------------------------------*# |
---|
18 | |
---|
19 | using "streams.mso"; |
---|
20 | |
---|
21 | Model Heater_Cooler_Basic |
---|
22 | |
---|
23 | ATTRIBUTES |
---|
24 | Pallete = false; |
---|
25 | Brief = "Heater or Cooler Basic Equations"; |
---|
26 | Info = |
---|
27 | "Determines thermal and phase conditions of outlet stream"; |
---|
28 | |
---|
29 | PARAMETERS |
---|
30 | outer PP as Plugin (Brief="Physical Properties", Type="PP"); |
---|
31 | outer NComp as Integer (Brief="Number of Components"); |
---|
32 | Ninlet as Integer (Brief="Number of Inlet Streams",Lower=1); |
---|
33 | |
---|
34 | VARIABLES |
---|
35 | in Inlet(Ninlet) as stream (Brief="Inlet Streams"); |
---|
36 | out Outlet as streamPH (Brief="Outlet Stream"); |
---|
37 | Q as power (Brief = "Heat Transfer"); |
---|
38 | Vfrac as fraction (Brief = "Vapor fraction Outlet Stream"); |
---|
39 | Lfrac as fraction (Brief = "Liquid fraction Outlet Stream"); |
---|
40 | |
---|
41 | EQUATIONS |
---|
42 | |
---|
43 | "Flow" |
---|
44 | Outlet.F = sum(Inlet.F); |
---|
45 | |
---|
46 | for j in [1 : NComp] |
---|
47 | |
---|
48 | "Composition" |
---|
49 | Outlet.F*Outlet.z(j) = sum(Inlet.F*Inlet.z(j)); |
---|
50 | |
---|
51 | end |
---|
52 | |
---|
53 | "Vapor fraction Outlet Stream" |
---|
54 | Vfrac = Outlet.v; |
---|
55 | |
---|
56 | "Liquid fraction Outlet Stream" |
---|
57 | Lfrac = 1-Vfrac; |
---|
58 | |
---|
59 | end |
---|
60 | |
---|
61 | Model heater as Heater_Cooler_Basic |
---|
62 | |
---|
63 | ATTRIBUTES |
---|
64 | Pallete = true; |
---|
65 | Brief = "Model of a Heater"; |
---|
66 | Info = |
---|
67 | "This model determines thermal and phase conditions of outlet stream"; |
---|
68 | |
---|
69 | EQUATIONS |
---|
70 | |
---|
71 | "Heat Duty" |
---|
72 | Q = Outlet.F*Outlet.h-sum(Inlet.F*Inlet.h); |
---|
73 | |
---|
74 | end |
---|
75 | |
---|
76 | Model cooler as Heater_Cooler_Basic |
---|
77 | |
---|
78 | ATTRIBUTES |
---|
79 | Pallete = true; |
---|
80 | Brief = "Model of a Cooler"; |
---|
81 | Info = |
---|
82 | "This model determines thermal and phase conditions of outlet stream"; |
---|
83 | |
---|
84 | EQUATIONS |
---|
85 | |
---|
86 | "Heat Duty" |
---|
87 | Q = sum(Inlet.F*Inlet.h)- Outlet.F*Outlet.h; |
---|
88 | |
---|
89 | end |
---|