Repository navigation
Fix temp enthalpy solve failures - #2981
Closed
joshkellyjak wants to merge 9 commits into
Closed
joshkellyjak wants to merge 9 commits into
joshkellyjak wants to merge 9 commits into
Conversation
…te fixes Adds the resolved Eq. (14) preferential diffusion flux formulation (model B2 of Schepers & van Oijen, C&F 280 (2025) 114332) to the flamelet scalar transport, alongside the existing beta correction, and fixes two defects that left the existing model inert or wrong. Model - PREFERENTIAL_DIFFUSION_METHOD selects BETA_CORRECTION (default, unchanged) or SOURCE_TERM. - PREFERENTIAL_DIFFUSION_MAJOR_SPECIES names the species carrying the resolved flux. The manifold variables (Res_<cv>, Y-<sp>, D_<cv>_<sp>, DT_<cv>) are composed from the configured controlling variable and species names. - The Eq. (14) fluxes are a new branch of CScalarFlux_Flamelet, driven by the CFD-resolved gradients of the major species and of temperature. Explicit, with a stabilising self-diffusion added to the Jacobian alone so the converged solution is unchanged. - The Eq. (16) closure sources are gated on manifold validity only. Fixes - nAuxVar was never set, so SetAuxVar_Gradient_* looped zero times and every beta gradient stayed zero. The beta term then evaluated grad(beta) - grad(phi) as -grad(phi), cancelling the ordinary diffusion of the controlling variables rather than correcting it. - LEAST_SQUARES fell through the auxiliary gradient switch, with the same effect. - Soret coefficients are zeroed on viscous walls, where the manifold carries no quench layer data. - A collective in the volume output ran behind an "iPoint == 0" test inside the per point loop; a rank owning no points would have hung the others. Moved to a new per write COutput::PrepareVolumeData hook. - The cached preferential diffusion source is cleared at off manifold nodes, and the Newton non convergence message is rank guarded. Diagnostics - FLAME_QUALITY volume group, hull miss deviations, FLAMELET_VERBOSE_MISSES, and per location probe history files. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…le gradient The stabilising diffusivity is a bound on the Eq. (14) flux recast as a self diffusion, |J| <= D_stab |grad phi|, so it has to be divided by the controlling variable's own gradient. Without that division D_stab sits at the raw coefficient magnitude everywhere, which damps the update far more than the explicit flux warrants: on the burner case every stabilised run plateaued near rms[h] = -2.45 whatever the CFL, so the higher ceiling bought no convergence. With the division restored, CFL 2 reaches -2.530 against -2.528 at CFL 1, and the ceiling moves from (1, 2) without the term to (2, 3) with it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…de/SU2 into feature_new_pref_diffusion
## Proposed Changes The implicit compressible solver limits the update of each point with an under-relaxation factor. To decide how much to limit, it compares the internal energy before and after the update. This internal energy was computed wrongly: the kinetic energy was not divided by the density. https://github.com/su2code/SU2/blob/a6b7496b740ac0e63807ee1b066a4badd902da91/SU2_CFD/src/solvers/CEulerSolver.cpp#L2555-L2556 In cases run with dimensional values the wrong internal energy can become negative. When it does, the point gets no update at all and stays frozen. In an air nozzle about a quarter of the points were frozen, so the case could not converge. The fix is 5 lines: the kinetic energy is divided by the density, using the old and the new density. Almost all compressible implicit regression cases converge a little differently, so most regression values change. They are updated from the CI. This is the first of four PRs that replace #2941, to make the review easier. The other three build on this one: - #2943: HLLC on moving grids; - #2944: Roe-type schemes in 3D; - #2945: smaller fixes. ## Related Work - #2830 added the under-relaxation factor. - #2941 (replaced by this PR and the three that follow). ## PR Checklist - [x] I am submitting my contribution to the develop branch. - [x] My contribution generates no new compiler warnings (try with --warnlevel=3 when using meson). - [x] My contribution is commented and consistent with SU2 style (https://su2code.github.io/docs_v7/Style-Guide/). - [x] I used the pre-commit hook to prevent dirty commits and used `pre-commit run --all` to format old commits. - [x] I have added a test case that demonstrates my contribution, if necessary. - [x] I have updated appropriate documentation (Tutorials, Docs Page, config_template.cpp), if necessary. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --------- Co-authored-by: rois1995 <rauxa1995@hotmail.it> Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Co-authored-by: rois1995 <rauxa1995@gmail.com> Co-authored-by: Josh Kelly <81244680+joshkellyjak@users.noreply.github.com>
…/su2code/SU2 into fix_temp_enthalpy_solve_failures
…initial guess is selected based on previous valid solution
joshkellyjak
added this pull request to stack #2982
October 15, 2026 15:23
joshkellyjak
removed this pull request from stack #2982
October 15, 2026 15:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed Changes
Fluid models that solve for the temperature from the enthalpy iteratively currently start every solve from a fixed temperature and give the caller no way to tell that it failed.
CIncIdealGasPolynomialstarts at 300 K and only prints a per-point warning when it fails.This PR adds
CFluidModel::SolveTDState_h(h, Y, T_guess), which takes the starting temperature as an argument and returns whether a valid state was found. The default implementation forwards toSetTDState_hand returnstrue, so models that compute the temperature directly are unchanged.CIncIdealGasPolynomialnow uses the guess (falling back to the non-dimensional reference temperature) and returns failure instead of printing per-point warnings. The incompressible call sites (SetPrimVarmain and fallback paths,ComputeConsistentExtrapolation,RecomputeDensity_time_n) now pass the previous temperature and handle failure explicitly.Related Work
Replaces the
SetTemperatureGuess/GetTemperatureIterationFailedpair proposed in #2713 (Cantera fluid model), which can implementSolveTDState_hinstead. Also prepares for a temperature-dependent cp inFLUID_MIXTURE(see the TODO inCFluidScalar::SetTDState_h).PR Checklist
pre-commit run --allto format old commits.