1 Introduction

The Cahn–Hilliard (CH) equation represents the dynamics of spinodal decomposition that occurs when a single thermodynamic phase spontaneously separates into two phases (Cahn and Hilliard 1958; Grant 1993):

$$\begin{aligned} \frac{\partial \phi (\mathbf{x},t)}{\partial t} = \Delta \left[ F'(\phi (\mathbf{x},t))-\epsilon ^2 \Delta \phi (\mathbf{x},t) \right] , \end{aligned}$$
(1)

where \(\phi (\mathbf{x},t)\) is a phase field at space \(\mathbf{x} \in \Omega \) and time t, \(\epsilon \) is a positive constant, and \(F(\phi )=(\phi ^2-1)^2/4\). The boundary condition is the homogeneous Neumann boundary condition: \(\mathbf{n} \cdot \nabla \phi (\mathbf{x},t) = 0\) and \(\mathbf{n} \cdot \nabla \Delta \phi (\mathbf{x},t)=0\) for \(\mathbf{x} \in \partial \Omega \), where \(\mathbf{n}\) is the outer unit normal vector. Because the CH equation can efficiently handle topological changes, it has been widely studied and applied in various applications. However, because the CH equation is a fourth-order nonlinear partial differential equation (PDE), the explicit time discretization requires a very small time step for stability. In order to overcome the strict time step constraints, various semi-implicit (Zhu et al. 1999; Li and Qiao 2017; Li et al. 2016, 2021) and implicit (Beneŝová et al. 2014; Bosch et al. 2014; Xu et al. 2019) schemes have been proposed to solve the CH equation with good numerical stability. Splitting-type numerical schemes have been used for variable studies (Chen et al. 2012; Li et al. 2018; Cheng et al. 2019; Chen et al. 2020; Meng et al. 2020; Hao 2021) with energy stability. Several different methods have been utilized to numerically solve the CH equation. Zhai et al. (2021) proposed a novel high-order linearly operator splitting method for the nonlocal viscous CH equation with the spectral deferred correction method. Their method can avoid the nonlinear iteration and obtain high temporal accuracy. Feng et al. (2020) considered the CH equation with an imposed advection term. They studied the effects of the imposed advection on phase separation of the CH equation. Ainsworth and Mao (2017) investigated the fractional CH equation with fractional free energy. They presented well-posedness and several numerical examples of the fractional CH equation. Li et al. (2016a) used the phase-field model to the minimized CH dynamics. Mohammadi and Dehghan (2019) presented an adaptive time algorithm for the CH equation. Fu and Han (2021) used a finite element method (FEM) to overcome the challenges of solving the CH equation with a degenerate mobility function. Theljani et al. (2020) proposed the image inpainting method which solves the CH equation on an adaptive mesh.Figure 1 shows an adaptive mesh (Theljani et al. 2020).

Fig. 1
figure 1

a Uniform mesh and b adaptive mesh. Reprinted from (Theljani et al. 2020) with permission from SAGE Publishing

Chen et al. (2016) solved the CH-type diffusion equation and the Navier–Stokes equation using a space-time adaptive finite difference method. Isotopic and strongly anisotropic CH systems were solved using the multigrid method on an adaptive grid (Chen et al. 2018). Figure 2a and b shows the adaptive meshes (Chen et al. 2016, 2018) for two- and three-dimensional spaces, respectively.

Fig. 2
figure 2

a and b are 2D and 3D adaptive meshes, reprinted from (Chen et al. 2016) and (Chen et al. 2018) with permission from Elsevier, respectively

Compared to the unstructured methods, the adaptive mesh refinement (AMR) framework can provide spatial multi-resolution (Berger and Oliger 1984), which imposes a good choice for the large-scale simulation with challenging physical issues (Li et al. 2016b; Zhou and Xie 2021). There are many applications for the AMR algorithm, i.e., crystal growth (Li and Kim 2012, 2017), thin film (Li et al. 2014; Sun et al. 2007), nonlinear wave (Dohnal and Uecker 2016), and computational fluid dynamics (Berger and Colella 1989). Koliesnikova et al. (2021) proposed a hierarchical mesh refinement scheme driven by a posteriori error estimator. Li et al. (2021) proposed an implicitly discretized surface method with an AMR method. To overcome the difficulties of imposing the boundary conditions by considering the skin depth, Jung and Yoo (2021) used an AMR framework for microwave applications of metallic structures. Grave and Coutinho (2021) used a PDE model to investigate the dynamics of COVID-19 using an AMR method. Their model can represent various spatial scales.

Kay and Welford (2006) presented a multigrid FEM for the CH equation. Banas and Nürnberg (2008) presented an AMR method for the CH equation. Ceniceros and Rom (2007) presented a nonstiff, fully AMR method for the CH equation. Wise et al. (2007) presented a second-order accurate and adaptive FDM to solve the CH equation in 2D and 3D spaces. Stogner et al. (2008) proposed a variational formulation and \(C^1\) FEM with an AMR method. The fourth-order spatial accurate compact schemes were developed for the CH equation in 2D (Lee et al. 2014) and 3D (Li et al. 2016c) spaces. The above-mentioned methods are based on a semi-implicit splitting or implicit scheme, in which a multigrid method or other numerical solvers should be performed on coarse and fine grid levels. Therefore, the explicit AMR-based method is much simpler to implement.

The main purpose of this study is to present an explicit adaptive FDM for the CH equation. The primary advantage of the proposed method is its simplicity compared to existing adaptive numerical schemes for the CH equation which use complex data structure and implicit solvers.

The outline of this article is as follows. In Sect. 2, the proposed numerical method is described. In Sect. 3, we present several computational experiments to confirm the superior performance of the proposed explicit AMR method. We conclude this paper in Sect. 4.

2 Numerical Method

We describe the proposed numerical solution algorithms on the adaptive domain for the 2D and 3D CH equations using the Saul’yev scheme (Yang et al. 2022) and adaptive methodology (Jeong et al. 2021).

2.1 Two-Dimensional Algorithm

For the completeness of exposition, we briefly describe the explicit finite difference scheme for the CH equation in the 2D domain \(\Omega = (L_x, R_x) \times (L_y, R_y)\). For more details, see (Yang et al. 2022). Let \(\Omega _h = \{ (x_i=L_x+h(i-0.5),~y_j=L_y+h(j-0.5))\vert i=1,\ldots , N_x,~ j=1, \ldots , N_y \}\), where the spatial space step is \(h=(R_x-L_x)/N_x=(R_y-L_y)/N_y\). Here, \(N_x\) and \(N_y\) are the numbers of the grid points. Let \(\phi _{ij}^n=\phi (x_i,y_j,n \Delta t)\), where \(\Delta t\) is the time step for a nonnegative integer n. First, we discretize Eq. (1) using the linear convex splitting scheme (Li et al. 2017):

$$\begin{aligned} \frac{\phi _{ij}^{n+1}-\phi _{ij}^n}{\Delta t} = \Delta _d ((\phi _{ij}^n)^3 -3\phi _{ij}^n)+2\Delta _d \phi _{ij}^{n+1}-\epsilon ^2 \Delta _d^2 \phi _{ij}^{n+1}, \end{aligned}$$
(2)

where \(\Delta _d \phi _{ij} =(\phi _{i+1,j}+\phi _{i-1,j}-4\phi _{ij} +\phi _{i,j+1} +\phi _{i,j-1})/h^2\) and \(\Delta _d^2 \phi _{ij}=\Delta _d ( \Delta _d \phi _{ij})\). We define a temporary narrow domain as

$$\begin{aligned} \Omega _\text {tmp}^n = \{(x_i,y_j)\vert ~\vert \nabla \phi _{ij}^n\vert > \xi ,~1 \le i \le N_x,~1 \le j \le N_y\}, \end{aligned}$$
(3)

where \(\xi \) is a parameter and

$$\begin{aligned} \nabla \phi _{ij}^n = \left( \frac{\phi _{i+1,j}^n - \phi _{i-1,j}^n}{2h}, \frac{\phi _{i,j+1}^n - \phi _{i,j-1}^n}{2h}\right) . \end{aligned}$$

A space-time adaptive narrow-band domain \(\Omega _\text {nb}^n\) is defined using \(\Omega _\text {tmp}^n\):

$$\begin{aligned} \Omega _\text {nb}^n = \bigcup _{p=-m}^{p=m} \bigcup _{q=-m}^{q=m} \{(x_{i+p},y_{j+q})\vert (x_i,y_j)\in \Omega _\text {tmp}^n\} \end{aligned}$$
(4)

for some positive integer m, which makes buffer points. We can control the narrow-band domain by adjusting \(\xi \) and m values appropriately. We define doubly layered exterior boundary points of \(\Omega _\text {nb}^n\) as

$$\begin{aligned} \Omega _\text {bd}^n = \bigcup _{p=-2}^{p=2} \bigcup _{q=-2}^{q=2} \{(x_{i+p},y_{j+q})\vert (x_i,y_j)\in \Omega _\text {nb}^n\} \setminus \Omega _\text {nb}^n. \end{aligned}$$

For better understanding of the narrow-band domain construction, let us consider the following circular shape at time \(t=n \Delta t\):

$$\begin{aligned} \phi (x,y,t) = \tanh \left( \frac{30-\sqrt{x^2+y^2}}{\sqrt{2}\epsilon }\right) , \end{aligned}$$
(5)

which is shown in Fig. 3a and the red line is the contour of \(\phi \) at zero level. Figure 3b, c, and d shows \(\vert \nabla \phi ^n\vert \) with \(z = \xi \)-plane, temporary domain \(\Omega _\text {tmp}^n\), and space-time adaptive narrow-band domain \(\Omega _\text {nb}^n\) (closed circle) with the exterior boundary points \(\Omega _\text {bd}^n\) (open circle), respectively. We use the values defined at \(\Omega _\text {bd}^n\) for the exterior boundary values when we solve Eq. (6) on the interior boundary points. Then, using the Saul’yev method (Yang et al. 2022), we have the following updating scheme: For \( j=1,2,\dots ,N_y,~\text {for~} i=1,2,\dots ,N_x\). If \((x_{i},y_{j}) \in \Omega _\text {nb}\), then

$$\begin{aligned} \phi _{ij}^{n+1}&= \frac{1}{r} \Big [ \frac{\phi _{ij}^n}{\Delta t} + \Delta _d ((\phi _{ij}^n)^3 -3\phi _{ij}^n)+\frac{2}{h^2}\big ( \phi _{i+1,j}^{n}+\phi _{i-1,j}^{n+1}-2\phi _{ij}^n \nonumber \\&\quad +\; \phi _{i,j+1}^{n} +\phi _{i,j-1}^{n+1}\big )- \frac{\epsilon ^2}{h^4} \big \{\phi _{i+2,j}^{n}+\phi _{i-2,j}^{n+1}+\phi _{i,j+2}^{n}+\phi _{i,j-2}^{n+1} \nonumber \\&\quad +\; 2(\phi _{i+1,j+1}^{n}+\phi _{i+1,j-1}^{n} +\phi _{i-1,j+1}^{n}+\phi _{i-1,j-1}^{n+1}) \nonumber \\&\quad - \;8(\phi _{i+1,j}^{n}+\phi _{i-1,j}^{n+1}+\phi _{i,j+1}^{n}+\phi _{i,j-1}^{n+1}) +10\phi _{ij}^n \big \} \Big ], \end{aligned}$$
(6)

where \(r=1/ \Delta t +4/h^2 +10\epsilon ^2/h^4\). The other 7 ‘for loop’ cases are similarly defined. Next, we adopt the adaptive methodology, which was developed for the Allen–Cahn equation, see (Jeong et al. 2021).

Fig. 3
figure 3

Schematic illustration for \(\Omega _\text {tmp}^n\), \(\Omega _\text {nb}^n\) and \(\Omega _\text {bd}^n\): a mesh plot of \(\phi \) with the zero level contour (red line), b \(\vert \nabla \phi ^n\vert \) and \(z = \xi \)-plane, c temporary domain \(\Omega _\text {tmp}^n\), and d space-time adaptive narrow-band domain \(\Omega _\text {nb}^n\) (closed circle) with the exterior boundary points \(\Omega _\text {bd}^n\) (open circle) (Color figure online)

Because the Saul’yev-type scheme is generally not conservative, we adopt a mass correction step (Jeong et al. 2020):

$$\begin{aligned} \phi ^{n+1}_{ij} = \phi ^{n+1}_{ij} + \frac{\sum _{(x_p, y_q) \in \Omega _\text {nb}^n} (\phi ^n_{pq}-\phi ^{n+1}_{pq})}{\sum _{(x_p, y_q) \in \Omega _\text {nb}^n} \sqrt{F(\phi ^{n+1}_{pq})} } \sqrt{F(\phi ^{n+1}_{ij})}~~ \text {for}~ (x_i, y_j) \in \Omega _\text {nb}^n. \end{aligned}$$
(7)

We should note that the mass correction is only done on the narrow-band domain because the values of \(\phi \) outside the narrow-band domain are unchanged.

Remark 1

Solving problems using the FDM in adaptive meshes is very complex and difficult; nevertheless, there are studies that have presented new numerical ideas and convincing numerical results on this interesting scientific problem (Feng et al. 2018; Wise et al. 2011). However, because most adaptive methods have very complex relational expressions, numerical methods have been verified through numerical experiments rather than analytically verified.

2.2 Three-Dimensional Algorithm

The 3D numerical solution algorithm and adaptive grid generation are straightforward extension of the 2D ones. Let \(\Omega = (L_x, R_x) \times (L_y, R_y) \times (L_z, R_z)\). Let \(\Omega _h = \{(x_i=L_x+ h(i-0.5),~y_j=L_y+h(j-0.5),~z_k=L_z+h(k-0.5))\vert i=1, \dots ,N_x,~j=1,\dots ,N_y,~k=1,\dots ,N_z \}\) be the discrete domain, where \(h = (R_x-L_x)/N_x = (R_y-L_y)/N_y = (R_z-L_z)/N_z\). Here, \(N_x\), \(N_y\) and \(N_z\) are the numbers of the grid points. Let \(\phi _{ijk}^n =\phi (x_i,y_j, z_k,n\Delta t)\). We start with the following method (Li et al. 2017):

$$\begin{aligned} \frac{\phi _{ijk}^{n+1}-\phi _{ijk}^n}{\Delta t} = \Delta _d ((\phi _{ijk}^n)^3 -3\phi _{ijk}^n )+2\Delta _d \phi _{ijk}^{n+1}-\epsilon ^2 \Delta _d^2 \phi _{ijk}^{n+1}, \end{aligned}$$
(8)

where \(\Delta _d \phi _{ijk} = \big ( \phi _{i+1,jk}+\phi _{i-1,jk}+\phi _{i,j+1,k}+\phi _{i,j-1,k}+\phi _{ij,k+1}+\phi _{ij,k-1}-6\phi _{ijk} \big ) / h^2\) and \(\Delta _d^2 \phi _{ijk}=\Delta _d ( \Delta _d \phi _{ijk}) \). Then, using the Saul’yev method (Yang et al. 2022), we have the following updating scheme:

$$\begin{aligned}&\text {For } i=1,2, \ldots , N_x, ~ \text {for } j=1,2, \ldots , N_y, ~ \text {for } k=1,2, \dots , N_z, \end{aligned}$$
(9)
$$\begin{aligned}&\text {If }(x_{i},y_{j},z_{k}) \in \Omega _{nb},~ \text {then}\nonumber \\&\quad \phi _{ijk}^{n+1} = \frac{1}{r} \Big [ \frac{\phi _{ijk}^{n}}{\Delta t} + \Delta _d ((\phi _{ijk}^n)^3 -3\phi _{ijk}^n)+\frac{2}{h^2}\big ( \phi _{i+1,jk}^{n}+\phi _{i-1,jk}^{n+1}+\phi _{i,j+1,k}^{n} \nonumber \\&\qquad \qquad \quad +\phi _{i,j-1,k}^{n+1}+\phi _{ij,k+1}^{n} + \phi _{ij,k-1}^{n+1} -3\phi _{ijk}^n\big )-\frac{\epsilon ^2}{h^4} \big \{ \phi _{i+2,jk}^{n} +\phi _{i-2,jk}^{n+1} \nonumber \\&\qquad \qquad \quad +\phi _{i,j+2,k}^{n}+\phi _{i,j-2,k}^{n+1} + \phi _{ij,k+2}^{n}+\phi _{ij,k-2}^{n+1}+2(\phi _{i+1,j+1,k}^{n}+\phi _{i+1,j-1,k}^{n}\nonumber \\&\qquad \qquad \quad +\phi _{i+1,j,k+1}^{n}+\phi _{i+1,j,k-1}^{n}+\phi _{i-1,j+1,k}^{n}+\phi _{i-1,j-1,k}^{n+1}+\phi _{i-1,j,k+1}^{n}\nonumber \\&\qquad \qquad \quad +\phi _{i-1,j,k-1}^{n+1}+\phi _{i,j+1,k+1}^{n}+\phi _{i,j+1,k-1}^n+\phi _{i,j-1,k+1}^n+\phi _{i,j-1,k-1}^{n+1})\nonumber \\&\qquad \qquad \quad -12(\phi _{i+1,jk}^{n}+\phi _{i-1,jk}^{n+1}+\phi _{i,j+1,k}^{n}+\phi _{i,j-1,k}^{n+1} \!+\!\phi _{ij,k+1}^{n}+\phi _{ij,k-1}^{n+1})+ 21\phi _{ijk}^n \big \} \Big ],\nonumber \\ \end{aligned}$$
(10)

where \(r=1/ \Delta t +6/h^2 +21\epsilon ^2/h^4\). The other 47 ‘for loop’ cases are similarly defined. A space-time adaptive narrow-band domain \(\Omega _\text {nb}^n\) is defined as \(\Omega _\text {nb}^n = \{(x_i,y_j,z_k)\vert ~ \vert \nabla \phi _{ijk}^n \vert > \xi ,~1 \le i \le N_x,~1 \le j \le N_y,~1 \le k \le N_z\},\) where

$$\begin{aligned} \nabla \phi _{ijk}^n = \left( \frac{\phi _{i+1,jk}^n - \phi _{i-1,jk}^n}{2h}, \frac{\phi _{i,j+1,k}^n - \phi _{i,j-1,k}^n}{2h}, \frac{\phi _{ij,k+1}^n - \phi _{ij,k-1}^n}{2h} \right) . \end{aligned}$$
(11)

Figure 4 illustrates a schematic of narrow-band domain on 3D space. It shows the temporal evolution of \(\Omega _\text {nb}^n\) (dots) with isosurface of solutions at zero level.

Fig. 4
figure 4

ac Snapshots of the temporal evolution of narrow-band domain \(\Omega _\text {nb}^n\) (dots) in 3D space

To make the numerical scheme conservative, we apply the mass correction algorithm after each temporal iteration:

$$\begin{aligned} \phi ^{n+1}_{ijk} = \phi ^{n+1}_{ijk} + \frac{\sum _{(x_p, y_q, z_r) \in \Omega _\text {nb}^n} (\phi ^n_{pqr}-\phi ^{n+1}_{pqr})}{\sum _{(x_p, y_q, z_r) \in \Omega _\text {nb}^n} \sqrt{F(\phi ^{n+1}_{pqr})} } \sqrt{F(\phi ^{n+1}_{ijk})}~~ \text {for}~ (x_i, y_j, z_k) \in \Omega _\text {nb}^n. ~~\nonumber \\ \end{aligned}$$
(12)

In Eqs. (2) and (8), we only considered a first-order linear convex splitting scheme. It can be extended to second-order linear convex splitting schemes (Guo et al. 2016, 2021; Chen et al. 2019; Dong et al. 2020). For example, we may use the following second-order method (Guo et al. 2016): for given \(\phi _{ijk}^{n-1},\phi _{ijk}^{n} \in \Omega _h\),

$$\begin{aligned} \frac{\phi _{ijk}^{n+1}-\phi _{ijk}^n}{\Delta t} = \Delta _d \mu _{ijk}^{n+\frac{1}{2}}, \end{aligned}$$
(13)

where

$$\begin{aligned} \mu _{ijk}^{n+\frac{1}{2}}= & {} \Delta _d \left( \chi (\phi _{ijk}^{n+1},\phi _{ijk}^{n}) - \phi _{ijk}^{n+\frac{1}{2}} - \epsilon ^2 \Delta _d {\hat{\phi }}_{ijk}^{n+\frac{1}{2}}\right) , \end{aligned}$$
(14)
$$\begin{aligned} \chi (\phi _{ijk}^{n+1},\phi _{ijk}^{n})= & {} \frac{1}{4}(\phi _{ijk}^{n+1}+\phi _{ijk}^{n})\Big [(\phi _{ijk}^{n+1})^2+(\phi _{ijk}^{n})^2\Big ], \end{aligned}$$
(15)
$$\begin{aligned} \phi _{ijk}^{n+\frac{1}{2}}= & {} \frac{3}{2}\phi _{ijk}^{n}-\frac{1}{2}\phi _{ijk}^{n-1}, \quad {\hat{\phi }}_{ijk}^{n+\frac{1}{2}} = \frac{3}{4}\phi _{ijk}^{n+1}+\frac{1}{4}\phi _{ijk}^{n-1}. \end{aligned}$$
(16)

3 Computational Tests

We perform various computational simulations using the proposed numerical solution algorithm on 2D and 3D spaces. Through the computational experiments, we demonstrate the efficiency and accuracy of our proposed numerical solution algorithm. For numerical simulations, we define the interface layer parameter \(\epsilon _l\) as follows (Jeong et al. 2021):

$$\begin{aligned} \epsilon _l = \frac{lh}{2\sqrt{2}\tanh ^{-1}(0.9)}, \end{aligned}$$
(17)

where l is a positive integer. Unless otherwise stated, numerical experiments are performed in \(\Omega = (-1,1)^d\) (\(d = 2,3\)) with grid points \(N_x = N_y = N_z = 128\), uniform spatial step \(h = 2/N_x = 2/N_y = 2/N_z\), and \(\epsilon = \epsilon _4\).

3.1 Stability Test

In this section, we test the time step stability of the proposed adaptive method. In 2D and 3D spaces, we consider square and cubic shapes as initial conditions, respectively. We define a maximum time step \(\Delta t_{max}\), which is a numerical maximum time step that guarantees the non-blow-up of the numerical solutions. The condition under which the numerical solution blows up is defined when \(\max _{i\in I}\{\phi (\mathbf{x}_i,100\Delta t)\}>1.7\), where I is the index set of grid points. In 2D and 3D computational domains \(\Omega = (0,1)^d\), where d is dimension, the given initial conditions are as follows:

$$\begin{aligned} \phi (x,y,0) = \left\{ \begin{array}{ll} +1,&{}~\text {if}~0.25<x<0.75,~0.25<y<0.75,\\ -1,&{}~\text {otherwise}, \end{array} \right. \end{aligned}$$
(18)

and

$$\begin{aligned} \phi (x,y,z, 0) = \left\{ \begin{array}{ll} +1,&{}~\text {if}~0.25<x<0.75,~0.25<y<0.75,~0.25<z<0.75, \\ -1,&{}~\text {otherwise}, \end{array} \right. \nonumber \\ \end{aligned}$$
(19)

respectively. Tables 1 and 2 list the maximum time step \(\Delta t_{max}\) in 2D and 3D space, respectively, with three different spatial grid sizes \(h=1/64,1/128,\) and 1/256. The stability test confirms that the proposed adaptive method can use sufficiently large time steps for the stable numerical solutions.

Table 1 Stability test results in 2D space
Table 2 Stability test results in 3D space

3.2 Two-Dimensional Space

In 2D space, we compare solutions of the entire domain with those of adaptive domains and investigate effects of the parameters m, \(\xi \), and K which generate the adaptive domain.

Fig. 5
figure 5

Temporal evolution of the contours of \(\phi \) at zero level with square initial condition. ac are snapshots of solution for entire and adaptive domains at \(t = 0\), \(t = 9000 \Delta t\), and \(t = 30000 \Delta t\), respectively. Here, \(m=6\), \(\Delta t = 0.1h^2\), and \(\xi = 0.5\) are used

In Fig. 5, we observe the temporal evolution with the following square shape initial condition,

$$\begin{aligned} \phi (x,y,0) = \left\{ \begin{array}{ll} +1,&{}~\text {if } ~ -0.5<x<0.5,~-0.5<y<0.5,\\ -1,&{}~\text {otherwise}, \end{array} \right. \end{aligned}$$
(20)
Fig. 6
figure 6

Snapshots of solution and narrow-band domain for ab adaptive domain \(m=2\) and \(m=6\), c entire domain. d Overlapped contour of solutions at zero level. Left to right column, \(t = 3000\Delta t\), \(t = 15000 \Delta t\), and \(t = 30000 \Delta t\). Here, \(\xi = 0.5\) and \( \Delta t = 0.1h^2\) are used

We compare the solutions of the CH equation computed on the entire domain (solid line) with the adaptive domain (solid line with markers). The solutions on the adaptive domain fit well with the solutions on the entire domains. For efficient computations, buffer size m which adjusts the narrow-band domain should be appropriately controlled. To find a proper the buffer size m, we investigate the evolution of the solutions on the adaptive narrow-band domain according to the value of m. In Fig. 6, we experiment with a square spiral shape. As a result of Fig. 6, \(m=6\) is sufficient to accurately represent the solution of the CH equation.

To compare CPU times for the entire domains with those for adaptive domains, we define a period K of updating the adaptive domain at every K time steps. That is, we update the computational domain \(\Omega _\text {nb}^n\) when \(n=Kp\) for \(p=0,1,2,\ldots \), where K is a positive integer. In Fig. 7, we show the comparison results for entire and adaptive domains. The CH equation is solved on a rectangular domain \(\Omega = (-1,1)\times (-0.5,0.5)\) with parameter values: \(N_x = 128\), \(N_y = 64\), \(\Delta t = h^2\), \(m = 4\), and \(\xi = 0.5\). We investigate the dynamics until the solution of the CH equation becomes circular from the rectangular initial condition. Figure 7a shows CPU times for entire and adaptive domains. It shows that as K increases, the CPU times decrease. Figure 7b shows contours of \(\phi \) at zero for the entire and adaptive domains with the rectangular initial condition. Solutions in the adaptive domains are similar to the solution in the entire domain up to \(K=100\). As shown in Figs. 7a and b, it seems reasonable to adopt \(K=100\) for efficient and accurate computation.

Fig. 7
figure 7

On a computational domain \(\Omega = (-1,1)\times (-0.5,0.5)\), for a rectangular initial condition, a CPU times and b contours of \(\phi \) at zero for entire domain and adaptive domains with \(K=1,100\), and 10000. Here, \(m=4\), \(h = 1/64\), \(\Delta t = h^2\), and \(t = 20000\Delta t\) are used

3.3 Three-Dimensional Space

We perform several computational experiments in 3D space. In 3D space, for stability and efficient computation, we use \(\Delta t = 0.2h^2\), \(m=6\), \(\xi =0.5\), and \(K=100\). Figure 8 displays the temporal evolution of the cubic shape initial condition as follows:

$$\begin{aligned} \phi (x,y,z,0) = \left\{ \begin{array}{ll} +1,&{}~\text {if}~-0.5<x<0.5,~-0.5<y<0.5,~-0.5<z<0.5,\\ -1,&{}~\text {otherwise}. \end{array} \right. \end{aligned}$$
Fig. 8
figure 8

Temporal evolution isosurface of \(\phi \) at zero level with cube initial condition in 3D space. ac are snapshots of solution for adaptive domain at \(t = 0\), \(t = 400 \Delta t\), and \(t = 3000 \Delta t\), respectively

To examine the efficiency of adaptive narrow-domain, a shape with irregularity is considered as the initial condition as shown in Fig. 9. In the case of the shape of Fig. 9, higher efficiencies can be obtained when using the adaptive narrow-band domain, compared to the case of solving the problems on the entire domain. Let us define the 3D discrete energy functional in the discretized space domain \(\Omega _h\) as

$$\begin{aligned} {\mathcal {E}}^h(\phi ^n) := \sum _{i=1}^{N_x}\sum _{j=1}^{N_y}\sum _{k=1}^{N_z}\left( F(\phi _{ijk}^n) + \frac{\epsilon ^2}{2}\vert \nabla _h \phi _{ijk}^n\vert ^2 \right) h^3, \end{aligned}$$
(21)

where

$$\begin{aligned} \nabla _h \phi _{ijk}^n = \Big (\frac{\phi _{i+1,jk}^n-\phi _{ijk}^n}{h},\frac{\phi _{i,j+1,k}^n-\phi _{ijk}^n}{h}, \frac{\phi _{ij,k+1}^n-\phi _{ijk}^n}{h}\Big ). \end{aligned}$$
(22)
Fig. 9
figure 9

Temporal evolution of the discrete free energy functional and dynamics with respect to the number of time iterations. Here, the solid line represents the energy curve, open circles represent the specific moments when \(t = 0\), \(t=1000\Delta t\), and \(t = 5000\Delta t\). From left to right, the figures inserted into the graph are snapshots of the zero level isosurface of solution \(\phi \) with the irregular initial condition

In Fig. 9, the graph shows the temporal evolution of discrete free energy from \(t = 0\) to \(t = 5000\Delta t\) and the figures are snapshots of the zero level isosurface of \(\phi \) with the irregular initial condition. We confirm that the discrete free energy functional decreases monotonically as time goes on.

Fig. 10
figure 10

Temporal evolution of isosurface of \(\phi \) at zero level with Genus 6 shape for initial condition. ad are snapshot of solution for the adaptive domain at \(t = 0\), \(t = 400 \Delta t\), \(t = 800 \Delta t\), and \(t = 3000 \Delta t\), respectively

Then, we investigate the robustness of the adaptive narrow-band domain for a shape with complex interface in 3D space. We consider ‘Genus 6 3D surface’ (Ceh Jan) as an initial condition, where the inside of the surface is 1 and the outside is -1, as shown in Fig. 10a. Figure 10a–d shows the temporal evolution of isosurface of \(\phi \) at zero level with Genus 6 shape. As shown in Fig. 10, it can be seen that the adaptive narrow-band domain operates well for the CH equation for shapes with complex interfaces such as Genus 6 3D surface.

To validate the adaptive procedure for disjoint drops in 3D space, we consider the four separate drops, (see, e.q., Cheng et al. (2018)) consisting of three ellipsoids and one sphere. The initial condition is given as

$$\begin{aligned} \phi (x,y,z,0)= & {} \tanh \left( \frac{\frac{\pi }{12} - \sqrt{0.25 (x+\frac{\pi }{14})^2+(y-\frac{\pi }{11})^2+(z+\frac{\pi }{11})^2}}{\sqrt{2}\epsilon }\right) \\&+ \tanh \left( \frac{\frac{\pi }{12} - \sqrt{0.5(x-\frac{\pi }{10})^2+(y+\frac{\pi }{13})^2+(z+\frac{\pi }{11})^2}}{\sqrt{2}\epsilon }\right) \\&+ \tanh \left( \frac{\frac{\pi }{14} - \sqrt{(x+\frac{\pi }{10})^2+(y+\frac{\pi }{12})^2+(z+\frac{\pi }{11})^2}}{\sqrt{2}\epsilon }\right) \\&+ \tanh \left( \frac{\frac{\pi }{10} - \sqrt{x^2+0.2y^2+(z-\frac{\pi }{10})^2}}{\sqrt{2}\epsilon }\right) +3. \end{aligned}$$

The isosurface of initial condition at \(\phi =0\) is illustrated in Fig. 11a. From the results in Fig. 11, four disjoint drops merge and eventually evolve into a sphere. The solution obtained by the proposed explicit adaptive method follows the dynamics of the CH equation well even if it is initially irregular or separated.

Fig. 11
figure 11

af Snapshots of the isosurface of numerical solution \(\phi \) at zero level with initially four drops, using the adaptive domain with \(\Delta t = 4000h^4\) at \(t = 0\), \(t = 100 \Delta t\), \(t = 300 \Delta t\), \(t = 800 \Delta t\), \(t = 3000 \Delta t\), and \(t = 50000 \Delta t\), respectively

4 Discussion and Conclusion

In this section, we discuss a relation between the interface layer parameter \(\epsilon \) and the gradient criterion \(\xi \). Then, we draw conclusions of this paper. An equilibrium profile is \(\psi (x)=\tanh (x/(\sqrt{2}\epsilon ))\) on the infinite domain, where the phase-field varies from \(-0.9\) to 0.9 at a distance of about \(2\sqrt{2}\tanh (0.9)\). Therefore, we use Eq. (17) for a transition layer width of approximately lh. We differentiate the equilibrium solution \(\psi (x)\) to define the gradient criterion value \(\xi \).

$$\begin{aligned} \psi '(x) = \frac{\text {sech}^2(x/(\sqrt{2}\epsilon ))}{\sqrt{2}\epsilon }. \end{aligned}$$

Thus, we define the relation between \(\xi \) and \(\epsilon _l\) as follows:

$$\begin{aligned} \xi (\epsilon ) = \Big \vert \psi '\left( \sqrt{2}\epsilon \tanh ^{-1}(0.995)\right) \Big \vert , \end{aligned}$$
(23)

which implies that our algorithm is set to recognize the transition layer more accurately. When \(\epsilon = \epsilon _4\), using the relation (23), \(\xi (\epsilon _4) \approx 0.4699\). In our previous numerical tests, we use \(\xi = 0.5\) for simplicity.

In this paper, we presented an explicit adaptive FDM for the CH equation which describes the process of phase separation. To numerically solve the CH equation fast and efficiently, we used the FDM and time-adaptive narrow-band domain. For the adaptive grid, we define a narrow-band domain including the interfacial transition layer of the phase field and solve the numerical scheme on the narrow-band domain which is computed using undivided finite difference. We used the alternating direction explicit method. To make the scheme conservative, we apply a mass correction algorithm after each temporal iteration step. To demonstrate the superior performance of the proposed method, we presented 2D and 3D numerical experiments and compared them with those of the other previous methods. There exist several interesting future extensions of the proposed adaptive approach of the CH equation to other phase field models such as two-phase flows (Guo et al. 2022), multiphase tumor growth (Chen et al. 2014), topology optimization (Bartels et al. 2021; Yu et al. 2021), N-component CH system (Li et al. 2016b), N-component fluid flows (Kim 2009; Xia et al. 2022), curve and surface smoothing (Choi et al. 2017), and dendritic crystal growth (Zhang et al. 2019).