Peka2D_v5  v5.0
Functions
water.h File Reference
#include "define.h"
#include "structs.h"
Include dependency graph for water.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

EXPORT_DLL void c_compute_cell_mass (int nTasks, t_arrays *arrays)
 This function recounts and stores the total mass of all active cells. More...
 
EXPORT_DLL void c_initialize_delta (int nTasks, t_arrays *arrays)
 This function initializes the variation of conserved variables in the arrays structure to 0.0 and the array solidWallByCell to 0. More...
 
EXPORT_DLL void c_wall_rotated_calculus (int nTasks, t_arrays *arrays)
 This function computes the variation of conserved variables (dh, dhu, dhv) using the ARoe method at active walls. It includes source terms (bed slope and bed friction), positivity, entropy and wet/dry fixes. Additionally, it updates aux arrays and the list of active cells. More...
 
EXPORT_DLL void c_get_dtmin (int nTasks, t_arrays *arrays)
 This function finds the minimum time step out of the vector localDt. If the whole domain is dry, it is set to 1.0 seconds. More...
 
EXPORT_DLL void c_update_contributions (int nTasks, t_arrays *arrays)
 This function computes the right-hand side of the equations to update each physical variable. More...
 
EXPORT_DLL void c_checkpos_h (int nTasks, t_arrays *arrays, int *check)
 This function checks the positivity of the water depth. If there is a cell where the depth is negative (-tol), it write a notification flag in variable check. More...
 
EXPORT_DLL void c_reduce_dt (t_arrays *arrays)
 This function multiplies the time step by a factor of 0.8 if the there is a change to get negative water depths (as checked in function c_checkpos_h). More...
 
EXPORT_DLL void c_set_new_dt (t_arrays *arrays)
 This function sets the new time step according to the dumping and final times. If the precomputed time step is too big, it is reduced to match the desired time. More...
 
EXPORT_DLL void c_update_cells (int nTasks, t_arrays *arrays)
 This function updates the water depth and water discharges (in wet cells). More...
 
EXPORT_DLL void c_check_wetdry (int nTasks, t_arrays *arrays)
 This function checks the presence of wet/dry fronts and writes flags to correct them later. More...
 
EXPORT_DLL void c_update_wetdry_cells (int nTasks, t_arrays *arrays)
 This function corrects the wet/dry fronts found in function c_check_wetdry. More...
 
EXPORT_DLL void c_compute_mass_error (t_arrays *arrays)
 This function computes the mass error of the current state with respect to the previous one (in %). More...
 
EXPORT_DLL void c_reconstruct_active_elements (int nTasks, t_arrays *arrays)
 This function computes the mass error of the current state with respect to the previous one (in %). More...
 
EXPORT_DLL void c_add_active_cells (t_arrays *arrays, int id)
 This function adds the newly wetted cells to the active cells set. More...
 
EXPORT_DLL void c_add_active_walls (t_arrays *arrays, int id)
 This function adds wall identified by index id to the active walls set. More...
 

Function Documentation

◆ c_add_active_cells()

EXPORT_DLL void c_add_active_cells ( t_arrays arrays,
int  id 
)

This function adds the newly wetted cells to the active cells set.

Parameters
arraysThis pointer variable passes the arrays structure.
idThis integer variable passes the index of the wetted cell.

◆ c_add_active_walls()

EXPORT_DLL void c_add_active_walls ( t_arrays arrays,
int  id 
)

This function adds wall identified by index id to the active walls set.

Parameters
arraysThis pointer variable passes the arrays structure.
idThis integer variable passes the index of the wetted cell.

◆ c_check_wetdry()

EXPORT_DLL void c_check_wetdry ( int  nTasks,
t_arrays arrays 
)

This function checks the presence of wet/dry fronts and writes flags to correct them later.

Parameters
nTasksThis integer variable passes the number of times the computation needs to be done.
arraysThis pointer variable passes the arrays structure.

◆ c_checkpos_h()

EXPORT_DLL void c_checkpos_h ( int  nTasks,
t_arrays arrays,
int *  check 
)

