\[\newcommand{\half}{\frac{1}{2}} \newcommand{\nph}{{n + \half}} \newcommand{\nmh}{{n - \frac{1}{2}}} \newcommand{\iphj}{{i+\frac{1}{2},j,k}} \newcommand{\ijph}{{i,j+\frac{1}{2}},k} \newcommand{\imhj}{{i-\frac{1}{2},j,k}} \newcommand{\ijmh}{{i,j-\frac{1}{2}},k} \newcommand{\ijkmh}{{i,j,k-\frac{1}{2}}} \newcommand{\ijkph}{{i,j,k+\frac{1}{2}}} \newcommand{\grad}{\nabla} \newcommand{\del}{\nabla} \newcommand{\AN}{[(U \cdot \nabla)U]^{n+\frac{1}{2}}} \newcommand{\npk}{{n + \frac{p+\half}{R}}} \newcommand{\nak}{{n + \frac{p}{R}}} \newcommand{\nmk}{{n + \frac{p-\half}{R}}} \newcommand{\iph}{i+\half} \newcommand{\imh}{i-\half} \newcommand{\ipmh}{i\pm\half} \newcommand{\jph}{j+\half} \newcommand{\jmh}{j-\half} \newcommand{\jpmh}{j\pm\half} \newcommand{\kph}{k+\half} \newcommand{\kmh}{k-\half} \newcommand{\GMAC}{C \rightarrow E} \newcommand{\DMAC}{E \rightarrow C} \newcommand{\U}{\boldsymbol{U}} \newcommand{\F}{\boldsymbol{F}} \newcommand{\dt}{\Delta t} \newcommand{\shalf}{\sfrac{1}{2}} \newcommand\hathat[1]{\widehat{\widehat{#1}}} \newcommand\hairbow[1]{\overset{\bowtie}{#1}} \newcommand\widebreve[1]{\overset{\smile}{#1}} \newcommand{\vol}{\mathcal{V}} \newcommand{\area}{\mathcal{A}}\]

Volume of fluid with PLIC

The PLIC directory provides geometric volume-of-fluid transport with a piecewise-linear interface calculation, for any AMReX-based solver. The interface in a cell is the plane \(\mathbf{m} \cdot \mathbf{x} = \alpha\) in unit-cube cell coordinates, with the liquid on the side \(\mathbf{m} \cdot \mathbf{x} \le \alpha\), and the plane is fixed by the volume fraction \(F\) of the cell through the analytic relations of Scardovelli & Zaleski (JCP 164, 2000).

Like Godunov, MOL and BDS, the library provides spatial operators and leaves the update of \(F\), its ghost cells and the synchronization of the levels to the solver. It requires Cartesian coordinates and does not support embedded boundaries; PLIC::CheckMesh aborts on either. The reconstruction is selected by name, as advection_type is in HydroUtils::ComputeFluxesOnBoxFromState.

What the solver provides

\(F\) needs PLIC::nGrowF(reconstruction) filled ghost cells. At coarse/fine boundaries, fill them with amrex::cell_cons_interp, which keeps \(F\) in \([0,1]\).

Reconstructions

PLIC::FitPlanes fits the plane of each mixed cell, from the normal of the selected reconstruction and the volume fraction of the cell:

youngs

Youngs’ finite-difference normal.

myc

Mixed Youngs-Centered normal (Aulisa et al., JCP 225, 2007).

myc_height

The height-function normal along the dominant direction of the Mixed Youngs-Centered normal, which is exact for a planar interface, and the latter where the heights are not defined. The default.

The geometric kernels in hydro_plic_K.H and hydro_plic_normals_K.H derive from Kynema-SGF (formerly AMR-Wind), under its BSD 3-Clause License; the headers keep its copyright notice.

Adding a normal

A normal runs inside device kernels, so it is a template parameter rather than a virtual function. Write a struct in hydro_plic_normals_K.H, as described there, and give it a name in PLIC::dispatch_normal, which every operator of the library selects its normal with.

Verification

Tests/PLIC checks the plane geometry, the normals and the plane fit to round-off. A run fails when its checks do not hold. See its README for the expected results.