Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run quick start in docs #1811

Merged
merged 20 commits into from
Sep 19, 2024
2 changes: 1 addition & 1 deletion docs/guide/delwaq.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.4"
"version": "3.12.5"
}
},
"nbformat": 4,
Expand Down
28 changes: 14 additions & 14 deletions docs/reference/node/basin.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ time table, it is empty, or all timestamps of that variable are missing.
column | type | unit | restriction
--------- | ------- | --------------------- | -----------
node_id | Int32 | - | sorted
precipitation | Float64 | $\text{m}/\text{s}$ | non-negative
potential_evaporation | Float64 | $\text{m}/\text{s}$ | non-negative
drainage | Float64 | $\text{m}^3/\text{s}$ | non-negative
infiltration | Float64 | $\text{m}^3/\text{s}$ | non-negative
precipitation | Float64 | $\text m}/\text{s}$ | non-negative
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This removes the opening braces.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted the commit, and fixed in 3c86334.
I tried find and replace with regex in VS Code, but couldn't find any matches, probably since the notebooks are JSON encoded. Though if I then searched for the JSON encoding in VS Code that was also buggy, so I did it in trusty Notepad++

potential_evaporation | Float64 | $\text m}/\text{s}$ | non-negative
drainage | Float64 | $\text m}^3/\text{s}$ | non-negative
infiltration | Float64 | $\text m}^3/\text{s}$ | non-negative

Note that if variables are not set in the static table, default values are used when
possible. These are generally zero, e.g. no precipitation, no inflow. If it is not possible
Expand Down Expand Up @@ -93,7 +93,7 @@ The state table gives the initial water levels of all Basins.
column | type | unit | restriction
--------- | ------- | ------------ | -----------
node_id | Int32 | - | sorted
level | Float64 | $\text{m}$ | $\ge$ basin bottom
level | Float64 | $\text m}$ | $\ge$ basin bottom

Each Basin ID needs to be in the table.
To use the final state of an earlier simulation as an initial condition, copy [`results/basin_state.arrow`](/reference/usage.qmd#sec-state) over to the `input_dir`, and point the TOML to it:
Expand All @@ -114,8 +114,8 @@ The profile table defines the physical dimensions of the storage reservoir of ea
column | type | unit | restriction
--------- | ------- | ------------ | -----------
node_id | Int32 | - | sorted
area | Float64 | $\text{m}^2$ | non-negative, per node_id: start positive and not decreasing
level | Float64 | $\text{m}$ | per node_id: increasing
area | Float64 | $\text m}^2$ | non-negative, per node_id: start positive and not decreasing
level | Float64 | $\text m}$ | per node_id: increasing

The level is the level at the basin outlet. All levels are defined in meters above a datum
that is the same for the entire model. An example of the first 4 rows of such a table is
Expand Down Expand Up @@ -369,8 +369,8 @@ column | type | unit | restriction
------------- | ------- | ------------ | ------------------------
subgrid_id | Int32 | - | sorted
node_id | Int32 | - | constant per subgrid_id
basin_level | Float64 | $\text{m}$ | sorted per subgrid_id
subgrid_level | Float64 | $\text{m}$ | sorted per subgrid_id
basin_level | Float64 | $\text m}$ | sorted per subgrid_id
subgrid_level | Float64 | $\text m}$ | sorted per subgrid_id

The table below shows example input for two subgrid elements:

Expand Down Expand Up @@ -399,8 +399,8 @@ column | type | unit | restriction
node_id | Int32 | - | sorted
time | DateTime | - | sorted per node_id
substance | String | | can correspond to known Delwaq substances
drainage | Float64 | $\text{g}/\text{m}^3$ | (optional)
precipitation | Float64 | $\text{g}/\text{m}^3$ | (optional)
drainage | Float64 | $\text{g}/\text m}^3$ | (optional)
precipitation | Float64 | $\text{g}/\text m}^3$ | (optional)

## ConcentrationState {#sec-basin-conc-state}
This table defines the concentration(s) of (a) substance(s) in the basin at the start of the simulation.
Expand All @@ -410,7 +410,7 @@ column | type | unit | restriction
node_id | Int32 | - | sorted
time | DateTime | - | sorted per node_id
substance | String | - | can correspond to known Delwaq substances
concentration | Float64 | $\text{g}/\text{m}^3$ |
concentration | Float64 | $\text{g}/\text m}^3$ |

## ConcentrationExternal
This table is used for (external) concentrations, that can be used for Control lookups.
Expand All @@ -420,7 +420,7 @@ column | type | unit | restriction
node_id | Int32 | - | sorted
time | DateTime | - | sorted per node_id
substance | String | - | can correspond to known Delwaq substances
concentration | Float64 | $\text{g}/\text{m}^3$ |
concentration | Float64 | $\text{g}/\text m}^3$ |

