We aim to solve the 2D Cahn-Hilliard equation:
The variable
The Fourier coefficients are given by
$$
\widehat{c}_{\boldsymbol{k}}(t)=\mathcal {FT}{c(\boldsymbol{r},t)}=\int c(\boldsymbol{r},t)e^{i\boldsymbol{k}\boldsymbol{r}}d\boldsymbol{r}
$$
and
The Fourier transform of the dynamical equation is $$ \frac{\partial\widehat{c}{\boldsymbol{k}}}{\partial t}= M[-\kappa k^4\widehat{c}{\boldsymbol{k}}-k^2\mathcal {FT}{\frac{\delta f}{\delta c}}] $$
Explanation of Terms
-
$\frac{\partial \hat{c}(k, t)}{\partial t}$ : Rate of change of the Fourier component of$c$ with respect to time$t$ . -
$-k^4 \hat{c}_{\boldsymbol{k}}$ : The Laplacian term in Fourier space.$k^4$ is a consequence of two spatial derivatives$\nabla^2$ . -
$k^2 \hat{f'}$ : Fourier transform of the derivative of free energy density.$k^2$ arises from one spatial derivative$\nabla^2$ .
The existing implicit Euler scheme for solving the equation is:
$$
\widehat{c}{\boldsymbol{k}}^{n+1} = \frac{\widehat{c}^n{\boldsymbol{k}}-\Delta tMk^2\mathcal{FT}{f'(c^n)} }{1+\Delta t\kappa M k^4}
$$
Solver for $\widehat{c}{\boldsymbol{k}}^{n+1}$: isolate $\widehat{c}{\boldsymbol{k}}^{n+1}$ to find its value at the next time step:
$$
\widehat{c}{\boldsymbol{k}}^{n+1}=\frac{\widehat{c}^n{\boldsymbol{k}}-\Delta tMk^2\mathcal{FT}{f'(c^n)} }{1+\Delta t\kappa M k^4}
$$
where
You can adapt the RK4 scheme to solve the Cahn-Hilliard equation. For the RHS defined as:
The RK4 scheme becomes:
$$ k_1 = \Delta t * RHS(\hat{c}{\boldsymbol{k}}^n) $$ $$ k_2 = \Delta t * RHS(\hat{c}{\boldsymbol{k}}^n + k_1 / 2) $$ $$ k_3 = \Delta t * RHS(\hat{c}{\boldsymbol{k}}^n + k_2 / 2) $$ $$ k_4 = \Delta t * RHS(\hat{c}{\boldsymbol{k}}^n + k_3) $$ $$ \hat{c}{\boldsymbol{k}}^{n+1} = \hat{c}{\boldsymbol{k}}^n + (k_1 + 2 * k_2 + 2 * k_3 + k_4) / 6 $$
To adapt this for the Cahn-Hilliard equation in Fourier space, we can use:
And the adapted Adams-Moulton formula becomes:
$$ \hat{c}{\boldsymbol{k}}^{n+4} = \hat{c}{\boldsymbol{k}}^{n+3} + \frac{\Delta t}{720} \left[ 251 \text{RHS}(\hat{c}{\boldsymbol{k}}^{n+4}) + 646 \text{RHS}(\hat{c}{\boldsymbol{k}}^{n+3}) - 264 \text{RHS}(\hat{c}{\boldsymbol{k}}^{n+2}) + 106 \text{RHS}(\hat{c}{\boldsymbol{k}}^{n+1}) - 19 \text{RHS}(\hat{c}_{\boldsymbol{k}}^n) \right] $$
We want to isolate
To isolate $\hat{c}{\boldsymbol{k}}^{n+4}$, we can rewrite the equation as follows: $$ \hat{c}{\boldsymbol{k}}^{n+4} \left( 1 - \frac{251 \Delta t M \kappa k^4}{720} \right) = \hat{c}{\boldsymbol{k}}^{n+3} + \frac{\Delta t}{720} \left( 646 \text{RHS}(\hat{c}{\boldsymbol{k}}^{n+3}) - 264 \text{RHS}(\hat{c}{\boldsymbol{k}}^{n+2}) + 106 \text{RHS}(\hat{c}{\boldsymbol{k}}^{n+1}) - 19 \text{RHS}(\hat{c}_{\boldsymbol{k}}^n) \right) $$
Finally, isolating
$$ \hat{c}{\boldsymbol{k}}^{n+4} = \frac{\hat{c}{\boldsymbol{k}}^{n+3} + \frac{\Delta t}{720} \left( 646 \text{RHS}(\hat{c}{\boldsymbol{k}}^{n+3}) - 264 \text{RHS}(\hat{c}{\boldsymbol{k}}^{n+2}) + 106 \text{RHS}(\hat{c}{\boldsymbol{k}}^{n+1}) - 19 \text{RHS}(\hat{c}{\boldsymbol{k}}^n) \right)}{1 - \frac{251 \Delta t M \kappa k^4}{720}} $$
- Inverse Fourier Transform:Take the inverse Fourier transform of $\widehat{c}{\boldsymbol{k}}^{n+4}$ to find ${c}{\boldsymbol{k}}^{n+4}$ the concentration at the next time step in real space.
- Repeat: Go back to RK4 and fourth-order Adams-Moulton method and repeat for all desired time steps.
A smaller value of
This controls the width of the interface between the two phases. A smaller value would mean a sharper interface, while a larger value results in a more diffuse interface. The value of
Controls the depth of the double well potential. Larger values make the free energy wells deeper, causing the phase separation to be more pronounced. However, this could also make the system more sensitive to numerical errors.
Stability analysis for complex nonlinear PDEs like the Cahn-Hilliard equation can be challenging. Here are some empirical strategies for ensuring numerical stability:
Make sure the Courant-Friedrichs-Lewy (CFL) condition is satisfied. This means ensuring that
where CFL is a number less than or equal to 1.
Make sure the grid is fine enough to resolve the smallest features in your simulation. This is particularly important for the interface width, which is often related to
$$ \sqrt{\frac{\kappa}{W}} $$.
It may be beneficial to start with a simpler system (e.g., 1D instead of 2D, or a smaller grid) and scale up as you verify the model's stability.
Perform a sensitivity analysis by varying one parameter at a time while keeping the others constant. This will help you understand how each parameter influences the stability of the solution.