wolfgpu.toy_datasets
Author: HECE - University of Liege, Stéphane Champailler, Pierre Archambeau Date: 2024
Copyright (c) 2024 University of Liege. All rights reserved.
This script and its content are protected by copyright law. Unauthorized copying or distribution of this file, via any medium, is strictly prohibited.
Module Contents
- class wolfgpu.toy_datasets.WallDirection[source]
Bases:
enum.Enum
Generic enumeration.
Derive from this class to define new enumerations.
- wolfgpu.toy_datasets.make_closed_pool(width, height, pos_x, pos_y, pool_width, pool_height, wall_height=10, mode='cube') wolfgpu.simple_simulation.SimpleSimulation [source]
Make a cube of water, surrounded by empty space, surrounded by walls, surrounded by empty space.
The problem will be pool_width by pool_height but it will be placed onto a grid (width*height) at (pos_x,pos_y)
- wolfgpu.toy_datasets.make_cube_drop(width, height, water_cube_height=10.0) wolfgpu.simple_simulation.SimpleSimulation [source]
Create a simulation with a cube of water in the middle of the domain.
The block’s size is 1/4 of the domain’s size.
The spatial resolution is 1.0 meter per cell.
We will compute 10_000 time steps.
No discharges at initial time.
Topography is flat (0. m), except for the boundaries where we have a wall (100 m).
Manning coefficient is 0.4 everywhere (very rough).
- Attention:
USED IN BENCHMARKING
- Parameters:
height (width,) – dimensions of the simulation domain.
water_cube_height – height of the cube of water (meters).
- wolfgpu.toy_datasets.make_swimming_pool(width: int, height: int, water_depth: float, wall: WallDirection, manning: float = 0.4, dx: float = 1, dy: float = 1) wolfgpu.simple_simulation.SimpleSimulation [source]
Create a rectangular swimming pool surrounded by walls.
- Note:
the meshes at x,y=0 and x,y=W/H-1 are not used.
the meshes at x,y=1 and x,y=W/H-2 are filled with walls.
Therefore the smallest fully enclosed swimming pool one can build is 5x5 meshes.
Manning coefficient is set to 0.4 everywhere.
- Parameters:
width – dimensions of the swimming pool along X.
height – dimensions of the swimming pool along Y.
water_depth – the swimming pool will be filled with that height of water (meters).
wall – which walls should be build around the pool ? You can choose to build only those along x-axis (hoorizontal), y-axis (vertical) or both.
manning – the Manning coefficient of the water in the pool (default = 0.4).
- wolfgpu.toy_datasets.make_channel(width: int, height: int, water_depth: float, direction: WallDirection, manning: float = 0.04, dx: float = 1, dy: float = 1) wolfgpu.simple_simulation.SimpleSimulation [source]
Create a channel of water surrounded by walls.
- Note:
one cell all around the domain is not computed.
the walls are built on the second cell from the border.
the water is put inside the walls.
Therefore the smallest fully enclosed channel one can build is 5 cells wide.
- Parameters:
width – dimensions of the channel along X.
height – dimensions of the channel along Y.
water_depth – the channel will be filled with that height of water (meters).
direction – which walls should be build around the channel ? You can choose to build only those along x-axis (hoorizontal), y-axis (vertical) or both.
- wolfgpu.toy_datasets.add_uniform_bridge2channel(sim: wolfgpu.simple_simulation.SimpleSimulation, pos: float = None, width: float = 20.0, roof_elevation: float = 5.0)[source]
Add a bridge to the simulation.
- Parameters:
sim – the simulation to modify.
pos – position of the bridge (in meters). If None, the bridge is placed at the center of the simulation.
width – width of the bridge (in meters).
elevation – elevation of the bridge’s roof (in meters).
- wolfgpu.toy_datasets.add_triangular_bridge2channel(sim: wolfgpu.simple_simulation.SimpleSimulation, pos: float = None, width: float = 20.0, roof_elevation_min: float = 5.0, roof_elevation_max: float = 6.0)[source]
Add a triangular bridge to the simulation.
- Parameters:
sim – the simulation to modify.
pos – position of the bridge (in meters). If None, the bridge is placed at the center of the simulation.
width – width of the bridge (in meters).
elevation_min – minimum elevation of the bridge’s roof (in meters) at the center.
elevation_max – maximum elevation of the bridge’s roof (in meters) at the extrema.
- wolfgpu.toy_datasets.add_arch_bridge2channel(sim: wolfgpu.simple_simulation.SimpleSimulation, pos: float = None, width: float = 20.0, roof_elevation_min: float = 5.0, roof_elevation_max: float = 6.0)[source]
Add an single arch bridge to the simulation.
- Parameters:
sim – the simulation to modify.
pos – position of the bridge (in meters). If None, the bridge is placed at the center of the simulation.
width – width of the bridge (in meters).
elevation_min – minimum elevation of the bridge’s roof (in meters) at the extrema.
elevation_max – maximum elevation of the bridge’s roof (in meters) at the center.
- wolfgpu.toy_datasets.add_multi_arch_bridge2channel(sim: wolfgpu.simple_simulation.SimpleSimulation, pos: float = None, width: float = 20.0, nb_arches: int = 2, roof_elevation_min: float = 5.0, roof_elevation_max: float = 6.0)[source]
Add a multi-arch bridge to the simulation.
- Parameters:
sim – the simulation to modify.
pos – position of the bridge (in meters). If None, the bridge is placed at the center of the simulation.
width – width of the bridge (in meters).
nb_arches – number of arches in the bridge.
elevation_min – minimum elevation of the bridge’s roof (in meters) at the extrema.
elevation_max – maximum elevation of the bridge’s roof (in meters) at the center.