tilupy.models.shaltop.read

Attributes

LOOKUP_NAMES

Dictionary of correspondance, to match code output names.

AVAILABLE_OUTPUT

All output available for a shaltop simulation.

READ_FROM_FILE_OUTPUT

Output read from the file.

FORCES_OUTPUT

Force-related output variables, including components in x, y, and additional forces.

INTEGRATED_OUTPUT

Integrated energy quantities.

Functions

read_params(→ dict)

Read simulation parameters from file.

read_file_bin(→ numpy.ndarray)

Read shaltop .bin result file.

read_file_init(→ numpy.ndarray)

Read shaltop initial .d files.

Classes

Results

Results of shaltop simulations.

Module Contents

Attributes

tilupy.models.shaltop.read.LOOKUP_NAMES

Dictionary of correspondance, to match code output names.

tilupy.models.shaltop.read.AVAILABLE_OUTPUT = ['h', 'hvert', 'u', 'hu', 'hu2', 'ux', 'uy']

All output available for a shaltop simulation.

Implemented states:

  • h : Flow thickness (normal to the surface)

  • hvert : True vertical flow thickness

  • ux : Velocity component in X direction

  • uy : Velocity component in Y direction

Output computed from other output:

  • u : Norm of the velocity (from ux and uy)

  • hu : Momentum flux (from h and u)

  • hu2 : Convective momentum flux (from h and u)

tilupy.models.shaltop.read.READ_FROM_FILE_OUTPUT = ['h_max', 'u_max', 'hu_max', 'hu2_int']

Output read from the file.

Read output:

  • h_max : Maximum value of h integrating all time steps

  • u_max : Maximum value of u integrating all time steps

  • hu_max : Maximum value of hu integrating all time steps

  • hu2_int : Integral of values of hu2 for each time steps

tilupy.models.shaltop.read.FORCES_OUTPUT = []

Force-related output variables, including components in x, y, and additional forces.

Generated from:

  • faccx, faccy : acceleration force

  • fcurvx, fcurvy : curvature force

  • ffricx, ffricy : friction force

  • fgravx, fgravy : gravitational force

  • finertx, finerty : inertial force

  • fpressionx, fpressiony : pressure force

Additional variables:

  • shearx, sheary, shearz : shear stresses

  • normalx, normaly, normalz : normal stresses

  • pbottom : basal pressure

  • pcorrdt : pressure correction (time step)

  • pcorrdiv : pressure correction (divergence)

tilupy.models.shaltop.read.INTEGRATED_OUTPUT = ['ek', 'ep', 'etot']

Integrated energy quantities.

Implemented energy:

  • ek : kinetic energy

  • ep : potential energy

  • etot : total energy

Functions

tilupy.models.shaltop.read.read_params(file: str) dict

Read simulation parameters from file.

Parameters:

file (str) – Path to the parameters file.

Returns:

params – Dictionnary with parameters

Return type:

dict

tilupy.models.shaltop.read.read_file_bin(file: str, nx: int, ny: int) numpy.ndarray

Read shaltop .bin result file.

Parameters:
  • file (str) – Path to the .bin file.

  • nx (int) – Number of cells in the X direction.

  • ny (int) – Number of cells in the Y direction.

Returns:

Values in the .bin file.

Return type:

numpy.ndarray

tilupy.models.shaltop.read.read_file_init(file: str, nx: int, ny: int) numpy.ndarray

Read shaltop initial .d files.

Parameters:
  • file (str) – Path to the .d file.

  • nx (int) – Number of cells in the X direction.

  • ny (int) – Number of cells in the Y direction.

Returns:

Values in the .d file.

Return type:

numpy.ndarray

Classes

class tilupy.models.shaltop.read.Results(folder=None, file_params=None, **varargs)

Bases: tilupy.read.Results

Results of shaltop simulations.

This class is the results class for shaltop. Reading results from shaltop outputs are done in this class.

This class has all the global and quick attributes of the parent class. The quick attributes are only computed if needed and can be deleted to clean memory.

In addition to these attributes, there are those necessary for the operation of reading the shaltop results.

Parameters:
  • folder (str) – Path to the folder containing the simulation files.

  • file_params (str) – Name of the simulation parameters file.

_htype

Always “normal”.

Type:

str

_tforces

Times of output.

Type:

list

_params

Dictionary of the simulation parameters.

Type:

dict

get_zinit(zinit=None) numpy.ndarray

Get zinit, the initial topography.

Returns:

The initial topography.

Return type:

numpy.ndarray

get_axes(**varargs) tuple[numpy.ndarray, numpy.ndarray]

Get X and Y axes.

varargsdict

All parameters needed to compute the axes : x0, y0, nx, ny, per, pery and coord_pos.

Returns:

Values of X and Y axes.

Return type:

tuple[numpy.ndarray, numpy.ndarray]

get_u() numpy.ndarray

Compute velocity norm from results.

Returns:

Values of flow velocity (norm).

Return type:

numpy.ndarray