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
6This is optional and only applies to the [time-implicit](implicit.h)
7layered solver.
8
9This checks that the free-surface position \f$\eta\f$ obtained from the
10solution of the implicit time-integration matches the free-surface
11position \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]
16This should be true to within the tolerance of the implicit solver.
17
18The difference is stored in the `deta` field. */
19
21
22/** @brief Event: update_eta (i++) */
23void event_update_eta (void)
24{
25 for (int _i = 0; _i < _N; _i++) /* foreach */ {
26 double eta_p = zb[];
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}
scalar zb[]
Definition atmosphere.h:6
scalar h[]
Definition atmosphere.h:6
void event_update_eta(void)
Event: update_eta (i++)
Definition check_eta.h:23
scalar deta[]
Definition check_eta.h:20
int y
Definition common.h:76
int x
Definition common.h:76
#define LINENO
Definition config.h:105
double t
Definition events.h:24
scalar eta
Definition hydro.h:50
#define foreach_layer()
double TOLERANCE
Definition poisson.h:107
def _i
Definition stencils.h:405