Skip to content

updated eqsolver max temperature to fix high-temperature errors - #100

Merged
markleader merged 2 commits into
nasa:mainfrom
markleader:fix-high-temp
Jul 29, 2026
Merged

updated eqsolver max temperature to fix high-temperature errors#100
markleader merged 2 commits into
nasa:mainfrom
markleader:fix-high-temp

Conversation

@markleader

Copy link
Copy Markdown
Contributor

Summary

Restore high-temperature equilibrium support through CEA2’s 20,000 K thermodynamic fit range.

The solver previously marked otherwise valid solutions as non-converged above 6,600 K because its upper temperature bound used the start of the final gas-fit interval rather than its 20,000 K endpoint.

Changes

  • Increase the equilibrium solver’s upper admissibility limit from 6,600 K to 22,000 K, matching CEA2’s 10% margin above the 20,000 K gas-fit limit.
  • Add a full 20,000 K TP regression for an ionized Ar/N₂/H₂ mixture at 1 atm.
  • Validate total moles and representative Ar⁺, H⁺, N⁺, and electron mole fractions against CEA2 results.

Testing

  • cmake --build build-dev
  • ctest --test-dir build-dev -R '^cea_core_test$' --output-on-failure
  • Reproduced the reported Python case using the rebuilt binding:
    • 6,610 K: converged
    • 20,000 K: converged
    • 22,000 K: converged
    • 22,010 K: non-converged, preserving the CEA2 extended-range boundary

Compatibility / Numerical behavior

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

Previously rejected equilibrium solutions above 6,600 K can now report successful convergence through the CEA2-supported range. Converged results at and below 6,600 K are unchanged because no iteration or thermodynamic calculation logic was modified. The new 20,000 K regression verifies the high-temperature ionized composition against CEA2.

@markleader
markleader merged commit 2c33ae8 into nasa:main Jul 29, 2026
21 checks passed
@markleader
markleader deleted the fix-high-temp branch July 29, 2026 13:31
@markleader markleader mentioned this pull request Jul 29, 2026

@BehradKashfi BehradKashfi left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up to #97: conductivity/viscosity still unphysical above ~10,000 K after the fix

Thanks for the fast fix on #97 -- the equilibrium composition and Cp are now
excellent across the full 300-20,000 K range (validated against your own
test_high_temperature_ionized_ar_n2_h2 regression values: our independent
solver matched Ar+/H+/N+/e- mole fractions to within 0.02-1.24%).

However, thermal conductivity and viscosity (conductivity_eq and
viscosity on EqSolution) still show clearly unphysical behavior above
~10,000 K
, even though the underlying composition is now correct. This
looks like a separate issue from #97, since that fix specifically targeted
the thermodynamic (thermo.lib) fit range -- trans.lib (used for
conductivity/viscosity) may have its own, still-unaddressed high-T
boundary.

Symptom

Conductivity and viscosity both grow smoothly and unboundedly with
temperature above ~10,000 K, with no turnover -- reaching values 20-40x
higher than expected by 20,000 K. Real thermal-plasma transport data
(compared against two independent references, see below) shows conductivity
and viscosity peaking around 10,000-15,000 K and then DECLINING as
ionization approaches completion -- physically expected, since the
"reactive" transport contribution is driven by dX/dT of the ionizing
species, which shrinks once the composition plateaus near full ionization.
Solver never reproduces this turnover.

Evidence -- two independent compositions, same failure pattern

Ar 75% / N2 10% / H2 15%, 1 atm (compared against Boulos/Moreau
reference data, pixel-digitized from a published plasma-torch dataset):

  • At T=20,000 K: conductivity_eq/10 ~ 125 W/(mK) vs reference ~6 W/(mK)
    (~20x too high)
  • Viscosity1e-4 ~ 3.8e-4 Pas vs reference ~1e-5 Pa*s (~38x too high)

Ar 45% / N2 45% / H2 10%, 1 atm (compared against an independently
obtained reference dataset for this composition):

  • Same qualitative failure: smooth unbounded growth to ~158 W/(mK) by
    20,000 K, vs reference showing a clean peak (~8.5 W/(m
    K)) around
    14,500 K followed by decline to ~2 W/(m*K) by 20,000 K.

Minimal reproduction

import numpy as np
import cea

cea.init()
cea.set_log_level(cea.LOG_ERROR)

reactants = cea.Mixture(["Ar", "N2", "H2"], ions=True)
products = cea.Mixture(["Ar", "N2", "H2"], products_from_reactants=True, ions=True)
solver = cea.EqSolver(products, reactants=reactants, transport=True)
solution = cea.EqSolution(solver)

reactant_moles = np.zeros(reactants.num_species)
reactant_moles[reactants.species_names.index("Ar")] = 0.75
reactant_moles[reactants.species_names.index("N2")] = 0.10
reactant_moles[reactants.species_names.index("H2")] = 0.15
reactant_weights = reactants.moles_to_weights(reactant_moles)

pressure_bar = cea.units.atm_to_bar(1.0)

for T in [8000, 12000, 16000, 20000]:
    solver.solve(solution, cea.TP, float(T), pressure_bar, reactant_weights)
    # NOTE: conductivity_eq appears to be in mW/(cm*K), divide by 10 for W/(m*K)
    # NOTE: viscosity appears to be in millipoise, multiply by 1e-4 for Pa*s
    print(f"T={T}: cp_eq={solution.cp_eq:.3f} kJ/(kg*K)  "
          f"cond={solution.conductivity_eq/10:.3f} W/(m*K)  "
          f"visc={solution.viscosity*1e-4:.3e} Pa*s")

Cp stays physically reasonable throughout; conductivity and viscosity grow
without bound.

Note on units

Separately from the above: conductivity_eq and viscosity appear to be
reported in legacy CGS-style units (mW/(cmK) and millipoise respectively)
rather than SI (W/(m
K), Pa*s) -- we found this empirically by comparing
against reference data and finding consistent conversion factors of /10
and *1e-4. Not sure if this is intentional/documented elsewhere, but it
wasn't obvious from the API and cost us some time to work out -- might be
worth a note in the docs if it's expected behavior.

Happy to provide full test scripts/data if useful.

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.

2 participants