CarreauPartiel Class¶
The CarreauPartiel
class represents partial grid cells that form the watershed drainage network in the CEQUEAU model. These are sub-units of whole grid cells (CarreauEntier) that define how water flows through the watershed.
Overview¶
CarreauPartiel (partial grid cells) are the fundamental units for streamflow routing in CEQUEAU. Each CarreauPartiel:
- Represents a portion of a CarreauEntier with a distinct drainage direction
- Forms part of the watershed's drainage network
- Connects to other CarreauPartiel cells in an upstream-downstream relationship
- Contains physical characteristics relevant to water routing
Key Properties¶
Identification¶
- id_: Unique identifier for the partial grid cell
- codeCarreauPartiel_: Special code for the partial cell
- idCarreauEntier_: Reference to the parent whole grid cell
- iCarreauEntier_, jCarreauEntier_: Grid coordinates of the parent whole grid cell
Connectivity¶
- idCarreauPartielAval_: ID of the downstream partial grid cell
- idCarreauxPartielsAmont_: IDs of upstream partial grid cells
Physical Characteristics¶
- pctSurface_: Percentage of the parent whole grid cell's area
- pctEau_: Percentage covered by water bodies
- pctForet_: Percentage covered by forest
- pctMarais_: Percentage covered by marshes
- pctSolNu_: Percentage of bare soil
Hydrographic Properties¶
- altitudeMoyenne_: Average elevation
- longueurCoursEauPrincipal_: Length of the main stream
- largeurCoursEauPrincipal_: Width of the main stream
- penteRiviere_: River slope
- azimutCoursEau_: Stream azimuth (direction)
Routing Parameters¶
- coeffTransfert_: Water transfer coefficient
- volumeInitial_: Initial water volume
Main Methods¶
Property Access¶
id()
: Get the cell's unique identifieridCarreauEntier()
: Get the parent whole grid cell IDidCarreauPartielAval()
: Get the downstream cell IDidCarreauxPartielsAmont()
: Get the upstream cells IDs
Hydrological Properties¶
pctSurface()
: Get the percentage of whole cell areapctEau()
,pctForet()
,pctMarais()
: Get land cover percentagesaltitudeMoyenne()
: Get average elevationpenteRiviere()
: Get river slope
Routing¶
coeffTransfert()
: Get/set the water transfer coefficientvolumeInitial()
: Get/set initial water volumecalculerCorrectionDebit()
: Calculate flow correction factors
Example Usage¶
// Access basic properties
int cpId = carreauPartiel.id();
int parentCellId = carreauPartiel.idCarreauEntier();
// Check downstream connectivity
int downstreamId = carreauPartiel.idCarreauPartielAval();
bool isOutlet = (downstreamId == 0); // 0 indicates watershed outlet
// Get upstream cells
const auto& upstreamIds = carreauPartiel.idCarreauxPartielsAmont();
bool isHeadwater = upstreamIds.empty();
// Access physical properties
float forestPercentage = carreauPartiel.pctForet();
float streamSlope = carreauPartiel.penteRiviere();