File Friction.h
FileList > src > Friction.h
Go to the source code of this file
#include "General.h"
#include "Param.h"
#include "Arrays.h"
#include "Forcing.h"
#include "MemManagement.h"
Public Functions
Type | Name |
---|---|
__host__ void | TheresholdVelCPU (Param XParam, BlockP< T > XBlock, EvolvingP< T > XEvolv) CPU routine for enforcing a velocity threshold. |
__global__ void | TheresholdVelGPU (Param XParam, BlockP< T > XBlock, EvolvingP< T > XEvolv) CUDA kernel for enforcing a velocity threshold. Function Used to prevent crazy velocity on the GPU. The function wraps the main function for the GPU. Updates velocity components to ensure they do not exceed a specified threshold. |
__host__ __device__ bool | ThresholdVelocity (T Threshold, T & u, T & v) Function Used to prevent crazy velocity. |
__host__ void | XiafrictionCPU (Param XParam, BlockP< T > XBlock, T dt, T * cf, EvolvingP< T > XEvolv, EvolvingP< T > XEvolv_o) CPU routine for applying bottom friction following Xia & Lang (2018). |
__global__ void | XiafrictionGPU (Param XParam, BlockP< T > XBlock, T dt, T * cf, EvolvingP< T > XEvolv, EvolvingP< T > XEvolv_o) CUDA kernel for applying Xia & Lang (2018) bottom friction to all active blocks. |
__host__ void | bottomfrictionCPU (Param XParam, BlockP< T > XBlock, T dt, T * cf, EvolvingP< T > XEvolv) CPU routine for applying bottom friction to all active blocks. |
__global__ void | bottomfrictionGPU (Param XParam, BlockP< T > XBlock, T dt, T * cf, EvolvingP< T > XEvolv) CUDA kernel for applying bottom friction to all active blocks. |
__host__ __device__ T | manningfriction (T g, T hi, T n) Manning friction model. |
__host__ __device__ T | smartfriction (T hi, T zo) Smart friction model for roughness height. |
Public Functions Documentation
function TheresholdVelCPU
CPU routine for enforcing a velocity threshold.
template<class T>
__host__ void TheresholdVelCPU (
Param XParam,
BlockP < T > XBlock,
EvolvingP < T > XEvolv
)
Updates velocity components to ensure they do not exceed a specified threshold. Function Used to prevent crazy velocity on the CPU
Parameters:
XParam
Simulation parametersXBlock
Block data structureXEvolv
Evolving variables structure
function TheresholdVelGPU
CUDA kernel for enforcing a velocity threshold. Function Used to prevent crazy velocity on the GPU. The function wraps the main function for the GPU. Updates velocity components to ensure they do not exceed a specified threshold.
template<class T>
__global__ void TheresholdVelGPU (
Param XParam,
BlockP < T > XBlock,
EvolvingP < T > XEvolv
)
Parameters:
XParam
Simulation parametersXBlock
Block data structureXEvolv
Evolving variables structure
function ThresholdVelocity
Function Used to prevent crazy velocity.
The function scale velocities so it doesn't exceeds a given threshold. Default threshold is/should be 16.0m/s
Parameters:
Threshold
Velocity thresholdu
Velocity component in x directionv
Velocity component in y direction
Returns:
true if velocity was above threshold and has been scaled down, false otherwise
function XiafrictionCPU
CPU routine for applying bottom friction following Xia & Lang (2018).
template<class T>
__host__ void XiafrictionCPU (
Param XParam,
BlockP < T > XBlock,
T dt,
T * cf,
EvolvingP < T > XEvolv,
EvolvingP < T > XEvolv_o
)
Updates velocity components using the Xia & Lang friction model for each cell in all blocks, using both current and previous evolving variables. Reference: Xia and Lang (2018), https://doi.org/10.1016/j.advwatres.2018.05.004
Template parameters:
T
Data type (float or double)
Parameters:
XParam
Simulation parametersXBlock
Block data structuredt
Time stepcf
Friction coefficient arrayXEvolv
Current evolving variables structureXEvolv_o
Previous evolving variables structure
function XiafrictionGPU
CUDA kernel for applying Xia & Lang (2018) bottom friction to all active blocks.
template<class T>
__global__ void XiafrictionGPU (
Param XParam,
BlockP < T > XBlock,
T dt,
T * cf,
EvolvingP < T > XEvolv,
EvolvingP < T > XEvolv_o
)
Updates velocity components using the Xia & Lang friction model for each cell in all blocks, using both current and previous evolving variables.
Template parameters:
T
Data type (float or double)
Parameters:
XParam
Simulation parametersXBlock
Block data structuredt
Time stepcf
Friction coefficient arrayXEvolv
Current evolving variables structureXEvolv_o
Previous evolving variables structure
function bottomfrictionCPU
CPU routine for applying bottom friction to all active blocks.
template<class T>
__host__ void bottomfrictionCPU (
Param XParam,
BlockP < T > XBlock,
T dt,
T * cf,
EvolvingP < T > XEvolv
)
Updates velocity components using the specified friction model (default, smart, or Manning) for each cell in all blocks.
Template parameters:
T
Data type (float or double)
Parameters:
XParam
Simulation parametersXBlock
Block data structuredt
Time stepcf
Friction coefficient arrayXEvolv
Evolving variables structure
function bottomfrictionGPU
CUDA kernel for applying bottom friction to all active blocks.
template<class T>
__global__ void bottomfrictionGPU (
Param XParam,
BlockP < T > XBlock,
T dt,
T * cf,
EvolvingP < T > XEvolv
)
Updates velocity components using the specified friction model (default, smart, or Manning) for each cell in all blocks.
Template parameters:
T
Data type (float or double)
Parameters:
XParam
Simulation parametersXBlock
Block data structuredt
Time stepcf
Friction coefficient arrayXEvolv
Evolving variables structure
function manningfriction
Manning friction model.
Computes friction coefficient using Manning's equation based on gravity, water depth, and Manning's n.
Template parameters:
T
Data type (float or double)
Parameters:
g
Gravityhi
Water depthn
Manning's n
Returns:
Friction coefficient
function smartfriction
Smart friction model for roughness height.
Computes friction coefficient using a log-law based on water depth and roughness height.
Template parameters:
T
Data type (float or double)
Parameters:
hi
Water depthzo
Roughness height
Returns:
Friction coefficient
The documentation for this class was generated from the following file src/Friction.h