Repository navigation
Conversation
The progress variable source was treated fully explicitly, which stalls the PV equation at high CFL. Add the decreasing part of dS/dPV, obtained from a forward-difference table lookup, to the Jacobian diagonal. With CFL 1e5, an ILU preconditioner and a consistent table, the unsteady 1D premixed flame converges in 8-10 inner iterations per time step and matches a 300-inner-iteration reference. Flamelet regression residuals shift slightly; reference values are not yet updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The extra Jacobian term changes the iteration history of the flamelet tests. The discrete adjoint tests change because the adjoint linear solves reuse the primal Jacobian; the converged adjoint is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
EvertBunschoten
left a comment
There was a problem hiding this comment.
Good initiative! I think it would be a low hanging fruit to extend this feature to use the Jacobian of the other controlling variables as well. The Jacobian of the source term w.r.t. the progress variable is of course the highest, but I expect that the mixture fraction and variance of the pv are also relevant.
The fluid model now provides dS_PV/dPV through GetProgVarSourceJacobian: analytically from the MLP Jacobian query, and by a forward difference on the PV source column only for the lookup table. The solver no longer perturbs the full source lookup and sets the derivative to zero where the PV source is clipped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…unsteady_flamelet
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Beyond the first and last table level the lookup used the outer level alone, so looked-up quantities stopped depending on the level variable. With preferential diffusion the mixture fraction is then no longer restored by its own diffusion and can run away, e.g. to negative values at a lean H2 flame tip. Queries outside the level range are now extrapolated linearly from the two outermost levels, up to one level spacing, and still reported as outside the manifold. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 24c8fbc)
The preferential diffusion flux D grad(beta - phi) used the Jacobian of the ordinary diffusion, i.e. d(beta - phi)/dphi = 1, without the coupling between the controlling variables and without the thermal term of the enthalpy equation. For the mixture fraction of lean H2 flames dbeta/dZ is about 3-4, so the term was under-implicit and the mixture fraction and enthalpy oscillated with a period of two iterations near cooled walls. The solver now evaluates d(beta_i - phi_i)/dphi_j, with beta_T dT/dphi_j in the enthalpy row, by finite differences of the manifold lookup when the preferential diffusion scalars are updated: central differences inside the manifold, one-sided towards it at its edges, and the previous Jacobian where neither fits. The steps are 1e-3 of the global range of each controlling variable. The edge kernel assembles the full block. The residual is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 9cace00)
…de the manifold GetBurntProgressVariable marched the progress variable up in steps of 1e-3 and returned the first value that was outside the manifold, because the step taken after leaving it was subtracted only once. The whole burnt region of a flame front initialization then started just outside the table, where the lookup returns frozen values of the nearest nodes; in a lean H2 slit burner these points persisted as a band of progress variable above equilibrium. The march now keeps the last value inside the manifold. When it leaves the manifold, the edge is bisected and the burnt value is set 0.1% of the progress variable range inside it. When the ignition temperature is reached first, that value is returned as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…bian Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…into fix_unsteady_flamelet
…t converted to larger type' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…Jacobian, PD Jacobian off the tape The lookup table again uses the outer level for a mixture fraction outside the table range, instead of extrapolating every looked-up quantity by up to one level spacing. Only the preferential diffusion scalar beta_Z is continued, with beta_Z - Z kept at its boundary value, so that the mixture fraction keeps its own diffusion outside the table. The progress variable source Jacobian of the lookup table uses a backward difference when the forward perturbation leaves the manifold, and zero when both do. The finite difference Jacobian of the preferential diffusion terms is not evaluated while the tape records; the adjoint keeps the Jacobian of the untaped pass that precedes the recording. Comments are shortened. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both values are the ones the CI computes for this branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SetPrefDiffJacobianSteps reduced passivedouble arrays with MPI_DOUBLE. In AD builds MPI_DOUBLE maps to the AD type, so the reduced enthalpy range came back as zero and the enthalpy step fell to 1e-10, turning that Jacobian column into roundoff noise and making the discrete adjoint diverge in one iteration. The reduction now uses su2double buffers. With the fix the H2 PD/MLP adjoint matches develop at CFL 5 and converges at CFL 50 (A_P -10.6 in 3000 iterations), where develop diverges. Sensitivities agree with develop to 1e-9. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ifold points - Store dT/dphi separately from the beta block and scale it in the edge flux with the thermal diffusivity Dth used by the thermal flux. - Start the PD Jacobian at the identity block, its fallback value. - Return the identity block before the finite differences for points off the manifold. - The lookup-table PV source Jacobian is zero for a point outside the table. - Update cfd_flamelet_h2, flame_init_methods and premixed_hydrogen values. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@joshkellyjak @EvertBunschoten @rois1995 This PR is finished, I have also prepared another PR to tackle the diffusion terms in a different way. I think it is better to implement them as D = D_lam + D_PD instead of the mix that we have now. The new approach is less sensitive to numerical errors and conditions close to the edge of the lookup table. For backward compatibility, I will keep the original implementation. |
|
@bigfooted, good catch! Have you also tried running the H2 burner primal with a larger CFL to see if it helps? |
The scalar system is solved in rho*Y, so dS/d(rho*Y) = source_cons / rho, as for the progress variable source and the diffusion Jacobian. Regression values of the cases with auxiliary species are updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Proposed Changes
The flamelet solver treated the progress variable source and the preferential diffusion terms fully explicitly. That stalls the PV equation at high CFL and limits the CFL of both the primal and the discrete adjoint. This PR adds both to the implicit Jacobian.
Progress variable source
CFluidFlamelet::GetProgVarSourceJacobian):Preferential diffusion
Lookup table
Results
Unsteady 1D premixed flame (CFL 1e5, ILU, consistent table): 8–10 inner iterations per time step. A 300-inner-iteration reference gives the same solution.
H2 burner, preferential diffusion, MLP manifold (coarse 6.5k-point version of the
premixed_hydrogentutorial):Sensitivities agree with develop to 1e-9. The develop adjoint agrees with a central finite difference of the outlet temperature to 7.5e-5, for a smooth interior mesh deformation.
CH4 discrete adjoints (
discadj_flamelet_ch4_hx,discadj_flamelet_ch4_cht): converged sensitivities match develop to 1e-6 (hx) and 1e-4 (cht).Regression values
The new Jacobian terms change the iterative path, so all flamelet reference values move:
cfd_flamelet_h2,premixed_hydrogen: larger changes in the scalar residuals, from the preferential diffusion Jacobian.flame_init_methods: the spark-centre temperature at the tested iteration is 1548 K instead of 1600 K. The case still ignites: on one rank, 1404 K at iteration 20, 1600 K (the cap) at 40, and 1542 K at 100, after the spark is off.dot_flamelet_ch4_hx: its gradient comes from a 10-iteration adjoint, whose transient the PV Jacobian changes by about 1%. The new reference is in Update dot_flamelet_ch4_hx gradient reference for SU2#3025 TestCases#218.Related Work
of_grad.csv.reffordot_flamelet_ch4_hx.SU2_MONchanges that were in this branch are now in SU2_MON: plot inner iterations of unsteady runs #3051.PR Checklist
pre-commit run --allto format old commits.🤖 Generated with Claude Code