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
6We 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]
12with \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
14potential is
15\f[
16\phi = [\rho]\mathbf{G}\cdot(\mathbf{x} - \mathbf{Z})
17\f]
18with \f$\mathbf{G}\f$ the gravity vector and \f$\mathbf{Z}\f$ an optional
19reference level. */
20
21coord G = {0.,0.,0.}, Z = {0.,0.,0.};
22
23/**
24We need the interfacial force module as well as some
25functions to compute the position of the interface. */
26
27#include "iforce.h"
28#include "curvature.h"
29
30/**
31We overload the acceleration() event to add the contribution of
32gravity to the interfacial potential \f$\phi\f$.
33
34If \f$\phi\f$ is already allocated, we add the contribution of gravity,
35otherwise we allocate a new field and set it to the contribution of
36gravity. */
37
38/** @brief Event: acceleration (i++) */
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}
#define dimension
Definition bitree.h:3
int x
Definition common.h:76
scalar f[]
The primary fields are:
Definition two-phase.h:56
scalar phi[]
The electric potential and the volume charge density are scalars while the permittivity and conductiv...
Definition implicit.h:34
double rho2
Definition momentum.h:15
double rho1
Definition momentum.h:15
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
coord Z
Definition reduced.h:21
coord G
Definition reduced.h:21
Definition common.h:78
double x
Definition common.h:79
int i
Definition common.h:44
Array * position