[78] | 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 | * |
---|
| 16 | *--------------------------------------------------------------------- |
---|
[26] | 17 | * Model of a Multistream Heat Exchanger |
---|
[1] | 18 | * |
---|
[26] | 19 | * Streams: |
---|
| 20 | * * Inlet(Ninlet) streams .... at least one material stream |
---|
| 21 | * * Outlet stream .... one material stream |
---|
[1] | 22 | * |
---|
[26] | 23 | * Purpose: |
---|
| 24 | * * Determines thermal and phase conditions of outlet stream |
---|
[1] | 25 | * |
---|
| 26 | *---------------------------------------------------------------------- |
---|
| 27 | * Author: Gerson Balbueno Bicca |
---|
| 28 | * $Id: Mheatex.mso 120 2007-01-17 20:11:19Z bicca $ |
---|
| 29 | *--------------------------------------------------------------------*# |
---|
[45] | 30 | |
---|
[1] | 31 | using "streams.mso"; |
---|
| 32 | |
---|
[45] | 33 | Model Inlet_Main_Stream |
---|
[26] | 34 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# |
---|
[45] | 35 | # Inlet Streams |
---|
[26] | 36 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# |
---|
[1] | 37 | PARAMETERS |
---|
[45] | 38 | |
---|
| 39 | Ncold as Integer (Brief="Number of Inlet Cold Streams",Lower=1); |
---|
| 40 | Nhot as Integer (Brief="Number of Inlet Hot Streams",Lower=1); |
---|
[1] | 41 | |
---|
| 42 | VARIABLES |
---|
| 43 | |
---|
[45] | 44 | Hot (Nhot) as stream;# Inlet Hot Streams |
---|
| 45 | Cold (Ncold) as stream;# Inlet Cold Streams |
---|
[1] | 46 | |
---|
| 47 | end |
---|
| 48 | |
---|
[45] | 49 | Model Outlet_Main_Stream |
---|
[26] | 50 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# |
---|
[1] | 51 | # Outlet Streams |
---|
[26] | 52 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# |
---|
[45] | 53 | PARAMETERS |
---|
| 54 | |
---|
| 55 | Ncold as Integer (Brief="Number of Inlet Cold Streams",Lower=1); |
---|
| 56 | Nhot as Integer (Brief="Number of Inlet Hot Streams",Lower=1); |
---|
| 57 | |
---|
[1] | 58 | VARIABLES |
---|
| 59 | |
---|
[45] | 60 | Hot (Nhot) as stream_therm;# Outlet Hot Streams |
---|
| 61 | Cold (Ncold) as stream_therm;# Outlet Cold Streams |
---|
[1] | 62 | |
---|
| 63 | end |
---|
| 64 | |
---|
| 65 | Model Mheatex |
---|
[26] | 66 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# |
---|
[1] | 67 | # Multistream Heat Exchanger Basic Calculation |
---|
[26] | 68 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# |
---|
[1] | 69 | PARAMETERS |
---|
| 70 | |
---|
[45] | 71 | ext PP as CalcObject (Brief="Physical Properties"); |
---|
| 72 | ext NComp as Integer (Brief="Number of Components"); |
---|
| 73 | HE as CalcObject (Brief="Cold Box Calculations",File="heatex"); |
---|
[1] | 74 | Side as Integer (Brief="Flow Direction",Lower=0,Upper=1); |
---|
[45] | 75 | Ncold as Integer (Brief="Number of Inlet Cold Streams",Lower=1); |
---|
| 76 | Nhot as Integer (Brief="Number of Inlet Hot Streams",Lower=1); |
---|
| 77 | |
---|
[1] | 78 | VARIABLES |
---|
| 79 | |
---|
| 80 | in Inlet as Inlet_Main_Stream; # Inlet Hot Streams |
---|
| 81 | out Outlet as Outlet_Main_Stream; # Outlet Hot Streams |
---|
| 82 | |
---|
| 83 | Q as power (Brief="Heat Transfer"); |
---|
| 84 | LMTD as temp_delta (Brief="Logarithmic Mean Temperature Difference"); |
---|
| 85 | UA as positive (Unit="W/K"); |
---|
[120] | 86 | DT0 as temp_delta (Brief="Temperature Difference at Inlet",Lower=1); |
---|
| 87 | DTL as temp_delta (Brief="Temperature Difference at Outlet",Lower=1); |
---|
| 88 | |
---|
[45] | 89 | SET |
---|
| 90 | |
---|
[100] | 91 | # Flow Direction |
---|
| 92 | Side = HE.FlowDir(); |
---|
[45] | 93 | |
---|
[100] | 94 | # Inlet Ncold Parameters |
---|
| 95 | Inlet.Ncold = Ncold; |
---|
| 96 | |
---|
| 97 | # Outlet Ncold Parameters |
---|
| 98 | Outlet.Ncold = Ncold; |
---|
[45] | 99 | |
---|
[100] | 100 | # Inlet Nhot Parameters |
---|
| 101 | Inlet.Nhot = Nhot; |
---|
| 102 | |
---|
| 103 | # Outlet Nhot Parameters |
---|
| 104 | Outlet.Nhot = Nhot ; |
---|
[45] | 105 | |
---|
[1] | 106 | EQUATIONS |
---|
| 107 | |
---|
| 108 | "Hot Flow" |
---|
| 109 | Outlet.Hot.F = Inlet.Hot.F; |
---|
| 110 | |
---|
| 111 | "Cold Flow" |
---|
| 112 | Outlet.Cold.F = Inlet.Cold.F; |
---|
| 113 | |
---|
| 114 | "Hot Composition" |
---|
| 115 | Outlet.Hot.z = Inlet.Hot.z; |
---|
| 116 | |
---|
| 117 | "Cold Composition" |
---|
| 118 | Outlet.Cold.z = Inlet.Cold.z; |
---|
| 119 | |
---|
| 120 | "Vapourisation Fraction Hot Stream" |
---|
| 121 | Outlet.Hot.v = Inlet.Hot.v; |
---|
| 122 | |
---|
| 123 | "Vapourisation Fraction Cold Stream" |
---|
| 124 | Outlet.Cold.v = Inlet.Cold.v; |
---|
| 125 | |
---|
| 126 | "Heat Duty Hot Stream" |
---|
| 127 | Q = sum(Inlet.Hot.F*(Inlet.Hot.h- Outlet.Hot.h)); |
---|
| 128 | |
---|
| 129 | "Heat Duty Cold Stream" |
---|
| 130 | Q = -sum(Inlet.Cold.F*(Inlet.Cold.h- Outlet.Cold.h)); |
---|
| 131 | |
---|
| 132 | "Heat Duty" |
---|
| 133 | Q=UA*LMTD; |
---|
| 134 | |
---|
[120] | 135 | |
---|
| 136 | if abs(DT0 - DTL) > 0.05*max(abs([DT0,DTL])) |
---|
| 137 | |
---|
| 138 | then |
---|
| 139 | "Log Mean Temperature Difference" |
---|
| 140 | LMTD= (DT0-DTL)/ln(DT0/DTL); |
---|
[26] | 141 | |
---|
[120] | 142 | else |
---|
| 143 | |
---|
| 144 | if DT0*DTL equal 0 |
---|
| 145 | |
---|
| 146 | then |
---|
| 147 | "Log Mean Temperature Difference" |
---|
| 148 | LMTD = 0.5*(DT0+DTL); |
---|
| 149 | |
---|
| 150 | else |
---|
| 151 | "Log Mean Temperature Difference" |
---|
| 152 | LMTD = 0.5*(DT0+DTL)*(1-(DT0-DTL)^2/(DT0*DTL)*(1+(DT0-DTL)^2/(DT0*DTL)/2)/12); |
---|
| 153 | |
---|
| 154 | end |
---|
| 155 | |
---|
| 156 | end |
---|
| 157 | |
---|
| 158 | |
---|
[1] | 159 | if Side equal 0 |
---|
| 160 | |
---|
| 161 | then |
---|
| 162 | |
---|
[120] | 163 | "Temperature Difference at Inlet" |
---|
| 164 | DT0 = max(Inlet.Hot.T) - min(Inlet.Cold.T); |
---|
| 165 | |
---|
| 166 | "Temperature Difference at Outlet" |
---|
| 167 | DTL = min(Outlet.Hot.T) - max(Outlet.Cold.T); |
---|
| 168 | |
---|
[1] | 169 | else |
---|
| 170 | |
---|
[120] | 171 | "Temperature Difference at Inlet" |
---|
| 172 | DT0 = max(Inlet.Hot.T) - max(Outlet.Cold.T); |
---|
| 173 | |
---|
| 174 | "Temperature Difference at Outlet" |
---|
| 175 | DTL = min(Outlet.Hot.T) - min(Inlet.Cold.T); |
---|
| 176 | |
---|
[1] | 177 | end |
---|
| 178 | |
---|
| 179 | end |
---|