Basilisk CFD
Adaptive Cartesian mesh PDE framework
Loading...
Searching...
No Matches
check_eta.h
Go to the documentation of this file.
1
/** @file check_eta.h
2
*/
3
/**
4
# Consistency check on free-surface evolution
5
6
This is optional and only applies to the [time-implicit](implicit.h)
7
layered solver.
8
9
This checks that the free-surface position \f$\eta\f$ obtained from the
10
solution of the implicit time-integration matches the free-surface
11
position \f$\eta_p\f$ obtained by integration of the corresponding
12
(barotropic) fluxes i.e.
13
\f[
14
\partial_t\eta_p + \sum_l \nabla\cdot(\mathbf{hu})_l = 0
15
\f]
16
This should be true to within the tolerance of the implicit solver.
17
18
The difference is stored in the `deta` field. */
19
20
scalar
deta
[];
21
22
/** @brief Event: update_eta (i++) */
23
void
event_update_eta
(
void
)
24
{
25
for
(
int
_i
= 0;
_i
<
_N
;
_i
++)
/* foreach */
{
26
double
eta_p
=
zb
[];
27
foreach_layer
()
28
eta_p
+=
h
[];
29
deta
[] =
eta_p
-
eta
[];
30
if
(
fabs
(
deta
[]) > 1.1*
TOLERANCE
)
31
fprintf
(
stderr
,
"src/layered/check_eta.h:%d: warning: fabs(etap - eta[]) = %g > 1.1*TOLERANCE = %g "
32
"at %g,%g,%g\n"
,
33
LINENO
,
fabs
(
deta
[]), 1.1*
TOLERANCE
,
x
,
y
,
t
);
34
}
35
}
zb
scalar zb[]
Definition
atmosphere.h:6
h
scalar h[]
Definition
atmosphere.h:6
event_update_eta
void event_update_eta(void)
Event: update_eta (i++)
Definition
check_eta.h:23
deta
scalar deta[]
Definition
check_eta.h:20
y
int y
Definition
common.h:76
x
int x
Definition
common.h:76
LINENO
#define LINENO
Definition
config.h:105
t
double t
Definition
events.h:24
eta
scalar eta
Definition
hydro.h:50
foreach_layer
#define foreach_layer()
TOLERANCE
double TOLERANCE
Definition
poisson.h:107
_i
def _i
Definition
stencils.h:405
scalar
Definition
common.h:44
layered
check_eta.h
Generated by
1.9.8