# Equations

Expand Down Expand Up @@ -520,7 +520,7 @@ $$
Q_\text{inf} = \sum_{i=1}^{n} \sum_{j=1}^{m} \max(Q_{\mathrm{mf6}_{i,j}}, 0.0)
$$ {#eq-inf}

Where $i$ is the index of the boundary condition, $j$ the MODFLOW 6 cell index, $n$ the number of boundary conditions, and $\text{m}$ the number of MODFLOW 6 cells in the Basin.
Where $i$ is the index of the boundary condition, $j$ the MODFLOW 6 cell index, $n$ the number of boundary conditions, and $\text m}$ the number of MODFLOW 6 cells in the Basin.
$Q_{\mathrm{mf6}_{i,j}}$ is the flow computed by MODFLOW 6 for cell $j$ for boundary condition $i$.

Drainage is a lump sum for the Basin, and consists of the sum of the absolute value of all **negative** flows of the MODFLOW 6 boundary conditions in the Basin.
Expand Down
6 changes: 3 additions & 3 deletions docs/reference/node/flow-boundary.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ column | type | unit | restriction
------------- | ------- | --------------------- | -----------
node_id | Int32 | - | sorted
active | Bool | - | (optional, default true)
flow_rate | Float64 | $\text{m}^3/\text{s}$ | non-negative
flow_rate | Float64 | $\text m}^3/\text{s}$ | non-negative

## Time

Expand All @@ -35,7 +35,7 @@ column | type | unit | restriction
--------- | ------- | --------------------- | -----------
node_id | Int32 | - | sorted
time | DateTime | - | sorted per node_id
flow_rate | Float64 | $\text{m}^3/\text{s}$ | non-negative
flow_rate | Float64 | $\text m}^3/\text{s}$ | non-negative

## Concentration {#sec-flow-boundary-conc}
This table defines the concentration(s) of (a) substance(s) for the flow from the FlowBoundary.
Expand All @@ -45,7 +45,7 @@ column | type | unit | restriction
node_id | Int32 | - | sorted
time | DateTime | - | sorted per node_id
substance | String | - | can correspond to known Delwaq substances
concentration | Float64 | $\text{g}/\text{m}^3$ |
concentration | Float64 | $\text{g}/\text m}^3$ |

# Equations

Expand Down
4 changes: 2 additions & 2 deletions docs/reference/node/flow-demand.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ column | type | unit | restriction
------------- | -------- | --------------------- | -----------
node_id | Int32 | - | sorted
priority | Int32 | - | positive
demand | Float64 | $\text{m}^3/\text{s}$ | non-negative
demand | Float64 | $\text m}^3/\text{s}$ | non-negative

## Time

Expand All @@ -25,4 +25,4 @@ column | type | unit | restriction
node_id | Int32 | - | sorted
time | DateTime | - | sorted per node_id
priority | Int32 | - | positive
demand | Float64 | $\text{m}^3/\text{s}$ | non-negative
demand | Float64 | $\text m}^3/\text{s}$ | non-negative
6 changes: 3 additions & 3 deletions docs/reference/node/level-boundary.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ column | type | unit | restriction
------------- | ------- | ------------ | -----------
node_id | Int32 | - | sorted
active | Bool | - | (optional, default true)
level | Float64 | $\text{m}$ | -
level | Float64 | $\text m}$ | -

## Time

Expand All @@ -31,7 +31,7 @@ column | type | unit | restriction
--------- | ------- | ------------ | -----------
node_id | Int32 | - | sorted
time | DateTime | - | sorted per node_id
level | Float64 | $\text{m}$ | -
level | Float64 | $\text m}$ | -

## Concentration {#sec-level-boundary-conc}
This table defines the concentration(s) of (a) substance(s) for the flow from the LevelBoundary.
Expand All @@ -41,7 +41,7 @@ column | type | unit | restriction
node_id | Int32 | - | sorted
time | DateTime | - | sorted per node_id
substance | String | - | can correspond to known Delwaq substances
concentration | Float64 | $\text{g}/\text{m}^3$ |
concentration | Float64 | $\text{g}/\text m}^3$ |

# Equations

Expand Down
8 changes: 4 additions & 4 deletions docs/reference/node/level-demand.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ If both are missing, `LevelDemand` won't have any effects on allocation.
column | type | unit | restriction
------------- | ------- | ------------ | -----------
node_id | Int32 | - | sorted
min_level | Float64 | $\text{m}$ | (optional, default -Inf)
max_level | Float64 | $\text{m}$ | (optional, default Inf)
min_level | Float64 | $\text m}$ | (optional, default -Inf)
max_level | Float64 | $\text m}$ | (optional, default Inf)
priority | Int32 | - | positive

