Documentation 6b54b78464
Loading...
Searching...
No Matches
CNEMOGas.hpp
Go to the documentation of this file.
1/*!
2 * \file CNEMOGas.hpp
3 * \brief Defines the nonequilibrium gas model.
4 * \author C. Garbacz, W. Maier, S. R. Copeland
5 * \version 8.5.0 "Harrier"
6 *
7 * SU2 Project Website: https://su2code.github.io
8 *
9 * The SU2 Project is maintained by the SU2 Foundation
10 * (http://su2foundation.org)
11 *
12 * Copyright 2012-2026, SU2 Contributors (cf. AUTHORS.md)
13 *
14 * SU2 is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Lesser General Public
16 * License as published by the Free Software Foundation; either
17 * version 2.1 of the License, or (at your option) any later version.
18 *
19 * SU2 is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Lesser General Public License for more details.
23 *
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with SU2. If not, see <http://www.gnu.org/licenses/>.
26 */
27
28#pragma once
29
30#include "CFluidModel.hpp"
31#include "../../../Common/include/option_structure.hpp"
32
33/*!
34 * \class CNEMOGas
35 * \brief Class for defining the 2T (trans-rotational and vibro-electronic) nonequilibrium gas model.
36 * \author: C. Garbacz, W. Maier, S. R. Copeland
37 */
38class CNEMOGas : public CFluidModel {
39
40protected:
41
42 bool frozen, /*!< \brief Indicates if mixture is frozen. */
43 ionization; /*!< \brief Presence of charged species in gas mixture. */
44
45 string gas_model; /*!< \brief String gas model. */
46
47 unsigned short nSpecies, /*!< \brief Number of species in the gas mixture. */
48 nHeavy, /*!< \brief Number of heavy particles in gas */
49 nEl, /*!< \brief Number of electrons in gas */
50 nDim, /*!< \brief Number of dimensions. */
51 nEnergyEq = 2; /*!< \brief Number of energy equations for the 2T model. */
52 TRANSCOEFFMODEL Kind_TransCoeffModel; /*!< \brief Transport coefficients model for NEMO solver. */
53
54 unsigned iSpecies, /*!< \brief Common iteration counter for species */
55 jSpecies, /*!< \brief Common iteration counter for species */
56 iDim; /*!< \brief Common iteration counter for dimensions */
57
58 su2double gamma{0.0}; /*!< \brief Specific heat ratio. */
59 su2double omega{0.0}; /*!< \brief Vibrational energy source term */
60 su2double T{0.0}; /*!< \brief Translational temperature. */
61 su2double Tve{0.0}; /*!< \brief Vibrational temperature. */
62 su2double ThermalCond_tr{0.0}; /*!< \brief T-R thermal conductivity of the gas mixture. */
63 su2double ThermalCond_ve{0.0}; /*!< \brief V-E thermal conductivity of the gas mixture. */
64 su2double RuSI{UNIVERSAL_GAS_CONSTANT};/*!< \brief Universal gas constant [J/(mol*K)] */
65 su2double Ru{1000.0*RuSI}; /*!< \brief Universal gas constant [J/(kmol*K)] */
66 su2double GasConstant{0.0}; /*!< \brief Universal gas constant [J/(kmol*K)] */
67 su2double rhoCvtr{0.0}; /*!< \brief density times T-R specific heat */
68 su2double rhoCvve{0.0}; /*!< \brief density times V-E specific heat */
69
70 vector<su2double> MolarMass, /*!< \brief Species molar mass */
71 MassFrac, /*!< \brief Species mass fractions */
72 rhos, /*!< \brief Species partial densities */
73 Cvtrs, /*!< \brief Species T-R specific heats at constant volume */
74 Cvves, /*!< \brief Species V-E specific heats at constant volume */
75 energies, /*!< \brief Mixture energies (total internal energy and vibrational energy) */
76 eves, /*!< \brief Vector of species total internal and V-E energies (dimension 2 * nSpecies)*/
77 temperatures, /*!< \brief translational and vibrational temperatures vector */
78 ThermalConductivities, /*!< \brief T-R and V-E Thermal conductivities vector*/
79 hs, /*!< \brief Species enthalpies */
80 MolarFractions, /*!< \brief Species molar fractions */
81 ws, /*!< \brief Species net production rates */
82 taus, /*!< \brief Relaxtion time scales */
83 DiffusionCoeff, /*!< \brief Species diffusion coefficients*/
84 Enthalpy_Formation, /*!< \brief Enthalpy of formation */
85 Ref_Temperature; /*!< \brief Reference temperature for thermodynamic relations */
86
87 su2matrix<int> CatRecombTable; /*!< \brief Table for catalytic wall recombination pairs. */
88
89public:
90
91 /*!
92 * \brief Constructor of the class.
93 */
94 CNEMOGas(const CConfig* config, unsigned short val_nDim);
95
96 /*!
97 * \brief Set mixture thermodynamic state.
98 * \param[in] rhos - Species partial densities.
99 * \param[in] T - Translational/Rotational temperature.
100 * \param[in] Tve - Vibrational/Electronic temperature.
101 */
102 virtual void SetTDStateRhosTTv(vector<su2double>& val_rhos, su2double val_temperature, su2double val_temperature_ve){}
103
104 /*!
105 * \brief Set mixture thermodynamic state.
106 * \param[in] P - Pressure.
107 * \param[in] Ms - Mass fractions of the gas.
108 * \param[in] T - Translational/Rotational temperature.
109 * \param[in] Tve - Vibrational/Electronic temperature.
110 */
111 void SetTDStatePTTv(su2double P, const su2double *val_massfrac, su2double val_temperature, su2double val_temperature_ve);
112
113 /*!
114 * \brief Get species T-R specific heats at constant volume.
115 */
116 virtual const vector<su2double>& GetSpeciesCvTraRot() = 0;
117
118 /*!
119 * \brief Compute species V-E specific heats at constant volume.
120 */
121 virtual vector<su2double>& ComputeSpeciesCvVibEle(su2double val_T) = 0;
122
123 /*!
124 * \brief Compute mixture energies (total internal energy and vibrational energy).
125 */
126 virtual vector<su2double>& ComputeMixtureEnergies() = 0;
127
128 /*!
129 * \brief Compute species net production rates.
130 */
131 virtual vector<su2double>& ComputeNetProductionRates(bool implicit, const su2double *V, const su2double* eve,
132 const su2double* cvve, const su2double* dTdU, const su2double* dTvedU,
133 su2double **val_jacobian) = 0;
134
135 /*!
136 * \brief Populate chemical source term jacobian.
137 */
138 virtual void ChemistryJacobian(unsigned short iReaction, const su2double *V, const su2double* eve,
139 const su2double* cvve, const su2double* dTdU, const su2double* dTvedU,
140 su2double **val_jacobian){};
141
142 /*!
143 * \brief Compute vibrational energy source term.
144 */
145 virtual su2double ComputeEveSourceTerm() { return 0; }
146
147 /*!
148 * \brief Compute vibration enery source term jacobian.
149 */
150 virtual void GetEveSourceTermJacobian(const su2double *V, const su2double *eve, const su2double *cvve,
151 const su2double *dTdU, const su2double* dTvedU,
152 su2double **val_jacobian){};
153
154 /*!
155 * \brief Compute vector of species V-E energy.
156 */
157 virtual vector<su2double>& ComputeSpeciesEve(su2double val_T, bool vibe_only = false) = 0;
158
159 /*!
160 * \brief Compute species enthalpies.
161 */
162 virtual vector<su2double>& ComputeSpeciesEnthalpy(su2double val_T, su2double val_Tve, su2double *val_eves) = 0;
163
164 /*!
165 * \brief Get species diffusion coefficients.
166 */
167 virtual vector<su2double>& GetDiffusionCoeff() = 0;
168
169 /*!
170 * \brief Get viscosity.
171 */
172 virtual su2double GetViscosity() { return 0; }
173
174 /*!
175 * \brief Get T-R and V-E thermal conductivities vector.
176 */
177 virtual vector<su2double>& GetThermalConductivities() = 0;
178
179 /*!
180 * \brief Compute translational and vibrational temperatures vector.
181 */
182 virtual vector<su2double>& ComputeTemperatures(vector<su2double>& val_rhos, su2double rhoEmix, su2double rhoEve, su2double rhoEvel, su2double Tve_old) = 0;
183
184 /*!
185 * \brief Compute speed of sound.
186 */
188
189 /*!
190 * \brief Compute pressure.
191 */
193
194 /*!
195 * \brief Compute gas constant.
196 */
198
199 /*!
200 * \brief Compute ratio of specific heats (Gamma).
201 */
203
204 /*!
205 * \brief Compute derivative of pressure w.r.t. conservative variables.
206 */
207 void ComputedPdU(const su2double *V, const vector<su2double>& val_eves, su2double *val_dPdU);
208
209 /*!
210 * \brief Compute derivative of temperature w.r.t. conservative variables.
211 */
212 void ComputedTdU(const su2double *V, su2double *val_dTdU);
213
214 /*!
215 * \brief Compute derivative of vibrational temperature w.r.t. conservative variables.
216 */
217 void ComputedTvedU(const su2double *V, const vector<su2double>& val_eves, su2double *val_dTvedU);
218
219 /*!
220 * \brief Set the translational temperature.
221 */
222 inline void SetT(su2double val_temperature) { T = val_temperature; }
223
224 /*!
225 * \brief Set the vibrational temperature.
226 */
227 inline void SetTve(su2double val_temperature_ve) { Tve = val_temperature_ve; }
228
229 /*!
230 * \brief Set species vibrational energies.
231 */
232 inline void SetEves(vector<su2double>& val_eves) { eves = val_eves; }
233
234 /*!
235 * \brief Compute rhoCvtr.
236 */
238 rhoCvtr = 0.0;
239 for (iSpecies = 0; iSpecies < nHeavy; iSpecies++)
241 return rhoCvtr;
242 }
243
244 /*!
245 * \brief Compute rhoCvve.
246 */
248
249 /*!
250 * \brief Get species molar mass.
251 */
252 virtual const vector<su2double>& GetSpeciesMolarMass() = 0;
253
254 /*!
255 * \brief Get reference temperature.
256 */
257 virtual const vector<su2double>& GetRefTemperature() = 0;
258
259 /*!
260 * \brief Get species formation enthalpy.
261 */
262 virtual const vector<su2double>& GetSpeciesFormationEnthalpy() = 0;
263
264 /*!
265 * \brief Get catalytic wall recombination indices and constants.
266 */
268
269};
Defines the main fluid model class for thermophysical properties.
A templated matrix/vector-like object.
Definition C2DContainer.hpp:374
Main class for defining the problem; basically this class reads the configuration file,...
Definition CConfig.hpp:64
Main class for defining the Thermo-Physical Model.
Definition CFluidModel.hpp:47
Class for defining the 2T (trans-rotational and vibro-electronic) nonequilibrium gas model.
Definition CNEMOGas.hpp:38
vector< su2double > taus
Relaxtion time scales.
Definition CNEMOGas.hpp:82
void SetT(su2double val_temperature)
Set the translational temperature.
Definition CNEMOGas.hpp:222
su2double Tve
Vibrational temperature.
Definition CNEMOGas.hpp:61
unsigned short nEnergyEq
Number of energy equations for the 2T model.
Definition CNEMOGas.hpp:51
su2double rhoCvtr
density times T-R specific heat
Definition CNEMOGas.hpp:67
su2matrix< int > CatRecombTable
Table for catalytic wall recombination pairs.
Definition CNEMOGas.hpp:87
virtual su2double GetViscosity()
Get viscosity.
Definition CNEMOGas.hpp:172
virtual void SetTDStateRhosTTv(vector< su2double > &val_rhos, su2double val_temperature, su2double val_temperature_ve)
Set mixture thermodynamic state.
Definition CNEMOGas.hpp:102
vector< su2double > MolarFractions
Species molar fractions.
Definition CNEMOGas.hpp:80
su2double ComputePressure()
Compute pressure.
Definition CNEMOGas.cpp:103
unsigned short nHeavy
Number of heavy particles in gas.
Definition CNEMOGas.hpp:48
unsigned short nSpecies
Number of species in the gas mixture.
Definition CNEMOGas.hpp:47
virtual vector< su2double > & ComputeMixtureEnergies()=0
Compute mixture energies (total internal energy and vibrational energy).
vector< su2double > MolarMass
Species molar mass.
Definition CNEMOGas.hpp:70
virtual vector< su2double > & GetThermalConductivities()=0
Get T-R and V-E thermal conductivities vector.
unsigned short nEl
Number of electrons in gas.
Definition CNEMOGas.hpp:49
virtual vector< su2double > & ComputeSpeciesEnthalpy(su2double val_T, su2double val_Tve, su2double *val_eves)=0
Compute species enthalpies.
su2double ComputeGasConstant()
Compute gas constant.
Definition CNEMOGas.cpp:118
su2double Ru
Universal gas constant [J/(kmol*K)].
Definition CNEMOGas.hpp:65
su2double omega
Vibrational energy source term.
Definition CNEMOGas.hpp:59
void ComputedPdU(const su2double *V, const vector< su2double > &val_eves, su2double *val_dPdU)
Compute derivative of pressure w.r.t. conservative variables.
Definition CNEMOGas.cpp:156
void SetEves(vector< su2double > &val_eves)
Set species vibrational energies.
Definition CNEMOGas.hpp:232
virtual vector< su2double > & ComputeNetProductionRates(bool implicit, const su2double *V, const su2double *eve, const su2double *cvve, const su2double *dTdU, const su2double *dTvedU, su2double **val_jacobian)=0
Compute species net production rates.
vector< su2double > eves
Vector of species total internal and V-E energies (dimension 2 * nSpecies)
Definition CNEMOGas.hpp:76
virtual vector< su2double > & GetDiffusionCoeff()=0
Get species diffusion coefficients.
vector< su2double > Cvtrs
Species T-R specific heats at constant volume.
Definition CNEMOGas.hpp:73
void SetTve(su2double val_temperature_ve)
Set the vibrational temperature.
Definition CNEMOGas.hpp:227
void ComputedTvedU(const su2double *V, const vector< su2double > &val_eves, su2double *val_dTvedU)
Compute derivative of vibrational temperature w.r.t. conservative variables.
Definition CNEMOGas.cpp:273
unsigned jSpecies
Common iteration counter for species.
Definition CNEMOGas.hpp:55
unsigned short nDim
Number of dimensions.
Definition CNEMOGas.hpp:50
void ComputedTdU(const su2double *V, su2double *val_dTdU)
Compute derivative of temperature w.r.t. conservative variables.
Definition CNEMOGas.cpp:239
vector< su2double > rhos
Species partial densities.
Definition CNEMOGas.hpp:72
su2double ComputeGamma()
Compute ratio of specific heats (Gamma).
Definition CNEMOGas.cpp:129
void SetTDStatePTTv(su2double P, const su2double *val_massfrac, su2double val_temperature, su2double val_temperature_ve)
Set mixture thermodynamic state.
Definition CNEMOGas.cpp:59
virtual const vector< su2double > & GetSpeciesCvTraRot()=0
Get species T-R specific heats at constant volume.
vector< su2double > temperatures
translational and vibrational temperatures vector
Definition CNEMOGas.hpp:77
vector< su2double > hs
Species enthalpies.
Definition CNEMOGas.hpp:79
vector< su2double > DiffusionCoeff
Species diffusion coefficients.
Definition CNEMOGas.hpp:83
virtual void ChemistryJacobian(unsigned short iReaction, const su2double *V, const su2double *eve, const su2double *cvve, const su2double *dTdU, const su2double *dTvedU, su2double **val_jacobian)
Populate chemical source term jacobian.
Definition CNEMOGas.hpp:138
const su2matrix< int > & GetCatalyticRecombination() const
Get catalytic wall recombination indices and constants.
Definition CNEMOGas.hpp:267
vector< su2double > MassFrac
Species mass fractions.
Definition CNEMOGas.hpp:71
su2double ThermalCond_ve
V-E thermal conductivity of the gas mixture.
Definition CNEMOGas.hpp:63
su2double RuSI
Universal gas constant [J/(mol*K)].
Definition CNEMOGas.hpp:64
virtual const vector< su2double > & GetSpeciesMolarMass()=0
Get species molar mass.
su2double ComputerhoCvtr()
Compute rhoCvtr.
Definition CNEMOGas.hpp:237
virtual vector< su2double > & ComputeSpeciesEve(su2double val_T, bool vibe_only=false)=0
Compute vector of species V-E energy.
vector< su2double > Cvves
Species V-E specific heats at constant volume.
Definition CNEMOGas.hpp:74
bool ionization
Presence of charged species in gas mixture.
Definition CNEMOGas.hpp:43
su2double ComputeSoundSpeed()
Compute speed of sound.
Definition CNEMOGas.cpp:83
virtual const vector< su2double > & GetSpeciesFormationEnthalpy()=0
Get species formation enthalpy.
su2double gamma
Specific heat ratio.
Definition CNEMOGas.hpp:58
vector< su2double > energies
Mixture energies (total internal energy and vibrational energy)
Definition CNEMOGas.hpp:75
vector< su2double > Enthalpy_Formation
Enthalpy of formation.
Definition CNEMOGas.hpp:84
string gas_model
String gas model.
Definition CNEMOGas.hpp:45
virtual void GetEveSourceTermJacobian(const su2double *V, const su2double *eve, const su2double *cvve, const su2double *dTdU, const su2double *dTvedU, su2double **val_jacobian)
Compute vibration enery source term jacobian.
Definition CNEMOGas.hpp:150
su2double T
Translational temperature.
Definition CNEMOGas.hpp:60
unsigned iSpecies
Common iteration counter for species.
Definition CNEMOGas.hpp:54
vector< su2double > Ref_Temperature
Reference temperature for thermodynamic relations.
Definition CNEMOGas.hpp:85
virtual const vector< su2double > & GetRefTemperature()=0
Get reference temperature.
unsigned iDim
Common iteration counter for dimensions.
Definition CNEMOGas.hpp:56
virtual su2double ComputeEveSourceTerm()
Compute vibrational energy source term.
Definition CNEMOGas.hpp:145
su2double rhoCvve
density times V-E specific heat
Definition CNEMOGas.hpp:68
su2double ThermalCond_tr
T-R thermal conductivity of the gas mixture.
Definition CNEMOGas.hpp:62
virtual vector< su2double > & ComputeTemperatures(vector< su2double > &val_rhos, su2double rhoEmix, su2double rhoEve, su2double rhoEvel, su2double Tve_old)=0
Compute translational and vibrational temperatures vector.
su2double GasConstant
Universal gas constant [J/(kmol*K)].
Definition CNEMOGas.hpp:66
vector< su2double > ws
Species net production rates.
Definition CNEMOGas.hpp:81
TRANSCOEFFMODEL Kind_TransCoeffModel
Transport coefficients model for NEMO solver.
Definition CNEMOGas.hpp:52
su2double ComputerhoCvve()
Compute rhoCvve.
Definition CNEMOGas.cpp:145
vector< su2double > ThermalConductivities
T-R and V-E Thermal conductivities vector.
Definition CNEMOGas.hpp:78
virtual vector< su2double > & ComputeSpeciesCvVibEle(su2double val_T)=0
Compute species V-E specific heats at constant volume.
bool frozen
Indicates if mixture is frozen.
Definition CNEMOGas.hpp:42
passivedouble su2double
Definition code_config.hpp:181
TRANSCOEFFMODEL
types of coefficient transport model
Definition option_structure.hpp:713
@ V
Menter k-w SST model with vorticity production terms.
constexpr passivedouble UNIVERSAL_GAS_CONSTANT
Universal gas constant in J/(mol*K)
Definition option_structure.hpp:95