Skip to content
Open
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
6 changes: 3 additions & 3 deletions SU2_CFD/include/solvers/CScalarSolver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class CScalarSolver : public CSolver {
numerics->SetScalarVar(nodes->GetSolution(iPoint), nodes->GetSolution(jPoint));
numerics->SetScalarVarGradient(nodes->GetGradient(iPoint), nodes->GetGradient(jPoint));

return numerics->ComputeResidual(config);
return numerics->ComputeResidual(config);
};

/*--- Compute fluxes and jacobians i->j ---*/
Expand Down Expand Up @@ -241,7 +241,7 @@ class CScalarSolver : public CSolver {
}
}
}

/*!
* \brief Generic implementation of the fluid interface boundary condition for scalar solvers.
* \tparam SolverSpecificNumericsFunc - lambda that implements solver specific contributions to viscous numerics.
Expand Down Expand Up @@ -427,7 +427,7 @@ class CScalarSolver : public CSolver {
* a nonlinear iteration for stability. Default value 1.0 set in ctor of CScalarVariable.
* \param[in] config - Definition of the particular problem.
*/
virtual void ComputeUnderRelaxationFactor(const CConfig* config) {}
virtual void ComputeUnderRelaxationFactor(CSolver** solver_container, const CConfig* config) {}

public:
/*!
Expand Down
2 changes: 1 addition & 1 deletion SU2_CFD/include/solvers/CScalarSolver.inl
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ void CScalarSolver<VariableType>::PrepareImplicitIteration(CGeometry* geometry,
template <class VariableType>
void CScalarSolver<VariableType>::CompleteImplicitIteration(CGeometry* geometry, CSolver** solver_container,
CConfig* config) {
ComputeUnderRelaxationFactor(config);
ComputeUnderRelaxationFactor(solver_container, config);

/*--- Update solution (system written in terms of increments) ---*/

Expand Down
2 changes: 1 addition & 1 deletion SU2_CFD/include/solvers/CTurbSASolver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class CTurbSASolver final : public CTurbSolver {
* a nonlinear iteration for stability.
* \param[in] config - Definition of the particular problem.
*/
void ComputeUnderRelaxationFactor(const CConfig *config) final;
void ComputeUnderRelaxationFactor(CSolver** solver_container, const CConfig *config) final;

public:
/*!
Expand Down
2 changes: 1 addition & 1 deletion SU2_CFD/include/solvers/CTurbSSTSolver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class CTurbSSTSolver final : public CTurbSolver {
* a nonlinear iteration for stability.
* \param[in] config - Definition of the particular problem.
*/
void ComputeUnderRelaxationFactor(const CConfig *config) override;
void ComputeUnderRelaxationFactor(CSolver** solver_container, const CConfig *config) override;

public:
/*!
Expand Down
2 changes: 1 addition & 1 deletion SU2_CFD/include/solvers/CTurbSolver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,5 +153,5 @@ class CTurbSolver : public CScalarSolver<CTurbVariable> {
* a nonlinear iteration for stability.
* \param[in] allowableRatio - Maximum percentage update in variable per iteration.
*/
void ComputeUnderRelaxationFactorHelper(su2double allowableRatio);
void ComputeUnderRelaxationFactorHelper(CSolver** solver_container, su2double allowableRatio);
};
4 changes: 2 additions & 2 deletions SU2_CFD/src/solvers/CTurbSASolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1555,7 +1555,7 @@ void CTurbSASolver::SetUniformInlet(const CConfig* config, unsigned short iMarke
}
}

