Skip to content

Commit

Permalink
deploy: ab24dd4
Browse files Browse the repository at this point in the history
  • Loading branch information
visr committed Nov 24, 2023
1 parent e51c623 commit 791d027
Show file tree
Hide file tree
Showing 9 changed files with 337 additions and 193 deletions.
290 changes: 151 additions & 139 deletions build/index.html

Large diffs are not rendered by default.

105 changes: 99 additions & 6 deletions core/usage.html
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,9 @@ <h2 id="toc-title">On this page</h2>
<li><a href="#basin-time" id="toc-basin-time" class="nav-link" data-scroll-target="#basin-time"><span class="header-section-number">5.1</span> Basin / time</a></li>
<li><a href="#basin-state" id="toc-basin-state" class="nav-link" data-scroll-target="#basin-state"><span class="header-section-number">5.2</span> Basin / state</a></li>
<li><a href="#basin-profile" id="toc-basin-profile" class="nav-link" data-scroll-target="#basin-profile"><span class="header-section-number">5.3</span> Basin / profile</a></li>
<li><a href="#basin-results" id="toc-basin-results" class="nav-link" data-scroll-target="#basin-results"><span class="header-section-number">5.4</span> Basin results</a></li>
<li><a href="#flow-results" id="toc-flow-results" class="nav-link" data-scroll-target="#flow-results"><span class="header-section-number">5.5</span> Flow results</a></li>
<li><a href="#basin-subgrid" id="toc-basin-subgrid" class="nav-link" data-scroll-target="#basin-subgrid"><span class="header-section-number">5.4</span> Basin / subgrid</a></li>
<li><a href="#basin-results" id="toc-basin-results" class="nav-link" data-scroll-target="#basin-results"><span class="header-section-number">5.5</span> Basin results</a></li>
<li><a href="#flow-results" id="toc-flow-results" class="nav-link" data-scroll-target="#flow-results"><span class="header-section-number">5.6</span> Flow results</a></li>
</ul></li>
<li><a href="#fractionalflow" id="toc-fractionalflow" class="nav-link" data-scroll-target="#fractionalflow"><span class="header-section-number">6</span> FractionalFlow</a></li>
<li><a href="#tabulatedratingcurve" id="toc-tabulatedratingcurve" class="nav-link" data-scroll-target="#tabulatedratingcurve"><span class="header-section-number">7</span> TabulatedRatingCurve</a>
Expand Down Expand Up @@ -461,6 +462,7 @@ <h1 data-number="3"><span class="header-section-number">3</span> Node</h1>
<li><code>Basin / profile</code>: geometries of the basins</li>
<li><code>Basin / time</code>: time series of the forcing values</li>
<li><code>Basin / state</code>: used as initial condition of the basins</li>
<li><code>Basin / subgrid</code>: used to interpolate basin levels to a more detailed spatial representation</li>
</ul></li>
<li>FractionalFlow: connect two of these from a Basin to get a fixed ratio bifurcation
<ul>
Expand Down Expand Up @@ -737,8 +739,99 @@ <h2 data-number="5.3" class="anchored" data-anchor-id="basin-profile"><span clas
</table>
<p>We use the symbol <span class="math inline">\(A\)</span> for area, <span class="math inline">\(h\)</span> for level and <span class="math inline">\(S\)</span> for storage. The profile provides a function <span class="math inline">\(A(h)\)</span> for each basin. Internally this get converted to two functions, <span class="math inline">\(A(S)\)</span> and <span class="math inline">\(h(S)\)</span>, by integrating over the function, setting the storage to zero for the bottom of the profile. The minimum area cannot be zero to avoid numerical issues. The maximum area is used to convert the precipitation flux into an inflow.</p>
</section>
<section id="basin-results" class="level2" data-number="5.4">
<h2 data-number="5.4" class="anchored" data-anchor-id="basin-results"><span class="header-section-number">5.4</span> Basin results</h2>
<section id="basin-subgrid" class="level2" data-number="5.4">
<h2 data-number="5.4" class="anchored" data-anchor-id="basin-subgrid"><span class="header-section-number">5.4</span> Basin / subgrid</h2>
<p>The subgrid_level table defines a piecewise linear interpolation from a basin water level to a subgrid element water level. Many subgrid elements may be associated with a single basin, each with distinct interpolation functions. This functionality can be used to translate a single lumped basin level to a more spatially detailed representation (e.g comparable to the output of a hydrodynamic simulation).</p>
<table class="table">
<thead>
<tr class="header">
<th>column</th>
<th>type</th>
<th>unit</th>
<th>restriction</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>subgrid_id</td>
<td>Int</td>
<td>-</td>
<td>sorted</td>
</tr>
<tr class="even">
<td>node_id</td>
<td>Int</td>
<td>-</td>
<td>constant per subgrid_id</td>
</tr>
<tr class="odd">
<td>basin_level</td>
<td>Float64</td>
<td><span class="math inline">\(m\)</span></td>
<td>sorted per subgrid_id</td>
</tr>
<tr class="even">
<td>subgrid_level</td>
<td>Float64</td>
<td><span class="math inline">\(m\)</span></td>
<td>sorted per subgrid_id</td>
</tr>
</tbody>
</table>
<p>The table below shows example input for two subgrid elements:</p>
<table class="table">
<thead>
<tr class="header">
<th>subgrid_id</th>
<th>node_id</th>
<th>basin_level</th>
<th>subgrid_level</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>1</td>
<td>9</td>
<td>0.0</td>
<td>0.0</td>
</tr>
<tr class="even">
<td>1</td>
<td>9</td>
<td>1.0</td>
<td>1.0</td>
</tr>
<tr class="odd">
<td>1</td>
<td>9</td>
<td>2.0</td>
<td>2.0</td>
</tr>
<tr class="even">
<td>2</td>
<td>9</td>
<td>0.0</td>
<td>0.5</td>
</tr>
<tr class="odd">
<td>2</td>
<td>9</td>
<td>1.0</td>
<td>1.5</td>
</tr>
<tr class="even">
<td>2</td>
<td>9</td>
<td>2.0</td>
<td>2.5</td>
</tr>
</tbody>
</table>
<p>Both subgrid elements use the water level of the basin with <code>node_id</code> 9 to interpolate to their respective water levels. The first element has a one to one connection with the water level; the second also has a one to one connection, but is offset by half a meter. A basin water level of 0.3 would be translated to a water level of 0.3 for the first subgrid element, and 0.8 for the second. Water levels beyond the last <code>basin_level</code> are linearly extrapolated.</p>
<p>Note that the interpolation to subgrid water level is not constrained by any water balance within Ribasim. Generally, to create physically meaningful subgrid water levels, the subgrid table must be parametrized properly such that the spatially integrated water volume of the subgrid elements agrees with the total storage volume of the basin.</p>
</section>
<section id="basin-results" class="level2" data-number="5.5">
<h2 data-number="5.5" class="anchored" data-anchor-id="basin-results"><span class="header-section-number">5.5</span> Basin results</h2>
<p>The basin table contains results of the storage and level of each basin at every solver timestep. The initial condition is also written to the file.</p>
<table class="table">
<thead>
Expand Down Expand Up @@ -773,8 +866,8 @@ <h2 data-number="5.4" class="anchored" data-anchor-id="basin-results"><span clas
</table>
<p>The table is sorted by time, and per time it is sorted by <code>node_id</code>.</p>
</section>
<section id="flow-results" class="level2" data-number="5.5">
<h2 data-number="5.5" class="anchored" data-anchor-id="flow-results"><span class="header-section-number">5.5</span> Flow results</h2>
<section id="flow-results" class="level2" data-number="5.6">
<h2 data-number="5.6" class="anchored" data-anchor-id="flow-results"><span class="header-section-number">5.6</span> Flow results</h2>
<p>The flow table contains results of the flow on every edge in the model, for each solver timestep.</p>
<table class="table">
<thead>
Expand Down
2 changes: 1 addition & 1 deletion python/examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ <h1 data-number="2"><span class="header-section-number">2</span> Update the basi
<span id="cb28-4"><a href="#cb28-4" aria-hidden="true" tabindex="-1"></a>ax <span class="op">=</span> df_flow.pivot_table(index<span class="op">=</span><span class="st">"time"</span>, columns<span class="op">=</span><span class="st">"edge"</span>, values<span class="op">=</span><span class="st">"flow_m3d"</span>).plot()</span>
<span id="cb28-5"><a href="#cb28-5" aria-hidden="true" tabindex="-1"></a>ax.legend(bbox_to_anchor<span class="op">=</span>(<span class="fl">1.3</span>, <span class="dv">1</span>), title<span class="op">=</span><span class="st">"Edge"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="26">
<pre><code>&lt;matplotlib.legend.Legend at 0x7f5109c22490&gt;</code></pre>
<pre><code>&lt;matplotlib.legend.Legend at 0x7fa6c4883690&gt;</code></pre>
</div>
<div class="cell-output cell-output-display">
<p><img src="examples_files/figure-html/cell-27-output-2.png" width="727" height="561"></p>
Expand Down
37 changes: 37 additions & 0 deletions schema/BasinSubgrid.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://deltares.github.io/Ribasim/schema/BasinSubgrid.schema.json",
"title": "BasinSubgrid",
"description": "A BasinSubgrid object based on Ribasim.BasinSubgridV1",
"type": "object",
"properties": {
"subgrid_id": {
"format": "default",
"type": "integer"
},
"node_id": {
"format": "default",
"type": "integer"
},
"basin_level": {
"format": "double",
"type": "number"
},
"subgrid_level": {
"format": "double",
"type": "number"
},
"remarks": {
"description": "a hack for pandera",
"type": "string",
"format": "default",
"default": ""
}
},
"required": [
"subgrid_id",
"node_id",
"basin_level",
"subgrid_level"
]
}
32 changes: 7 additions & 25 deletions schema/Results.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,6 @@
"description": "A Results object based on Ribasim.config.Results",
"type": "object",
"properties": {
"basin": {
"format": "default",
"type": "string",
"default": "results/basin.arrow"
},
"flow": {
"format": "default",
"type": "string",
"default": "results/flow.arrow"
},
"control": {
"format": "default",
"type": "string",
"default": "results/control.arrow"
},
"allocation": {
"format": "default",
"type": "string",
"default": "results/allocation.arrow"
},
"outstate": {
"format": "default",
"anyOf": [
Expand All @@ -46,14 +26,16 @@
"format": "default",
"type": "integer",
"default": 6
},
"subgrid": {
"format": "default",
"type": "boolean",
"default": false
}
},
"required": [
"basin",
"flow",
"control",
"allocation",
"compression",
"compression_level"
"compression_level",
"subgrid"
]
}
26 changes: 12 additions & 14 deletions schema/Config.schema.json → schema/Toml.schema.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://deltares.github.io/Ribasim/schema/Config.schema.json",
"title": "Config",
"description": "A Config object based on Ribasim.config.Config",
"$id": "https://deltares.github.io/Ribasim/schema/Toml.schema.json",
"title": "Toml",
"description": "A Toml object based on Ribasim.config.Toml",
"type": "object",
"properties": {
"starttime": {
Expand All @@ -15,17 +15,16 @@
},
"input_dir": {
"format": "default",
"type": "string",
"default": "."
"type": "string"
},
"results_dir": {
"format": "default",
"type": "string",
"default": "results"
"type": "string"
},
"database": {
"format": "default",
"type": "string"
"type": "string",
"default": "database.gpkg"
},
"allocation": {
"$ref": "https://deltares.github.io/Ribasim/schema/Allocation.schema.json",
Expand All @@ -39,7 +38,8 @@
"$ref": "https://deltares.github.io/Ribasim/schema/Solver.schema.json",
"default": {
"algorithm": "QNDF",
"saveat": [],
"saveat": [
],
"adaptive": true,
"dt": null,
"dtmin": null,
Expand All @@ -64,13 +64,10 @@
"results": {
"$ref": "https://deltares.github.io/Ribasim/schema/Results.schema.json",
"default": {
"basin": "results/basin.arrow",
"flow": "results/flow.arrow",
"control": "results/control.arrow",
"allocation": "results/allocation.arrow",
"outstate": null,
"compression": "zstd",
"compression_level": 6
"compression_level": 6,
"subgrid": false
}
},
"terminal": {
Expand Down Expand Up @@ -126,6 +123,7 @@
"profile": null,
"state": null,
"static": null,
"subgrid": null,
"time": null
}
},
Expand Down
12 changes: 12 additions & 0 deletions schema/basin.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@
],
"default": null
},
"subgrid": {
"format": "default",
"anyOf": [
{
"type": "null"
},
{
"type": "string"
}
],
"default": null
},
"time": {
"format": "default",
"anyOf": [
Expand Down
3 changes: 3 additions & 0 deletions schema/root.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
"basinstatic": {
"$ref": "basinstatic.schema.json"
},
"basinsubgrid": {
"$ref": "basinsubgrid.schema.json"
},
"basintime": {
"$ref": "basintime.schema.json"
},
Expand Down
23 changes: 15 additions & 8 deletions search.json

Large diffs are not rendered by default.

0 comments on commit 791d027

Please sign in to comment.