:py:mod:`wolfgpu.toy_datasets` ============================== .. py:module:: wolfgpu.toy_datasets .. autoapi-nested-parse:: 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 --------------- .. py:class:: WallDirection Bases: :py:obj:`enum.Enum` .. autoapi-inheritance-diagram:: wolfgpu.toy_datasets.WallDirection :parts: 1 :private-bases: Generic enumeration. Derive from this class to define new enumerations. .. py:attribute:: HORIZONTAL :value: 1 Walls follow x-axis .. py:attribute:: VERTICAL :value: 2 Walls follow y-axis .. py:attribute:: HORIZONTAL_AND_VERTICAL :value: 3 Walls follow x and y-axis .. py:function:: make_closed_pool(width, height, pos_x, pos_y, pool_width, pool_height, wall_height=10, mode='cube') -> wolfgpu.simple_simulation.SimpleSimulation 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) .. py:function:: make_cube_drop(width, height, water_cube_height=10.0) -> wolfgpu.simple_simulation.SimpleSimulation 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 :param width, height: dimensions of the simulation domain. :param water_cube_height: height of the cube of water (meters). .. py:function:: 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 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. :param width: dimensions of the swimming pool along X. :param height: dimensions of the swimming pool along Y. :param water_depth: the swimming pool will be filled with that height of water (meters). :param 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. :param manning: the Manning coefficient of the water in the pool (default = 0.4). .. py:function:: 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 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. :param width: dimensions of the channel along X. :param height: dimensions of the channel along Y. :param water_depth: the channel will be filled with that height of water (meters). :param 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. .. py:function:: add_uniform_bridge2channel(sim: wolfgpu.simple_simulation.SimpleSimulation, pos: float = None, width: float = 20.0, roof_elevation: float = 5.0) Add a bridge to the simulation. :param sim: the simulation to modify. :param pos: position of the bridge (in meters). If None, the bridge is placed at the center of the simulation. :param width: width of the bridge (in meters). :param elevation: elevation of the bridge's roof (in meters). .. py:function:: 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) Add a triangular bridge to the simulation. :param sim: the simulation to modify. :param pos: position of the bridge (in meters). If None, the bridge is placed at the center of the simulation. :param width: width of the bridge (in meters). :param elevation_min: minimum elevation of the bridge's roof (in meters) at the center. :param elevation_max: maximum elevation of the bridge's roof (in meters) at the extrema. .. py:function:: 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) Add an single arch bridge to the simulation. :param sim: the simulation to modify. :param pos: position of the bridge (in meters). If None, the bridge is placed at the center of the simulation. :param width: width of the bridge (in meters). :param elevation_min: minimum elevation of the bridge's roof (in meters) at the extrema. :param elevation_max: maximum elevation of the bridge's roof (in meters) at the center. .. py:function:: 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) Add a multi-arch bridge to the simulation. :param sim: the simulation to modify. :param pos: position of the bridge (in meters). If None, the bridge is placed at the center of the simulation. :param width: width of the bridge (in meters). :param nb_arches: number of arches in the bridge. :param elevation_min: minimum elevation of the bridge's roof (in meters) at the extrema. :param elevation_max: maximum elevation of the bridge's roof (in meters) at the center.