## 2 Materials and Methods
### Phase Field Model
#### 2.2.3 Cahn-Hilliard Equation  
The Cahn-Hilliard equation is a phase field equation commonly used to reflect the evolution of conservative field variables that reflect the change of composition [27]. It can be used to track the diffusion interface of oil-water two phases, considering the different effects of three scales: macroscopic fluid mechanics; supramolecular or intermolecular interactions; and mesoscopic interface morphology. The diffusion and deformation of the oil-water two-phase interface caused by macroscopic fluid dynamics and intermolecular forces can be well described [17]. The Cahn-Hilliard equation is:  
\[\left\{ \begin{array}{c}\frac{\partial\varphi}{\partial t}+\mathbf{u}\cdot\
abla \varphi=\
abla\cdot\frac{2\lambda}{\varepsilon^{2}}\
abla\psi\\ \psi=-\
abla\cdot\varepsilon^{2}\
abla\varphi+\left(\varphi^{2}-1\right) \varphi+\frac{\varepsilon^{2}}{\lambda}\frac{\partial f}{\partial\varphi} \end{array} \right. \tag{8}\] \begin{table}
\begin{tabular}{c c c} \hline \hline
**Parameter Notation** & **Parameter Definition** & **Unit** \\ \hline \(\mathbf{u}\) & Fluid velocity & m/s \\ \(\rho\) & The mixed fluid density in the two-phase & kg/m\({}^{3}\) \\  & transition Interface & \\ \(t\) & Time & s \\ \(\mathbf{p}\) & Pressure & Pa \\ \(\mathbf{I}\) & Unit matrix & dimensionless \\ \(\mu\) & Mixed fluid viscosity & Pa\(\cdot\)s \\ \(T\) & Temperature & K \\ \(\mathbf{F}\) & Surface tension & N \\ \(\mathbf{g}\) & Gravity acceleration & kg/s\({}^{2}\) \\ \(\varepsilon\) & Interface thickness control parameter & m \\ \(\lambda\) & Mixed energy density & N \\ \(\varphi\) & Phase field variables & dimensionless \\ \(\psi\) & Phase field covariates & dimensionless \\ \(\rho_{1}\) & Density of fluid 1 & kg/m\({}^{3}\) \\ \(\rho_{2}\) & Density of fluid 2 & kg/m\({}^{3}\) \\ \(\mu_{1}\) & The viscosity of fluid 1 & Pa\(\cdot\)s \\ \(\mu_{2}\) & The viscosity of fluid 2 & Pa\(\cdot\)s \\ \(V_{/2}\) & Volume fraction of fluid 2 & dimensionless \\ \(\gamma\) & Migration rate & m\({}^{3}\cdot\)s/kg \\ \(\sigma\) & Surface tension coefficient & N/m \\ \(a\) & Chemoattractant concentration & mol/m\({}^{3}\) \\ \(D_{e,a}\) & Chemical attractant effective diffusion coefficient & m\({}^{2}\)/s \\ \(v_{x}\) & Two-dimensional phase field model to solve the & m/s \\ \(v_{y}\) & Fluid transverse velocity & m/s \\ \(D_{a}\) & Diffusion coefficient of chemical attractant & m\({}^{2}\)/s \\ \(\epsilon_{p}\) & Porosity & dimensionless \\ \(b\) & Bacterial density & mol/m\({}^{3}\) \\  & Two-dimensional phase field model to solve the & m/s \\ \(v_{x}\) & fluid transverse velocity & m/s \\  & Two-dimensional phase field model to solve the & m/s \\ \(v_{y}\) & fluid longitudinal velocity & m/s \\ \(v_{Chx}\) & Horizontal chemotaxis rate of bacteria & m/s \\ \(v_{Chy}\) & The vertical chemotaxis rate of bacteria & m/s \\ \(D_{b}\) & Random motion coefficient of bacteria & m\({}^{2}\)/s \\ \(v_{b}\) & Bacterial swimming speed & m/s \\ \(K_{c}\) & Chemokine receptor constant & mol/m\({}^{3}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Nomenclature section to the paper. \(f\) is the external free energy and \(\partial\!/\partial\!/\partial\varphi\) is the derivative of the external free energy with respect to \(\varphi\). \(\partial\!/\partial\!/\partial\varphi\) takes \(0\) in general, and the formula is obtained:  
\[\left\{ \begin{array}{l}\frac{\partial\varphi}{\partial t}+\mathbf{u}\cdot\
abla \varphi=\
abla\cdot\frac{\gamma\lambda}{\xi}\
abla\psi\\ \psi=-\
abla\cdot\epsilon^{2}\
abla\varphi+\left(\varphi^{2}-1\right)\varphi \end{array} \right. \tag{9}\]  
\(\varphi\)--Phase field variables, dimensionless;  
\(t\)--Time, s;  
\(\mathbf{u}\)--Fluid velocity, m/s;  
\(\gamma\)--Migration rate, m\({}^{3}\cdot\)s/kg;  
\(\lambda\)--Mixed energy density, N;  
\(\psi\)--Phase field variables, dimensionless;  
\(\epsilon\)--Interface thickness control parameter, m.  
The mobility \(\gamma\) can be expressed as:  
\[\gamma=\gamma_{c}\epsilon^{2}, \tag{10}\]  
\(\gamma_{c}\)--Migration adjustment parameters, m\(\cdot\)s/kg.