Gradients and Laplacian
Sometimes it is necessary to compute gradients or Laplacian of one function e.g. \(\phi(\boldsymbol{x},t)\). For example, the conservative Allen-Cahn equation involves the unit normal vector \(\boldsymbol{n}=\boldsymbol{\nabla}\phi/|\boldsymbol{\nabla}\phi|\) whereas the Cahn-Hilliard equation involves the Laplacian of \(\phi\). That Laplacian \(\boldsymbol{\nabla}^2\phi\) also appears explicitely in the chemical potential \(\mu_{\phi}\) of capillary force \(\boldsymbol{F}_c=\mu_{\phi}\boldsymbol{\nabla}\phi\) in the impulsion balance equation.
Important
In LBM_Saclay, those gradients and Laplacian are computed in the source file src/kernels/LBMSchemeBase.h
Bulk: directional derivatives
When the node \(\boldsymbol{x}\) is inside the computational domain, not close to the boundary, the gradients and Laplacian are computed by directional derivatives method which is a finite difference method applied for every direction \(\boldsymbol{e}_i\) of lattice.
Gradients
For gradient, the directional derivative \(\boldsymbol{e}_{i}\cdot\boldsymbol{\nabla}\phi\bigr|_{\boldsymbol{x}}\) for each direction \(\boldsymbol{e}_i\) writes:
where \(\delta x\) is the discretization step in space and \(e^2\) is a lattice-dependent coefficient. Except for D2Q5, its value is \(e^2=1/3\) meaning that \(1/e^2=3\). In Eq. (242), let us notice that for one particular direction (e.g. \(x\)-direction i.e. \(i=1\)), the directional derivative corresponds to the second order central finite difference method. The gradient is obtained by a weighted sum of all those directional derivatives:
Laplacian
For Laplacian, the method is identical. First we compute the components for all directions
Once again, for one particular direction (e.g. \(x\)-direction i.e. \(i=1\)), the directional derivative corresponds to the second order central finite difference method. The Laplcian is obtained by the weighted sum:
Boundaries
When the node \(\boldsymbol{x}\) is close to one of boundaries, in that case, the classic
Section author: Alain Cartalade