void CTurbSASolver::ComputeUnderRelaxationFactor(const CConfig *config) {
void CTurbSASolver::ComputeUnderRelaxationFactor(CSolver** solver_container, const CConfig *config) {

/* Apply the turbulent under-relaxation to the SA variants. The
SA_NEG model is more robust due to allowing for negative nu_tilde,
Expand All @@ -1568,6 +1568,6 @@ void CTurbSASolver::ComputeUnderRelaxationFactor(const CConfig *config) {

const su2double allowableRatio = config->GetMaxUpdateFractionSA();

ComputeUnderRelaxationFactorHelper(allowableRatio);
ComputeUnderRelaxationFactorHelper(solver_container, allowableRatio);

}
4 changes: 2 additions & 2 deletions SU2_CFD/src/solvers/CTurbSSTSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1046,9 +1046,9 @@ void CTurbSSTSolver::SetUniformInlet(const CConfig* config, unsigned short iMark

}

void CTurbSSTSolver::ComputeUnderRelaxationFactor(const CConfig *config) {
void CTurbSSTSolver::ComputeUnderRelaxationFactor(CSolver** solver_container, const CConfig *config) {

const su2double allowableRatio = config->GetMaxUpdateFractionSST();

ComputeUnderRelaxationFactorHelper(allowableRatio);
ComputeUnderRelaxationFactorHelper(solver_container, allowableRatio);
}
13 changes: 9 additions & 4 deletions SU2_CFD/src/solvers/CTurbSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ unsigned long CTurbSolver::RegisterSolutionExtra(bool input, const CConfig* conf
return 0;
}

void CTurbSolver::ComputeUnderRelaxationFactorHelper(su2double allowableRatio) {
void CTurbSolver::ComputeUnderRelaxationFactorHelper(CSolver** solver_container, su2double allowableRatio) {

/* Loop over the solution update given by relaxing the linear
system for this nonlinear iteration. */
Expand All @@ -257,14 +257,19 @@ void CTurbSolver::ComputeUnderRelaxationFactorHelper(su2double allowableRatio) {
su2double localUnderRelaxation = 1.0;

for (unsigned short iVar = 0; iVar < nVar; iVar++) {
const unsigned long index = iPoint * nVar + iVar;
su2double ratio = fabs(LinSysSol[index])/(fabs(nodes->GetSolution(iPoint, iVar)) + EPS);

su2double current_sol = nodes->GetSolution(iPoint, iVar);
if (Conservative) {
/* Need to multiply by density if this is a conservative variable */
current_sol *= solver_container[FLOW_SOL]->GetNodes()->GetDensity(iPoint);
}

su2double ratio = fabs(LinSysSol(iPoint, iVar) / (current_sol + EPS));

/* We impose a limit on the maximum percentage that the
turbulence variables can change over a nonlinear iteration. */
if (ratio > allowableRatio) {
localUnderRelaxation = min(allowableRatio / ratio, localUnderRelaxation);

}
}

Expand Down
22 changes: 11 additions & 11 deletions TestCases/hybrid_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,15 @@ def main():
rae2822_sst.cfg_dir = "rans/rae2822"
rae2822_sst.cfg_file = "turb_SST_RAE2822.cfg"
rae2822_sst.test_iter = 20
rae2822_sst.test_vals = [-0.510339, 5.386831, 0.811983, 0.061600, 0.000000]
rae2822_sst.test_vals = [-0.510329, 6.062197, 0.811983, 0.061600, 0.000000]
test_list.append(rae2822_sst)

# RAE2822 SST_SUST
rae2822_sst_sust = TestCase('rae2822_sst_sust')
rae2822_sst_sust.cfg_dir = "rans/rae2822"
rae2822_sst_sust.cfg_file = "turb_SST_SUST_RAE2822.cfg"
rae2822_sst_sust.test_iter = 20
rae2822_sst_sust.test_vals = [-2.643406, 5.386831, 0.811983, 0.061600]
rae2822_sst_sust.test_vals = [-2.589964, 6.062197, 0.811983, 0.061600]
test_list.append(rae2822_sst_sust)

# Flat plate
Expand Down Expand Up @@ -224,7 +224,7 @@ def main():
turb_naca0012_sst_fixedvalues.cfg_dir = "rans/naca0012"
turb_naca0012_sst_fixedvalues.cfg_file = "turb_NACA0012_sst_fixedvalues.cfg"
turb_naca0012_sst_fixedvalues.test_iter = 10
turb_naca0012_sst_fixedvalues.test_vals = [-5.192389, -10.445226, 0.774100, 1.022534, 0.040529, -2.383436]
turb_naca0012_sst_fixedvalues.test_vals = [-5.192389, -10.448080, 0.773965, 1.022534, 0.040529, -2.383403]
test_list.append(turb_naca0012_sst_fixedvalues)

# NACA0012 (SST, explicit Euler for flow and turbulence equations)
Expand Down Expand Up @@ -278,7 +278,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.979757, 1.345555, 0.450656, -0.030217]
turb_naca0012_1c.test_vals = [-4.979765, 1.343317, 0.445160, -0.028835]
turb_naca0012_1c.test_vals_aarch64 = [-4.976620, 1.345983, 0.433171, -0.033685]
test_list.append(turb_naca0012_1c)

Expand All @@ -287,7 +287,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.482860, 1.263778, 0.403145, -0.043182]
turb_naca0012_2c.test_vals = [-5.482873, 1.260834, 0.398789, -0.041781]
turb_naca0012_2c.test_vals_aarch64 = [-5.485484, 1.263406, 0.411442, -0.040859]
test_list.append(turb_naca0012_2c)

Expand All @@ -296,7 +296,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.583729, 1.232137, 0.384897, -0.047679]
turb_naca0012_3c.test_vals = [-5.583738, 1.228730, 0.381824, -0.046280]
turb_naca0012_3c.test_vals_aarch64 = [-5.583737, 1.232005, 0.390258, -0.046305]
test_list.append(turb_naca0012_3c)

