-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(0.91.7) Open boundary conditions for
NonhydrostaticModel
(#3482)
* Generalised `Open` boundary condition * `adapt` seems to be defined twice for boundary conditions * added internal wave example * corrected spelling in adapt * mistake * corrected syntax * changed validation name * clarified sponge * fixed docs * a slightly less ugly way of passing around boundary condition classifcations and keeping their properties * added `update_boundary_condition!` and `update_boundary_conditions!` * more update boundary condition changes * add mean outflow open boundary condition * change boundary conditions setup to allow classifcations to have properties * forgot to add Adapt import * forgot another local change * fixed immersed boundary conditions * fixed tests * fixed for etc. * added kwarg to to know if the pressure is corrected * addded no wall normal velocity gradcient * moved clock tick to before pressure correction * Revert "added kwarg to to know if the pressure is corrected" This reverts commit 1369d64. * refuse to fill bounded-wall normal velocity points after the pressure correction * Revert "refuse to fill bounded-wall normal velocity points after the pressure correction" This reverts commit c8f6cd6. * different implementation to only fill bounde wall normal velocity halos before pressure correction * corrections * correction * refactor open halo filling to multiple dispatch rather than if else * formatting * formatting * fixed new way to fill open halos * backwars compatible, do we want this or to update the tests? * renamed functions * change no graidnet bc to return nothing * Fixed set model for new boundary filling * fixed poisson solver test * fixed stretched poisson solver test * simplified test updates * fixed naming for boundary condition updates * fixed bc tests again * fixed bc integration test * fixed import * added \`fill_open_boundary_region\` method for manual call on \`Field\` * moved `fill_open_boundary_region\!` * corrected order of boundary filling * solved multi region bug for update boundary conditions * renamed `ZeroGradient` matching scheme * renamed flat extrapolation file * fixed open halo filling for tracers * correction * fixed set nonhydrostatic model * corrected doc string * fix (?) multi region grid fills * maybe made windowed fields work * fixed multiregion open fills (more tests now pass locally ...) * Revert previous test change * fixed more tests * reverted an accidental (?) change * MRG tests pass locally * Removed redundant code * added back Impenetrable BC summary * change some @test_skip to @test * Update src/BoundaryConditions/show_boundary_conditions.jl Co-authored-by: Gregory L. Wagner <[email protected]> * renamed `left/right_boundary_condition` * maybe made distributed work * oops * corrected multi region change * I can't use githubs merge conflict thing * renamed distributed halo fill * revert computed field test change * finally understand distributed bc filling * mistake * added oscillating example and added relaxation to flat extrapolation * fixed * added documentation for open boundary conditions * Apply suggestions from code review Co-authored-by: Tomas Chor <[email protected]> * spelling * Update src/BoundaryConditions/flat_extrapolation_open_boundary_matching_scheme.jl * made FEOBC work for stretched grids * Apply suggestions from code review Thank you! Co-authored-by: Tomas Chor <[email protected]> * Update src/BoundaryConditions/BoundaryConditions.jl * bump version * review comments * rename \`update_boundary_conditions!\` to \`update_boundary_condition!\` * made `spacing_factor` stuff grid agnostic * fix * renamed \`unrelaxed\` to \`gradient_free_c\` * fix formatting in validation scripts * removed redundant adapts * formatting in update model * removed commenting out of \`update_model_field_time_series!\` * replaced redundant \`get_boundary_conditions\` * Apply suggestions from code review Thank you @tomchor Co-authored-by: Tomas Chor <[email protected]> * fix boundary conditions doctest * clarified fallbacks for open boundary conditions * Apply suggestions from code review Co-authored-by: Gregory L. Wagner <[email protected]> * turns out we did need this fallback * changed `C` to `c` and `c` to `a` * changed `a` to `ϕ` * changed argument order for `update_boundary_condition!` * failure to find and replace * failure to find and replace more * Update lagrangian_particle_advection.jl * changed argument order in `relax` * Attempts to fix enzyme tests * Apply suggestions from code review Co-authored-by: Gregory L. Wagner <[email protected]> * Update update_boundary_conditions.jl * modify `boundary_conditions` * Rearranged regular fills for OBCs * Update fill_halo_regions_open.jl Co-authored-by: Tomas Chor <[email protected]> * Apply suggestions from code review Co-authored-by: Simone Silvestri <[email protected]> Co-authored-by: Tomas Chor <[email protected]> * correct version number --------- Co-authored-by: Gregory L. Wagner <[email protected]> Co-authored-by: Tomas Chor <[email protected]> Co-authored-by: Simone Silvestri <[email protected]>
- Loading branch information
1 parent
852bf68
commit 3c4785c
Showing
33 changed files
with
821 additions
and
155 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
3c4785c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
Release notes:
This PR implements the infrastructure for open boundaries in
NonhydrostaticModel
s by differentiating the filling of halos forBoundaryCondition{Open}
boundaries so they are not refilled after the pressure correction step, as this would result in the interior field becoming divergent. This means that if the boundary value is not known a priori (e.g. it depends on the interior values), then the condition will not be enforced exactly. However, since open boundary conditions are already unphysical, it was decided that this was the preferable non-physicality.To allow more sophisticated boundary conditions this PR adds a
matching_scheme
property to theOpen
boundary classification, and as an example, a matching scheme namedFlatExtrapolation
is implemented.Finally, it introduces
update_boundary_condition!(boundary_condition, field, model)
which can be dispatched onboundary_condition
to allow more complex boundary conditions to be implemented (e.g. to compute the mean outflow at the boundary and store it in the condition).3c4785c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/112609
Tagging
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:
3c4785c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really the right way to describe the algorithm? I thought that the algorithm is actually the only way to do it.
I don't really see what's unphysical about an open boundary. If you continue that argument to its extreme then the only "physical" simulation contains the whole universe. Smells wrong...