STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
engine.core.chamber_solver.ChamberSolver Class Reference

Public Member Functions

 __init__ (self, PintleEngineConfig config, CEACache cea_cache)
float residual (self, float Pc, float P_tank_O, float P_tank_F)
Tuple[float, Dict[str, Any]] solve (self, float P_tank_O, float P_tank_F, float Pc_guess=None, bool debug=False, bool silent=False)

Public Attributes

 config = config
 cea_cache = cea_cache
bool spray_quality_good = True

Protected Member Functions

 _accel_chamber_pc (self, float P_tank_O, float P_tank_F)
 _raise_supply_exceeds_demand (self, P_tank_O, P_tank_F, Pc_max, residual_min, residual_max, debug)
Dict[str, float] _extract_and_validate_mixture_diagnostics (self, Dict[str, Any] closure_diag, bool strict=True)
None _log_mixture_diagnostics (self, Dict[str, float] diag)
float _compute_cooling_efficiency (self, Dict[str, Any] cooling_results, float mdot_total, float Tc, float gamma, float R)
Tuple[Dict[str, Any], float, float] _evaluate_cooling_models (self, float Pc, float mdot_O, float mdot_F, Dict[str, float] cea_props, Dict[str, Any] closure_diag, bool with_profile=True)
 _wall_contour (self)
float _liner_end (self, contour)
float _infer_injector_diameter (self)
Dict[str, float] _get_chamber_geometry (self)
float _rupe_R_opt (self)
Optional[Dict[str, float]] _fluid_props (self, str which)
Optional[Dict[str, float]] _get_fuel_props (self)
Optional[Dict[str, float]] _get_ox_props (self)

Static Protected Member Functions

 _highest_sign_change (f, float Pc_min, float Pc_max, float r_min, float r_max, int n=PC_BRACKET_SCAN_POINTS)

Protected Attributes

 _debug
 _silent = silent
 _wall_contour_cache = cached

Detailed Description

Solves for chamber pressure by balancing supply and demand

Definition at line 73 of file chamber_solver.py.

Constructor & Destructor Documentation

◆ __init__()

engine.core.chamber_solver.ChamberSolver.__init__ ( self,
PintleEngineConfig config,
CEACache cea_cache )

Definition at line 76 of file chamber_solver.py.

Member Function Documentation

◆ _accel_chamber_pc()

engine.core.chamber_solver.ChamberSolver._accel_chamber_pc ( self,
float P_tank_O,
float P_tank_F )
protected
Solve Pc with the native C kernel (whole residual loop + Brent) when native
is enabled and can handle this config; otherwise return None so the Python
Brent solver runs.

Pure capability routing — no runtime parity self-check or process latch. Parity
is enforced by the golden test suite and the load-time ABI assert in
the accelerator. A solve that raises or returns a non-finite Pc falls back to the
Python solver for that call.

Definition at line 265 of file chamber_solver.py.

References cea_cache, backend.routers.documents.CreatePayload.config, backend.routers.documents.ReleasePayload.config, backend.state.AppState.config, board_simulator.SimulatedBoard.config, calibration_robustness.AnomalyDetector.config, calibration_robustness.BackupManager.config, calibration_robustness.CalibrationValidator.config, calibration_robustness.HealthMonitor.config, calibration_robustness.RobustnessManager.config, combined_fsw_gui.ConfigManager.config, combined_gui.ConfigManager.config, emmc_log_t.config, engine.control.robust_ddp.engine_wrapper.EngineWrapper.config, config, idle_t.config, self_test_t.config, solenoid_characterization_gui.ConfigManager.config, and StarOTA::Server.config.

◆ _compute_cooling_efficiency()

◆ _evaluate_cooling_models()

◆ _extract_and_validate_mixture_diagnostics()

Dict[str, float] engine.core.chamber_solver.ChamberSolver._extract_and_validate_mixture_diagnostics ( self,
Dict[str, Any] closure_diag,
bool strict = True )
protected
Extract and validate mixture quality diagnostics from closure diagnostics.

