Skip to content

Commit 3ac3d64

Browse files
committed
use enthalpy for computing temperature also when energy is off
1 parent ae9d43f commit 3ac3d64

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

SU2_CFD/src/variables/CIncNSVariable.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,10 @@ bool CIncNSVariable::SetPrimVar(unsigned long iPoint, su2double eddy_visc, su2do
6565
FluidModel->SetTDState_h(Enthalpy, scalar);
6666
Temperature = FluidModel->GetTemperature();
6767
} else {
68-
/*--- When energy equation is switch off, a constant temperature is imposed, and enthalpy is recomputed based on
69-
* this temperature. As in the fluid flamelet model, the temperature is retrieved from a look-up table, then the
70-
* temperature is obtained directly from the fluidmodel. For the other fluid models, GetTemperature provides the
71-
* same value as TemperatureInc ---*/
72-
FluidModel->SetTDState_T(TemperatureInc, scalar);
73-
Enthalpy = Solution(iPoint, nDim + 1) = FluidModel->GetEnthalpy();
68+
/*--- When energy equation is switched off, use enthalpy from solution to compute temperature.
69+
* This allows Python wrapper updates to enthalpy to correctly update the density. ---*/
70+
Enthalpy = Solution(iPoint, nDim + 1);
71+
FluidModel->SetTDState_h(Enthalpy, scalar);
7472
Temperature = FluidModel->GetTemperature();
7573
}
7674
auto check_temp = SetTemperature(iPoint, Temperature, TemperatureLimits);

0 commit comments

Comments
 (0)