Skip to content

Commit fb55e82

Browse files
authored
Merge branch 'develop' into reduce_disc_adj_mem
2 parents 3230f4e + 575c157 commit fb55e82

54 files changed

Lines changed: 714 additions & 370 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.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: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,8 @@ class CConfig {
735735
unsigned short Tab_FileFormat; /*!< \brief Format of the output files. */
736736
unsigned short ActDisk_Jump; /*!< \brief Format of the output files. */
737737
unsigned long StartWindowIteration; /*!< \brief Starting Iteration for long time Windowing apporach . */
738-
bool CFL_Adapt; /*!< \brief Adaptive CFL number. */
738+
unsigned short nCFL_AdaptParam; /*!< \brief Number of CFL parameters provided in config. */
739+
bool CFL_Adapt; /*!< \brief Use adaptive CFL number. */
739740
bool HB_Precondition; /*!< \brief Flag to turn on harmonic balance source term preconditioning */
740741
su2double RefArea, /*!< \brief Reference area for coefficient computation. */
741742
RefElemLength, /*!< \brief Reference element length for computing the slope limiting epsilon. */
@@ -762,7 +763,6 @@ class CConfig {
762763
Solution_FileName, /*!< \brief Flow solution input file. */
763764
Solution_AdjFileName, /*!< \brief Adjoint solution input file for drag functional. */
764765
Volume_FileName, /*!< \brief Flow variables output file. */
765-
Residual_FileName, /*!< \brief Residual variables output file. */
766766
Conv_FileName, /*!< \brief Convergence history output file. */
767767
Breakdown_FileName, /*!< \brief Breakdown output file. */
768768
Restart_FileName, /*!< \brief Restart file for flow variables. */
@@ -1056,10 +1056,10 @@ class CConfig {
10561056
bool Radiation; /*!< \brief Determines if a radiation model is incorporated. */
10571057
su2double CFL_Rad; /*!< \brief CFL Number for the radiation solver. */
10581058

1059+
array<su2double,5> default_cfl_adapt; /*!< \brief Default CFL adapt param array for the COption class. */
10591060
su2double default_vel_inf[3], /*!< \brief Default freestream velocity array for the COption class. */
10601061
default_eng_cyl[7], /*!< \brief Default engine box array for the COption class. */
10611062
default_eng_val[5], /*!< \brief Default engine box array values for the COption class. */
1062-
default_cfl_adapt[4], /*!< \brief Default CFL adapt param array for the COption class. */
10631063
default_jst_coeff[2], /*!< \brief Default artificial dissipation (flow) array for the COption class. */
10641064
default_ffd_coeff[3], /*!< \brief Default artificial dissipation (flow) array for the COption class. */
10651065
default_mixedout_coeff[3], /*!< \brief Default default mixedout algorithm coefficients for the COption class. */
@@ -1538,13 +1538,6 @@ class CConfig {
15381538
*/
15391539
su2double GetCFL_AdaptParam(unsigned short val_index) const { return CFL_AdaptParam[val_index]; }
15401540

1541-
/*!
1542-
* \brief Set the values of the CFL adaption parameters.
1543-
* \param[in] val_index - Index of the particular CFL adaption parameter
1544-
* \param[in] val_cfl_param - Value of the CFL adaption parameter
1545-
*/
1546-
void SetCFL_AdaptParam(unsigned short val_index, su2double val_cfl_param) { CFL_AdaptParam[val_index] = val_cfl_param; }
1547-
15481541
/*!
15491542
* \brief Get the value of the CFL adaption flag.
15501543
* \return <code>TRUE</code> if CFL adaption is active; otherwise <code>FALSE</code>.
@@ -3652,7 +3645,7 @@ class CConfig {
36523645
* \brief Gas model that we are using.
36533646
* \return Gas model that we are using.
36543647
*/
3655-
string GetGasModel (void) const {return GasModel;}
3648+
string GetGasModel(void) const {return GasModel;}
36563649

36573650
/*!
36583651
* \brief Get the transport coefficient model.
@@ -5208,12 +5201,6 @@ class CConfig {
52085201
*/
52095202
string GetSolution_AdjFileName(void) const { return Solution_AdjFileName; }
52105203

5211-
/*!
5212-
* \brief Get the name of the file with the residual of the problem.
5213-
* \return Name of the file with the residual of the problem.
5214-
*/
5215-
string GetResidual_FileName(void);
5216-
52175204
/*!
52185205
* \brief Get the format of the input/output grid.
52195206
* \return Format of the input/output grid.

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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ const unsigned int INST_0 = 0; /*!< \brief Definition of the first instance per
9494

9595
const su2double STANDARD_GRAVITY = 9.80665; /*!< \brief Acceleration due to gravity at surface of earth. */
9696
const su2double UNIVERSAL_GAS_CONSTANT = 8.3144598; /*!< \brief Universal gas constant in J/(mol*K) */
97-
const su2double BOLTZMANN_CONSTANT = 1.3806503E-23; /*! \brief Boltzmann's constant [J K^-1] */
97+
const su2double BOLTZMANN_CONSTANT = 1.3806503E-23; /*! \brief Boltzmann's constant [J K^-1] */
9898
const su2double AVOGAD_CONSTANT = 6.0221415E26; /*!< \brief Avogardro's constant, number of particles in one kmole. */
9999

100100
const su2double EPS = 1.0E-16; /*!< \brief Error scale. */
@@ -541,9 +541,9 @@ enum ENUM_FLUIDMODEL {
541541
PR_GAS = 3, /*!< \brief Perfect Real gas model. */
542542
CONSTANT_DENSITY = 4, /*!< \brief Constant density gas model. */
543543
INC_IDEAL_GAS = 5, /*!< \brief Incompressible ideal gas model. */
544-
INC_IDEAL_GAS_POLY = 6, /*!< \brief Inc. ideal gas, polynomial gas model. */
544+
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: 30 additions & 13 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*/
@@ -1620,11 +1618,12 @@ void CConfig::SetConfig_Options() {
16201618
/* DESCRIPTION: Activate The adaptive CFL number. */
16211619
addBoolOption("CFL_ADAPT", CFL_Adapt, false);
16221620
/* !\brief CFL_ADAPT_PARAM
1623-
* DESCRIPTION: Parameters of the adaptive CFL number (factor down, factor up, CFL limit (min and max) )
1621+
* DESCRIPTION: Parameters of the adaptive CFL number (factor down, factor up, CFL limit (min and max), acceptable linear residual )
16241622
* Factor down generally <1.0, factor up generally > 1.0 to cause the CFL to increase when the under-relaxation parameter is 1.0
16251623
* and to decrease when the under-relaxation parameter is less than 0.1. Factor is multiplicative. \ingroup Config*/
16261624
default_cfl_adapt[0] = 1.0; default_cfl_adapt[1] = 1.0; default_cfl_adapt[2] = 10.0; default_cfl_adapt[3] = 100.0;
1627-
addDoubleArrayOption("CFL_ADAPT_PARAM", 4, CFL_AdaptParam, default_cfl_adapt);
1625+
default_cfl_adapt[4] = 0.001;
1626+
addDoubleListOption("CFL_ADAPT_PARAM", nCFL_AdaptParam, CFL_AdaptParam);
16281627
/* DESCRIPTION: Reduction factor of the CFL coefficient in the adjoint problem */
16291628
addDoubleOption("CFL_REDUCTION_ADJFLOW", CFLRedCoeff_AdjFlow, 0.8);
16301629
/* DESCRIPTION: Reduction factor of the CFL coefficient in the level set problem */
@@ -2785,7 +2784,6 @@ void CConfig::SetConfig_Options() {
27852784

27862785
/* DESCRIPTION: Size of the edge groups colored for thread parallel edge loops (0 forces the reducer strategy). */
27872786
addUnsignedLongOption("EDGE_COLORING_GROUP_SIZE", edgeColorGroupSize, 512);
2788-
27892787
/* END_CONFIG_OPTIONS */
27902788

27912789
}
@@ -3174,7 +3172,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_
31743172
(Kind_FluidModel == INC_IDEAL_GAS_POLY) ||
31753173
(Kind_FluidModel == CONSTANT_DENSITY));
31763174
bool noneq_gas = ((Kind_FluidModel == MUTATIONPP) ||
3177-
(Kind_FluidModel == USER_DEFINED_NONEQ));
3175+
(Kind_FluidModel == SU2_NONEQ));
31783176
bool standard_air = ((Kind_FluidModel == STANDARD_AIR));
31793177
bool nemo = GetNEMOProblem();
31803178

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

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-
35463540
if (nemo && Kind_TransCoeffModel != WILKE ) {
35473541
SU2_MPI::Error("Only WILKE transport model is stable for the NEMO solver.", CURRENT_FUNCTION);
35483542
}
@@ -3558,6 +3552,14 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_
35583552
SU2_MPI::Error("AUSMPW+ is extremely unstable. Feel free to fix me!", CURRENT_FUNCTION);
35593553
}
35603554

3555+
if (GetGasModel() == "ARGON" && GetKind_FluidModel() == SU2_NONEQ){
3556+
SU2_MPI::Error("ARGON is not working with SU2_NONEQ fluid model!", CURRENT_FUNCTION);
3557+
}
3558+
3559+
if (GetKind_FluidModel() == MUTATIONPP && GetFrozen() == true){
3560+
SU2_MPI::Error("The option of FROZEN_MIXTURE is not yet working with Mutation++ support.", CURRENT_FUNCTION);
3561+
}
3562+
35613563
if(GetBoolTurbomachinery()){
35623564
nBlades = new su2double[nZone];
35633565
FreeStreamTurboNormal= new su2double[3];
@@ -4142,6 +4144,19 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_
41424144
CFL = new su2double[nCFL];
41434145
CFL[0] = CFLFineGrid;
41444146

4147+
/*--- Handle optional CFL adapt parameter values ---*/
4148+
4149+
if (nCFL_AdaptParam < default_cfl_adapt.size()) {
4150+
auto newParam = new su2double [default_cfl_adapt.size()];
4151+
for (iCFL = 0; iCFL < default_cfl_adapt.size(); ++iCFL) {
4152+
if (iCFL < nCFL_AdaptParam) newParam[iCFL] = CFL_AdaptParam[iCFL];
4153+
else newParam[iCFL] = default_cfl_adapt[iCFL];
4154+
}
4155+
swap(newParam, CFL_AdaptParam);
4156+
delete [] newParam;
4157+
nCFL_AdaptParam = default_cfl_adapt.size();
4158+
}
4159+
41454160
/*--- Evaluate when the Cl should be evaluated ---*/
41464161

41474162
Iter_Fixed_CM = SU2_TYPE::Int(nInnerIter / (su2double(Update_iH)+1));
@@ -4978,6 +4993,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_
49784993
/*--- Specifying a deforming surface requires a mesh deformation solver. ---*/
49794994
if (GetSurface_Movement(DEFORMING)) Deform_Mesh = true;
49804995

4996+
if (GetGasModel() == "ARGON") monoatomic = true;
49814997
}
49824998

49834999
void CConfig::SetMarkers(unsigned short val_software) {
@@ -5559,14 +5575,14 @@ void CConfig::SetOutput(unsigned short val_software, unsigned short val_izone) {
55595575
break;
55605576
case NEMO_EULER:
55615577
if (Kind_Regime == COMPRESSIBLE) cout << "Compressible two-temperature thermochemical non-equilibrium Euler equations." << endl;
5562-
if(Kind_FluidModel == USER_DEFINED_NONEQ){
5578+
if(Kind_FluidModel == SU2_NONEQ){
55635579
if ((GasModel != "N2") && (GasModel != "AIR-5") && (GasModel != "ARGON"))
55645580
SU2_MPI::Error("The GAS_MODEL given as input is not valid. Choose one of the options: N2, AIR-5, ARGON.", CURRENT_FUNCTION);
55655581
}
55665582
break;
55675583
case NEMO_NAVIER_STOKES:
55685584
if (Kind_Regime == COMPRESSIBLE) cout << "Compressible two-temperature thermochemical non-equilibrium Navier-Stokes equations." << endl;
5569-
if(Kind_FluidModel == USER_DEFINED_NONEQ){
5585+
if(Kind_FluidModel == SU2_NONEQ){
55705586
if ((GasModel != "N2") && (GasModel != "AIR-5") && (GasModel != "ARGON"))
55715587
SU2_MPI::Error("The GAS_MODEL given as input is not valid. Choose one of the options: N2, AIR-5, ARGON.", CURRENT_FUNCTION);
55725588
}
@@ -6538,7 +6554,8 @@ void CConfig::SetOutput(unsigned short val_software, unsigned short val_izone) {
65386554

65396555
if (!CFL_Adapt) cout << "No CFL adaptation." << endl;
65406556
else cout << "CFL adaptation. Factor down: "<< CFL_AdaptParam[0] <<", factor up: "<< CFL_AdaptParam[1]
6541-
<<",\n lower limit: "<< CFL_AdaptParam[2] <<", upper limit: " << CFL_AdaptParam[3] <<"."<< endl;
6557+
<<",\n lower limit: "<< CFL_AdaptParam[2] <<", upper limit: " << CFL_AdaptParam[3]
6558+
<<",\n acceptable linear residual: "<< CFL_AdaptParam[4] << "." << endl;
65426559

65436560
if (nMGLevels !=0) {
65446561
PrintingToolbox::CTablePrinter MGTable(&std::cout);

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)