Skip to content

Commit ce6f487

Browse files
Merge pull request #1160 from su2code/feature_NEMO_merge_final
NEMO - link with mutation++
2 parents 629902a + 7bdef46 commit ce6f487

36 files changed

Lines changed: 551 additions & 200 deletions

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@
1212
[submodule "externals/meson"]
1313
path = externals/meson
1414
url = https://github.com/mesonbuild/meson
15+
[submodule "subprojects/Mutationpp"]
16+
path = subprojects/Mutationpp
17+
url = https://github.com/mutationpp/Mutationpp.git

Common/include/CConfig.hpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,7 @@ class CConfig {
758758
su2double* Mesh_Box_Length; /*!< \brief Array containing the length in the x-, y-, and z-directions for the analytic RECTANGLE and BOX grid formats. */
759759
su2double* Mesh_Box_Offset; /*!< \brief Array containing the offset from 0.0 in the x-, y-, and z-directions for the analytic RECTANGLE and BOX grid formats. */
760760
string Mesh_FileName, /*!< \brief Mesh input file. */
761+
Target_Mesh_FileName, /*!< \brief Mesh name to be adapted. */
761762
Mesh_Out_FileName, /*!< \brief Mesh output file. */
762763
Solution_FileName, /*!< \brief Flow solution input file. */
763764
Solution_AdjFileName, /*!< \brief Adjoint solution input file for drag functional. */
@@ -1156,7 +1157,7 @@ class CConfig {
11561157
monoatomic; /*!< \brief Flag for monoatomic mixture. */
11571158
string GasModel, /*!< \brief Gas Model. */
11581159
*Wall_Catalytic; /*!< \brief Pointer to catalytic walls. */
1159-
1160+
11601161
/*!
11611162
* \brief Set the default values of config options not set in the config file using another config object.
11621163
* \param config - Config object to use the default values from.
@@ -3652,7 +3653,7 @@ class CConfig {
36523653
* \brief Gas model that we are using.
36533654
* \return Gas model that we are using.
36543655
*/
3655-
string GetGasModel (void) const {return GasModel;}
3656+
string GetGasModel(void) const {return GasModel;}
36563657

36573658
/*!
36583659
* \brief Get the transport coefficient model.
@@ -5111,6 +5112,11 @@ class CConfig {
51115112
*/
51125113
bool GetRestart(void) const { return Restart; }
51135114

5115+
/*!
5116+
* \brief Sets the restart information.
5117+
*/
5118+
void SetRestart(bool val_restart) { Restart = val_restart; }
5119+
51145120
/*!
51155121
* \brief Flag for whether binary SU2 native restart files are read.
51165122
* \return Flag for whether binary SU2 native restart files are read, if <code>TRUE</code> then the code will load binary restart files.

Common/include/adt/CADTElemClass.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,4 +400,4 @@ class CADTElemClass : public CADTBaseClass {
400400
*/
401401
CADTElemClass() = delete;
402402

403-
};
403+
};

Common/include/fem/fem_standard_element.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1767,4 +1767,4 @@ class CFEMStandardBoundaryFace : public CFEMStandardElementBase {
17671767
* \param[in] other - Object, whose data is copied.
17681768
*/
17691769
void Copy(const CFEMStandardBoundaryFace &other);
1770-
};
1770+
};

