Appendix
In the appendix, we provide details of the ghost fluid discretization on the interface. First of all, with the notations \(\mathbf{n}=(n_1,n_2)\) and \({\varvec{\tau }}=(-n_2,n_1)\), the traction boundary conditions (2.4) read
$$\begin{aligned} {\left\{ \begin{array}{ll} 2n_1^2u_x+2n_1n_2(u_y+v_x)+2n_2^2v_y-p=f_{\perp },\\ -2n_1n_2u_x+(n_1^2-n_2^2)(u_y+v_x)+2n_1n_2v_y=f_{\parallel }, \end{array}\right. } \end{aligned}$$
where \(f_{\perp }=\mathbf{f}\cdot \mathbf{n}\) and \(f_{\parallel }=\mathbf{f}\cdot {\varvec{\tau }}\). Some straightforward algebraic calculations together with the incompressibility condition (2.2) lead to
$$\begin{aligned}&2u_x-(n_1^2-n_2^2)p=(n_1^2-n_2^2)f_{\perp }-2n_1n_2f_{\parallel }, \end{aligned}$$
(6.1)
$$\begin{aligned}&2(n_2^2-n_1^2)v_y+2n_1n_2(u_y+v_x)-p=f_{\perp }. \end{aligned}$$
(6.2)
For any ghost velocity point \(\mathbf{x}\), we find a point \(\mathbf{x}^*\in \Gamma \), such that \(|\mathbf{x}-\mathbf{x}^*|=dist(\mathbf{x},\Gamma )\). We call \(\mathbf{x}^*\) a projection point of \(\mathbf{x}\) onto \(\Gamma \). We then discretize Eq. (6.1) at each projection point \(\mathbf{x}^*_{i-1/2,j}\) corresponding to each ghost velocity point \(\mathbf{x}_{i-1/2,j}\) of u. Similarly, we discretize Eq. (6.2) at each projection point \(\mathbf{x}^*_{i,j-1/2}\) corresponding to each ghost velocity point \(\mathbf{x}_{i,j-1/2}\) of v.
To obtain a second-order convergence scheme for u, v, and p up to \(\Gamma \), we design a third-order discretization of \(u_x\), \(u_y\), \(v_x\), \(v_y\), and p in the fluid region. This requires 10 stencil points for u, v, and 6 stencil points for p. We denote by \(S(u,\mathbf{x}^*,r)\), \(S(v,\mathbf{x}^*,r)\), and \(S(p,\mathbf{x}^*,r)\) respectively, the sets of u, v and p stencil points for discretizing \(\nabla u\), \(\nabla v\) and p with an order r at the projection point \(\mathbf{x}^*_{i,j-1/2}\). Then
$$\begin{aligned} |S(u,\mathbf{x}^*,r)|=\frac{(r+1)(r+2)}{2},\ |S(v,\mathbf{x}^*,r)|=\frac{(r+1)(r+2)}{2},\ \text { and } |S(p,\mathbf{x}^*,r)|=\frac{r(r+1)}{2}. \end{aligned}$$
In choosing these stencil points, we follow three criteria: (1) Each of these stencil points needs to be either a ghost point or a fluid point; (2) The stencil points need to include \(\mathbf{x}\), that is \(\mathbf{x}\!\in \! S(u,\mathbf{x}^*,r)\!\cup \! S(v,\mathbf{x}^*,r)\!\cup \! S(p,\mathbf{x}^*,r)\); (3) All \(S(u,\mathbf{x}^*,r)\), \(S(v,\mathbf{x}^*,r)\), and \(S(p,\mathbf{x}^*,r)\) satisfy
$$\begin{aligned} {\left\{ \begin{array}{ll} max\{i: \mathbf{x}_{i,j}\in S(u,\mathbf{x}^*,r)\}-min\{i: \mathbf{x}_{i,j}\in S(u,\mathbf{x}^*,r)\}=r,\\ max\{j: \mathbf{x}_{i,j}\in S(u,\mathbf{x}^*,r)\}-min\{j: \mathbf{x}_{i,j}\in S(u,\mathbf{x}^*,r)\}=r,\\ max\{i: \mathbf{x}_{i,j}\in S(v,\mathbf{x}^*,r)\}-min\{i: \mathbf{x}_{i,j}\in S(v,\mathbf{x}^*,r)\}=r,\\ max\{j: \mathbf{x}_{i,j}\in S(v,\mathbf{x}^*,r)\}-min\{j: \mathbf{x}_{i,j}\in S(v,\mathbf{x}^*,r)\}=r,\\ max\{i: \mathbf{x}_{i,j}\in S(p,\mathbf{x}^*,r)\}-min\{i: \mathbf{x}_{i,j}\in S(p,\mathbf{x}^*,r)\}=r-1,\\ max\{j: \mathbf{x}_{i,j}\in S(p,\mathbf{x}^*,r)\}-min\{j: \mathbf{x}_{i,j}\in S(p,\mathbf{x}^*,r)\}=r-1. \end{array}\right. } \end{aligned}$$
(6.3)
The criterion (3) is important for the invertibility of matrix A in Eq. (6.4), as shall be discussed later.
We now describe the process of constructing \(S(u,\mathbf{x}^*,r)\), \(S(v,\mathbf{x}^*,r)\), and \(S(p,\mathbf{x}^*,r)\), and the corresponding schemes. In this process, we use the following notations
$$\begin{aligned} (\lambda _1h_x, \lambda _2h_y)=\mathbf{x}^*-\mathbf{x},\quad (s_1, s_2)=(\mathrm{sign}(\lambda _1),\mathrm{sign}(\lambda _2)). \end{aligned}$$
It is easy to see that \(|\lambda _1|<1\) and \(|\lambda _2|<1\). Since a ghost point is a neighbor to a fluid point, at least one of its neighbor needs to be in \(\Omega _+\). We name a neighbor of \(\mathbf{x}\) a check point, if that neighbor point is in \(\Omega _+\). There are totally six different cases for the combination of ghost point and check point: (a) \(\mathbf{x}=\mathbf{x}_{i-1/2,j}\) and \(\phi (\mathbf{x}_{i-1/2+s_1,j})>0\); (b) \(\mathbf{x}=\mathbf{x}_{i-1/2,j}\) and \(\phi (\mathbf{x}_{i-1/2,j+s_2})>0\); (c) \(\mathbf{x}=\mathbf{x}_{i-1/2,j}\) and \(\phi (\mathbf{x}_{i-1/2+s_1/2,j+s_2/2})>0\); (d) \(\mathbf{x}=\mathbf{x}_{i,j-1/2}\) and \(\phi (\mathbf{x}_{i+s_1,j-1/2})>0\); (e) \(\mathbf{x}=\mathbf{x}_{i,j-1/2}\) and \(\phi (\mathbf{x}_{i,j-1/2+s_2})>0\); (f) \(\mathbf{x}=\mathbf{x}_{i,j-1/2}\) and \(\phi (\mathbf{x}_{i+s_1/2,j-1/2+s_2/2})>0\). For each of these cases, we obtain the corresponding \(S(u,\mathbf{x}^*,r)\), \(S(v,\mathbf{x}^*,r)\), and \(S(p,\mathbf{x}^*,r)\) with \(r\in \{1, 2, 3\}\). In Fig. 12, we schematically plot all six cases and the corresponding \(S(u,\mathbf{x}^*,r)\), \(S(v,\mathbf{x}^*,r)\), and \(S(p,\mathbf{x}^*,r)\) for \(r=3\). Notice that for cases (a)–(c), Eq. (6.1) is discretized, and \(S(v,\mathbf{x}^*,r)\) is not needed.
We now describe the steps of constructing a third-order discretization scheme for case (a), whereas all other cases just follow tediously. We consider a u ghost point \(\mathbf{x}_{i-1/2,j}\) with its projection point \(\mathbf{x}^*\). Let us denote
$$\begin{aligned} \mathbf{X}=\left( \mathbf{x}_0, \mathbf{x}_1, \mathbf{x}_2, \mathbf{x}_3, \mathbf{x}_4, \mathbf{x}_5, \mathbf{x}_6, \mathbf{x}_7, \mathbf{x}_8, \mathbf{x}_9\right) ^T=\left( \mathbf{x}_{i-\frac{1}{2},j}, \mathbf{x}_{i-\frac{1}{2}+s_1,j}, \mathbf{x}_{i-\frac{1}{2}-s_1,j+s_2}, \mathbf{x}_{i-\frac{1}{2},j+s_2}, \right. \\ \left. \mathbf{x}_{i-\frac{1}{2}+s_1,j+s_2}, \mathbf{x}_{i-\frac{1}{2}+2s_1,j+s_2}, \mathbf{x}_{i-\frac{1}{2},j+2s_2}, \mathbf{x}_{i-\frac{1}{2}+s_1,j+2s_2}, \mathbf{x}_{i-\frac{1}{2}+2s_1,j+2s_2}, \mathbf{x}_{i-\frac{1}{2},j+3s_2}\right) ^T, \end{aligned}$$
and \(\mathbf{F}=\left( u, u_x, u_y, u_{xx}, u_{xy}, u_{yy}, u_{xxx}, u_{xyy}, u_{xxy}, u_{yyy}\right) ^T\), where \((\cdot )^T\) denotes transpose. Then a third-order Taylor expansion leads to a linear system \(\mathbf{X}=A\mathbf{F}(\mathbf{x}^*)\), where
$$\begin{aligned} A= \left[ \begin{array}{cccccccccc}1 &{} h_{x,1} &{} h_{y,1} &{} h^2_{x,1}/2 &{} h_{x,1}h_{y,1} &{} h^{2}_{y,1}/2 &{} h^3_{x,1}/6 &{} h^2_{x,1}h_{y,1}/2 &{} h_{x,1}h^2_{y,1}/2 &{} h^3_{y,1}/6 \\ 1 &{} h_{x,2} &{} h_{y,2} &{} h^2_{x,2}/2 &{} h_{x,2}h_{y,2} &{} h^{2}_{y,2}/2 &{} h^3_{x,2}/6 &{} h^2_{x,2}h_{y,2}/2 &{} h_{x,2}h^2_{y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/2 &{} h_{x,9}h^2_{y,9}/2 &{} h^3_{y,9}/6 \\ \end{array}\right] , \end{aligned}$$
(6.4)
with \((h_{x,k}, h_{y,k}):=\mathbf{x}_k-\mathbf{x}^*\). A sufficient condition to have A invertible is (6.3). Inverting A symbolically, we get \(\mathbf{F}(\mathbf{x}^*)=A^{-1}\mathbf{X}\), and the second entry of \(\mathbf{F}(\mathbf{x}^*)\) corresponds to a third-order discretization of \(u_x(\mathbf{x}^*)\):
$$\begin{aligned}&u_x(\mathbf{x}^*)=-\frac{(\lambda _2-s_2)(\lambda _2-2s_2)}{2s_1h_x}u_0+\frac{(\lambda _2-s_2)(\lambda _2-2s_2)}{2s_1h_x}u_1-\frac{3\lambda _1^2-6\lambda _1s_1+2}{6s_1h_x}u_2\\&\quad -\frac{s_1(\lambda _1+\lambda _1\lambda _2 s_2)+3\lambda _2s_2/2-\lambda _2^2-3\lambda _1^2/2}{s_1h_x}u_3\\&\quad -\frac{s_1(\lambda _1-2\lambda _1\lambda _2 s_2)+\lambda _2^2- \lambda _2s_2-1+3\lambda _1^2/2}{s_1h_x}u_4\\&\quad +\frac{\lambda _2/2-2s_2/3+\lambda _1^2s_2/2-s_1\lambda _1\lambda _2+s_1\lambda _1s_2}{s_1s_2h_x}u_5-\frac{(\lambda _2-s_2)(\lambda _2s_1-2\lambda _1s_2+s_1s_2)}{2h_x}u_6\\&\quad +\frac{(\lambda _2-s_2)(\lambda _2s_1-4\lambda _1s_2+2s_1s_2)}{2h_x}u_7+\frac{(\lambda _2-s_2)(2\lambda _1-s_1)}{2s_2h_x}u_8, \end{aligned}$$
where the notation \(u(\mathbf{X})=\left( u_0, u_1, u_2, u_3, u_4, u_5, u_6, u_7, u_8, u_9 \right) ^T\) is used. The third entry of \(\mathbf{F}(\mathbf{x}^*)^t\) gives a third-order discretization of \(u_y(\mathbf{x}^*)\). However, it is not necessary in discretizing Eq. (6.1).
Similarly, one can derive a third-order discretization scheme for \(p(\mathbf{x}^*)\):
$$\begin{aligned}&p(\mathbf{x}^*)=\left( \frac{3}{8}-\lambda _1s_1+\frac{\lambda _1^2}{2}\right) p_0-\frac{(2\lambda _1-3s_1)(2\lambda _1s_2-2\lambda _2s_1+3s_1s_2)}{4s_2}p_1\\&\quad +\frac{((2\lambda _1s_2 - 2\lambda _2s_1 + s_1s_2)(2\lambda _1s_2 - 2\lambda _2s_1 + 3s_1s_2))}{8}p_2-\frac{(\lambda _2 - s_2)(2\lambda _1 - 3s_1)}{2s_1s_2}p_3\\&\quad +\frac{(\lambda _2 - s_2)(2\lambda _1s_2 - 2\lambda _2s_1 + 3s_1s_2)}{2*s_1}p_4+\frac{(\lambda _2 - s_2)(\lambda _2 - 2s_2)}{2}p_5, \end{aligned}$$
where \(p_0=p(\mathbf{x}_{i-\frac{s_1+1}{2},j+s_2})\), \(p_1=p(\mathbf{x}_{i+\frac{s_1-1}{2},j+s_2})\), \(p_2=p(\mathbf{x}_{i+\frac{3s_1-1}{2},j+s_2})\), \(p_3=p(\mathbf{x}_{i+\frac{s_1-1}{2},j+2s_2})\), \(p_4=p(\mathbf{x}_{i+\frac{3s_1-1}{2},j+2s_2})\), \(p_5=p(\mathbf{x}_{i+\frac{3s_1-1}{2},j+3s_2})\).
We use this symbolic inverse matrix method to find a third-order scheme for discretizing Eq. (6.1) around \(\mathbf{x}^*\). To find a second-order or first-order scheme, we form a smaller matrix A by applying a second or first-order Taylor expansion to \(u(\mathbf{x}_k)\), \(v(\mathbf{y}_k)\), and \(p(\mathbf{z}_k)\) at \(\mathbf{x}^*\), with \(\mathbf{x}_k\in S(u,\mathbf{x}^*,r)\), \(\mathbf{y}_k\in S(v,\mathbf{x}^*,r)\), and \(\mathbf{z}_k\in S(p,\mathbf{x}^*,r)\), respectively. Using similar computations, we are able to construct the first, second, and third-order schemes for all six cases (a)–(f), but we do not need to record the ten-page formulas here.