|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Classes | |
| class | CEACache |
| class | CEAAuxTables |
Functions | |
| bool | _cea_build_allowed () |
| float | _isentropic_cf_vac (float gamma, float eps) |
| float | _scalar_clamp (float x, float lo, float hi) |
| _get_CEA_Obj () | |
| safe_print (*args, **kwargs) | |
| Tuple[float, float, float, float, float, float] | parse_cea_basic (str out) |
| List[Tuple[int, int, int, float, float, float, float, float, float]] | _compute_cea_point_chunk (List[Tuple[int, int, int, float, float, float]] chunk, str ox_name, str fuel_name, Optional[float] expansion_ratio=None, Optional[Any] lock=None) |
| Dict[str, np.ndarray] | _load_npz_tables (str path) |
| Tuple[int, float, bool] | _aux_axis (np.ndarray grid, float x, bool log) |
| np.ndarray | _fill_nan_nearest (np.ndarray a) |
| CEAAuxTables | get_aux_tables (str ox_name, str fuel_name) |
Variables | |
| int | CEA_TABLE_SCHEMA_VERSION = 2 |
| _CEA_Obj = None | |
| logger = logging.getLogger("evaluate") | |
| _original_print = print | |
| print = safe_print | |
| encoding | |
| errors | |
| stdout | |
| buffer | |
| dict | _NPZ_TABLE_MEMO = {} |
| int | CEA_AUX_SCHEMA_VERSION = 1 |
| tuple | AUX_SPECIES = ("H2O", "CO2", "CO", "H2", "OH", "O2", "O", "H") |
| _AUX_MR = np.round(np.linspace(0.8, 4.0, 65), 6) | |
| _AUX_PC = np.geomspace(1.0e5, 1.2e7, 16) | |
| _AUX_EPS = np.geomspace(1.1, 60.0, 48) | |
| float | _PSI = 6894.757293168361 |
| float | _BTU_LBM_R = 4186.8 |
| float | _MILLIPOISE = 1.0e-4 |
| float | _MCAL_CM_S_K = 0.4184 |
| dict | _AUX_MEMO = {} |
RocketCEA wrapper with MR/Pc caching and bilinear interpolation
|
protected |
Cell index, weight and clamp flag on a uniform (or log-uniform) grid.
Definition at line 1130 of file cea_cache.py.
Referenced by engine.pipeline.cea_cache.CEAAuxTables._bilinear(), and engine.pipeline.cea_cache.CEAAuxTables._exit().
|
protected |
Definition at line 31 of file cea_cache.py.
Referenced by engine.pipeline.cea_cache.CEACache._build_cache().
|
protected |
Worker function for parallel CEA cache building.
Computes CEA properties for a chunk of grid points.
This function must be at module level for multiprocessing.
Parameters:
-----------
chunk : List[Tuple[int, int, int, float, float, float]]
List of (i, j, k_idx, Pc_psia, MR, eps) tuples
ox_name : str
Oxidizer name
fuel_name : str
Fuel name
expansion_ratio : float, optional
Fixed expansion ratio (for 2D cache). If None, uses eps from chunk (3D cache)
lock : multiprocessing.Lock, optional
Lock to serialize RocketCEA calls (RocketCEA is not process-safe)
Returns:
--------
results : List[Tuple[int, int, int, float, float, float, float, float, float]]
List of (i, j, k_idx, cstar, Cf, Tc, gamma, R, M) tuples
Definition at line 214 of file cea_cache.py.
References _get_CEA_Obj(), and parse_cea_basic().
|
protected |
Fill failed CEA points from the nearest good one along the first axis (MR), then Pc.
Definition at line 1142 of file cea_cache.py.
References min.
Referenced by engine.pipeline.cea_cache.CEAAuxTables._build().
|
protected |
Lazy import of CEA_Obj - only import when needed for cache building.
Definition at line 101 of file cea_cache.py.
Referenced by engine.pipeline.cea_cache.CEAAuxTables._build(), engine.pipeline.cea_cache.CEACache._build_cache_sequential(), and _compute_cea_point_chunk().
|
protected |
Ideal vacuum thrust coefficient from gamma + area ratio (isentropic, frozen). Fallback for caches built before the Cf_vac table existed. Slightly low vs CEA's shifting-equilibrium Cf_vac (the same ~2% frozen gap documented in the thrust-model analysis); regenerate the cache to get the exact CEA value. Self-contained to avoid importing the nozzle solvers here.
Definition at line 49 of file cea_cache.py.
Referenced by engine.pipeline.cea_cache.CEACache.eval(), and engine.pipeline.cea_cache.CEACache.eval_cf_vac().
|
protected |
Return the fully-materialised contents of a cache .npz, memoised per file version.
Definition at line 305 of file cea_cache.py.
Referenced by engine.pipeline.cea_cache.CEAAuxTables._load(), and engine.pipeline.cea_cache.CEACache._load_cache().
|
protected |
float(np.clip(x, lo, hi)) for a scalar, without numpy's per-call overhead. Matches np.clip exactly, including NaN pass-through (NaN < lo and NaN > hi are both False, so NaN is returned). Hot path: called per CEA lookup.
Definition at line 85 of file cea_cache.py.
Referenced by engine.pipeline.cea_cache.CEACache.eval(), and engine.pipeline.cea_cache.CEACache.eval_cf_vac().
| CEAAuxTables engine.pipeline.cea_cache.get_aux_tables | ( | str | ox_name, |
| str | fuel_name ) |
Definition at line 1301 of file cea_cache.py.
Referenced by engine.pipeline.cea_cache.CEACache.aux().
| Tuple[float, float, float, float, float, float] engine.pipeline.cea_cache.parse_cea_basic | ( | str | out | ) |
Extract Tc, gamma, R, c*, and Isp from NASA CEA text output (chamber values only). Returns: -------- Tc : float [K] gamma : float R : float [J/(kg*K)] cstar : float [m/s] M : float [kg/kmol] Isp : float [s] (ambient Isp, or NaN if not found)
Definition at line 162 of file cea_cache.py.
Referenced by engine.pipeline.cea_cache.CEACache._build_cache_sequential(), and _compute_cea_point_chunk().
| engine.pipeline.cea_cache.safe_print | ( | * | args, |
| ** | kwargs ) |
Log function that handles Unicode encoding errors gracefully
Definition at line 121 of file cea_cache.py.
References decode().
|
protected |
Definition at line 1122 of file cea_cache.py.
|
protected |
Definition at line 1127 of file cea_cache.py.
|
protected |
Definition at line 1120 of file cea_cache.py.
|
protected |
Definition at line 1121 of file cea_cache.py.
|
protected |
Definition at line 1124 of file cea_cache.py.
|
protected |
Definition at line 99 of file cea_cache.py.
|
protected |
Definition at line 1126 of file cea_cache.py.
|
protected |
Definition at line 1125 of file cea_cache.py.
|
protected |
Definition at line 302 of file cea_cache.py.
|
protected |
Definition at line 120 of file cea_cache.py.
|
protected |
Definition at line 1123 of file cea_cache.py.
| tuple engine.pipeline.cea_cache.AUX_SPECIES = ("H2O", "CO2", "CO", "H2", "OH", "O2", "O", "H") |
Definition at line 1119 of file cea_cache.py.
| engine.pipeline.cea_cache.buffer |
Definition at line 157 of file cea_cache.py.
| int engine.pipeline.cea_cache.CEA_AUX_SCHEMA_VERSION = 1 |
Definition at line 1118 of file cea_cache.py.
| int engine.pipeline.cea_cache.CEA_TABLE_SCHEMA_VERSION = 2 |
Definition at line 46 of file cea_cache.py.
| engine.pipeline.cea_cache.encoding |
Definition at line 154 of file cea_cache.py.
| engine.pipeline.cea_cache.errors |
Definition at line 154 of file cea_cache.py.
| engine.pipeline.cea_cache.logger = logging.getLogger("evaluate") |
Definition at line 117 of file cea_cache.py.
| engine.pipeline.cea_cache.print = safe_print |
Definition at line 149 of file cea_cache.py.
Referenced by engine.pipeline.cea_cache.CEACache._build_cache(), engine.pipeline.cea_cache.CEACache._build_cache_parallel(), engine.pipeline.cea_cache.CEACache._build_cache_sequential(), engine.pipeline.cea_cache.CEACache._load_cache(), and engine.pipeline.cea_cache.CEACache.eval().
| engine.pipeline.cea_cache.stdout |
Definition at line 157 of file cea_cache.py.