Docs: the integration-point history's low Courant number limit, and the choice between transport managers - #711
Open
lmoresi wants to merge 2 commits into
Open
Docs: the integration-point history's low Courant number limit, and the choice between transport managers#711lmoresi wants to merge 2 commits into
lmoresi wants to merge 2 commits into
Conversation
…he choice between transport managers The growth measured in the oversampling section sets a lower limit on the Courant number at which the integration-point history is useful, and nothing said so. Two measurements bound it: on the rotating Gaussian at Courant 0.1 under pure advection the energy finishes 0.92 % high with a -3.7 % undershoot, and the growth is gone by cell diffusion number 1e-2; on the LeVeque deformation test at T = 8, where the filament thins below the cell, the returned field overshoots by 8 % and Eulerian SUPG reaches the same L2 error more cheaply and with 100 times less volume drift. Both schemes are near the error the mesh can resolve at that spacing, so on a sharp interface they are equivalent in accuracy. Also records that the stabilising diffusivity kappa = eps h^2/(pi^2 dt) suggested for the growth does not work: the L2 error rises with eps throughout, the proposed eps = 1e-3 moves the overshoot a third of the way while costing 9 % of accuracy and 9 % of interface width, and there is no intermediate setting, since the peak goes from 1.052 to 0.880 between eps = 1e-3 and 1e-2. The damping reaches the physically sharp interface more strongly than the spurious mode. docs/advanced/eulerian-advection-diffusion.md gains a section naming the three managers worth considering and what each is for: Eulerian SUPG as the general choice, the integration-point history for larger Courant numbers and for tensor transport, and the swarm history when the model already carries particles for material tracking. The nodal semi-Lagrangian history is described as superseded; it diverges on a deforming flow below a Courant number that depends on the problem. Measurements and scripts: ~/+Simulations/slcn-ip-real-cases/ Underworld development team with AI support from Claude Code Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E87Q7KrpapxeQiLD1RiNXv
Its accuracy and cost are still being measured as part of the particle-in-cell work, so the entry states the intended role rather than making a recommendation. Underworld development team with AI support from Claude Code Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E87Q7KrpapxeQiLD1RiNXv
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
A couple of new headings/introductions are internally inconsistent (notably “three managers” while describing four, and an “added diffusion” heading that reads as contradicting the preceding paragraph) and should be clarified before merging.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds practical guidance on the integration-point semi-Lagrangian history’s low-Courant-number limitation and documents how to choose between the available transport managers for advection–diffusion problems.
Changes:
- Documented the observed low-Courant growth regime (and when it matters) for the integration-point history, including bounding measurements against reference solutions.
- Recorded (as a negative result) that a proposed stabilising diffusivity worsens accuracy across tested strengths for the LeVeque case.
- Added a comparison section naming transport managers and summarising when to use each.
File summaries
| File | Description |
|---|---|
| docs/developer/subsystems/integration-point-variables.md | Adds “low Courant limit in practice” guidance plus measured outcome of proposed stabilising diffusion. |
| docs/advanced/eulerian-advection-diffusion.md | Adds a manager-selection section describing the intended roles of Eulerian SUPG vs semi-Lagrangian and swarm-based transport. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+83
to
+87
| ## The three transport managers | ||
|
|
||
| `DuDt` selects the transport, and three managers are worth considering for a | ||
| scalar field. The choice turns on the Courant number the model runs at and on | ||
| whether the model is carrying particles for another reason. |
Comment on lines
+292
to
+296
| ### Added diffusion does not remove the growth | ||
|
|
||
| A stabilising diffusivity `κ = ε h²/(π² Δt)`, a cell diffusion number | ||
| `D = ε/π²`, has been suggested for the growth. We measured it on the case | ||
| that shows the overshoot, LeVeque `T = 8` with this history at Courant 2: |
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.
The oversampling section of
integration-point-variables.mdexplains the growth mechanism but never says what it means for use. This adds the limit, the measurements that bound it, and a section naming the transport managers and what each is for.The limit
Two measurements bound it, both against exact solutions.
Rotating Gaussian, Courant 0.1, pure advection, one revolution (503 steps): energy finishes 0.92 % above the analytic value with a -3.7 % undershoot. Adding physical diffusion removes it, and the ringing goes faster than the energy: -0.04 % undershoot at cell diffusion number
D = 1e-3, and energy ratio 0.9934 atD = 1e-2.CandPeare not independent within a run.Pe = C/DwithD = κΔt/h²carrying no velocity, so a cell at low Courant number sits at proportionally low Péclet number. A Courant-limited timestep fixesD = C_max/Pe_maxand cannot reach the growth region; a timestep imposed by a coupled free surface or an elastic timescale can.LeVeque single vortex at
T = 8(h = 1/48, P2, one-cell tanh level set, no diffusion, no reinitialisation), where the filament thins below the cell: at Courant 2 the returned field has L2 1.54e-1, peak 1.080, undershoot -0.068. Eulerian SUPG at Crank-Nicolson reaches 1.50e-1 and holds the enclosed volume to 4e-5 against this scheme's 5e-3. Both approach ~1.45e-1, which is what the mesh resolves at that spacing, so on a sharp interface the two are equivalent in accuracy and SUPG is cheaper.The suggested damping does not work
κ = ε h²/(π² Δt)was suggested for the growth. Measured on LeVequeT = 8at Courant 2:L2 rises with
εthroughout, so the unstabilised run is the most accurate row. At the suggestedε = 1e-3the overshoot moves a third of the way while error and interface width each grow 9 %. There is no intermediate setting: the peak goes 1.052 to 0.880 between1e-3and1e-2. The damping is applied to the whole field, so it reaches the sharp interface more strongly than the spurious mode. Recorded as a negative result so it is not re-proposed.The three managers
docs/advanced/eulerian-advection-diffusion.mdgains a section naming what to use:Δt², no lower Courant limit, conserves the integral to solver tolerance.T = 2, at C = 1 atT = 8), reproduced with the solver building its own history.Notes
Docs only, no code. Class names checked against
systems/ddt.py. Costs measured on #707, which changes them substantially: ath = 1/48nodal 149 → 78 s and integration point 273 → 156 s, SUPG unchanged.Scripts, per-step logs and raw JSON:
~/+Simulations/slcn-ip-real-cases/.Underworld development team with AI support from Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01E87Q7KrpapxeQiLD1RiNXv