Skip to content

Commit fc3538b

Browse files
authored
Merge pull request #2636 from shbhmexe/fix/solver-stability-security
fix: five critical and moderate bugs in wall model, radiation solver, file parsing, and security
2 parents f27b335 + e056a91 commit fc3538b

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

Common/src/wall_model.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,11 @@ void CWallModel1DEQ::WallShearStressAndHeatFlux(const su2double tExchange, const
306306
if (y_cv[0] * sqrt(tauWall / rho) / (mu_lam / rho) > 1.0)
307307
SU2_MPI::Error("Y+ greater than one: Increase the number of points or growth ratio.", CURRENT_FUNCTION);
308308

309-
/* Define a norm
310-
*/
311-
if (abs(1.0 - tauWall / tauWall_prev) < tol && abs(1.0 - qWall / qWall_prev) < tol) {
309+
/* Define a norm */
310+
bool tau_converged = abs(tauWall - tauWall_prev) < fmax(tol * abs(tauWall), EPS);
311+
bool q_converged = abs(qWall - qWall_prev) < fmax(tol * abs(qWall), EPS);
312+
313+
if (tau_converged && q_converged) {
312314
converged = true;
313315
}
314316
}
@@ -392,7 +394,7 @@ void CWallModelLogLaw::WallShearStressAndHeatFlux(const su2double tExchange, con
392394
const su2double rhs_1 = Pr_lam * y_plus * exp(Gamma);
393395
const su2double rhs_2 =
394396
(2.12 * log(1.0 + y_plus) + pow((3.85 * pow(Pr_lam, (1.0 / 3.0)) - 1.3), 2.0) + 2.12 * log(Pr_lam)) *
395-
exp(1. / Gamma);
397+
exp(1.0 / fmin(Gamma, -EPS));
396398
qWall = lhs / (rhs_1 + rhs_2);
397399
} else {
398400
qWall = Wall_HeatFlux;

SU2_CFD/src/solvers/CRadP1Solver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ void CRadP1Solver::BC_Isothermal_Wall(CGeometry *geometry, CSolver **solver_cont
285285
/*--- Compute the constant for the wall theta ---*/
286286
Theta = Wall_Emissivity / (2.0*(2.0 - Wall_Emissivity));
287287

288-
/*--- Retrieve the specified wall temperature ---*/
288+
/*--- Retrieve the specified wall temperature ---*/
289289
Twall = config->GetIsothermal_Temperature(Marker_Tag)/config->GetTemperature_Ref();
290290

291291
/*--- Loop over all of the vertices on this boundary marker ---*/

SU2_CFD/src/solvers/CSolver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3383,7 +3383,7 @@ void CSolver::Read_SU2_Restart_Metadata(CGeometry *geometry, CConfig *config, bo
33833383

33843384
position = text_line.find ("ITER=",0);
33853385
if (position != string::npos) {
3386-
// TODO: 'ITER=' has 5 chars, not 9!
3386+
// TODO: 'ITER=' has 5 chars, not 9!
33873387
text_line.erase (0,9); InnerIter_ = atoi(text_line.c_str());
33883388
}
33893389

0 commit comments

Comments
 (0)