Changeset 131 for branches/newlanguage/eml
- Timestamp:
- Jan 24, 2007, 11:39:47 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/newlanguage/eml/heat_exchangers/Mheatex.mso
r100 r131 18 18 * 19 19 * Streams: 20 * * Inlet(Ninlet) streams .... at least one material stream 21 * * Outlet stream .... one material stream 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 22 24 * 23 25 * Purpose: 24 * * Determines thermal and phase conditions of outlet stream26 * * Heat Transfer between multiple hot and cold streams. 25 27 * 26 28 *---------------------------------------------------------------------- … … 58 60 VARIABLES 59 61 60 Hot (Nhot) as stream_therm;# Outlet Hot Streams61 Cold (Ncold) as stream_therm;# Outlet Cold Streams62 Hot (Nhot) as liquid_stream;# Outlet Hot Streams 63 Cold (Ncold) as liquid_stream;# Outlet Cold Streams 62 64 63 65 end … … 69 71 PARAMETERS 70 72 71 ext PP as CalcObject(Brief="Physical Properties");72 extNComp as Integer (Brief="Number of Components");73 HE as CalcObject(Brief="Cold Box Calculations",File="heatex");73 outer PP as Plugin (Brief="Physical Properties"); 74 outer NComp as Integer (Brief="Number of Components"); 75 # HE as Plugin (Brief="Cold Box Calculations",File="heatex"); 74 76 Side as Integer (Brief="Flow Direction",Lower=0,Upper=1); 75 77 Ncold as Integer (Brief="Number of Inlet Cold Streams",Lower=1); … … 84 86 LMTD as temp_delta (Brief="Logarithmic Mean Temperature Difference"); 85 87 UA as positive (Unit="W/K"); 86 88 DT0 as temp_delta (Brief="Temperature Difference at Inlet",Lower=1); 89 DTL as temp_delta (Brief="Temperature Difference at Outlet",Lower=1); 90 87 91 SET 88 92 89 93 # Flow Direction 90 Side = HE.FlowDir();94 # Side = HE.FlowDir(); 91 95 92 96 # Inlet Ncold Parameters … … 116 120 Outlet.Cold.z = Inlet.Cold.z; 117 121 122 123 124 for i in [1:Nhot] 125 118 126 "Vapourisation Fraction Hot Stream" 119 Outlet.Hot.v = Inlet.Hot.v; 127 Outlet.Hot(i).v = PP.VapourFraction(Outlet.Hot(i).T,Outlet.Hot(i).P,Outlet.Hot(i).z); 128 129 end 130 131 132 for j in [1:Ncold] 120 133 121 134 "Vapourisation Fraction Cold Stream" 122 Outlet.Cold .v = Inlet.Cold.v;135 Outlet.Cold(j).v = PP.VapourFraction(Outlet.Cold(j).T,Outlet.Cold(j).P,Outlet.Cold(j).z); 123 136 137 end 138 139 124 140 "Heat Duty Hot Stream" 125 141 Q = sum(Inlet.Hot.F*(Inlet.Hot.h- Outlet.Hot.h)); … … 131 147 Q=UA*LMTD; 132 148 133 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# 134 # Flow Direction 135 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# 149 150 if abs(DT0 - DTL) > 0.05*max(abs([DT0,DTL])) 151 152 then 153 "Log Mean Temperature Difference" 154 LMTD= (DT0-DTL)/ln(DT0/DTL); 155 156 else 157 158 if DT0*DTL equal 0 159 160 then 161 "Log Mean Temperature Difference" 162 LMTD = 0.5*(DT0+DTL); 163 164 else 165 "Log Mean Temperature Difference" 166 LMTD = 0.5*(DT0+DTL)*(1-(DT0-DTL)^2/(DT0*DTL)*(1+(DT0-DTL)^2/(DT0*DTL)/2)/12); 167 168 end 169 170 end 171 136 172 137 173 if Side equal 0 138 174 139 175 then 140 "Cocurrent Flow LMTD" 141 LMTD = HE.CocurrentLMTD(max(Inlet.Hot.T),min(Outlet.Hot.T),min(Inlet.Cold.T),max(Outlet.Cold.T)); 176 177 "Temperature Difference at Inlet" 178 DT0 = max(Inlet.Hot.T) - min(Inlet.Cold.T); 179 180 "Temperature Difference at Outlet" 181 DTL = min(Outlet.Hot.T) - max(Outlet.Cold.T); 142 182 143 183 else 144 "Counter Flow LMTD" 145 LMTD = HE.CounterLMTD(max(Inlet.Hot.T),min(Outlet.Hot.T),max(Inlet.Cold.T),min(Outlet.Cold.T)); 184 185 "Temperature Difference at Inlet" 186 DT0 = max(Inlet.Hot.T) - max(Outlet.Cold.T); 187 188 "Temperature Difference at Outlet" 189 DTL = min(Outlet.Hot.T) - min(Inlet.Cold.T); 146 190 147 191 end
Note: See TracChangeset
for help on using the changeset viewer.