[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: |
---|
[131] | 20 | * * Hot Inlet streams .... at least one Hot material stream |
---|
| 21 | * * Cold Inlet streams .... at least one Cold material stream |
---|
| 22 | * * Hot Outlet streams .... one material stream for each Hot Inlet |
---|
| 23 | * * Cold Outlet streams .... one material stream for each Cold Inlet |
---|
[1] | 24 | * |
---|
[26] | 25 | * Purpose: |
---|
[131] | 26 | * * Heat Transfer between multiple hot and cold streams. |
---|
[1] | 27 | * |
---|
| 28 | *---------------------------------------------------------------------- |
---|
| 29 | * Author: Gerson Balbueno Bicca |
---|
| 30 | * $Id: Mheatex.mso 147 2007-01-31 19:02:46Z bicca $ |
---|
| 31 | *--------------------------------------------------------------------*# |
---|
[45] | 32 | |
---|
[1] | 33 | using "streams.mso"; |
---|
| 34 | |
---|
[45] | 35 | Model Inlet_Main_Stream |
---|
[135] | 36 | |
---|
| 37 | ATTRIBUTES |
---|
| 38 | Pallete = false; |
---|
| 39 | Brief = "Inlet material streams for Hot and Cold side"; |
---|
| 40 | Info = |
---|
| 41 | "write some information"; |
---|
| 42 | |
---|
[1] | 43 | PARAMETERS |
---|
[45] | 44 | |
---|
[140] | 45 | outer Ncold as Integer (Brief="Number of Inlet Cold Streams",Lower=1); |
---|
| 46 | outer Nhot as Integer (Brief="Number of Inlet Hot Streams",Lower=1); |
---|
| 47 | |
---|
[1] | 48 | VARIABLES |
---|
| 49 | |
---|
[135] | 50 | Hot (Nhot) as stream (Brief="Inlet Hot Streams"); |
---|
| 51 | Cold (Ncold) as stream (Brief="Inlet Cold Streams"); |
---|
[1] | 52 | |
---|
| 53 | end |
---|
| 54 | |
---|
[45] | 55 | Model Outlet_Main_Stream |
---|
[135] | 56 | |
---|
| 57 | ATTRIBUTES |
---|
| 58 | Pallete = false; |
---|
| 59 | Brief = "Outlet material streams for Hot and Cold side"; |
---|
| 60 | Info = |
---|
| 61 | "write some information"; |
---|
| 62 | |
---|
[45] | 63 | PARAMETERS |
---|
| 64 | |
---|
[140] | 65 | outer Ncold as Integer (Brief="Number of Outlet Cold Streams",Lower=1); |
---|
| 66 | outer Nhot as Integer (Brief="Number of Outlet Hot Streams",Lower=1); |
---|
| 67 | |
---|
[1] | 68 | VARIABLES |
---|
[147] | 69 | |
---|
| 70 | Hot (Nhot) as streamPH (Brief="Outlet Hot Streams"); |
---|
| 71 | Cold (Ncold) as streamPH (Brief="Outlet Cold Streams"); |
---|
[1] | 72 | |
---|
| 73 | end |
---|
| 74 | |
---|
| 75 | Model Mheatex |
---|
[135] | 76 | |
---|
| 77 | ATTRIBUTES |
---|
[139] | 78 | Pallete = true; |
---|
[135] | 79 | Brief = "Multistream heat exchangers"; |
---|
| 80 | Info = |
---|
| 81 | "Heat Transfer between multiple hot and cold streams"; |
---|
| 82 | |
---|
[1] | 83 | PARAMETERS |
---|
| 84 | |
---|
[144] | 85 | outer PP as Plugin (Brief="Physical Properties"); |
---|
| 86 | outer NComp as Integer (Brief="Number of Components"); |
---|
| 87 | FlowDirection as Switcher(Brief="Flow Direction",Valid=["counter","cocurrent"],Default="cocurrent"); |
---|
| 88 | Ncold as Integer (Brief="Number of Inlet Cold Streams",Lower=1); |
---|
| 89 | Nhot as Integer (Brief="Number of Inlet Hot Streams",Lower=1); |
---|
[45] | 90 | |
---|
[1] | 91 | VARIABLES |
---|
| 92 | |
---|
[135] | 93 | in Inlet as Inlet_Main_Stream (Brief="Inlet Streams"); |
---|
| 94 | out Outlet as Outlet_Main_Stream (Brief="Outlet Streams"); |
---|
[1] | 95 | |
---|
[135] | 96 | Q as power (Brief="Heat Transfer"); |
---|
| 97 | LMTD as temp_delta (Brief="Logarithmic Mean Temperature Difference"); |
---|
| 98 | UA as positive (Brief="UA product",Unit="W/K"); |
---|
| 99 | DT0 as temp_delta (Brief="Temperature Difference at Inlet",Lower=1); |
---|
[131] | 100 | DTL as temp_delta (Brief="Temperature Difference at Outlet",Lower=1); |
---|
| 101 | |
---|
[1] | 102 | EQUATIONS |
---|
| 103 | |
---|
| 104 | "Hot Flow" |
---|
| 105 | Outlet.Hot.F = Inlet.Hot.F; |
---|
| 106 | |
---|
| 107 | "Cold Flow" |
---|
| 108 | Outlet.Cold.F = Inlet.Cold.F; |
---|
| 109 | |
---|
| 110 | "Hot Composition" |
---|
| 111 | Outlet.Hot.z = Inlet.Hot.z; |
---|
| 112 | |
---|
| 113 | "Cold Composition" |
---|
| 114 | Outlet.Cold.z = Inlet.Cold.z; |
---|
| 115 | |
---|
| 116 | "Heat Duty Hot Stream" |
---|
| 117 | Q = sum(Inlet.Hot.F*(Inlet.Hot.h- Outlet.Hot.h)); |
---|
| 118 | |
---|
| 119 | "Heat Duty Cold Stream" |
---|
| 120 | Q = -sum(Inlet.Cold.F*(Inlet.Cold.h- Outlet.Cold.h)); |
---|
| 121 | |
---|
| 122 | "Heat Duty" |
---|
| 123 | Q=UA*LMTD; |
---|
| 124 | |
---|
[131] | 125 | |
---|
| 126 | if abs(DT0 - DTL) > 0.05*max(abs([DT0,DTL])) |
---|
| 127 | |
---|
| 128 | then |
---|
| 129 | "Log Mean Temperature Difference" |
---|
| 130 | LMTD= (DT0-DTL)/ln(DT0/DTL); |
---|
[26] | 131 | |
---|
[131] | 132 | else |
---|
| 133 | |
---|
| 134 | if DT0*DTL equal 0 |
---|
| 135 | |
---|
| 136 | then |
---|
| 137 | "Log Mean Temperature Difference" |
---|
| 138 | LMTD = 0.5*(DT0+DTL); |
---|
| 139 | |
---|
| 140 | else |
---|
| 141 | "Log Mean Temperature Difference" |
---|
| 142 | LMTD = 0.5*(DT0+DTL)*(1-(DT0-DTL)^2/(DT0*DTL)*(1+(DT0-DTL)^2/(DT0*DTL)/2)/12); |
---|
| 143 | |
---|
| 144 | end |
---|
| 145 | |
---|
| 146 | end |
---|
| 147 | |
---|
| 148 | |
---|
[144] | 149 | switch FlowDirection |
---|
[1] | 150 | |
---|
[140] | 151 | case "cocurrent": |
---|
| 152 | |
---|
[131] | 153 | "Temperature Difference at Inlet" |
---|
| 154 | DT0 = max(Inlet.Hot.T) - min(Inlet.Cold.T); |
---|
| 155 | |
---|
| 156 | "Temperature Difference at Outlet" |
---|
| 157 | DTL = min(Outlet.Hot.T) - max(Outlet.Cold.T); |
---|
| 158 | |
---|
[140] | 159 | case "counter": |
---|
[1] | 160 | |
---|
[131] | 161 | "Temperature Difference at Inlet" |
---|
| 162 | DT0 = max(Inlet.Hot.T) - max(Outlet.Cold.T); |
---|
| 163 | |
---|
| 164 | "Temperature Difference at Outlet" |
---|
| 165 | DTL = min(Outlet.Hot.T) - min(Inlet.Cold.T); |
---|
| 166 | |
---|
[1] | 167 | end |
---|
| 168 | |
---|
| 169 | end |
---|