AQUAgpusph 4.1.2
Loading...
Searching...
No Matches
Functions
TimeStep.cl File Reference

Variable time step computation. More...

#include "resources/Scripts/types/types.h"
Include dependency graph for TimeStep.cl:

Functions

__kernel void entry (__global float *dt_var, __global vec *u, __global vec *dudt, unsigned int N, float dt, float dt_min, float courant, float h)
 Compute the maximum time step for each particle.
 

Detailed Description

Variable time step computation.

Function Documentation

◆ entry()

__kernel void entry ( __global float *  dt_var,
__global vec u,
__global vec dudt,
unsigned int  N,
float  dt,
float  dt_min,
float  courant,
float  h 
)

Compute the maximum time step for each particle.

In SPH the time step is selected to enforce the particles may not move more than \( 0.1 h \), where the Courant factor is not taken into account yet.

Along this line, the distance moved by a particle can be written as follows:

\( \vert \mathbf{r}_{n+1} - \mathbf{r}_{n} \vert = \vert \mathbf{u} \vert \Delta t + \frac{1}{2} \left\vert \frac{\mathrm{d} \mathbf{u}}{\mathrm{d} t} \right\vert {\Delta t}^2 + \mathcal{O}({\Delta t}^3) \)

Such that, taking maximums, and rearraging the equation:

\( \Delta t = \frac{1}{20} \min \left( \frac{h}{\vert \mathbf{u} \vert}, \sqrt{\frac{2 h}{\left\vert \frac{\mathrm{d} \mathbf{u}}{\mathrm{d} t} \right\vert}} \right) \)

Parameters
dt_varVariable time step \( \mathrm{min} \left( C_f \frac{h}{c_s}, C_f \frac{h}{10 \vert \mathbf{u} \vert}\right)\).
uVelocity \( \mathbf{u}_{n+1/2} \).
dudtVelocity rate of change \( \frac{d \mathbf{u}}{d t} \).
NNumber of particles.
dtFixed time step \( \Delta t = C_f \frac{h}{c_s} \).
dt_minMinimum time step \( \Delta t_{\mathrm{min}} \).
courantCourant factor \( C_f \).
hKernel characteristic length \( h \).