This program solves the Cahn Hilliard equation using the an implicit pseudospectral method.
The Cahn-Hilliard equation is defined as
with M being a mobility and the functional of free-energy given by
where is a parameter related to the interfacial energy and is the bulk free-energy density given by
where W is the height ot the thermodynamic barrier. The next Figure presents this bulk free-energy.
The concentration field can be expanded as a Fourier series in the form
where the Fourier coefficients are given by
and where and is the stepsize of the meshgrid on the i direction.
The Fourier transform of the dynamical equation is
and using an implicit Euler integration, we have
such that
The following figure is a result for the system with M=1.0, W=2.0, , dx=1.0, dt=0.1. The initial condition is given by a normal distribution
And the system is evolved until N = 1000 steps.