HPC Tier Module
Phase-Field Solidification (Allen-Cahn / Cahn-Hilliard)
2D Allen-Cahn and Cahn-Hilliard phase-field solver with its physical invariants measured each run.
See it run - a worked example, 100% in this browser tab
The problem
Phase-field prototyping needs a solver whose physical invariants are actually verified, not assumed - and whose stiff stability limit is handled so a default run does not silently blow up.
The local-first solution
This solver integrates the Allen-Cahn and Cahn-Hilliard equations on a periodic grid with a standard double-well in your browser, measures the free-energy decrease and total-mass conservation each run, fits the realized interface width against the exact tanh profile, and auto-caps the stiff time step. Deterministic f64 math, nothing uploaded.
What it does
Allen-Cahn (non-conserved L2 gradient flow) with measured monotone free-energy decrease
Cahn-Hilliard (conserved 4th-order) with measured total-mass conservation
Standard symmetric double-well f(phi)=phi^2(1-phi)^2 on a periodic square grid
5-point Laplacian with explicit forward-Euler time stepping and surfaced stability caps
Exact tanh planar-interface anchor with realized width fit versus eps
GeoNum drift probe of the near-equilibrium free-energy decrement
Honest scope
EXACT: the finite-difference stencils, double-well algebra, forward-Euler stepping, and the measured energy and mass series in f64. Mobility M, gradient coefficient eps, dx, and dt are dated model inputs - the analytic width (~3.11 eps) and stability caps derive from them and are echoed back. NOT modeled: anisotropy/dendritic side-branching, thermal coupling, elastic/advective coupling, implicit/spectral stepping, or >2D. A prototype at browser grid sizes, not a production dendrite code.
Authorities cited
- Allen, S. M. & Cahn, J. W. (1979). A microscopic theory for antiphase boundary motion and its application to antiphase domain coarsening. Acta Metallurgica 27(6), 1085-1095. DOI 10.1016/0001-6160(79)90196-2. (The non-conserved Allen-Cahn equation d phi/dt = -M(f'(phi) - eps^2 lap phi).)
- Cahn, J. W. & Hilliard, J. E. (1958). Free energy of a nonuniform system. I. Interfacial free energy. J. Chem. Phys. 28(2), 258-267. DOI 10.1063/1.1744102. (The gradient-energy functional F = integral[f + (kappa/2)|grad c|^2] and the conserved Cahn-Hilliard dynamics.)
- Provatas, N. & Elder, K. (2010). Phase-Field Methods in Materials Science and Engineering. Wiley-VCH. ISBN 978-3-527-40747-7. (Double-well f = phi^2(1-phi)^2, the tanh equilibrium interface phi = 1/2[1+tanh(x/(2 sqrt(2) eps))], and explicit-scheme stability.)
- Kobayashi, R. (1993). Modeling and numerical simulations of dendritic crystal growth. Physica D 63(3-4), 410-423. DOI 10.1016/0167-2789(93)90120-P. (Anisotropic solidification phase-field with a thermal field - the not-modeled extension named in scope.)
- Eyre, D. J. (1998). Unconditionally gradient stable time marching the Cahn-Hilliard equation. MRS Proc. 529, 39. (Convex-splitting implicit stepping - the not-modeled stable-scheme alternative to explicit Euler.)
- Strikwerda, J. C. (2004). Finite Difference Schemes and Partial Differential Equations, 2nd ed. SIAM. DOI 10.1137/1.9780898717938. (Explicit-Euler stability limits: dt ~ dx^2 for 2nd-order and dt ~ dx^4 for 4th-order diffusion operators.)
Solve with invariants verified
Run the solver in your browser with nothing uploaded, then save the energy and mass series to a Sandbox workspace or attach them to a Worklog case.