|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Functions | |
| _sat_T (P, Tb, Lb, MW, Tcrit) | |
| _spline_block (xs, ys) | |
| _tab_range (lo, hi, flag, h_target, fn, nf, tol_rel, tol_abs, depth) | |
| _piecewise (segments, fn, nf, tol_rel, tol_abs) | |
| _roots (f, a, b, n=800) | |
| heatup_tables (name, T0, Tb, Lb, MW, Tcrit) | |
| _pw_find (segs, ok, x) | |
| _pw_val (coef, k, j, dx) | |
| _pw_flag (segs, x) | |
| _saturation_state (P, Tb, Lb, MW, Tcrit) | |
| _huzel_mu (T, M) | |
| _area_ratio (M, gamma) | |
| _mach (ar, gamma, sup) | |
| _kappa (CR, gamma) | |
| _axis (lo, hi, n, x, log) | |
| _aux2 (Q, tab, k, MR, Pc) | |
| _aux3 (Q, tab, k, MR, Pc, eps) | |
| _wide_row (lnPc, cs, Pc, row) | |
| _interp (x, xp, fp) | |
| _cs_of_r (r, lnMR, row, MR_lo, MR_hi, r_lo, r_hi, c_lo, c_hi) | |
| _cs_of_MR (MR, lnMR, row, MR_lo, MR_hi, r_lo, r_hi, c_lo, c_hi) | |
| _rupe_Em_at_M (M, Em_opt, M_opt, curv) | |
| _heatup (Q, b, HTs, HTc, HTo, TLs, TLc, TLo, Pc, T0, Ts, Tc) | |
| _eta_vap (Q, CH, Pc, Tc, gamma, R, MR, mdot, D32_O, D32_F, u_O, u_F, u_ax, L_imp, L_b, lnMR, row, MR_lo, MR_hi, r_lo, r_hi, c_lo, c_hi, out) | |
| _eta_mix (Q, CH, MR, rupe_M, holes_O, holes_F, lnMR, row, MR_lo, MR_hi, r_lo, r_hi, c_lo, c_hi, out) | |
| _lk_eps0 (c, t, paL) | |
| _lk_species (h2o, T, P_bar, pa_bar, L_cm) | |
| _lk_overlap (pH, pC, L_cm) | |
| _ablative_Q (Q, CH, T0, P0, gamma, G, mu, cp, Pr, xH, xC, gas_mdot) | |
| _point (Pc, P, CH, C, P_O, P_F, eps_cea, out) | |
| _brentq (P, CH, C, P_O, P_F, a, b, xtol, rtol, maxit, out) | |
| evaluate_core (P, CH, C, P_O, P_F, Pa) | |
| _contour (cg) | |
| _aux_arrays (cache) | |
| _wide_arrays (cache) | |
| chamber_inputs (config, cache) | |
| warmup () | |
Variables | |
| float | G0 = 9.80665 |
| RR_W = np.ascontiguousarray(_RR_WEIGHTS, np.float64) | |
| GL_X = np.ascontiguousarray(_HEATUP_GL_X, np.float64) | |
| GL_W = np.ascontiguousarray(_HEATUP_GL_W, np.float64) | |
| LK_H2O = np.ascontiguousarray(_LECKNER_H2O, np.float64) | |
| LK_CO2 = np.ascontiguousarray(_LECKNER_CO2, np.float64) | |
| N_HEAT = GL_X.size | |
| list | _QNAMES |
| dict | _Q = {n: i for i, n in enumerate(_QNAMES)} |
| NQ = len(_QNAMES) | |
| dict | _S_STRIDE = _Q["SF_OK"] - _Q["SO_OK"] |
| list | _RNAMES |
| dict | _R = {n: i for i, n in enumerate(_RNAMES)} |
| NR = len(_RNAMES) | |
| _P_LO | |
| _P_HI | |
| float | _DX_KNOT = 0.004 |
| _TOL_CP | |
| _TOL_RHO | |
| _TOL_T | |
| dict | _HEAT_MEMO = {} |
| _REFINE | |
| _MAX_DEPTH | |
| tuple | _NO_HT |
| str | _CONTOUR_MEMO = OrderedDict() |
Numba mirror of the Python chamber solve, for the Layer 1 inner loop.
Each function here is a transcription of the Python function named in its docstring, in the same
order of operations, so the two paths compute the same physics and differ only by rounding and
by the one tabulation below. tests/test_numba_ab_parity.py diffs them live at 1e-6.
residual(Pc) = mdot_injector(Pc) - (Pc/kappa) At / (eta_c* c*_ideal) chamber_solver.residual
eta_c* = eta_vap eta_mix eta_HL combustion_eff.eta_cstar
The one thing numba cannot call is CoolProp, which the droplet heat-up reads at the chamber
pressure (combustion_physics.liquid_heatup_properties). It is tabulated here once per fluid as
functions of ln P -- cp at the 24 Gauss-Legendre nodes the Python integral uses, cp at the upper
limit, the density at the mean drop temperature, and CoolProp's saturation temperature -- as
cubic splines between the pressures where the integrand changes form (the critical pressure, where
the Clausius-Clapeyron surface temperature meets CoolProp's saturation line, where it reaches the
critical temperature, where the heat-up vanishes). Every interval is checked against CoolProp at
its midpoint when the table is built; an interval that misses is refused, and a pressure there
makes the kernel return no solution so the caller runs the Python solve.
|
protected |
liner_response's heat_removed [W]: the lined stations' flux at the ablation temperature, through the pyrolysis-blowing fixed point.
Definition at line 796 of file chamber.py.
References _lk_overlap(), _lk_species(), _mach(), max, and min.
Referenced by _point().
|
protected |
Definition at line 351 of file chamber.py.
Referenced by _mach().
|
protected |
CEAAuxTables._bilinear.
Definition at line 417 of file chamber.py.
References _axis().
Referenced by _point().
|
protected |
CEAAuxTables._exit.
Definition at line 426 of file chamber.py.
References _axis().
Referenced by evaluate_core().
|
protected |
Definition at line 1150 of file chamber.py.
Referenced by chamber_inputs().
|
protected |
|
protected |
scipy.optimize.brentq (the C original), on _point.
Definition at line 1002 of file chamber.py.
Referenced by evaluate_core().
|
protected |
Definition at line 1138 of file chamber.py.
Referenced by chamber_inputs().
|
protected |
CstarOfMR.__call__.
Definition at line 489 of file chamber.py.
References _cs_of_r().
Referenced by _eta_mix(), and _eta_vap().
|
protected |
CstarOfMR.of_fraction for one oxidizer mass fraction -> (c*, outside the table).
Definition at line 477 of file chamber.py.
References _interp().
Referenced by _cs_of_MR(), and _eta_mix().
|
protected |
Definition at line 687 of file chamber.py.
References _cs_of_MR(), _cs_of_r(), and _rupe_Em_at_M().
Referenced by _point().
|
protected |
calculate_vaporization_efficiency -> eta_vap (NaN where the Python raises).
Definition at line 547 of file chamber.py.
References _cs_of_MR(), _heatup(), _huzel_mu(), _saturation_state(), and max.
Referenced by _point().
|
protected |
liquid_heatup_properties from the tables -> (status, I, rho_l). status 1: CoolProp values; 0: Python returns None here (configured props); -1: the tables cannot answer (a refused interval / outside them) -- no solution.
Definition at line 511 of file chamber.py.
References _pw_find(), _pw_flag(), and _pw_val().
Referenced by _eta_vap().
|
protected |
regen_cooling.calculate_gas_viscosity_huzel.
Definition at line 345 of file chamber.py.
Referenced by _eta_vap().
|
protected |
np.interp for one point.
Definition at line 464 of file chamber.py.
Referenced by _cs_of_r(), and _point().
|
protected |
nozzle.nozzle_stagnation_loss (CR <= 1: bore not declared).
Definition at line 393 of file chamber.py.
References _mach().
Referenced by _point(), and evaluate_core().
|
protected |
|
protected |
|
protected |
Definition at line 763 of file chamber.py.
References _lk_eps0(), max, and min.
Referenced by _ablative_Q().
|
protected |
gas_side.mach_from_area_ratio for one station: the root of A/A*(M) = ar on the requested branch. The Python bisects 64 times; this is Newton kept inside the same shrinking bracket, which lands on the same root to the last bit or two in ~6 steps instead of 64.
Definition at line 357 of file chamber.py.
References _area_ratio().
Referenced by _ablative_Q(), and _kappa().
|
protected |
Tabulate fn(x, flag) -> (nf,) on each (lo, hi, flag) segment. Returns (segs, coef, ok).
Definition at line 161 of file chamber.py.
References _tab_range().
Referenced by heatup_tables().
|
protected |
supply - demand at Pc (NaN where the Python residual is NaN or raises); fills ``out``.
Definition at line 877 of file chamber.py.
References _ablative_Q(), _aux2(), _eta_mix(), _eta_vap(), _interp(), _kappa(), _wide_row(), and max.
Referenced by _brentq(), and evaluate_core().
|
protected |
(interval index, dx) of x in a piecewise table, or (-1, 0) outside or on a refused one.
Definition at line 293 of file chamber.py.
Referenced by _heatup().
|
protected |
Definition at line 316 of file chamber.py.
Referenced by _heatup().
|
protected |
Definition at line 311 of file chamber.py.
Referenced by _heatup().
|
protected |
Sign changes of f on [a, b], each refined by Brent.
Definition at line 181 of file chamber.py.
Referenced by heatup_tables().
|
protected |
combustion_physics.rupe_Em_at_M (NaN where the Python raises).
Definition at line 496 of file chamber.py.
References max.
Referenced by _eta_mix().
|
protected |
combustion_physics.saturation_state's surface temperature (Tcrit 0 => none).
Definition at line 91 of file chamber.py.
Referenced by heatup_tables().
|
protected |
combustion_physics.saturation_state -> (ok, T_sat, h_fg).
Definition at line 327 of file chamber.py.
Referenced by _eta_vap().
|
protected |
Per-interval cubic coefficients (highest power first) of not-a-knot splines through ys.
Definition at line 97 of file chamber.py.
Referenced by _tab_range().
|
protected |
Pieces (lo, hi, h, n, coef, ok, flag) covering [lo, hi]: one not-a-knot spline per run of knots, each interval checked against fn at its midpoint; a run of intervals that misses is tabulated again finer, and still refused after _MAX_DEPTH refinements.
Definition at line 109 of file chamber.py.
References _spline_block(), _tab_range(), and max.
Referenced by _piecewise(), and _tab_range().
|
protected |
Definition at line 1168 of file chamber.py.
Referenced by chamber_inputs().
|
protected |
| engine.accel.chamber.chamber_inputs | ( | config, | |
| cache ) |
The chamber tuple for evaluate_core, or None when a piece of the Python chamber solve is not mirrored here (the caller then runs Python).
Definition at line 1188 of file chamber.py.
References _aux_arrays(), _contour(), _wide_arrays(), g, heatup_tables(), and max.
| engine.accel.chamber.evaluate_core | ( | P, | |
| CH, | |||
| C, | |||
| P_O, | |||
| P_F, | |||
| Pa ) |
Pc root, converged state and delivered thrust -> (ok, result vector). The window and the top-down bracket scan are chamber_solver.solve's (PC_CHOKE_FLOOR_PA, PC_MIN_TOTAL_DROP_FRAC, _highest_sign_change); the thrust is nozzle.calculate_thrust.
Definition at line 1055 of file chamber.py.
References _aux3(), _brentq(), _kappa(), _point(), max, and min.
Referenced by warmup().
| engine.accel.chamber.heatup_tables | ( | name, | |
| T0, | |||
| Tb, | |||
| Lb, | |||
| MW, | |||
| Tcrit ) |
(HT segs, HT coef, HT ok, TL segs, TL coef) for a fluid CoolProp knows, else None. HT columns, as functions of x = ln P: cp at T_n = T0 + (T_hi - T0)(x_n + 1)/2 for each Gauss-Legendre node x_n, cp at T_hi, and rho at (T0 + T_hi)/2, with T_hi = min(T_s, T_lim); segment flag 1 = above the critical pressure (T_lim infinite). TL: T_lim(x) below it.
Definition at line 202 of file chamber.py.
References _piecewise(), _roots(), _sat_T(), and min.
Referenced by chamber_inputs().
| engine.accel.chamber.warmup | ( | ) |
Load (or compile) evaluate_core for the argument types every config produces, so a worker pool does not pay it inside its first generation. Never raises.
Definition at line 1298 of file chamber.py.
References evaluate_core().
|
protected |
Definition at line 1135 of file chamber.py.
|
protected |
Definition at line 83 of file chamber.py.
|
protected |
Definition at line 88 of file chamber.py.
|
protected |
Definition at line 106 of file chamber.py.
|
protected |
Definition at line 288 of file chamber.py.
|
protected |
Definition at line 82 of file chamber.py.
|
protected |
Definition at line 82 of file chamber.py.
Definition at line 62 of file chamber.py.
|
protected |
Definition at line 52 of file chamber.py.
Definition at line 74 of file chamber.py.
|
protected |
Definition at line 106 of file chamber.py.
|
protected |
Definition at line 68 of file chamber.py.
Definition at line 65 of file chamber.py.
|
protected |
Definition at line 87 of file chamber.py.
|
protected |
Definition at line 87 of file chamber.py.
|
protected |
Definition at line 87 of file chamber.py.
| float engine.accel.chamber.G0 = 9.80665 |
Definition at line 43 of file chamber.py.
| engine.accel.chamber.GL_W = np.ascontiguousarray(_HEATUP_GL_W, np.float64) |
Definition at line 46 of file chamber.py.
| engine.accel.chamber.GL_X = np.ascontiguousarray(_HEATUP_GL_X, np.float64) |
Definition at line 45 of file chamber.py.
| engine.accel.chamber.LK_CO2 = np.ascontiguousarray(_LECKNER_CO2, np.float64) |
Definition at line 48 of file chamber.py.
| engine.accel.chamber.LK_H2O = np.ascontiguousarray(_LECKNER_H2O, np.float64) |
Definition at line 47 of file chamber.py.
| engine.accel.chamber.N_HEAT = GL_X.size |
Definition at line 49 of file chamber.py.
| engine.accel.chamber.NQ = len(_QNAMES) |
Definition at line 64 of file chamber.py.
| engine.accel.chamber.NR = len(_RNAMES) |
Definition at line 76 of file chamber.py.
| engine.accel.chamber.RR_W = np.ascontiguousarray(_RR_WEIGHTS, np.float64) |
Definition at line 44 of file chamber.py.