Skip to content

Commit

Permalink
Merge branch 'develop' into testcase_axisymmetric_jet
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristopher-Morales authored Nov 15, 2024
2 parents ecc6331 + c2da451 commit 28be1dd
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 23 deletions.
2 changes: 1 addition & 1 deletion Common/include/CConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,7 @@ class CConfig {
bool Radiation; /*!< \brief Determines if a radiation model is incorporated. */
su2double CFL_Rad; /*!< \brief CFL Number for the radiation solver. */

array<su2double,5> default_cfl_adapt; /*!< \brief Default CFL adapt param array for the COption class. */
array<su2double,6> default_cfl_adapt; /*!< \brief Default CFL adapt param array for the COption class. */
su2double vel_init[3], /*!< \brief initial velocity array for the COption class. */
vel_inf[3], /*!< \brief freestream velocity array for the COption class. */
eng_cyl[7], /*!< \brief engine box array for the COption class. */
Expand Down
12 changes: 9 additions & 3 deletions Common/src/CConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1777,11 +1777,16 @@ void CConfig::SetConfig_Options() {
/* DESCRIPTION: Activate The adaptive CFL number. */
addBoolOption("CFL_ADAPT", CFL_Adapt, false);
/* !\brief CFL_ADAPT_PARAM
* DESCRIPTION: Parameters of the adaptive CFL number (factor down, factor up, CFL limit (min and max), acceptable linear residual )
* DESCRIPTION: Parameters of the adaptive CFL number (factor down, factor up, CFL limit (min and max)[, acceptable linear residual][, starting iteration]).
* Parameters in square brackets are optional, parameter "starting iteration" only valid with parameter "acceptable linear residual".
* Factor down generally <1.0, factor up generally > 1.0 to cause the CFL to increase when the under-relaxation parameter is 1.0
* and to decrease when the under-relaxation parameter is less than 0.1. Factor is multiplicative. \ingroup Config*/
default_cfl_adapt[0] = 1.0; default_cfl_adapt[1] = 1.0; default_cfl_adapt[2] = 10.0; default_cfl_adapt[3] = 100.0;
default_cfl_adapt[0] = 0.1;
default_cfl_adapt[1] = 1.2;
default_cfl_adapt[2] = 10.0;
default_cfl_adapt[3] = 100.0;
default_cfl_adapt[4] = 0.001;
default_cfl_adapt[5] = 0.0;
addDoubleListOption("CFL_ADAPT_PARAM", nCFL_AdaptParam, CFL_AdaptParam);
/* DESCRIPTION: Reduction factor of the CFL coefficient in the adjoint problem */
addDoubleOption("CFL_REDUCTION_ADJFLOW", CFLRedCoeff_AdjFlow, 0.8);
Expand Down Expand Up @@ -7230,7 +7235,8 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) {
if (!CFL_Adapt) cout << "No CFL adaptation." << endl;
else cout << "CFL adaptation. Factor down: "<< CFL_AdaptParam[0] <<", factor up: "<< CFL_AdaptParam[1]
<<",\n lower limit: "<< CFL_AdaptParam[2] <<", upper limit: " << CFL_AdaptParam[3]
<<",\n acceptable linear residual: "<< CFL_AdaptParam[4] << "." << endl;
<<",\n acceptable linear residual: "<< CFL_AdaptParam[4]
<<"'\n starting iteration: "<< CFL_AdaptParam[5] << "." << endl;

if (nMGLevels !=0) {
PrintingToolbox::CTablePrinter MGTable(&std::cout);
Expand Down
9 changes: 7 additions & 2 deletions SU2_CFD/src/solvers/CSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1717,6 +1717,7 @@ void CSolver::AdaptCFLNumber(CGeometry **geometry,
const su2double CFLMin = config->GetCFL_AdaptParam(2);
const su2double CFLMax = config->GetCFL_AdaptParam(3);
const su2double acceptableLinTol = config->GetCFL_AdaptParam(4);
const su2double startingIter = config->GetCFL_AdaptParam(5);
const bool fullComms = (config->GetComm_Level() == COMM_FULL);

/* Number of iterations considered to check for stagnation. */
Expand Down Expand Up @@ -1764,8 +1765,12 @@ void CSolver::AdaptCFLNumber(CGeometry **geometry,

/* Check if we should decrease or if we can increase, the 20% is to avoid flip-flopping. */
resetCFL = linRes > 0.99;
reduceCFL = linRes > 1.2*linTol;
canIncrease = linRes < linTol;
unsigned long iter = config->GetMultizone_Problem() ? config->GetOuterIter() : config->GetInnerIter();

/* only change CFL number when larger than starting iteration */
reduceCFL = (linRes > 1.2*linTol) && (iter >= startingIter);

canIncrease = (linRes < linTol) && (iter >= startingIter);

if ((iMesh == MESH_0) && (Res_Count > 0)) {
Old_Func = New_Func;
Expand Down
3 changes: 1 addition & 2 deletions TestCases/parallel_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -1078,8 +1078,7 @@ def main():
Aachen_3D_restart.cfg_dir = "turbomachinery/Aachen_turbine"
Aachen_3D_restart.cfg_file = "aachen_3D_MP_restart.cfg"
Aachen_3D_restart.test_iter = 5
Aachen_3D_restart.enabled_with_asan = False
Aachen_3D_restart.test_vals = [-9.829186, -8.875103, -9.609509, -8.075211, -7.759491, -4.360714]
Aachen_3D_restart.test_vals = [-7.701448, -8.512241, -6.014939, -6.468738, -5.801759, -4.607179, -5.551037, -5.300771, -3.804188, -5.256055, -5.765160, -3.609605, -2.229276, -2.883962, -0.563469]
test_list.append(Aachen_3D_restart)

# Jones APU Turbocharger restart
Expand Down
2 changes: 1 addition & 1 deletion TestCases/serial_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ def main():
Aachen_3D_restart.cfg_dir = "turbomachinery/Aachen_turbine"
Aachen_3D_restart.cfg_file = "aachen_3D_MP_restart.cfg"
Aachen_3D_restart.test_iter = 5
Aachen_3D_restart.test_vals = [-9.829185, -8.875103, -9.609505, -8.075194, -7.759490, -4.360713]
Aachen_3D_restart.test_vals = [-7.701448, -8.512359, -6.014939, -6.468741, -5.801762, -4.607173, -5.551041, -5.300777, -3.804188, -5.256055, -5.765225, -3.609601, -2.229277, -2.883896, -0.563470]
test_list.append(Aachen_3D_restart)

# Jones APU Turbocharger restart
Expand Down
21 changes: 15 additions & 6 deletions TestCases/turbomachinery/Aachen_turbine/aachen_3D_MP_restart.cfg
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,15 @@ CONDUCTIVITY_MODEL= CONSTANT_PRANDTL
%Navier-Stokes wall boundary marker(s) (NONE = no marker)
MARKER_HEATFLUX= (BLADE1, 0.0, BLADE2, 0.0, BLADE3, 0.0, HUB1, 0.0, SHROUD1, 0.0, HUB2, 0.0, SHROUD2, 0.0, HUB3, 0.0, SHROUD3, 0.0)
%
% ------------------------ WALL FUNCTION DEFINITION --------------------------%
%
MARKER_WALL_FUNCTIONS= ( BLADE1, STANDARD_WALL_FUNCTION , BLADE2, STANDARD_WALL_FUNCTION , BLADE3, STANDARD_WALL_FUNCTION , HUB1, STANDARD_WALL_FUNCTION , SHROUD1, STANDARD_WALL_FUNCTION , HUB2, STANDARD_WALL_FUNCTION , SHROUD2, STANDARD_WALL_FUNCTION , HUB3, STANDARD_WALL_FUNCTION , SHROUD3, STANDARD_WALL_FUNCTION )
WALLMODEL_KAPPA= 0.41
WALLMODEL_B= 5.5
WALLMODEL_MINYPLUS= 5.0
WALLMODEL_MAXITER= 200
WALLMODEL_RELFAC= 0.5

% Periodic boundary marker(s) (NONE = no marker)
% Format: ( periodic marker, donor marker, rot_cen_x, rot_cen_y, rot_cen_z, rot_angle_x-axis, rot_angle_y-axis, rot_angle_z-axis, translation_x, translation_y, translation_z)
MARKER_PERIODIC= (PER1_STATOR1, PER2_STATOR1, 0.0, 0.0, 0.0, 0.0, 0.0, 8.7804878, 0.0, 0.0, 0.0, PER1_ROTOR, PER2_ROTOR, 0.0, 0.0, 0.0, 0.0, 0.0, 8.7804878, 0.0, 0.0, 0.0, PER1_STATOR2, PER2_STATOR2, 0.0, 0.0, 0.0, 0.0, 0.0, 8.7804878, 0.0, 0.0, 0.0)
Expand Down Expand Up @@ -167,7 +176,7 @@ TURBULENT_MIXINGPLANE= YES
RAMP_OUTLET_PRESSURE= NO
%
% Parameters of the outlet pressure ramp (starting outlet pressure, updating-iteration-frequency, total number of iteration for the ramp)
RAMP_OUTLET_PRESSURE_COEFF= (140000.0, 10.0, 2000)
RAMP_OUTLET_PRESSURE_COEFF= (140000.0, 150.0, 2000)
%
% Specify Kind of average process for linearizing the Navier-Stokes equation at inflow and outflow BC included mixing-plane
% (ALGEBRAIC, AREA, MASSSFLUX, MIXEDOUT) default AREA
Expand Down Expand Up @@ -196,7 +205,7 @@ MARKER_MONITORING= (BLADE1, BLADE2, BLADE3)
NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES
%
% Courant-Friedrichs-Lewy condition of the finest grid
CFL_NUMBER= 10
CFL_NUMBER= 2
%
% Adaptive CFL number (NO, YES)
CFL_ADAPT= NO
Expand Down Expand Up @@ -230,8 +239,8 @@ LIMITER_ITER= 999999
% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------%
%
% Convective numerical method
CONV_NUM_METHOD_FLOW= ROE
ENTROPY_FIX_COEFF= 0.001
CONV_NUM_METHOD_FLOW= JST
ENTROPY_FIX_COEFF= 0.3
%
JST_SENSOR_COEFF= ( 0.5, 0.25 )
% Spatial numerical order integration
Expand Down Expand Up @@ -294,7 +303,7 @@ CONV_RESIDUAL_MINVAL= -12
CONV_STARTITER= 10
%
% Screen output fields (use 'SU2_CFD -d <config_file>' to view list of available fields)
SCREEN_OUTPUT= (OUTER_ITER, RMS_DENSITY[0], RMS_DENSITY[1], RMS_DENSITY[2], RMS_MOMENTUM-X[0], RMS_MOMENTUM-Y[0], RMS_ENERGY[0])
SCREEN_OUTPUT= (OUTER_ITER, RMS_DENSITY[0], RMS_DENSITY[1], RMS_DENSITY[2], RMS_MOMENTUM-X[0], RMS_MOMENTUM-X[1], RMS_MOMENTUM-X[2], RMS_MOMENTUM-Y[0], RMS_MOMENTUM-Y[1], RMS_MOMENTUM-Y[2], RMS_MOMENTUM-Z[0], RMS_MOMENTUM-Z[1], RMS_MOMENTUM-Z[2], RMS_ENERGY[0], RMS_ENERGY[1], RMS_ENERGY[2])
%
% History output groups (use 'SU2_CFD -d <config_file>' to view list of available fields)
HISTORY_OUTPUT= (ITER, RMS_RES, TURBO_PERF)
Expand Down Expand Up @@ -349,7 +358,7 @@ SURFACE_FILENAME= surface_flow
SURFACE_ADJ_FILENAME= surface_adjoint
%
% Writing solution file frequency
OUTPUT_WRT_FREQ= 500
OUTPUT_WRT_FREQ= 1000
%
% Writing convergence history frequency
HISTORY_WRT_FREQ_OUTER= 1
Expand Down
8 changes: 4 additions & 4 deletions config_template.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -1389,12 +1389,12 @@ CFL_NUMBER= 15.0
CFL_ADAPT= NO
%
% Parameters of the adaptive CFL number (factor-down, factor-up, CFL min value,
% CFL max value, acceptable linear solver convergence)
% Local CFL increases by factor-up until max if the solution rate of change is not limited,
% and acceptable linear convergence is achieved. It is reduced if rate is limited, or if there
% CFL max value, acceptable linear solver convergence, starting iteration)
% After the starting iteration has passed, local CFL increases by factor-up until max if the solution rate of
% change is not limited, and acceptable linear convergence is achieved. It is reduced if rate is limited, or if there
% is not enough linear convergence, or if the nonlinear residuals are stagnant and oscillatory.
% It is reset back to min when linear solvers diverge, or if nonlinear residuals increase too much.
CFL_ADAPT_PARAM= ( 0.1, 2.0, 10.0, 1e10, 0.001 )
CFL_ADAPT_PARAM= ( 0.1, 2.0, 10.0, 1e10, 0.001, 0)
%
% Maximum Delta Time in local time stepping simulations
MAX_DELTA_TIME= 1E6
Expand Down
4 changes: 2 additions & 2 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ option('extra-deps', type : 'string', value : '', description: 'comma-separated
option('enable-mpp', type : 'boolean', value : false, description: 'enable Mutation++ support')
option('install-mpp', type : 'boolean', value : false, description: 'install Mutation++ in the directory defined with --prefix')
option('enable-coolprop', type : 'boolean', value : false, description: 'enable CoolProp support')
option('enable-mlpcpp', type : 'boolean', value : false, description: 'enable profiling through gprof')
option('enable-gprof', type : 'boolean', value : false, description: 'enable MLPCpp support')
option('enable-mlpcpp', type : 'boolean', value : false, description: 'enable MLPCpp support')
option('enable-gprof', type : 'boolean', value : false, description: 'enable profiling through gprof')
option('opdi-backend', type : 'combo', choices : ['auto', 'macro', 'ompt'], value : 'auto', description: 'OpDiLib backend choice')
option('codi-tape', type : 'combo', choices : ['JacobianLinear', 'JacobianReuse', 'JacobianMultiUse', 'PrimalLinear', 'PrimalReuse', 'PrimalMultiUse'], value : 'JacobianLinear', description: 'CoDiPack tape choice')
option('opdi-shared-read-opt', type : 'boolean', value : true, description : 'OpDiLib shared reading optimization')
Expand Down
2 changes: 1 addition & 1 deletion meson_scripts/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def init_submodules(
github_repo_coolprop = "https://github.com/CoolProp/CoolProp"
sha_version_mel = "46205ab019e5224559091375a6d71aabae6bc5b9"
github_repo_mel = "https://github.com/pcarruscag/MEL"
sha_version_mlpcpp = "c19c53ea2b85ccfb185f1c6c87044dc0b5bc7ae0"
sha_version_mlpcpp = "6865a58b22f21a92977839d9c93eae9522402f55"
github_repo_mlpcpp = "https://github.com/EvertBunschoten/MLPCpp"

medi_name = "MeDiPack"
Expand Down

0 comments on commit 28be1dd

Please sign in to comment.