Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions SU2_CFD/include/solvers/CFVMFlowSolverBase.inl
Original file line number Diff line number Diff line change
Expand Up @@ -597,20 +597,13 @@ void CFVMFlowSolverBase<V, R>::ComputeUnderRelaxationFactor(CSolver** solver_con

if ((iVar == 0) || (iVar == nVar - 1)) {
const unsigned long index = iPoint * nVar + iVar;
su2double ratio = fabs(LinSysSol[index]) / (nodes->GetSolution(iPoint, iVar) + EPS);
su2double ratio = fabs(LinSysSol[index]) / (fabs(nodes->GetSolution(iPoint, iVar)) + EPS);
if (ratio > allowableRatio) {
localUnderRelaxation = min(allowableRatio / ratio, localUnderRelaxation);
}
}
}

/* In case of turbulence, take the min of the under-relaxation factor
between the mean flow and the turb model. */

if (config->GetKind_Turb_Model() != NONE)
localUnderRelaxation =
min(localUnderRelaxation, solver_container[TURB_SOL]->GetNodes()->GetUnderRelaxation(iPoint));

/* Threshold the relaxation factor in the event that there is
a very small value. This helps avoid catastrophic crashes due
to non-realizable states by canceling the update. */
Expand Down
15 changes: 6 additions & 9 deletions SU2_CFD/src/solvers/CTurbSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -665,9 +665,8 @@ void CTurbSolver::ComputeUnderRelaxationFactor(CSolver **solver_container, const
/* Loop over the solution update given by relaxing the linear
system for this nonlinear iteration. */

su2double localUnderRelaxation = 1.00;
const su2double allowableDecrease = -0.99;
const su2double allowableIncrease = 0.99;
su2double localUnderRelaxation = 1.00;
const su2double allowableRatio = 0.99;
Comment on lines +668 to +669
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, just fyi, the original intent was to allow it to increase and decrease by separate percentages. For S-A, for instance, we often have very large increases at the start of the solve, but only very small decreases, so one may want to allow for a much larger percent increase but limit the decrease to a smaller percentage.

As for swapping out the clipping in SST for something related to under-relaxation thresholds, it could be a good idea. Worth some testing and prob a follow up PR. As you have probably seen, we are only applying the under-relaxation to some S-A variants.. I played around a little with under-relaxation with SST, but I did not have time to experiment properly (and the results seemed very sensitive to it). I do not believe the SST articles in the literature have much to say about clipping. Actually, we had been clipping S-A unnecessarily before putting in the under-relaxation and CFL adaption, which we removed, so it would be good to experiment with SST as well.


SU2_OMP_FOR_STAT(omp_chunk_size)
for (unsigned long iPoint = 0; iPoint < nPointDomain; iPoint++) {
Expand All @@ -679,12 +678,10 @@ void CTurbSolver::ComputeUnderRelaxationFactor(CSolver **solver_container, const
/* We impose a limit on the maximum percentage that the
turbulence variables can change over a nonlinear iteration. */

const unsigned long index = iPoint*nVar + iVar;
su2double ratio = LinSysSol[index]/(nodes->GetSolution(iPoint, iVar)+EPS);
if (ratio > allowableIncrease) {
localUnderRelaxation = min(allowableIncrease/ratio, localUnderRelaxation);
} else if (ratio < allowableDecrease) {
localUnderRelaxation = min(fabs(allowableDecrease)/ratio, localUnderRelaxation);
const unsigned long index = iPoint * nVar + iVar;
su2double ratio = fabs(LinSysSol[index]) / (fabs(nodes->GetSolution(iPoint, iVar)) + EPS);
if (ratio > allowableRatio) {
localUnderRelaxation = min(allowableRatio / ratio, localUnderRelaxation);
}

}
Expand Down
26 changes: 13 additions & 13 deletions TestCases/hybrid_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def main():
rae2822_sa.cfg_dir = "rans/rae2822"
rae2822_sa.cfg_file = "turb_SA_RAE2822.cfg"
rae2822_sa.test_iter = 20
rae2822_sa.test_vals = [-2.021218, -5.268447, 0.807465, 0.060897]
rae2822_sa.test_vals = [-2.021224, -5.268445, 0.807582, 0.060731]
test_list.append(rae2822_sa)

# RAE2822 SST
Expand Down Expand Up @@ -175,7 +175,7 @@ def main():
turb_oneram6.cfg_dir = "rans/oneram6"
turb_oneram6.cfg_file = "turb_ONERAM6.cfg"
turb_oneram6.test_iter = 10
turb_oneram6.test_vals = [-2.412446, -6.702976, 0.229866, 0.147638]
turb_oneram6.test_vals = [-2.388851, -6.689340, 0.230320, 0.157649]
test_list.append(turb_oneram6)

# NACA0012 (SA, FUN3D finest grid results: CL=1.0983, CD=0.01242)
Expand Down Expand Up @@ -215,7 +215,7 @@ def main():
propeller_var_load.cfg_dir = "rans/actuatordisk_variable_load"
propeller_var_load.cfg_file = "propeller_variable_load.cfg"
propeller_var_load.test_iter = 20
propeller_var_load.test_vals = [-1.810684, -4.535582, 0.000252, 0.170455]
propeller_var_load.test_vals = [-1.808010, -4.535613, 0.000190, 0.172483]
test_list.append(propeller_var_load)

#################################
Expand All @@ -240,39 +240,39 @@ def main():
turb_naca0012_1c.cfg_dir = "rans_uq/naca0012"
turb_naca0012_1c.cfg_file = "turb_NACA0012_uq_1c.cfg"
turb_naca0012_1c.test_iter = 10
turb_naca0012_1c.test_vals = [-4.979339, 1.140084, 1.217182, 0.220079]
turb_naca0012_1c.test_vals = [-4.979389, 1.140070, 1.211965, 0.194237]
test_list.append(turb_naca0012_1c)

# NACA0012 2c
turb_naca0012_2c = TestCase('turb_naca0012_2c')
turb_naca0012_2c.cfg_dir = "rans_uq/naca0012"
turb_naca0012_2c.cfg_file = "turb_NACA0012_uq_2c.cfg"
turb_naca0012_2c.test_iter = 10
turb_naca0012_2c.test_vals = [-5.484195, 0.969780, 1.315926, 0.258346]
turb_naca0012_2c.test_vals = [-5.484195, 0.969789, 1.310525, 0.231240]
test_list.append(turb_naca0012_2c)

# NACA0012 3c
turb_naca0012_3c = TestCase('turb_naca0012_3c')
turb_naca0012_3c.cfg_dir = "rans_uq/naca0012"
turb_naca0012_3c.cfg_file = "turb_NACA0012_uq_3c.cfg"
turb_naca0012_3c.test_iter = 10
turb_naca0012_3c.test_vals = [-5.586959, 0.932347, 1.540973, 0.345562]
turb_naca0012_3c.test_vals = [-5.586959, 0.932359, 1.535455, 0.315820]
test_list.append(turb_naca0012_3c)

# NACA0012 p1c1
turb_naca0012_p1c1 = TestCase('turb_naca0012_p1c1')
turb_naca0012_p1c1.cfg_dir = "rans_uq/naca0012"
turb_naca0012_p1c1.cfg_file = "turb_NACA0012_uq_p1c1.cfg"
turb_naca0012_p1c1.test_iter = 10
turb_naca0012_p1c1.test_vals = [-5.132080, 1.076459, 1.183320, 0.207012]
turb_naca0012_p1c1.test_vals = [-5.132081, 1.076462, 1.178093, 0.181595]
test_list.append(turb_naca0012_p1c1)

# NACA0012 p1c2
turb_naca0012_p1c2 = TestCase('turb_naca0012_p1c2')
turb_naca0012_p1c2.cfg_dir = "rans_uq/naca0012"
turb_naca0012_p1c2.cfg_file = "turb_NACA0012_uq_p1c2.cfg"
turb_naca0012_p1c2.test_iter = 10
turb_naca0012_p1c2.test_vals = [-5.556645, 0.945121, 1.246337, 0.231311]
turb_naca0012_p1c2.test_vals = [-5.556648, 0.945129, 1.240986, 0.205071]
test_list.append(turb_naca0012_p1c2)

######################################
Expand All @@ -293,7 +293,7 @@ def main():
hb_rans_preconditioning.cfg_dir = "harmonic_balance/hb_rans_preconditioning"
hb_rans_preconditioning.cfg_file = "davis.cfg"
hb_rans_preconditioning.test_iter = 25
hb_rans_preconditioning.test_vals = [-1.909633, -5.954752, 0.007773, 0.131217]
hb_rans_preconditioning.test_vals = [-1.902391, -5.950120, 0.007786, 0.128110]
hb_rans_preconditioning.new_output = False
test_list.append(hb_rans_preconditioning)

Expand Down Expand Up @@ -386,7 +386,7 @@ def main():
Jones_tc.cfg_dir = "turbomachinery/APU_turbocharger"
Jones_tc.cfg_file = "Jones.cfg"
Jones_tc.test_iter = 5
Jones_tc.test_vals = [-5.280316, 0.379651, 44.725470, 2.271540]
Jones_tc.test_vals = [-5.280316, 0.379651, 72.207590, 1.277638]
Jones_tc.new_output = False
test_list.append(Jones_tc)

Expand All @@ -395,7 +395,7 @@ def main():
Jones_tc_rst.cfg_dir = "turbomachinery/APU_turbocharger"
Jones_tc_rst.cfg_file = "Jones_rst.cfg"
Jones_tc_rst.test_iter = 5
Jones_tc_rst.test_vals = [-4.626647, -1.570858, 34.014100, 10.190720]
Jones_tc_rst.test_vals = [-4.625330, -1.568896, 33.995140, 10.181610]
Jones_tc_rst.new_output = False
test_list.append(Jones_tc_rst)

Expand All @@ -404,7 +404,7 @@ def main():
axial_stage2D.cfg_dir = "turbomachinery/axial_stage_2D"
axial_stage2D.cfg_file = "Axial_stage2D.cfg"
axial_stage2D.test_iter = 20
axial_stage2D.test_vals = [-1.933199, 5.381560, 73.357900, 1.780500]
axial_stage2D.test_vals = [-1.933200, 5.379973, 73.357900, 0.925878]
axial_stage2D.new_output = False
test_list.append(axial_stage2D)

Expand All @@ -413,7 +413,7 @@ def main():
transonic_stator.cfg_dir = "turbomachinery/transonic_stator_2D"
transonic_stator.cfg_file = "transonic_stator.cfg"
transonic_stator.test_iter = 20
transonic_stator.test_vals = [-0.563540, 5.823232, 96.736080, 0.062426]
transonic_stator.test_vals = [-0.562430, 5.828446, 96.436050, 0.062506]
transonic_stator.new_output = False
test_list.append(transonic_stator)

Expand Down
26 changes: 13 additions & 13 deletions TestCases/parallel_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def main():
rae2822_sa.cfg_dir = "rans/rae2822"
rae2822_sa.cfg_file = "turb_SA_RAE2822.cfg"
rae2822_sa.test_iter = 20
rae2822_sa.test_vals = [-2.013881, -5.271311, 0.814981, 0.061858] #last 4 columns
rae2822_sa.test_vals = [-2.014031, -5.271357, 0.815010, 0.061599] #last 4 columns
rae2822_sa.su2_exec = "parallel_computation.py -f"
rae2822_sa.timeout = 1600
rae2822_sa.tol = 0.00001
Expand Down Expand Up @@ -232,7 +232,7 @@ def main():
turb_oneram6.cfg_dir = "rans/oneram6"
turb_oneram6.cfg_file = "turb_ONERAM6.cfg"
turb_oneram6.test_iter = 10
turb_oneram6.test_vals = [-2.412448, -6.702975, 0.229867, 0.147637] #last 4 columns
turb_oneram6.test_vals = [-2.388853, -6.689340, 0.230321, 0.157649] #last 4 columns
turb_oneram6.su2_exec = "parallel_computation.py -f"
turb_oneram6.timeout = 3200
turb_oneram6.tol = 0.00001
Expand Down Expand Up @@ -287,7 +287,7 @@ def main():
propeller_var_load.cfg_dir = "rans/actuatordisk_variable_load"
propeller_var_load.cfg_file = "propeller_variable_load.cfg"
propeller_var_load.test_iter = 20
propeller_var_load.test_vals = [-1.839227, -4.535048, -0.000314, 0.169980] #last 4 columns
propeller_var_load.test_vals = [-1.839281, -4.535070, -0.000323, 0.171814] #last 4 columns
propeller_var_load.su2_exec = "parallel_computation.py -f"
propeller_var_load.timeout = 3200
propeller_var_load.tol = 0.00001
Expand Down Expand Up @@ -642,7 +642,7 @@ def main():
turb_naca0012_1c.cfg_dir = "rans_uq/naca0012"
turb_naca0012_1c.cfg_file = "turb_NACA0012_uq_1c.cfg"
turb_naca0012_1c.test_iter = 10
turb_naca0012_1c.test_vals = [-4.973604, 1.141377, 0.870252, 0.041511] #last 4 columns
turb_naca0012_1c.test_vals = [-4.973604, 1.141376, 0.865859, 0.015106] #last 4 columns
turb_naca0012_1c.su2_exec = "parallel_computation.py -f"
turb_naca0012_1c.timeout = 1600
turb_naca0012_1c.tol = 0.00001
Expand All @@ -653,7 +653,7 @@ def main():
turb_naca0012_2c.cfg_dir = "rans_uq/naca0012"
turb_naca0012_2c.cfg_file = "turb_NACA0012_uq_2c.cfg"
turb_naca0012_2c.test_iter = 10
turb_naca0012_2c.test_vals = [-5.484222, 0.967203, 0.909852, 0.056844] #last 4 columns
turb_naca0012_2c.test_vals = [-5.484222, 0.967199, 0.905520, 0.029991] #last 4 columns
turb_naca0012_2c.su2_exec = "parallel_computation.py -f"
turb_naca0012_2c.timeout = 1600
turb_naca0012_2c.tol = 0.00001
Expand All @@ -664,7 +664,7 @@ def main():
turb_naca0012_3c.cfg_dir = "rans_uq/naca0012"
turb_naca0012_3c.cfg_file = "turb_NACA0012_uq_3c.cfg"
turb_naca0012_3c.test_iter = 10
turb_naca0012_3c.test_vals = [-5.587082, 0.929251, 1.008548, 0.094463] #last 4 columns
turb_naca0012_3c.test_vals = [-5.587082, 0.929246, 1.004417, 0.066538] #last 4 columns
turb_naca0012_3c.su2_exec = "parallel_computation.py -f"
turb_naca0012_3c.timeout = 1600
turb_naca0012_3c.tol = 0.00001
Expand All @@ -675,7 +675,7 @@ def main():
turb_naca0012_p1c1.cfg_dir = "rans_uq/naca0012"
turb_naca0012_p1c1.cfg_file = "turb_NACA0012_uq_p1c1.cfg"
turb_naca0012_p1c1.test_iter = 10
turb_naca0012_p1c1.test_vals = [-5.128243, 1.076374, 0.959431, 0.067416] #last 4 columns
turb_naca0012_p1c1.test_vals = [-5.128243, 1.076375, 0.955242, 0.039885] #last 4 columns
turb_naca0012_p1c1.su2_exec = "parallel_computation.py -f"
turb_naca0012_p1c1.timeout = 1600
turb_naca0012_p1c1.tol = 0.00001
Expand All @@ -686,7 +686,7 @@ def main():
turb_naca0012_p1c2.cfg_dir = "rans_uq/naca0012"
turb_naca0012_p1c2.cfg_file = "turb_NACA0012_uq_p1c2.cfg"
turb_naca0012_p1c2.test_iter = 10
turb_naca0012_p1c2.test_vals = [-5.556656, 0.941889, 0.956330, 0.069297] #last 4 columns
turb_naca0012_p1c2.test_vals = [-5.556656, 0.941887, 0.952078, 0.041824] #last 4 columns
turb_naca0012_p1c2.su2_exec = "parallel_computation.py -f"
turb_naca0012_p1c2.timeout = 1600
turb_naca0012_p1c2.tol = 0.00001
Expand All @@ -713,7 +713,7 @@ def main():
hb_rans_preconditioning.cfg_dir = "harmonic_balance/hb_rans_preconditioning"
hb_rans_preconditioning.cfg_file = "davis.cfg"
hb_rans_preconditioning.test_iter = 25
hb_rans_preconditioning.test_vals = [-1.909596, -5.954720, 0.007773, 0.131219] #last 4 columns
hb_rans_preconditioning.test_vals = [-1.902361, -5.950093, 0.007786, 0.128110] #last 4 columns
hb_rans_preconditioning.su2_exec = "parallel_computation.py -f"
hb_rans_preconditioning.timeout = 1600
hb_rans_preconditioning.tol = 0.00001
Expand Down Expand Up @@ -856,7 +856,7 @@ def main():
Jones_tc.cfg_dir = "turbomachinery/APU_turbocharger"
Jones_tc.cfg_file = "Jones.cfg"
Jones_tc.test_iter = 5
Jones_tc.test_vals = [-5.280323, 0.379654, 44.725390, 2.271597] #last 4 columns
Jones_tc.test_vals = [-5.280323, 0.379654, 72.206950, 1.277699] #last 4 columns
Jones_tc.su2_exec = "parallel_computation.py -f"
Jones_tc.timeout = 1600
Jones_tc.new_output = False
Expand All @@ -868,7 +868,7 @@ def main():
Jones_tc_rst.cfg_dir = "turbomachinery/APU_turbocharger"
Jones_tc_rst.cfg_file = "Jones_rst.cfg"
Jones_tc_rst.test_iter = 5
Jones_tc_rst.test_vals = [-4.626538, -1.570728, 34.013520, 10.190740] #last 4 columns
Jones_tc_rst.test_vals = [-4.625211, -1.568755, 33.994550, 10.181630] #last 4 columns
Jones_tc_rst.su2_exec = "parallel_computation.py -f"
Jones_tc_rst.timeout = 1600
Jones_tc_rst.new_output = False
Expand All @@ -880,7 +880,7 @@ def main():
axial_stage2D.cfg_dir = "turbomachinery/axial_stage_2D"
axial_stage2D.cfg_file = "Axial_stage2D.cfg"
axial_stage2D.test_iter = 20
axial_stage2D.test_vals = [-1.933205, 5.381311, 73.357930, 1.780467] #last 4 columns
axial_stage2D.test_vals = [-1.933206, 5.379711, 73.357930, 0.925874] #last 4 columns
axial_stage2D.su2_exec = "parallel_computation.py -f"
axial_stage2D.timeout = 1600
axial_stage2D.new_output = False
Expand All @@ -892,7 +892,7 @@ def main():
transonic_stator.cfg_dir = "turbomachinery/transonic_stator_2D"
transonic_stator.cfg_file = "transonic_stator.cfg"
transonic_stator.test_iter = 20
transonic_stator.test_vals = [-0.576128, 5.820136, 96.994800, 0.062868] #last 4 columns
transonic_stator.test_vals = [-0.575758, 5.826350, 96.764000, 0.062990] #last 4 columns
transonic_stator.su2_exec = "parallel_computation.py -f"
transonic_stator.timeout = 1600
transonic_stator.new_output = False
Expand Down
Loading