Improvements to make field-based refinements work as expected at initialization (for estuary flows) - #2021
Open
mbkuhn wants to merge 5 commits into
Open
Improvements to make field-based refinements work as expected at initialization (for estuary flows)#2021mbkuhn wants to merge 5 commits into
mbkuhn wants to merge 5 commits into
Conversation
Contributor
Author
|
The reg tests fail due to the terrain_box_amr. However, this test features something this PR is trying to change, which is refining at the bottom boundary due to the terrain_blank values always being 0 inside the boundary. To test if the PR actually changes the results aside from changing the mesh, I did one run with main where I set a bounding box for the field refinement. This made the meshes identical between the main branch version of the reg test and the PR version of it. With the same mesh, there were no diffs. |
mbkuhn
marked this pull request as ready for review
August 20, 2026 16:08
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
For most multiphase flow cases, the initializer in a physics class sets up a levelset field (e.g., SloshingTank, ChannelBuilder, OceanWaves), then MultiPhase physics (in post_init) converts the levelset field to vof and then calculates the density from the vof field. That means that the vof field isn't calculated by the time it is being used for a field refinement, which is undesirable. The solution is to put those post_init actions direcly into initialize_fields(). This PR does that for ChannelBuilder, which we are currently using as the estuary flow initializer.
There is also a conditional in TerrainDrag that prevents cells within the bottom boundary as being identified as terrain. That leads to a gradient being identified there by gradient field refinement, which is undesirable. Turning that off - need to confirm with tests that it doesn't mess up terrain runs (I don't expect it to matter).
Pull request type
Please check the type of change introduced:
Checklist
The following is included:
This PR was tested by running:
Additional background
Issue Number: