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
4
double
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;
19
previous
=
dtmax
;
20
return
dtmax
;
21
}
u
#define u
Definition
advection.h:30
dtmax
double dtmax
The timestep is computed using the CFL condition on the face velocity field.
Definition
all-mach.h:105
timestep
trace double timestep(void)
Definition
atmosphere.h:37
x
int x
Definition
common.h:76
fm
const vector fm[]
Definition
common.h:396
assert
#define assert(a)
Definition
config.h:107
dt
double dt
Definition
predictor-corrector.h:18
t
double t
Definition
events.h:24
_i
def _i
Definition
stencils.h:405
vector
Definition
common.h:46
vector::x
scalar x
Definition
common.h:47
CFL
double CFL
Definition
utils.h:10
timestep.h
Generated by
1.9.8