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: Mheatex.mso 359 2007-08-31 20:57:03Z bicca $ |
---|
17 | *--------------------------------------------------------------------*# |
---|
18 | |
---|
19 | using "HEX_Engine.mso"; |
---|
20 | |
---|
21 | Model Mheatex |
---|
22 | |
---|
23 | ATTRIBUTES |
---|
24 | Icon = "icon/Mheatex"; |
---|
25 | Pallete = true; |
---|
26 | Brief = "Model of a Multistream heat exchangers"; |
---|
27 | Info = |
---|
28 | "Heat Transfer between multiple hot and cold streams. |
---|
29 | |
---|
30 | == Specify == |
---|
31 | * The Inlet Hot streams: Any Number |
---|
32 | * The Inlet Cold streams: Any Number |
---|
33 | * The LMTD correction factor |
---|
34 | * Specify: |
---|
35 | **The outlet temperature and the outlet pressure for each stream on one side (hot or cold) of the heat exchanger |
---|
36 | ** On the other side the user must leave at least one unespecified outlet stream. |
---|
37 | |
---|
38 | |
---|
39 | == Setting The Mheatex Parameters == |
---|
40 | *FlowDirection: counter or cocurrent |
---|
41 | *Nhot |
---|
42 | *Ncold |
---|
43 | "; |
---|
44 | |
---|
45 | PARAMETERS |
---|
46 | |
---|
47 | outer PP as Plugin (Brief="Physical Properties", Type="PP"); |
---|
48 | outer NComp as Integer (Brief="Number of Components"); |
---|
49 | FlowDirection as Switcher (Brief="Flow Direction",Valid=["counter","cocurrent"],Default="cocurrent"); |
---|
50 | Ncold as Integer (Brief="Number of Inlet Cold Streams",Lower=1, Symbol = "N_{cold}"); |
---|
51 | Nhot as Integer (Brief="Number of Inlet Hot Streams",Lower=1, Symbol = "N_{hot}"); |
---|
52 | |
---|
53 | VARIABLES |
---|
54 | |
---|
55 | in InletHot(Nhot) as stream (Brief="Inlet Hot Streams", PosX=0, PosY=0.7156, Symbol="^{inHot}"); |
---|
56 | out OutletHot(Nhot) as streamPH (Brief="Outlet Hot Streams", PosX=1, PosY=0.7156, Symbol="^{outHot}"); |
---|
57 | in InletCold(Ncold) as stream (Brief="Inlet Cold Streams", PosX=1, PosY=0.2793, Symbol="^{inCold}"); |
---|
58 | out OutletCold(Ncold) as streamPH (Brief="Outlet Cold Streams", PosX=0, PosY=0.2793, Symbol="^{outCold}"); |
---|
59 | |
---|
60 | Method as LMTD_Basic (Brief="Log Mean Temperature Difference Method", Symbol = " "); |
---|
61 | Q as power (Brief="Heat Transfer", Default=7000, Lower=1e-6, Upper=1e10); |
---|
62 | UA as Real (Brief="UA product",Unit='W/K',Lower=1e-8); |
---|
63 | |
---|
64 | EQUATIONS |
---|
65 | |
---|
66 | "Hot Flow" |
---|
67 | OutletHot.F = InletHot.F; |
---|
68 | |
---|
69 | "Cold Flow" |
---|
70 | OutletCold.F = InletCold.F; |
---|
71 | |
---|
72 | "Hot Composition" |
---|
73 | OutletHot.z = InletHot.z; |
---|
74 | |
---|
75 | "Cold Composition" |
---|
76 | OutletCold.z = InletCold.z; |
---|
77 | |
---|
78 | "Heat Duty Hot Stream" |
---|
79 | Q = sum(InletHot.F*(InletHot.h- OutletHot.h)); |
---|
80 | |
---|
81 | "Heat Duty Cold Stream" |
---|
82 | Q = -sum(InletCold.F*(InletCold.h- OutletCold.h)); |
---|
83 | |
---|
84 | "Heat Duty" |
---|
85 | Q = UA*Method.LMTD*Method.Fc; |
---|
86 | |
---|
87 | switch FlowDirection |
---|
88 | |
---|
89 | case "cocurrent": |
---|
90 | |
---|
91 | "Temperature Difference at Inlet" |
---|
92 | Method.DT0 = max(InletHot.T) - min(InletCold.T); |
---|
93 | |
---|
94 | "Temperature Difference at Outlet" |
---|
95 | Method.DTL = min(OutletHot.T) - max(OutletCold.T); |
---|
96 | |
---|
97 | case "counter": |
---|
98 | |
---|
99 | "Temperature Difference at Inlet" |
---|
100 | Method.DT0 = max(InletHot.T) - max(OutletCold.T); |
---|
101 | |
---|
102 | "Temperature Difference at Outlet" |
---|
103 | Method.DTL = min(OutletHot.T) - min(InletCold.T); |
---|
104 | |
---|
105 | end |
---|
106 | |
---|
107 | end |
---|