Skip to content

Fix/reflected shock w5#56

Merged
markleader merged 12 commits intonasa:mainfrom
markleader:fix/reflected_shock_w5
Mar 18, 2026
Merged

Fix/reflected shock w5#56
markleader merged 12 commits intonasa:mainfrom
markleader:fix/reflected_shock_w5

Conversation

@markleader
Copy link
Contributor

@markleader markleader commented Mar 9, 2026

Summary

Fixes #55 with a focus on reflected-shock handling, shock transport output, and graceful behavior around singular/non-converged equilibrium solves.

This branch:

  • fixes the reflected frozen u5+v2 discrepancy
  • restores shock transport-property computation/output when output transport is requested
  • matches CEA2-style shock branch sequencing/early-exit behavior more closely in the CLI
  • prevents shock singular/non-converged paths from emitting NaN/stale state
  • improves reflected-frozen thermo parity for the reproduced cea_eq case
  • adds focused shock regression coverage for transport and singular-recovery paths

Changes

  • source/shock.f90

    • fixed reflected frozen shock bookkeeping so the incident rho12 and reflected density ratio are not conflated
    • corrected reflected frozen u5+v2 handling
    • added explicit shock-state validity/failure helpers so failed states are zeroed consistently and stop after the last valid point
    • added shock-specific transport updates, including frozen-shock transport handling
    • finalized retained incident-equilibrium states more defensively after singular/non-converged equilibrium solves
    • added a reflected-frozen finalization path so state-5 thermo is not overwritten by the generic post-processing path
  • source/equilibrium.f90

    • added cached transport outputs and cached transport basis state to EqSolution
    • restored cached transport/full-state data on singular or max-iteration exits when available
    • added cp_eq_transport as the equilibrium-transport Cp reported separately from thermo cp_eq
    • avoided rebuilding the transport basis after solves that encountered singular matrices when a cached basis is already available
    • added frozen-shock transport support so frozen shock states compute viscosity/conductivity/Prandtl without equilibrium-reaction transport terms
  • source/main.f90

    • updated shock CLI execution to follow CEA2-like branch ordering and early-exit rules for mixed equilibrium/frozen reflected shock cases
    • tracked explicit shock branch codes instead of inferring output sections from permutation index
    • updated shock output so only actually-reached branches are printed
    • added shock transport output blocks in the CLI when requested
  • source/shock_test.pf

    • added transport-focused shock coverage
    • added singular-recovery/reflected-frozen regression coverage for the reproduced methane/nitrogen shock case
    • updated failure-path assertions to match the newer CEA2-style recovery behavior
  • source/equilibrium_test.pf, source/rocket_test.pf, source/input_test.pf

    • test-only cleanup/debug-output adjustments

Testing

  • ctest -R cea_core_test -V

Compatibility / Numerical behavior

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

Expected numerical/output changes:

  • reflected frozen u5+v2 now matches the legacy CEA2 result for the reproduced frozen case
  • shock outputs now include transport sections when requested
  • shock singular/non-converged paths stop cleanly instead of printing NaN/stale data
  • reflected-frozen thermo for the reproduced cea_eq case is closer to CEA2, especially H/U/G/S and u5+v2

Validation notes:

  • cea_fr.out reflected frozen u5+v2 now matches the legacy reference to output precision
  • cea_eq.out branch sequencing/output omission now follows the CEA2 path more closely and reflected-frozen G/S are improved

@markleader markleader changed the title WIP: Fix/reflected shock w5 Fix/reflected shock w5 Mar 10, 2026
@markleader markleader merged commit 3189728 into nasa:main Mar 18, 2026
21 checks passed
@markleader markleader deleted the fix/reflected_shock_w5 branch March 18, 2026 14:31
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] Correct reflected shock property calculation

2 participants