Skip to content

Commit 2378913

Browse files
authored
Merge branch 'develop' into fix_race_conditions
2 parents 85ebbe0 + 40e82f4 commit 2378913

53 files changed

Lines changed: 11426 additions & 189 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Regression tests running on Linux ARM64
2+
3+
on:
4+
push:
5+
branches:
6+
- 'develop'
7+
8+
jobs:
9+
build_on_arm64:
10+
name: Run the jobs on Linux ARM64
11+
uses: './.github/workflows/regression.yml'
12+
with:
13+
runner: 'ARM64'

.github/workflows/regression.yml

Lines changed: 95 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ on:
99
branches:
1010
- 'develop'
1111
- 'master'
12+
workflow_call:
13+
inputs:
14+
runner:
15+
description: 'The github runner to use'
16+
default: 'ubuntu-latest'
17+
required: false
18+
type: string
1219

1320
jobs:
1421
build:
@@ -36,25 +43,37 @@ jobs:
3643
flags: '-Denable-autodiff=true -Denable-normal=false -Dwith-omp=true -Denable-mixedprec=true -Denable-tecio=false --warnlevel=3 --werror'
3744
- config_set: ForwardOMP
3845
flags: '-Denable-directdiff=true -Denable-normal=false -Dwith-omp=true -Denable-mixedprec=true -Denable-tecio=false --warnlevel=3 --werror'
39-
runs-on: ubuntu-latest
46+
runs-on: ${{ inputs.runner || 'ubuntu-latest' }}
4047
steps:
4148
- name: Cache Object Files
42-
uses: actions/cache@v1
49+
uses: actions/cache@v3
4350
with:
4451
path: ccache
4552
key: ${{ matrix.config_set }}-${{ github.sha }}
4653
restore-keys: ${{ matrix.config_set }}
54+
- name: Pre Cleanup
55+
uses: docker://ghcr.io/su2code/su2/build-su2:220614-1237
56+
with:
57+
entrypoint: /bin/rm
58+
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
4759
- name: Build
48-
uses: docker://su2code/build-su2:20191105
60+
uses: docker://ghcr.io/su2code/su2/build-su2:220614-1237
4961
with:
5062
args: -b ${{github.ref}} -f "${{matrix.flags}}"
63+
- name: Compress binaries
64+
run: tar -zcvf install_bin.tgz install/bin
5165
- name: Upload Binaries
52-
uses: actions/upload-artifact@v1
66+
uses: actions/upload-artifact@v3
5367
with:
5468
name: ${{ matrix.config_set }}
55-
path: install/bin
69+
path: install_bin.tgz
70+
- name: Post Cleanup
71+
uses: docker://ghcr.io/su2code/su2/build-su2:220614-1237
72+
with:
73+
entrypoint: /bin/rm
74+
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
5675
regression_tests:
57-
runs-on: ubuntu-latest
76+
runs-on: ${{ inputs.runner || 'ubuntu-latest' }}
5877
name: Regression Tests
5978
needs: build
6079
strategy:
@@ -79,22 +98,44 @@ jobs:
7998
- testscript: 'hybrid_regression_AD.py'
8099
tag: OMP
81100
steps:
82-
- name: Download All artifact
83-
uses: actions/download-artifact@v2
84-
- name: Move Binaries
101+
- name: Pre Cleanup
102+
uses: docker://ghcr.io/su2code/su2/test-su2:220614-1237
103+
with:
104+
entrypoint: /bin/rm
105+
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
106+
- name: Download All artifacts
107+
uses: actions/download-artifact@v3
108+
- name: Uncompress and Move Binaries
85109
run: |
86-
mkdir -p install/bin
87-
if [ -d "${{format('Base{0}', matrix.tag)}}" ]; then cp -r ${{format('Base{0}', matrix.tag)}}/. install/bin/; fi
88-
if [ -d "${{format('Reverse{0}', matrix.tag)}}" ]; then cp -r ${{format('Reverse{0}', matrix.tag)}}/. install/bin/; fi
89-
if [ -d "${{format('Forward{0}', matrix.tag)}}" ]; then cp -r ${{format('Forward{0}', matrix.tag)}}/. install/bin/; fi
90-
chmod a+x install/bin/*
110+
BIN_FOLDER="$PWD/install/bin"
111+
mkdir -p $BIN_FOLDER
112+
ls -lah $BIN_FOLDER
113+
for type in Base Reverse Forward; do
114+
TYPE_FOLDER="${type}${{matrix.tag}}"
115+
echo "Processing '$TYPE_FOLDER' ..."
116+
if [ -d $TYPE_FOLDER ]; then
117+
pushd $TYPE_FOLDER
118+
ls -lah
119+
tar -zxvf install_bin.tgz
120+
ls -lah install/bin/
121+
cp -r install/bin/* $BIN_FOLDER;
122+
popd;
123+
fi
124+
done
125+
chmod a+x $BIN_FOLDER/*
126+
ls -lahR $BIN_FOLDER
91127
- name: Run Tests in Container
92-
uses: docker://su2code/test-su2:20200303
128+
uses: docker://ghcr.io/su2code/su2/test-su2:220614-1237
93129
with:
94130
# -t <Tutorials-branch> -c <Testcases-branch>
95131
args: -b ${{github.ref}} -t develop -c develop -s ${{matrix.testscript}}
132+
- name: Cleanup
133+
uses: docker://ghcr.io/su2code/su2/test-su2:220614-1237
134+
with:
135+
entrypoint: /bin/rm
136+
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
96137
unit_tests:
97-
runs-on: ubuntu-latest
138+
runs-on: ${{ inputs.runner || 'ubuntu-latest' }}
98139
name: Unit Tests
99140
needs: build
100141
strategy:
@@ -109,26 +150,54 @@ jobs:
109150
- testdriver: 'test_driver_DD'
110151
tag: MPI
111152
steps:
153+
- name: Pre Cleanup
154+
uses: docker://ghcr.io/su2code/su2/test-su2:220614-1237
155+
with:
156+
entrypoint: /bin/rm
157+
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
112158
- name: Download Base
113-
uses: actions/download-artifact@v1
159+
uses: actions/download-artifact@v3
114160
with:
115161
name: ${{format('Base{0}', matrix.tag)}}
162+
path: ${{format('Base{0}', matrix.tag)}}
116163
- name: Download Reverse
117-
uses: actions/download-artifact@v1
164+
uses: actions/download-artifact@v3
118165
with:
119166
name: ${{format('Reverse{0}', matrix.tag)}}
167+
path: ${{format('Reverse{0}', matrix.tag)}}
120168
- name: Download Forward
121-
uses: actions/download-artifact@v1
169+
uses: actions/download-artifact@v3
122170
with:
123171
name: ${{format('Forward{0}', matrix.tag)}}
124-
- name: Move Binaries
172+
path: ${{format('Forward{0}', matrix.tag)}}
173+
- name: Uncompress and Move Binaries
125174
run: |
126-
mkdir -p install/bin
127-
cp -r ${{format('Base{0}', matrix.tag)}}/. install/bin/
128-
cp -r ${{format('Reverse{0}', matrix.tag)}}/. install/bin/
129-
cp -r ${{format('Forward{0}', matrix.tag)}}/. install/bin/
130-
chmod a+x install/bin/*
175+
ls -lah
176+
BIN_FOLDER="$PWD/install/bin"
177+
mkdir -p $BIN_FOLDER
178+
ls -laH $BIN_FOLDER
179+
for type in Base Reverse Forward; do
180+
TYPE_FOLDER="${type}${{matrix.tag}}"
181+
if [ -d $TYPE_FOLDER ]; then
182+
echo "Processing '$TYPE_FOLDER' ..."
183+
pushd $TYPE_FOLDER
184+
ls -lah
185+
tar -zxvf install_bin.tgz
186+
ls -laH install/bin/
187+
cp -r install/bin/* $BIN_FOLDER;
188+
popd;
189+
else
190+
echo "$TYPE_FOLDER does not exist!"
191+
fi
192+
done
193+
find $BIN_FOLDER -type f -exec chmod a+x '{}' \;
194+
ls -lahR $BIN_FOLDER
131195
- name: Run Unit Tests
132-
uses: docker://su2code/test-su2:20191031
196+
uses: docker://ghcr.io/su2code/su2/test-su2:220614-1237
133197
with:
134198
entrypoint: install/bin/${{matrix.testdriver}}
199+
- name: Post Cleanup
200+
uses: docker://ghcr.io/su2code/su2/test-su2:220614-1237
201+
with:
202+
entrypoint: /bin/rm
203+
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}

Common/include/CConfig.hpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -802,8 +802,9 @@ class CConfig {
802802
Beta_Factor, /*!< \brief Value of the epsilon^2 multiplier for Beta for the incompressible preconditioner. */
803803
Gas_Constant, /*!< \brief Specific gas constant. */
804804
Gas_ConstantND, /*!< \brief Non-dimensional specific gas constant. */
805-
Molecular_Weight, /*!< \brief Molecular weight of an incompressible ideal gas (g/mol). */
806-
Specific_Heat_Cp, /*!< \brief Specific heat at constant pressure. */
805+
*Molecular_Weight; /*!< \brief Molecular weight of an incompressible ideal gas (g/mol). */
806+
unsigned short nMolecular_Weight; /*!< \brief Number of species molecular weights. */
807+
su2double Specific_Heat_Cp, /*!< \brief Specific heat at constant pressure. */
807808
Specific_Heat_CpND, /*!< \brief Non-dimensional specific heat at constant pressure. */
808809
Specific_Heat_Cv, /*!< \brief Specific heat at constant volume. */
809810
Specific_Heat_CvND, /*!< \brief Non-dimensional specific heat at constant volume. */
@@ -1164,8 +1165,9 @@ class CConfig {
11641165
unsigned short maxBasisDim, /*!< \brief Maximum number of POD basis dimensions. */
11651166
rom_save_freq; /*!< \brief Frequency of unsteady time steps to save. */
11661167

1168+
unsigned short nSpecies, /*!< \brief Number of transported species equations (for NEMO and species transport)*/
1169+
11671170
/* other NEMO configure options*/
1168-
unsigned short nSpecies, /*!< \brief No of species present in flow */
11691171
iWall_Catalytic,
11701172
nWall_Catalytic; /*!< \brief No of catalytic walls */
11711173
su2double *Gas_Composition, /*!< \brief Initial mass fractions of flow [dimensionless] */
@@ -1186,7 +1188,6 @@ class CConfig {
11861188
bool Species_StrongBC; /*!< \brief Boolean whether strong BC's are used for in- outlet of the species solver. */
11871189
su2double* Species_Init; /*!< \brief Initial uniform value for scalar transport. */
11881190
unsigned short nSpecies_Init; /*!< \brief Number of entries of SPECIES_INIT */
1189-
unsigned short n_species; /*!< \brief Number of species equations! Not species itself which would be 1 more. */
11901191

11911192
/*!
11921193
* \brief Set the default values of config options not set in the config file using another config object.
@@ -1608,7 +1609,7 @@ class CConfig {
16081609
* \brief Get the value of the molecular weight for an incompressible ideal gas (g/mol).
16091610
* \return Value of the molecular weight for an incompressible ideal gas (g/mol).
16101611
*/
1611-
su2double GetMolecular_Weight(void) const { return Molecular_Weight; }
1612+
su2double GetMolecular_Weight(unsigned short val_index = 0) const { return Molecular_Weight[val_index]; }
16121613

16131614
/*!
16141615
* \brief Get the value of specific heat at constant pressure.

Common/include/option_structure.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,8 @@ enum ENUM_FLUIDMODEL {
567567
INC_IDEAL_GAS = 5, /*!< \brief Incompressible ideal gas model. */
568568
INC_IDEAL_GAS_POLY = 6, /*!< \brief Inc. ideal gas, polynomial gas model. */
569569
MUTATIONPP = 7, /*!< \brief Mutation++ gas model for nonequilibrium flow. */
570-
SU2_NONEQ = 8 /*!< \brief User defined gas model for nonequilibrium flow. */
570+
SU2_NONEQ = 8, /*!< \brief User defined gas model for nonequilibrium flow. */
571+
FLUID_MIXTURE = 9, /*!< \brief Species mixture model. */
571572
};
572573
static const MapType<std::string, ENUM_FLUIDMODEL> FluidModel_Map = {
573574
MakePair("STANDARD_AIR", STANDARD_AIR)
@@ -579,6 +580,7 @@ static const MapType<std::string, ENUM_FLUIDMODEL> FluidModel_Map = {
579580
MakePair("INC_IDEAL_GAS_POLY", INC_IDEAL_GAS_POLY)
580581
MakePair("MUTATIONPP", MUTATIONPP)
581582
MakePair("SU2_NONEQ", SU2_NONEQ)
583+
MakePair("FLUID_MIXTURE", FLUID_MIXTURE)
582584
};
583585

584586
/*!

Common/src/CConfig.cpp

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,15 +1050,14 @@ void CConfig::SetPointersNull(void) {
10501050

10511051
Time_Ref = 1.0;
10521052

1053-
Delta_UnstTime = 0.0;
1053+
Delta_UnstTime = 0.0;
10541054
Delta_UnstTimeND = 0.0;
1055-
Total_UnstTime = 0.0;
1055+
Total_UnstTime = 0.0;
10561056
Total_UnstTimeND = 0.0;
10571057

10581058
Kind_TimeNumScheme = EULER_IMPLICIT;
10591059

10601060
Gas_Composition = nullptr;
1061-
10621061
}
10631062

10641063
void CConfig::SetConfig_Options() {
@@ -1168,7 +1167,7 @@ void CConfig::SetConfig_Options() {
11681167
/*!\brief THERMAL_EXPANSION_COEFF \n DESCRIPTION: Thermal expansion coefficient (0.00347 K^-1 (air), used for Boussinesq approximation for liquids/non-ideal gases) \ingroup Config*/
11691168
addDoubleOption("THERMAL_EXPANSION_COEFF", Thermal_Expansion_Coeff, 0.00347);
11701169
/*!\brief MOLECULAR_WEIGHT \n DESCRIPTION: Molecular weight for an incompressible ideal gas (28.96 g/mol (air) default) \ingroup Config*/
1171-
addDoubleOption("MOLECULAR_WEIGHT", Molecular_Weight, 28.96);
1170+
addDoubleListOption("MOLECULAR_WEIGHT", nMolecular_Weight, Molecular_Weight);
11721171

11731172
///* DESCRIPTION: Specify if Mutation++ library is used */
11741173
/*--- Reading gas model as string or integer depending on TC library used. ---*/
@@ -3308,6 +3307,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
33083307
bool ideal_gas = ((Kind_FluidModel == STANDARD_AIR) ||
33093308
(Kind_FluidModel == IDEAL_GAS) ||
33103309
(Kind_FluidModel == INC_IDEAL_GAS) ||
3310+
(Kind_FluidModel == FLUID_MIXTURE) ||
33113311
(Kind_FluidModel == INC_IDEAL_GAS_POLY) ||
33123312
(Kind_FluidModel == CONSTANT_DENSITY));
33133313
bool noneq_gas = ((Kind_FluidModel == MUTATIONPP) ||
@@ -3741,6 +3741,35 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
37413741
}
37423742
}
37433743

3744+
/*--- Set default values for various fluid properties. ---*/
3745+
3746+
const su2double Molecular_Weight_Default = 28.96;
3747+
3748+
if (Molecular_Weight == nullptr) {
3749+
Molecular_Weight = new su2double[1];
3750+
Molecular_Weight[0] = Molecular_Weight_Default;
3751+
nMolecular_Weight = 1;
3752+
}
3753+
3754+
/*--- Check whether inputs for FLUID_MIXTURE are correctly specified. ---*/
3755+
3756+
if (Kind_FluidModel == FLUID_MIXTURE) {
3757+
/*--- Check whether the number of entries of each specified fluid property equals the number of transported scalar
3758+
equations solved + 1. nMolecular_Weight is used because it is required for the fluid mixing models. --- */
3759+
if (nMolecular_Weight != nSpecies_Init + 1) {
3760+
SU2_MPI::Error(
3761+
"The use of FLUID_MIXTURE requires the number of entries for MOLECULAR_WEIGHT\n"
3762+
"to be equal to the number of entries of SCALAR_INIT + 1",
3763+
CURRENT_FUNCTION);
3764+
}
3765+
/*--- Check whether the density model used is correct, in the case of FLUID_MIXTURE the density model must be
3766+
VARIABLE. Otherwise, if the density model is CONSTANT, the scalars will not have influence the mixture density and
3767+
it will remain constant through the complete domain. --- */
3768+
if (Kind_DensityModel != INC_DENSITYMODEL::VARIABLE) {
3769+
SU2_MPI::Error("The use of FLUID_MIXTURE requires the INC_DENSITY_MODEL option to be VARIABLE", CURRENT_FUNCTION);
3770+
}
3771+
}
3772+
37443773
/*--- Overrule the default values for viscosity if the US measurement system is used. ---*/
37453774

37463775
if (SystemMeasurements == US) {
@@ -4725,7 +4754,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
47254754
}
47264755

47274756
if (Kind_DensityModel == INC_DENSITYMODEL::VARIABLE) {
4728-
if (Kind_FluidModel != INC_IDEAL_GAS && Kind_FluidModel != INC_IDEAL_GAS_POLY) {
4757+
if (Kind_FluidModel != INC_IDEAL_GAS && Kind_FluidModel != INC_IDEAL_GAS_POLY && Kind_FluidModel != FLUID_MIXTURE) {
47294758
SU2_MPI::Error("Variable density incompressible solver limited to ideal gases.\n Check the fluid model options (use INC_IDEAL_GAS, INC_IDEAL_GAS_POLY).", CURRENT_FUNCTION);
47304759
}
47314760
}
@@ -4738,7 +4767,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
47384767

47394768
if (Kind_Solver == MAIN_SOLVER::INC_NAVIER_STOKES || Kind_Solver == MAIN_SOLVER::INC_RANS) {
47404769
if (Kind_ViscosityModel == VISCOSITYMODEL::SUTHERLAND) {
4741-
if ((Kind_FluidModel != INC_IDEAL_GAS) && (Kind_FluidModel != INC_IDEAL_GAS_POLY)) {
4770+
if ((Kind_FluidModel != INC_IDEAL_GAS) && (Kind_FluidModel != INC_IDEAL_GAS_POLY) && (Kind_FluidModel != FLUID_MIXTURE)) {
47424771
SU2_MPI::Error("Sutherland's law only valid for ideal gases in incompressible flows.\n Must use VISCOSITY_MODEL=CONSTANT_VISCOSITY and set viscosity with\n MU_CONSTANT, or use DENSITY_MODEL= VARIABLE with FLUID_MODEL= INC_IDEAL_GAS or INC_IDEAL_GAS_POLY for VISCOSITY_MODEL=SUTHERLAND.\n NOTE: FREESTREAM_VISCOSITY is no longer used for incompressible flows!", CURRENT_FUNCTION);
47434772
}
47444773
}

SU2_CFD/include/fluid/CConstantDensity.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class CConstantDensity final : public CFluidModel {
4949
* \brief Set the Dimensionless State using Temperature.
5050
* \param[in] t - Temperature value at the point.
5151
*/
52-
void SetTDState_T(su2double t) override {
52+
void SetTDState_T(su2double t, const su2double *val_scalars = nullptr) override {
5353
/* Density is constant and thermodynamic pressure is
5454
not required for incompressible, constant density flows,
5555
but the energy equation can still be computed as a

SU2_CFD/include/fluid/CFluidModel.hpp

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,26 @@ class CFluidModel {
119119
*/
120120
su2double GetCv() const { return Cv; }
121121

122+
/*!
123+
* \brief Compute and return fluid mean molecular weight in kg/mol.
124+
*/
125+
template <class Vector_t>
126+
static su2double ComputeMeanMolecularWeight(const Vector_t& molar_masses, const su2double* val_scalars) {
127+
su2double OneOverMeanMolecularWeight = 0.0;
128+
su2double val_scalars_sum = 0.0;
129+
130+
for (size_t i_scalar = 0; i_scalar < molar_masses.size() - 1; i_scalar++) {
131+
OneOverMeanMolecularWeight += val_scalars[i_scalar] / (molar_masses[i_scalar] / 1000);
132+
val_scalars_sum += val_scalars[i_scalar];
133+
}
134+
OneOverMeanMolecularWeight += (1 - val_scalars_sum) / (molar_masses[molar_masses.size() - 1] / 1000);
135+
return 1 / OneOverMeanMolecularWeight;
136+
}
137+
122138
/*!
123139
* \brief Get fluid dynamic viscosity.
124140
*/
125-
su2double GetLaminarViscosity() {
141+
inline su2double GetLaminarViscosity() {
126142
LaminarViscosity->SetViscosity(Temperature, Density);
127143
Mu = LaminarViscosity->GetViscosity();
128144
LaminarViscosity->SetDerViscosity(Temperature, Density);
@@ -135,7 +151,7 @@ class CFluidModel {
135151
* \brief Get fluid thermal conductivity.
136152
*/
137153

138-
su2double GetThermalConductivity() {
154+
inline su2double GetThermalConductivity() {
139155
ThermalConductivity->SetConductivity(Temperature, Density, Mu, Mu_Turb, Cp);
140156
Kt = ThermalConductivity->GetConductivity();
141157
ThermalConductivity->SetDerConductivity(Temperature, Density, dmudrho_T, dmudT_rho, Cp);
@@ -291,11 +307,10 @@ class CFluidModel {
291307
* \brief Virtual member.
292308
* \param[in] T - Temperature value at the point.
293309
*/
294-
virtual void SetTDState_T(su2double val_Temperature) {}
310+
virtual void SetTDState_T(su2double val_Temperature, const su2double* val_scalars = nullptr) {}
295311

296312
/*!
297313
* \brief Set fluid eddy viscosity provided by a turbulence model needed for computing effective thermal conductivity.
298314
*/
299315
void SetEddyViscosity(su2double val_Mu_Turb) { Mu_Turb = val_Mu_Turb; }
300-
301316
};

0 commit comments

Comments
 (0)