Repository navigation
Conversation
When infiltration decreases only slightly, trailwav adds a single wave whose water content differs from the wave above by at most 1e-9. Its speed was computed with leadspeed() as a finite difference across that gap, which gives a speed near 1e-15/dtheta instead of the flux derivative. Set the speed from the derivative at the preceding wave's water content before assigning smoist, as TRAILWAVE2 in MODFLOW-NWT does. Add a unit test that leaves junk in the new wave's slot, calls trailwav in the single-wave branch, and checks the new wave's water content, depth, flux and speed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This branch has not been deployed
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.
Followup to #3152, addressing review comment there.
When infiltration decreases only slightly (the new water content is within 1e-9 of the top wave's),
trailwavadds a single wave instead of a set of trailing waves. Its speed came fromleadspeed(), a finite difference across a water content gap of at most 1e-9 with nearly equal fluxes, which gives roughly 1e-15/Δθ instead of the flux derivative. The wave could crawl, or in rare cases race, through the unsaturated zone. MODFLOW-NWT (TRAILWAVE2) instead sets the speed from the derivative at the preceding wave's water content, before assigning the new water content. Do the same, including NWT's near-zero clamp on the relative saturation.trailwav_single_waveunit test inTestUzfCellGroup.f90. It leaves junk in the new wave's slot, triggers the single-wave branch, and checks the new wave's water content, depth, flux and speed. It fails on develop before fix(uzf): fix new wave water content initialization #3152 (flux read from the junk slot) and on develop after fix(uzf): fix new wave water content initialization #3152UzfCellGroup.f90(and refactor(uzf): rename variables with aliases and split into submodules #3015 alsoTestUzfCellGroup.f90), this can be rebased if those go firstChecklist of items for pull request
fprettify