2.0.0b10
catchment modelling framework
Loading...
Searching...
No Matches
project Class Reference

The study area, holding all cells, outlets and streams. More...

+ Collaboration diagram for project:

Detailed Description

The study area, holding all cells, outlets and streams.

Public Member Functions

 project (std::string solute_names="")
 Creates a new project.
 
upslope::Cellget_cell (ptrdiff_t index)
 Returns the reference to the cell at index in the project.
 
const upslope::cell_vectorget_cells () const
 Returns the cells in the project.
 
cmf::water::flux_node::ptr get_node (ptrdiff_t index)
 Returns the node from the project nodes at index.
 
cmf::river::Reach::ptr get_reach (ptrdiff_t index)
 Returns the reach at index.
 
cmf::water::node_list get_storages ()
 Returns a list of all storages of this project.
 
cmf::upslope::CellNewCell (double x, double y, double z, double area, bool with_surfacewater=false)
 Creates a new cell.
 
cmf::water::NeumannBoundary::ptr NewNeumannBoundary (std::string name, cmf::water::WaterStorage::ptr target)
 Creates a new Neumann boundary for a target water storage.
 
cmf::river::OpenWaterStorage::ptr NewOpenStorage (std::string name, double x, double y, double z, double area)
 Creates a new open water storage with a prism geometry.
 
cmf::water::DirichletBoundary::ptr NewOutlet (std::string name, double x=0, double y=0, double z=0)
 Creates a new Dirichlet boundary condition and adds it to the list of outlets The potential of the Dirichlet boundary equals z, but can be changed.
 
cmf::river::Reach::ptr NewReach (double x, double y, double z, cmf::river::IChannel &shape, bool diffusive=false)
 Creates a new reach.
 
cmf::water::WaterStorage::ptr NewStorage (std::string name, double x=0, double y=0, double z=0)
 Creates a new generic water storage at position x,y,z.
 
size_t node_count () const
 Returns the number of nodes saved with this project.
 
size_t reach_count () const
 Returns the number of reaches in this project.
 
size_t remove_node (cmf::water::flux_node::ptr node)
 Removes a node from the repository.
 
size_t size () const
 The number of cells in the project.
 
void use_IDW_meteo (double z_weight=0, double power=2)
 Uses IDW interpolation to generate meterological data for each cell of project.
 
void use_IDW_rainfall (double z_weight=0, double power=2)
 Uses IDW interpolation to generate rainfall data for each cell of project.
 
void use_nearest_meteo (double z_weight=0)
 Connects all cells of the project with its nearest meteorological station.
 
void use_nearest_rainfall (double z_weight=0)
 Connects all cells of the project with its nearest rainfall station.
 

Public Attributes

cmf::atmosphere::MeteoStationList meteo_stations
 The meteorological stations in the project.
 
cmf::atmosphere::RainfallStationList rainfall_stations
 The rainfall stations of the project.
 
const cmf::water::solute_vector solutes
 The solutes transported by the model.
 

Friends

class cmf::upslope::Cell
 

Constructor & Destructor Documentation

◆ project()

project ( std::string solute_names = "")

Creates a new project.

Parameters
solute_namesA string representing the names of the solutes to be used in the project. Sepereate solute names with space.

Member Function Documentation

◆ NewCell()

cmf::upslope::Cell * NewCell ( double x,
double y,
double z,
double area,
bool with_surfacewater = false )

Creates a new cell.

Returns
A new cell, owned by the project
Parameters
x,y,zPosition of the cell center in project coordinates (m)
areaArea of the cell in m^2
with_surfacewaterIf true, the cell will own a surfacewater storage upon creation

◆ NewNeumannBoundary()

cmf::water::NeumannBoundary::ptr NewNeumannBoundary ( std::string name,
cmf::water::WaterStorage::ptr target )

Creates a new Neumann boundary for a target water storage.

The boundary is stored with the project

Returns
A new Neumann boundary
Parameters
nameThe name of the boundary condition
targetThe water storage to which the Neumann boundary is bound

◆ NewOpenStorage()

cmf::river::OpenWaterStorage::ptr NewOpenStorage ( std::string name,
double x,
double y,
double z,
double area )

Creates a new open water storage with a prism geometry.

The open water storage is added to the project nodes

Returns
A new open water storage, owned by the project
Parameters
nameName of the open water storage for output
x,y,zPosition of the open water storage in project coordinates
areaSurface area of the open water storage

◆ NewOutlet()

cmf::water::DirichletBoundary::ptr NewOutlet ( std::string name,
double x = 0,
double y = 0,
double z = 0 )

Creates a new Dirichlet boundary condition and adds it to the list of outlets The potential of the Dirichlet boundary equals z, but can be changed.

Parameters
nameName of the boundary condition for output
x,y,zPosition of the boundary condition in project coordinates

◆ NewReach()

cmf::river::Reach::ptr NewReach ( double x,
double y,
double z,
cmf::river::IChannel & shape,
bool diffusive = false )

Creates a new reach.

Returns
A new reach, owned by the project
Parameters
x,y,zPosition of the reach in project coordinates
shapeCrossectional geometry of the river. Any class inheriting from cmf::water::IChannel
diffusiveIf true, this reach uses by default a diffusive wave connection

◆ NewStorage()

cmf::water::WaterStorage::ptr NewStorage ( std::string name,
double x = 0,
double y = 0,
double z = 0 )

Creates a new generic water storage at position x,y,z.

The storage is added to the project nodes

