Skip to content

Commit 728cb8d

Browse files
authored
Merge pull request #1887 from su2code/feature_NEMO_visc_ion
Adding ionization capabilities for viscous simulations (NEMO)
2 parents 60e47b6 + 5a0ea92 commit 728cb8d

12 files changed

Lines changed: 522 additions & 369 deletions

File tree

Common/include/option_structure.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ const su2double STANDARD_GRAVITY = 9.80665; /*!< \brief Acceleration d
9494
const su2double UNIVERSAL_GAS_CONSTANT = 8.3144598; /*!< \brief Universal gas constant in J/(mol*K) */
9595
const su2double BOLTZMANN_CONSTANT = 1.3806503E-23; /*!< \brief Boltzmann's constant [J K^-1] */
9696
const su2double AVOGAD_CONSTANT = 6.0221415E26; /*!< \brief Avogadro's constant, number of particles in one kmole. */
97+
const su2double FUND_ELEC_CHARGE_CGS = 4.8032047E-10; /*!< \brief Fundamental electric charge in CGS units, cm^(3/2) g^(1/2) s^(-1). */
9798

9899
const su2double EPS = 1.0E-16; /*!< \brief Error scale. */
99100
const su2double TURB_EPS = 1.0E-16; /*!< \brief Turbulent Error scale. */

Common/src/CConfig.cpp

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3931,16 +3931,27 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
39313931
SU2_MPI::Error("Only STANDARD_AIR fluid model can be used with US Measurement System", CURRENT_FUNCTION);
39323932
}
39333933

