Summary
rocket.f90:896 and the identical :990 hardcode soln%eq_partials(2)%gamma_s as the throat's initial-guess seed for a Newton iteration:
else if (supar(i) >= 2.0d0) then
ln_pinf_pe = soln%eq_partials(2)%gamma_s + 1.4d0*log(supar(i))
The literal 2 is meant to be the throat station. For IAC problems soln%throat_idx = 2, so this happens to be right — but for FAC problems soln%throat_idx = 4 (stations: 1=injector, 2=infinity, 3=combustor end, 4=throat), so eq_partials(2) in the FAC path is the infinity station, not the throat.
Reproduction
- Interface: Fortran (
RocketSolver_solve, fac=.true.)
rocket_test.pf:427-448 (test_rocket_fac_only_area_ratios) calls solve(..., fac=.true.) with supar=[25.0d0] (>= 2.0), hitting this exact branch with the wrong station.
Expected behavior
The throat station's gamma_s should seed the Newton iteration, via soln%eq_partials(soln%throat_idx)%gamma_s — matching the pattern already used in the analogous RocketSolver_solve_pi_p/_solve_pi_p_frozen (rocket.f90:660-661,723-724).
Actual behavior
The infinity station's gamma_s is used instead when fac=.true., incorrectly seeding the throat pressure-ratio guess.
Additional context
Impact is likely limited: this only seeds a Newton iteration's initial guess (rocket.f90:899-924, refined against area_tol=4.0d-5 over up to max_iter_area=10 steps) — a converged fixed point doesn't depend on the seed, only convergence speed/robustness does, which is presumably why the existing FAC test still passes. Not verified: whether some supar/propellant combination causes the 10-iteration cap to be hit before convergence with the bad seed (neither function warns on iteration exhaustion). Suggested fix — change soln%eq_partials(2)%gamma_s to soln%eq_partials(soln%throat_idx)%gamma_s at both sites — is mechanical and matches the file's own established pattern, but this is an initial-guess formula inside a solver iteration loop, so per CLAUDE.md it needs a maintainer's sign-off before treating as a drop-in fix.
Drafted with Claude's assistance
- The station-index mismatch and the correct pattern used elsewhere in the same file were confirmed by direct read of
rocket.f90, in the 2026-08-29 codebase sweep that originated this item.
- Checked
gh issue list on both nasa/cea and djkees/cea before filing to confirm this isn't a duplicate.
Summary
rocket.f90:896and the identical:990hardcodesoln%eq_partials(2)%gamma_sas the throat's initial-guess seed for a Newton iteration:The literal
2is meant to be the throat station. For IAC problemssoln%throat_idx = 2, so this happens to be right — but for FAC problemssoln%throat_idx = 4(stations: 1=injector, 2=infinity, 3=combustor end, 4=throat), soeq_partials(2)in the FAC path is the infinity station, not the throat.Reproduction
RocketSolver_solve,fac=.true.)rocket_test.pf:427-448(test_rocket_fac_only_area_ratios) callssolve(..., fac=.true.)withsupar=[25.0d0](>= 2.0), hitting this exact branch with the wrong station.Expected behavior
The throat station's
gamma_sshould seed the Newton iteration, viasoln%eq_partials(soln%throat_idx)%gamma_s— matching the pattern already used in the analogousRocketSolver_solve_pi_p/_solve_pi_p_frozen(rocket.f90:660-661,723-724).Actual behavior
The infinity station's
gamma_sis used instead whenfac=.true., incorrectly seeding the throat pressure-ratio guess.Additional context
Impact is likely limited: this only seeds a Newton iteration's initial guess (
rocket.f90:899-924, refined againstarea_tol=4.0d-5over up tomax_iter_area=10steps) — a converged fixed point doesn't depend on the seed, only convergence speed/robustness does, which is presumably why the existing FAC test still passes. Not verified: whether some supar/propellant combination causes the 10-iteration cap to be hit before convergence with the bad seed (neither function warns on iteration exhaustion). Suggested fix — changesoln%eq_partials(2)%gamma_stosoln%eq_partials(soln%throat_idx)%gamma_sat both sites — is mechanical and matches the file's own established pattern, but this is an initial-guess formula inside a solver iteration loop, so perCLAUDE.mdit needs a maintainer's sign-off before treating as a drop-in fix.Drafted with Claude's assistance
rocket.f90, in the 2026-08-29 codebase sweep that originated this item.gh issue liston both nasa/cea and djkees/cea before filing to confirm this isn't a duplicate.