STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
test_convection.py
Go to the documentation of this file.
1"""The still-gas film, checked against the correlation it adapts."""
2
3from __future__ import annotations
4
5import math
6
7import pytest
8from ht import Nu_vertical_plate_Churchill
9
10from feedtwin.props import Fluid
11from feedtwin.vessels.convection import still_gas_conductance
12
13PSI = 6894.757293168361
14
15
17 """The function is the correlation applied to CoolProp's numbers and the
18 vessel's area, nothing more. Redo it by hand."""
19 gas = Fluid("nitrogen")
20 p, T, L, A, dT = 500.0 * PSI, 293.15, 0.5, 0.6, 10.0
21 film = still_gas_conductance(gas, p, T, L, A, dT)
22
23 rho = gas.get("rho", p=p, T=T)
24 mu = gas.get("mu", p=p, T=T)
25 k = gas.get("k", p=p, T=T)
26 cp = gas.get("cp", p=p, T=T)
27 gr = 9.80665 * (1.0 / T) * dT * L**3 / (mu / rho) ** 2
28 pr = cp * mu / k
29 nu = Nu_vertical_plate_Churchill(pr, gr)
30 assert film.grashof == pytest.approx(gr)
31 assert film.prandtl == pytest.approx(pr)
32 assert film.nusselt == pytest.approx(nu)
33 assert film.hA == pytest.approx(nu * k / L * A)
34
35
37 """The shipped default for a 17.5 L tank was 12 W/K, scaled as V^(2/3).
38 A nitrogen ullage at 500 psi against a wall of that size should come out
39 the same order -- not a tenth, not ten times."""
40 gas = Fluid("nitrogen")
41 film = still_gas_conductance(gas, 500.0 * PSI, 293.15, 0.45, 0.45, 10.0)
42 assert 3.0 < film.hA < 60.0
43
44
46 """Grashof goes as density squared, so the same tank at a higher pressure
47 has a stiffer film. Which is the point of deriving it from the gas."""
48 gas = Fluid("nitrogen")
49 low = still_gas_conductance(gas, 100.0 * PSI, 293.15, 0.45, 0.45, 10.0)
50 high = still_gas_conductance(gas, 1000.0 * PSI, 293.15, 0.45, 0.45, 10.0)
51 assert high.hA > low.hA
52
53
55 """Same tank, same pressure, different gas: the number is the gas's."""
56 n2 = still_gas_conductance(Fluid("nitrogen"), 500.0 * PSI, 293.15, 0.45, 0.45)
57 he = still_gas_conductance(Fluid("helium"), 500.0 * PSI, 293.15, 0.45, 0.45)
58 assert not math.isclose(n2.hA, he.hA, rel_tol=0.05)
59
60
62 with pytest.raises(ValueError):
63 still_gas_conductance(Fluid("nitrogen"), 0.0, 293.15, 0.45, 0.45)
None test_refuses_nonsense()
None test_denser_gas_convects_harder()
None test_matches_a_hand_calculation_through_ht()
None test_helium_and_nitrogen_differ()
None test_lands_in_the_band_the_old_default_stood_in()