|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Functions | |
| float | cd_inf_from_orifice_diameter (Optional[float] d_hyd_m, DischargeConfig config) |
| float | discharge_cd_inf_ratio (float d_hyd_O, float d_hyd_F, DischargeConfig discharge_O, DischargeConfig discharge_F) |
| float | cd_from_re (float Re, DischargeConfig config, float P_inlet=None, float T_inlet=None, Optional[float] d_hyd_m=None) |
| float | calculate_reynolds_number (float rho, float u, float d_hyd, float mu) |
| float | cd_from_inlet_radius_ratio (float r_over_d) |
| float | cd_length_factor (float l_over_d, str model="lichtarowicz") |
| float | cd_with_approach (float cd, Optional[float] beta, float k_entrance=COUNTERBORE_ENTRANCE_K) |
| Optional[float] | cd_inf_from_inlet_geometry (config) |
| Optional[float] | cd_u_from_inlet_geometry (config) |
| float | cd_lichtarowicz_re (float cd_u, float Re, float l_over_d) |
| Optional[tuple] | lichtarowicz_re_inputs (config) |
| float | contraction_coefficient (float r_over_d) |
| Dict[str, float] | cavitation_margin (*, float P_in, float Pc, float Pv, float Cd, float r_over_d=0.0) |
| float | inlet_radius_ratio_of (config) |
Variables | |
| dict | INLET_GEOMETRY_CD |
| dict | INLET_GEOMETRY_RD |
| float | LICHTAROWICZ_A = 0.827 |
| float | LICHTAROWICZ_B = 0.0085 |
| tuple | LICHTAROWICZ_REF_LD = (LICHTAROWICZ_A - 0.80) / LICHTAROWICZ_B |
| float | LICHTAROWICZ_LD_MAX = 10.0 |
| float | COUNTERBORE_ENTRANCE_K = 0.5 |
| float | LICHTAROWICZ_RE_A = 20.0 |
| float | LICHTAROWICZ_RE_B = 2.25 |
| float | LICHTAROWICZ_RE_C = 0.0015 |
| float | LICHTAROWICZ_RE_D = 7.5 |
| float | LICHTAROWICZ_RE_E = 0.00015 |
| float | NURICK_CC0 = 0.62 |
| float | NURICK_RD_GAIN = 11.4 |
Injector discharge coefficient model Cd(Re, orifice geometry). A declared orifice inlet (``inlet_geometry`` / ``inlet_radius_ratio``) and L/d set Cd_inf: the short-tube table with the Lichtarowicz (1965) length fit, which is what a drilled doublet hole is (the shipped configs declare sharp, L/d 4). Without one, Cd_inf is the thin-plate sharp-orifice value (ASME / ISO 5167: Cd ≈ 0.60–0.61 at high Re), keyed to d_jet.
| float engine.core.discharge.calculate_reynolds_number | ( | float | rho, |
| float | u, | ||
| float | d_hyd, | ||
| float | mu ) |
Calculate Reynolds number. Re = (ρ × u × d_hyd) / μ
Definition at line 145 of file discharge.py.
| Dict[str, float] engine.core.discharge.cavitation_margin | ( | * | , |
| float | P_in, | ||
| float | Pc, | ||
| float | Pv, | ||
| float | Cd, | ||
| float | r_over_d = 0.0 ) |
K, K_crit = (Cd/Cc)^2 and their ratio for one orifice. Ratio < 1 means it cavitates.
Definition at line 412 of file discharge.py.
References contraction_coefficient().
| float engine.core.discharge.cd_from_inlet_radius_ratio | ( | float | r_over_d | ) |
Cd at Re > 1e4 and L/d ~ 2-5 as a continuous function of inlet rounding r/d. Saturating fit through the practitioner anchors for a SHORT TUBE: 0.80 sharp entry (r/d = 0), ~0.88 at r/d = 0.1-0.125, 0.95 at r/d >= 0.2. Rounding past r/d ~ 0.2 buys almost nothing, which is why bellmouth entries are specified at that ratio, not deeper. For the thin-plate limit multiply by cd_length_factor(L/d), which recovers 0.61 at L/d 0.
Definition at line 220 of file discharge.py.
References max.
Referenced by cd_u_from_inlet_geometry().
| float engine.core.discharge.cd_from_re | ( | float | Re, |
| DischargeConfig | config, | ||
| float | P_inlet = None, | ||
| float | T_inlet = None, | ||
| Optional[float] | d_hyd_m = None ) |
Calculate discharge coefficient as function of Reynolds number, optional orifice
diameter, pressure, and temperature.
``Re`` is on the bulk hole velocity mdot/(rho A) and the hole diameter.
Re law, when the block declares an inlet, an ``orifice_l_over_d`` and
``length_model: lichtarowicz`` (the default) -- Lichtarowicz, Duggins & Markland (1965):
1/Cd = 1/Cd_u + 20 (1 + 2.25 L/d)/Re - 0.0015 (L/d) / (1 + 7.5 [log10(0.00015 Re)]^2)
with Cd_u the orifice's own high-Re Cd as this module anchors it (inlet table x
cd_length_factor, cd_u_from_inlet_geometry), then the counterbore approach
(approach_beta) and the 0.98 cap exactly as cd_inf_from_inlet_geometry applies them.
Otherwise (``length_model: piecewise``, or no declared inlet / L/d): the LEGACY, unsourced
form Cd(Re) = Cd_inf,eff - a_Re / √Re. ``a_Re`` is a tuned coefficient with no reference
and is ignored whenever the Lichtarowicz law applies.
``Cd_inf,eff`` is ``cd_inf_from_orifice_diameter(d_hyd_m, config)`` when geometry
mode is enabled; otherwise ``config.Cd_inf``.
Corrections (unsourced; off by default):
- Pressure correction: Cd(P) = Cd(Re) × [1 + a_P × (P/P_ref - 1)]
- Temperature correction: Cd(T) = Cd(Re) × [1 + a_T × (T/T_ref - 1)]
Clamped to [Cd_min, Cd_inf,eff]
Definition at line 85 of file discharge.py.
References cd_inf_from_orifice_diameter(), cd_lichtarowicz_re(), cd_with_approach(), lichtarowicz_re_inputs(), max, and min.
| Optional[float] engine.core.discharge.cd_inf_from_inlet_geometry | ( | config | ) |
Asymptotic Cd from the orifice's INLET treatment and L/d, or None if not configured. Returns None when neither ``inlet_geometry`` nor ``inlet_radius_ratio`` is set, so the caller keeps its existing diameter-based behaviour and nothing changes for old configs. This is the orifice's own ultimate Cd (cd_u_from_inlet_geometry) seen through the counterbore approach, capped at 0.98.
Definition at line 305 of file discharge.py.
References cd_u_from_inlet_geometry(), cd_with_approach(), and min.
Referenced by cd_inf_from_orifice_diameter().
| float engine.core.discharge.cd_inf_from_orifice_diameter | ( | Optional[float] | d_hyd_m, |
| DischargeConfig | config ) |
Asymptotic Cd at high Re for a circular injector hole. A declared inlet (``inlet_geometry`` / ``inlet_radius_ratio``) wins: the short-tube value at the hole's L/d (cd_inf_from_inlet_geometry). Otherwise this is a THIN-PLATE model: - **d = d_ref** (default 2 mm): ``Cd_inf`` equals config baseline (default **0.60**), matching thin-plate sharp-edged orifice data (Cd ≈ 0.595–0.602, Re > 10⁴). - **d < d_ref**: ``(d/d_ref)^cd_small_hole_exponent``, default 0 (no change). ISO 5167 and Sutton & Biblarz Table 8-2 have small sharp holes flowing slightly MORE; the old 0.2 penalty had the wrong sign. - **d > d_ref**: small logarithmic rise toward ``cd_inf_max`` (≤ ~0.62). - Result clamped to ``[cd_inf_min_geom, cd_inf_max]``. A drilled hole of L/d 2-10 is not a thin plate (0.79 at L/d 4, Lichtarowicz 1965); this path under-predicts its flow by ~24%. When ``use_geometry_cd`` is False or diameter is missing, returns ``config.Cd_inf``.
Definition at line 18 of file discharge.py.
References cd_inf_from_inlet_geometry(), and max.
Referenced by cd_from_re(), and discharge_cd_inf_ratio().
| float engine.core.discharge.cd_length_factor | ( | float | l_over_d, |
| str | model = "lichtarowicz" ) |
Multiplier on Cd for orifice length. ``lichtarowicz`` (default): the published sharp-inlet fit Cd_u = 0.827 - 0.0085 L/d over 2 <= L/d <= 10, divided by its value at LICHTAROWICZ_REF_LD so the inlet table stays the anchor. Past 10 (outside the data) the same slope continues, floored at 0.85, and the extrapolation is recorded. Below 2 it blends linearly to the thin-plate anchor at L/d 0. ``piecewise`` (legacy, unsourced): 1.0 over L/d = 2-5, a steep rise from the thin-plate end below 2 and a 1.2 %/L/d decline above 5. Lichtarowicz et al. (1965): steep rise from L/d = 0, maximum near L/d ~ 2 where the expansion downstream of the vena contracta recovers dynamic pressure, then a slow decline from wall friction. Below L/d ~ 1 the orifice behaves as a thin plate and loses that recovery; above ~10 friction dominates.
Definition at line 249 of file discharge.py.
References max.
Referenced by cd_u_from_inlet_geometry().
| float engine.core.discharge.cd_lichtarowicz_re | ( | float | cd_u, |
| float | Re, | ||
| float | l_over_d ) |
Lichtarowicz et al. (1965) Cd at Reynolds number ``Re`` (bulk velocity mdot/(rho A), hole diameter) for an orifice whose ultimate (high-Re) Cd is ``cd_u`` and length is ``l_over_d``. Mirrored by ``engine.accel.kernels._cd_lichtarowicz_re``; keep the operation order identical.
Definition at line 356 of file discharge.py.
Referenced by cd_from_re().
| Optional[float] engine.core.discharge.cd_u_from_inlet_geometry | ( | config | ) |
The ORIFICE's high-Re Cd, inlet table x length factor, before any counterbore approach. This is Cd_u of Lichtarowicz et al. (1965) as anchored here (sharp 0.80 at LICHTAROWICZ_REF_LD). None when the config declares no inlet.
Definition at line 320 of file discharge.py.
References cd_from_inlet_radius_ratio(), and cd_length_factor().
Referenced by cd_inf_from_inlet_geometry(), and lichtarowicz_re_inputs().
| float engine.core.discharge.cd_with_approach | ( | float | cd, |
| Optional[float] | beta, | ||
| float | k_entrance = COUNTERBORE_ENTRANCE_K ) |
Cd of an orifice fed through a counterbore of diameter d / beta, referred to the
plenum-to-chamber drop.
Energy from the plenum: the counterbore entrance costs (1 + K) of the counterbore's
velocity head, and the orifice, with its static tap in the counterbore, discharges
Cd A sqrt(2 rho dp / (1 - beta^4)). Adding the two drops:
dp_total = rho v^2 / 2 * [ (1 - beta^4) / Cd^2 + beta^4 (1 + K) ]
Wall friction in the counterbore (f L/D ~ 0.05) is neglected: it adds under 0.2 % of the
already-small beta^4 term.
Definition at line 286 of file discharge.py.
Referenced by cd_from_re(), and cd_inf_from_inlet_geometry().
| float engine.core.discharge.contraction_coefficient | ( | float | r_over_d | ) |
Vena-contracta contraction coefficient for inlet rounding r/d (Nurick 1976).
Definition at line 405 of file discharge.py.
Referenced by cavitation_margin().
| float engine.core.discharge.discharge_cd_inf_ratio | ( | float | d_hyd_O, |
| float | d_hyd_F, | ||
| DischargeConfig | discharge_O, | ||
| DischargeConfig | discharge_F ) |
High-Re Cd_inf,O / Cd_inf,F from orifice diameters (≈1 when jets share the same hole style).
Definition at line 71 of file discharge.py.
References cd_inf_from_orifice_diameter().
| float engine.core.discharge.inlet_radius_ratio_of | ( | config | ) |
r/d a discharge block describes: inlet_radius_ratio, else the named inlet's, else 0 (sharp).
Definition at line 423 of file discharge.py.
| Optional[tuple] engine.core.discharge.lichtarowicz_re_inputs | ( | config | ) |
``(Cd_u, L/d, approach_beta)`` when cd_from_re uses the Lichtarowicz Re law, else None. It applies when the block declares an inlet (so Cd_u exists), an L/d, and ``length_model: lichtarowicz`` (the default). Otherwise cd_from_re keeps the legacy a_Re form.
Definition at line 370 of file discharge.py.
References cd_u_from_inlet_geometry().
Referenced by cd_from_re().
| float engine.core.discharge.COUNTERBORE_ENTRANCE_K = 0.5 |
Definition at line 246 of file discharge.py.
| dict engine.core.discharge.INLET_GEOMETRY_CD |
Definition at line 204 of file discharge.py.
| dict engine.core.discharge.INLET_GEOMETRY_RD |
Definition at line 214 of file discharge.py.
| float engine.core.discharge.LICHTAROWICZ_A = 0.827 |
Definition at line 237 of file discharge.py.
| float engine.core.discharge.LICHTAROWICZ_B = 0.0085 |
Definition at line 238 of file discharge.py.
| float engine.core.discharge.LICHTAROWICZ_LD_MAX = 10.0 |
Definition at line 243 of file discharge.py.
| float engine.core.discharge.LICHTAROWICZ_RE_A = 20.0 |
Definition at line 349 of file discharge.py.
| float engine.core.discharge.LICHTAROWICZ_RE_B = 2.25 |
Definition at line 350 of file discharge.py.
| float engine.core.discharge.LICHTAROWICZ_RE_C = 0.0015 |
Definition at line 351 of file discharge.py.
| float engine.core.discharge.LICHTAROWICZ_RE_D = 7.5 |
Definition at line 352 of file discharge.py.
| float engine.core.discharge.LICHTAROWICZ_RE_E = 0.00015 |
Definition at line 353 of file discharge.py.
| tuple engine.core.discharge.LICHTAROWICZ_REF_LD = (LICHTAROWICZ_A - 0.80) / LICHTAROWICZ_B |
Definition at line 241 of file discharge.py.
| float engine.core.discharge.NURICK_CC0 = 0.62 |
Definition at line 401 of file discharge.py.
| float engine.core.discharge.NURICK_RD_GAIN = 11.4 |
Definition at line 402 of file discharge.py.