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
6The EHD force density, \f$\mathbf{f}_e\f$, can be computed as the
7divergence of the Maxwell stress tensor \f$\mathbf{M}\f$,
8\f[
9M_{ij} = \varepsilon (E_i E_j - \frac{E^2}{2}\delta_{ij})
10\f]
11where \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
14We need to add the corresponding acceleration to the
15[Navier--Stokes solver](/src/navier-stokes/centered.h).
16
17If the acceleration vector *a* (defined by the Navier--Stokes solver)
18is constant, we make it variable. */
19
20/** @brief Event: defaults (i = 0) */
21void event_defaults (void) {
22 if (is_constant (a.x))
23 a = {0} /* new vector */;
24}
25
26/**
27We overload the
28[acceleration event](/src/navier-stokes/centered.h#acceleration-term)
29of the Navier--Stokes solver to add the electrohydrodynamics acceleration
30term. */
31
32/** @brief Event: acceleration (i++) */
33void 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}
const vector alpha
Definition all-mach.h:47
const vector a
Definition all-mach.h:59
#define dimension
Definition bitree.h:3
int x
Definition common.h:76
const scalar cm[]
Definition common.h:397
static number sq(number x)
Definition common.h:11
const vector fm[]
Definition common.h:396
scalar f[]
The primary fields are:
Definition two-phase.h:56
#define assert(a)
Definition config.h:107
scalar phi[]
The electric potential and the volume charge density are scalars while the permittivity and conductiv...
Definition implicit.h:34
#define epsilon
Definition riemann.h:12
vector av[]
def _i
Definition stencils.h:405
void event_acceleration(void)
We overload the acceleration event of the Navier–Stokes solver to add the electrohydrodynamics accele...
Definition stress.h:33
void event_defaults(void)
Event: defaults (i = 0)
Definition stress.h:21
scalar x
Definition common.h:47
scalar y
Definition common.h:49