Common/include/option_structure.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ enum ENUM_FLUIDMODEL {
543543
INC_IDEAL_GAS = 5, /*!< \brief Incompressible ideal gas model. */
544544
INC_IDEAL_GAS_POLY = 6, /*!< \brief Inc. ideal gas, polynomial gas model. */
545545
MUTATIONPP = 7, /*!< \brief Mutation++ gas model for nonequilibrium flow. */
546-
USER_DEFINED_NONEQ = 8 /*!< \brief User defined gas model for nonequilibrium flow. */
546+
SU2_NONEQ = 8 /*!< \brief User defined gas model for nonequilibrium flow. */
547547
};
548548
static const MapType<string, ENUM_FLUIDMODEL> FluidModel_Map = {
549549
MakePair("STANDARD_AIR", STANDARD_AIR)
@@ -554,7 +554,7 @@ static const MapType<string, ENUM_FLUIDMODEL> FluidModel_Map = {
554554
MakePair("INC_IDEAL_GAS", INC_IDEAL_GAS)
555555
MakePair("INC_IDEAL_GAS_POLY", INC_IDEAL_GAS_POLY)
556556
MakePair("MUTATIONPP", MUTATIONPP)
557-
MakePair("USER_DEFINED_NONEQ", USER_DEFINED_NONEQ)
557+
MakePair("SU2_NONEQ", SU2_NONEQ)
558558
};
559559

560560
/*!

Common/src/CConfig.cpp

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,8 +1162,6 @@ void CConfig::SetConfig_Options() {
11621162
addBoolOption("IONIZATION", ionization, false);
11631163
/* DESCRIPTION: Specify if there is VT transfer residual limiting */
11641164
addBoolOption("VT_RESIDUAL_LIMITING", vt_transfer_res_limit, false);
1165-
/* DESCRIPTION: Specify if the gas is monoatomic */
1166-
addBoolOption("MONOATOMIC", monoatomic, false);
11671165
/* DESCRIPTION: List of catalytic walls */
11681166
addStringListOption("CATALYTIC_WALL", nWall_Catalytic, Wall_Catalytic);
11691167
/*!\brief MARKER_MONITORING\n DESCRIPTION: Marker(s) of the surface where evaluate the non-dimensional coefficients \ingroup Config*/
@@ -2785,7 +2783,6 @@ void CConfig::SetConfig_Options() {
27852783

27862784
/* DESCRIPTION: Size of the edge groups colored for thread parallel edge loops (0 forces the reducer strategy). */
27872785
addUnsignedLongOption("EDGE_COLORING_GROUP_SIZE", edgeColorGroupSize, 512);
2788-
27892786
/* END_CONFIG_OPTIONS */
27902787

27912788
}
@@ -3174,7 +3171,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_
31743171
(Kind_FluidModel == INC_IDEAL_GAS_POLY) ||
31753172
(Kind_FluidModel == CONSTANT_DENSITY));
31763173
bool noneq_gas = ((Kind_FluidModel == MUTATIONPP) ||
3177-
(Kind_FluidModel == USER_DEFINED_NONEQ));
3174+
(Kind_FluidModel == SU2_NONEQ));
31783175
bool standard_air = ((Kind_FluidModel == STANDARD_AIR));
31793176
bool nemo = GetNEMOProblem();
31803177

@@ -3539,10 +3536,6 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_
35393536
SU2_MPI::Error("Only STANDARD_AIR fluid model can be used with US Measurement System", CURRENT_FUNCTION);
35403537
}
35413538

3542-
if (nemo && Kind_FluidModel != USER_DEFINED_NONEQ ) {
3543-
SU2_MPI::Error("Only USER_DEFINED_NONEQ fluid model can be used with the NEMO solver. Mutation++ library will soon be available.", CURRENT_FUNCTION);
3544-
}
3545-
35463539
if (nemo && Kind_TransCoeffModel != WILKE ) {
35473540
SU2_MPI::Error("Only WILKE transport model is stable for the NEMO solver.", CURRENT_FUNCTION);
35483541
}
@@ -3558,6 +3551,14 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_
35583551
SU2_MPI::Error("AUSMPW+ is extremely unstable. Feel free to fix me!", CURRENT_FUNCTION);
35593552
}
35603553

3554+
if (GetGasModel() == "ARGON" && GetKind_FluidModel() == SU2_NONEQ){
3555+
SU2_MPI::Error("ARGON is not working with SU2_NONEQ fluid model!", CURRENT_FUNCTION);
3556+
}
3557+
3558+
if (GetKind_FluidModel() == MUTATIONPP && GetFrozen() == true){
3559+
SU2_MPI::Error("The option of FROZEN_MIXTURE is not yet working with Mutation++ support.", CURRENT_FUNCTION);
3560+
}
3561+
35613562
if(GetBoolTurbomachinery()){
35623563
nBlades = new su2double[nZone];
35633564
FreeStreamTurboNormal= new su2double[3];
@@ -4978,6 +4979,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_
49784979
/*--- Specifying a deforming surface requires a mesh deformation solver. ---*/
49794980
if (GetSurface_Movement(DEFORMING)) Deform_Mesh = true;
49804981

4982+
if (GetGasModel() == "ARGON") monoatomic = true;
49814983
}
49824984

