Geometry
Geometry(self, geometry_x, geometry_z, geometry_n)Represents a discretized 1D geometry composed of multiple connected geometry parts, each defined by a pair of x and z coordinates, and associated Manning roughness values.
Attributes
| Name | Type | Description |
|---|---|---|
| geometry_x | np.ndarray | Array of x-coordinates. |
| geometry_s | np.ndarray | Arrau of s-coordinates (distance along the geometry) |
| geometry_z | np.ndarray | Array of corresponding z-coordinates (elevation). |
| geometry_n | np.ndarray | Array of Manning’s n values, one per segment (length = len(x) - 1). |
| x | np.ndarray | Discretisation cell centers x |
| s | np.ndarray | Discretisation cell centers s |
| z | np.ndarray | Discretisation cell centers z |
| t | np.ndarray | Time steps of the results |
| u | np.ndarray | Results flow velocity [t, x] |
| h | np.ndarray | Results flow thickness along z-coordinates [t, x] |
| h_s | np.ndarray | Results flow thickness perpendicular to slope [t, x] |
| t_front | np.ndarray | Time of passing of the wetting front [x] |
| u_front | np.ndarray | Velocity of the wetting front [x] |
| simulated | bool | Flag whether the model is simulated |
| simulation_time | float | Time it took to simulate the model |
| boundary_condition | BCBase | The boundary condition applied when simulated |
Methods
| Name | Description |
|---|---|
| check_geometry | Validates the consistency of the geometry input arrays. |
| derive_front_velocity | Derive the time and velocity of the wetting front for this geometry part. |
| get_peak_flow | Get the peak flow characteristics along the x-coordinate. |
| get_st | Get the time series of flow variables at a specific s-location along the slope. |
| get_xt | Get the time series of flow variables at a specific x-location. |
check_geometry
Geometry.check_geometry()Validates the consistency of the geometry input arrays.
derive_front_velocity
Geometry.derive_front_velocity(threshold=0.01)Derive the time and velocity of the wetting front for this geometry part.
The wetting front is considered as the point where the water depth exceeds a given threshold. The time of passing (t_front) is calculated based on linear interpolation. The velocity (u_front) of the wetting front is calculated based on second-order differences.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| threshold | float | The threshold for determining the wetting front location (default: 0.01m) | 0.01 |
get_peak_flow
Geometry.get_peak_flow(get_h_perpendicular=True, quantile=1.0)Get the peak flow characteristics along the x-coordinate.
Parameters:
get_h_perpendicular : bool Whether to compute the perpendicular flow thickness (default is True). quantile : float, optional Get the quantiles, quantile=1 is the maximum values (default: 1.0)
Returns:
np.ndarray Numpy 2D array with [hpeak, upeak, qpeak]
get_st
Geometry.get_st(s, get_h_perpendicular=True)Get the time series of flow variables at a specific s-location along the slope.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| s | float | The slope-based coordinate (distance along the geometry). | required |
| get_h_perpendicular | bool | Whether to compute the perpendicular flow thickness (default is True). | True |
Returns
| Name | Type | Description |
|---|---|---|
| np.ndarray or None | A np.ndarray containing the time series at location x, or None if x is outside the modeled domain. |
get_xt
Geometry.get_xt(x, get_h_perpendicular=True)Get the time series of flow variables at a specific x-location.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| x | float | The x-coordinate at which to retrieve the time series. | required |
| get_h_perpendicular | bool | Whether to compute the perpendicular water depth (default is True). | True |
Returns
| Name | Type | Description |
|---|---|---|
| np.ndarray or None | A np.ndarray containing the time series [t, h, u] at location x, or None if x is outside the modeled domain. |