A KWC-type Multi-phase-field Model for Static Recrystallization through Subgrain Rotation and Coalescence
This repository provides the paper and source code for a KWC-type Multi-phase-field model designed to describe static recrystallization behavior associated with subgrain rotation and coalescence in polycrystalline materials.
Note: This paper summarizes the formulation and numerical examples associated with the KWC-type multi-phase-field model presented at the Asian Pacific Congress on Computational Mechanics (APCOM 2019, Taipei, Taiwan) under the title "Multi-phase-field Model Considering Evolution of Crystal Orientation for Nucleation from Subgrains in Polycrystal."
This study develops a KWC-type Multi-phase-field model in which multiple phase-field variables represent grains or subgrains, while crystal orientation is treated as an additional order parameter. The model is formulated based on a Ginzburg-Landau-type free energy functional and is intended to describe microstructural evolution involving grain-boundary migration, orientation evolution, and coalescence of neighboring subgrains.
The repository includes both two-dimensional and three-dimensional implementations:
mpfkwc.py: two-dimensional implementation with scalar (angle) orientation field
mpfkwc_3d.py: three-dimensional implementation using quaternion-based crystal orientation
The KWC-type Multi-phase-field model introduces a phase-field order parameter $\phi_{[\iota]}$ for each grain $\iota$ ($\iota = 1, \ldots, N$) and a crystal-orientation order parameter $\theta$.
The Ginzburg-Landau free-energy functional is defined as
$$F
=
\int_{\mathscr{V}}
\left(
f_{\mathrm{grad}}
+ f_{\mathrm{double}}
+ f_{\mathrm{drive}}
+ f_{\mathrm{orie}}
\right)
\, \mathrm{d}v,$$
where $f_{\mathrm{grad}}$ is the gradient energy of the order parameters, $f_{\mathrm{double}}$ is the double-well potential, $f_{\mathrm{drive}}$ is the driving-force energy associated with stored energy, and $f_{\mathrm{orie}}$ is the orientation-gradient energy.
The orientation-gradient energy extends the KWC-type formulation to the multi-phase-field
framework:
$$f_{\mathrm{orie}}
=
s\, G(\{\phi_{[\iota]}\}) \|\nabla\theta\|
+
\frac{1}{2}\varepsilon^2
H(\{\phi_{[\iota]}\})
\|\nabla\theta\|^2,$$
where $s$ and $\varepsilon$ are coefficients, and $G$ and $H$ are global weight functions that depend on the phase-field variables and representative grain orientations. These functions are chosen to take minimum values at grain boundaries, thereby localizing orientation changes in those regions.
Evolution Equation for $\phi_{[\iota]}$
The phase-field evolution equation is derived from the variational derivative of the free energy under the sum constraint, yielding
$$\frac{\partial \phi_{[\iota]}}{\partial t}
=
-
\sum_{\kappa=1}^{N}
\frac{M^{\phi}_{[\iota\kappa]}}{N}
\Biggl\{
\sum_{\lambda=1}^{N}
\left[
\frac{1}{2}
\left(
\alpha_{[\iota\lambda]}^2
-
\alpha_{[\kappa\lambda]}^2
\right)
\nabla^2\phi_{[\lambda]}
+
W_{[\iota\lambda]}
\frac{\partial p(\phi_{[\iota]},\phi_{[\lambda]})}{\partial\phi_{[\iota]}}
-
W_{[\kappa\lambda]}
\frac{\partial p(\phi_{[\kappa]},\phi_{[\lambda]})}{\partial\phi_{[\kappa]}}
\right]
+
\frac{\delta f_{\mathrm{drive}}}{\delta\phi_{[\iota]}}
-
\frac{\delta f_{\mathrm{drive}}}{\delta\phi_{[\kappa]}}
+
s
\left(
\frac{\partial G}{\partial\phi_{[\iota]}}
-
\frac{\partial G}{\partial\phi_{[\kappa]}}
\right)
\|\nabla\theta\|
+
\frac{1}{2}\varepsilon^2
\left(
\frac{\partial H}{\partial\phi_{[\iota]}}
-
\frac{\partial H}{\partial\phi_{[\kappa]}}
\right)
\|\nabla\theta\|^2
\Biggr\},$$
where $M^{\phi}_{[\iota\kappa]}$ is the phase-field mobility between grains $\iota$ and $\kappa$, $\alpha_{[\iota\lambda]}$ is the gradient energy coefficient, $W_{[\iota\lambda]}$ is the energy barrier coefficient, and $p(\phi_{[\iota]}, \phi_{[\lambda]})$ is the double-well potential. The last two terms represent contributions from the orientation-gradient energy $f_{\mathrm{orie}}$, which couples the orientation field to the phase-field evolution.
Evolution Equation for $\theta$
The crystal-orientation field evolves according to
$$\frac{\partial \theta}{\partial t}
=
M^{\theta}
\,\mathrm{div}
\left[
\left(
\frac{s\, G}{\|\nabla\theta\|}
+
\varepsilon^2 H
\right)
\nabla\theta
\right],$$
where $M^{\theta}$ is the orientation mobility. The first-order term in $|\nabla\theta|$ localizes orientation changes near grain boundaries, while the second-order term smooths spatial variations in the orientation field.
In the three-dimensional extension, the scalar orientation $\theta$ is replaced by a unit quaternion field $q \in S^3$, and $|\nabla\theta|$ is replaced by $|\nabla q|$. A more detailed derivation is provided in the paper.
| File |
Dimension |
Description |
mpfkwc.py |
2D |
KWC-type Multi-phase-field model with scalar orientation field |
mpfkwc_3d.py |
3D |
KWC-type Multi-phase-field model with quaternion-based orientation field |
Clone this repository:
git clone https://github.com/your-name/mpf-kwc-model.git
cd mpf-kwc-model
Install the package and its dependencies using uv:
Two-dimensional analysis
Three-dimensional analysis
Two-dimensional result

Distributions of grains and crystal orientations in static recrystallization analysis (Step No.: (i) 100, (ii) 600, (iii) 1000, (iv) 1700, (v) 2500). (a) Grain number and (b) crystal orientation.
Three-dimensional result

Distributions of grains and crystal orientations in static recrystallization analysis (Step No.: (i) 200, (ii) 600, (iii) 1200, (iv) 1800, (v) 2400). (a) Grain number and (b) IPF-colored crystal orientation.