STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
test_time_series_keeps_solver_cstar.py
Go to the documentation of this file.
1"""The coupled time-series path reports the chamber solve's c* and eta_c*, not an assumed 0.85.
2
3runner.evaluate_arrays_with_time used to overwrite the time-varying solver's results with
4cstar_ideal = cstar_actual / 0.85, which set eta_c* to exactly 0.85 at every step (the Time-Series
5tab and Layer 2/3 read it).
6"""
7import numpy as np
8import pytest
9
10PSI = 6894.757
11
12
14 from engine.pipeline.io import load_config
15 from engine.core.runner import PintleEngineRunner
16
17 cfg = load_config("configs/ethalox_6500N.yaml")
18 runner = PintleEngineRunner(cfg)
19 P_O = cfg.lox_tank.initial_pressure_psi * PSI
20 P_F = cfg.fuel_tank.initial_pressure_psi * PSI
21 times = np.array([0.0, 0.5])
22 ts = runner.evaluate_arrays_with_time(times, np.full(2, P_O), np.full(2, P_F), use_coupled_solver=True)
23 point = runner.evaluate(P_O, P_F, silent=True)
24 eta = np.asarray(ts["eta_cstar"], dtype=float)
25 assert not np.allclose(eta, 0.85)
26 assert eta[0] == pytest.approx(point["eta_cstar"], rel=2e-3)
27 assert np.asarray(ts["cstar_ideal"])[0] == pytest.approx(point["cstar_ideal"], rel=2e-3)