Basilisk CFD
Adaptive Cartesian mesh PDE framework
Loading...
Searching...
No Matches
elevation.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

static void refine_elevation (Point point, scalar h)
 
static void restriction_elevation (Point point, scalar h)
 Cell restriction is simpler.
 
static void prolongation_elevation (Point point, scalar h)
 We also need to define a consistent prolongation function.
 
void conserve_elevation (void)
 Finally we define a function which will be called by the user to apply these reconstructions.
 

Variables

static double default_sea_level = 0.
 

Function Documentation

◆ conserve_elevation()

void conserve_elevation ( void  )

Finally we define a function which will be called by the user to apply these reconstructions.


Definition at line 129 of file elevation.h.

References h, prolongation_elevation(), refine_elevation(), restriction_elevation(), set_prolongation(), and set_restriction().

Here is the call graph for this function:

◆ prolongation_elevation()

static void prolongation_elevation ( Point  point,
scalar  h 
)
static

We also need to define a consistent prolongation function.

For cells which are entirely surrounded by wet cells, we can use the standard linear refinement function, otherwise we use straight injection from the parent cell.

Definition at line 106 of file elevation.h.

References dry, h, point, refine_linear(), x, and zb.

Referenced by conserve_elevation(), and conserve_layered_elevation().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ refine_elevation()

static void refine_elevation ( Point  point,
scalar  h 
)
static

The "dry" case is a bit more complicated. We look in a 3x3 neighborhood of the coarse parent cell and compute a depth-weighted average of the "wet" surface elevation \(\eta\). We need to do this because we cannot assume a priori that the surrounding wet cells are necessarily close to e.g. \(\eta = 0\).

If none of the surrounding cells is wet, we set a default sealevel.

We then reconstruct the water depth in each child using \(\eta\) (of the parent cell i.e. a first-order interpolation in contrast to the wet case above) and \(z_b\) of the child cells.

Definition at line 20 of file elevation.h.

References default_sea_level, dimension, dry, eta, g, gradient, h, max, v, vector::x, x, and zb.

Referenced by conserve_elevation().

Here is the caller graph for this function:

◆ restriction_elevation()

static void restriction_elevation ( Point  point,
scalar  h 
)
static

Cell restriction is simpler.

We first compute the depth-weighted average of \(\eta\) over all the children...

... and use this in combination with \(z_b\) (of the coarse cell) to compute the water depth \(h\).

Definition at line 81 of file elevation.h.

References dry, eta, h, max, v, x, and zb.

Referenced by conserve_elevation(), and conserve_layered_elevation().

Here is the caller graph for this function:

Variable Documentation

◆ default_sea_level

double default_sea_level = 0.
static

Conservation of water surface elevation

When using the default adaptive reconstruction of variables, the Saint-Venant solver or the layered solver will conserve the water depth when cells are refined or coarsened. However, this will not necessarily ensure that the "lake-at-rest" condition (i.e. a constant water surface elevation) is also preserved. In what follows, we redefine the prolongation() and restriction()* methods of the water depth \(h\) so that the water surface elevation \(\eta\) is conserved.

We start with the reconstruction of fine "wet" cells:

Definition at line 18 of file elevation.h.

Referenced by refine_elevation(), and refine_layered_elevation().