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
6
This adds buoyancy to the [multilayer solver](hydro.h), assuming that
7
each layer has a constant density variation.
8
9
This is a special case of the more general [buoyancy module](dr.h)
10
which should be consulted for more details.
11
12
The density variations in each layer are defined by the user using the
13
`drho` array whose dimension must match the numbers of layers. */
14
15
extern
double
*
drho
;
16
17
/** @brief Event: acceleration (i++) */
18
void
event_acceleration
(
void
)
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
}
q
vector q[]
The primitive variables are the momentum , pressure , density , (face) specific volume ,...
Definition
all-mach.h:44
G
double G
Definition
atmosphere.h:12
h
scalar h[]
Definition
atmosphere.h:6
x
int x
Definition
common.h:76
point
Point point
Definition
conserving.h:86
dp
scalar dp[]
Definition
double-projection.h:104
ha
vector ha
Definition
hydro.h:209
hpg
#define hpg(pg, phi, i, code)
Definition
hydro.h:525
event_acceleration
void event_acceleration(void)
Event: acceleration (i++)
Definition
isopycnal.h:18
drho
double * drho
nl
int nl
Definition
layers.h:9
_i
def _i
Definition
stencils.h:405
scalar
Definition
common.h:44
vector::x
scalar x
Definition
common.h:47
layered
isopycnal.h
Generated by
1.9.8