Skip to content

Commit 922d55d

Browse files
authored
Merge pull request #2522 from Bot-Enigma-0/feature_sst_rework
moving fork to su2code
2 parents a0ab3da + 25ef2c8 commit 922d55d

Some content is hidden

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

47 files changed

+1410
-272
lines changed

.github/workflows/regression.yml

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
strategy:
2424
fail-fast: false
2525
matrix:
26-
config_set: [BaseMPI, ReverseMPI, ForwardMPI, BaseNoMPI, ReverseNoMPI, ForwardNoMPI, BaseOMP, ReverseOMP, ForwardOMP]
26+
config_set: [BaseMPI, ReverseMPI, ForwardMPI, BaseNoMPI, ReverseNoMPI, ForwardNoMPI, ReverseTagNoMPI, BaseOMP, ReverseOMP, ForwardOMP]
2727
include:
2828
- config_set: BaseMPI
2929
flags: '-Denable-pywrapper=true -Denable-coolprop=true -Denable-mpp=true -Dinstall-mpp=true -Denable-mlpcpp=true -Denable-tests=true --warnlevel=2'
@@ -37,6 +37,8 @@ jobs:
3737
flags: '-Denable-autodiff=true -Denable-normal=false -Dwith-mpi=disabled -Denable-pywrapper=true -Denable-tests=true --warnlevel=3 --werror'
3838
- config_set: ForwardNoMPI
3939
flags: '-Denable-directdiff=true -Denable-normal=false -Dwith-mpi=disabled -Denable-tests=true --warnlevel=3 --werror'
40+
- config_set: ReverseTagNoMPI
41+
flags: '-Denable-autodiff=true -Denable-normal=false -Dwith-mpi=disabled -Denable-pywrapper=true -Denable-tests=true --warnlevel=3 --werror -Dcodi-tape=Tag'
4042
- config_set: BaseOMP
4143
flags: '-Dwith-omp=true -Denable-mixedprec=true -Denable-pywrapper=true -Denable-tecio=false --warnlevel=3 --werror'
4244
- config_set: ReverseOMP
@@ -215,6 +217,55 @@ jobs:
215217
with:
216218
entrypoint: /bin/rm
217219
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
220+
discadj_tape_tests:
221+
if: inputs.runner != 'ARM64'
222+
runs-on: ${{ inputs.runner || 'ubuntu-latest' }}
223+
name: Tape Tests
224+
needs: build
225+
strategy:
226+
fail-fast: false
227+
matrix:
228+
testscript: ['serial_regression_AD.py']
229+
include:
230+
- testscript: 'serial_regression_AD.py'
231+
tag: TagNoMPI
232+
steps:
233+
- name: Pre Cleanup
234+
uses: docker://ghcr.io/su2code/su2/test-su2:240320-1536
235+
with:
236+
entrypoint: /bin/rm
237+
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
238+
- name: Download All artifacts
239+
uses: actions/download-artifact@v4
240+
- name: Uncompress and Move Binaries
241+
run: |
242+
BIN_FOLDER="$PWD/install/bin"
243+
mkdir -p $BIN_FOLDER
244+
ls -lah $BIN_FOLDER
245+
for type in Base Reverse Forward; do
246+
TYPE_FOLDER="${type}${{matrix.tag}}"
247+
echo "Processing '$TYPE_FOLDER' ..."
248+
if [ -d $TYPE_FOLDER ]; then
249+
pushd $TYPE_FOLDER
250+
ls -lah
251+
tar -zxvf install_bin.tgz
252+
ls -lah install/bin/
253+
cp -r install/* $BIN_FOLDER/../
254+
popd;
255+
fi
256+
done
257+
chmod a+x $BIN_FOLDER/*
258+
ls -lahR $BIN_FOLDER
259+
- name: Run Tests in Container
260+
uses: docker://ghcr.io/su2code/su2/test-su2:240320-1536
261+
with:
262+
# -t <Tutorials-branch> -c <Testcases-branch>
263+
args: -b ${{github.ref}} -t develop -c develop -s ${{matrix.testscript}} -a "--tapetests"
264+
- name: Cleanup
265+
uses: docker://ghcr.io/su2code/su2/test-su2:240320-1536
266+
with:
267+
entrypoint: /bin/rm
268+
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
218269
thread_sanitizer_tests:
219270
if: inputs.runner != 'ARM64'
220271
runs-on: ${{ inputs.runner || 'ubuntu-latest' }}

Common/include/CConfig.hpp

Lines changed: 77 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -591,14 +591,17 @@ class CConfig {
591591
MUSCL_AdjTurb; /*!< \brief MUSCL scheme for the adj turbulence equations.*/
592592
bool MUSCL_Species; /*!< \brief MUSCL scheme for the species equations.*/
593593
bool Use_Accurate_Jacobians; /*!< \brief Use numerically computed Jacobians for AUSM+up(2) and SLAU(2). */
594+
bool Use_Accurate_Turb_Jacobians; /*!< \brief Use numerically computed Jacobians for standard SA turbulence model. */
594595
bool EulerPersson; /*!< \brief Boolean to determine whether this is an Euler simulation with Persson shock capturing. */
595596
bool FSI_Problem = false,/*!< \brief Boolean to determine whether the simulation is FSI or not. */
596597
Multizone_Problem; /*!< \brief Boolean to determine whether we are solving a multizone problem. */
597598
//bool ContactResistance = false; /*!< \brief Apply contact resistance for conjugate heat transfer. */
598599
unsigned short nID_DV; /*!< \brief ID for the region of FEM when computed using direct differentiation. */
599600