49834985
void CConfig::SetMarkers(unsigned short val_software) {
@@ -5559,14 +5561,14 @@ void CConfig::SetOutput(unsigned short val_software, unsigned short val_izone) {
55595561
break;
55605562
case NEMO_EULER:
55615563
if (Kind_Regime == COMPRESSIBLE) cout << "Compressible two-temperature thermochemical non-equilibrium Euler equations." << endl;
5562-
if(Kind_FluidModel == USER_DEFINED_NONEQ){
5564+
if(Kind_FluidModel == SU2_NONEQ){
55635565
if ((GasModel != "N2") && (GasModel != "AIR-5") && (GasModel != "ARGON"))
55645566
SU2_MPI::Error("The GAS_MODEL given as input is not valid. Choose one of the options: N2, AIR-5, ARGON.", CURRENT_FUNCTION);
55655567
}
55665568
break;
55675569
case NEMO_NAVIER_STOKES:
55685570
if (Kind_Regime == COMPRESSIBLE) cout << "Compressible two-temperature thermochemical non-equilibrium Navier-Stokes equations." << endl;
5569-
if(Kind_FluidModel == USER_DEFINED_NONEQ){
5571+
if(Kind_FluidModel == SU2_NONEQ){
55705572
if ((GasModel != "N2") && (GasModel != "AIR-5") && (GasModel != "ARGON"))
55715573
SU2_MPI::Error("The GAS_MODEL given as input is not valid. Choose one of the options: N2, AIR-5, ARGON.", CURRENT_FUNCTION);
55725574
}

Common/src/adt/CADTElemClass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2158,4 +2158,4 @@ bool CADTElemClass::Dist2ToQuadrilateral(const unsigned long i0,
21582158
}
21592159

21602160
return true;
2161-
}
2161+
}

Common/src/fem/fem_standard_element.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4015,4 +4015,4 @@ void CFEMStandardBoundaryFace::Copy(const CFEMStandardBoundaryFace &other) {
40154015
matDerBasisElemIntegrationTranspose = other.matDerBasisElemIntegrationTranspose;
40164016

40174017
subConnForPlotting = other.subConnForPlotting;
4018-
}
4018+
}

SU2_CFD/include/fluid/CMutationTCLib.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929

3030
#include "CNEMOGas.hpp"
3131

32+
#if defined(HAVE_MPP) && !defined(CODI_REVERSE_TYPE) && !defined(CODI_FORWARD_TYPE)
33+
#include "mutation++.h"
34+
3235
/*!
3336
* \derived class CMutationTCLib
3437
* \brief Child class for Mutation++ nonequilibrium gas model.
@@ -38,6 +41,8 @@ class CMutationTCLib : public CNEMOGas {
3841

3942
private:
4043

44+
std::unique_ptr<Mutation::Mixture> mix; /*!< \brief Pointer to object Mixture from Mutation++ library. */
45+
4146
vector<su2double> Cv_ks, /*!< \brief Species specific heats at constant volume. */
4247
es, /*!< \brief Species energies. */
4348
omega_vec, /*!< \brief Dummy vector for vibrational energy source term. */
@@ -110,6 +115,7 @@ class CMutationTCLib : public CNEMOGas {
110115
*/
111116
su2double GetViscosity() final;
112117

118+
113119
/*!
114120
* \brief Get T-R and V-E thermal conductivities vector.
115121
*/
@@ -136,3 +142,4 @@ class CMutationTCLib : public CNEMOGas {
136142
vector<su2double>& GetSpeciesFormationEnthalpy() final;
137143

138144
};
145+
#endif

SU2_CFD/include/fluid/CNEMOGas.hpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class CNEMOGas : public CFluidModel {
4242
bool frozen, /*!< \brief Indicates if mixture is frozen. */
4343
ionization; /*!< \brief Presence of charged species in gas mixture. */
4444

45-
string Kind_GasModel; /*!< \brief String gas model. */
45+
string gas_model; /*!< \brief String gas model. */
4646

4747
unsigned short nSpecies, /*!< \brief Number of species in the gas mixture. */
4848
nHeavy, /*!< \brief Number of heavy particles in gas */
@@ -101,7 +101,6 @@ class CNEMOGas : public CFluidModel {
101101
/*!
102102
* \brief Set mixture thermodynamic state.
103103
* \param[in] P - Pressure.
104-
* \param[in] Ms - Mass fraction of the gas.
105104
* \param[in] T - Translational/Rotational temperature.
106105
* \param[in] Tve - Vibrational/Electronic temperature.
107106
*/
@@ -183,17 +182,17 @@ class CNEMOGas : public CFluidModel {
183182
su2double ComputeGamma();
184183

185184
/*!
186-
* \brief Get derivative of pressure w.r.t. conservative variables.
185+
* \brief Compute derivative of pressure w.r.t. conservative variables.
187186
*/
188187
void ComputedPdU(su2double *V, vector<su2double>& val_eves, su2double *val_dPdU);
189188

190189
/*!
191-
* \brief Get derivative of temperature w.r.t. conservative variables.
190+
* \brief Compute derivative of temperature w.r.t. conservative variables.
192191
*/
193192
void ComputedTdU(su2double *V, su2double *val_dTdU);
194193

195194
/*!
196-
* \brief Get derivative of vibrational temperature w.r.t. conservative variables.
195+
* \brief Compute derivative of vibrational temperature w.r.t. conservative variables.
197196
*/
198197
void ComputedTvedU(su2double *V, vector<su2double>& val_eves, su2double *val_dTvedU);
199198

@@ -241,4 +240,4 @@ class CNEMOGas : public CFluidModel {
241240
* \brief Get species formation enthalpy.
242241
*/
243242
virtual const vector<su2double>& GetSpeciesFormationEnthalpy() = 0;
244-
};
243+
};

0 commit comments

Comments
 (0)