3934-
if (Kind_FluidModel == SU2_NONEQ && (Kind_TransCoeffModel != TRANSCOEFFMODEL::WILKE && Kind_TransCoeffModel != TRANSCOEFFMODEL::SUTHERLAND) ) {
3935-
SU2_MPI::Error("Only WILKE and SUTHERLAND transport models are stable for the NEMO solver using SU2TClib. Use Mutation++ instead.", CURRENT_FUNCTION);
3934+
/* --- Check for NEMO compatibility issues ---*/
3935+
if (Kind_FluidModel == SU2_NONEQ && (Kind_TransCoeffModel != TRANSCOEFFMODEL::WILKE && Kind_TransCoeffModel != TRANSCOEFFMODEL::SUTHERLAND && Kind_TransCoeffModel != TRANSCOEFFMODEL::GUPTAYOS) ) {
3936+
SU2_MPI::Error("Transport model not available for NEMO solver using SU2TCLIB. Please use the WILKE, SUTHERLAND or GUPTAYOS transport model instead.", CURRENT_FUNCTION);
3937+
}
3938+
3939+
if (Kind_Solver == MAIN_SOLVER::NEMO_NAVIER_STOKES) {
3940+
if (Kind_FluidModel == SU2_NONEQ && GasModel == "AIR-7" && Kind_TransCoeffModel != TRANSCOEFFMODEL::GUPTAYOS) {
3941+
SU2_MPI::Error("Only Gupta-Yos transport model available for ionized flows using SU2TCLIB.", CURRENT_FUNCTION);
3942+
}
39363943
}
39373944

39383945
if (Kind_FluidModel == MUTATIONPP &&
39393946
(Kind_TransCoeffModel != TRANSCOEFFMODEL::WILKE && Kind_TransCoeffModel != TRANSCOEFFMODEL::CHAPMANN_ENSKOG)) {
3940-
SU2_MPI::Error("Only WILKE and Chapmann-Enskog transport model can be used with Mutation++ at the moment.",
3947+
SU2_MPI::Error("Transport model not available for NEMO solver using MUTATIONPP. Please use the WILKE or CHAPMANN_ENSKOG transport model instead..",
39413948
CURRENT_FUNCTION);
39423949
}
39433950

3951+
if (Kind_FluidModel == SU2_NONEQ && GasModel == "AIR-7" && nWall_Catalytic != 0) {
3952+
SU2_MPI::Error("Catalytic wall recombination is not yet available for ionized flows in SU2_NEMO.", CURRENT_FUNCTION);
3953+
}
3954+
39443955
if (!ideal_gas && !nemo) {
39453956
if (Kind_Upwind_Flow != UPWIND::ROE && Kind_Upwind_Flow != UPWIND::HLLC && Kind_Centered_Flow != CENTERED::JST) {
39463957
SU2_MPI::Error("Only ROE Upwind, HLLC Upwind scheme, and JST scheme can be used for Non-Ideal Compressible Fluids", CURRENT_FUNCTION);
@@ -6086,14 +6097,14 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) {
60866097
if (Kind_Regime == ENUM_REGIME::COMPRESSIBLE) cout << "Compressible two-temperature thermochemical non-equilibrium Euler equations." << endl;
60876098
if (Kind_FluidModel == SU2_NONEQ){
60886099
if ((GasModel != "N2") && (GasModel != "AIR-5") && (GasModel != "AIR-7") && (GasModel != "ARGON"))
6089-
SU2_MPI::Error("The GAS_MODEL given as input is not valid. Choose one of the options: N2, AIR-5, AIR-7, ARGON.", CURRENT_FUNCTION);
6100+
SU2_MPI::Error("The GAS_MODEL given is unavailable using CSU2TCLIB. Choose one of the options: N2, AIR-5, AIR-7, or ARGON.", CURRENT_FUNCTION);
60906101
}
60916102
break;
60926103
case MAIN_SOLVER::NEMO_NAVIER_STOKES:
60936104
if (Kind_Regime == ENUM_REGIME::COMPRESSIBLE) cout << "Compressible two-temperature thermochemical non-equilibrium Navier-Stokes equations." << endl;
60946105
if (Kind_FluidModel == SU2_NONEQ){
6095-
if ((GasModel != "N2") && (GasModel != "AIR-5") && (GasModel != "ARGON"))
6096-
SU2_MPI::Error("The GAS_MODEL given as input is not valid. Choose one of the options: N2, AIR-5, ARGON.", CURRENT_FUNCTION);
6106+
if ((GasModel != "N2") && (GasModel != "AIR-5") && (GasModel != "AIR-7") && (GasModel != "ARGON"))
6107+
SU2_MPI::Error("The GAS_MODEL given is unavailable using CSU2TCLIB. Choose one of the options: N2, AIR-5, AIR-7, or ARGON.", CURRENT_FUNCTION);
60976108
}
60986109
break;
60996110
case MAIN_SOLVER::FEM_LES:

SU2_CFD/include/fluid/CSU2TCLib.hpp

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,33 @@ class CSU2TCLib : public CNEMOGas {
7070
std::array<su2double,1> Sk_ref; /*!< \brief Vector containing Sutherland's constant for thermal conductivities */
7171

7272
const su2double T_ref_suth = 273.15; /*!<\brief Reference temperature for Sutherland's model [K] */
73+
74+
// Coulomb potential constant values source: Scalabrin, NUMERICAL SIMULATION OF WEAKLY IONIZED HYPERSONIC
75+
// FLOW OVER REENTRY CAPSULES, 2007.
76+
/*--- Attractive Coulombic potential constants ---*/
77+
const su2double D1_a = 0.784;
78+
const su2double C1_a = -0.476;
79+
const su2double c1_a = 0.0313;
80+
const su2double D2_a = 1.262;
81+
const su2double C2_a = -0.146;
82+
const su2double c2_a = 0.0377;
83+
84+
/*--- Repulsive Coulombic potential constants ---*/
85+
const su2double D1_r = 0.765;
86+
const su2double C1_r = 0.138;
87+
const su2double c1_r = 0.0106;
88+
const su2double D2_r = 1.235;
89+
const su2double C2_r = 0.157;
90+
const su2double c2_r = 0.0274;
7391

7492
su2activematrix CharElTemp, /*!< \brief Characteristic temperature of electron states. */
7593
ElDegeneracy, /*!< \brief Degeneracy of electron states. */
7694
RxnConstantTable, /*!< \brief Table of chemical equiibrium reaction constants */
7795
Blottner, /*!< \brief Blottner viscosity coefficients */
7896
Dij; /*!< \brief Binary diffusion coefficients. */
7997

80-
C3DDoubleMatrix Omega00, /*!< \brief Collision integrals (Omega(0,0)) */
81-
Omega11; /*!< \brief Collision integrals (Omega(1,1)) */
98+
C3DDoubleMatrix Omega11, /*!< \brief Collision integrals (Omega^(1,1)) */
99+
Omega22; /*!< \brief Collision integrals (Omega^(2,2)) */
82100

83101
/*--- Implicit variables ---*/
84102
su2double /*!< \brief Derivatives w.r.t. conservative variables */
@@ -249,6 +267,29 @@ class CSU2TCLib : public CNEMOGas {
249267
*/
250268
void ThermalConductivitiesSuth();
251269

270+
/*!
271+
*\brief Compute the collision terms (deltas)
272+
*\param[in] iSpecies - Species of gas
273+
*\param[in] jSpecies - Collision partner of species i
274+
*\param[in] Mi - Molar mass of species i
275+
*\param[in] Mj - Molar mass of species j
276+
*\param[in] T - Temperature of gas
277+
*\param[in] d1 - Whether delta_1 or delta_2 is computed
278+
*\param[out] Delta_1 or Delta_2 - Collision term between species i and j
279+
*/
280+
su2double ComputeCollisionDelta(unsigned iSpecies, unsigned jSpecies, su2double Mi, su2double Mj, su2double T, bool d1);
281+
282+
/*!
283+
*\brief Compute the collision cross section
284+
*\param[in] iSpecies - Species of gas
285+
*\param[in] jSpecies - Collision partner of species i
286+
*\param[in] T - Temperature of gas
287+
*\param[in] d1 - Whether omega^(1,1) or omega^(2,2)
288+
*\param[in] coulomb - Whether to use Coulomb potential
289+
*\param[out] Omega_ij - collision cross section
290+
*/
291+
su2double ComputeCollisionCrossSection(unsigned iSpecies, unsigned jSpecies, su2double T, bool d1, bool coulomb);
292+
252293
/*!
253294
* \brief Get reference temperature.
254295
*/

SU2_CFD/src/fluid/CMutationTCLib.cpp

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -58,43 +58,38 @@ CMutationTCLib::CMutationTCLib(const CConfig* config, unsigned short val_nDim):
5858
/* Initialize mixture object */
5959
mix.reset(new Mutation::Mixture(opt));
6060

61-
for(iSpecies = 0; iSpecies < nSpecies; iSpecies++) MolarMass[iSpecies] = 1000* mix->speciesMw(iSpecies); // x1000 to have Molar Mass in kg/kmol
62-
63-
if (mix->hasElectrons()) {
64-
if (config->GetViscous()) {
65-
SU2_MPI::Error("Ionization is not yet operational for a viscous flow in the NEMO solver.", CURRENT_FUNCTION);
66-
} else {
67-
nHeavy = nSpecies-1;
68-
nEl = 1;
69-
}
70-
}
71-
else { nHeavy = nSpecies; nEl = 0; }
61+
// x1000 to have Molar Mass in kg/kmol
62+
for(iSpecies = 0; iSpecies < nSpecies; iSpecies++)
63+
MolarMass[iSpecies] = 1000* mix->speciesMw(iSpecies);
64+
65+
if (mix->hasElectrons()) { nHeavy = nSpecies-1; nEl = 1; }
66+
else { nHeavy = nSpecies; nEl = 0; }
7267

7368
/*--- Set up catalytic recombination table. ---*/
7469
// Creation/Destruction (+1/-1), Index of monoatomic reactants
75-
// Monoatomic species (N,O) recombine into diaatomic (N2, O2)
70+
// Monoatomic species (N,O) recombine into diaatomic (N2, O2) species
7671
if (gas_model == "N2") {
77-
CatRecombTable(0,0) = 1; CatRecombTable(0,1) = 1;
78-
CatRecombTable(1,0) = -1; CatRecombTable(1,1) = 1;
72+
CatRecombTable(0,0) = 1; CatRecombTable(0,1) = 1; // N2
73+
CatRecombTable(1,0) = -1; CatRecombTable(1,1) = 1; // N
7974

8075
} else if (gas_model == "air_5"){
81-
CatRecombTable(0,0) = -1; CatRecombTable(0,1) = 0;
82-
CatRecombTable(1,0) = -1; CatRecombTable(1,1) = 1;
83-
CatRecombTable(2,0) = 0; CatRecombTable(2,1) = 4;
84-
CatRecombTable(3,0) = 1; CatRecombTable(3,1) = 0;
85-
CatRecombTable(4,0) = 1; CatRecombTable(4,1) = 1;
76+
CatRecombTable(0,0) = -1; CatRecombTable(0,1) = 0; // N
77+
CatRecombTable(1,0) = -1; CatRecombTable(1,1) = 1; // O
78+
CatRecombTable(2,0) = 0; CatRecombTable(2,1) = 4; // NO
79+
CatRecombTable(3,0) = 1; CatRecombTable(3,1) = 0; // N2
80+
CatRecombTable(4,0) = 1; CatRecombTable(4,1) = 1; // O2
8681

8782
} else if (gas_model == "air_6") {
88-
CatRecombTable(0,0) = -1; CatRecombTable(0,1) = 0;
89-
CatRecombTable(1,0) = -1; CatRecombTable(1,1) = 1;
90-
CatRecombTable(2,0) = 0; CatRecombTable(2,1) = 4;
91-
CatRecombTable(3,0) = 1; CatRecombTable(3,1) = 0;
92-
CatRecombTable(4,0) = 1; CatRecombTable(4,1) = 1;
93-
CatRecombTable(5,0) = 0; CatRecombTable(5,1) = 4;
83+
CatRecombTable(0,0) = -1; CatRecombTable(0,1) = 0; // N
84+
CatRecombTable(1,0) = -1; CatRecombTable(1,1) = 1; // O
85+
CatRecombTable(2,0) = 0; CatRecombTable(2,1) = 4; // NO
86+
CatRecombTable(3,0) = 1; CatRecombTable(3,1) = 0; // N2
87+
CatRecombTable(4,0) = 1; CatRecombTable(4,1) = 1; // O2
88+
CatRecombTable(5,0) = 0; CatRecombTable(5,1) = 4; // Ar
9489

9590
} else {
9691
if (config->GetCatalytic())
97-
SU2_MPI::Error("Cataylic wall recombination not implemented for specified Mutation gas model.", CURRENT_FUNCTION);
92+
SU2_MPI::Error("Catalytic wall recombination not implemented for specified Mutation gas model.", CURRENT_FUNCTION);
9893
}
9994

10095
}

0 commit comments

Comments
 (0)