updated eqsolver max temperature to fix high-temperature errors - #100
Conversation
BehradKashfi
left a comment
There was a problem hiding this comment.
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/(mK)) 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/(mK), 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.
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
Testing
cmake --build build-devctest --test-dir build-dev -R '^cea_core_test$' --output-on-failureCompatibility / Numerical behavior
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.