Skip to content

Commit

Permalink
allow one-directional outflow to LevelBoundary (#327)
Browse files Browse the repository at this point in the history
This came up in a model from @d2hydro
(d2hydro/lhm-ribasim#5 (comment)).

FractionalFlow, FlowBoundary and TabulatedRatingCurve should be able to
flow out into a LevelBoundary. This is slightly odd since in these cases
the level of the level boundary does not matter, since the flow is
always into the LevelBoundary as determined by the other side. So using
a Terminal might make more sense there.

Still, validation shouldn't block this since you may want a single
boundary node that connects to multiple node types, some directed like
this, some with resistance for which you need a level.
  • Loading branch information
visr authored Jun 16, 2023
1 parent ab90472 commit 6e72ba4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions core/src/validation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,15 @@ neighbortypes(::Val{:Basin}) = Set((
:FlowBoundary,
))
neighbortypes(::Val{:Terminal}) = Set{Symbol}() # only endnode
neighbortypes(::Val{:FractionalFlow}) = Set((:Basin, :FractionalFlow, :Terminal))
neighbortypes(::Val{:FlowBoundary}) = Set((:Basin, :FractionalFlow, :Terminal))
neighbortypes(::Val{:FractionalFlow}) =
Set((:Basin, :FractionalFlow, :Terminal, :LevelBoundary))
neighbortypes(::Val{:FlowBoundary}) =
Set((:Basin, :FractionalFlow, :Terminal, :LevelBoundary))
neighbortypes(::Val{:LevelBoundary}) = Set((:LinearResistance, :ManningResistance))
neighbortypes(::Val{:LinearResistance}) = Set((:Basin, :LevelBoundary))
neighbortypes(::Val{:ManningResistance}) = Set((:Basin, :LevelBoundary))
neighbortypes(::Val{:TabulatedRatingCurve}) = Set((:Basin, :FractionalFlow, :Terminal))
neighbortypes(::Val{:TabulatedRatingCurve}) =
Set((:Basin, :FractionalFlow, :Terminal, :LevelBoundary))
neighbortypes(::Any) = Set{Symbol}()

# TODO NodeV1 and EdgeV1 are not yet used
Expand Down

0 comments on commit 6e72ba4

Please sign in to comment.