Lid driven cavity flow tutorial - #86
Open
thijsaalbers wants to merge 3 commits into
Open
Conversation
6 tasks
pcarruscag
added a commit
to su2code/SU2
that referenced
this pull request
Sep 14, 2026
- Gate the PB config-validation guard block on Kind_Regime == INCOMPRESSIBLE, not just the raw KIND_INCOMP_SYSTEM value. That option is read regardless of solver family, so a compressible or SU2_DEF config carrying a leftover PRESSURE_BASED line would otherwise hard-error on an unrelated MGLEVEL/TIME_DOMAIN/adjoint check. - Inline the substance of the TIME_DOMAIN guard's explanation instead of pointing at PB_SOLVER_PLAN.md, which is a local untracked planning file and not part of this branch's committed tree - anyone else checking out pr2812 would have hit a dangling reference. - Fix CIncNSSolver::Preprocessing's primitive-gradient switch to also handle plain NUM_METHOD_GRAD= LEAST_SQUARES, matching the fix adc77f6 already applied to the inviscid path (CIncEulerSolver::Preprocessing / ComputeEdgeMassFluxesRhieChow). The viscous solver calls CommonPreprocessing directly rather than the Euler override, so it had its own copy of the same gap: with plain LEAST_SQUARES the pressure gradient silently stayed zero. Confirmed no registered incompressible Navier-Stokes regression case uses plain LEAST_SQUARES, so this doesn't move any existing test_vals. - Add explanatory comments to CPBConvection_Base::ComputeJacobian's continuity and enthalpy rows, which still carry proj_vel-derived terms that contradict the "mass flux is frozen, so d(m_f)/du = 0" reasoning 9592182 used to justify dropping the equivalent momentum-row term. Left the values as-is rather than changing them blind: the continuity row is provably harmless (PrepareImplicitIteration_impl deletes row 0 for the pressure-based solver before the linear system is assembled), and the enthalpy row/column only matter when INC_ENERGY_EQUATION= YES, which no currently-registered pressure-based regression case exercises - so there's no test coverage to validate a re-derivation against. - Disable (rather than delete) the tutorials.py lid_driven_cavity entry: su2code/Tutorials#86, which adds the referenced Inc_Lid_Driven_Cavity/incomp_pb_liddrivencavity.cfg and its mesh, has not landed (checked the local Tutorials clone - no matching branch or content). Leaving the entry active would fail CI outright rather than fail a regression check. Kept the recorded test_vals in a comment so whoever lands that Tutorials PR can re-enable this with one uncomment, not a re-derivation. Not changed, on reflection: - The RowDeleted second Jacobian-diagonal sweep in SetMomCoeff (flagged as an efficiency finding) does add real cost, but a correctness-safe fix would need CIncEulerVariable::strongBC extended to cover wall and outlet row-deletions too (currently only set for the far-field-inflow case), which is a real behavioral change I'm not making blind. Left as-is. - The suspected stale-halo-density issue in ComputeHbyA across PISO corrections doesn't hold up: CIncEulerVariable::SetPressure/SetVelocity only touch the Pressure/Velocity primitive entries, never Density, so density stays frozen at its "top of outer iteration" value for every point (local or halo) throughout the correction loop - there's no actual divergence to fix. Verified Common/src/CConfig.cpp, SU2_CFD/src/solvers/CIncNSSolver.cpp and SU2_CFD/src/numerics/flow/convection/pressure_based.cpp compile clean, the full SU2_CFD binary links, and incomp_pb_NACA0012.cfg (GREEN_GAUSS, unaffected by the LEAST_SQUARES fix) still runs and converges to Exit Success. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Mesh and config file for the lid driven cavity flow tutorial. Please see the corresponding PR's su2code/su2code.github.io#218 and su2code/SU2#2812.