Basilisk CFD
Adaptive Cartesian mesh PDE framework
Loading...
Searching...
No Matches
isopycnal.h
Go to the documentation of this file.
1/** @file isopycnal.h
2 */
3/**
4# Boussinesq buoyancy for isopycnal layers
5
6This adds buoyancy to the [multilayer solver](hydro.h), assuming that
7each layer has a constant density variation.
8
9This is a special case of the more general [buoyancy module](dr.h)
10which should be consulted for more details.
11
12The density variations in each layer are defined by the user using the
13`drho` array whose dimension must match the numbers of layers. */
14
15extern double * drho;
16
17/** @brief Event: acceleration (i++) */
19{
20 scalar q = {0} /* new scalar */[nl];
21
22 for (int _i = 0; _i < _N; _i++) /* foreach */ {
23 double ph = 0.;
24 for (point.l = nl - 1; point.l >= 0; point.l--) {
25 double dp = G*drho[point.l]*h[];
26 ph += dp;
27 q[] = ph;
28 }
29 }
30
31 for (int _i = 0; _i < _N; _i++) /* foreach_face */
32 hpg (pg, q, 0,
33 ha.x[] += pg);
34
35 delete ({q});
36}
vector q[]
The primitive variables are the momentum , pressure , density , (face) specific volume ,...
Definition all-mach.h:44
double G
Definition atmosphere.h:12
scalar h[]
Definition atmosphere.h:6
int x
Definition common.h:76
Point point
Definition conserving.h:86
scalar dp[]
vector ha
Definition hydro.h:209
#define hpg(pg, phi, i, code)
Definition hydro.h:525
void event_acceleration(void)
Event: acceleration (i++)
Definition isopycnal.h:18
double * drho
int nl
Definition layers.h:9
def _i
Definition stencils.h:405
scalar x
Definition common.h:47