Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions SU2_CFD/include/variables/CPrimitiveIndices.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ std::map<std::string, IndexType> PrimitiveNameToIndexMap(const CPrimitiveIndices
nameToIndex["VELOCITY_Y"] = idx.Velocity() + 1;
if (idx.NDim() == 3) {
nameToIndex["VELOCITY_Z"] = idx.Velocity() + 2;
nameToIndex["ENERGY"] = idx.Velocity() + 3;
} else {
nameToIndex["ENERGY"] = idx.Velocity() + 2;
Comment on lines +127 to +129
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!!

}
for (IndexType iSpecies = 0; iSpecies < idx.NSpecies(); ++iSpecies) {
nameToIndex["DENSITY_" + std::to_string(iSpecies)] = idx.SpeciesDensities() + iSpecies;
Expand Down
6 changes: 3 additions & 3 deletions TestCases/py_wrapper/turbulent_premixed_psi/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ def update_temperature(SU2Driver, iPoint):
iCp = primindex.get("CP_TOTAL")
Cp = SU2Driver.Primitives()(iPoint,iCp)
# get solution index for energy equation
iTEMP = solindex.get("TEMPERATURE")
# set enthalpy, for Ideal Gas model, enthalpy is Cp*T
SU2Driver.Solution(iFLOWSOLVER).Set(iPoint,iTEMP,Cp*T)
iEnergy = solindex.get("ENERGY")
# set solution in energy equation, for Ideal Gas model, enthalpy is Cp*T
SU2Driver.Solution(iFLOWSOLVER).Set(iPoint,iEnergy,Cp*T)


# ################################################################## #
Expand Down
Loading