Skip to content

Fix frozen indices - #99

Merged
markleader merged 2 commits into
nasa:mainfrom
markleader:fix-frozen-indices
Jul 29, 2026
Merged

Fix frozen indices#99
markleader merged 2 commits into
nasa:mainfrom
markleader:fix-frozen-indices

Conversation

@markleader

Copy link
Copy Markdown
Contributor

Summary

Fix frozen rocket scheduling when n_frz falls inside a multi-point exit schedule, restoring parity with legacy CEA2 for n_frz=3 and higher. Closes #95 .

Also add experimental n_frz=-1 support to expand the supplied reactant composition through the nozzle without performing any equilibrium solves.

Changes

  • Split IAC and FAC pi_p and supar schedules into:

    • An equilibrium prefix through the freeze station.
    • A frozen suffix after the freeze station.
  • Preserve the freeze-station composition at every downstream frozen point.

  • Add an experimental n_frz=-1 mode that:

    • Initializes the chamber state directly from the reactants.
    • Supports both temperature and enthalpy inputs.
    • Bypasses all EqSolver.solve calls.
    • Uses the existing frozen-property kernels for IAC and FAC throat and exit calculations.
    • Supports pi_p, subar, and supar schedules.
    • Passes through the existing Fortran, C, Python, MATLAB, Excel, and command-line interfaces without restricting n_frz to positive values.
  • Prevent negative composition indexing in command-line frozen output.

Testing

  • Added one pFUnit regression test reproducing the RP-1/O₂/CO₂/H₂O n_frz=3 issue.
  • The regression test verifies:
    • All four stations complete and converge.
    • Station 4 retains station 3’s species amounts.
    • Temperature, thrust coefficient, specific impulse, vacuum specific impulse, and characteristic velocity agree with local legacy CEA2 results to approximately 1e-5 relative tolerance.

Compatibility / Numerical behavior

  • No expected changes to numerical results
  • Expected changes (explain and provide validation)

Numerical results change for freeze boundaries that previously occurred inside a multi-point pi_p or supar schedule. These cases now transition from equilibrium to frozen composition at the requested station and match legacy CEA2 behavior.

n_frz=-1 introduces new experimental numerical behavior with no CEA2 equivalent: reactants are expanded with fixed composition and no equilibrium solves.

@markleader
markleader merged commit 46be9bd into nasa:main Jul 29, 2026
@markleader
markleader deleted the fix-frozen-indices branch July 29, 2026 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Python interface: Frozen status not working for station 3+

1 participant