AllenCahn1D
Derivation of the exact solution
The Allen Cahn equation admits a 1D solution that can be used to test the implementation. The energy functional in 1D is
The Allen-Cahn equation is
where the variational derivative can be derived from the Euler-Lagrange equation resulting in
At steady-state, (\(\frac{\partial\alpha}{\partial t}=0\)) the Allen-Cahn equation simplifies to
This is a nonlinear ODE, but it can be reduced by multiplying both sides by \(\frac{d\alpha}{dx}\):
Using the chain rule, we can further simplify:
When integrated, we obtain
Combining the constants of integration into a single constant \(C_0=C_2-C_1\):
Solving for \(\frac{d\alpha}{dx}\):
For a monotonic interface profile connecting two phases, we require \(C_0=0\) to ensure that \(\frac{d\alpha}{dx}=0\) at the minima of \(W(\alpha)\):
As is often the convention, we let \(W\) represent a double-well chemical potential
which has a convenient square root. After substituting, we now have a nonlinear, but trivially solved differential equation:
where \(\gamma=\pm\sqrt{\frac{2\lambda}{\kappa}}\). This differential equation can be solved by separation of variables or by substitution as shown here:
Substituting \(u\) for \(\alpha\) we find
which has the solution:
where \(C\) is a constant. Reversing the substitution, we get the following solution for \(\alpha\):
We desire a solution centered at \(x=0\) such that \(\alpha(-x)=1-\alpha(x)\). This condition is only satisfied when \(C=1\); so, the interfacial solution is:
Determination of interface width \(\varepsilon\)
The slope at the center of the interface (\(x=0\)) is
The function changes from approximately 0 to 1 across the interface. Using a linear approximation slope—i.e., slope \(\approx\) (change in \(\alpha\))/(change in \(x\))—the interface width \(\varepsilon\) is as follows:
Determination of interface energy density \(\sigma\)
The interface energy \(\sigma\) is given by substituting the solution for \(\alpha\) into the free energy functional:
Using the chain rule, the derivative of \(\alpha\) is
Conveniently, this can be written as
Squaring this derivative, we can make another convenient substitution:
Plugging this back into the integrand:
Recalling that \(\gamma^2=\frac{2\lambda}{\kappa}\):
We can trivially solve this integral with a simple substitution:
To adjust the bounds of integration, we note:
Substituting these variables into the integrand:
Applying one final substitution, we find the following expression for the interface energy \(\sigma\):
Inverting the relationship
It may be more desirable to define behavior in terms of the interface energy \(\sigma\) and interface width \(\varepsilon\). From the previously derived equation for \(\sigma\), we can show:
From the definition of \(\gamma\), we can use the following substitutions:
These relationships then give us the following expressions:
Recalling that \(\gamma=\frac{4}{\varepsilon}\), we can finalize the inversion:
Writing the free energy in terms of these quantities gives:
Dimensional analysis
Given that \(\sigma\) has units of \(\left[\mathrm{E}\ \mathrm{L}^{-2}\right]\) and \(\varepsilon\) has units of length \(\left[\mathrm{L}\right]\), it becomes clear from the inverted relationships that \(\lambda\) and \(\kappa\) must have the following units:
eps_0.50_sigma_0.05
Two-dimensional |
|
Serial |
|
Validated using check script |
|
./bin/alamo-2d-g++ tests/AllenCahn1D/input ch.eps="0.50" ch.sigma="0.05"
|
eps_0.50_sigma_0.1
Two-dimensional |
|
Serial |
|
Validated using check script |
|
./bin/alamo-2d-g++ tests/AllenCahn1D/input ch.eps="0.50" ch.sigma="0.1"
|
eps_0.05_sigma_0.05
Two-dimensional |
|
Serial |
|
Validated using check script |
|
./bin/alamo-2d-g++ tests/AllenCahn1D/input ch.eps="0.05" ch.sigma="0.01"
|
#@
#@ [eps_0.50_sigma_0.05]
#@ exe=alamo
#@ dim=2
#@ args = ch.eps=0.50
#@ args = ch.sigma=0.05
#@ check-file = eps_0.50_sigma_0.05
#@
#@ [eps_0.50_sigma_0.1]
#@ exe=alamo
#@ dim=2
#@ args = ch.eps=0.50
#@ args = ch.sigma=0.1
#@ check-file = eps_0.50_sigma_0.1
#@
#@ [eps_0.05_sigma_0.05]
#@ exe=alamo
#@ dim=2
#@ args = ch.eps=0.05
#@ args = ch.sigma=0.01
#@ check-file = eps_0.05_sigma_0.01
#@
alamo.program = allencahn
### OUTPUT ###
plot_file = tests/AllenCahn1D/output
### MESHING ###
# Specify system units
system.length = m
system.time = s
amr.plot_int = 1000
amr.max_level = 3
amr.max_grid_size = 500000
amr.blocking_factor = 2
amr.grid_eff = 0.8
amr.n_cell = 64 4 0
geometry.prob_lo = -1.0_m 0.000_m 0.0_m # [ m ]
geometry.prob_hi = 1.0_m 0.125_m 0.0_m # [ m ]
geometry.is_periodic = 0 0 0
timestep = 1.0_ms
stop_time = 5.0_s
alpha.bc.constant.type.xlo = neumann
alpha.bc.constant.type.xhi = neumann
alpha.bc.constant.type.ylo = neumann
alpha.bc.constant.type.yhi = neumann
alpha.ic.type = expression
alpha.ic.expression.region0 = "x>0"
ch.L = 1.0_1/Pa/s
ch.eps = 0.100.0_m
ch.sigma = 0.01_J/m^2