Basilisk CFD
Adaptive Cartesian mesh PDE framework
Loading...
Searching...
No Matches
stress.h
Go to the documentation of this file.
1
/** @file stress.h
2
*/
3
/**
4
# Electrohydrodynamic stresses
5
6
The EHD force density, \f$\mathbf{f}_e\f$, can be computed as the
7
divergence of the Maxwell stress tensor \f$\mathbf{M}\f$,
8
\f[
9
M_{ij} = \varepsilon (E_i E_j - \frac{E^2}{2}\delta_{ij})
10
\f]
11
where \f$E_i\f$ is the \f$i\f$-component of the electric field,
12
\f$\mathbf{E}=-\nabla \phi\f$ and \f$\delta_{ij}\f$ is the Kronecker delta.
13
14
We need to add the corresponding acceleration to the
15
[Navier--Stokes solver](/src/navier-stokes/centered.h).
16
17
If the acceleration vector *a* (defined by the Navier--Stokes solver)
18
is constant, we make it variable. */
19
20
/** @brief Event: defaults (i = 0) */
21
void
event_defaults
(
void
) {
22
if
(
is_constant
(
a
.
x
))
23
a
= {0}
/* new vector */
;
24
}
25
26
/**
27
We overload the
28
[acceleration event](/src/navier-stokes/centered.h#acceleration-term)
29
of the Navier--Stokes solver to add the electrohydrodynamics acceleration
30
term. */
31
32
/** @brief Event: acceleration (i++) */
33
void
event_acceleration
(
void
) {
34
assert
(
dimension
<= 2);
// not 3D yet
35
vector
f
[];
36
for
(
int
_d
= 0;
_d
<
dimension
;
_d
++) {
37
vector
Mx
[];
38
for
(
int
_i
= 0;
_i
<
_N
;
_i
++)
/* foreach_face */
39
Mx
.
x
[] =
epsilon
.x[]/2.*(
sq
(
phi
[] -
phi
[-1,0]) -
40
sq
(
phi
[0,1] -
phi
[0,-1] +
41
phi
[-1,1] -
phi
[-1,-1])/16.)/
sq
(
Delta
);
42
for
(
int
_i
= 0;
_i
<
_N
;
_i
++)
/* foreach_face */
43
Mx
.y[] =
epsilon
.y[]*(
phi
[] -
phi
[0,-1])*
44
(
phi
[1,0] -
phi
[-1,0] +
45
phi
[1,-1] -
phi
[-1,-1])/
sq
(2.*
Delta
);
46
47
/**
48
The electric force is the divergence of the Maxwell stress tensor
49
\f$\mathbf{M}\f$. */
50
51
for
(
int
_i
= 0;
_i
<
_N
;
_i
++)
/* foreach */
52
f
.x[] = (
Mx
.x[1,0] -
Mx
.x[] +
Mx
.y[0,1] -
Mx
.y[])/(
Delta
*
cm
[]);
53
}
54
55
/**
56
If [axisymmetric cylindrical coordinates](/src/axi.h) are used an
57
additional term must be added. */
58
59
#if AXI
60
for
(
int
_i
= 0;
_i
<
_N
;
_i
++)
/* foreach */
61
f
.y[] += (
sq
(
phi
[1,0] -
phi
[-1,0]) +
62
sq
(
phi
[0,1] -
phi
[0,-1]))/(8.*
cm
[]*
sq
(
Delta
))
63
*(
epsilon
.x[]/
fm
.
x
[] +
epsilon
.y[]/
fm
.
y
[] +
64
epsilon
.x[1,0]/
fm
.
x
[1,0] +
epsilon
.y[0,1]/
fm
.
y
[0,1])/4.;
65
#endif
66
67
/**
68
To get the acceleration from the force we need to multiply by the
69
specific volume \f$\alpha\f$. */
70
71
vector
av
=
a
;
72
for
(
int
_i
= 0;
_i
<
_N
;
_i
++)
/* foreach_face */
73
av
.
x
[] +=
alpha
.
x
[]/
fm
.
x
[]*(
f
.x[] +
f
.x[-1])/2.;
74
}
alpha
const vector alpha
Definition
all-mach.h:47
a
const vector a
Definition
all-mach.h:59
dimension
#define dimension
Definition
bitree.h:3
x
int x
Definition
common.h:76
cm
const scalar cm[]
Definition
common.h:397
sq
static number sq(number x)
Definition
common.h:11
fm
const vector fm[]
Definition
common.h:396
f
scalar f[]
The primary fields are:
Definition
two-phase.h:56
assert
#define assert(a)
Definition
config.h:107
phi
scalar phi[]
The electric potential and the volume charge density are scalars while the permittivity and conductiv...
Definition
implicit.h:34
epsilon
#define epsilon
Definition
riemann.h:12
av
vector av[]
Definition
saint-venant-implicit.h:36
_i
def _i
Definition
stencils.h:405
event_acceleration
void event_acceleration(void)
We overload the acceleration event of the Navier–Stokes solver to add the electrohydrodynamics accele...
Definition
stress.h:33
event_defaults
void event_defaults(void)
Event: defaults (i = 0)
Definition
stress.h:21
vector
Definition
common.h:46
vector::x
scalar x
Definition
common.h:47
vector::y
scalar y
Definition
common.h:49
ehd
stress.h
Generated by
1.9.8