Skip to content

Commit 64e24b1

Browse files
authored
Merge pull request #1417 from su2code/feature_cat_wall
Addition of catalytic isothermal wall boundary conditions in SU2-NEMO
2 parents c3c6649 + 581a6b3 commit 64e24b1

14 files changed

Lines changed: 501 additions & 199 deletions

File tree

.github/workflows/regression.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ jobs:
128128
uses: docker://ghcr.io/su2code/su2/test-su2:220614-1237
129129
with:
130130
# -t <Tutorials-branch> -c <Testcases-branch>
131-
args: -b ${{github.ref}} -t develop -c develop -s ${{matrix.testscript}}
131+
args: -b ${{github.ref}} -t develop -c feature_cat_wall -s ${{matrix.testscript}}
132132
- name: Cleanup
133133
uses: docker://ghcr.io/su2code/su2/test-su2:220614-1237
134134
with:

Common/include/CConfig.hpp

Lines changed: 48 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,6 @@ class CConfig {
311311
su2double *Isothermal_Temperature; /*!< \brief Specified isothermal wall temperatures (static). */
312312
su2double *HeatTransfer_Coeff; /*!< \brief Specified heat transfer coefficients. */
313313
su2double *HeatTransfer_WallTemp; /*!< \brief Specified temperatures at infinity alongside heat transfer coefficients. */
314-
su2double *Wall_Catalycity; /*!< \brief Specified wall species mass-fractions for catalytic boundaries. */
315314
su2double *Heat_Flux; /*!< \brief Specified wall heat fluxes. */
316315
su2double *Roughness_Height; /*!< \brief Equivalent sand grain roughness for the marker according to config file. */
317316
su2double *Displ_Value; /*!< \brief Specified displacement for displacement boundaries. */
@@ -1169,20 +1168,24 @@ class CConfig {
11691168
unsigned short maxBasisDim, /*!< \brief Maximum number of POD basis dimensions. */
11701169
rom_save_freq; /*!< \brief Frequency of unsteady time steps to save. */
11711170

1172-
unsigned short nSpecies, /*!< \brief Number of transported species equations (for NEMO and species transport)*/
1171+
unsigned short nSpecies; /*!< \brief Number of transported species equations (for NEMO and species transport)*/
11731172

11741173
/* other NEMO configure options*/
1175-
iWall_Catalytic,
1176-
nWall_Catalytic; /*!< \brief No of catalytic walls */
1177-
su2double *Gas_Composition, /*!< \brief Initial mass fractions of flow [dimensionless] */
1174+
unsigned short nSpecies_Cat_Wall, /*!< \brief No. of species for a catalytic wall. */
1175+
iWall_Catalytic, /*!< \brief Iterator over catalytic walls. */
1176+
nWall_Catalytic; /*!< \brief No. of catalytic walls. */
1177+
su2double *Gas_Composition, /*!< \brief Initial mass fractions of flow [dimensionless]. */
1178+
*Supercatalytic_Wall_Composition, /*!< \brief Supercatalytic wall mass fractions [dimensionless]. */
11781179
pnorm_heat; /*!< \brief pnorm for heat-flux. */
11791180
bool frozen, /*!< \brief Flag for determining if mixture is frozen. */
11801181
ionization, /*!< \brief Flag for determining if free electron gas is in the mixture. */
11811182
vt_transfer_res_limit, /*!< \brief Flag for determining if residual limiting for source term VT-transfer is used. */
1182-
monoatomic; /*!< \brief Flag for monoatomic mixture. */
1183+
monoatomic, /*!< \brief Flag for monoatomic mixture. */
1184+
Supercatalytic_Wall; /*!< \brief Flag for supercatalytic wall. */
11831185
string GasModel, /*!< \brief Gas Model. */
11841186
*Wall_Catalytic; /*!< \brief Pointer to catalytic walls. */
11851187
TRANSCOEFFMODEL Kind_TransCoeffModel; /*!< \brief Transport coefficient Model for NEMO solver. */
1188+
su2double CatalyticEfficiency; /*!< \brief Wall catalytic efficiency. */
11861189

11871190
/*--- Additional species solver options ---*/
11881191
bool Species_Clipping; /*!< \brief Boolean that activates solution clipping for scalar transport. */
@@ -3029,13 +3032,13 @@ class CConfig {
30293032

30303033
/*!
30313034
* \brief Retrieves the number of periodic time instances for Harmonic Balance.
3032-
* \return: Number of periodic time instances for Harmonic Balance.
3035+
* \return Number of periodic time instances for Harmonic Balance.
30333036
*/
30343037
unsigned short GetnTimeInstances(void) const { return nTimeInstances; }
30353038

30363039
/*!
30373040
* \brief Retrieves the period of oscillations to be used with Harmonic Balance.
3038-
* \return: Period for Harmonic Balance.
3041+
* \return Period for Harmonic Balance.
30393042
*/
30403043
su2double GetHarmonicBalance_Period(void) const { return HarmonicBalance_Period; }
30413044

@@ -3724,6 +3727,12 @@ class CConfig {
37243727
*/
37253728
string GetWall_Catalytic_TagBound(unsigned short val_marker) const { return Wall_Catalytic[val_marker]; }
37263729

3730+
/*!
3731+
* \brief Get wall catalytic efficiency.
3732+
* \return wall catalytic efficiency value.
3733+
*/
3734+
su2double GetCatalytic_Efficiency(void) const { return CatalyticEfficiency; }
3735+
37273736
/*!
37283737
* \brief Fluid model that we are using.
37293738
* \return Fluid model that we are using.
@@ -5211,22 +5220,22 @@ class CConfig {
52115220
TIME_MARCHING GetTime_Marching() const { return TimeMarching; }
52125221

52135222
/*!
5214-
* \brief Provides the number of species present in the plasma
5215-
* \return: The number of species present in the plasma, read from input file
5223+
* \brief Provides the number of species present in the gas mixture.
5224+
* \return The number of species present in the gas mixture.
52165225
*/
52175226
unsigned short GetnSpecies() const { return nSpecies; }
52185227

5219-
/*!
5220-
* \brief Get the wall heat flux on a constant heat flux boundary.
5221-
* \return The heat flux.
5228+
/*!
5229+
* \brief Provides the gas mass fractions of the flow.
5230+
* \return Gas Mass fractions.
52225231
*/
5223-
const su2double *GetWall_Catalycity(void) const { return Wall_Catalycity; }
5232+
const su2double *GetGas_Composition(void) const { return Gas_Composition; }
52245233

52255234
/*!
5226-
* \brief Provides the gas mass fractions of the flow
5227-
* \return: Gas Mass fractions
5235+
* \brief Provides the gas mass fractions at the wall for supercat wall.
5236+
* \return Supercat wall gas mass fractions.
52285237
*/
5229-
const su2double *GetGas_Composition(void) const { return Gas_Composition; }
5238+
const su2double *GetSupercatalytic_Wall_Composition(void) const { return Supercatalytic_Wall_Composition; }
52305239

52315240
/*!
52325241
* \brief Provides the restart information.
@@ -5304,6 +5313,11 @@ class CConfig {
53045313
*/
53055314
bool GetMonoatomic(void) const { return monoatomic; }
53065315

5316+
/*!
5317+
* \brief Indicates whether supercatalytic wall is used.
5318+
*/
5319+
bool GetSupercatalytic_Wall(void) const { return Supercatalytic_Wall; }
5320+
53075321
/*!
53085322
* \brief Information about computing and plotting the equivalent area distribution.
53095323
* \return <code>TRUE</code> or <code>FALSE</code> depending if we are computing the equivalent area.
@@ -6217,17 +6231,30 @@ class CConfig {
62176231
bool GetViscous_Wall(unsigned short iMarker) const;
62186232

62196233
/*!
6220-
* \brief Determines if problem is adjoint
6221-
* \return true if Adjoint
6234+
* \brief Determines whether a marker with index iMarker is a catalytic boundary.
6235+
* \param iMarker
6236+
* \return <TRUE> it marker with index iMarker is a catalytic boundary.
6237+
*/
6238+
bool GetCatalytic_Wall(unsigned short iMarker) const;
6239+
6240+
/*!
6241+
* \brief Determines if problem is adjoint.
6242+
* \return true if Adjoint.
62226243
*/
62236244
bool GetContinuous_Adjoint(void) const { return ContinuousAdjoint; }
62246245

62256246
/*!
6226-
* \brief Determines if problem is viscous
6227-
* \return true if Viscous
6247+
* \brief Determines if problem is viscous.
6248+
* \return true if Viscous.
62286249
*/
62296250
bool GetViscous(void) const { return Viscous; }
62306251

6252+
/*!
6253+
* \brief Determines if problem has catalytic walls.
6254+
* \return true if catalytic walls are present.
6255+
*/
6256+
bool GetCatalytic(void) const { return nWall_Catalytic > 0; }
6257+
62316258
/*!
62326259
* \brief Provides the index of the solution in the container.
62336260
* \param[in] val_eqsystem - Equation that is being solved.

Common/src/CConfig.cpp

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,7 +1057,6 @@ void CConfig::SetPointersNull(void) {
10571057

10581058
Kind_TimeNumScheme = EULER_IMPLICIT;
10591059

1060-
Gas_Composition = nullptr;
10611060
}
10621061

10631062
void CConfig::SetConfig_Options() {
@@ -1183,7 +1182,13 @@ void CConfig::SetConfig_Options() {
11831182
addBoolOption("VT_RESIDUAL_LIMITING", vt_transfer_res_limit, false);
11841183
/* DESCRIPTION: List of catalytic walls */
11851184
addStringListOption("CATALYTIC_WALL", nWall_Catalytic, Wall_Catalytic);
1186-
1185+
/* DESCRIPTION: Specfify super-catalytic wall */
1186+
addBoolOption("SUPERCATALYTIC_WALL", Supercatalytic_Wall, false);
1187+
/* DESCRIPTION: Wall mass fractions for supercatalytic case */
1188+
addDoubleListOption("SUPERCATALYTIC_WALL_COMPOSITION", nSpecies_Cat_Wall, Supercatalytic_Wall_Composition);
1189+
/* DESCRIPTION: Specfify catalytic efficiency of wall if using gamma model */
1190+
addDoubleOption("CATALYTIC_EFFICIENCY", CatalyticEfficiency, 1.0);
1191+
/*!\brief MARKER_MONITORING\n DESCRIPTION: Marker(s) of the surface where evaluate the non-dimensional coefficients \ingroup Config*/
11871192

11881193
/*--- Options related to VAN der WAALS MODEL and PENG ROBINSON ---*/
11891194

@@ -7796,6 +7801,17 @@ bool CConfig::GetViscous_Wall(unsigned short iMarker) const {
77967801
Marker_All_KindBC[iMarker] == CHT_WALL_INTERFACE);
77977802
}
77987803

7804+
bool CConfig::GetCatalytic_Wall(unsigned short iMarker) const {
7805+
7806+
bool catalytic = false;
7807+
for (unsigned short iMarker_Catalytic = 0; iMarker_Catalytic < nWall_Catalytic; iMarker_Catalytic++){
7808+
string Catalytic_Tag = Wall_Catalytic[iMarker_Catalytic];
7809+
if (Catalytic_Tag == Marker_All_TagBound[iMarker]) { catalytic = true; break; }
7810+
}
7811+
7812+
return catalytic;
7813+
}
7814+
77997815
bool CConfig::GetSolid_Wall(unsigned short iMarker) const {
78007816

78017817
return GetViscous_Wall(iMarker) ||

SU2_CFD/include/fluid/CNEMOGas.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ class CNEMOGas : public CFluidModel {
8484
Enthalpy_Formation, /*!< \brief Enthalpy of formation */
8585
Ref_Temperature; /*!< \brief Reference temperature for thermodynamic relations */
8686

87+
su2matrix<int> CatRecombTable; /*!< \brief Table for catalytic wall recombination pairs. */
88+
8789
public:
8890

8991
/*!
@@ -258,4 +260,10 @@ class CNEMOGas : public CFluidModel {
258260
* \brief Get species formation enthalpy.
259261
*/
260262
virtual const vector<su2double>& GetSpeciesFormationEnthalpy() = 0;
263+
264+
/*!
265+
* \brief Get catalytic wall recombination indices and constants.
266+
*/
267+
inline const su2matrix<int>& GetCatalyticRecombination() const {return CatRecombTable;}
268+
261269
};

SU2_CFD/include/solvers/CFVMFlowSolverBase.inl

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2437,9 +2437,10 @@ void CFVMFlowSolverBase<V, FlowRegime>::Friction_Forces(const CGeometry* geometr
24372437

24382438
unsigned long iVertex, iPoint, iPointNormal;
24392439
unsigned short iMarker, iMarker_Monitoring, iDim, jDim;
2440-
su2double Viscosity = 0.0, Area, Density = 0.0, GradTemperature = 0.0, WallDistMod, FrictionVel,
2440+
su2double Viscosity = 0.0, Area, Density = 0.0, WallDistMod, FrictionVel,
24412441
UnitNormal[3] = {0.0}, TauElem[3] = {0.0}, Tau[3][3] = {{0.0}}, Cp,
2442-
thermal_conductivity, MaxNorm = 8.0, Grad_Vel[3][3] = {{0.0}}, Grad_Temp[3] = {0.0}, AxiFactor;
2442+
thermal_conductivity, MaxNorm = 8.0, Grad_Vel[3][3] = {{0.0}}, Grad_Temp[3] = {0.0},
2443+
Grad_Temp_ve[3] = {0.0}, AxiFactor;
24432444
const su2double *Coord = nullptr, *Coord_Normal = nullptr, *Normal = nullptr;
24442445
const su2double minYPlus = config->GetwallModel_MinYPlus();
24452446

@@ -2520,6 +2521,7 @@ void CFVMFlowSolverBase<V, FlowRegime>::Friction_Forces(const CGeometry* geometr
25202521
Grad_Vel[iDim][jDim] = nodes->GetGradient_Primitive(iPoint, prim_idx.Velocity() + iDim, jDim);
25212522
}
25222523
Grad_Temp[iDim] = nodes->GetGradient_Primitive(iPoint, prim_idx.Temperature(), iDim);
2524+
if (nemo) Grad_Temp_ve[iDim] = nodes->GetGradient_Primitive(iPoint, prim_idx.Temperature_ve(), iDim);
25232525
}
25242526

25252527
Viscosity = nodes->GetLaminarViscosity(iPoint);
@@ -2591,35 +2593,53 @@ void CFVMFlowSolverBase<V, FlowRegime>::Friction_Forces(const CGeometry* geometr
25912593

25922594
/*--- Compute total and maximum heat flux on the wall ---*/
25932595

2594-
/// TODO: Move these ifs to specialized functions.
2596+
su2double dTdn = -GeometryToolbox::DotProduct(nDim, Grad_Temp, UnitNormal);
2597+
25952598
if (!nemo){
25962599

25972600
if (FlowRegime == ENUM_REGIME::COMPRESSIBLE) {
2598-
GradTemperature = -GeometryToolbox::DotProduct(nDim, Grad_Temp, UnitNormal);
25992601

26002602
Cp = (Gamma / Gamma_Minus_One) * Gas_Constant;
26012603
thermal_conductivity = Cp * Viscosity / Prandtl_Lam;
26022604
}
26032605
if (FlowRegime == ENUM_REGIME::INCOMPRESSIBLE) {
2604-
if (energy)
2605-
GradTemperature = -GeometryToolbox::DotProduct(nDim, Grad_Temp, UnitNormal);
2606-
2606+
if (!energy) dTdn = 0.0;
26072607
thermal_conductivity = nodes->GetThermalConductivity(iPoint);
26082608
}
2609-
HeatFlux[iMarker][iVertex] = -thermal_conductivity * GradTemperature * RefHeatFlux;
2609+
HeatFlux[iMarker][iVertex] = -thermal_conductivity * dTdn * RefHeatFlux;
26102610

26112611
} else {
26122612

26132613
const auto& thermal_conductivity_tr = nodes->GetThermalConductivity(iPoint);
26142614
const auto& thermal_conductivity_ve = nodes->GetThermalConductivity_ve(iPoint);
2615-
const auto& Grad_PrimVar = nodes->GetGradient_Primitive(iPoint);
2616-
2617-
su2double dTn = GeometryToolbox::DotProduct(nDim, Grad_PrimVar[prim_idx.Temperature()], UnitNormal);
2618-
su2double dTven = GeometryToolbox::DotProduct(nDim, Grad_PrimVar[prim_idx.Temperature_ve()], UnitNormal);
2615+
2616+
const su2double dTvedn = -GeometryToolbox::DotProduct(nDim, Grad_Temp_ve, UnitNormal);
2617+
2618+
/*--- Surface energy balance: trans-rot heat flux, vib-el heat flux ---*/
2619+
HeatFlux[iMarker][iVertex] = -(thermal_conductivity_tr*dTdn + thermal_conductivity_ve*dTvedn);
2620+
2621+
/*--- Compute enthalpy transport to surface due to mass diffusion ---*/
2622+
bool catalytic = config->GetCatalytic_Wall(iMarker);
2623+
if (catalytic){
2624+
2625+
const auto nSpecies = config->GetnSpecies();
2626+
const auto& Grad_PrimVar = nodes->GetGradient_Primitive(iPoint);
2627+
const auto& PrimVar = nodes->GetPrimitive(iPoint);
2628+
const auto& Ds = nodes->GetDiffusionCoeff(iPoint);
2629+
const auto& hs = nodes->GetEnthalpys(iPoint);
2630+
const su2double rho = PrimVar[prim_idx.Density()];
2631+
2632+
su2double sumJhs = 0.0;
2633+
for (auto iSpecies = 0u; iSpecies < nSpecies; iSpecies++) {
2634+
for (auto iDim = 0u; iDim < nDim; iDim++) {
2635+
su2double dYdn = 1.0/rho*(Grad_PrimVar[iSpecies][iDim] - PrimVar[iSpecies]*Grad_PrimVar[prim_idx.Density()][iDim]/rho);
2636+
sumJhs += rho*Ds[iSpecies]*hs[iSpecies]*dYdn*UnitNormal[iDim];
2637+
}
2638+
}
2639+
/*--- Surface energy balance: mass diffusion ---*/
2640+
HeatFlux[iMarker][iVertex] += sumJhs;
26192641

2620-
/*--- Surface energy balance: trans-rot heat flux, vib-el heat flux,
2621-
enthalpy transport due to mass diffusion ---*/
2622-
HeatFlux[iMarker][iVertex] = thermal_conductivity_tr*dTn + thermal_conductivity_ve*dTven;
2642+
}
26232643
}
26242644

26252645
/*--- Note that heat is computed at the

SU2_CFD/src/fluid/CMutationTCLib.cpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ CMutationTCLib::CMutationTCLib(const CConfig* config, unsigned short val_nDim):
3838
Cv_ks.resize(nEnergyEq*nSpecies,0.0);
3939
es.resize(nEnergyEq*nSpecies,0.0);
4040
omega_vec.resize(1,0.0);
41+
CatRecombTable.resize(nSpecies,2) = 0;
4142

4243
/*--- Set up inputs to define type of mixture in the Mutation++ library ---*/
4344

@@ -69,6 +70,33 @@ CMutationTCLib::CMutationTCLib(const CConfig* config, unsigned short val_nDim):
6970
}
7071
else { nHeavy = nSpecies; nEl = 0; }
7172

73+
/*--- Set up catalytic recombination table. ---*/
74+
// Creation/Destruction (+1/-1), Index of monoatomic reactants
75+
// Monoatomic species (N,O) recombine into diaatomic (N2, O2)
76+
if (gas_model == "N2") {
77+
CatRecombTable(0,0) = 1; CatRecombTable(0,1) = 1;
78+
CatRecombTable(1,0) = -1; CatRecombTable(1,1) = 1;
79+
80+
} 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;
86+
87+
} 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;
94+
95+
} else {
96+
if (config->GetCatalytic())
97+
SU2_MPI::Error("Cataylic wall recombination not implemented for specified Mutation gas model.", CURRENT_FUNCTION);
98+
}
99+
72100
}
73101

74102
CMutationTCLib::~CMutationTCLib(){}

0 commit comments

Comments
 (0)