Basilisk CFD
Adaptive Cartesian mesh PDE framework
Loading...
Searching...
No Matches
tension.h
Go to the documentation of this file.
1
/** @file tension.h
2
*/
3
/**
4
# Surface tension effects for the compressible solver
5
6
This module incorporates surface tension effects in the compressible
7
solver. Unlike momentum, which is defined for the averaged mixture,
8
the energy is defined separately for both phases. For that reason, we
9
need to reconstruct the pressure of each phase from the averaged
10
pressure obtained from the Helmholtz--Poisson equation.
11
12
To reconstruct \f$p_1\f$ and \f$p_2\f$ from the averaged pressure \f$p\f$,
13
we interpret the averaged pressure as
14
\f[p = f p_1 + (1-f) p_2\f]
15
Using the Laplace equation
16
\f[p_2 - p_1 = -\sigma \kappa + [[\mu n \cdot \tau \cdot n]]\f]
17
we can solve the system of the two equations for \f$p_1\f$ and \f$p_2\f$
18
\f[ p_1 = p + (1 - f) \sigma \kappa - (1-f) [[\mu n \cdot \tau \cdot n]]\f]
19
\f[ p_2 = p - f \sigma \kappa + f [[\mu n \cdot \tau \cdot n]]\f]
20
The flux terms depending on pressure entering into the conservative total energy equation are
21
\f[\nabla \cdot (u p_1) = \nabla \cdot (u p) + \nabla \cdot (u (1-f) \sigma \kappa) -
22
\nabla \cdot (u (1-f) [[\mu n \cdot \tau \cdot n]])\f]
23
\f[\nabla \cdot (u p_2) = \nabla \cdot (u p) - \nabla \cdot (u f \sigma \kappa) +
24
\nabla \cdot (u f [[\mu n \cdot \tau \cdot n]])\f]
25
26
In this module we only introduce the correction due to surface tension. */
27
28
/** @brief Event: end_timestep (i++) */
29
void
event_end_timestep
(
void
)
30
{
31
if
(
f
.sigma > 0.) {
32
scalar
skappa
[];
33
curvature
(
f
,
skappa
,
f
.sigma);
34
35
/**
36
Here we just introduce the correction due to the surface tension
37
contribution to the pressure jump. */
38
39
vector
upf
[];
40
for
(
int
_fE
= 0;
_fE
< 1;
_fE
++)
/* scalar in {fE1, fE2} */
{
41
for
(
int
_i
= 0;
_i
<
_N
;
_i
++)
/* foreach_face */
{
42
double
fr
=
f
[1],
fl
=
f
[];
43
if
(!
fE
.inverse)
44
fr
= 1. -
fr
,
fl
= 1. -
fl
;
45
if
(
fr
+
fl
> 0. &&
fr
+
fl
< 2.) {
46
if
(
fr
>
fl
)
47
upf
.x[] =
uf
.
x
[]*
fl
*
skappa
[];
48
else
49
upf
.x[] =
uf
.
x
[]*
fr
*
skappa
[1];
50
}
51
else
52
upf
.x[] = 0.;
53
}
54
55
for
(
int
_i
= 0;
_i
<
_N
;
_i
++)
/* foreach */
{
56
double
div
= 0.;
57
for
(
int
_d
= 0;
_d
<
dimension
;
_d
++)
58
div
+=
upf
.x[1] -
upf
.x[];
59
fE
[] -= (
fE
.inverse ? 1. -
f
[] :
f
[])*
div
/
Delta
*
dt
/
cm
[];
60
}
61
}
62
}
63
}
uf
vector uf[]
We allocate the (face) velocity field.
Definition
advection.h:29
dimension
#define dimension
Definition
bitree.h:3
x
int x
Definition
common.h:76
cm
const scalar cm[]
Definition
common.h:397
event_end_timestep
void event_end_timestep(void)
Event: end_timestep (i++)
Definition
tension.h:29
f
scalar f[]
The primary fields are:
Definition
two-phase.h:56
curvature
trace cstats curvature(scalar c, scalar kappa, double sigma=1.[0], bool add=false)
Definition
curvature.h:543
dt
double dt
Definition
predictor-corrector.h:18
_i
def _i
Definition
stencils.h:405
scalar
Definition
common.h:44
vector
Definition
common.h:46
vector::x
scalar x
Definition
common.h:47
compressible
tension.h
Generated by
1.9.8