DIAGNOSTICS-ONLY - no efficiency impact. Physics comes from:
- eta_Lstar: actual SMD via gasification model
- eta_mixing: actual turbulence/velocities via diffusion
- eta_kinetics: actual T/P via Damköhler number

Parameters:
- closure_diag: Injector diagnostics dict
- strict: If True, raise on missing critical data. If False, warn.

Returns: Dict with actual_smd_microns, x_star_mm, We_O, We_F, etc.

Definition at line 680 of file chamber_solver.py.

References max, and min.

◆ _fluid_props()

◆ _get_chamber_geometry()

Dict[str, float] engine.core.chamber_solver.ChamberSolver._get_chamber_geometry ( self)
protected

◆ _get_fuel_props()

◆ _get_ox_props()

Optional[Dict[str, float]] engine.core.chamber_solver.ChamberSolver._get_ox_props ( self)
protected
Oxidizer liquid properties for the c* model (see ``_fluid_props``).

Definition at line 1215 of file chamber_solver.py.

References _fluid_props().

Referenced by _raise_supply_exceeds_demand(), and residual().

◆ _highest_sign_change()

engine.core.chamber_solver.ChamberSolver._highest_sign_change ( f,
float Pc_min,
float Pc_max,
float r_min,
float r_max,
int n = PC_BRACKET_SCAN_POINTS )
staticprotected
[lo, hi] holding the HIGHEST-Pc sign change of the residual on [Pc_min, Pc_max], or
(None, None). Equal steps scanned from the top; ``r_min``/``r_max`` are reused at the ends.
Verbatim mirror of the scan in accel.kernels.evaluate_core (parity).

Definition at line 295 of file chamber_solver.py.

◆ _infer_injector_diameter()

◆ _liner_end()

◆ _log_mixture_diagnostics()

None engine.core.chamber_solver.ChamberSolver._log_mixture_diagnostics ( self,
Dict[str, float] diag )
protected
Log mixture quality diagnostics for informational purposes.

DIAGNOSTICS-ONLY - no efficiency impact.

Definition at line 831 of file chamber_solver.py.

References info.

◆ _raise_supply_exceeds_demand()

◆ _rupe_R_opt()

float engine.core.chamber_solver.ChamberSolver._rupe_R_opt ( self)
protected

◆ _wall_contour()

◆ residual()

◆ solve()

Tuple[float, Dict[str, Any]] engine.core.chamber_solver.ChamberSolver.solve ( self,
float P_tank_O,
float P_tank_F,
float Pc_guess = None,
bool debug = False,
bool silent = False )

Member Data Documentation

◆ _debug

engine.core.chamber_solver.ChamberSolver._debug
protected

Definition at line 222 of file chamber_solver.py.

Referenced by solve().

◆ _silent

engine.core.chamber_solver.ChamberSolver._silent = silent
protected

Definition at line 427 of file chamber_solver.py.

◆ _wall_contour_cache

engine.core.chamber_solver.ChamberSolver._wall_contour_cache = cached
protected

Definition at line 1071 of file chamber_solver.py.

◆ cea_cache

◆ config

engine.core.chamber_solver.ChamberSolver.config = config

Definition at line 77 of file chamber_solver.py.