This function checks the positivity of the water depth. If there is a cell where the depth is negative (-tol), it write a notification flag in variable check.

Parameters
nTasksThis integer variable passes the number of times the computation needs to be done.
arraysThis pointer variable passes the arrays structure.
checkThis integer acts as a flag to check the positivity of the water depth and is used in calculate.cpp to reduced the time step.

◆ c_compute_cell_mass()

EXPORT_DLL void c_compute_cell_mass ( int  nTasks,
t_arrays arrays 
)

This function recounts and stores the total mass of all active cells.

Parameters
nTasksThis integer variable passes the number of times the computation needs to be done.
arraysThis pointer variable passes the arrays structure.

◆ c_compute_mass_error()

EXPORT_DLL void c_compute_mass_error ( t_arrays arrays)

This function computes the mass error of the current state with respect to the previous one (in %).

Parameters
arraysThis pointer variable passes the arrays structure.

◆ c_get_dtmin()

EXPORT_DLL void c_get_dtmin ( int  nTasks,
t_arrays arrays 
)

This function finds the minimum time step out of the vector localDt. If the whole domain is dry, it is set to 1.0 seconds.

Parameters
nTasksThis integer variable passes the number of times the computation needs to be done.
arraysThis pointer variable passes the arrays structure. arrays->dt is modifed.

◆ c_initialize_delta()

EXPORT_DLL void c_initialize_delta ( int  nTasks,
t_arrays arrays 
)

This function initializes the variation of conserved variables in the arrays structure to 0.0 and the array solidWallByCell to 0.

Parameters
nTasksThis integer variable passes the number of times the computation needs to be done.
arraysThis pointer variable passes the arrays structure.

◆ c_reconstruct_active_elements()

EXPORT_DLL void c_reconstruct_active_elements ( int  nTasks,
t_arrays arrays 
)

This function computes the mass error of the current state with respect to the previous one (in %).

Parameters
arraysThis pointer variable passes the arrays structure.

◆ c_reduce_dt()

EXPORT_DLL void c_reduce_dt ( t_arrays arrays)

This function multiplies the time step by a factor of 0.8 if the there is a change to get negative water depths (as checked in function c_checkpos_h).

Parameters
arraysThis pointer variable passes the arrays structure.

◆ c_set_new_dt()

EXPORT_DLL void c_set_new_dt ( t_arrays arrays)

This function sets the new time step according to the dumping and final times. If the precomputed time step is too big, it is reduced to match the desired time.

Parameters
arraysThis pointer variable passes the arrays structure.

◆ c_update_cells()

EXPORT_DLL void c_update_cells ( int  nTasks,
t_arrays arrays 
)

This function updates the water depth and water discharges (in wet cells).

Parameters
nTasksThis integer variable passes the number of times the computation needs to be done.
arraysThis pointer variable passes the arrays structure.

◆ c_update_contributions()

EXPORT_DLL void c_update_contributions ( int  nTasks,
t_arrays arrays 
)

This function computes the right-hand side of the equations to update each physical variable.

Parameters
nTasksThis integer variable passes the number of times the computation needs to be done.
arraysThis pointer variable passes the arrays structure. arrays->dt is modifed.

◆ c_update_wetdry_cells()

EXPORT_DLL void c_update_wetdry_cells ( int  nTasks,
t_arrays arrays 
)

This function corrects the wet/dry fronts found in function c_check_wetdry.

Parameters
nTasksThis integer variable passes the number of times the computation needs to be done.
arraysThis pointer variable passes the arrays structure.

◆ c_wall_rotated_calculus()

EXPORT_DLL void c_wall_rotated_calculus ( int  nTasks,
t_arrays arrays 
)

This function computes the variation of conserved variables (dh, dhu, dhv) using the ARoe method at active walls. It includes source terms (bed slope and bed friction), positivity, entropy and wet/dry fixes. Additionally, it updates aux arrays and the list of active cells.

Parameters
nTasksThis integer variable passes the number of times the computation needs to be done.
arraysThis pointer variable passes the arrays structure.