Skip to content

Commit 96e45a2

Browse files
adding 'ENERGY' in CPrimitiveIndices to get index of energy equation
1 parent e27908e commit 96e45a2

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

SU2_CFD/include/variables/CPrimitiveIndices.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ std::map<std::string, IndexType> PrimitiveNameToIndexMap(const CPrimitiveIndices
124124
nameToIndex["VELOCITY_Y"] = idx.Velocity() + 1;
125125
if (idx.NDim() == 3) {
126126
nameToIndex["VELOCITY_Z"] = idx.Velocity() + 2;
127+
nameToIndex["ENERGY"] = idx.Velocity() + 3;
128+
} else {
129+
nameToIndex["ENERGY"] = idx.Velocity() + 2;
127130
}
128131
for (IndexType iSpecies = 0; iSpecies < idx.NSpecies(); ++iSpecies) {
129132
nameToIndex["DENSITY_" + std::to_string(iSpecies)] = idx.SpeciesDensities() + iSpecies;

TestCases/py_wrapper/turbulent_premixed_psi/run.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,10 @@ def update_temperature(SU2Driver, iPoint):
9595
iFLOWSOLVER = SU2Driver.GetSolverIndices()['INC.FLOW']
9696
# the list with names
9797
solindex = getsolvar(SU2Driver)
98-
iTEMP = solindex.get("TEMPERATURE")
99-
SU2Driver.Solution(iFLOWSOLVER).Set(iPoint,iTEMP,T)
98+
# get solution index for energy equation
99+
iEnergy = solindex.get("ENERGY")
100+
# set solution in energy equation
101+
SU2Driver.Solution(iFLOWSOLVER).Set(iPoint,iEnergy,T)
100102

101103

102104
# ################################################################## #

0 commit comments

Comments
 (0)