Fix/issue 1 junction surface area#5
Open
wiesnerfriedman wants to merge 11 commits intoSWMM-Project:swmm6_relfrom
Open
Fix/issue 1 junction surface area#5wiesnerfriedman wants to merge 11 commits intoSWMM-Project:swmm6_relfrom
wiesnerfriedman wants to merge 11 commits intoSWMM-Project:swmm6_relfrom
Conversation
Only strip conduit/orifice half-areas at a STORAGE node when the storage curve provides area > MIN_SURFAREA. For degenerate storage nodes (zero or near-zero curve), keep the legacy pipe-half contribution so the Picard denominator stays bounded away from MIN_SURFAREA. Fixes: DynamicWave.cpp::updateNodeFlows (conduit path) Fixes: SWMMEngine.cpp non-conduit callback (orifice path) Tests: 5 new StorageHalfAreaGuard unit tests
… regimes
Anderson acceleration (AA) requires a smooth fixed-point operator G
between consecutive Picard iterates. Three surcharge formulations
violate this assumption:
EXTRAN: discontinuous dQ/dH formulation at crown
DYNAMIC_SLOT: per-iterate geometry rewrite (Sharior et al. 2023)
SLOT: C⁰ kink at the slot cutoff (~0.985·yFull)
The existing code only skipped AA for EXTRAN surcharged nodes (from
pr/aa-extran-guard). This extends the guard to all three regimes via
a per-node aa_skip_ flag vector, scatter-computed each Picard iteration
after geometry is known:
- EXTRAN: skip when xnode_.is_surcharged
- DPS: skip end-nodes of conduits with active slot area (As > 0)
- SLOT: skip end-nodes of conduits with depth_mid/yFull in [0.98, 1.02]
Free-surface nodes (95%+ of network) retain full AA speedup.
No physics is altered; only the numerical accelerator is gated.
Implementation:
- DynamicWave.hpp: add aa_skip_ (vector<uint8_t>), computeAASkipFlags()
declaration, aaSkipFlags() const accessor
- DynamicWave.cpp: allocate aa_skip_ in init(), implement
computeAASkipFlags() with O(n_conduits) scatter, call after
computeLinkGeometry() in execute(), guard AA block in
updateNodeDepths() with !aa_skip_[ui]
Tests: 6 new AASkipFlagTest cases in test_routing.cpp
- FreeSurfaceNoSkip, ExtranSurchargedSkips, DPSActiveSkipsEndNodes,
SlotNearKinkSkipsEndNodes, SlotFarFromKinkNoSkip, AADisabledNoFlags
All 61 routing tests pass.
…orage-conduit-halves fix(issue-2): conditionally zero storage-node conduit half-areas
…derson-acceleration-scope fix(issue-3): extend Anderson acceleration skip guard to DPS and SLOT…
…Node, wire option into DWSolver with unit conversion, add .inp-driven regression tests
Phase 1: Non-storage getSurfArea() returns 0.0 (physical area only)
Phase 2: Storage getSurfArea() purely geometric (no MIN_SURFAREA clamp)
Wire MIN_SURFAREA/HEAD_TOL options into DWSolver with UCF conversion
Phase 3: Add minimal_conduit.inp fixture and DWNodeContinuity tests
(DepthRisesWithForcedLateralInflow, MultipleStepsAccumulateDepth)
All 61 routing + 21 site-drainage tests pass.
dac366e to
8f75098
Compare
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.
Node::getSurfAreareturnsMIN_SURFAREAas a constant for non-storage nodes, which gets added to conduit half-areas instead of acting as a floor. This inflates junction surface area, damping depth response. Fix moves the floor toDWSolver::setNodeDepthasmax(surfArea, MIN_SURFAREA).