Basilisk CFD
Adaptive Cartesian mesh PDE framework
Loading...
Searching...
No Matches
reduced.h
Go to the documentation of this file.
1
/** @file reduced.h
2
*/
3
/**
4
# Reduced gravity
5
6
We re-express gravity in [two-phase flows](two-phase.h) as an
7
[interfacial force](iforce.h) as
8
\f[
9
-\nabla p + \rho\mathbf{g} =
10
-\nabla p' - [\rho]\mathbf{g}\cdot\mathbf{x}\mathbf{n}\delta_s
11
\f]
12
with \f$p'= p - \rho\mathbf{g}\cdot\mathbf{x}\f$ the dynamic pressure and
13
\f$\rho\mathbf{g}\cdot\mathbf{x}\f$ the hydrostatic pressure. The corresponding
14
potential is
15
\f[
16
\phi = [\rho]\mathbf{G}\cdot(\mathbf{x} - \mathbf{Z})
17
\f]
18
with \f$\mathbf{G}\f$ the gravity vector and \f$\mathbf{Z}\f$ an optional
19
reference level. */
20
21
coord
G
= {0.,0.,0.},
Z
= {0.,0.,0.};
22
23
/**
24
We need the interfacial force module as well as some
25
functions to compute the position of the interface. */
26
27
#include "
iforce.h
"
28
#include "
curvature.h
"
29
30
/**
31
We overload the acceleration() event to add the contribution of
32
gravity to the interfacial potential \f$\phi\f$.
33
34
If \f$\phi\f$ is already allocated, we add the contribution of gravity,
35
otherwise we allocate a new field and set it to the contribution of
36
gravity. */
37
38
/** @brief Event: acceleration (i++) */
39
void
event_acceleration
(
void
)
40
{
41
scalar
phi
=
f
.phi;
42
coord
G1
;
43
for
(
int
_d
= 0;
_d
<
dimension
;
_d
++)
44
G1
.
x
= (
rho2
-
rho1
)*
G
.
x
;
45
46
if
(
phi
.
i
)
47
position
(
f
,
phi
,
G1
,
Z
,
add
=
true
);
48
else
{
49
phi
= {0}
/* new scalar */
;
50
position
(
f
,
phi
,
G1
,
Z
,
add
=
false
);
51
f
.phi =
phi
;
52
}
53
}
dimension
#define dimension
Definition
bitree.h:3
x
int x
Definition
common.h:76
f
scalar f[]
The primary fields are:
Definition
two-phase.h:56
curvature.h
phi
scalar phi[]
The electric potential and the volume charge density are scalars while the permittivity and conductiv...
Definition
implicit.h:34
iforce.h
rho2
double rho2
Definition
momentum.h:15
rho1
double rho1
Definition
momentum.h:15
event_acceleration
void event_acceleration(void)
We need the interfacial force module as well as some functions to compute the position of the interfa...
Definition
reduced.h:39
Z
coord Z
Definition
reduced.h:21
G
coord G
Definition
reduced.h:21
coord
Definition
common.h:78
coord::x
double x
Definition
common.h:79
scalar
Definition
common.h:44
scalar::i
int i
Definition
common.h:44
position
Array * position
Definition
vertexbuffer.h:18
reduced.h
Generated by
1.9.8