Basilisk CFD
Adaptive Cartesian mesh PDE framework
Loading...
Searching...
No Matches
conservation.h File Reference
#include "tag.h"
Include dependency graph for conservation.h:

Go to the source code of this file.

Functions

void event_init (void)
 Event: init (i = 0)
 
void event_viscous_term (void)
 At each timestep...
 
void event_cleanup (void)
 We free memory at the end of the simulation to avoid memory leaks.
 

Variables

doublehmin
 
struct { 
 
   double *   sum 
 
Conservation = {0} 
 The domain considered needs to be simply-connected in order to avoid the transfer of mass between basins which are not connected.
 

Function Documentation

◆ event_cleanup()

void event_cleanup ( void  )

We free memory at the end of the simulation to avoid memory leaks.

Event: cleanup (t = end)

Definition at line 117 of file conservation.h.

References Conservation, and free().

Here is the call graph for this function:

◆ event_init()

void event_init ( void  )

Event: init (i = 0)

At initialisation we make sure that the domain is simply connected by retaining only the largest "oceanic" basin. We first define an indicator function which is zero on dry land and one in wet areas.

We remove cells which are only connected diagonally with their neighbors.

We only keep the largest basin.

We "dry out" all the other basins.

And finally we store the initial volume of each layer.

Definition at line 32 of file conservation.h.

References _i, _layer, Conservation, d, dry, foreach_layer, h, HUGE, nl, remove_droplets(), statsf(), stats::sum, x, and zb.

Here is the call graph for this function:

◆ event_viscous_term()

void event_viscous_term ( void  )

At each timestep...

Event: viscous_term (i++)

... we compute the current volume of each layer and the area of cells which are "thick enough".

The ratio of these two quantities gives the vertical displacement, which is then applied in each cell which is "thick enough".

Definition at line 85 of file conservation.h.

References _i, _layer, area(), assert, Conservation, dh, dv, foreach_layer, h, hmin, and x.

Here is the call graph for this function:

Variable Documentation

◆ [struct]

struct { ... } Conservation

The domain considered needs to be simply-connected in order to avoid the transfer of mass between basins which are not connected.

To enforce this we use the functions in [/src/tag.h](). This stores the initial volume of each layer.

Referenced by event_cleanup(), event_init(), and event_viscous_term().

◆ hmin

double* hmin
extern

Conservation of the volume of each layer

This module enforces conservation of the volume of each layer using a spatially-constant, but varying in time, "upwelling" velocity within each layer which compensates any volume loss. This can be interpreted as a vertical volume/mass transfer between layers.

This upwelling velocity is only applied when the thickness of a layer is larger than hmin/10. The value of hmin is typically that set in [entrainment.h]().

Referenced by event_viscous_term(), and geometric_beta().

◆ sum