Skip to content

Commit b0e3769

Browse files
imposing temperature when energy equation is switched off
1 parent c874b02 commit b0e3769

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

SU2_CFD/include/variables/CIncEulerVariable.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ class CIncEulerVariable : public CFlowVariable {
7272
VectorType Streamwise_Periodic_RecoveredPressure, /*!< \brief Recovered/Physical pressure [Pa] for streamwise periodic flow. */
7373
Streamwise_Periodic_RecoveredTemperature; /*!< \brief Recovered/Physical temperature [K] for streamwise periodic flow. */
7474
su2double TemperatureLimits[2]; /*!< \brief Temperature limits [K]. */
75+
su2double TemperatureInc = 0.0; /*!< \brief Temperature [K] imposed when energy equation is switch off. */
76+
bool Energy; /*!< \brief Flag for Energy equation in incompressible flows. */
7577
public:
7678
/*!
7779
* \brief Constructor of the class.

SU2_CFD/src/variables/CIncNSVariable.cpp

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ CIncNSVariable::CIncNSVariable(su2double pressure, const su2double *velocity, su
4646
AuxVar.resize(nPoint,nAuxVar) = su2double(0.0);
4747
Grad_AuxVar.resize(nPoint,nAuxVar,nDim);
4848
}
49+
Energy = config->GetEnergy_Equation();
50+
if(!Energy) TemperatureInc = config->GetInc_Temperature_Init();
4951
}
5052

5153
bool CIncNSVariable::SetPrimVar(unsigned long iPoint, su2double eddy_visc, su2double turb_ke, CFluidModel *FluidModel, const su2double *scalar) {
@@ -58,9 +60,19 @@ bool CIncNSVariable::SetPrimVar(unsigned long iPoint, su2double eddy_visc, su2do
5860

5961
SetPressure(iPoint);
6062

61-
Enthalpy = Solution(iPoint, nDim + 1);
62-
FluidModel->SetTDState_h(Enthalpy, scalar);
63-
Temperature = FluidModel->GetTemperature();
63+
if (Energy) {
64+
Enthalpy = Solution(iPoint, nDim + 1);
65+
FluidModel->SetTDState_h(Enthalpy, scalar);
66+
Temperature = FluidModel->GetTemperature();
67+
} 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();
74+
Temperature = FluidModel->GetTemperature();
75+
}
6476
auto check_temp = SetTemperature(iPoint, Temperature, TemperatureLimits);
6577

6678
/*--- Set the value of the density ---*/

0 commit comments

Comments
 (0)