Referenced by engine.layerx.card.EngineSampler.__call__(), _accel_chamber_pc(), engine.pipeline.time_varying_solver.TimeVaryingCoupledSolver._advance_walls(), 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.time_varying_solver.TimeVaryingCoupledSolver._build_walls(), _compute_cooling_efficiency(), _evaluate_cooling_models(), engine.core.runner.PintleEngineRunner._evaluate_internal(), _fluid_props(), engine.pipeline.time_varying_solver.TimeVaryingCoupledSolver._geometry(), engine.core.runner.PintleEngineRunner._get_ambient_pressure(), _get_chamber_geometry(), engine.core.runner.PintleEngineRunner._get_elevation(), _get_fuel_props(), engine.pipeline.time_varying_solver.TimeVaryingCoupledSolver._graphite_layers(), _infer_injector_diameter(), engine.pipeline.time_varying_solver.TimeVaryingCoupledSolver._insert_backing(), _liner_end(), engine.pipeline.time_varying_solver.TimeVaryingCoupledSolver._liner_layers(), engine.pipeline.cea_cache.CEACache._load_cache(), _raise_supply_exceeds_demand(), _rupe_R_opt(), engine.pipeline.cea_cache.CEACache._save_cache(), engine.pipeline.time_varying_solver.TimeVaryingCoupledSolver._station_loads(), _wall_contour(), engine.pipeline.time_varying_solver.TimeVaryingCoupledSolver._wall_report(), engine.pipeline.cea_cache.CEACache.aux(), engine.pipeline.system_diagnostics.SystemDiagnostics.diagnose_all(), engine.pipeline.cea_cache.CEACache.eval(), engine.pipeline.cea_cache.CEACache.eval_cf_vac(), engine.pipeline.time_varying_solver.TimeVaryingCoupledSolver.liner_end(), residual(), solve(), engine.pipeline.time_varying_solver.TimeVaryingCoupledSolver.solve_time_step(), test_robust_ddp_constraints.TestConstraints.test_all_constraints_safe(), test_robust_ddp_engine_wrapper.TestEngineWrapper.test_cache_stats(), test_robust_ddp_engine_wrapper.TestEngineWrapper.test_caching(), test_robust_ddp_engine_wrapper.TestEngineWrapper.test_clear_cache(), test_robust_ddp_constraints.TestConstraints.test_constraint_summary(), test_robust_ddp_engine_wrapper.TestEngineWrapper.test_convenience_function(), test_robust_ddp_constraints.TestConstraints.test_copv_minimum_constraint(), test_robust_ddp_constraints.TestConstraints.test_edge_cases(), test_robust_ddp_engine_wrapper.TestEngineWrapper.test_estimate_error_handling(), test_robust_ddp_engine_wrapper.TestEngineWrapper.test_estimate_from_pressures_mock(), test_robust_ddp_engine_wrapper.TestEngineWrapper.test_estimate_without_stability(), test_robust_ddp_constraints.TestConstraints.test_headroom_constraints(), test_robust_ddp_constraints.TestConstraints.test_injector_stiffness_constraints(), test_robust_ddp_constraints.TestConstraints.test_mixture_ratio_constraints(), test_robust_ddp_robustness.TestRobustness.test_multiple_updates_convergence(), test_robust_ddp_constraints.TestConstraints.test_multiple_violations(), test_robust_ddp_constraints.TestConstraints.test_nan_handling(), test_robust_ddp_dynamics.TestDynamics.test_regulator_behavior(), test_robust_ddp_robustness.TestRobustness.test_tube_propagate_basic(), test_robust_ddp_robustness.TestRobustness.test_tube_propagate_validation(), test_robust_ddp_robustness.TestRobustness.test_tube_propagate_widens(), test_robust_ddp_robustness.TestRobustness.test_tube_propagate_with_large_w_bar(), test_robust_ddp_constraints.TestConstraints.test_ullage_maximum_constraints(), test_robust_ddp_robustness.TestRobustness.test_update_bounds_basic(), test_robust_ddp_robustness.TestRobustness.test_update_bounds_beta(), test_robust_ddp_robustness.TestRobustness.test_update_bounds_ema_behavior(), test_robust_ddp_robustness.TestRobustness.test_update_bounds_inflation(), test_robust_ddp_robustness.TestRobustness.test_update_bounds_requires_mass_flow(), test_robust_ddp_robustness.TestRobustness.test_update_bounds_residual_spike(), test_robust_ddp_robustness.TestRobustness.test_update_bounds_with_engine_wrapper(), and test_robust_ddp_engine_wrapper.TestEngineWrapper.test_wrapper_initialization().

◆ spray_quality_good

bool engine.core.chamber_solver.ChamberSolver.spray_quality_good = True

Definition at line 84 of file chamber_solver.py.

Referenced by residual().


The documentation for this class was generated from the following file: