mat-phase-field-conservative

Installation
SKILL.md

Conservative Phase-Field: Cahn-Hilliard

Goal

To simulate the morphological evolution of spinodal decomposition (phase separation) in a binary alloy system using the Cahn-Hilliard equation. This skill solves the 4th-order partial differential equation to track the conservative concentration field $c(\mathbf{r}, t)$ over time.

Instructions

1. Mathematical Formulation

The Cahn-Hilliard equation describes the evolution of a conserved concentration field $c$ down a free energy gradient: $$ \frac{\partial c}{\partial t} = \nabla \cdot \left( M \nabla \frac{\delta F}{\delta c} \right) $$ Where $M$ is the mobility, and $F$ is the Ginzburg-Landau free energy functional incorporating a double-well local potential $f(c) = a c^2(1-c)^2$ and a gradient energy penalty $\frac{\kappa}{2} |\nabla c|^2$.

2. Running the Spinodal Decomposition Simulation

Use the provided script to set up a 2D grid and solve the Cahn-Hilliard equation using FiPy.

Installs
5
GitHub Stars
176
First Seen
Jun 19, 2026