600-
bool AD_Mode; /*!< \brief Algorithmic Differentiation support. */
601-
bool AD_Preaccumulation; /*!< \brief Enable or disable preaccumulation in the AD mode. */
601+
bool AD_Mode; /*!< \brief Algorithmic Differentiation support. */
602+
bool AD_Preaccumulation; /*!< \brief Enable or disable preaccumulation in the AD mode. */
603+
CHECK_TAPE_TYPE AD_CheckTapeType; /*!< \brief Type of tape that is checked in a tape debug run. */
604+
CHECK_TAPE_VARIABLES AD_CheckTapeVariables; /*!< \brief Type of variables that are checked in a tape debug run. */
602605
STRUCT_COMPRESS Kind_Material_Compress; /*!< \brief Determines if the material is compressible or incompressible (structural analysis). */
603606
STRUCT_MODEL Kind_Material; /*!< \brief Determines the material model to be used (structural analysis). */
604607
STRUCT_DEFORMATION Kind_Struct_Solver; /*!< \brief Determines the geometric condition (small or large deformations) for structural analysis. */
@@ -636,6 +639,9 @@ class CConfig {
636639
su2double Relaxation_Factor_Adjoint; /*!< \brief Relaxation coefficient for variable updates of adjoint solvers. */
637640
su2double Relaxation_Factor_CHT; /*!< \brief Relaxation coefficient for the update of conjugate heat variables. */
638641
su2double EntropyFix_Coeff; /*!< \brief Entropy fix coefficient. */
642+
su2double Max_Update_SST; /*!< \brief Cap for the Under-Relaxation Factor for SST Turbulent Variables*/
643+
su2double Max_Update_SA; /*!< \brief Cap for the Under-Relaxation Factor for SA Turbulent Variables*/
644+
su2double Max_Update_Flow; /*!< \brief Cap for the Under-Relaxation Factor for Flow Density and Energy Variables*/
639645
unsigned short nLocationStations, /*!< \brief Number of section cuts to make when outputting mesh and cp . */
640646
nWingStations; /*!< \brief Number of section cuts to make when calculating internal volume. */
641647
su2double Kappa_1st_AdjFlow, /*!< \brief Lax 1st order dissipation coefficient for adjoint flow equations (coarse multigrid levels). */
@@ -822,6 +828,7 @@ class CConfig {
822828
SurfSens_FileName, /*!< \brief Output file for the sensitivity on the surface (discrete adjoint). */
823829
VolSens_FileName, /*!< \brief Output file for the sensitivity in the volume (discrete adjoint). */
824830
ObjFunc_Hess_FileName; /*!< \brief Hessian approximation obtained by the Sobolev smoothing solver. */
831+
bool Multizone_Adapt_FileName; /*!< \brief Append zone number to solution and restart file names. */
825832

826833
bool
827834
Wrt_Performance, /*!< \brief Write the performance summary at the end of a calculation. */
@@ -1055,7 +1062,8 @@ class CConfig {
10551062
long ParMETIS_pointWgt; /*!< \brief Load balancing weight given to points. */
10561063
long ParMETIS_edgeWgt; /*!< \brief Load balancing weight given to edges. */
10571064
unsigned short DirectDiff; /*!< \brief Direct Differentation mode. */
1058-
bool DiscreteAdjoint; /*!< \brief AD-based discrete adjoint mode. */
1065+
bool DiscreteAdjoint, /*!< \brief AD-based discrete adjoint mode. */
1066+
DiscreteAdjointDebug; /*!< \brief Discrete adjoint debug mode using tags. */
10591067
su2double Const_DES; /*!< \brief Detached Eddy Simulation Constant. */
10601068
WINDOW_FUNCTION Kind_WindowFct; /*!< \brief Type of window (weight) function for objective functional. */
10611069
unsigned short Kind_HybridRANSLES; /*!< \brief Kind of Hybrid RANS/LES. */
@@ -1897,6 +1905,12 @@ class CConfig {
18971905
*/
18981906
su2double GetPressure_FreeStreamND(void) const { return Pressure_FreeStreamND; }
18991907

1908+
/*!
1909+
* \brief Get a reference to the non-dimensionalized freestream pressure (used for AD tracking).
1910+
* \return Reference to non-dimensionalized freestream pressure.
1911+
*/
1912+
su2double& GetPressure_FreeStreamND(void) { return Pressure_FreeStreamND; }
1913+
19001914
/*!
19011915
* \brief Get the value of the thermodynamic pressure.
19021916
* \return Thermodynamic pressure.
@@ -1922,6 +1936,12 @@ class CConfig {
19221936
*/
19231937
su2double GetTemperature_FreeStreamND(void) const { return Temperature_FreeStreamND; }
19241938

1939+
/*!
1940+
* \brief Get a reference to the non-dimensionalized freestream temperature (used for AD tracking).
1941+
* \return Reference to non-dimensionalized freestream temperature.
1942+
*/
1943+
su2double& GetTemperature_FreeStreamND(void) { return Temperature_FreeStreamND; }
1944+
19251945
/*!
19261946
* \brief Get the value of the non-dimensionalized vibrational-electronic freestream temperature.
19271947
* \return Non-dimensionalized vibrational-electronic freestream temperature.
@@ -4208,6 +4228,24 @@ class CConfig {
42084228
*/
42094229
su2double GetRelaxation_Factor_CHT(void) const { return Relaxation_Factor_CHT; }
42104230

4231+
/*!
4232+
* \brief Get the under-relaxation for flow variables density and energy.
4233+
* \return under-relaxation for flow variables.
4234+
*/
4235+
su2double GetUnderRelax_Flow(void) const { return Max_Update_Flow; }
4236+
4237+
/*!
4238+
* \brief Get the under-relaxation for SA variable, nu_tilde.
4239+
* \return under-relaxation for SA variables.
4240+
*/
4241+
su2double GetUnderRelax_SA(void) const { return Max_Update_SA; }
4242+
4243+
/*!
4244+
* \brief Get the under-relaxation for SST turbulence variables k and omega.
4245+
* \return under-relaxation for SST variables.
4246+
*/
4247+
su2double GetUnderRelax_SST(void) const { return Max_Update_SST; }
4248+
42114249
/*!
42124250
* \brief Get the number of samples used in quasi-Newton methods.
42134251
*/
@@ -4500,6 +4538,12 @@ class CConfig {
45004538
*/
45014539
bool GetUse_Accurate_Jacobians(void) const { return Use_Accurate_Jacobians; }
45024540

4541+
/*!
4542+
* \brief Get whether to "Use Accurate Jacobians" for Standard SA turbulence model.
4543+
* \return yes/no.
4544+
*/
4545+
bool GetUse_Accurate_Turb_Jacobians(void) const { return Use_Accurate_Turb_Jacobians; }
4546+
45034547
/*!
45044548
* \brief Get the kind of integration scheme (explicit or implicit)
45054549
* for the flow equations.
@@ -5384,19 +5428,25 @@ class CConfig {
53845428
bool GetWrt_Volume_Overwrite(void) const { return Wrt_Volume_Overwrite; }
53855429

53865430
/*!
5387-
* \brief Provides the number of varaibles.
5431+
* \brief Get whether filenames are appended the zone number automatically (multiphysics solver).
5432+
* \return Flag for appending zone numbers to restart and solution filenames. If Flag=true, zone numer is appended.
5433+
*/
5434+
bool GetMultizone_AdaptFilename(void) const { return Multizone_Adapt_FileName; }
5435+
5436+
/*!
5437+
* \brief Provides the number of variables.
53885438
* \return Number of variables.
53895439
*/
53905440
unsigned short GetnVar(void);
53915441

53925442
/*!
5393-
* \brief Provides the number of varaibles.
5443+
* \brief Provides the number of variables.
53945444
* \return Number of variables.
53955445
*/
53965446
unsigned short GetnZone(void) const { return nZone; }
53975447

53985448
/*!
5399-
* \brief Provides the number of varaibles.
5449+
* \brief Provides the number of variables.
54005450
* \return Number of variables.
54015451
*/
54025452
unsigned short GetiZone(void) const { return iZone; }
@@ -8779,6 +8829,12 @@ class CConfig {
87798829
*/
87808830
bool GetDiscrete_Adjoint(void) const { return DiscreteAdjoint; }
87818831

8832+
/*!
8833+
* \brief Get the indicator whether a debug run for the discrete adjoint solver will be started.
8834+
* \return the discrete adjoint debug indicator.
8835+
*/
8836+
bool GetDiscrete_Adjoint_Debug(void) const { return DiscreteAdjointDebug; }
8837+
87828838
/*!
87838839
* \brief Get the number of subiterations while a ramp is applied.
87848840
* \return Number of FSI subiters.
@@ -9216,6 +9272,16 @@ class CConfig {
92169272
*/
92179273
su2double GetConst_DES(void) const { return Const_DES; }
92189274

9275+
/*!
9276+
* \brief Get the type of tape that will be checked in a tape debug run.
9277+
*/
9278+
CHECK_TAPE_TYPE GetAD_CheckTapeType(void) const { return AD_CheckTapeType; }
9279+
9280+
/*!
9281+
* \brief Get the type of variables that will be checked for in a tape debug run.
9282+
*/
9283+
CHECK_TAPE_VARIABLES GetAD_CheckTapeVariables(void) const { return AD_CheckTapeVariables; }
9284+
92199285
/*!
92209286
* \brief Get if AD preaccumulation should be performed.
92219287
*/
@@ -9605,6 +9671,11 @@ class CConfig {
96059671
*/
96069672
unsigned short GetnVolumeOutputFiles() const { return nVolumeOutputFiles; }
96079673

9674+
/*!
9675+
* \brief GetnVolumeOutputFrequencies
9676+
*/
9677+
unsigned short GetnVolumeOutputFrequencies() const { return nVolumeOutputFrequencies; }
9678+
96089679
/*!
96099680
* \brief GetVolumeOutputFrequency
96109681
* \param[in] iFile: index of file number for which the writing frequency needs to be returned.

0 commit comments

Comments
 (0)