BassinVersant Class¶
The BassinVersant
class represents the entire watershed in the CEQUEAU model. It manages all the spatial components, including whole grid cells (CarreauEntier) and partial grid cells (CarreauPartiel), as well as other watershed components like dams and reservoirs.
Overview¶
BassinVersant is the core container class for the entire hydrological model. It:
- Holds collections of grid cells (CarreauEntier) and drainage cells (CarreauPartiel)
- Manages dams, reservoirs, and wells in the watershed
- Provides methods for routing water through the drainage network
- Implements watershed initialization from input data
Key Components¶
Spatial Elements¶
- CarreauEntier: Collection of whole grid cells covering the watershed
- CarreauPartiel: Collection of partial grid cells forming the drainage network
- Width and Height: Grid dimensions in terms of number of cells
Water Management Structures¶
- Barrages: Dams/reservoirs within the watershed
- Puits: Water extraction wells
Main Methods¶
Initialization¶
initialiserCarreauxEntiers
: Initialize the whole grid cells from input datainitialiserCarreauxPartiels
: Initialize the partial grid cells and drainage networkinitialiserBarrage
: Set up dams and reservoirs within the watershed
Grid Cell Access¶
trouverCarreauEntierParId
: Find a whole grid cell by its IDtrouverCarreauPartielParId
: Find a partial grid cell by its IDtrouverBarrageParIdCP
: Find a dam by its partial grid cell ID
Water Management¶
possedeBarrage
: Check if a specific location has a dampuits
: Access water extraction wellscalculerCoeffTransfert
: Calculate flow transfer coefficients
Example Usage¶
The BassinVersant class is typically used as follows:
// Initialize the watershed
BassinVersant bassinVersant;
bassinVersant.initialiserCarreauxEntiers(carreauxEntiersData);
bassinVersant.initialiserCarreauxPartiels(carreauxPartielsData);
// Simulate water flow through the watershed
for (auto& cp : bassinVersant.carreauxPartiels()) {
// Process each partial grid cell
}
// Check for dams at a specific location
if (bassinVersant.possedeBarrage(idCP)) {
// Handle dam operations
}