[WIP] Adding ENERGY in CPrimitiveIndices to get index of energy equation #2645
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
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:
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.
pre-commit run --allto format old commits.