Skip to content

Commit

Permalink
Use ribasim.org domain name
Browse files Browse the repository at this point in the history
  • Loading branch information
visr committed Aug 19, 2024
1 parent 9bdb262 commit 179e8d8
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 36 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![QGIS Tests](https://github.com/Deltares/Ribasim/actions/workflows/qgis.yml/badge.svg)](https://github.com/Deltares/Ribasim/actions/workflows/qgis.yml)
[![codecov](https://codecov.io/gh/Deltares/Ribasim/branch/main/graph/badge.svg)](https://codecov.io/gh/Deltares/Ribasim)

**Documentation: https://deltares.github.io/Ribasim/**
**Documentation: https://ribasim.org/**

Ribasim is a water resources model, designed to be the replacement of the regional surface
water modules Mozart and SIMRES in the Netherlands Hydrological Instrument (NHI). Ribasim is
Expand Down
2 changes: 1 addition & 1 deletion docs/concept/concept.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ This version of Ribasim is the follow up of the legacy Fortran kernel of Ribasim

## Physical layer {#sec-physical}

To represent the physical characteristics of the water system in an area, Ribasim allows you to divide the area into a network of connected representative elementary watersheds ([Reggiani, Sivapalan, and Majid Hassanizadeh 1998](https://deltares.github.io/Ribasim/#ref-REGGIANI1998367)).
To represent the physical characteristics of the water system in an area, Ribasim allows you to divide the area into a network of connected representative elementary watersheds [@REGGIANI1998367].
Within Ribasim, these elements are called basins, which are essentially buckets or reservoirs holding an aggregated volume of water bodies in an area.
Basins are chained in a graph with connector nodes determining the exchange of water between the basins.
These connector nodes can represent open water connections (e.g. bifurcations or resistance in a free flowing open water channel) or infrastructure elements such as pumps, gates or weirs.
Expand Down
38 changes: 19 additions & 19 deletions docs/dev/allocation.qmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "Allocation"
---
# Overview of allocation implementation
# Overview of allocation implementation [#sec-allocation-overview]
In this document, the allocation workflow is explained. Below is an overview of it.
```{mermaid}
flowchart TD
Expand All @@ -17,28 +17,28 @@ flowchart TD
H --> |Yes| D(End)
```

If allocation is used in a model, [Allocation structs](https://deltares.github.io/Ribasim/dev/allocation.html#the-allocation-struct) are created.
If allocation is used in a model, [Allocation structs](#sec-allocation-struct) are created.
The allocation struct stores the data that is needed for the calculations and stores also the results of the calculation.
In allocation, optimization is an essential part.
`JuMP.jl` is used to model and solve the optimization problems that are defined by allocation.
The [AllocationModel struct](https://deltares.github.io/Ribasim/dev/allocation.html#the-allocation-struct) is used for constructing the JuMP model.
The [AllocationModel struct](#sec-allocation-model-struct) is used for constructing the JuMP model.
When an instance of `AllocationModel` is created, a JuMP optimization model is defined and initialized in the instance.
More details on how allocation interacts with `JuMP.jl` is explained [here](https://deltares.github.io/Ribasim/dev/allocation.html#jump.jl-problem-interaction).
More details on how allocation interacts with `JuMP.jl` is explained [here](#sec-jump-problem).

After initialization, as the simulation starts, the allocation problem is solved and updated after every allocation timestep (which is specified in the TOML).
With every allocation timestep a new optimization problem is formulated and solved, using the latest available (simulation) model conditions and forcing and demand predictions.

The update of allocation (`update_allocation`) is repeating and spread into three parts:

- Updating the mean flows. The mean flow data is only used only for output, not used by any internal functions.
- ["Collect demand"](https://deltares.github.io/Ribasim/concept/allocation.html#the-high-level-algorithm). This step initialize and solve the optimization problems that collects the demand from the subnetworks.
- ["Allocate"](https://deltares.github.io/Ribasim/concept/allocation.html#the-high-level-algorithm). This step solves the optimization problems that allocates the demand. For the main network this step allocates to the subnetworks and demand nodes that are in the main network. For the subnetwork this step allocates to the demand nodes.
- ["Collect demand"](#sec-allocation-overview). This step initialize and solve the optimization problems that collects the demand from the subnetworks.
- ["Allocate"](#sec-allocation-overview). This step solves the optimization problems that allocates the demand. For the main network this step allocates to the subnetworks and demand nodes that are in the main network. For the subnetwork this step allocates to the demand nodes.

The steps "collect demand" and "allocate" correspond to the function `collect_demand` and `allocate_demand` in the code.

The iteration stops when it reaches the end time step.

## The `Allocation` struct
## The `Allocation` struct [#sec-allocation-struct]

The `Allocation` struct stores necessary data and calculation results.

Expand All @@ -55,7 +55,7 @@ The `Allocation` struct stores necessary data and calculation results.
|record_demand | | A record of demands and allocated flows for nodes that have these|
|record_flow | | A record of all flows computed by allocation optimization, eventually saved to output file|

## The `AllocationModel` struct
## The `AllocationModel` struct [#sec-allocation-model-struct]

The `AllocationModel` struct has all the data that is needed for the JuMP optimization problem.

Expand All @@ -66,7 +66,7 @@ The `AllocationModel` struct has all the data that is needed for the JuMP optimi
|problem | JuMP.Model | The JuMP.jl model for solving the allocation problem|
|Δt_allocation | Float64 | The time interval between consecutive allocation solves |

## `JuMP.jl` problem interaction
## JuMP problem interaction [#sec-jump-problem]
When working with optimization problems using JuMP, there are three fundamental components that need to be defined:

- Optimization variables: These are the [variables](https://jump.dev/JuMP.jl/stable/api/JuMP/#@constraints) that are optimized in the allocation problem formulation.
Expand All @@ -77,15 +77,15 @@ For example, to specify the flow rates in all the edges in the allocation networ
problem[:F] = JuMP.@variable(problem, F[edge = edges] >= 0.0)
```

More details about setting up variables in allocation can be found in the section [below](https://deltares.github.io/Ribasim/dev/allocation.html#optimization-problem).
More details about setting up variables in allocation can be found in the section [below](#sec-optimization-problem).

- Constraints: These are the constraints that the optimization variables must satisfy.
They are defined using the [`@constraint`](https://jump.dev/JuMP.jl/stable/api/JuMP/#@constraints) macro.
The definition of the edge capacity constraints is shown in section [below](https://deltares.github.io/Ribasim/dev/allocation.html#setting-the-constraints-and-capacities).
`add_constraints_...` functions are used to [add constraints](https://deltares.github.io/Ribasim/dev/allocation.html#setting-up-initial-optimization-constraints) to the optimization problem.
The [initial value of the constraints](https://deltares.github.io/Ribasim/dev/allocation.html#setting-the-constraints-and-capacities) is set in the function `set_initial_values_...`.
They are defined using the [`@constraint`](https://jump.dev/JuMP.jl/stable/api/JuMP/#@constraint) macro.
The definition of the edge capacity constraints is shown in section [below](#sec-constraints-and-capacities).
`add_constraints_...` functions are used to [add constraints](#sec-initial-constraints) to the optimization problem.
The [initial value of the constraints](#sec-constraints-and-capacities) is set in the function `set_initial_values_...`.
During the iteration, the constraints are updated based on the current state of the allocation network.
When [looping over priorities](https://deltares.github.io/Ribasim/dev/allocation.html#updating-capacities), the constraints are updated by the function `adjust_...`.
When [looping over priorities](#updating-capacities), the constraints are updated by the function `adjust_...`.

- Objective function: This is the function that sets the objective of the optimization problem.
It is defined using the [`@objective`](https://jump.dev/JuMP.jl/stable/api/JuMP/#@objective) macro.
Expand Down Expand Up @@ -117,7 +117,7 @@ The function `get_capacity` obtains the capacities of the edges within a subnetw
The function `find_subnetwork_connetions` finds the edges that connected the main network to a subnetwork. `subnetwork_demands` and `subnetwork_allocateds` will be created, which stores demands and allocated values for subnetworks as a whole.
`main_network_connections` is a vector of edges that connect a subnetwork with the main network.

## The optimization problem
## The optimization problem [#sec-optimization-problem]
### Setting up the optimization variables
There are three types of variables in the optimization problems:

Expand Down Expand Up @@ -152,7 +152,7 @@ problem[:F_basin_out] =

The last set of optimization variables is the flow edges in and out of the buffer of nodes with a flow demand. It is defined in a similar way to the second set of variables.

### Setting up initial optimization constraints
### Setting up initial optimization constraints [#sec-initial-constraints]
All the variables are greater and equal to 0. This is set when the variables are added to the optimization problem.

Other constraints are `capacity`, `source_user`, `source`, `flow_conservation`, `fractional_flow`, `basin_outflow`, `flow_buffer_outflow` and `flow_demand_outflow`.
Expand Down Expand Up @@ -237,7 +237,7 @@ Source constraints will be adapted based on the optimization type.
This function is called separately and thus not part of the `set_initial_values`.

## Looping over priorities
### Updating capacities
### Updating capacities [#sec-updating-capacities]
While optimizing a given priority, the function `set_capacities_flow_demand_outflow` updates the constraints `flow_demand_outflow`.
If the current priority is the same as the priority of the flow demand, constraints will be infinite, otherwise 0.
At priorities where there is no flow demand, flow can go freely trough the node. When there is flow demand, flow is directed into the buffer. This is to make sure that flow can go to the node with the flow demand, even though the flow might have nowhere to go after that node.
Expand Down Expand Up @@ -274,7 +274,7 @@ Afterwards, it writes the resulting flow to the `Allocation` object.

### `UserDemand` abstraction
When allocation is active, the amount each `UserDemand` node is allowed to extract from its upstream basin is determined by the allocation algorithm.
See [here](https://deltares.github.io/Ribasim/reference/node/user-demand.html) for more details on how allocation updates the `UserDemand` node.
See [here](/reference/node/user-demand.qmd) for more details on how allocation updates the `UserDemand` node.

### Controlling pumps/weirs based on allocation results
N/A and TODO in [this task](https://github.com/Deltares/Ribasim/issues/714).
4 changes: 2 additions & 2 deletions docs/dev/release.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Don't change the old version numbers in `changelog.qmd`.

## Update the changelog

The `docs/changelog.qmd` file, hosted on https://deltares.github.io/Ribasim/changelog, records the most important changes for users.
The `docs/changelog.qmd` file, hosted on https://ribasim.org/changelog, records the most important changes for users.
Review the commits since the [latest Ribasim release](https://github.com/Deltares/Ribasim/releases/latest) to make sure these are listed.
Change the "Unreleased" section to the new version number and date, and create a new empty "Unreleased" section at the top.

Expand Down Expand Up @@ -102,4 +102,4 @@ It is a good idea to load new test models if there are any, or test any other ch

Announce the release in appropriate channels.
Include a link to the release notes and assets, which is whatever [this](https://github.com/Deltares/Ribasim/releases/latest) resolves to at that time.
Also include a link to the [documentation](https://deltares.github.io/Ribasim/).
Also include a link to the [documentation](https://ribasim.org/).
4 changes: 2 additions & 2 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ platforms = ["win-64", "linux-64", "osx-arm64", "osx-64"]
readme = "README.md"
license = "MIT"
license-file = "LICENSE"
homepage = "https://deltares.github.io/Ribasim/"
documentation = "https://deltares.github.io/Ribasim/"
homepage = "https://ribasim.org/"
documentation = "https://ribasim.org/"
repository = "https://github.com/Deltares/Ribasim"

[tasks]
Expand Down
4 changes: 2 additions & 2 deletions python/ribasim/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ setup is fully reproducible.
The package is [registered in PyPI](https://pypi.org/project/ribasim/) and can therefore
be installed with `pip install ribasim`.

For documentation please see the https://deltares.github.io/Ribasim/ and [API reference](https://deltares.github.io/Ribasim/reference/python/)
For documentation please see the https://ribasim.org/ and [API reference](https://ribasim.org/reference/python/)

# Contributing

For the developer docs please have a look at https://deltares.github.io/Ribasim/dev/.
For the developer docs please have a look at https://ribasim.org/dev/.
2 changes: 1 addition & 1 deletion python/ribasim/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ delwaq = ["jinja2", "networkx", "ribasim[netcdf]"]
all = ["ribasim[tests]", "ribasim[netcdf]", "ribasim[delwaq]"]

[project.urls]
Documentation = "https://deltares.github.io/Ribasim"
Documentation = "https://ribasim.org/"
Source = "https://github.com/Deltares/Ribasim"

[tool.hatch.version]
Expand Down
2 changes: 1 addition & 1 deletion python/ribasim_api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ conda install -c conda-forge ribasim-api

# Contributing

For the developer docs please have a look at https://deltares.github.io/Ribasim/dev/.
For the developer docs please have a look at https://ribasim.org/dev/.
2 changes: 1 addition & 1 deletion python/ribasim_api/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dynamic = ["version"]
tests = ["pytest", "ribasim", "ribasim_testmodels"]

[project.urls]
Documentation = "https://deltares.github.io/Ribasim"
Documentation = "https://ribasim.org/"
Source = "https://github.com/Deltares/Ribasim"

[tool.hatch.version]
Expand Down
2 changes: 1 addition & 1 deletion python/ribasim_testmodels/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ The test models are used for internal testing of Ribasim.

# Contributing

For the developer docs please have a look at https://deltares.github.io/Ribasim/contribute/
For the developer docs please have a look at https://ribasim.org/dev/
2 changes: 1 addition & 1 deletion python/ribasim_testmodels/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dynamic = ["version"]
tests = ["pytest"]

[project.urls]
Documentation = "https://deltares.github.io/Ribasim"
Documentation = "https://ribasim.org/"
Source = "https://github.com/Deltares/Ribasim"

[tool.hatch.version]
Expand Down
7 changes: 3 additions & 4 deletions ribasim_qgis/metadata.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,12 @@ repository=https://github.com/Deltares/Ribasim
# Recommended items:

hasProcessingProvider=no
# Uncomment the following line and add your changelog:
# changelog=https://deltares.github.io/Ribasim/changelog.html
changelog=https://ribasim.org/changelog

# Tags are comma separated with spaces allowed
tags=julia, hydrology, water allocation
tags=hydrology, water, water resources, model, julia

homepage=https://github.com/Deltares/Ribasim
homepage=https://ribasim.org/
category=Plugins
icon=icon.png
# experimental flag
Expand Down

0 comments on commit 179e8d8

Please sign in to comment.