:py:mod:`wolfgpu.test_scenarios` ================================ .. py:module:: wolfgpu.test_scenarios .. 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:data:: DATA_DIR .. py:data:: NPAS_BASE :value: 1000000 .. py:function:: create_swimming_pool(destination_dir: pathlib.Path, width: int = 100, height: int = 50, x_aligned_borders: bool = True, water_height=np.float32(5.0), wall_height=np.float32(100.0), bathy_min=np.float32(0.0), napbin: numpy.ndarray = None, top: numpy.ndarray = None, frott: float = 0.0, suxsuy=True) -> wolfhece.mesh2d.wolf2dprev.prev_sim2D Creates a monobloc prev_sim2D (WOLF 2D) that represents a kind of swimming pool. The pool is open on two of its sides (you **have to** provide boundary conditions to handle that) or fully closed (no b.c. necessary). The pool is filled with water. The water is still (no movement). It is frictionless or not. This class is used for testing purposes. Its base name will be `simul` :param x_aligned_borders: True= borders x aligned, False = borders y aligned, "squared" : both borders. :param width: width of the pool (number of cells along X axis == Nbx == number of lines of the WolfArray) - default: 100 :param height: height of the pool (number of cells along Y axis == Nby == number of columns of the WolfArray) - default: 50 :param water_height: water depth in the pool - default: 5.0 :param wall_height: height of the walls of the pool -- Must be higher than water_height - default: 100 :param bathy_min: minimum depth of the pool (the bottom of the pool) - default: 0.0 :param napbin: a numpy array that will be used to fill the `napbin` array of the simulation :param top: a numpy array that will be used to fill the `top` array of the simulation :param frott: friction coefficient of the pool - scalar value Swimming pool (width*height cells) structure: ////////// with: '/' = masked cell; 'W':wall cell, '.':wet cell /WWWWWWWW/ /......../ /......../ /......../ /WWWWWWWW/ ////////// .. py:function:: scenario_cube_drop(destination_dir: pathlib.Path, width=None, height=None) A cube of water spreads into a filled swimming pool. No boundary conditions. .. py:function:: scenario_still_water(destination_dir: pathlib.Path, width=10, height=10, rockyness=0, water_height=np.float32(5.0)) A frictionless swimming pool filled with completely still, motionless, water. rockyness = 0 = flat bed. 1: maximum randomness on bed height .. py:function:: scenario_still_water_rocky_bed(destination_dir: pathlib.Path, width=10, height=10) A swimming pool filled with completely still, motionless, water. Bed is rocky, with a random height between 0 and 1. .. py:function:: scenario4(destination_dir: pathlib.Path, N: int = 2830, active_surface: float = 0.25, optim_pas: bool = False, npas: int = 100, hini: float = 10.0) -> wolfhece.mesh2d.wolf2dprev.prev_sim2D A block of water at the center of an empty (dry) pool. Scenario without boundary conditions and friction set to 0.01. :param N: size of the squared pool :param active_surface: proportion of the pool that is active (filled with water) :param optim_pas: optimize time step :param npas: number of time steps to compute .. py:function:: scenario4_odd(destination_dir: pathlib.Path, N: int = 2830, active_surface: float = 0.25, optim_pas: bool = False, npas: int = 100, hini: float = 1.0) -> wolfhece.mesh2d.wolf2dprev.prev_sim2D A block of water at the center of an empty (dry) pool. Scenario without boundary conditions and friction set to 0.01. :param N: size of the squared pool :param active_surface: proportion of the pool that is active (filled with water) :param optim_pas: optimize time step :param npas: number of time steps to compute .. py:function:: scenario_sine_ground_sine_water(destination_dir: pathlib.Path, N=100, freq=10.0, translate=0) .. py:function:: scenario_small_movement(destination_dir: pathlib.Path) .. py:function:: scenario_multiple_infiltration(dest_dir: pathlib.Path) -> wolfhece.mesh2d.wolf2dprev.prev_sim2D .. py:function:: scenario1(destination_dir: pathlib.Path, size=100, bc_qx_factor=1.1, bc_hmod_factor=1.05, friction=0.04, WATER_HEIGHT=10.0, IC_SPEED=1.0) Water moving left to right .. py:function:: create_steady_flow_swimming_pool_bottom_to_top(destination_dir: pathlib.Path, WATER_HEIGHT=np.float32(10.0), width=50, height=100) -> wolfhece.mesh2d.wolf2dprev.prev_sim2D Water flows steadily from bottom to top (positive direction). :param IC: Water level is flat across the pool and water is moving at some speed. :param BC: water gets in the simulation at the same speed as the IC. h is set at the same height as IC where the water leaves the simulation. There's no friction. .. py:function:: create_steady_flow_swimming_pool_top_to_bottom(destination_dir: pathlib.Path, WATER_HEIGHT=np.float32(10.0), width=50, height=100) -> wolfhece.mesh2d.wolf2dprev.prev_sim2D Water flows steadily from bottom to top (positive direction). IC: Water level is flat across the pool and water is moving at some speed. BC: water gets in the simulation at the same speed as the IC. h is set at the same height as IC where the water leaves the simulation. There's no friction. .. py:function:: scenario_drying(destination_dir: pathlib.Path, size=100, friction=0.04, WATER_HEIGHT=1.0, top_topo=2.0) Water moving left to right .. py:function:: save_short_format(wolf: wolfhece.mesh2d.wolf2dprev.prev_sim2D, glsim: wolfgpu.glsimulation.GLSimulation, filename: pathlib.Path, row_slice: slice = None, col_slice: slice = None, transpose=False, hbin=None, qxbin=None, qybin=None)