Basilisk CFD
Adaptive Cartesian mesh PDE framework
Loading...
Searching...
No Matches
timestep.h
Go to the documentation of this file.
1/** @file timestep.h
2 */
3// note: u is weighted by fm
4double timestep (const vector u, double dtmax)
5{
6 static double previous = 0.;
7 if (t == 0.) previous = 0.;
8 dtmax /= CFL;
9 for (int _i = 0; _i < _N; _i++) /* foreach_face */)
10 if (u.x[] != 0.) {
11 double dt = Delta/fabs(u.x[]);
12 assert (fm.x[]);
13 dt *= fm.x[];
14 if (dt < dtmax) dtmax = dt;
15 }
16 dtmax *= CFL;
17 if (dtmax > previous)
18 dtmax = (previous + 0.1*dtmax)/1.1;
20 return dtmax;
21}
#define u
Definition advection.h:30
double dtmax
The timestep is computed using the CFL condition on the face velocity field.
Definition all-mach.h:105
trace double timestep(void)
Definition atmosphere.h:37
int x
Definition common.h:76
const vector fm[]
Definition common.h:396
#define assert(a)
Definition config.h:107
double dt
double t
Definition events.h:24
def _i
Definition stencils.h:405
scalar x
Definition common.h:47
double CFL
Definition utils.h:10