SU2 icon indicating copy to clipboard operation
SU2 copied to clipboard

[WIP] Adding ENERGY in CPrimitiveIndices to get index of energy equation

Open Cristopher-Morales opened this issue 1 month ago • 1 comments

Proposed Changes

with @bigfooted , we were discussing about getting the index of the energy equation in order to overwrite the solution independent of the variable that is being actually solved. For Incompressible is the temperature, with pull request #2426 , the enthalpy is going to be solved, and for compressible solvers the total energy is solved. However, if a user would like to overwrite the energy solution in the compressible solver, it might encounter an issue in identifying the index of the Total energy, that user would probably have to do something like:

# get solution index for energy equation
    iEnergy = solindex.get("PRESSURE")

because pressure has index nDim+1 in the primitives, which also corresponds to the index of the energy in the solution vector. The turbulent_premixed_psi test case using the python wrapper for incompressible flows is a good example of this.

with this pull request we aim to make this distinction between the index of primitives and the index of the solution, in particular, the index of the energy equation.

Obviously, a better solution to this could be implemented.

Related Work

related with pull request #2426

PR Checklist

Put an X by all that apply. You can fill this out after submitting the PR. If you have any questions, don't hesitate to ask! We want to help. These are a guide for you to know what the reviewers will be looking for in your contribution.

  • [ 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/).
  • [ ] I used the pre-commit hook to prevent dirty commits and used pre-commit run --all to format old commits.
  • [ ] I have added a test case that demonstrates my contribution, if necessary.
  • [ ] I have updated appropriate documentation (Tutorials, Docs Page, config_template.cpp), if necessary.

Cristopher-Morales avatar Dec 12 '25 13:12 Cristopher-Morales

So we introduce cSolutionIndices?

bigfooted avatar Dec 13 '25 08:12 bigfooted