AQUAgpusph 5.0.4
|
Variable time step computation. More...
#include "resources/Scripts/types/types.h"
Functions | |
__kernel void | entry (const __global int *imove, const __global vec *u, __global float *dt_var, const usize N, const float dt, const float dt_min, const float courant, const float dt_Ma, const float h) |
Compute the maximum time step for each particle. |
Variable time step computation.
__kernel void entry | ( | const __global int * | imove, |
const __global vec * | u, | ||
__global float * | dt_var, | ||
const usize | N, | ||
const float | dt, | ||
const float | dt_min, | ||
const float | courant, | ||
const float | dt_Ma, | ||
const 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 \( Ma_{\Delta t} 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 + \mathcal{O}({\Delta t}^2) \)
Such that rearraging the equation:
\( \Delta t = Ma \frac{h}{\vert \mathbf{u} \vert} \)
imove | Moving flags.
|
u | Velocity \( \mathbf{u}_{n+1/2} \). |
dt_var | Variable time step \( \mathrm{min} \left( C_f \frac{h}{c_s}, C_f \frac{h}{10 \vert \mathbf{u} \vert}\right)\). |
dt_Ma | The maximum Mach number, \( Ma_{\Delta t} \) |
dt | Fixed time step \( \Delta t = C_f \frac{h}{c_s} \). |
dt_min | Minimum time step \( \Delta t_{\mathrm{min}} \). |
courant | Courant factor \( C_{\Delta t} \). |
h | Kernel characteristic length \( h \). |
Ma | Mach number \( Ma \). |
N | Number of particles. |