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 307 2007-07-05 01:54:54Z arge $ |
---|
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 | PARAMETERS |
---|
31 | |
---|
32 | outer PP as Plugin (Brief="Physical Properties", Type="PP"); |
---|
33 | outer NComp as Integer (Brief="Number of Components"); |
---|
34 | FlowDirection as Switcher(Brief="Flow Direction",Valid=["counter","cocurrent"],Default="cocurrent"); |
---|
35 | Ncold as Integer (Brief="Number of Inlet Cold Streams",Lower=1); |
---|
36 | Nhot as Integer (Brief="Number of Inlet Hot Streams",Lower=1); |
---|
37 | |
---|
38 | VARIABLES |
---|
39 | |
---|
40 | in InletHot(Nhot) as stream (Brief="Inlet Hot Streams"); |
---|
41 | out OutletHot(Nhot) as streamPH (Brief="Outlet Hot Streams"); |
---|
42 | in InletCold(Ncold) as stream (Brief="Inlet Cold Streams"); |
---|
43 | out OutletCold(Ncold) as streamPH (Brief="Outlet Cold Streams"); |
---|
44 | |
---|
45 | Method as LMTD_Basic (Brief="Log Mean Temperature Difference Method"); |
---|
46 | Q as power (Brief="Heat Transfer", Default=7000, Lower=1e-6, Upper=1e10); |
---|
47 | UA as Real (Brief="UA product",Unit='W/K',Lower=1e-8); |
---|
48 | |
---|
49 | EQUATIONS |
---|
50 | |
---|
51 | "Hot Flow" |
---|
52 | OutletHot.F = InletHot.F; |
---|
53 | |
---|
54 | "Cold Flow" |
---|
55 | OutletCold.F = InletCold.F; |
---|
56 | |
---|
57 | "Hot Composition" |
---|
58 | OutletHot.z = InletHot.z; |
---|
59 | |
---|
60 | "Cold Composition" |
---|
61 | OutletCold.z = InletCold.z; |
---|
62 | |
---|
63 | "Heat Duty Hot Stream" |
---|
64 | Q = sum(InletHot.F*(InletHot.h- OutletHot.h)); |
---|
65 | |
---|
66 | "Heat Duty Cold Stream" |
---|
67 | Q = -sum(InletCold.F*(InletCold.h- OutletCold.h)); |
---|
68 | |
---|
69 | "Heat Duty" |
---|
70 | Q = UA*Method.LMTD*Method.Fc; |
---|
71 | |
---|
72 | switch FlowDirection |
---|
73 | |
---|
74 | case "cocurrent": |
---|
75 | |
---|
76 | "Temperature Difference at Inlet" |
---|
77 | Method.DT0 = max(InletHot.T) - min(InletCold.T); |
---|
78 | |
---|
79 | "Temperature Difference at Outlet" |
---|
80 | Method.DTL = min(OutletHot.T) - max(OutletCold.T); |
---|
81 | |
---|
82 | case "counter": |
---|
83 | |
---|
84 | "Temperature Difference at Inlet" |
---|
85 | Method.DT0 = max(InletHot.T) - max(OutletCold.T); |
---|
86 | |
---|
87 | "Temperature Difference at Outlet" |
---|
88 | Method.DTL = min(OutletHot.T) - min(InletCold.T); |
---|
89 | |
---|
90 | end |
---|
91 | |
---|
92 | end |
---|