1 | #*--------------------------------------------------------------------- |
---|
2 | * This file is property of the author and cannot be used, copyed |
---|
3 | * or modified without permission. |
---|
4 | * |
---|
5 | * Copyright (C) 2004-2006 the author |
---|
6 | * |
---|
7 | * |
---|
8 | * Multistream Heat Exchanger |
---|
9 | * Cocurrent and Counter Flow |
---|
10 | * |
---|
11 | *---------------------------------------------------------------------- |
---|
12 | * Author: Gerson Balbueno Bicca |
---|
13 | * $Id: Mheatex.mso 1 2006-06-20 17:33:53Z rafael $ |
---|
14 | *--------------------------------------------------------------------*# |
---|
15 | |
---|
16 | using "streams.mso"; |
---|
17 | |
---|
18 | Model Parameters |
---|
19 | #===================================================================== |
---|
20 | # Heat Exchanger Parameters |
---|
21 | #===================================================================== |
---|
22 | PARAMETERS |
---|
23 | |
---|
24 | ext PP as CalcObject; |
---|
25 | ext NComp as Integer (Brief="Number of Components"); |
---|
26 | ext Ncold as Integer (Brief="Number of Inlet Cold Streams",Lower=1,Default=1); |
---|
27 | ext Nhot as Integer (Brief="Number of Inlet Hot Streams",Lower=1,Default=1); |
---|
28 | |
---|
29 | end |
---|
30 | |
---|
31 | Model Inlet_Main_Stream as Parameters |
---|
32 | #===================================================================== |
---|
33 | # Inlet Streams |
---|
34 | #===================================================================== |
---|
35 | |
---|
36 | VARIABLES |
---|
37 | |
---|
38 | Hot(Nhot) as stream;# Inlet Hot Streams |
---|
39 | Cold(Ncold) as stream;# Inlet Cold Streams |
---|
40 | |
---|
41 | end |
---|
42 | |
---|
43 | Model Outlet_Main_Stream as Parameters |
---|
44 | #===================================================================== |
---|
45 | # Outlet Streams |
---|
46 | #===================================================================== |
---|
47 | |
---|
48 | VARIABLES |
---|
49 | |
---|
50 | Hot(Nhot) as stream_therm;# Outlet Hot Streams |
---|
51 | Cold(Ncold) as stream_therm;# Outlet Cold Streams |
---|
52 | |
---|
53 | end |
---|
54 | |
---|
55 | Model Mheatex |
---|
56 | #===================================================================== |
---|
57 | # Multistream Heat Exchanger Basic Calculation |
---|
58 | #===================================================================== |
---|
59 | PARAMETERS |
---|
60 | |
---|
61 | ext HE as CalcObject (Brief="Cold Box Calculations",File="Heatex.dll"); |
---|
62 | Side as Integer (Brief="Flow Direction",Lower=0,Upper=1); |
---|
63 | |
---|
64 | SET |
---|
65 | |
---|
66 | Side = HE.FlowDirection(); |
---|
67 | |
---|
68 | VARIABLES |
---|
69 | |
---|
70 | in Inlet as Inlet_Main_Stream; # Inlet Hot Streams |
---|
71 | out Outlet as Outlet_Main_Stream; # Outlet Hot Streams |
---|
72 | |
---|
73 | Q as power (Brief="Heat Transfer"); |
---|
74 | LMTD as temp_delta (Brief="Logarithmic Mean Temperature Difference"); |
---|
75 | UA as positive (Unit="W/K"); |
---|
76 | |
---|
77 | EQUATIONS |
---|
78 | |
---|
79 | "Hot Flow" |
---|
80 | Outlet.Hot.F = Inlet.Hot.F; |
---|
81 | |
---|
82 | "Cold Flow" |
---|
83 | Outlet.Cold.F = Inlet.Cold.F; |
---|
84 | |
---|
85 | "Hot Composition" |
---|
86 | Outlet.Hot.z = Inlet.Hot.z; |
---|
87 | |
---|
88 | "Cold Composition" |
---|
89 | Outlet.Cold.z = Inlet.Cold.z; |
---|
90 | |
---|
91 | "Vapourisation Fraction Hot Stream" |
---|
92 | Outlet.Hot.v = Inlet.Hot.v; |
---|
93 | |
---|
94 | "Vapourisation Fraction Cold Stream" |
---|
95 | Outlet.Cold.v = Inlet.Cold.v; |
---|
96 | |
---|
97 | "Heat Duty Hot Stream" |
---|
98 | Q = sum(Inlet.Hot.F*(Inlet.Hot.h- Outlet.Hot.h)); |
---|
99 | |
---|
100 | "Heat Duty Cold Stream" |
---|
101 | Q = -sum(Inlet.Cold.F*(Inlet.Cold.h- Outlet.Cold.h)); |
---|
102 | |
---|
103 | "Heat Duty" |
---|
104 | Q=UA*LMTD; |
---|
105 | |
---|
106 | #=================================================================== |
---|
107 | # Flow Direction |
---|
108 | #=================================================================== |
---|
109 | if Side equal 0 |
---|
110 | |
---|
111 | then |
---|
112 | #===================================================================== |
---|
113 | # Cocurrent Flow Multistream Heat Exchanger |
---|
114 | #=================================================================== |
---|
115 | "Cocurrent Flow LMTD" |
---|
116 | LMTD = HE.CocurrentLMTD(max(Inlet.Hot.T),min(Outlet.Hot.T),min(Inlet.Cold.T),max(Outlet.Cold.T)); |
---|
117 | |
---|
118 | else |
---|
119 | #===================================================================== |
---|
120 | # Counter Flow Multistream Heat Exchanger |
---|
121 | #===================================================================== |
---|
122 | "Counter Flow LMTD" |
---|
123 | LMTD = HE.CounterLMTD(max(Inlet.Hot.T),min(Outlet.Hot.T),max(Inlet.Cold.T),min(Outlet.Cold.T)); |
---|
124 | |
---|
125 | end |
---|
126 | |
---|
127 | end |
---|