## Time
Expand All @@ -33,6 +33,6 @@ column | type | unit | restriction
------------- | ------- | ------------ | -----------
node_id | Int32 | - | sorted
time | DateTime | - | sorted per node id
min_level | Float64 | $\text{m}$ | -
max_level | Float64 | $\text{m}$ | -
min_level | Float64 | $\text m}$ | -
max_level | Float64 | $\text m}$ | -
priority | Int32 | - | positive
4 changes: 2 additions & 2 deletions docs/reference/node/linear-resistance.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ column | type | unit | restriction
node_id | Int32 | - | sorted
control_state | String | - | (optional) sorted per node_id
active | Bool | - | (optional, default true)
resistance | Float64 | $\text{s}/\text{m}^2$ | -
max_flow_rate | Float64 | $\text{m}^3/s$ | non-negative
resistance | Float64 | $\text{s}/\text m}^2$ | -
max_flow_rate | Float64 | $\text m}^3/s$ | non-negative

# Equations

Expand Down
6 changes: 3 additions & 3 deletions docs/reference/node/manning-resistance.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ column | type | unit | restriction
node_id | Int32 | - | sorted
control_state | String | - | (optional) sorted per node_id
active | Bool | - | (optional, default true)
length | Float64 | $\text{m}$ | positive
manning_n | Float64 | $\text{s} \text{m}^{-\frac{1}{3}}$ | positive
profile_width | Float64 | $\text{m}$ | positive
length | Float64 | $\text m}$ | positive
manning_n | Float64 | $\text{s} \text m}^{-\frac{1}{3}}$ | positive
profile_width | Float64 | $\text m}$ | positive
profile_slope | Float64 | - | -

# Equations
Expand Down
10 changes: 5 additions & 5 deletions docs/reference/node/outlet.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ column | type | unit | restriction
node_id | Int32 | - | sorted
control_state | String | - | (optional) sorted per node_id
active | Bool | - | (optional, default true)
flow_rate | Float64 | $\text{m}^3/\text{s}\$ | non-negative
min_flow_rate | Float64 | $\text{m}^3/\text{s}\$ | (optional, default 0.0)
max_flow_rate | Float64 | $\text{m}^3/\text{s}\$ | (optional)
min_upstream_level | Float64 | $\text{m}$ | (optional)
max_downstream_level | Float64 | $\text{m}$ | (optional)
flow_rate | Float64 | $\text m}^3/\text{s}\$ | non-negative
min_flow_rate | Float64 | $\text m}^3/\text{s}\$ | (optional, default 0.0)
max_flow_rate | Float64 | $\text m}^3/\text{s}\$ | (optional)
min_upstream_level | Float64 | $\text m}$ | (optional)
max_downstream_level | Float64 | $\text m}$ | (optional)

# Equations

Expand Down
4 changes: 2 additions & 2 deletions docs/reference/node/pid-control.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ control_state | String | - | (optional) sorted per node_id
active | Bool | - | (optional, default true)
listen_node_type | String | - | known node type
listen_node_id | Int32 | - | -
target | Float64 | $\text{m}$ | -
target | Float64 | $\text m}$ | -
proportional | Float64 | $\text{s}^{-1}$ | -
integral | Float64 | $\text{s}^{-2}$ | -
derivative | Float64 | - | -
Expand All @@ -41,7 +41,7 @@ node_id | Int32 | - | sorted
time | DateTime | - | sorted per node_id
listen_node_type | Int32 | - | known node type
listen_node_id | Int32 | - | -
target | Float64 | $\text{m}$ | -
target | Float64 | $\text m}$ | -
proportional | Float64 | $\text{s}^{-1}$ | -
integral | Float64 | $\text{s}^{-2}$ | -
derivative | Float64 | - | -
Expand Down
10 changes: 5 additions & 5 deletions docs/reference/node/pump.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ column | type | unit | restriction
node_id | Int32 | - | sorted
control_state | String | - | (optional) sorted per node_id
active | Bool | - | (optional, default true)
flow_rate | Float64 | $\text{m}^3/\text{s}$ | non-negative
min_flow_rate | Float64 | $\text{m}^3/\text{s}$ | (optional, default 0.0)
max_flow_rate | Float64 | $\text{m}^3/\text{s}$ | (optional)
min_upstream_level | Float64 | $\text{m}$ | (optional)
max_downstream_level | Float64 | $\text{m}$ | (optional)
flow_rate | Float64 | $\text m}^3/\text{s}$ | non-negative
min_flow_rate | Float64 | $\text m}^3/\text{s}$ | (optional, default 0.0)
max_flow_rate | Float64 | $\text m}^3/\text{s}$ | (optional)
min_upstream_level | Float64 | $\text m}$ | (optional)
max_downstream_level | Float64 | $\text m}$ | (optional)

# Equations

