220 wall_temperature: float,
221 inlet_temperature: float,
225 heat_capacity: float,
227 """Heat the wall gives the stream, and the temperature it leaves at.
229 Treated as a single-stream heat exchanger against a wall at one
230 temperature: the film coefficient comes from Dittus-Boelter, and the
231 outlet follows from the number of transfer units rather than from
232 applying a heat rate to an inlet state. Using ``Q = h.A.dT`` directly
233 would let a long line at low flow hand the gas more than the wall-to-gas
234 difference, which is not a small error -- it is thermodynamically
237 **No flow, no exchange.** A still line does not trade heat with its
238 metal here; see the module docstring for why soak is out of scope.
240 if abs(mdot) < 1e-9
or self.area <= 0.0
or heat_capacity <= 0.0:
241 return WallExchange(outlet_temperature=inlet_temperature)
242 if density <= 0.0
or viscosity <= 0.0
or conductivity <= 0.0:
243 return WallExchange(outlet_temperature=inlet_temperature)
245 area_flow = math.pi * self.bore * self.bore / 4.0
246 velocity = abs(mdot) / (density * area_flow)
247 reynolds = density * velocity * self.bore / viscosity
248 prandtl = heat_capacity * viscosity / conductivity
249 if reynolds < LAMINAR_LIMIT:
257 exponent = 0.4
if wall_temperature > inlet_temperature
else 0.3
258 nusselt = 0.023 * reynolds**0.8 * prandtl**exponent
259 film = nusselt * conductivity / self.bore
261 ntu = film * self.area / (abs(mdot) * heat_capacity)
262 effectiveness = 1.0 - math.exp(-
min(ntu, 40.0))
263 rise = effectiveness * (wall_temperature - inlet_temperature)
265 heat=abs(mdot) * heat_capacity * rise,
266 outlet_temperature=inlet_temperature + rise,
267 effectiveness=effectiveness,