Skip to content

Conversation

@Cristopher-Morales
Copy link
Contributor

@Cristopher-Morales Cristopher-Morales commented Dec 12, 2025

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.
  • My contribution generates no new compiler warnings (try with --warnlevel=3 when using meson).
  • 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 Cristopher-Morales changed the title Adding ENERGY in CPrimitiveIndices to get index of energy equation [WIP] Adding ENERGY in CPrimitiveIndices to get index of energy equation Dec 12, 2025
Comment on lines +127 to +129
nameToIndex["ENERGY"] = idx.Velocity() + 3;
} else {
nameToIndex["ENERGY"] = idx.Velocity() + 2;
Copy link
Member

Choose a reason for hiding this comment

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

energy is not stored in the primitive variables

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi!

Thank you for your comment!

Yes, It is not stored.

What we were discussing in the morning was about how the energy solution index should be obtained without having to know that the temperature is the one that matches the index. In the python wrapper case mentioned, the index was called using "TEMPERATURE", is there a way of defining indexes for the solution and used like "ENERGY_SOLUTION"?

I would really appreciate any suggestion/advice about this

Thank you so much!!

Copy link
Member

Choose a reason for hiding this comment

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

We should define "solution" or "conservative" indices instead of aliasing the ones in primitives.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for suggestion!!

@bigfooted
Copy link
Contributor

So we introduce cSolutionIndices?

@Cristopher-Morales
Copy link
Contributor Author

Hi!

I am going to close this pull request because the pull request #2652 addresses the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants