# An AMR-Based Liquid Film Simulation with Surfactant Transport Using PLIC-HF Method
## 2 Governing Equations
### Conservative PLIC-VOF Method  
A conservative piecewise linear interface calculation volume-of-fluid (PLIC-VOF) method was included in the present research [35; 36] where a 'color function' \(c(\mathbf{x})\) is used to describe the fluid type. This is defined as  
\[c(\mathbf{x})= \begin{cases}1&\text{if $\mathbf{x}\in\text{ 'heavy' fluid}$}\\ 0&\text{if $\mathbf{x}\in\text{ 'light' fluid}$}\end{cases}  \tag{4}\]  
In the VOF method, a characteristic function \(\phi\) is obtained by integrating the color function into a computational volume \(\Omega\):  
\[\phi=\frac{\int_{\Omega}c(\mathbf{x})\mathrm{d}\mathbf{v}}{\int_{\Omega}1\mathrm{d} \mathbf{v}} \tag{5}\]  
This characteristic function \(\phi\) is a volume fraction and has physical constraints such as  
\[0\leqslant\phi\leqslant 1 \tag{6}\]  
which means that in the computational volume, the fluid cannot be less than empty or more than full. The PLIC method approximates interfaces on each cell as a line in two dimensional simulations, as shown in Figure 1a. The line can be described by the following equation:  
\[\mathbf{n}\cdot\mathbf{x}=\alpha \tag{7}\]  
where \(\alpha\) is a constant that ensures that the volume fraction cut by the interface is exactly the \(\phi\) defined by Equation (5) [37]. In Equation (7), the interface normal vector \(\mathbf{n}\) is computed with the second-order mixed Youngs-centered (MYC) method [38], and \(\mathbf{x}\) is local coordinate defined in one cell. As shown in Figure 1b, the volume flux across the cell face is calculated by the geometric relationship to advect the reconstructed interface. Figure 1: The interface reconstruction and flux calculation used in the Piecewise Linear Interface Calculation (PLIC) method.The region in blue is occupied by heavy fluid and the region in white is occupied by light fluid. The dotted line represents linearized interface in a cell. The black arrow in (**a**) indicates the normal vector of the interface and the black arrow in (**b**) indicates the direction of the velocity on that cell face. (**a**) Interface reconstruction. (**b**) Flux calculation. The transport equation is based on the physical nature phenomenon whereby on any material point, the fluid type does not change. It can be described by the material derivative of the color function:  
\[\frac{Dc}{Dt}=\frac{\partial c}{\partial t}+\mathbf{u}\cdot\
abla c=0 \tag{8}\]  
By integrating Equation (8) into a computational volume \(\Omega\) and using the divergence theorem, we get  
\[\frac{\partial}{\partial t}\int_{\Omega}c\;\mathrm{d}v+\oint_{\partial\Omega} cu_{n}\;\mathrm{d}s=\oint_{\Omega}c\
abla\cdot\mathbf{u}\;\mathrm{d}v \tag{9}\]  
By considering the definition of the volume fraction \(\phi\) in Equation (5), the transport equation can be written as  
\[\frac{\partial\phi}{\partial t}\Delta\Omega+F_{net}=\oint_{\Omega}c\
abla\cdot \mathbf{u}\;\mathrm{d}v \tag{10}\]  
where \(\Delta\Omega\equiv\int_{\Omega}1\mathrm{d}v\) is defined as the volume of the cell. In Equation (10), the value of the right-hand side should be zero because it is a divergence-free velocity field where \(\
abla\cdot\mathbf{u}\) is zero. However, a dimensional split method was used in the current research, which means that the flux calculation and time integration proceeded alternately in the X-direction and Y-direction. One-direction velocity is not divergence-free; thus, the right-hand side could not be simply ignored. To conserve the volume, a simplification was adopted:  
\[\oint_{\Omega}c\
abla\cdot\mathbf{u}\;\mathrm{d}v=c_{c}\frac{\partial u_{d}}{ \partial x_{d}}\Delta\Omega \tag{11}\]  
where \(d\) is the Cartesian index indicating the X-direction or Y-direction, and \(c_{c}\) is the value of the color function at the center of the cell and is defined explicitly as  
\[c_{c}= \begin{cases}1&\text{ if }\quad\phi>1/2\\ 0&\text{ else }\end{cases}