Returns
A new water storage, owned by the project
Parameters
nameName of the generic water storage for output
x,y,zPosition of the generic water storage condition in project coordinates

◆ remove_node()

size_t remove_node ( cmf::water::flux_node::ptr node)

Removes a node from the repository.

Removes a node (boundary condition or water storage) from the node repository of the project. NOTE: If you have other references to this node, the node is not deleted. If you are creating a new solver, the node will not be part of the solver.

◆ use_IDW_meteo()

void use_IDW_meteo ( double z_weight = 0,
double power = 2 )

Uses IDW interpolation to generate meterological data for each cell of project.

Creates a meteo-data source for each cell, using spatial interpolated data from all meteorological stations of the project using Inverse Distance Weighted (IDW) interpolation. The meteorolgical value f is calculated with IDW for position x,y,z and time t as follows:

\begin{eqnarray*} f(x,y,z,t) &=& \sum^N_{i=1}{f_i(t) w_i(x,y,z)} \\ w_i(x,y,z) &=& \frac{d_i(x,y,z)^{-p}}{\sum^N_{j=0}{d_j(x,y,z)^{-p}}} \\ d_i(x,y,z) &=& w_z \left|z-z_i\right| + \sqrt{\left(x-x_i\right)^2 + \left(y-y_i\right)^2} \end{eqnarray*}

  • \(N\) is the number of stations
  • \(f_i(t)\) the meteorological value at time t, eg. Temperature, Humidity
  • \(w_i\) is the weight of station i
  • \(d_i\) is the distance from x,y,z to station i
  • \(p\) the power of the weighting function, usually 2.
  • \(x_i,y_i,z_i\) is the position of station i in space
  • \(w_z\) is a factor to weight the vertical distance between stations and the cell. 0 results in a pure horizontal interpolation (normal IDW). If \(w_z=1\), height difference is as important as horizontal distance, and with \(w_z>1\) the height difference is weighted more important than horizontal distance
    See also
    IDW_Meteorology
    Parameters
    z_weight\(w_z\) the weight of height difference between cell and station
    powerthe power of the distance weight

◆ use_IDW_rainfall()

void use_IDW_rainfall ( double z_weight = 0,
double power = 2 )

Uses IDW interpolation to generate rainfall data for each cell of project.

Creates a rainfall-data source for each cell, using spatial interpolated data from all meteorological stations of the project using Inverse Distance Weighted (IDW) interpolation. The rainfall intensity P is calculated with IDW for position x,y,z and time t as follows:

\begin{eqnarray*} P(x,y,z,t) &=& \sum^N_{i=1}{P_i(t) w_i(x,y,z)} \\ w_i(x,y,z) &=& \frac{d_i(x,y,z)^{-p}}{\sum^N_{j=0}{d_j(x,y,z)^{-p}}} \\ d_i(x,y,z) &=& w_z \left|z-z_i\right| + \sqrt{\left(x-x_i\right)^2 + \left(y-y_i\right)^2} \end{eqnarray*}

  • \(N\) is the number of stations
  • \(P_i(t)\) the meteorological value at time t, eg. Temperature, Humidity
  • \(w_i\) is the weight of station i
  • \(d_i\) is the distance from x,y,z to station i
  • \(p\) the power of the weighting function, usually 2.
  • \(x_i,y_i,z_i\) is the position of station i in space
  • \(w_z\) is a factor to weight the vertical distance between stations and the cell. 0 results in a pure horizontal interpolation (normal IDW). If \(w_z=1\), height difference is as important as horizontal distance, and with \(w_z>1\) the height difference is weighted more important than horizontal distance
    See also
    IDW_Meteorology
    Parameters
    z_weight\(w_z\) the weight of height difference between cell and station
    powerthe power of the distance weight

◆ use_nearest_meteo()

void use_nearest_meteo ( double z_weight = 0)

Connects all cells of the project with its nearest meteorological station.

Distance is calculated as follows:

\[d_i(x,y,z) = w_z \left|z-z_i\right| + \sqrt{\left(x-x_i\right)^2 + \left(y-y_i\right)^2} \]

  • \(d_i\) is the distance from x,y,z to station i
  • \(p\) the power of the weighting function, usually 2.
  • \(x_i,y_i,z_i\) is the position of station i in space
  • \(w_z\) is a factor to weight the vertical distance between stations and the cell. 0 results in a pure horizontal interpolation (normal IDW). If \(w_z=1\), height difference is as important as horizontal distance, and with \(w_z>1\) the height difference is weighted more important than horizontal distance
    Parameters
    z_weight\(w_z\) the weight of height difference between cell and station

◆ use_nearest_rainfall()

void use_nearest_rainfall ( double z_weight = 0)

Connects all cells of the project with its nearest rainfall station.

Distance is calculated as follows:

\[d_i(x,y,z) = w_z \left|z-z_i\right| + \sqrt{\left(x-x_i\right)^2 + \left(y-y_i\right)^2} \]

  • \(d_i\) is the distance from x,y,z to station i
  • \(p\) the power of the weighting function, usually 2.
  • \(x_i,y_i,z_i\) is the position of station i in space
  • \(w_z\) is a factor to weight the vertical distance between stations and the cell. 0 results in a pure horizontal interpolation (normal IDW). If \(w_z=1\), height difference is as important as horizontal distance, and with \(w_z>1\) the height difference is weighted more important than horizontal distance
    Parameters
    z_weight\(w_z\) the weight of height difference between cell and station