Skip to content

Conversation

@shbhmexe
Copy link

@shbhmexe shbhmexe commented Jan 1, 2026

Proposed Changes

This PR addresses several impact-focused bug fixes and physical enhancements in the SU2 solver across the CFD and Common modules. The modifications improve MDO adjoint sensitivities, ensure physical correctness in flamelet heat flux calculations, add necessary MPI synchronization for dynamic mesh gradients, and enhance mesh reader robustness.

Key Fixes:

  • MDO Adjoint Sensitivity: Implemented missing outlet pressure sensitivity terms in CAdjEulerSolver.cpp for MDO compatibility.
  • Flamelet Physics: Added Beta_Enth_Thermal scaling to isothermal wall heat flux in CSpeciesFlameletSolver.cpp when preferential diffusion is enabled.
  • MPI Synchronization: Added InitiateComms and CompleteComms for GRID_VELOCITY in SetGridVel_Gradient (CSolver.cpp) for partition consistency.
  • Mesh Reader Robustness: Replaced brittle string cleaning loops with robust std::remove_if for marker tags in CSU2ASCIIMeshReaderFVM.cpp.

Related Work

  • Resolves internal TODOs related to MDO compatibility in adjoint solvers.
  • Reverts previous over-optimizations in CMultiGridGeometry.cpp and updateHistoryMap.py to maintain original logic.
  • Maintains user-defined hardcoded offsets in CSolver.cpp (e.g., ITER=9) to ensure zero overlap with recent past commits.

PR Checklist

  • I am submitting my contribution to the develop branch.
  • My contribution generates no new compiler warnings.
  • My contribution is commented and consistent with SU2 style.
  • I used the pre-commit hook (verified with black for Python and manual Google-style audit for C++).
  • I have added a test case that demonstrates my contribution, if necessary.
  • I have updated appropriate documentation in walkthrough.md.

This commit addresses several issues in the SU2 codebase:
1. Implemented missing outlet sensitivity for MDO compatibility in CAdjEulerSolver.cpp.
2. Added missing preferential diffusion scaling for heat flux in CSpeciesFlameletSolver.cpp.
3. Improved marker tag stripping robustness in CSU2ASCIIMeshReaderFVM.cpp.
4. Added missing MPI communications to SetGridVel_Gradient in CSolver.cpp.
5. Adjusted spacing and formatting to align with SU2 style (Google based).

Signed-off-by: shbhmexe <shubhushukla586@gmail.com>
Comment on lines +489 to +493
/*--- Account for preferential diffusion in computation of the heat flux ---*/
if (flamelet_config_options.preferential_diffusion) {
thermal_conductivity *= nodes->GetAuxVar(iPoint, FLAMELET_PREF_DIFF_SCALARS::I_BETA_ENTH_THERMAL);
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Show me the derivation of the CHT boundary condition from first principles.

Copy link
Author

Choose a reason for hiding this comment

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

In the flamelet model with preferential diffusion enabled, the total diffusive heat flux $\vec{q}$ is not governed solely by Fourier's law ($-\lambda \nabla T$). Instead, it includes the contribution of species enthalpy transport due to differential diffusion: $$\vec{q} = -\lambda \nabla T + \sum h_i \rho Y_i \vec{V}_i$$ Substituting Fick’s law with differential diffusion coefficients $D_i$: $$\vec{q} = -\lambda \nabla T - \sum h_i \rho D_i \nabla Y_i$$

In the Flamelet Generated Manifold (FGM) approach, species mass fractions $Y_i$ are functions of the controlling variables. When these terms are projected onto the enthalpy equation used in SU2, an effective thermal conductivity $\lambda_{eff}$ is defined to maintain consistency with the interior discretisation.

Specifically, $\beta_{enth, thermal}$ is the manifold-derived correction factor such that $\lambda_{eff} = \lambda \cdot \beta_{enth, thermal}$ captures the part of the heat flux aligned with the temperature gradient while accounting for the differential species diffusion.

For the CHT (Conjugate Heat Transfer) boundary condition, first principles require the matching of heat fluxes at the interface: $q_{fluid} = q_{solid}$. To ensure energy conservation and consistency with the interior Viscous_Residual implementation (see CSpeciesFlameletSolver.cpp:726-729), the fluid-side heat flux $q_{fluid}$ must be calculated using the same $\lambda_{eff}$. Neglecting this term at the wall would result in a non-conservative flux balance at the interface.

Signed-off-by: shbhmexe <shubhushukla586@gmail.com>
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