AQUAgpusph 5.0.4
Loading...
Searching...
No Matches
TimeStep.cl File Reference

Variable time step computation. More...

Include dependency graph for TimeStep.cl:

Functions

__kernel void entry (__global float *dt_var, const __global int *imove, const __global unsigned int *iset, const __global vec *u, const __global vec *dudt, const __global float *rho, const __global float *p, const __global float *m, const usize N, const float dt, const float dt_min, const float courant, const float h, const __global float *div_u, const __global vec *grad_p, __constant float *gamma)
 Compute the maximum time step for each particle.

Detailed Description

Variable time step computation.

Function Documentation

◆ entry()

__kernel void entry ( __global float * dt_var,
const __global int * imove,
const __global unsigned int * iset,
const __global vec * u,
const __global vec * dudt,
const __global float * rho,
const __global float * p,
const __global float * m,
const usize N,
const float dt,
const float dt_min,
const float courant,
const float h,
const __global float * div_u,
const __global vec * grad_p,
__constant float * gamma )

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 \).
Here is the call graph for this function: