Skip to content

Commit

Permalink
Review comments and correct rebasing omissions
Browse files Browse the repository at this point in the history
  • Loading branch information
visr committed Feb 9, 2024
1 parent eb5194e commit 93e4287
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion core/src/parameter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ Requirements:
node_id: node ID of the LinearResistance node
active: whether this node is active and thus contributes flows
resistance: the resistance to flow; Q = Δh/resistance
resistance: the resistance to flow; `Q_unlimited = Δh/resistance`
max_flow_rate: the maximum flow rate allowed through the node; `Q = clamp(Q_unlimited, -max_flow_rate, max_flow_rate)`
control_mapping: dictionary from (node_id, control_state) to resistance and/or active state
"""
struct LinearResistance <: AbstractParameterNode
Expand Down
1 change: 1 addition & 0 deletions core/src/schema.jl
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ end
node_id::Int
active::Union{Missing, Bool}
resistance::Float64
max_flow_rate::Union{Missing, Float64}
control_state::Union{Missing, String}
end

Expand Down
2 changes: 1 addition & 1 deletion docs/core/equations.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ $$
Q = \mathrm{clamp}(\frac{h_a - h_b}{R}, -Q_{\max}, Q_{\max})
$$ {#eq-basinflow}
Here $h_a$ is the water level in the first basin, $h_b$ is the water level in the second basin.
Here $h_a$ is the water level in the first basin and $h_b$ is the water level in the second basin.
$R$ is the resistance of the link, and $Q_{\max}$ is the maximum flow rate.
A `LinearResistance` makes no assumptions about the direction of the flow: water flows from high to low.
Expand Down
1 change: 1 addition & 0 deletions python/ribasim/ribasim/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ class LinearResistanceStaticSchema(_BaseSchema):
node_id: Series[int] = pa.Field(nullable=False)
active: Series[pa.BOOL] = pa.Field(nullable=True)
resistance: Series[float] = pa.Field(nullable=False)
max_flow_rate: Series[float] = pa.Field(nullable=True)
control_state: Series[str] = pa.Field(nullable=True)


Expand Down

0 comments on commit 93e4287

Please sign in to comment.