51 Gas_Constant = val_gas_constant;
54 Std_Ref_Temp_ND = val_Temperature_Ref;
62 for (
int i = 0; i < N; ++i) {
80 Enthalpy = coeffs_[0] * (t - Std_Ref_Temp_ND);
83 for (
int i = 1; i < N; ++i) {
85 tref_i *= Std_Ref_Temp_ND;
86 Cp += coeffs_[i] * t_i;
87 Enthalpy += coeffs_[i] * (t_i * t - tref_i * Std_Ref_Temp_ND) / (i + 1);
104 const int counter_limit = 20;
109 while ((
abs(delta_temp_iter) > toll) && (counter++ < counter_limit)) {
111 Cp_iter = coeffs_[0];
112 su2double Enthalpy_iter = coeffs_[0] * (temp_iter - Std_Ref_Temp_ND);
115 for (
int i = 1; i < N; ++i) {
117 tref_i *= Std_Ref_Temp_ND;
118 Cp_iter += coeffs_[i] * t_i;
119 Enthalpy_iter += coeffs_[i] * (t_i * temp_iter - tref_i * Std_Ref_Temp_ND) / (i + 1);
122 delta_enthalpy_iter =
Enthalpy - Enthalpy_iter;
124 delta_temp_iter = delta_enthalpy_iter / Cp_iter;
126 temp_iter += delta_temp_iter;
127 if (temp_iter < Temperature_Min) {
128 cout <<
"Warning: Negative temperature has been found during Newton-Raphson." << endl;
129 temp_iter = Temperature_Min;
136 if (counter == counter_limit) {
137 cout <<
"Warning: Newton-Raphson exceeds max. iterations in temperature computation." << endl;
147 array<su2double, N> coeffs_;
Defines the main fluid model class for thermophysical properties.
Main class for defining the problem; basically this class reads the configuration file,...
Definition CConfig.hpp:64
su2double GetCp_PolyCoeffND(unsigned short val_index) const
Get the temperature polynomial coefficient for specific heat Cp.
Definition CConfig.hpp:4288
su2double GetTemperatureLimits(int iVar) const
Get Temperature limits for incompressible flows.
Definition CConfig.hpp:2277
Main class for defining the Thermo-Physical Model.
Definition CFluidModel.hpp:47
su2double Cp
Specific Heat Capacity at constant pressure.
Definition CFluidModel.hpp:64
su2double Temperature
Temperature.
Definition CFluidModel.hpp:55
su2double Cv
Specific Heat Capacity at constant volume.
Definition CFluidModel.hpp:65
su2double Enthalpy
Enthalpy.
Definition CFluidModel.hpp:50
su2double Pressure
Pressure.
Definition CFluidModel.hpp:53
su2double Density
Density.
Definition CFluidModel.hpp:52
Child class for defining a custom incompressible ideal gas model.
Definition CIncIdealGasPolynomial.hpp:40
void SetCpModel(const CConfig *config, su2double val_Temperature_Ref) override
Set the temperature polynomial coefficients for variable Cp.
Definition CIncIdealGasPolynomial.hpp:61
void SetTDState_T(su2double t, const su2double *val_scalars=nullptr) override
Set the Dimensionless State using Temperature.
Definition CIncIdealGasPolynomial.hpp:73
CIncIdealGasPolynomial(su2double val_gas_constant, su2double val_operating_pressure, su2double val_Temperature_Ref)
Constructor of the class.
Definition CIncIdealGasPolynomial.hpp:45
void SetTDState_h(su2double val_enthalpy, const su2double *val_scalars=nullptr) override
Set the Dimensionless State using enthalpy.
Definition CIncIdealGasPolynomial.hpp:96
passivedouble su2double
Definition code_config.hpp:181
FORCEINLINE ARRAY_T abs(const ARRAY_T &x)
Definition special_vectorization.hpp:117