STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
convection.py
Go to the documentation of this file.
1"""Still-gas conductance between an ullage and its wall, from the gas.
2
3A vessel's ``wall_conductance`` (hA, W/K) used to be a number somebody typed,
4or a per-litre default scaled by area. It is neither a material property nor
5a number a person on the stand knows. It is the gas: a helium ullage and a
6nitrogen ullage at the same pressure sit against the same wall with different
7conductivity, viscosity and density, and natural convection in an enclosed
8gas is what sets the film.
9
10So it is estimated here from the gas and the vessel, with the correlation
11adapted from ``ht`` rather than written down: Churchill–Chu for a vertical
12isothermal surface, which a tank wall is to within its curvature. The
13temperature difference driving the convection is not known ahead of a run,
14so it is an argument, stated, and the caller reports it as an assumption.
15
16Nothing here is applied unless a drawing leaves the field blank and the
17caller asks. The library's default stays what it was.
18"""
19
20from __future__ import annotations
21
22from dataclasses import dataclass
23
24from ht import Nu_vertical_plate_Churchill
25
26from feedtwin.props import Fluid
27
28G = 9.80665
29
30
31@dataclass(frozen=True, slots=True)
32class GasFilm:
33 """What the estimate was made from, so a report can print it."""
34
35 hA: float
36 """Conductance [W/K]."""
37 h: float
38 """Film coefficient [W/(m^2.K)]."""
39 area: float
40 """Inner surface used [m^2]."""
41 grashof: float
42 prandtl: float
43 nusselt: float
44 delta_T: float
45 """The gas-to-wall temperature difference assumed [K]."""
46
47
49 gas: Fluid,
50 pressure: float,
51 temperature: float,
52 height: float,
53 area: float,
54 delta_T: float = 10.0,
55) -> GasFilm:
56 """hA for a still gas against a vertical wall of this height and area.
57
58 Args:
59 gas: The ullage gas.
60 pressure: Gas pressure [Pa], absolute. Density goes as p, and the
61 Grashof number as density squared, so this matters.
62 temperature: Gas film temperature [K].
63 height: Height of the wall the gas convects along [m].
64 area: Inner surface in contact with the gas [m^2].
65 delta_T: Gas-to-wall difference the film is evaluated at [K]. Natural
66 convection stiffens with it as ``dT^(1/4)`` or so; ten kelvin is a
67 blowdown in progress, and is what the caller states.
68 """
69 if pressure <= 0.0 or temperature <= 0.0 or height <= 0.0 or area <= 0.0:
70 raise ValueError("pressure, temperature, height and area must be positive")
71 dT = max(delta_T, 1e-3)
72 rho = gas.get("rho", p=pressure, T=temperature)
73 mu = gas.get("mu", p=pressure, T=temperature)
74 k = gas.get("k", p=pressure, T=temperature)
75 cp = gas.get("cp", p=pressure, T=temperature)
76 nu = mu / rho
77 # Ideal-gas expansivity; the ullage gases are near enough ideal at these
78 # states for a film estimate, and CoolProp's own beta is not in the
79 # property registry.
80 beta = 1.0 / temperature
81 grashof = G * beta * dT * height**3 / (nu * nu)
82 prandtl = cp * mu / k
83 nusselt = float(Nu_vertical_plate_Churchill(prandtl, grashof))
84 h = nusselt * k / height
85 return GasFilm(
86 hA=h * area,
87 h=h,
88 area=area,
89 grashof=grashof,
90 prandtl=prandtl,
91 nusselt=nusselt,
92 delta_T=dT,
93 )
#define max(a, b)
Definition Arduino.h:43
GasFilm still_gas_conductance(Fluid gas, float pressure, float temperature, float height, float area, float delta_T=10.0)
Definition convection.py:55