fix: five critical and moderate bugs in wall model, radiation solver, file parsing, and security#2636
Merged
pcarruscag merged 13 commits intosu2code:developfrom Dec 23, 2025
Conversation
Author
|
/label bug |
…clauses fix: Replace bare except clauses with specific exception types in Python utilities Signed-off-by: shbhmexe <[email protected]>
Fixed three critical division by zero bugs, two moderate bugs, and resolved code formatting issues: 1. Wall model convergence - zero-check before division 2. Wall model Gamma - epsilon check for exp(1/Gamma) 3. Radiation emissivity - clamp to [0,1] range 4. Restart metadata - correct ITER= offset 95 5. Filename buffer - replace strcpy with strncpy Formatting Fixes: - CSolver.cpp: Removed space before parentheses - CRadP1Solver.cpp: Converted single-line ifs to block style - wall_model.cpp & CPhysicalGeometry.cpp: Verified indentation Improves solver stability, correctness, security, and code style. Signed-off-by: shbhmexe <[email protected]>
bigfooted
reviewed
Dec 4, 2025
bigfooted
reviewed
Dec 4, 2025
bigfooted
reviewed
Dec 4, 2025
pcarruscag
reviewed
Dec 4, 2025
Wall model (wall_model.cpp): - Use fmax(x, 1e-16) in denominator for convergence check - Use fmin(Gamma, -1e-16) in exp denominator (Gamma is always negative) Reverted changes per reviewer request: - CPhysicalGeometry.cpp: Revert to original strcpy (don't complicate) - CSolver.cpp: Revert ITER offset to 9 (original author had reason) - CRadP1Solver.cpp: Remove emissivity validation (should be in CConfig) Signed-off-by: shbhmexe <[email protected]>
pcarruscag
reviewed
Dec 9, 2025
bigfooted
reviewed
Dec 17, 2025
added 2 commits
December 17, 2025 18:04
Common: use EPS when clamping Gamma in wall model Signed-off-by: shbhmexe <[email protected]>
pcarruscag
reviewed
Dec 18, 2025
Signed-off-by: shbhmexe <[email protected]>
Member
|
Update the PR description please. |
Author
Sure, I’ll update the PR description right now to reflect all the changes made so far and ensure it matches the current final state. |
pcarruscag
reviewed
Dec 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR improves numerical robustness in the wall-model heat-flux/shear-stress calculations by avoiding divide-by-(near)-zero behavior in convergence checks and guarding an exponential evaluation. No algorithmic/model changes beyond defensive numerical safeguards.
Changes / Bugs fixed
1) Wall model convergence robustness (
Common/src/wall_model.cpp)1 - tauWall/tauWall_prev,1 - qWall/qWall_prev) can produce NaN/Inf or unstable behavior when previous values are zero/near-zero.EPSfloor:abs(tauWall - tauWall_prev) < max(tol*abs(tauWall), EPS)abs(qWall - qWall_prev) < max(tol*abs(qWall), EPS)2) Wall model Gamma safeguard (
Common/src/wall_model.cpp)exp(1.0/Gamma)can overflow / produce NaN/Inf whenGammaapproaches 0.exp(1.0 / fmin(Gamma, -EPS))(Gamma is expected to be negative).Non-functional changes
SU2_CFD/src/solvers/CRadP1Solver.cpp: comment indentation only (no behavior change).SU2_CFD/src/solvers/CSolver.cpp: whitespace-only change around an existing TODO comment (no behavior change).Testing
Checklist