Expand All @@ -305,7 +305,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.133790, 1.285469, 0.551790, 0.009703]
turb_naca0012_p1c1.test_vals = [-5.133798, 1.283504, 0.548676, 0.010882]
turb_naca0012_p1c1.test_vals_aarch64 = [-5.114189, 1.285037, 0.406851, -0.043003]
test_list.append(turb_naca0012_p1c1)

Expand All @@ -314,7 +314,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.553940, 1.237339, 0.427689, -0.034727]
turb_naca0012_p1c2.test_vals = [-5.553950, 1.234029, 0.424324, -0.033438]
turb_naca0012_p1c2.test_vals_aarch64 = [-5.548245, 1.236384, 0.381821, -0.050337]
test_list.append(turb_naca0012_p1c2)

Expand Down Expand Up @@ -564,15 +564,15 @@ 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.065797, 1.519589, -2.928280, 2.573904, -2.526637, 3.017140, 106370.000000, 106370.000000, 5.726800, 64.383000]
axial_stage2D.test_vals = [1.167176, 1.598838, -2.928275, 2.573906, -2.526637, 3.017140, 106370.000000, 106370.000000, 5.726800, 64.383000]
test_list.append(axial_stage2D)

# 2D transonic stator restart
transonic_stator_restart = TestCase('transonic_stator_restart')
transonic_stator_restart.cfg_dir = "turbomachinery/transonic_stator_2D"
transonic_stator_restart.cfg_file = "transonic_stator_restart.cfg"
transonic_stator_restart.test_iter = 20
transonic_stator_restart.test_vals = [-4.442510, -2.561369, -2.165778, 1.652750, -1.355494, 3.172711, -471620.000000, 94.843000, -0.043825]
transonic_stator_restart.test_vals = [-4.367184, -2.487640, -2.079069, 1.728134, -1.464968, 3.224889, -471620.000000, 94.839000, -0.051073]
transonic_stator_restart.test_vals_aarch64 = [-4.442510, -2.561369, -2.165778, 1.652750, -1.355494, 3.172712, -471620.000000, 94.843000, -0.043825]
test_list.append(transonic_stator_restart)

Expand Down Expand Up @@ -656,7 +656,7 @@ def main():
bars_SST_2D.cfg_dir = "sliding_interface/bars_SST_2D"
bars_SST_2D.cfg_file = "bars.cfg"
bars_SST_2D.test_iter = 13
bars_SST_2D.test_vals = [13.000000, -0.621423, -1.660901]
bars_SST_2D.test_vals = [13.000000, -0.623154, -1.660901]
bars_SST_2D.multizone = True
test_list.append(bars_SST_2D)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"VARIABLE" , "AVG_DENSITY[0]", "AVG_ENTHALPY[0]", "AVG_NORMALVEL[0]", "DRAG[0]" , "EFFICIENCY[0]" , "FORCE_X[0]" , "FORCE_Y[0]" , "FORCE_Z[0]" , "LIFT[0]" , "MOMENT_X[0]" , "MOMENT_Y[0]" , "MOMENT_Z[0]" , "SIDEFORCE[0]" , "SURFACE_MACH[0]", "SURFACE_MASSFLOW[0]", "SURFACE_MOM_DISTORTION[0]", "SURFACE_PRESSURE_DROP[0]", "SURFACE_SECONDARY[0]", "SURFACE_SECOND_OVER_UNIFORM[0]", "SURFACE_STATIC_PRESSURE[0]", "SURFACE_STATIC_TEMPERATURE[0]", "SURFACE_TOTAL_PRESSURE[0]", "SURFACE_TOTAL_TEMPERATURE[0]", "SURFACE_UNIFORMITY[0]", "AVG_TEMPERATURE[1]", "TOTAL_HEATFLUX[1]", "FINDIFF_STEP"
0 , 0.0 , -20000.000949949026, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , -0.01000000082740371, 1.1100000001884e-08, -0.04000000330961484 , 0.0 , 0.01000000082740371 , 0.059999993862192014 , -9.999999406318238 , 0.0 , -69.99999868639861 , 0.0 , -0.09999998606957661 , -80.0000009348878 , -359.99998999614036, 1e-08
0 , 0.0 , -850000.0054482371, -7.771600000104802e-08, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , -0.5900000002445616, -2.4420000000008897e-07, -42.92999999933045 , 0.0 , 54.82000000056608 , 110.76999999470871 , 29899.9999984062 , -239.9999971203215 , 28910.000000337277 , -239.9999971203215 , -35.200000003676735 , -80.0000009348878 , -490.00000217347406, 1e-08
Loading