Skip to content

Fix/rocket fail gracefully#62

Merged
markleader merged 3 commits intonasa:mainfrom
markleader:fix/rocket_fail_gracefully
Mar 19, 2026
Merged

Fix/rocket fail gracefully#62
markleader merged 3 commits intonasa:mainfrom
markleader:fix/rocket_fail_gracefully

Conversation

@markleader
Copy link
Contributor

Summary

Fixes #57 by restoring backward-compatible frozen rocket failure behavior for non-converging rocket problems that should still emit partial output. This updates the modern solver/output path to retain completed stations, stop at the same points as the reproduced legacy cases, and emit the same warning after partial output instead of producing an empty file or crashing.

Changes

  • Updated frozen rocket stopping logic in source/rocket.f90 so partial-stop cases retain the last valid station set and return a usable partial RocketSolution.
  • Added explicit rocket partial-status bookkeeping (status_code, warning_code, last_completed_idx) so output handling can distinguish full convergence from valid partial failure states.
  • Matched frozen stop criteria to the reproduced behavior:
    • check the active thermo-fit interval for frozen condensed species,
    • stop on the lower-temperature frozen-fit guard,
    • retain the same user-facing warning text in final rocket output.
  • Updated source/main.f90 rocket output handling to:
    • truncate output at the last completed station,
    • avoid reading uncomputed stations,
    • avoid empty-trace output crashes,
    • append the warning after partial output.
  • Adjusted repeated-singular recovery in source/equilibrium.f90 so difficult chamber solves can retain a usable reduced-component state instead of falling back to an unusable seed in the reproduced rocket failure path.
  • Added frozen transport-property population for retained frozen rocket points so partial outputs include transport values where expected.
  • Added focused regressions in source/rocket_test.pf for the associated frozen rocket failure cases.

Testing

  • ./build-dev/source/cea_core_test

Compatibility / Numerical behavior

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

The intended numerical/output behavior changes are limited to the reproduced frozen rocket failure paths. These cases now stop at the legacy-compatible point, retain valid upstream stations, and emit partial output plus the warning instead of producing no output, invalid extra stations, or crashing. Converged cases were validated with the existing core test suite, and the reproduced failure cases were validated by comparing the generated partial outputs against the legacy reference behavior.

@markleader markleader merged commit 159f02c into nasa:main Mar 19, 2026
12 of 21 checks passed
@markleader markleader deleted the fix/rocket_fail_gracefully branch March 19, 2026 13:41
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] Rocket problem segfault

1 participant