STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
test_gas_viscosity_units.py
Go to the documentation of this file.
1
"""Huzel & Huang's combustion-gas viscosity fit, mu = 46.6e-10 M^0.5 T[R]^0.6, is in lbm/(in s).
2
3
It was converted with the lbf s/in^2 factor (6894.76) instead of 17.858, which made the gas
4
viscosity g_c = 386x too high and the Bartz convective coefficient ~117x too low -- the
5
long-standing "ablative convection ~283x low". Checked against NASA CEA transport properties,
6
not against the code.
7
"""
8
import
math
9
10
import
pytest
11
12
from
engine.pipeline.constants
import
LBM_PER_IN_S_TO_PA_S
13
14
15
def
test_the_conversion_is_mass_pounds
():
16
assert
LBM_PER_IN_S_TO_PA_S == pytest.approx(0.45359237 / 0.0254, rel=1e-12)
17
assert
LBM_PER_IN_S_TO_PA_S == pytest.approx(17.857967, rel=1e-6)
18
19
20
@pytest.mark.parametrize
(
"T, M, mu_cea"
, [
21
# LOX/ethanol, O/F 1.5, Pc 434 psia chamber: CEA frozen transport 1.04e-4 Pa s
22
(3226.0, 22.25, 1.04e-4),
23
])
24
def
test_huzel_viscosity_is_the_right_order_against_cea
(T, M, mu_cea):
25
from
engine.pipeline.thermal.regen_cooling
import
calculate_gas_viscosity_huzel
26
mu = calculate_gas_viscosity_huzel(T, M)
27
# Huzel's fit is an approximation; within a factor 1.6 of CEA. The wrong unit gave 264x.
28
assert
mu_cea / 1.6 < mu < mu_cea * 1.6
29
assert
mu == pytest.approx(46.6e-10 * math.sqrt(M) * (T * 1.8) ** 0.6 * 17.857967, rel=1e-6)
30
31
32
def
test_every_copy_of_the_fit_agrees
():
33
from
engine.pipeline.thermal.regen_cooling
import
calculate_gas_viscosity_huzel
34
from
engine.accel.chamber
import
_huzel_mu
as
_gas_viscosity_huzel
# the spray march film
35
T, M = 3226.0, 22.25
36
assert
_gas_viscosity_huzel(T, M) == pytest.approx(calculate_gas_viscosity_huzel(T, M), rel=1e-12)
37
src = open(
"engine/pipeline/thermal/ablative_cooling.py"
).
read
()
38
assert
"6894.76"
not
in
src,
"ablative_cooling.py converts the Huzel fit with the lbf factor again"
engine.accel.chamber
Definition
chamber.py:1
engine.pipeline.constants
Definition
constants.py:1
engine.pipeline.thermal.regen_cooling
Definition
regen_cooling.py:1
test_gas_viscosity_units.test_huzel_viscosity_is_the_right_order_against_cea
test_huzel_viscosity_is_the_right_order_against_cea(T, M, mu_cea)
Definition
test_gas_viscosity_units.py:24
test_gas_viscosity_units.test_the_conversion_is_mass_pounds
test_the_conversion_is_mass_pounds()
Definition
test_gas_viscosity_units.py:15
test_gas_viscosity_units.test_every_copy_of_the_fit_agrees
test_every_copy_of_the_fit_agrees()
Definition
test_gas_viscosity_units.py:32
read
static double read(int32_t code)
Definition
test_rtd_board.cpp:37
EngineDesign
tests
test_gas_viscosity_units.py
Generated by
1.15.0