Expand Down
12 changes: 6 additions & 6 deletions docs/reference/node/tabulated-rating-curve.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ column | type | unit | restriction
node_id | Int32 | - | sorted
control_state | String | - | (optional) sorted per node_id
active | Bool | - | (optional, default true)
max_downstream_level | Float64 | $\text{m}$ | (optional)
level | Float64 | $\text{m}$ | sorted per control_state, unique
flow_rate | Float64 | $\text{m}^3/\text{s}$ | start at 0, increasing
max_downstream_level | Float64 | $\text m}$ | (optional)
level | Float64 | $\text m}$ | sorted per control_state, unique
flow_rate | Float64 | $\text m}^3/\text{s}$ | start at 0, increasing

Thus a single rating curve can be given by the following table:

Expand Down Expand Up @@ -89,9 +89,9 @@ column | type | unit | restriction
-------------------- | ------- | --------------------- | -----------
node_id | Int32 | - | sorted
time | DateTime | - | sorted per node_id
level | Float64 | $\text{m}$ | sorted per node_id per time
flow_rate | Float64 | $\text{m}^3/\text{s}$ | non-negative
max_downstream_level | Float64 | $\text{m}$ | (optional)
level | Float64 | $\text m}$ | sorted per node_id per time
flow_rate | Float64 | $\text m}^3/\text{s}$ | non-negative
max_downstream_level | Float64 | $\text m}$ | (optional)

# Equations

Expand Down
8 changes: 4 additions & 4 deletions docs/reference/node/user-demand.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ column | type | unit | restriction
------------- | ------- | ----------------------| -----------
node_id | Int32 | - | sorted
active | Bool | - | (optional, default true)
demand | Float64 | $\text{m}^3/\text{s}$ | non-negative
demand | Float64 | $\text m}^3/\text{s}$ | non-negative
return_factor | Float64 | - | between [0 - 1]
min_level | Float64 | $\text{m}$ | -
min_level | Float64 | $\text m}$ | -
priority | Int32 | - | positive, sorted per node id

## Time
Expand All @@ -47,9 +47,9 @@ column | type | unit | restriction
node_id | Int32 | - | sorted
priority | Int32 | - | positive, sorted per node id
time | DateTime | - | sorted per priority per node id
demand | Float64 | $\text{m}^3/\text{s}$ | non-negative
demand | Float64 | $\text m}^3/\text{s}$ | non-negative
return_factor | Float64 | - | between [0 - 1]
min_level | Float64 | $\text{m}$ | -
min_level | Float64 | $\text m}$ | -

# Equations

Expand Down
24 changes: 12 additions & 12 deletions docs/reference/usage.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -205,16 +205,16 @@ column | type | unit
-------------- | ---------| ----
time | DateTime | -
node_id | Int32 | -
storage | Float64 | $\text{m}^3$
level | Float64 | $\text{m}$
inflow_rate | Float64 | $\text{m}^3/\text{s}$
outflow_rate | Float64 | $\text{m}^3/\text{s}$
storage_rate | Float64 | $\text{m}^3/\text{s}$
precipitation | Float64 | $\text{m}^3/\text{s}$
evaporation | Float64 | $\text{m}^3/\text{s}$
drainage | Float64 | $\text{m}^3/\text{s}$
infiltration | Float64 | $\text{m}^3/\text{s}$
balance_error | Float64 | $\text{m}^3/\text{s}$
storage | Float64 | $\text m}^3$
level | Float64 | $\text m}$
inflow_rate | Float64 | $\text m}^3/\text{s}$
outflow_rate | Float64 | $\text m}^3/\text{s}$
storage_rate | Float64 | $\text m}^3/\text{s}$
precipitation | Float64 | $\text m}^3/\text{s}$
evaporation | Float64 | $\text m}^3/\text{s}$
drainage | Float64 | $\text m}^3/\text{s}$
infiltration | Float64 | $\text m}^3/\text{s}$
balance_error | Float64 | $\text m}^3/\text{s}$
relative_error | Float64 | -

The table is sorted by time, and per time it is sorted by `node_id`.
Expand All @@ -232,7 +232,7 @@ from_node_type | String | -
from_node_id | Int32 | -
to_node_type | String | -
to_node_id | Int32 | -
flow_rate | Float64 | $\text{m}^3/\text{s}$
flow_rate | Float64 | $\text m}^3/\text{s}$

The table is sorted by time, and per time the same `edge_id` order is used, though not sorted.
The `edge_id` value is the same as the `fid` written to the Edge table, and can be used to directly look up the Edge geometry.
Expand All @@ -245,7 +245,7 @@ The Basin state table contains the water levels in each Basin at the end of the
column | type | unit
--------- | ------- | ------------
node_id | Int32 | -
level | Float64 | $\text{m}$
level | Float64 | $\text m}$

To use this result as the initial condition of another simulation, see the [Basin / state](/reference/node/basin.qmd#sec-state) table reference.

Expand Down
Loading
Loading