# Numerical Phase-Field Model Validation for Dissolution of Minerals
## 3 Mathematical Methods
### The Phase-Field (PF) Method  
The total free energy of the thermodynamic system drives changes in the microstructure of materials only when the total free energy changes from a high chemical potential (or a higher free energy) state to a low chemical potential (or a lower free energy) state to eventually attain an equilibrium. The total free energy \(F\) of the system is a function of the solute concentration \(c\) and the phase parameter \(\phi\) and expressed as:  
\[F(c,\phi)=F_{\rm loc}+F_{\rm int}=\int\limits_{V}\left[f_{\rm loc}(c,\phi)+ \frac{k}{2}|\
abla\phi|^{2}\right]dV, \tag{16}\]  
where \(F_{\rm loc}\) is the local free energy of the system, \(F_{\rm int}\) is the interfacial energy, and \(k\) is the gradient energy coefficient. In order to simplify the numerical calculation, the molar concentration of the solute is normalized by the molar concentration of the solid \(c_{\rm S}\), that is, \(c=ct/c_{\rm S}\). The molar concentration of the solid is defined as the density of the solid divided by its average molar mass [77]. Each point in the entire domain is a mixture of two phases with different chemical compositions. The Gibbs free energy expression, in the KKS model, has been widely employed in solidification mechanisms of binary alloys [78; 79], in addition to the recent extension to the field of electrochemical corrosion [61; 68]. The mechanism of the corrosion reaction is similar to that of the dissolution reaction, i.e., both are phase transformations triggered by the diffusion of ions. Hence, the double well potential (i.e., Gibbs free energy density) has two minima at \(\phi=0\), \(\phi=1\) and a maximum at \(\phi=0.5\) (middle of the interface). Based on this theoretical basis, the present model identifies the local free energy \(f_{\rm loc}(c,\phi)\) as a fractionally weighted average of the solid \(f_{\rm S}(c_{\rm S})\) and liquid free energies \(f_{L}(c_{L})\), and imposes a double-well potential \(\omega g(\phi)\) as follows:  
\[f_{\rm loc}(c,\phi)=h(\phi)f_{\rm S}(c_{\rm S})+[1-h(\phi)]f_{\rm L}(c_{\rm L} )+\omega g(\phi), \tag{17}\]  
where the interpolation function \(h(\phi)\) is built as \(h(\phi)=-2\phi^{3}+3\phi^{2}\), and \(\omega\) is the height of the double-well potential function given by \(g(\phi)=\phi^{2}(1-\phi)^{2}\). The free energy density of the solid and liquid phase is approximated by a parabolic function with the same curvature \(A\) as follows:  
\[f_{\rm S}(c_{\rm S}) = A(c_{\rm S}-c_{\rm Se})^{2}, \tag{18}\] \[f_{\rm L}(c_{\rm L}) = A(c_{\rm L}-c_{\rm Le})^{2}, \tag{19}\]  
where \(c_{\rm Se}=c_{\rm S}/c_{\rm S}=1\) and \(c_{\rm Le}=c_{\rm sat}/c_{\rm S}\) are the solute concentrations at the normalized equilibrium of the solid and the liquid phase, respectively. Complementary condition indicates that the phase concentrations are constrained such that the chemical potentials of each phase are equal:  
\[\frac{\partial f_{\rm S}(c_{\rm S})}{\partial c_{\rm S}}=\frac{\partial f_{\rm L }(c_{\rm L})}{\partial c_{\rm L}}. \tag{20}\]  
The solute composition in the interface area is the fraction-weighted average of the liquid and solid composition, and the same formula is used for the diffusion coefficient, as shown below:  
\[c=h(\phi)c_{\rm S}+[1-h(\phi)]c_{\rm L}, \tag{21}\]  
\[D=h(\phi)D_{\rm S}+[1-h(\phi)]D_{\rm L}, \tag{22}\]  
The interfacial evolution is controlled through coupled conserved and non-conserved dynamics. Particularly, the Allen-Cahn equation is used to describe the temporal evolution of the non-conserved variable \(\phi\). However, the diffusion equation is applied for solving the evolution of the conserved parameter \(c\):  
\[\frac{\partial\phi(x,t)}{\partial t}=-L\frac{\delta F}{\delta\phi}=-L\bigg{(} \frac{\partial f(\phi)}{\partial\phi}-k\Delta\phi\bigg{)}, \tag{23}\]  
where \(L\) is the PF mobility:  
\[\frac{\partial c(x,t)}{\partial t}=D\cdot\
abla^{2}c(x,t), \tag{24}\]  
where \(D\) is the diffusion coefficient. The energy of the system is minimal when it reaches equilibrium.