diff --git a/applications/CHAC_anisotropy/CHAC_anisotropy.md b/applications/CHAC_anisotropy/CHAC_anisotropy.md index 932b5d5c3..c1919424a 100644 --- a/applications/CHAC_anisotropy/CHAC_anisotropy.md +++ b/applications/CHAC_anisotropy/CHAC_anisotropy.md @@ -1,4 +1,4 @@ -## PRISMS-PF: CHAC Anisotropy (with Coupled CH-AC Dynamics) +# PRISMS-PF: CHAC Anisotropy (with Coupled CH-AC Dynamics) Consider a free energy expression of the form: $$ diff --git a/applications/CHAC_anisotropyRegularized/CHAC_anisotropyRegularized.md b/applications/CHAC_anisotropyRegularized/CHAC_anisotropyRegularized.md index e03525c51..8be17c483 100644 --- a/applications/CHAC_anisotropyRegularized/CHAC_anisotropyRegularized.md +++ b/applications/CHAC_anisotropyRegularized/CHAC_anisotropyRegularized.md @@ -1,4 +1,4 @@ -## PRISMS PhaseField: Regularized Anisotropy (with Coupled CH-AC Dynamics) +# PRISMS PhaseField: Regularized Anisotropy (with Coupled CH-AC Dynamics) Consider a free energy expression of the form: diff --git a/applications/CHAC_performance_test/formulation_coupledCHAC.md b/applications/CHAC_performance_test/formulation_coupledCHAC.md index 93d40e594..d0500375a 100644 --- a/applications/CHAC_performance_test/formulation_coupledCHAC.md +++ b/applications/CHAC_performance_test/formulation_coupledCHAC.md @@ -1,4 +1,4 @@ -## PRISMS PhaseField: Coupled Cahn-Hilliard and Allen-Cahn Dynamics +# PRISMS PhaseField: Coupled Cahn-Hilliard and Allen-Cahn Dynamics Consider a free energy expression of the form: diff --git a/applications/allenCahn_conserved/allenCahn_conserved.md b/applications/allenCahn_conserved/allenCahn_conserved.md new file mode 100644 index 000000000..22ea5b640 --- /dev/null +++ b/applications/allenCahn_conserved/allenCahn_conserved.md @@ -0,0 +1,183 @@ +# PRISMS PhaseField: Globally Conserved Allen-Cahn Dynamics + +This application performs a phase field simulation of Allen-Cahn dynamics subject to global (as opposed to local) conservation. Global conservation implies that $\int_\Omega \eta \,dV$, where $\Omega$ is the volume of the system, is constant in time. + +Note: This application needs to run with **uniform mesh** in order for the calculation of the chemical potential to be accurate. + +Consider a free energy expression of the form: + +$$ +\begin{equation} + \Pi(\eta, \nabla \eta) = \int_{\Omega} f( \eta ) + \frac{\kappa}{2} \nabla \eta \cdot \nabla \eta ~dV, +\end{equation} +$$ + +where $\eta$ is the structural order parameter, and $\kappa$ is the gradient length scale parameter. + +## Variational treatment + +Considering variations on the primal field $\eta$ of the from $\eta+\epsilon w$, we have + +$$ +\begin{align} +\delta \Pi &= \left. \frac{d}{d\epsilon} \int_{\Omega} f(\eta+\epsilon w) + \frac{\kappa}{2} \nabla (\eta+\epsilon w) \cdot ~\nabla (\eta+\epsilon w) ~dV \right\vert_{\epsilon=0} +\end{align} +$$ + +$$ +\begin{align} +&= \int_{\Omega} w f_{,\eta} + \kappa \nabla w \nabla \eta ~dV +\end{align} +$$ + +$$ +\begin{align} +&= \int_{\Omega} w \left( f_{,\eta} - \kappa \Delta \eta \right) ~dV + \int_{\partial \Omega} w \kappa \nabla \eta \cdot n ~dS, +\end{align} +$$ + +where $f_{,\eta} = \partial f/\partial \eta$. + +Assuming $\kappa \nabla \eta \cdot n = 0$, and using standard variational arguments on the equation $\delta \Pi =0$ we have the expression for chemical potential as + +$$ +\begin{equation} + \mu = f_{,\eta} - \kappa \Delta \eta. +\end{equation} +$$ + +## Kinetics +The Parabolic PDE for Allen-Cahn dynamics is given by: + +$$ +\begin{align} +\frac{\partial \eta}{\partial t} &= -M\mu, +\end{align} +$$ + +where $M$ is the constant mobility. However, the previous equation does not ensure global conservation of $\eta$. In order to achieve global conservation we can add a spatially-uniform term, $A$, to the RHS that effectively offsets the total change in $\eta$ such that $\int_\Omega \partial \eta / \partial t\,dV =0$: + +$$ +\begin{align} +\frac{\partial \eta}{\partial t} &= -M\mu+A. +\end{align} +$$ + +Applying the global conservation constraint to previous equation, we obtain + +$$ +\begin{align} +\int_\Omega \frac{\partial \eta}{\partial t}\,dV &= -\int_\Omega (M\mu-A) \,dV = 0. +\end{align} +$$ + +Since $A$ is spatially uniform and $M$ is a constant, $A$ given by + +$$ +\begin{align} +A &= \frac{M}{V}\int_\Omega \mu \,dV. +\end{align} +$$ + +Subsituting $A$ from + +$$ +\begin{align} +A &= \frac{M}{V}\int_\Omega \mu \,dV. +\end{align} +$$ + +into + +$$ +\begin{align} +\frac{\partial \eta}{\partial t} &= -M\mu+A. +\end{align} +$$ + +we get + +$$ +\begin{align} +\frac{\partial \eta}{\partial t} &= -M(\mu-\bar{\mu}), +\end{align} +$$ + +where $\bar{\mu} = (1/V)\int_\Omega \mu \,dV$. + +## Time discretization +Considering forward Euler explicit time stepping, we have the time discretized kinetics equations: + +$$ +\begin{align} +\eta^{n+1} &= \eta^{n} - \Delta t M(\mu^n-\bar{\mu}^n) +\end{align} +$$ + +and + +$$ +\begin{align} +\mu^{n+1} &= f_{,\eta}^n - \kappa \Delta \eta^n. +\end{align} +$$ + +## Weak formulation +In the weak formulation, considering an arbitrary variation $w$, the above equation can be expressed as a residual equations: + +$$ +\begin{align} +\int_{\Omega} w \eta^{n+1} ~dV&= \int_{\Omega} w [ \eta^{n} - \Delta t M(\mu^n-\bar{\mu}^n) ]~dV +\end{align} +$$ + +$$ +\begin{align} +r_{\eta} &= \eta^{n} - \Delta t M(\mu^n-\bar{\mu}^n) +\end{align} +$$ + +and + +$$ +\begin{align} +\int_{\Omega} w \mu^{n+1} ~dV&= \int_{\Omega} [w f_{,\eta}^n - w \kappa \Delta \eta^{n}]~dV +\end{align} +$$ + +$$ +\begin{align} +&= \int_{\Omega} w ( f_{,\eta}^{n} ) + \nabla w \cdot (\kappa \nabla \eta^{n}) ~dV, +\end{align} +$$ + +$$ +\begin{align} +r_{\mu x} &= \kappa \nabla \eta^{n} +\end{align} +$$ + +$$ +\begin{align} +r_{\mu} &= f_{,\eta}^{n} +\end{align} +$$ + +where the reference chemical potential $\bar{\mu}^n$ for time step $n$ in + +$$ +\begin{align} +\int_{\Omega} w \eta^{n+1} ~dV&= \int_{\Omega} w [ \eta^{n} - \Delta t M(\mu^n-\bar{\mu}^n) ]~dV +\end{align} +$$ + +is calculated as + +$$ +\begin{align} +\bar{\mu}^n& = \frac{1}{V}\int_\Omega \mu^n ~dV. +\end{align} +$$ + +The above values of $r_{\eta}$, $r_{\mu}$, and $r_{\mu x}$ are used to define the residuals in the following parameters file: +`\textit{applications/allenCahn\_conserved/equations.cc` diff --git a/applications/allenCahn_conserved/allenCahn_conserved.pdf b/applications/allenCahn_conserved/allenCahn_conserved.pdf deleted file mode 100644 index 3e501d9a4..000000000 Binary files a/applications/allenCahn_conserved/allenCahn_conserved.pdf and /dev/null differ diff --git a/applications/allenCahn_conserved/tex_files/allenCahn_conserved.tex b/applications/allenCahn_conserved/tex_files/allenCahn_conserved.tex deleted file mode 100644 index 113dc03e5..000000000 --- a/applications/allenCahn_conserved/tex_files/allenCahn_conserved.tex +++ /dev/null @@ -1,261 +0,0 @@ -\documentclass[10pt]{article} -\usepackage{amsmath} -\usepackage{bm} -\usepackage{bbm} -\usepackage{mathrsfs} -\usepackage{graphicx} -\usepackage{wrapfig} -\usepackage{subcaption} -\usepackage{epsfig} -\usepackage{amsfonts} -\usepackage{amssymb} -\usepackage{amsmath} -\usepackage{wrapfig} -\usepackage{graphicx} -\usepackage{psfrag} -\newcommand{\sun}{\ensuremath{\odot}} % sun symbol is \sun -\let\vaccent=\v % rename builtin command \v{} to \vaccent{} -\renewcommand{\v}[1]{\ensuremath{\mathbf{#1}}} % for vectors -\newcommand{\gv}[1]{\ensuremath{\mbox{\boldmath$ #1 $}}} -\newcommand{\grad}[1]{\gv{\nabla} #1} -\renewcommand{\baselinestretch}{1.2} -\jot 5mm -\graphicspath{{./figures/}} -%text dimensions -\textwidth 6.5 in -\oddsidemargin .2 in -\topmargin -0.2 in -\textheight 8.5 in -\headheight 0.2in -\overfullrule = 0pt -\pagestyle{plain} -\def\newpar{\par\vskip 0.5cm} -\begin{document} -% -%---------------------------------------------------------------------- -% Define symbols -%---------------------------------------------------------------------- -% -\def\iso{\mathbbm{1}} -\def\half{{\textstyle{1 \over 2}}} -\def\third{{\textstyle{1 \over 3}}} -\def\fourth{{\textstyle{{1 \over 4}}}} -\def\twothird{{\textstyle {{2 \over 3}}}} -\def\ndim{{n_{\rm dim}}} -\def\nint{n_{\rm int}} -\def\lint{l_{\rm int}} -\def\nel{n_{\rm el}} -\def\nf{n_{\rm f}} -\def\DIV {\hbox{\af div}} -\def\GRAD{\hbox{\af Grad}} -\def\sym{\mathop{\rm sym}\nolimits} -\def\tr{\mathop{\rm tr}\nolimits} -\def\dev{\mathop{\rm dev}\nolimits} -\def\Dev{\mathop{\rm Dev}\nolimits} -\def\DEV{\mathop {\rm DEV}\nolimits} -\def\bfb {{\bi b}} -\def\Bnabla{\nabla} -\def\bG{{\bi G}} -\def\jmpdelu{{\lbrack\!\lbrack \Delta u\rbrack\!\rbrack}} -\def\jmpudot{{\lbrack\!\lbrack\dot u\rbrack\!\rbrack}} -\def\jmpu{{\lbrack\!\lbrack u\rbrack\!\rbrack}} -\def\jmphi{{\lbrack\!\lbrack\varphi\rbrack\!\rbrack}} -\def\ljmp{{\lbrack\!\lbrack}} -\def\rjmp{{\rbrack\!\rbrack}} -\def\sign{{\rm sign}} -\def\nn{{n+1}} -\def\na{{n+\vartheta}} -\def\nna{{n+(1-\vartheta)}} -\def\nt{{n+{1\over 2}}} -\def\nb{{n+\beta}} -\def\nbb{{n+(1-\beta)}} -%--------------------------------------------------------- -% Bold Face Math Characters: -% All In Format: \B***** . -%--------------------------------------------------------- -\def\bOne{\mbox{\boldmath$1$}} -\def\BGamma{\mbox{\boldmath$\Gamma$}} -\def\BDelta{\mbox{\boldmath$\Delta$}} -\def\BTheta{\mbox{\boldmath$\Theta$}} -\def\BLambda{\mbox{\boldmath$\Lambda$}} -\def\BXi{\mbox{\boldmath$\Xi$}} -\def\BPi{\mbox{\boldmath$\Pi$}} -\def\BSigma{\mbox{\boldmath$\Sigma$}} -\def\BUpsilon{\mbox{\boldmath$\Upsilon$}} -\def\BPhi{\mbox{\boldmath$\Phi$}} -\def\BPsi{\mbox{\boldmath$\Psi$}} -\def\BOmega{\mbox{\boldmath$\Omega$}} -\def\Balpha{\mbox{\boldmath$\alpha$}} -\def\Bbeta{\mbox{\boldmath$\beta$}} -\def\Bgamma{\mbox{\boldmath$\gamma$}} -\def\Bdelta{\mbox{\boldmath$\delta$}} -\def\Bepsilon{\mbox{\boldmath$\epsilon$}} -\def\Bzeta{\mbox{\boldmath$\zeta$}} -\def\Beta{\mbox{\boldmath$\eta$}} -\def\Btheta{\mbox{\boldmath$\theta$}} -\def\Biota{\mbox{\boldmath$\iota$}} -\def\Bkappa{\mbox{\boldmath$\kappa$}} -\def\Blambda{\mbox{\boldmath$\lambda$}} -\def\Bmu{\mbox{\boldmath$\mu$}} -\def\Bnu{\mbox{\boldmath$\nu$}} -\def\Bxi{\mbox{\boldmath$\xi$}} -\def\Bpi{\mbox{\boldmath$\pi$}} -\def\Brho{\mbox{\boldmath$\rho$}} -\def\Bsigma{\mbox{\boldmath$\sigma$}} -\def\Btau{\mbox{\boldmath$\tau$}} -\def\Bupsilon{\mbox{\boldmath$\upsilon$}} -\def\Bphi{\mbox{\boldmath$\phi$}} -\def\Bchi{\mbox{\boldmath$\chi$}} -\def\Bpsi{\mbox{\boldmath$\psi$}} -\def\Bomega{\mbox{\boldmath$\omega$}} -\def\Bvarepsilon{\mbox{\boldmath$\varepsilon$}} -\def\Bvartheta{\mbox{\boldmath$\vartheta$}} -\def\Bvarpi{\mbox{\boldmath$\varpi$}} -\def\Bvarrho{\mbox{\boldmath$\varrho$}} -\def\Bvarsigma{\mbox{\boldmath$\varsigma$}} -\def\Bvarphi{\mbox{\boldmath$\varphi$}} -\def\bone{\mathbf{1}} -\def\bzero{\mathbf{0}} -%--------------------------------------------------------- -% Bold Face Math Italic: -% All In Format: \b* . -%--------------------------------------------------------- -\def\bA{\mbox{\boldmath$ A$}} -\def\bB{\mbox{\boldmath$ B$}} -\def\bC{\mbox{\boldmath$ C$}} -\def\bD{\mbox{\boldmath$ D$}} -\def\bE{\mbox{\boldmath$ E$}} -\def\bF{\mbox{\boldmath$ F$}} -\def\bG{\mbox{\boldmath$ G$}} -\def\bH{\mbox{\boldmath$ H$}} -\def\bI{\mbox{\boldmath$ I$}} -\def\bJ{\mbox{\boldmath$ J$}} -\def\bK{\mbox{\boldmath$ K$}} -\def\bL{\mbox{\boldmath$ L$}} -\def\bM{\mbox{\boldmath$ M$}} -\def\bN{\mbox{\boldmath$ N$}} -\def\bO{\mbox{\boldmath$ O$}} -\def\bP{\mbox{\boldmath$ P$}} -\def\bQ{\mbox{\boldmath$ Q$}} -\def\bR{\mbox{\boldmath$ R$}} -\def\bS{\mbox{\boldmath$ S$}} -\def\bT{\mbox{\boldmath$ T$}} -\def\bU{\mbox{\boldmath$ U$}} -\def\bV{\mbox{\boldmath$ V$}} -\def\bW{\mbox{\boldmath$ W$}} -\def\bX{\mbox{\boldmath$ X$}} -\def\bY{\mbox{\boldmath$ Y$}} -\def\bZ{\mbox{\boldmath$ Z$}} -\def\ba{\mbox{\boldmath$ a$}} -\def\bb{\mbox{\boldmath$ b$}} -\def\bc{\mbox{\boldmath$ c$}} -\def\bd{\mbox{\boldmath$ d$}} -\def\be{\mbox{\boldmath$ e$}} -\def\bff{\mbox{\boldmath$ f$}} -\def\bg{\mbox{\boldmath$ g$}} -\def\bh{\mbox{\boldmath$ h$}} -\def\bi{\mbox{\boldmath$ i$}} -\def\bj{\mbox{\boldmath$ j$}} -\def\bk{\mbox{\boldmath$ k$}} -\def\bl{\mbox{\boldmath$ l$}} -\def\bm{\mbox{\boldmath$ m$}} -\def\bn{\mbox{\boldmath$ n$}} -\def\bo{\mbox{\boldmath$ o$}} -\def\bp{\mbox{\boldmath$ p$}} -\def\bq{\mbox{\boldmath$ q$}} -\def\br{\mbox{\boldmath$ r$}} -\def\bs{\mbox{\boldmath$ s$}} -\def\bt{\mbox{\boldmath$ t$}} -\def\bu{\mbox{\boldmath$ u$}} -\def\bv{\mbox{\boldmath$ v$}} -\def\bw{\mbox{\boldmath$ w$}} -\def\bx{\mbox{\boldmath$ x$}} -\def\by{\mbox{\boldmath$ y$}} -\def\bz{\mbox{\boldmath$ z$}} -%********************************* -%Start main paper -%********************************* -\centerline{\Large{\bf PRISMS PhaseField}} -\smallskip -\centerline{\Large{\bf Globally Conserved Allen-Cahn Dynamics}} -\bigskip - -This application performs a phase field simulation of Allen-Cahn dynamics subject to global (as opposed to local) conservation. Global conservation implies that $\int_\Omega \eta \,dV$, where $\Omega$ is the volume of the system, is constant in time. \\ - -Note: This application needs to run with {\bf uniform mesh} in order for the calculation of the chemical potential to be accurate.\\ - -Consider a free energy expression of the form: -\begin{equation} - \Pi(\eta, \grad \eta) = \int_{\Omega} f( \eta ) + \frac{\kappa}{2} \grad \eta \cdot \grad \eta ~dV, -\end{equation} -where $\eta$ is the structural order parameter, and $\kappa$ is the gradient length scale parameter. - -\section{Variational treatment} -Considering variations on the primal field $\eta$ of the from $\eta+\epsilon w$, we have -\begin{align} -\delta \Pi &= \left. \frac{d}{d\epsilon} \int_{\Omega} f(\eta+\epsilon w) + \frac{\kappa}{2} \grad (\eta+\epsilon w) \cdot ~\grad (\eta+\epsilon w) ~dV \right\vert_{\epsilon=0} \\ -&= \int_{\Omega} w f_{,\eta} + \kappa \grad w \grad \eta ~dV \\ -&= \int_{\Omega} w \left( f_{,\eta} - \kappa \Delta \eta \right) ~dV + \int_{\partial \Omega} w \kappa \grad \eta \cdot n ~dS, -\end{align} -where $f_{,\eta} = \partial f/\partial \eta$. -Assuming $\kappa \grad \eta \cdot n = 0$, and using standard variational arguments on the equation $\delta \Pi =0$ we have the expression for chemical potential as -\begin{equation} - \mu = f_{,\eta} - \kappa \Delta \eta. -\end{equation} - -\section{Kinetics} -The Parabolic PDE for Allen-Cahn dynamics is given by: -\begin{align} -\label{AC_dynamics} -\frac{\partial \eta}{\partial t} &= -M\mu, -\end{align} -\noindent where $M$ is the constant mobility. However, Eq.~\eqref{AC_dynamics} does not ensure global conservation of $\eta$. In order to achieve global conservation we can add a spatially-uniform term, $A$, to the RHS of \eqref{AC_dynamics} that effectively offsets the total change in $\eta$ such that $\int_\Omega \partial \eta / \partial t\,dV =0$: -\begin{align} -\label{AC_dynamics_conserved_0} -\frac{\partial \eta}{\partial t} &= -M\mu+A. -\end{align} -Applying the global conservation constraint to Eq.~\eqref{AC_dynamics_conserved_0}, we obtain -\begin{align} -\label{AC_conservation condition} -\int_\Omega \frac{\partial \eta}{\partial t}\,dV &= -\int_\Omega (M\mu-A) \,dV = 0. -\end{align} -Since $A$ is spatially uniform and $M$ is a constant, $A$ given by -\begin{align} -\label{A} -A &= \frac{M}{V}\int_\Omega \mu \,dV. -\end{align} -Subsituting $A$ from Eq.~\eqref{A} into Eq.~\eqref{AC_dynamics_conserved_0} we get -\begin{align} -\label{AC_dynamics_conserved} -\frac{\partial \eta}{\partial t} &= -M(\mu-\bar{\mu}), -\end{align} -where $\bar{\mu} = (1/V)\int_\Omega \mu \,dV$. - -\section{Time discretization} -Considering forward Euler explicit time stepping, we have the time discretized kinetics equations: -\begin{align} -\eta^{n+1} &= \eta^{n} - \Delta t M(\mu^n-\bar{\mu}^n) -\end{align} -and -\begin{align} -\mu^{n+1} &= f_{,\eta}^n - \kappa \Delta \eta^n. -\end{align} -\section{Weak formulation} -In the weak formulation, considering an arbitrary variation $w$, the above equation can be expressed as a residual equations: -\begin{align} -\label{weakform_eta} -\int_{\Omega} w \eta^{n+1} ~dV&= \int_{\Omega} w [ \underbrace{ \eta^{n} - \Delta t M(\mu^n-\bar{\mu}^n)}_{r_{\eta}} ]~dV -\end{align} -and -\begin{align} -\int_{\Omega} w \mu^{n+1} ~dV&= \int_{\Omega} [w f_{,\eta}^n - w \kappa \Delta \eta^{n}]~dV \\ -&= \int_{\Omega} w ( \underbrace{ f_{,\eta}^{n} }_{r_{\mu}} ) + \grad w \cdot\underbrace{ (\kappa \grad \eta^{n})}_{r_{\mu x}} ~dV, -\end{align} -where the reference chemical potential $\bar{\mu}^n$ for time step $n$ in Eq.~\eqref{weakform_eta} is calculated as -\begin{align} -\bar{\mu}^n& = \frac{1}{V}\int_\Omega \mu^n ~dV. -\end{align} -\vskip 0.25in -The above values of $r_{\eta}$, $r_{\mu}$, and $r_{\mu x}$ are used to define the residuals in the following parameters file:\\ -\textit{applications/allenCahn\_conserved/equations.cc} -\end{document} \ No newline at end of file diff --git a/applications/alloySolidification/alloySolidification.md b/applications/alloySolidification/alloySolidification.md new file mode 100644 index 000000000..0507f6226 --- /dev/null +++ b/applications/alloySolidification/alloySolidification.md @@ -0,0 +1,388 @@ +# PRISMS-PF Application Formulation: alloySolidification + +This example application [1] implements a simple model to simulate the directional solidification of a binary alloy A-B in the dilute limit with component B acting as a solute in a matrix of A. +The implemented model was introduced by Echebarria et al. [2] in 2004. In this model, latent heat is assumed to diffuse much faster than impurities and, therefore, the temperature field is considered +to be fixed by external conditions. In the default settings of the application, the simulation starts with a circular solid in the corner of an elongated system which evolves as a system is cooled under +a uniform thermal gradient and constant cooling rate. As this seed grows, three variables are tracked: an order parameter, $\phi$, that denotes whether the material is a liquid ($\phi=-1$) or solid ($\phi=1$), +a dimensionless supersaturation, $U$, and an auxiliary term, $\xi$. In addition, a solute concentration variable, $c$, is calculated during post-processing and outputted along with the aforementioned variables. + +## Model +Consider a free energy expression given by: + +$$ +\begin{equation} +\mathcal{F}[\phi,c,T]= \int_{\Omega} \left[\frac{\sigma}{2}|\nabla \phi|^2 +f(\phi, T_m) + f_{AB}(\phi, c, T) \right] ~dV, +\end{equation} +$$ + +where $\sigma$ is penalty coefficient for phase gradients. The term $f(\phi, T_m)$ is a symmetric double-well potential evaluated at the melting temperature of the pure material (A), $T_m$, and the term $f_{AB}(\phi, c, T)$ accounts for the relative stability of the liquid and solid phases at different temperatures, according to the phase diagram. The double-well potential has the standard form with height $H$ given by + +$$ +\begin{equation} +f(\phi, T_m) = H(-\phi^2/2 + \phi^4/4). +\end{equation} +$$ + +For a dilute binary alloy, $f_{AB}$ can be written as + +$$ +\begin{equation} +f_{AB}(\phi, c, T) = f^A(T_m) - (T-T_m) s(\phi) + \frac{R T_m}{v_o}(c\ln c -c) +\epsilon (\phi) c, +\end{equation} +$$ + +where $f^A(T_m)$ is the free energy density of pure A at its melting point, $v_0$ is the molar volume of A and $R$ is the gas constant. The functions $s(\phi)$ and $\epsilon(\phi)$ are interpolation functions for the entropy and internal energy of the solid and liquid phases, respectively. The general form of the coupled governing equations for the $\phi$ and $c$ is + +$$ +\begin{equation} +\frac{\partial \phi}{\partial t} = -K_\phi \frac{\delta \mathcal{F}}{\delta \phi} +\end{equation} +$$ + +and + +$$ +\begin{equation} +\frac{\partial c}{\partial t} = \nabla \cdot \left(\ M(\phi,c) \frac{\delta \mathcal{F}}{\delta c} - \vec{\jmath}_{at} \right), +\end{equation} +$$ + +where $K_\phi$ is a kinetic constant, $M(\phi,c)$ is the mobility of solute atoms and $\vec{\jmath}_{at}$ is a nonvariational anti-trapping solute current required to correct for spurious effects that arise from considering an interface thickness much larger than the physical solid-liquid interface. In the dilute limit, the solidus and liquidus lines of the $T$ vs. $c$ phase diagram are defined by the equations + +$$ +\begin{equation} +T_l=T_m-|m|c_l +\end{equation} +$$ + +and + +$$ +\begin{equation} +T_s=T_m-\frac{|m|}{k}c_s, +\end{equation} +$$ + +where $m$ is the liquidus slope and $k=c_s/c_l$ is the partition coefficient, which relates the equilibrium concentrations, $c_l$ and $c_s$, of the liquid and solid, respectively. + +For the governing equations to simulate directional solidification, we follow the same approach of Ref. [2] by introducing a dimensionless supersaturation, $U$, instead of $c$. This supersaturation term is defined as + +$$ +\begin{equation} +U = \frac{e^u -1}{1-k}, +\end{equation} +$$ + +where + +$$ +\begin{equation} +u(c,\phi) = \ln \left( \frac{2c}{c_l^0[1+k-(1-k)\phi]}\right). +\end{equation} +$$ + +The constant $c_l^0$, is the equilibrium liquidus concentration at reference temperature, $T_0$. We define it as $c_l^0 = c_\infty /k$, where $c_\infty$ is the concentration of the liquid far from the solid-liquid interface (equal to the average concentration of the alloy). Thus, the reference temperature is given by $T_0=T_m - |m|c_l^0 =T_m-|m|c_\infty/k$. + +## Governing Equations +After nondimensionalization (see Ref. [2] for derivation), the governing equations (in 2D) for $\phi$ and $U$ are given by + +$$ +\begin{equation} +\tau_\phi\frac{\partial \phi}{\partial t} = \xi(\phi,U) +\end{equation} +$$ + +and + +$$ +\begin{equation} +\tau_U\frac{\partial U}{\partial t} = \nabla \cdot \left[ \tilde{D} \frac{1-\phi}{2} \nabla U - \vec{\jmath}_{at}^{\,U} \right] + \frac{1}{2}[1+(1-k)U]\frac{\partial \phi}{\partial t}, +\end{equation} +$$ + +where + +$$ +\begin{align} +\tau_\phi=[1+(1-k) U ]a_s^2(\hat{n}), +\end{align} +$$ + +$$ +\begin{align} +\tau_U=\frac{1+k}{2} - \frac{1-k}{2}\phi, +\end{align} +$$ + +$$ +\begin{align} +\xi = & \nabla \cdot \left( a_s^2(\hat{n}) \nabla \phi \right) &+ \frac{\partial}{\partial x} \left[ |\nabla \phi|^2 a_s(\hat{n}) \frac{\partial a_s(\hat{n})}{\partial \left( \frac{\partial \phi}{\partial x} \right)} \right] +&+ \frac{\partial}{\partial y} \left[ |\nabla \phi|^2 a_s(\hat{n}) \frac{\partial a_s(\hat{n})}{\partial \left( \frac{\partial \phi}{\partial y} \right)} \right] +\end{align} +$$ + +$$ +\begin{align} +& +\phi-\phi^3 - \lambda(1-\phi^2)^2 \left[ U + U_\text{off} + \frac{\tilde{y} - \tilde{y}_0 - \tilde{V}_p t}{\tilde{l}_T} \right], +\end{align} +$$ + +and + +$$ +\begin{equation} +\vec{\jmath}_{at}^{\,U}=\frac{1}{2\sqrt{2}}[1+(1-k)U]\hat{n}\frac{\partial \phi}{\partial t}. +\end{equation} +$$ + +The function $a_s$ is the anisotropy factor for the solid-liquid interfacial energy, which depends on the outward normal (with respect to the solid) of the interface, +$\hat{n}=-\nabla \phi / |\nabla \phi|$. For a solid phase with $m$-fold symmetry this factor is given by + +$$ +\begin{equation} +a_s(\hat{n})=1+\epsilon_m \cos[m(\theta-\theta_0)], +\end{equation} +$$ + +(In the implementation of the current model, $m$ is set to 4 and $\theta_0=0$. For the purpose of computational efficiency, explicit calculation of trigonometric functions (and their inverse) is avoided. Thus, all sine and cosine terms with argument $m\theta$ are evaluated as $\sin(m\theta)=4\cos^3\theta\sin\theta-4\cos\theta\sin^3\theta$ and $\cos(m\theta)=\cos^4\theta -6\cos^2\theta\sin^2\theta-\sin^4\theta$, where $\sin\theta=\partial_y\phi / |\nabla \phi|$ and $\cos\theta=\partial_x\phi / |\nabla \phi|$.) + +where $\epsilon_m$ determines the strength of the anisotropy, $\theta$ is the in-plane azimuthal angle of the normal vector with respect to the positive $x$-direction and $\theta_0$ is the reference orientation of the solid grains. The angle $\theta$ is related to the normal derivatives of $\phi$ at the interface via + +$$ +\begin{equation} +\tan(\theta) = \frac{\partial \phi / \partial y}{\partial \phi / \partial x}. +\end{equation} +$$ + +In + +$$ +\begin{align} +\xi = & \nabla \cdot \left( a_s^2(\hat{n}) \nabla \phi \right) &+ \frac{\partial}{\partial x} \left[ |\nabla \phi|^2 a_s(\hat{n}) \frac{\partial a_s(\hat{n})}{\partial \left( \frac{\partial \phi}{\partial x} \right)} \right] +&+ \frac{\partial}{\partial y} \left[ |\nabla \phi|^2 a_s(\hat{n}) \frac{\partial a_s(\hat{n})}{\partial \left( \frac{\partial \phi}{\partial y} \right)} \right] +\end{align} +$$ + +$$ +\begin{align} +& +\phi-\phi^3 - \lambda(1-\phi^2)^2 \left[ U + U_\text{off} + \frac{\tilde{y} - \tilde{y}_0 - \tilde{V}_p t}{\tilde{l}_T} \right], +\end{align} +$$ + +$\lambda$ is a coupling constant defined as $\lambda=5\sqrt{2}W/(8d_0)$, where $W=(\sigma/H)^{1/2}$ is the equilibrium interface width and $d_0$ is the chemical capillary length, given by + +$$ +\begin{equation} +d_0=\frac{\gamma T_m}{L |m| (1-k) c_l^0}. +\end{equation} +$$ + +In the previous equation, $\gamma$ is the equilibrium surface tension and $L$ is the latent heat of fusion per volume. +Finally, $\tilde{y}$, $\tilde{V}_p$, $\tilde{l}_T$ and $\tilde{D}$ are all dimensionless parameters, calculated by taking the unit length as $W$ and the unit time as $\tau_0=0.6267\lambda W^2/D$, +where $D$ is the solute diffusivity in the liquid. The coordinate, $\tilde{y}$, represents the position along the direction of the thermal gradient, $\tilde{V}_p$ is the steady-state solidification speed, +$\tilde{l}_T$ is the thermal length, calculated as + +$$ +\begin{align} +\tilde{l}_T=|m|(1-k)c_l^0/\tilde{G} +\end{align} +$$ + + +where $\tilde{G}$ is the dimensionless thermal gradient, and $\tilde{D}$ is the dimensionless solute diffusivity in the liquid. Note that Eqs. 10 through 15 +are equivalent to Eqs. (132) and (133) from Ref. [2], except for the expression for the phase-field relaxation time $\tau_\phi$ which, for this application, was chosen to be $U$-dependent, +as defined by Eq. (123) from Ref. [2]. + + +Equation + +$$ +\begin{align} +\xi = & \nabla \cdot \left( a_s^2(\hat{n}) \nabla \phi \right) &+ \frac{\partial}{\partial x} \left[ |\nabla \phi|^2 a_s(\hat{n}) \frac{\partial a_s(\hat{n})}{\partial \left( \frac{\partial \phi}{\partial x} \right)} \right] +&+ \frac{\partial}{\partial y} \left[ |\nabla \phi|^2 a_s(\hat{n}) \frac{\partial a_s(\hat{n})}{\partial \left( \frac{\partial \phi}{\partial y} \right)} \right] +\end{align} +$$ + +$$ +\begin{align} +& +\phi-\phi^3 - \lambda(1-\phi^2)^2 \left[ U + U_\text{off} + \frac{\tilde{y} - \tilde{y}_0 - \tilde{V}_p t}{\tilde{l}_T} \right], +\end{align} +$$ + +can be simplified by explicitly writing $a_s(\hat{n})$ in terms of $\theta$. We can evaluate the terms $\partial a_s(\theta)/\partial \left( \frac{\partial \phi}{\partial x} \right)$ and $\partial a_s(\theta)/\partial \left( \frac{\partial \phi}{\partial y} \right)$ by using the chain rule, i.e., + +$$ +\begin{align} +\frac{\partial a_s(\theta)}{\partial \left( \frac{\partial \phi}{\partial x} \right)}=\frac{\partial a_s(\theta)}{\partial \theta} \frac{\partial \theta}{\partial \left( \frac{\partial \phi}{\partial x} \right)}\ \mathrm{and}\ \frac{\partial a_s(\theta)}{\partial \left( \frac{\partial \phi}{\partial y} \right)}=\frac{\partial a_s(\theta)}{\partial \theta} \frac{\partial \theta}{\partial \left( \frac{\partial \phi}{\partial y} \right)} +\end{align} +$$ + +along with + +$$ +\begin{equation} +\tan(\theta) = \frac{\partial \phi / \partial y}{\partial \phi / \partial x}. +\end{equation} +$$ + +Also, the second and third terms on the right-hand side can be expressed using a divergence operator, allowing them to be grouped with the first term, which will simplify matters later. Carrying out these transformations yields: + +$$ +\begin{align} +\xi = & \nabla \cdot \left[ \left(a_s^2(\theta) \frac{\partial \phi}{\partial x} + \epsilon_m m a_s(\theta) \sin \left[ m \left(\theta - \theta_0 \right) \right] \frac{\partial \phi}{\partial y}\right)\hat{x} \right. +\end{align} +$$ + +$$ +\begin{align} +& \left . + \left(a_s^2(\theta) \frac{\partial \phi}{\partial y} - \epsilon_m m a_s(\theta) \sin \left[ m \left(\theta - \theta_0 \right) \right] \frac{\partial \phi}{\partial x}\right)\hat{y}\right] +\end{align} +$$ + +$$ +\begin{align} +&+ \phi-\phi^3 - \lambda{(1-\phi^2)}^2 \left[ U + U_\text{off} + \frac{\tilde{y} - \tilde{y}_0 - \tilde{V}_p t}{\tilde{l}_T} \right]. +\end{align} +$$ + +## Model Constants + +- $\epsilon$: Strength of the anisotropy ($\epsilon_4$ for a solid with fourfold anisotropy) +- $k$: Partition coefficient +- $c_0$: Initial liquid concentration ($c_\infty$) +- $\lambda$: Coupling constant (setting this value fixes the interface width) +- $\tilde{D}$: Dimensionless solute diffusivity in the liquid phase. +- $\tilde{V}_p$: Dimensionless steady-state velocity of the tip. +- $\tilde{l}_T$: Dimensionless thermal length. +- $U_0$: Initial constitutional undercooling of the system ($U_0=-1$ sets the concentration of the liquid as $c_\infty$ and of the solid as $kc_\infty$) +- $U_{\text{off}}$: Undercooling offset that determines the initial temperature at the interface ($U_{\text{off}}=0$ sets it to the solidus temperature, $U_{\text{off}}=1$ sets it to the liquidus temperature). +- $\tilde{y}_0$: Initial solid-liquid interface position relative to the bottom of the system ($\tilde{y}=0$) + + +## Time Discretization +Considering forward Euler explicit time stepping, we have the time-discretized kinetics equations: + +$$ +\begin{equation} +\phi^{n+1}=\phi^{n} + \frac{\xi^n}{\tau_\phi}\Delta t, +\end{equation} +$$ + +$$ +\begin{align} +U^{n+1}=U^{n}+\frac{\Delta t}{\tau_U}\left[\nabla \cdot \left( \tilde{D}\frac{1-\phi^n}{2} \nabla U^n - \vec{\jmath_{at}}^{\ U} \right) + \frac{1}{2}[1+(1-k)U^n]\frac{\xi^n}{\tau_\phi} \right\], +\end{align} +$$ + +and + +$$ +\begin{align} +\xi^{n+1} = & \nabla \cdot \left[ \left(a_s^2(\theta^n) \frac{\partial \phi^n}{\partial x} + \epsilon_m m a_s(\theta^n) \sin \left[ m \left(\theta^n - \theta_0 \right) \right] \frac{\partial \phi^n}{\partial y}\right)\hat{x} \right. +\end{align} +$$ + +$$ +\begin{align} +& \left . + \left(a_s^2(\theta^n) \frac{\partial \phi^n}{\partial y} - \epsilon_m m a_s(\theta^n) \sin \left[ m \left(\theta^n - \theta_0 \right) \right] \frac{\partial \phi^n}{\partial x}\right)\hat{y}\right] +\end{align} +$$ + +$$ +\begin{align} +& +\phi^n-{(\phi^n)}^3 - \lambda {\left[1-{(\phi^n)}^2\right]}^2 \left[ U^n + U_\text{off} + \frac{\tilde{y} - \tilde{y}_0 - \tilde{V}_p t}{\tilde{l}_T} \right]. +\end{align} +$$ + +## Weak Formulation +The weak formulation is obtained by multiplying the time-discretized equations by test function, $\omega$, and integrating over the volume, $\Omega$. For $\phi$ we get + +$$ +\begin{align} +\int_{\Omega} \omega \phi^{n+1} ~dV = \int_{\Omega} \omega \left(\phi^n + \frac{ \xi^n}{\tau_\phi}\Delta t\right) ~dV. +\end{align} +$$ + +$$ +\begin{align} +r_{\phi} &= \left(\phi^n + \frac{ \xi^n}{\tau_\phi}\Delta t\right) +\end{align} +$$ + + +For the weak form of + +$$ +\begin{align} +U^{n+1}=U^{n}+\frac{\Delta t}{\tau_U}\left[\nabla \cdot \left( \tilde{D}\frac{1-\phi^n}{2} \nabla U^n - \vec{\jmath_{at}}^{\ U} \right) + \frac{1}{2}[1+(1-k)U^n]\frac{\xi^n}{\tau_\phi} \right\], +\end{align} +$$ + +we employ the relation $\nabla \frac{1}{\tau_U}=\frac{1}{\tau_U^2}\frac{1-k}{2}\nabla\phi$ that results from substituting $\tau$ as defined by + +$$ +\begin{align} +\tau_U=\frac{1+k}{2} - \frac{1-k}{2}\phi, +\end{align} +$$ + +into the gradient of $1/\tau_U$: + +$$ +\begin{align} +\int_{\Omega} \omega U^{n+1} ~dV =& +\int_{\Omega} \omega \left( U^{n} + \frac{\Delta t}{2\tau_U\tau_\phi}[1+(1-k)U^n]\xi^n - \frac{\Delta t (1-k)}{2\tau_U^2} \nabla \phi \cdot \left[\tilde{D}\frac{1-\phi^n}{2}\nabla U^n-\vec{\jmath}_{at}^{\,U}\right] \right) ~dV +\end{align} +$$ + +$$ +\begin{align} +&+\int_{\Omega} \nabla \omega \cdot \left( -\frac{\Delta t}{\tau_U}\left[\tilde{D}(1-\phi^n)\nabla U^n-\vec{\jmath}_{at}^{\,U}\right] \right) ~dV. +\end{align} +$$ + +$$ +\begin{align} +r_U &= \left( U^{n} + \frac{\Delta t}{2\tau_U\tau_\phi}[1+(1-k)U^n]\xi^n - \frac{\Delta t (1-k)}{2\tau_U^2} \nabla \phi \cdot \left[\tilde{D}\frac{1-\phi^n}{2}\nabla U^n-\vec{\jmath}_{at}^{\,U}\right] \right) +\end{align} +$$ + +$$ +\begin{align} +r_{Ux} &= \left( -\frac{\Delta t}{\tau_U}\left[\tilde{D}(1-\phi^n)\nabla U^n-\vec{\jmath}_{at}^{\,U}\right] \right) +\end{align} +$$ + +Finally, for $\xi$, we obtain + +$$ +\begin{equation} +\int_{\Omega} \omega \xi^{n+1} ~dV =\int_{\Omega} \omega r_\xi ~dV + \int_{\Omega} \nabla \omega r_{\xi x} ~dV, +\end{equation} +$$ + +where + +$$ +\begin{equation} +r_\xi= \phi^n-(\phi^n)^3 - \lambda \left[1-(\phi^n)^2\right]^2 \left[ U^n + U_\text{off} + \frac{\tilde{y} - \tilde{y}_0 - \tilde{V}_p t}{\tilde{l}_T} \right] +\end{equation} +$$ + +$$ +\begin{equation} +\begin{split} +r_{\xi x}= &-\left[a_s^2(\theta^n) \frac{\partial \phi^n}{\partial x} + \epsilon_m m a_s(\theta^n) \sin \left[ m \left(\theta^n - \theta_0 \right) \right] \frac{\partial \phi^n}{\partial y}\right]\hat{x}\\ +&-\left[a_s^2(\theta^n) \frac{\partial \phi^n}{\partial y} - \epsilon_m m a_s(\theta^n) \sin \left[ m \left(\theta^n - \theta_0 \right) \right] \frac{\partial \phi^n}{\partial x}\right]\hat{y} +\end{split} +\end{equation} +$$ + + +The above values of $r_{\phi}$, $r_{U}$, $r_{Ux}$, $r_{\xi}$ and $r_{\xi x}$ are used to define the residuals in the following parameters file: +`\textit{applications/alloySolification/equations.cc}` + +## References +[1] Developed by Zhenjie Yao, Department of Material Science and Engineering, University of Michigan (2021). + +[2] B. Echebarria, R. Folch, A. Karma, and M. Plapp, Quantitative phase-field model of alloy solidification, *Phys. Rev. E* **70**, 061604 (2004). diff --git a/applications/alloySolidification/alloySolidification.pdf b/applications/alloySolidification/alloySolidification.pdf deleted file mode 100644 index 4a5ad5854..000000000 Binary files a/applications/alloySolidification/alloySolidification.pdf and /dev/null differ diff --git a/applications/alloySolidification/tex_files/alloySolidification.tex b/applications/alloySolidification/tex_files/alloySolidification.tex deleted file mode 100644 index 48ec1493a..000000000 --- a/applications/alloySolidification/tex_files/alloySolidification.tex +++ /dev/null @@ -1,361 +0,0 @@ -\documentclass[10pt]{article} -\usepackage{amsmath} -\usepackage{bm} -%\usepackage{bbm} -\usepackage{mathrsfs} -\usepackage{graphicx} -%\usepackage{wrapfig} -\usepackage{subcaption} -\usepackage{epsfig} -\usepackage{amsfonts} -\usepackage{amssymb} -\usepackage{amsmath} -\usepackage{graphicx} -\usepackage{psfrag} -\usepackage{cleveref} -\newcommand{\sun}{\ensuremath{\odot}} % sun symbol is \sun -\let\vaccent=\v % rename builtin command \v{} to \vaccent{} -\renewcommand{\v}[1]{\ensuremath{\mathbf{#1}}} % for vectors -\newcommand{\gv}[1]{\ensuremath{\mbox{\boldmath$ #1 $}}} -\newcommand{\grad}[1]{\gv{\nabla} #1} -\renewcommand{\baselinestretch}{1.2} -\jot 5mm -\graphicspath{{./figures/}} -%text dimensions -\textwidth 6.5 in -\oddsidemargin .2 in -\topmargin -0.2 in -\textheight 8.5 in -\headheight 0.2in -\overfullrule = 0pt -\pagestyle{plain} -\def\newpar{\par\vskip 0.5cm} -\begin{document} -% -%---------------------------------------------------------------------- -% Define symbols -%---------------------------------------------------------------------- -% -\def\iso{\mathbbm{1}} -\def\half{{\textstyle{1 \over 2}}} -\def\third{{\textstyle{1 \over 3}}} -\def\fourth{{\textstyle{{1 \over 4}}}} -\def\twothird{{\textstyle {{2 \over 3}}}} -\def\ndim{{n_{\rm dim}}} -\def\nint{n_{\rm int}} -\def\lint{l_{\rm int}} -\def\nel{n_{\rm el}} -\def\nf{n_{\rm f}} -\def\DIV {\hbox{\af div}} -\def\GRAD{\hbox{\af Grad}} -\def\sym{\mathop{\rm sym}\nolimits} -\def\tr{\mathop{\rm tr}\nolimits} -\def\dev{\mathop{\rm dev}\nolimits} -\def\Dev{\mathop{\rm Dev}\nolimits} -\def\DEV{\mathop {\rm DEV}\nolimits} -\def\bfb {{\bi b}} -\def\Bnabla{\nabla} -\def\bG{{\bi G}} -\def\jmpdelu{{\lbrack\!\lbrack \Delta u\rbrack\!\rbrack}} -\def\jmpudot{{\lbrack\!\lbrack\dot u\rbrack\!\rbrack}} -\def\jmpu{{\lbrack\!\lbrack u\rbrack\!\rbrack}} -\def\jmphi{{\lbrack\!\lbrack\varphi\rbrack\!\rbrack}} -\def\ljmp{{\lbrack\!\lbrack}} -\def\rjmp{{\rbrack\!\rbrack}} -\def\sign{{\rm sign}} -\def\nn{{n+1}} -\def\na{{n+\vartheta}} -\def\nna{{n+(1-\vartheta)}} -\def\nt{{n+{1\over 2}}} -\def\nb{{n+\beta}} -\def\nbb{{n+(1-\beta)}} -%--------------------------------------------------------- -% Bold Face Math Characters: -% All In Format: \B***** . -%--------------------------------------------------------- -\def\bOne{\mbox{\boldmath$1$}} -\def\BGamma{\mbox{\boldmath$\Gamma$}} -\def\BDelta{\mbox{\boldmath$\Delta$}} -\def\BTheta{\mbox{\boldmath$\Theta$}} -\def\BLambda{\mbox{\boldmath$\Lambda$}} -\def\BXi{\mbox{\boldmath$\Xi$}} -\def\BPi{\mbox{\boldmath$\Pi$}} -\def\BSigma{\mbox{\boldmath$\Sigma$}} -\def\BUpsilon{\mbox{\boldmath$\Upsilon$}} -\def\BPhi{\mbox{\boldmath$\Phi$}} -\def\BPsi{\mbox{\boldmath$\Psi$}} -\def\BOmega{\mbox{\boldmath$\Omega$}} -\def\Balpha{\mbox{\boldmath$\alpha$}} -\def\Bbeta{\mbox{\boldmath$\beta$}} -\def\Bgamma{\mbox{\boldmath$\gamma$}} -\def\Bdelta{\mbox{\boldmath$\delta$}} -\def\Bepsilon{\mbox{\boldmath$\epsilon$}} -\def\Bzeta{\mbox{\boldmath$\zeta$}} -\def\Beta{\mbox{\boldmath$\eta$}} -\def\Btheta{\mbox{\boldmath$\theta$}} -\def\Biota{\mbox{\boldmath$\iota$}} -\def\Bkappa{\mbox{\boldmath$\kappa$}} -\def\Blambda{\mbox{\boldmath$\lambda$}} -\def\Bmu{\mbox{\boldmath$\mu$}} -\def\Bnu{\mbox{\boldmath$\nu$}} -\def\Bxi{\mbox{\boldmath$\xi$}} -\def\Bpi{\mbox{\boldmath$\pi$}} -\def\Brho{\mbox{\boldmath$\rho$}} -\def\Bsigma{\mbox{\boldmath$\sigma$}} -\def\Btau{\mbox{\boldmath$\tau$}} -\def\Bupsilon{\mbox{\boldmath$\upsilon$}} -\def\Bphi{\mbox{\boldmath$\phi$}} -\def\Bchi{\mbox{\boldmath$\chi$}} -\def\Bpsi{\mbox{\boldmath$\psi$}} -\def\Bomega{\mbox{\boldmath$\omega$}} -\def\Bvarepsilon{\mbox{\boldmath$\varepsilon$}} -\def\Bvartheta{\mbox{\boldmath$\vartheta$}} -\def\Bvarpi{\mbox{\boldmath$\varpi$}} -\def\Bvarrho{\mbox{\boldmath$\varrho$}} -\def\Bvarsigma{\mbox{\boldmath$\varsigma$}} -\def\Bvarphi{\mbox{\boldmath$\varphi$}} -\def\bone{\mathbf{1}} -\def\bzero{\mathbf{0}} -%--------------------------------------------------------- -% Bold Face Math Italic: -% All In Format: \b* . -%--------------------------------------------------------- -\def\bA{\mbox{\boldmath$ A$}} -\def\bB{\mbox{\boldmath$ B$}} -\def\bC{\mbox{\boldmath$ C$}} -\def\bD{\mbox{\boldmath$ D$}} -\def\bE{\mbox{\boldmath$ E$}} -\def\bF{\mbox{\boldmath$ F$}} -\def\bG{\mbox{\boldmath$ G$}} -\def\bH{\mbox{\boldmath$ H$}} -\def\bI{\mbox{\boldmath$ I$}} -\def\bJ{\mbox{\boldmath$ J$}} -\def\bK{\mbox{\boldmath$ K$}} -\def\bL{\mbox{\boldmath$ L$}} -\def\bM{\mbox{\boldmath$ M$}} -\def\bN{\mbox{\boldmath$ N$}} -\def\bO{\mbox{\boldmath$ O$}} -\def\bP{\mbox{\boldmath$ P$}} -\def\bQ{\mbox{\boldmath$ Q$}} -\def\bR{\mbox{\boldmath$ R$}} -\def\bS{\mbox{\boldmath$ S$}} -\def\bT{\mbox{\boldmath$ T$}} -\def\bU{\mbox{\boldmath$ U$}} -\def\bV{\mbox{\boldmath$ V$}} -\def\bW{\mbox{\boldmath$ W$}} -\def\bX{\mbox{\boldmath$ X$}} -\def\bY{\mbox{\boldmath$ Y$}} -\def\bZ{\mbox{\boldmath$ Z$}} -\def\ba{\mbox{\boldmath$ a$}} -\def\bb{\mbox{\boldmath$ b$}} -\def\bc{\mbox{\boldmath$ c$}} -\def\bd{\mbox{\boldmath$ d$}} -\def\be{\mbox{\boldmath$ e$}} -\def\bff{\mbox{\boldmath$ f$}} -\def\bg{\mbox{\boldmath$ g$}} -\def\bh{\mbox{\boldmath$ h$}} -\def\bi{\mbox{\boldmath$ i$}} -\def\bj{\mbox{\boldmath$ j$}} -\def\bk{\mbox{\boldmath$ k$}} -\def\bl{\mbox{\boldmath$ l$}} -\def\bm{\mbox{\boldmath$ m$}} -\def\bn{\mbox{\boldmath$ n$}} -\def\bo{\mbox{\boldmath$ o$}} -\def\bp{\mbox{\boldmath$ p$}} -\def\bq{\mbox{\boldmath$ q$}} -\def\br{\mbox{\boldmath$ r$}} -\def\bs{\mbox{\boldmath$ s$}} -\def\bt{\mbox{\boldmath$ t$}} -\def\bu{\mbox{\boldmath$ u$}} -\def\bv{\mbox{\boldmath$ v$}} -\def\bw{\mbox{\boldmath$ w$}} -\def\bx{\mbox{\boldmath$ x$}} -\def\by{\mbox{\boldmath$ y$}} -\def\bz{\mbox{\boldmath$ z$}} -%********************************* -%Start main paper -%********************************* -\centerline{\Large{\bf PRISMS-PF Application Formulation:}} -\smallskip -\centerline{\Large{\bf alloySolidification}} -\bigskip - -This example application~\cite{Yao2021} implements a simple model to simulate the directional solidification of a binary alloy A-B in the dilute limit with component B acting as a solute in a matrix of A. The implemented model was introduced by Echebarria et al.~\cite{Echebarria2004} in 2004. In this model, latent heat is assumed to diffuse much faster than impurities and, therefore, the temperature field is considered to be fixed by external conditions. In the default settings of the application, the simulation starts with a circular solid in the corner of an elongated system which evolves as a system is cooled under a uniform thermal gradient and constant cooling rate. As this seed grows, three variables are tracked: an order parameter, $\phi$, that denotes whether the material is a liquid ($\phi=-1$) or solid ($\phi=1$), a dimensionless supersaturation, $U$, and an auxiliary term, $\xi$. In addition, a solute concentration variable, $c$, is calculated during post-processing and outputted along with the aforementioned variables. - -\section{Model} -Consider a free energy expression given by: - -\begin{equation} -\mathcal{F}[\phi,c,T]= \int_{\Omega} \left[\frac{\sigma}{2}|\nabla \phi|^2 +f(\phi, T_m) + f_{AB}(\phi, c, T) \right] ~dV, -\end{equation} -where $\sigma$ is penalty coefficient for phase gradients. The term $f(\phi, T_m)$ is a symmetric double-well potential evaluated at the melting temperature of the pure material (A), $T_m$, and the term $f_{AB}(\phi, c, T)$ accounts for the relative stability of the liquid and solid phases at different temperatures, according to the phase diagram. The double-well potential has the standard form with height $H$ given by -\begin{equation} -f(\phi, T_m) = H(-\phi^2/2 + \phi^4/4). -\end{equation} -For a dilute binary alloy, $f_{AB}$ can be written as -\begin{equation} -f_{AB}(\phi, c, T) = f^A(T_m) - (T-T_m) s(\phi) + \frac{R T_m}{v_o}(c\ln c -c) +\epsilon (\phi) c, -\end{equation} -where $f^A(T_m)$ is the free energy density of pure A at its melting point, $v_0$ is the molar volume of A and $R$ is the gas constant. The functions $s(\phi)$ and $\epsilon(\phi)$ are interpolation functions for the entropy and internal energy of the solid and liquid phases, respectively. The general form of the coupled governing equations for the $\phi$ and $c$ is -\begin{equation} -\frac{\partial \phi}{\partial t} = -K_\phi \frac{\delta \mathcal{F}}{\delta \phi} -\end{equation} -and -\begin{equation} -\frac{\partial c}{\partial t} = \nabla \cdot \left(\ M(\phi,c) \frac{\delta \mathcal{F}}{\delta c} - \vec{\jmath}_{at} \right), -\end{equation} -where $K_\phi$ is a kinetic constant, $M(\phi,c)$ is the mobility of solute atoms and $\vec{\jmath}_{at}$ is a nonvariational anti-trapping solute current required to correct for spurious effects that arise from considering an interface thickness much larger than the physical solid-liquid interface. In the dilute limit, the solidus and liquidus lines of the $T$ vs. $c$ phase diagram are defined by the equations -\begin{equation} -T_l=T_m-|m|c_l -\end{equation} -and -\begin{equation} -T_s=T_m-\frac{|m|}{k}c_s, -\end{equation} -where $m$ is the liquidus slope and $k=c_s/c_l$ is the partition coefficient, which relates the equilibrium concentrations, $c_l$ and $c_s$, of the liquid and solid, respectively.\\ - -For the governing equations to simulate directional solidification, we follow the same approach of Ref.~\cite{Echebarria2004} by introducing a dimensionless supersaturation, $U$, instead of $c$. This supersaturation term is defined as -\begin{equation} -U = \frac{e^u -1}{1-k}, -\end{equation} -where -\begin{equation} -\label{defu} -u(c,\phi) = \ln \left( \frac{2c}{c_l^0[1+k-(1-k)\phi]}\right). -\end{equation} -The constant $c_l^0$, is the equilibrium liquidus concentration at reference temperature, $T_0$. We define it as $c_l^0 = c_\infty /k$, where $c_\infty$ is the concentration of the liquid far from the solid-liquid interface (equal to the average concentration of the alloy). Thus, the reference temperature is given by $T_0=T_m - |m|c_l^0 =T_m-|m|c_\infty/k$. - -\section{Governing Equations} -After nondimensionalization (see Ref.~\cite{Echebarria2004} for derivation), the governing equations (in 2D) for $\phi$ and $U$ are given by -\begin{equation} -\label{eqphi} -\tau_\phi\frac{\partial \phi}{\partial t} = \xi(\phi,U) -\end{equation} -and -\begin{equation} -\label{eqU} -\tau_U\frac{\partial U}{\partial t} = \nabla \cdot \left[ \tilde{D} \frac{1-\phi}{2} \nabla U - \vec{\jmath}_{at}^{\,U} \right] + \frac{1}{2}[1+(1-k)U]\frac{\partial \phi}{\partial t}, -\end{equation} -where -\begin{equation} -\label{tau_phi} -\tau_\phi=[1+(1-k) U ]a_s^2(\hat{n}), -\end{equation} -\begin{equation} -\tau_U=\frac{1+k}{2} - \frac{1-k}{2}\phi, -\label{tauU} -\end{equation} -\begin{equation} -\label{eqxi} -\begin{split} -\xi = & \nabla \cdot \left[ a_s^2(\hat{n}) \nabla \phi \right] -+ \frac{\partial}{\partial x} \left[ |\nabla \phi|^2 a_s(\hat{n}) \frac{\partial a_s(\hat{n})}{\partial \left( \frac{\partial \phi}{\partial x} \right)} \right] -+ \frac{\partial}{\partial y} \left[ |\nabla \phi|^2 a_s(\hat{n}) \frac{\partial a_s(\hat{n})}{\partial \left( \frac{\partial \phi}{\partial y} \right)} \right] \\ -& +\phi-\phi^3 - \lambda(1-\phi^2)^2 \left[ U + U_\text{off} + \frac{\tilde{y} - \tilde{y}_0 - \tilde{V}_p t}{\tilde{l}_T} \right], -\end{split} -\end{equation} -and -\begin{equation} -\label{eqjat} -\vec{\jmath}_{at}^{\,U}=\frac{1}{2\sqrt{2}}[1+(1-k)U]\hat{n}\frac{\partial \phi}{\partial t}. -\end{equation} -The function $a_s$ is the anisotropy factor for the solid-liquid interfacial energy, which depends on the outward normal (with respect to the solid) of the interface, $\hat{n}=-\nabla \phi / |\nabla \phi|$. For a solid phase with $m$-fold symmetry this factor is given by~\footnote{In the implementation of the current model, $m$ is set to 4 and $\theta_0=0$. For the purpose of computational efficiency, explicit calculation of trigonometric functions (and their inverse) is avoided. Thus, all sine and cosine terms with argument $m\theta$ are evaluated as $\sin(m\theta)=4\cos^3\theta\sin\theta-4\cos\theta\sin^3\theta$ and $\cos(m\theta)=\cos^4\theta -6\cos^2\theta\sin^2\theta-\sin^4\theta$, where $\sin\theta=\partial_y\phi / |\nabla \phi|$ and $\cos\theta=\partial_x\phi / |\nabla \phi|$.} -\begin{equation} -a_s(\hat{n})=1+\epsilon_m \cos[m(\theta-\theta_0)], -\end{equation} -where $\epsilon_m$ determines the strength of the anisotropy, $\theta$ is the in-plane azimuthal angle of the normal vector with respect to the positive $x$-direction and $\theta_0$ is the reference orientation of the solid grains. The angle $\theta$ is related to the normal derivatives of $\phi$ at the interface via -\begin{equation} -\label{taneq} -\tan(\theta) = \frac{\partial \phi / \partial y}{\partial \phi / \partial x}. -\end{equation} -In Eq.~\labelcref{eqxi}, $\lambda$ is a coupling constant defined as $\lambda=5\sqrt{2}W/(8d_0)$, where $W=(\sigma/H)^{1/2}$ is the equilibrium interface width and $d_0$ is the chemical capillary length, given by -\begin{equation} -\label{clength} -d_0=\frac{\gamma T_m}{L |m| (1-k) c_l^0}. -\end{equation} -In Eq. \labelcref{clength}, $\gamma$ is the equilibrium surface tension and $L$ is the latent heat of fusion per volume. Finally, $\tilde{y}$, $\tilde{V}_p$, $\tilde{l}_T$ and $\tilde{D}$ are all dimensionless parameters, calculated by taking the unit length as $W$ and the unit time as $\tau_0=0.6267\lambda W^2/D$, where $D$ is the solute diffusivity in the liquid. The coordinate, $\tilde{y}$, represents the position along the direction of the thermal gradient, $\tilde{V}_p$ is the steady-state solidification speed, $\tilde{l}_T$ is the thermal length, calculated as $\tilde{l}_T=|m|(1-k)c_l^0/\tilde{G}$, where $\tilde{G}$ is the dimensionless thermal gradient, and $\tilde{D}$ is the dimensionless solute diffusivity in the liquid. Note that Eqs. (\ref{eqphi})-(\ref{eqjat}) are equivalent to Eqs. (132) and (133) from Ref.~\cite{Echebarria2004}, except for the expression for the phase-field relaxation time $\tau_\phi$ which, for this application, was chosen to be $U$-dependent, as defined by Eq. (123) from Ref.~\cite{Echebarria2004}.\\ -\\ -Equation~\labelcref{eqxi} can be simplified by explicitly writing $a_s(\hat{n})$ in terms of $\theta$. We can evaluate the terms $\partial a_s(\theta)/\partial \left( \frac{\partial \phi}{\partial x} \right)$ and $\partial a_s(\theta)/\partial \left( \frac{\partial \phi}{\partial y} \right)$ by using the chain rule, i.e., -\[ -\frac{\partial a_s(\theta)}{\partial \left( \frac{\partial \phi}{\partial x} \right)}=\frac{\partial a_s(\theta)}{\partial \theta} \frac{\partial \theta}{\partial \left( \frac{\partial \phi}{\partial x} \right)}\ \mathrm{and}\ \frac{\partial a_s(\theta)}{\partial \left( \frac{\partial \phi}{\partial y} \right)}=\frac{\partial a_s(\theta)}{\partial \theta} \frac{\partial \theta}{\partial \left( \frac{\partial \phi}{\partial y} \right)} -\] -along with Eq.~\labelcref{taneq}. Also, the second and third terms on the right-hand side can be expressed using a divergence operator, allowing them to be grouped with the first term, which will simplify matters later. Carrying out these transformations yields: -\begin{equation} -\label{eqxi2} -\begin{split} -\xi = & \nabla \cdot \left[ \left(a_s^2(\theta) \frac{\partial \phi}{\partial x} + \epsilon_m m a_s(\theta) \sin \left[ m \left(\theta - \theta_0 \right) \right] \frac{\partial \phi}{\partial y}\right)\hat{x} \right. \\ -& \left . + \left(a_s^2(\theta) \frac{\partial \phi}{\partial y} - \epsilon_m m a_s(\theta) \sin \left[ m \left(\theta - \theta_0 \right) \right] \frac{\partial \phi}{\partial x}\right)\hat{y}\right] \\ -&+ \phi-\phi^3 - \lambda{(1-\phi^2)}^2 \left[ U + U_\text{off} + \frac{\tilde{y} - \tilde{y}_0 - \tilde{V}_p t}{\tilde{l}_T} \right]. -\end{split} -\end{equation} - -\section{Model Constants} - -\begin{itemize} -\item[$\epsilon$:] Strength of the anisotropy ($\epsilon_4$ for a solid with fourfold anisotropy)%\\ -\item[$k$:] Partition coefficient%\\ -\item[$c_0$:] Initial liquid concentration ($c_\infty$)%\\ -\item[$\lambda$:] Coupling constant (setting this value fixes the interface width)%\\ -\item[$\tilde{D}$:] Dimensionless solute diffusivity in the liquid phase.%\\ -\item[$\tilde{V}_p$:] Dimensionless steady-state velocity of the tip.%\\ -\item[$\tilde{l}_T$:] Dimensionless thermal length.%\\ -\item[$U_0$:] Initial constitutional undercooling of the system ($U_0=-1$ sets the concentration of the liquid as $c_\infty$ and of the solid as $kc_\infty$)%\\ -\item[$U_{\text{off}}$:] Undercooling offset that determines the initial temperature at the interface ($U_{\text{off}}=0$ sets it to the solidus temperature, $U_{\text{off}}=1$ sets it to the liquidus temperature).%\\ -\item[$\tilde{y}_0$:] Initial solid-liquid interface position relative to the bottom of the system ($\tilde{y}=0$)%\\ -\end{itemize} - -\section{Time Discretization} -Considering forward Euler explicit time stepping, we have the time-discretized kinetics equations: -\begin{equation} -\phi^{n+1}=\phi^{n} + \frac{\xi^n}{\tau_\phi}\Delta t, -\end{equation} -\begin{equation} -U^{n+1}=U^{n}+\frac{\Delta t}{\tau_U}\left\{\nabla \cdot \left[ \tilde{D}\frac{1-\phi^n}{2} \nabla U^n - \vec{\jmath}_{at}^{\,U} \right] + \frac{1}{2}[1+(1-k)U^n]\frac{\xi^n}{\tau_\phi} \right\}, -\label{ueq_td} -\end{equation} -and -\begin{equation} -\begin{split} -\xi^{n+1} = & \nabla \cdot \left[ \left(a_s^2(\theta^n) \frac{\partial \phi^n}{\partial x} + \epsilon_m m a_s(\theta^n) \sin \left[ m \left(\theta^n - \theta_0 \right) \right] \frac{\partial \phi^n}{\partial y}\right)\hat{x} \right. \\ -& \left . + \left(a_s^2(\theta^n) \frac{\partial \phi^n}{\partial y} - \epsilon_m m a_s(\theta^n) \sin \left[ m \left(\theta^n - \theta_0 \right) \right] \frac{\partial \phi^n}{\partial x}\right)\hat{y}\right] \\ -& +\phi^n-{(\phi^n)}^3 - \lambda {\left[1-{(\phi^n)}^2\right]}^2 \left[ U^n + U_\text{off} + \frac{\tilde{y} - \tilde{y}_0 - \tilde{V}_p t}{\tilde{l}_T} \right]. -\end{split} -\end{equation} - -\section{Weak Formulation} -The weak formulation is obtained by multiplying the time-discretized equations by test function, $\omega$, and integrating over the volume, $\Omega$. For $\phi$ we get -\begin{equation} -\int_{\Omega} \omega \phi^{n+1} ~dV = \int_{\Omega} \omega \underbrace{\left(\phi^n + \frac{ \xi^n}{\tau_\phi}\Delta t\right)}_{r_{\phi}} ~dV. -\end{equation} -For the weak form of Eq.~\ref{ueq_td}, we employ the relation $\nabla \frac{1}{\tau_U}=\frac{1}{\tau_U^2}\frac{1-k}{2}\nabla\phi$ that results from substituting $\tau$ as defined by Eq. (\ref{tauU}) into the gradient of $1/\tau_U$: -\begin{equation} -\begin{split} -\int_{\Omega} \omega U^{n+1} ~dV =& -\int_{\Omega} \omega \underbrace{ \left( U^{n} + \frac{\Delta t}{2\tau_U\tau_\phi}[1+(1-k)U^n]\xi^n - \frac{\Delta t (1-k)}{2\tau_U^2} \nabla \phi \cdot \left[\tilde{D}\frac{1-\phi^n}{2}\nabla U^n-\vec{\jmath}_{at}^{\,U}\right] \right) }_{r_U}~dV\\ -&+\int_{\Omega} \nabla \omega \cdot \underbrace{\left( -\frac{\Delta t}{\tau_U}\left[\tilde{D}(1-\phi^n)\nabla U^n-\vec{\jmath}_{at}^{\,U}\right] \right)}_{r_{Ux}}~dV. -\end{split} -\end{equation} -Finally, for $\xi$, we obtain -\begin{equation} -\int_{\Omega} \omega \xi^{n+1} ~dV =\int_{\Omega} \omega r_\xi ~dV + \int_{\Omega} \nabla \omega r_{\xi x} ~dV, -\end{equation} -where -\begin{equation} -r_\xi= \phi^n-(\phi^n)^3 - \lambda \left[1-(\phi^n)^2\right]^2 \left[ U^n + U_\text{off} + \frac{\tilde{y} - \tilde{y}_0 - \tilde{V}_p t}{\tilde{l}_T} \right] -\end{equation} -\begin{equation} -\begin{split} -r_{\xi x}= &-\left[a_s^2(\theta^n) \frac{\partial \phi^n}{\partial x} + \epsilon_m m a_s(\theta^n) \sin \left[ m \left(\theta^n - \theta_0 \right) \right] \frac{\partial \phi^n}{\partial y}\right]\hat{x}\\ -&-\left[a_s^2(\theta^n) \frac{\partial \phi^n}{\partial y} - \epsilon_m m a_s(\theta^n) \sin \left[ m \left(\theta^n - \theta_0 \right) \right] \frac{\partial \phi^n}{\partial x}\right]\hat{y} -\end{split} -\end{equation} -\vskip 0.25in -The above values of $r_{\phi}$, $r_{U}$, $r_{Ux}$, $r_{\xi}$ and $r_{\xi x}$ are used to define the residuals in the following parameters file: \\ -\textit{applications/alloySolification/equations.cc} - -\begin{thebibliography}{plain} - \bibitem{Yao2021} Developed by Zhenjie Yao, Department of Material Science and Engineering, University of Michigan (2021). - \bibitem{Echebarria2004} B. Echebarria, R. Folch, A. Karma, and M. Plapp, Quantitative phase-field model of alloy solidification, \emph{Phys. Rev. E} {\bf 70}, 061604 (2004). -\end{thebibliography} - -\end{document} diff --git a/applications/alloySolidification_uniform/alloySolidification_uniform.md b/applications/alloySolidification_uniform/alloySolidification_uniform.md new file mode 100644 index 000000000..a7fa311ae --- /dev/null +++ b/applications/alloySolidification_uniform/alloySolidification_uniform.md @@ -0,0 +1,284 @@ +# PRISMS-PF Application Formulation: alloySolidification_uniform + +This example application implements a simple model to simulate solidification of a binary alloy A-B in the dilute limit with component B acting as a solute in a matrix of A. The implemented model was introduced by Karma [1] in 2001. In this model, latent heat is assumed to diffuse much faster than impurities and, therefore, the temperature field is considered to be fixed by external conditions. In contrast to *alloySolidification*, this application considers solidification under uniform temperature and no diffusion in the solid. In the default settings of the application, the simulation starts with a circular solid in the corner of a square system. The evolution of the system is calculated for an initial scaled supersaturation value, $\Omega$. As this seed grows, three variables are tracked, an order parameter, $\phi$, that denotes whether the material a liquid ($\phi=-1$) or solid ($\phi=1$), the solute concentration, $c$, and an auxiliary term, $\xi$. + +## Model +The free energy of the system can be written as the functional [2] + +$$ +\begin{equation} +\mathcal{F}[\phi,c,T]= \int_{\Omega} \left[\frac{\sigma}{2}|\nabla \phi|^2 +Hf(\phi, T_M) + f_{AB}(\phi, c, T) \right] ~dV, +\end{equation} +$$ + + +where $\sigma$ is penalty coefficient for phase gradients. The term $f(\phi, T_M)$ is a symmetric double-well term evaluated at the melting temperature of the pure material $A$, $T_M$. The constant $H$ is the height of the well and $f_{AB}(\phi, c, T)$ accounts for the relative stability of the liquid and solid phases at different temperatures, according to the phase diagram. The double-well term has the standard form given by + +$$ +\begin{equation} +f(\phi, T_M) = -\phi^2/2 + \phi^4/4. +\end{equation} +$$ + +For a dilute binary alloy, $f_{AB}$ can be written as + +$$ +\begin{equation} +f_{AB}(\phi, c, T) = f^A(T_M) - (T-T_M) s(\phi) + \frac{R T_M}{v_o}(c\ln c -c) +\epsilon (\phi) c, +\end{equation} +$$ + +where $f^A(T_M)$ is the free energy density of pure A at its melting point, $v_0$ is the molar volume of A and $R$ is the gas constant. The functions $s(\phi)$ and $\epsilon (\phi)$ are interpolation functions for the entropy and internal energy of the solid and liquid phases, respectively. The general form of the coupled governing equations for the $\phi$ and $c$ is + +$$ +\begin{equation} +\frac{\partial \phi}{\partial t} = -K_\phi \frac{\delta \mathcal{F}}{\delta \phi} +\end{equation} +$$ + +and + +$$ +\begin{equation} +\frac{\partial c}{\partial t} = \nabla \cdot \left(\ M(\phi,c) \frac{\delta \mathcal{F}}{\delta c} - \vec{j}_{at} \right), +\end{equation} +$$ + +where $K_\phi$ is a kinetic constant, $M(\phi,c)$ is the mobility of solute atoms and $\vec{j}_{at}$ is a nonvariational anti-trapping solute current required to correct for spurious effects that arise from considering an interface thickness much larger than the physical solid-liquid interface. in the dilute limit, the solidus and liquidus lines of the $T$ vs $c$ phase diagram are defined by the equations + +$$ +\begin{equation} +T_l=T_M-|m|c_l +\end{equation} +$$ + +and + +$$ +\begin{equation} +T_s=T_M-\frac{|m|}{k}c_s, +\end{equation} +$$ + +where $m$ is the liquidus slope and $k=c_s/c_l$ is the partition coefficient, which relates the equilibrium concentrations, $c_l$ and $c_s$, of the liquid and solid, respectively. + +Considering solidification at a temperature $T_0 0$. Thus, the ionic transport equations are coupled to the phase field method by using $\psi$ as the domain parameter. The electrolyte is assumed to be composed of three ionic species: an effective cation species for the metal (M) dissolved at the interface, a supporting cation (+), and a supporting anion (-). The electrolyte is assumed to be electroneutral, which implies that that the following constraint must be satisfied, + +$$ +\begin{equation} +z_M c_M + z_+ c_+ + z_-c_- = 0. +\end{equation} +$$ + +Thus, the concentrations are not independent of each other only two additional equations are required to describe the concentration evolution for all three species. The concentrations of the effective metal cation and the supporting electrolyte cation are directly solved and the supporting anion concentration is eliminated via + +$$ +\begin{equation} +z_M c_M + z_+ c_+ + z_-c_- = 0. +\end{equation} +$$ + +The SBM reformulated governing equation for each species, $i$, which includes diffusion and migration effects, is given by + +$$ +\begin{align} +\frac{\partial c_i}{\partial t}=\frac{1}{\psi} \nabla \cdot (\psi D_i \nabla c_i) + \frac{1}{\psi} \left(\frac{z_i F}{RT} \nabla \cdot (\psi D_i c_i \nabla \Phi) \right) + \frac{|\nabla \psi|}{\psi} \left( \frac{i_{rxn}}{z_i F} \right) +\end{align} +$$ + +where $c_i =c_M, c_+$ and $\Phi$ is the electrostatic potential. The last term of the right hand side of + +$$ +\begin{align} +\frac{\partial c_i}{\partial t}=\frac{1}{\psi} \nabla \cdot (\psi D_i \nabla c_i) + \frac{1}{\psi} \left(\frac{z_i F}{RT} \nabla \cdot (\psi D_i c_i \nabla \Phi) \right) + \frac{|\nabla \psi|}{\psi} \left( \frac{i_{rxn}}{z_i F} \right) +\end{align} +$$ + +is zero for $c_i =c_+$ because $i_{rxn}$ is the reaction current density for the dissolution of the metal (M), which does not involve the supporting cation (+) and anion (-). The SBM reformulated governing equation for the potential is + +$$ +\begin{equation} +\nabla \cdot (\psi \kappa \nabla \Phi) = F \nabla \cdot \left[ \psi \left( z_M (D_- - D_M) \nabla c_M + z_+ (D_- - D_+) \nabla c_+ \right) \right] - |\nabla \psi | i_{rxn}, +\end{equation} +$$ + +where + +$$ +\begin{equation} +\kappa =\frac{F^2}{RT}\left[ z_Mc_M\left( z_MD_M-z_-D_-\right) + z_+c_+\left( z_+D_+-z_-D_-\right) \right]. +\end{equation} +$$ + +The reaction current density is obtained via a Butler-Volmer type kinetic expression that includes a maximum current density that accounts for both how far the electrolyte is from saturation at a point in time as well as the rate of transport of ions into the electrolyte: + +$$ +\begin{equation} +\frac{i_{rxn}}{i_{corr}}= \left( 1 - \frac{i_{rxn}}{i_{max,c}} \right) \exp \left( \frac{z_M (1-\beta) F}{RT}\xi \right), +\end{equation} +$$ + +where $i_{max,c}$ is the maximum reaction current density, $\beta$ is the the charge transfer symmetry factor and $\xi$ is the overpotential, defined as $\xi=V_s-E_{corr}-\Phi$. The parameters $i_{corr}$ and $E_{corr}$ are the corrosion current density and corrosion potential, respectively, and $V_s$ is the applied potential. The maximum reaction current density is given by + +$$ +\begin{equation} +i_{max,c}=\left( \frac{z_M F}{1-c_M V_M} \right) \left[ \frac{2\delta}{\tau}(c_{M,sat} - c_M ) + \left( D_M\nabla c_M +z_M\frac{F}{RT}D_M c_M \nabla \Phi \right) \cdot \mathbf{n} \right], +\end{equation} +$$ + +where $c_{M,sat}$ is the saturation concentration of the metal ions in solution and $2\delta/\tau$ is a characteristic velocity of ion transport across the diffuse interface. This velocity is given by the largest value between the characteristic velocities of diffusion and of migration: + +$$ +\begin{equation} +\frac{2\delta}{\tau}=\max \left( \frac{D_M}{2\delta}, \left| \frac{z_M D_M F \nabla \Phi \cdot \mathbf{n}}{RT} \right| \right). +\end{equation} +$$ + +## Time Discretization +The fields $\eta$, $\psi$, $c_M$ and $c_+$ are solved using an explicit Euler method for time integration. For $\eta$ and $\psi$ we employ a splitting strategy to transform Eqs. + +$$ +\begin{equation} + \frac{\partial \eta}{\partial t} = \nabla \cdot \left[ M(\psi) \nabla \frac{\delta \Pi}{\delta \eta}\right] + v |\nabla \psi|, + \end{equation} +$$ + +and + +$$ +\begin{equation} + \frac{\partial \psi}{\partial t} = \nabla \cdot \left[ M(\psi) \nabla \frac{\delta \Pi}{\delta \psi} \right] - v |\nabla \psi|. + \end{equation} +$$ + +into second order PDEs: + +$$ +\begin{equation} + \frac{\partial \eta}{\partial t} = \nabla \cdot \left( M \nabla \mu_\eta \right) + v |\nabla \psi| +\end{equation} +$$ + +and + +$$ +\begin{equation} +\frac{\partial \psi}{\partial t} = \nabla \cdot \left( M \nabla \mu_\psi \right) - v |\nabla \psi|, +\end{equation} +$$ + +where + +$$ +\begin{equation} +\mu_\eta=W \left( \eta^3 - \eta +2 \gamma \eta \psi^2 \right) -\epsilon^2 \nabla^2 \eta +\end{equation} +$$ + +and + +$$ +\begin{equation} +\mu_\psi=W \left( \psi^3 - \psi +2 \gamma \psi \eta^2 \right) -\epsilon^2 \nabla^2 \psi. +\end{equation} +$$ + +Considering forward Euler explicit time stepping, the time-discretized version of the equations above are + +$$ +\begin{equation} +\eta^{n+1} = \eta^n + \Delta t \left[ \nabla \cdot \left( M \nabla \mu_\eta^n \right) + v |\nabla \psi^n| \right], +\end{equation} +$$ + +$$ +\begin{equation} +\psi^{n+1} = \psi^n + \Delta t \left[ \nabla \cdot \left( M \nabla \mu_\psi^n \right) - v |\nabla \psi^n | \right], +\end{equation} +$$ + +$$ +\begin{equation} +\mu_\eta^{n+1}=f_\eta^n -\epsilon^2 \nabla^2 \eta^n, +\end{equation} +$$ + +and + +$$ +\begin{equation} +\mu_\psi^{n+1}=f_\psi^n -\epsilon^2 \nabla^2 \psi^n, +\end{equation} +$$ + +where $f_\eta=W \left( \eta^3 - \eta +2 \gamma \eta \psi^2 \right)$ and $f_\psi= W \left( \psi^3 - \psi +2 \gamma \psi \eta^2 \right)$. + +The discretized equation for the ion concentrations are + +$$ +\begin{equation} +c_i ^{n+1}= c_i^n + \Delta t \left[ \frac{1}{\psi^n} \nabla \cdot (\psi^n D_i \nabla c_i^n) + \frac{1}{\psi^n} \left( \frac{z_i F}{RT} \nabla \cdot (\psi^n D_i c_i^n \nabla \Phi^n) \right)+ \frac{|\nabla \psi^n|}{\psi^n} \left( \frac{i_{rxn}}{z_i F} \right) \right]. +\end{equation} +$$ + +The electrostatic potential is assumed to be in equilibrium throughout the simulation and needs to be solved as a non-linear time-independent equation. + +## Weak Formulation +For the weak formulation of time-discretized equations only the RHS terms need to be specified (see `https://prisms-center.github.io/phaseField/doxygen_files/app_files.html` for details) + +$$ +\begin{equation} +\int_{\Omega} \omega \eta^{n+1} dV = \int_{\Omega} \omega \left( \eta^n +\Delta t v |\psi^n|\right)dV + \int_{\Omega} \nabla \omega \cdot \left(- \Delta t M \nabla \mu_\eta^n \right) dV +\end{equation} +$$ + +$$ +\begin{align} +r_\eta &= \left( \eta^n +\Delta t v |\psi^n|\right) +\end{align} +$$ + +$$ +\begin{align} +r_{\eta x} &= \left(- \Delta t M \nabla \mu_\eta^n \right) +\end{align} +$$ + +$$ +\begin{equation} +\int_{\Omega} \omega \mu_\eta^{n+1} dV = \int_{\Omega} \omega f_\eta^n dV + \int_{\Omega} \nabla \omega \cdot (\epsilon^2\nabla\eta^n) dV +\end{equation} +$$ + +$$ +\begin{align} +r_{\mu \eta} &= f_\eta^n +\end{align} +$$ + +$$ +\begin{align} +r_{\mu \eta x} &= (\epsilon^2\nabla\eta^n) +\end{align} +$$ + +$$ +\begin{equation} +\int_{\Omega} \omega \psi^{n+1} dV = \int_{\Omega} \omega \left( \psi^n -\Delta t v |\psi^n|\right) dV+ \int_{\Omega} \nabla \omega \cdot \left(- \Delta t M \nabla \mu_\psi^n \right) dV +\end{equation} +$$ + +$$ +\begin{align} +r_\psi &= \left( \psi^n -\Delta t v |\psi^n|\right) +\end{align} +$$ + +$$ +\begin{align} +r_{\psi x} &= \left(- \Delta t M \nabla \mu_\psi^n \right) +\end{align} +$$ + +$$ +\begin{equation} +\int_{\Omega} \omega \mu_\psi^{n+1} dV = \int_{\Omega} \omega f_\psi^n dV + \int_{\Omega} \nabla \omega \cdot (\epsilon^2\nabla\psi^n) dV +\end{equation} +$$ + +$$ +\begin{align} +r_{\mu \psi} &= f_\psi^n +\end{align} +$$ + +$$ +\begin{align} +r_{\mu \psi x} &= (\epsilon^2\nabla\psi^n) +\end{align} +$$ + +$$ +\begin{align} +\int_{\Omega} \omega c_i^{n+1} dV &=\int_{\Omega} \omega \left( c_i^n+\frac{\Delta t D_i}{\psi^n}\nabla\psi^n\cdot\nabla c_i^n ++\frac{\Delta t D_i z_i F}{RT\psi^n}\nabla\psi^n\cdot(c_i^n\nabla \Phi^n) +\frac{\Delta t}{z_i F\psi^n} |\nabla\psi^n| i_{rxn}\right) dV +\end{align} +$$ + +$$ +\begin{align} +&+ \int_{\Omega} \nabla \omega \cdot \left( -\Delta t D_i \nabla c_i^n -\frac{\Delta t D_i z_i F}{RT} c_i^n\nabla \Phi^n \right) dV +\end{align} +$$ + +$$ +\begin{align} +r_{ci} &= \left( c_i^n+\frac{\Delta t D_i}{\psi^n}\nabla\psi^n\cdot\nabla c_i^n ++\frac{\Delta t D_i z_i F}{RT\psi^n}\nabla\psi^n\cdot(c_i^n\nabla \Phi^n) +\frac{\Delta t}{z_i F\psi^n} |\nabla\psi^n| i_{rxn}\right) +\end{align} +$$ + +$$ +\begin{align} +r_{cix} &= \left( -\Delta t D_i \nabla c_i^n -\frac{\Delta t D_i z_i F}{RT} c_i^n\nabla \Phi^n \right) +\end{align} +$$ + +For the time-independent electrostatic potential, we need to specify LHS and RHS terms: + +$$ +\begin{align} +&\int_{\Omega} \omega \left( \frac{\partial i_{rxn}}{\partial \Phi}^n |\nabla\psi^n| \Delta\Phi\right) dV + \int_{\Omega} \nabla\omega \cdot \left( -\psi^n \kappa \nabla(\Delta\Phi)\right) dV = +\end{align} +$$ + +$$ +\begin{align} +&\int_{\Omega} \omega \left( -|\nabla\psi^n| i_{rxn} \right) dV + \int_{\Omega} \nabla\omega \cdot \left( -F \left[ \left( z_M (D_- - D_M) \nabla c_M^n + z_+ (D_- - D_+) \nabla c_+^n \right) \right] +\psi^n \kappa \nabla\Phi^n \right) dV +\end{align} +$$ + +$$ +\begin{align} +r_{\Delta \Phi} &= \left( \frac{\partial i_{rxn}}{\partial \Phi}^n |\nabla\psi^n| \Delta\Phi\right) +\end{align} +$$ + +$$ +\begin{align} +r_{\Delta \Phi x} &= \left( -\psi^n \kappa \nabla(\Delta\Phi)\right) +\end{align} +$$ + +$$ +\begin{align} +r_\Phi &= \left( -|\nabla\psi^n| i_{rxn} \right) +\end{align} +$$ + +$$ +\begin{align} +r_\Phi x &= \left( -F \left[ \left( z_M (D_- - D_M) \nabla c_M^n + z_+ (D_- - D_+) \nabla c_+^n \right) \right] +\psi^n \kappa \nabla\Phi^n \right) +\end{align} +$$ + +The above values of are used to define the equation terms in the input file `applications/corrosion/equations.cc`. diff --git a/applications/corrosion/corrosion.pdf b/applications/corrosion/corrosion.pdf deleted file mode 100644 index 5643cae36..000000000 Binary files a/applications/corrosion/corrosion.pdf and /dev/null differ diff --git a/applications/corrosion/tex_files/corrosion.pdf b/applications/corrosion/tex_files/corrosion.pdf deleted file mode 100644 index 5643cae36..000000000 Binary files a/applications/corrosion/tex_files/corrosion.pdf and /dev/null differ diff --git a/applications/corrosion/tex_files/corrosion.tex b/applications/corrosion/tex_files/corrosion.tex deleted file mode 100644 index 4c7c162ef..000000000 --- a/applications/corrosion/tex_files/corrosion.tex +++ /dev/null @@ -1,335 +0,0 @@ -% *********************************************************** -% ******************* PHYSICS HEADER ************************ -% *********************************************************** -% Version 2 -\documentclass[11pt]{article} -\usepackage{amsmath} % AMS Math Package -\usepackage{amsthm} % Theorem Formatting -\usepackage{amssymb} % Math symbols such as \mathbb -\usepackage{graphicx} % Allows for eps images -\usepackage{multicol} % Allows for multiple columns -\usepackage[dvips,letterpaper,margin=0.75in,bottom=0.5in]{geometry} - % Sets margins and page size -\pagestyle{empty} % Removes page numbers -\makeatletter % Need for anything that contains an @ command -\renewcommand{\maketitle} % Redefine maketitle to conserve space -{ \begingroup \vskip 10pt \begin{center} \large {\bf \@title} - \vskip 10pt \end{center} - \vskip 10pt \endgroup \setcounter{footnote}{0} } -\makeatother % End of region containing @ commands -\renewcommand{\labelenumi}{(\alph{enumi})} % Use letters for enumerate -% \DeclareMathOperator{\Sample}{Sample} -\let\vaccent=\v % rename builtin command \v{} to \vaccent{} -\renewcommand{\v}[1]{\ensuremath{\mathbf{#1}}} % for vectors -\newcommand{\gv}[1]{\ensuremath{\mbox{\boldmath$ #1 $}}} -% for vectors of Greek letters -\newcommand{\uv}[1]{\ensuremath{\mathbf{\hat{#1}}}} % for unit vector -\newcommand{\abs}[1]{\left| #1 \right|} % for absolute value -\newcommand{\avg}[1]{\left< #1 \right>} % for average -\let\underdot=\d % rename builtin command \d{} to \underdot{} -\renewcommand{\d}[2]{\frac{d #1}{d #2}} % for derivatives -\newcommand{\dd}[2]{\frac{d^2 #1}{d #2^2}} % for double derivatives -\newcommand{\pd}[2]{\frac{\partial #1}{\partial #2}} -% for partial derivatives -\newcommand{\pdd}[2]{\frac{\partial^2 #1}{\partial #2^2}} -% for double partial derivatives -\newcommand{\pdc}[3]{\left( \frac{\partial #1}{\partial #2} - \right)_{#3}} % for thermodynamic partial derivatives -\newcommand{\ket}[1]{\left| #1 \right>} % for Dirac bras -\newcommand{\bra}[1]{\left< #1 \right|} % for Dirac kets -\newcommand{\braket}[2]{\left< #1 \vphantom{#2} \right| - \left. #2 \vphantom{#1} \right>} % for Dirac brackets -\newcommand{\matrixel}[3]{\left< #1 \vphantom{#2#3} \right| - #2 \left| #3 \vphantom{#1#2} \right>} % for Dirac matrix elements -\newcommand{\grad}[1]{\gv{\nabla} #1} % for gradient -\let\divsymb=\div % rename builtin command \div to \divsymb -\renewcommand{\div}[1]{\gv{\nabla} \cdot #1} % for divergence -\newcommand{\curl}[1]{\gv{\nabla} \times #1} % for curl -\let\baraccent=\= % rename builtin command \= to \baraccent -\renewcommand{\=}[1]{\stackrel{#1}{=}} % for putting numbers above = -\newtheorem{prop}{Proposition} -\newtheorem{thm}{Theorem}[section] -\newtheorem{lem}[thm]{Lemma} -\theoremstyle{definition} -\newtheorem{dfn}{Definition} -\theoremstyle{remark} -\newtheorem*{rmk}{Remark} - -% *********************************************************** -% ********************** END HEADER ************************* -% *********************************************************** - - -\usepackage[noprefix]{nomencl} -\usepackage{amsfonts} -\usepackage{amssymb} -\usepackage{amsmath} -\usepackage[hidelinks]{hyperref} -\usepackage{xcolor} - -%--------------------------------------------------------- -% Bold Face Math Characters: -% All In Format: \B***** . -%--------------------------------------------------------- -\def\BGamma{\mbox{\boldmath$\Gamma$}} -\def\BDelta{\mbox{\boldmath$\Delta$}} -\def\BTheta{\mbox{\boldmath$\Theta$}} -\def\BLambda{\mbox{\boldmath$\Lambda$}} -\def\BXi{\mbox{\boldmath$\Xi$}} -\def\BPi{\mbox{\boldmath$\Pi$}} -\def\BSigma{\mbox{\boldmath$\Sigma$}} -\def\BUpsilon{\mbox{\boldmath$\Upsilon$}} -\def\BPhi{\mbox{\boldmath$\Phi$}} -\def\BPsi{\mbox{\boldmath$\Psi$}} -\def\BOmega{\mbox{\boldmath$\Omega$}} -\def\Balpha{\mbox{\boldmath$\alpha$}} -\def\Bbeta{\mbox{\boldmath$\beta$}} -\def\Bgamma{\mbox{\boldmath$\gamma$}} -\def\Bdelta{\mbox{\boldmath$\delta$}} -\def\Bepsilon{\mbox{\boldmath$\epsilon$}} -\def\Bzeta{\mbox{\boldmath$\zeta$}} -\def\Beta{\mbox{\boldmath$\eta$}} -\def\Btheta{\mbox{\boldmath$\theta$}} -\def\Biota{\mbox{\boldmath$\iota$}} -\def\Bkappa{\mbox{\boldmath$\kappa$}} -\def\Blambda{\mbox{\boldmath$\lambda$}} -\def\Bmu{\mbox{\boldmath$\mu$}} -\def\Bnu{\mbox{\boldmath$\nu$}} -\def\Bxi{\mbox{\boldmath$\xi$}} -\def\Bpi{\mbox{\boldmath$\pi$}} -\def\Brho{\mbox{\boldmath$\rho$}} -\def\Bsigma{\mbox{\boldmath$\sigma$}} -\def\Btau{\mbox{\boldmath$\tau$}} -\def\Bupsilon{\mbox{\boldmath$\upsilon$}} -\def\Bphi{\mbox{\boldmath$\phi$}} -\def\Bchi{\mbox{\boldmath$\chi$}} -\def\Bpsi{\mbox{\boldmath$\psi$}} -\def\Bomega{\mbox{\boldmath$\omega$}} -\def\Bvarepsilon{\mbox{\boldmath$\varepsilon$}} -\def\Bvartheta{\mbox{\boldmath$\vartheta$}} -\def\Bvarpi{\mbox{\boldmath$\varpi$}} -\def\Bvarrho{\mbox{\boldmath$\varrho$}} -\def\Bvarsigma{\mbox{\boldmath$\varsigma$}} -\def\Bvarphi{\mbox{\boldmath$\varphi$}} -\def\bone{\mbox{\boldmath$1$}} -\def\bzero{\mbox{\boldmath$0$}} -%--------------------------------------------------------- -% Bold Face Math Italic: -% All In Format: \b* . -%--------------------------------------------------------- -\def\bA{\mbox{\boldmath$ A$}} -\def\bB{\mbox{\boldmath$ B$}} -\def\bC{\mbox{\boldmath$ C$}} -\def\bD{\mbox{\boldmath$ D$}} -\def\bE{\mbox{\boldmath$ E$}} -\def\bF{\mbox{\boldmath$ F$}} -\def\bG{\mbox{\boldmath$ G$}} -\def\bH{\mbox{\boldmath$ H$}} -\def\bI{\mbox{\boldmath$ I$}} -\def\bJ{\mbox{\boldmath$ J$}} -\def\bK{\mbox{\boldmath$ K$}} -\def\bL{\mbox{\boldmath$ L$}} -\def\bM{\mbox{\boldmath$ M$}} -\def\bN{\mbox{\boldmath$ N$}} -\def\bO{\mbox{\boldmath$ O$}} -\def\bP{\mbox{\boldmath$ P$}} -\def\bQ{\mbox{\boldmath$ Q$}} -\def\bR{\mbox{\boldmath$ R$}} -\def\bS{\mbox{\boldmath$ S$}} -\def\bT{\mbox{\boldmath$ T$}} -\def\bU{\mbox{\boldmath$ U$}} -\def\bV{\mbox{\boldmath$ V$}} -\def\bW{\mbox{\boldmath$ W$}} -\def\bX{\mbox{\boldmath$ X$}} -\def\bY{\mbox{\boldmath$ Y$}} -\def\bZ{\mbox{\boldmath$ Z$}} -\def\ba{\mbox{\boldmath$ a$}} -\def\bb{\mbox{\boldmath$ b$}} -\def\bc{\mbox{\boldmath$ c$}} -\def\bd{\mbox{\boldmath$ d$}} -\def\be{\mbox{\boldmath$ e$}} -\def\bff{\mbox{\boldmath$ f$}} -\def\bg{\mbox{\boldmath$ g$}} -\def\bh{\mbox{\boldmath$ h$}} -\def\bi{\mbox{\boldmath$ i$}} -\def\bj{\mbox{\boldmath$ j$}} -\def\bk{\mbox{\boldmath$ k$}} -\def\bl{\mbox{\boldmath$ l$}} -\def\bm{\mbox{\boldmath$ m$}} -\def\bn{\mbox{\boldmath$ n$}} -\def\bo{\mbox{\boldmath$ o$}} -\def\bp{\mbox{\boldmath$ p$}} -\def\bq{\mbox{\boldmath$ q$}} -\def\br{\mbox{\boldmath$ r$}} -\def\bs{\mbox{\boldmath$ s$}} -\def\bt{\mbox{\boldmath$ t$}} -\def\bu{\mbox{\boldmath$ u$}} -\def\bv{\mbox{\boldmath$ v$}} -\def\bw{\mbox{\boldmath$ w$}} -\def\bx{\mbox{\boldmath$ x$}} -\def\by{\mbox{\boldmath$ y$}} -\def\bz{\mbox{\boldmath$ z$}} - -\makenomenclature -\makeindex -\title{\huge Corrosion} -\begin{document} -\maketitle -\nomenclature[a]{$c$}{Concentration (Cahn-Hilliard order parameter)} -\nomenclature[b]{$\eta$}{Structural order parameter (Allen-Cahn order parameter)} -\nomenclature[c]{$\bE$}{Lagrange strain tensor (Mechanics order parameter)} -\nomenclature[d]{$\Pi$}{Total free energy of the system} -\nomenclature[e]{$F$}{Local free energy density} -\nomenclature[f]{$\mathcal{J}$}{Concentration flux} -\nomenclature[g]{$\mu$}{Chemical potential} -\nomenclature[h]{$\kappa^c$}{Cahn-Hilliard gradient coefficient} -\nomenclature[i]{$\kappa^{\eta}$}{Allen-Cahn gradient coefficient} -\nomenclature[j]{$L^{c}$}{Concentration mobility} -\nomenclature[k]{$L^{\eta}$}{Structural order parameter mobility} -\nomenclature[l]{$\omega$}{Variations over primal field} -\nomenclature[m]{$\mathcal{M}$}{Boundary chemical potential like term} -\nomenclature[n]{$\bn$}{Nomal vector in the current configuration} -\nomenclature[o]{$(\theta,~\phi)$}{Polar angles of the interface normal, $\bn$} -\centerline{\today} -%\printnomenclature[1cm] -\vspace{.25in} - -This application simulates the evolution of the metal-electrolyte interface during the anodic corrosion reaction. The model employed [Chadwick et al., J. Electrochem. Soc.,{\bf 10}, C633-C646 (2018)] uses the phase-field and smoothed boundary methods to track the moving metal/electrolyte interface and to couple it to mass transport (diffusion and migration) within the electrolyte and Butler-Volmer electrochemical kinetics. -\section{Free Energy} -Consider a free energy expression of the form: -\begin{equation} - \Pi(\eta,\psi) = \int_{\Omega} \left( W f_0(\eta,\psi)+ \frac{\epsilon^2}{2} |\grad \eta|^2 + \frac{\epsilon^2}{2} |\grad \psi|^2 \right) dV -\end{equation} -\noindent with $f_0$ given by -\begin{equation} - f_0(\eta,\psi) = \left( \frac{\eta^4}{4} - \frac{\eta^2}{2} \right) + \left( \frac{\psi^4}{4} - \frac{\psi^2}{2} \right) + \gamma ~\eta^2 \psi^2, -\end{equation} -\noindent where the fields $\eta$ and $\psi$ represent the physical domain of the metal and the liquid electrolyte, respectively, $W$ is the height of the free energy wall, $\epsilon^2$ is the gradient energy coefficient, and $\gamma$ is a phenomenological parameter that quantifies the free energy increase at overlapping interfaces. -\section{Governing Equations} -The evolution of the system is determined via the constrained minimization of the free energy with respect to $\eta$ and $\psi$ coupled to the electrochemical kinetics at the interface and the transport of ionic species in the electrolyte. The order parameter is evolved according to the advective Cahn-Hilliard equation: -\begin{equation} -\label{CH_eta} - \frac{\partial \eta}{\partial t} = \nabla \cdot \left[ M(\psi) \nabla \frac{\delta \Pi}{\delta \eta}\right] + v |\nabla \psi|, - \end{equation} -\noindent where $M$ is the Cahn-Hilliard mobility coefficient and $v$ is the velocity of the interface normal to the surface, which is related to the reaction current at the interface via Faraday's law of electrolysis: -\begin{equation} -\label{int_vel} -v=-\frac{V_M i_{rxn}}{z_M F} - \end{equation} -\noindent where $V_M$ is the molar volume of the metal, $i_{rxn}$ is the reaction current density, $z_M$ is the dissolved metal cation charge number, and $F$ is Faraday's constant. The interfacial mobility, $M$, is set as a function of the local current density, -\begin{equation} -M=2\frac{V_M |i_{rxn}| \psi}{z_M F}\sqrt{\frac{2 \epsilon^2}{W}} -\end{equation} -The evolution of $\psi$ employs the advective Cahn-Hilliard equation, but with the opposite sign of the advective source term in Eq. \eqref{CH_eta}: -\begin{equation} -\label{CH_psi} - \frac{\partial \psi}{\partial t} = \nabla \cdot \left[ M(\psi) \nabla \frac{\delta \Pi}{\delta \psi} \right] - v |\nabla \psi|. - \end{equation} - The smoothed boundary method (SBM) [H.-C. Yu, H.-Y. Chen, and K. Thornton, Model. Simul. Mater. Sci. Eng. {\bf 20}, 075008 -(2012)] is employed to confine the transport of ionic species to the electrolyte region, where $\psi > 0$. Thus, the ionic transport equations are coupled to the phase field method by using $\psi$ as the domain parameter. The electrolyte is assumed to be composed of three ionic species: an effective cation species for the metal (M) dissolved at the interface, a supporting cation (+), and a supporting anion (-). The electrolyte is assumed to be electroneutral, which implies that that the following constraint must be satisfied, -\begin{equation} -\label{electroneutrality} -z_M c_M + z_+ c_+ + z_-c_- = 0. - \end{equation} -Thus, the concentrations are not independent of each other only two additional equations are required to describe the concentration evolution for all three species. The concentrations of the effective metal cation and the supporting electrolyte cation are directly solved and the supporting anion concentration is eliminated via Eq. \eqref{electroneutrality}. The SBM reformulated governing equation for each species, $i$, which includes diffusion and migration effects, is given by -\begin{equation} -\label{conc_dynamics} -\frac{\partial c_i}{\partial t}=\frac{1}{\psi} \nabla \cdot (\psi D_i \nabla c_i) + \frac{1}{\psi} \left( \frac{z_i F}{RT} \nabla \cdot (\psi D_i c_i \nabla \Phi) \right) -+ \frac{|\nabla \psi|}{\psi} \left( \frac{i_{rxn}}{z_i F} \right) -\end{equation} -\noindent where $c_i =c_M, c_+$ and $\Phi$ is the electrostatic potential. The last term of the right hand side of Eq. \eqref{conc_dynamics} is zero for $c_i =c_+$ because $i_{rxn}$ is the reaction current density for the dissolution of the metal (M), which does not involve the supporting cation (+) and anion (-). The SBM reformulated governing equation for the potential is -\begin{equation} -\nabla \cdot (\psi \kappa \nabla \Phi) = F \nabla \cdot \left[ \psi \left( z_M (D_- - D_M) \nabla c_M + z_+ (D_- - D_+) \nabla c_+ \right) \right] - |\nabla \psi | i_{rxn}, -\end{equation} -where -\begin{equation} -\kappa =\frac{F^2}{RT}\left[ z_Mc_M\left( z_MD_M-z_-D_-\right) + z_+c_+\left( z_+D_+-z_-D_-\right) \right]. -\end{equation} -The reaction current density is obtained via a Butler-Volmer type kinetic expression that includes a maximum current density that accounts for both how far the electrolyte is from saturation at a point in time as well as the rate of transport of ions into the electrolyte: -\begin{equation} -\frac{i_{rxn}}{i_{corr}}= \left( 1 - \frac{i_{rxn}}{i_{max,c}} \right) \exp \left( \frac{z_M (1-\beta) F}{RT}\xi \right), -\end{equation} -where $i_{max,c}$ is the maximum reaction current density, $\beta$ is the the charge transfer symmetry factor and $\xi$ is the overpotential, defined as $\xi=V_s-E_{corr}-\Phi$. The parameters $i_{corr}$ and $E_{corr}$ are the corrosion current density and corrosion potential, respectively, and $V_s$ is the applied potential. The maximum reaction current density is given by -\begin{equation} -i_{max,c}=\left( \frac{z_M F}{1-c_M V_M} \right) \left[ \frac{2\delta}{\tau}(c_{M,sat} - c_M ) + \left( D_M\nabla c_M +z_M\frac{F}{RT}D_M c_M \nabla \Phi \right) \cdot \mathbf{n} \right], -\end{equation} -where $c_{M,sat}$ is the saturation concentration of the metal ions in solution and $2\delta/\tau$ is a characteristic velocity of ion transport across the diffuse interface. This velocity is given by the largest value between the characteristic velocities of diffusion and of migration: -\begin{equation} -\frac{2\delta}{\tau}=\max \left( \frac{D_M}{2\delta}, \left| \frac{z_M D_M F \nabla \Phi \cdot \mathbf{n}}{RT} \right| \right). -\end{equation} -\section{Time Discretization} -The fields $\eta$, $\psi$, $c_M$ and $c_+$ are solved using an explicit Euler method for time integration. For $\eta$ and $\psi$ we employ a splitting strategy to transform Eqs. \eqref{CH_eta} and \eqref{CH_psi} into second order PDEs: -\begin{equation} -\label{eta_eq} - \frac{\partial \eta}{\partial t} = \nabla \cdot \left( M \nabla \mu_\eta \right) + v |\nabla \psi| -\end{equation} -and -\begin{equation} -\label{psi_eq} -\frac{\partial \psi}{\partial t} = \nabla \cdot \left( M \nabla \mu_\psi \right) - v |\nabla \psi|, -\end{equation} -where -\begin{equation} -\label{mueta_eq} -\mu_\eta=W \left( \eta^3 - \eta +2 \gamma \eta \psi^2 \right) -\epsilon^2 \nabla^2 \eta -\end{equation} -and -\begin{equation} -\label{mupsi_eq} -\mu_\psi=W \left( \psi^3 - \psi +2 \gamma \psi \eta^2 \right) -\epsilon^2 \nabla^2 \psi. -\end{equation} -Considering forward Euler explicit time stepping, the time-discretized version of the equations above are -\begin{equation} -\label{eta_eq_td} -\eta^{n+1} = \eta^n + \Delta t \left[ \nabla \cdot \left( M \nabla \mu_\eta^n \right) + v |\nabla \psi^n| \right], -\end{equation} -\begin{equation} -\label{psi_eq_td} -\psi^{n+1} = \psi^n + \Delta t \left[ \nabla \cdot \left( M \nabla \mu_\psi^n \right) - v |\nabla \psi^n | \right], -\end{equation} -\begin{equation} -\label{mueta_eq_td} -\mu_\eta^{n+1}=f_\eta^n -\epsilon^2 \nabla^2 \eta^n, -\end{equation} -and -\begin{equation} -\label{mupsi_eq_td} -\mu_\psi^{n+1}=f_\psi^n -\epsilon^2 \nabla^2 \psi^n, -\end{equation} -where $f_\eta=W \left( \eta^3 - \eta +2 \gamma \eta \psi^2 \right)$ and $f_\psi= W \left( \psi^3 - \psi +2 \gamma \psi \eta^2 \right)$.\\ -The discretized equation for the ion concentrations are -\begin{equation} -\label{conc_eq_td} -c_i ^{n+1}= c_i^n + \Delta t \left[ \frac{1}{\psi^n} \nabla \cdot (\psi^n D_i \nabla c_i^n) + \frac{1}{\psi^n} \left( \frac{z_i F}{RT} \nabla \cdot (\psi^n D_i c_i^n \nabla \Phi^n) \right)+ \frac{|\nabla \psi^n|}{\psi^n} \left( \frac{i_{rxn}}{z_i F} \right) \right]. -\end{equation} -The electrostatic potential is assumed to be in equilibrium throughout the simulation and needs to be solved as a non-linear time-independent equation. -\section{Weak Formulation} -For the weak formulation of time-discretized equations \eqref{eta_eq_td}-\eqref{conc_eq_td} only RHS terms need to be specified (see \href{https://prisms-center.github.io/phaseField/doxygen_files/app_files.html}{\textcolor{blue}{User Manual}} for details) -\begin{equation} -\int_{\Omega} \omega \eta^{n+1} dV = \int_{\Omega} \omega \underbrace{\left( \eta^n +\Delta t v |\psi^n|\right)}_{r_\eta}dV + \int_{\Omega} \nabla \omega \cdot \underbrace{\left(- \Delta t M \nabla \mu_\eta^n \right)}_{r_{\eta x}}dV -\end{equation}' -\begin{equation} -\int_{\Omega} \omega \mu_\eta^{n+1} dV = \int_{\Omega} \omega \underbrace{f_\eta^n}_{r_{\mu \eta}}dV + \int_{\Omega} \nabla \omega \cdot \underbrace{(\epsilon^2\nabla\eta^n)}_{r_{\mu \eta x}}dV -\end{equation} -\begin{equation} -\int_{\Omega} \omega \psi^{n+1} dV = \int_{\Omega} \omega \underbrace{\left( \psi^n -\Delta t v |\psi^n|\right)}_{r_\psi} dV+ \int_{\Omega} \nabla \omega \cdot \underbrace{\left(- \Delta t M \nabla \mu_\psi^n \right)}_{r_{\psi x}}dV -\end{equation} -\begin{equation} -\int_{\Omega} \omega \mu_\psi^{n+1} dV = \int_{\Omega} \omega \underbrace{f_\psi^n}_{r_{\mu \psi}}dV + \int_{\Omega} \nabla \omega \cdot \underbrace{(\epsilon^2\nabla\psi^n)}_{r_{\mu \psi x}}dV -\end{equation} -\begin{align} -\int_{\Omega} \omega c_i^{n+1} dV &=\int_{\Omega} \omega \underbrace{\left( c_i^n+\frac{\Delta t D_i}{\psi^n}\nabla\psi^n\cdot\nabla c_i^n -+\frac{\Delta t D_i z_i F}{RT\psi^n}\nabla\psi^n\cdot(c_i^n\nabla \Phi^n) +\frac{\Delta t}{z_i F\psi^n} |\nabla\psi^n| i_{rxn}\right)}_{r_{ci}} dV\\ -&+ \int_{\Omega} \nabla \omega \cdot \underbrace{\left( -\Delta t D_i \nabla c_i^n -\frac{\Delta t D_i z_i F}{RT} c_i^n\nabla \Phi^n \right)}_{r_{cix}}dV -\end{align} - -For the time-independent electrostatic potential, we need to specify LHS and RHS terms: -\begin{align} -&\int_{\Omega} \omega \underbrace{\left( \frac{\partial i_{rxn}}{\partial \Phi}^n |\nabla\psi^n| \Delta\Phi\right)}_{r_{\Delta \Phi}} dV -+ \int_{\Omega} \nabla\omega \cdot \underbrace{\left( -\psi^n \kappa \nabla(\Delta\Phi)\right)}_{r_{\Delta \Phi x}} dV =\\ -&\int_{\Omega} \omega \underbrace{\left( -|\nabla\psi^n| i_{rxn} \right)}_{r_\Phi} dV + \int_{\Omega} \nabla\omega \cdot \underbrace{\left( -F \left[ \left( z_M (D_- - D_M) \nabla c_M^n + z_+ (D_- - D_+) \nabla c_+^n \right) \right] +\psi^n \kappa \nabla\Phi^n \right)}_{r_\Phi x} dV -\end{align} - -The above values of are used to define the equation terms in the input file $applications/corrosion/equations.cc$. - -\end{document} diff --git a/applications/corrosion_microgalvanic/corrosion_microgalvanic.md b/applications/corrosion_microgalvanic/corrosion_microgalvanic.md new file mode 100644 index 000000000..3c62411fc --- /dev/null +++ b/applications/corrosion_microgalvanic/corrosion_microgalvanic.md @@ -0,0 +1,469 @@ +# Microgalvanic Corrosion (July 8, 2022) + +This application simulates the evolution of the metal-electrolyte interface due to the microgalvanic coupling between the anodic and cathodic metals when immersed in the electrolyte. This model uses phase-field and smooth boundary methods to track the moving electrolyte/metal interface of the anodic phase. The electrolyte in this model is considered well-mixed; therefore, the model does not consider the effect of diffusion in the electrolyte. See Table 1 for the variable/parameter names in the code corresponding to each of the terms defined below. + +## Free Energy Functional + +Consider the free energy functional of the form + +$$ +\begin{equation} + \widetilde {\mathcal F} = \int_\Omega \left(f_0\left(\{\varphi_j\},\psi\right)+\frac{\widetilde\epsilon^2}{2}\left(\sum^2_{j=1}|\nabla\varphi_j|^2+|\nabla\psi|^2\right)\right)d\Omega, +\end{equation} +$$ + +where $\widetilde {\mathcal F}$ represents the total free energy of the system scaled by the bulk free energy density coefficient, $W$, and $\tilde{\epsilon}^2=\epsilon/W$ is the rescaled gradient energy coefficient. Here $\psi$ and $\varphi_j$ represent the order parameter for the electrolyte phase and for the $j^{th}$ metal phase respectively. The dimensionless bulk free energy density, $f_0$, is given by + +$$ +\begin{equation} +f_0\left(\{\varphi_j\},\psi\right)= \sum^N_{j=1}\left(\frac{\varphi_j^4}{4}-\frac{\varphi_j^2}{2}\right)+\left(\frac{\psi^4}{4}-\frac{\psi^2}{2}\right)+\frac{3}{2}\sum^N_{j=1}\sum^N_{k>j}\varphi_j^2\varphi_k^2+\frac{3}{2}\sum^N_{j=1} \varphi_j^2\psi^2. +\end{equation} +$$ + +In this application, we only consider two phases in the metal: the anodic phase, $\varphi_1$, and the cathodic phase, $\varphi_2$. + + +## Phase-field Equations +The evolution of the anodic metal/electrolyte interface is governed by Cahn-Hilliard equations with a source term for $\varphi_1$ and $\psi$, + +$$ +\begin{equation} +\frac{\partial \varphi_1}{\partial t} = \nabla \cdot \left(M\nabla\frac{\delta \widetilde F}{\delta \varphi_1} \right)+v\big|\nabla \psi \big| +\end{equation} +$$ + +and + +$$ +\begin{equation} +\frac{\partial \psi}{\partial t} = \nabla \cdot \left(M\nabla\frac{\delta \widetilde F}{\delta \psi} \right)-v\big|\nabla \psi \big|. +\end{equation} +$$ + +Since we do not consider any deposition on the cathodic phase, the evolution of $\varphi_2$ is given by the Cahn-Hilliard equation, + +$$ +\begin{equation} +\frac{\partial\varphi_2}{\partial t}=\nabla \cdot \left(M\nabla\frac{\delta \widetilde F}{\delta \varphi_2} \right) +\end{equation} +$$ + +In the previous Eqs., $M$ is the Cahn-Hilliard mobility coefficient, assumed to be equal for all phases, and $v$ is the velocity of the interface normal to the surface, which is related to the reaction current at the interface via Faraday’s law of electrolysis: + +$$ +\begin{equation} +v = -\frac{V_m \xi_1 i_{rxn,1}}{z_mF}. +\end{equation} +$$ + +Here $V_m$ is the molar volume of the metal, $i_{rxn,1}$, is the anodic current density, $z_m$ is the dissolved metal cation charge number, and $F$ is Faraday’s constant. The variable $\xi_1$ is used as a weighing factor for the contribution of the anodic current density over the total current density. This factor is defined in the following section. The interfacial mobility, $M$, is set as a function of the local current density, + +$$ +\begin{equation} +M = 2\delta\frac{V_m|\xi_1 i_{rxn,1}|\psi}{z_mF}, +\end{equation} +$$ + +where $2\delta=2\sqrt{2\widetilde{\epsilon}^2}$ gives the equilibrium interfacial thickness. + +## Electrochemical Equations + +In general, the transport of the ionic species in the electrolyte is controlled by migration, diffusion, and convection. Though PRISMS-PF is capable of including diffusion, in this application, the electrolyte is considered to be well-stirred. The current density ${i_e}$ in the electrolyte is given by + +$$ +\begin{equation} +{i_e} = -\kappa_e\nabla\Phi_e +\end{equation} +$$ + +where $\kappa_e$ is the conductivity of the electrolyte while $\Phi_e$ is the electrostatic potential in the electrolyte. To satisfy the current continuity in the electrolyte, + +$$ +\begin{equation} +\nabla \cdot {i_e} = 0. +\end{equation} +$$ + +At the metal/electrolyte interface, the normal component of ${i_e}$ is equal to $i_{rxn}$ + +$$ +\begin{equation} +{i_e}\cdot{\hat n_{m/e}}=i_{rxn}. +\end{equation} +$$ + +where ${\hat n_{m/e}}$ is the unit normal vector of the metal/electrolyte interface pointing out of the metal. The previous Eqs. can combined using the Smoothed Boundary Method (SBM) [H.-C. Yu, H.-Y. Chen, and K. Thornton, Model. Simul. Mater. Sci. Eng. **20**, 075008 +(2012)] to obtain an expression for $\Phi_e$ within the electrolyte that includes the appropriate boundary condition at the metal/electrolyte interface. For this system, the SBM is applied with $\psi$ as the domain parameter. The resulting equation for $\Phi_e$ is given by + +$$ +\begin{equation} +\nabla\cdot\left(\psi\kappa_e\nabla\Phi_e\right) =-|\nabla\psi|i_{rxn}. +\end{equation} +$$ + +The anodic current density is given by + +$$ +\begin{equation} +i_{rxn,1} = \frac{i_{corr,1}\cdot e^{\frac{\eta_1}{A_1}}}{1+\frac{i_{corr,1}\cdot e^{\frac{\eta_1}{A_{1}}}}{i_{max}}}, +\end{equation} +$$ + +where $i_{corr,1}$ is the corrosion current density of the anodic phase, $\eta_1$ is the anodic overpotential, given by + +$$ +\begin{equation} +\eta_1 = \Phi_m - \Phi_e - E_{corr,1}, +\end{equation} +$$ + +where $\Phi_m$ and $E_{corr,1}$ represent the applied electrostatic potential (we set is as zero because we consider free immersion) and the corrosion potential of the anodic metal, respectively. The constant $A_1$ is the Tafel slope of the anodic metal and $i_{max}$ is the maximum current density. The cathodic current density is given as + +$$ +\begin{equation} +i_{rxn,2}=-i_{corr,2}\cdot e^{\frac{\eta_2}{A_2}}, +\end{equation} +$$ + +where $i_{corr,2}$ is the corrosion current density of the cathodic phase, $\eta_2$ is the cathodic overpotential which is given in the same form as its anodic counterpart: + +$$ +\begin{equation} +\eta_2 = \Phi_m - \Phi_e - E_{corr,2}, +\end{equation} +$$ + +where $E_{corr,2}$ represents the corrosion potential of the cathodic metal. The reaction current density $i_{rxn}$ is formulated as a linear combination of $i_{rxn,1}$ and $i_{rxn,2}$ + +$$ +\begin{equation} +i_{rxn} = \sum_{j=1}^{2}\xi_{j}i_{rxn,j}, +\end{equation} +$$ + +where $\xi_j$ is an interpolation function that varies from 0 to 1, which indicates the region of each of the metal phases. We define $\xi$ for each of the metal phases as + +$$ +\begin{equation} +\xi_{2} = \frac{\varphi_{2}}{max\left(\varphi_1 + \varphi_2,\zeta\right)}, +\end{equation} +$$ + +and + +$$ +\begin{equation} +\xi_{1} = 1- \varphi_2, +\end{equation} +$$ + +where $\zeta$ is small regularization constant added to the denominator to avoid division by zero. + +## Time Discretization + +The fields $\varphi_1$, $\varphi_2$ and $\psi$ are solved using an explicit Euler method for time integration. For we employ a splitting strategy to transform Eqs. 3, 4, and 5, into second order PDEs + +$$ +\begin{equation} +\frac{\partial \varphi_1}{\partial t} = \nabla \cdot \left(M\nabla\mu_1 \right)+v\big|\nabla \psi \big|, +\end{equation} +$$ + +$$ +\begin{equation} +\frac{\partial\varphi_2}{\partial t}=\nabla \cdot \left(M\nabla\mu_2 \right), +\end{equation} +$$ + +and + +$$ +\begin{equation} +\frac{\partial \psi}{\partial t} = \nabla \cdot \left(M\nabla\mu_{\psi} \right)-v\big|\nabla \psi \big|, +\end{equation} +$$ + +where + +$$ +\begin{equation} +\mu_{1}=f_1-\widetilde{\epsilon}^2\nabla^2\varphi_{1}, +\end{equation} +$$ + +$$ +\begin{equation} +\mu_{2}=f_2-\widetilde{\epsilon}^2\nabla^2\varphi_{2}, +\end{equation} +$$ + +and + +$$ +\begin{equation} +\mu_{\psi}=f_{\psi}-\widetilde{\epsilon}^2\nabla^2\psi. +\end{equation} +$$ + +The terms $f_1$, $f_2$ and $f_\psi$ are given by + +$$ +\begin{equation} +f_1=W\left(\varphi_{1}^3-\varphi_{1}+3\varphi_{1}\varphi_{2}^2+3\varphi_{1}\psi^2\right), +\end{equation} +$$ + +$$ +\begin{equation} +f_2=W\left(\varphi_{2}^3-\varphi_{2}+3\varphi_{2}\varphi_{1}^2+3\varphi_{2}\psi^2\right). +\end{equation} +$$ + +and + +$$ +\begin{equation} +f_{\psi}= W\left(\psi^3-\psi+3\psi\varphi_{1}^2+3\psi\varphi_{2}^2\right), +\end{equation} +$$ + +Considering forward Euler explicit time stepping, the time-discretized versions of the equations above are + +$$ +\begin{equation} +\varphi^{n+1}_1 = \varphi^n_1+\Delta t \left(\nabla\cdot \left(M\nabla\mu^n_1\right)+v|\nabla \psi^n|\right), +\end{equation} +$$ + +$$ +\begin{equation} +\varphi^{n+1}_2 = \varphi^n_2+\Delta t \nabla\cdot \left(M\nabla\mu^n_2\right), +\end{equation} +$$ + +and + +$$ +\begin{equation} +\psi^{n+1} = \psi^n+\Delta t \left(\nabla\cdot\left(M\nabla\mu^n_{\psi}\right)-v|\nabla\psi^n|\right), +\end{equation} +$$ + +where + +$$ +\begin{equation} +\mu^n_1=f^n_1-\widetilde{\epsilon}^2\nabla^2\varphi^n_1, +\end{equation} +$$ + +$$ +\begin{equation} +\mu^n_2=f^n_2-\widetilde{\epsilon}^2\nabla^2\varphi^n_2, +\end{equation} +$$ + +and + +$$ +\begin{equation} +\mu^n_{\psi}=f^n_{\psi}-\widetilde{\epsilon}^2\nabla^2\psi^n. +\end{equation} +$$ + +## Weak Formulation + +The weak formulation for Eqs. 28-33 is derived by multiplying by a test function, $\omega$, and integrating over the whole system. After applying the divergence theorem and rearranging in order to obtain only first-order spatial derivatives, the terms denoted as 'value' terms are those that multiply the test function and the terms denoted as 'gradient' terms are those that multiply by the gradient of the test function, $\nabla \omega$(see `https://prisms-center.github.io/phaseField/doxygen_files/app_files.html` for details). The 'value' and 'gradient' terms are obtained from the following equations: + +$$ +\begin{align} +\int_\Omega \omega \varphi_1^{n+1}dV = \int_\Omega \omega\left(\varphi_1^{n}+\Delta tv|\nabla\psi^n|\right)dV + \int_\Omega \nabla\omega\cdot \left(-\Delta t M\nabla\mu_1^{n}\right) dV +\end{align} +$$ + +$$ +\begin{align} +r_1 &= \left(\varphi^{n}_1+\Delta tv|\nabla\psi^n|\right) +\end{align} +$$ + +$$ +\begin{align} +r_{1 x} &= \left(-\Delta t M\nabla\mu_1^{n}\right) +\end{align} +$$ + +$$ +\begin{align} +\int_\Omega \omega \varphi_2^{n+1}dV = \int_\Omega \omega \varphi_2^n dV + \int_\Omega \nabla\omega\cdot \left(-\Delta t M\nabla\mu_2^{n}\right) dV +\end{align} +$$ + +$$ +\begin{align} +r_2 &= \varphi^n_2 +\end{align} +$$ + +$$ +\begin{align} +r_{2x} &= \left(-\Delta t M\nabla\mu^{n}_2\right) +\end{align} +$$ + +$$ +\begin{align} +\int_\Omega \omega \psi^{n+1}dV = \int_\Omega \omega \left(\psi^n-\Delta tv|\nabla\psi^n|\right) dV + \int_\Omega \nabla\omega\cdot \left(-\Delta t M\nabla\mu^n_{\psi}\right) dV +\end{align} +$$ + +$$ +\begin{align} +r_{\psi} &= \left(\psi^n-\Delta tv|\nabla\psi^n|\right) +\end{align} +$$ + +$$ +\begin{align} +r_{\psi x} &= \left(-\Delta t M\nabla\mu^n_{\psi}\right) +\end{align} +$$ + +$$ +\begin{align} +\int_\Omega \omega\mu_1^{n+1}dV = \int_\Omega \omega f^n_1 dV +\int_\Omega \nabla\omega\cdot \left(\widetilde{\epsilon}^2\nabla\varphi^n_1\right) dV +\end{align} +$$ + +$$ +\begin{align} +r_{\mu 1} &= f^n_1 +\end{align} +$$ + +$$ +\begin{align} +r_{\mu 1 x} &= \left(\widetilde{\epsilon}^2\nabla\varphi^n_1\right) +\end{align} +$$ + +$$ +\begin{align} +\int_\Omega \omega\mu_2^{n+1} dV = \int_\Omega \omega f^n_2 dV +\int_\Omega \nabla\omega\cdot \left(\widetilde{\epsilon}^2\nabla\varphi^n_2\right) dV +\end{align} +$$ + +$$ +\begin{align} +r_{\mu 2} &= f^n_2 +\end{align} +$$ + +$$ +\begin{align} +r_{\mu 2 x} &= \left(\widetilde{\epsilon}^2\nabla\varphi^n_2\right) +\end{align} +$$ + +$$ +\begin{align} +\int_\Omega \omega\mu_{\psi}^{n+1}dV = \int_\Omega \omega f^n_{\psi} dV +\int_\Omega \nabla\omega\cdot \left(\widetilde{\epsilon}^2\nabla\psi^n\right) dV +\end{align} +$$ + +$$ +\begin{align} +r_{\mu\psi} &= f^n_{\psi} +\end{align} +$$ + +$$ +\begin{align} +r_{\mu\psi x} &= \left(\widetilde{\epsilon}^2\nabla\psi^n\right) +\end{align} +$$ + +For the weak formulation of the time-independent electrostatic potential equation we need to specify LHS and RHS terms. To write the equation in terms of a Newton iteration, the solution, $\Phi_e$, can be written as the sum of an initial guess, $\Phi^0_e$, and an update, $\Delta \Phi_e$ (see `https://prisms-center.github.io/phaseField/doxygen_files/app_files.html` for details): + +$$ +\begin{align} +\int_\Omega \omega \left(\left(\frac{\partial i_{rxn}}{\partial\Phi_e}\right)_{\Phi_e = \Phi_e^0}|\nabla\psi|\Delta\Phi_e\right)dV +\end{align} +$$ + +$$ +\begin{align} +&+ \int_\Omega \nabla\omega \cdot \left(-\psi\kappa_e\nabla\left(\Delta\Phi_e\right)\right)dV=\int_\Omega\omega \left(-|\nabla\psi|i_{rxn}\right)dV+\int_\Omega\nabla\omega\cdot \left(\psi\kappa_e\nabla\Phi^0_e\right)dV, +\end{align} +$$ + +$$ +\begin{align} +r_{\Delta \Phi_e} &= \left(\left(\frac{\partial i_{rxn}}{\partial\Phi_e}\right)_{\Phi_e = \Phi^0_e}|\nabla\psi|\Delta\Phi_e\right) +\end{align} +$$ + +$$ +\begin{align} +r_{\Delta \Phi_e x} &= \left(-\psi\kappa_e\nabla\left(\Delta\Phi_e\right)\right) +\end{align} +$$ + +$$ +\begin{align} +r_{\Phi^0_e} &= \left(-|\nabla\psi|i_{rxn}\right) +\end{align} +$$ + +$$ +\begin{align} +r_{\Phi^0_ex} &= \left(\psi\kappa_e\nabla\Phi^0_e\right) +\end{align} +$$ + +where + +$$ +\begin{align} +\frac{\partial i_{rxn}}{\partial \Phi_e} = -\xi_{1}\left(\frac{i_{max}}{i_{max}+i_{corr,1}\cdot e^{\frac{\eta_1}{A_{1}}}}\right)^2\left(\frac{i_{corr,1}\cdot e^{\frac{\eta_1}{A_{1}}}}{A_1}\right)-\xi_{2}\left(\frac{i_{rxn,2}}{A_2}\right). +\end{align} +$$ + +The above values of are used to define the equation terms in the input file: +`applications/corrosion\_microgalvanic/equations.cc` + + + + + + |Name in the model equations | Variable/parameter name in the code | + |----------------------------|-------------------------------------| +| $\varphi_1$ | nAnodic | +| $\varphi_2$ | nCathodic | +| $\psi$ | psi | +| $v$ | v | +| $M$ | MnV | +| $V_m$ | VMV | +| $z_m$ | zMV | +| $\delta$ | delta | +| $\widetilde{{\epsilon}}^2$ | epssqV | +| $\kappa_e$ | kappa | +| $\Phi_e$ | Phi | +| $i_{corr,1}$ | i0Anodic | +| $i_{corr,2}$ | i0Cathodic | +| $i_{rxn,1}$ | iAnodic | +| $i_{rxn,2}$ | iCathodic | +| $i_{max}$ | iMax | +| $\eta_1$ | etaAnodic | +| $\eta_2$ | etaCathodic | +| \xi_1$ | xiAnodic | +| $\xi_2$ | xiCathodic | +| $A_1$ | AAnodic | +| $A_2$ | ACathodic | +| $E_{corr,1}$ | EcorrAnodic | +| $E_{corr,2}$ | EcorrCathodic | +| $\zeta$ | lthresh | + + +Table 1: Variables/parameters names used in the model equations and the corresponding names used in the code + diff --git a/applications/corrosion_microgalvanic/corrosion_microgalvanic.pdf b/applications/corrosion_microgalvanic/corrosion_microgalvanic.pdf deleted file mode 100644 index d28f5f2b0..000000000 Binary files a/applications/corrosion_microgalvanic/corrosion_microgalvanic.pdf and /dev/null differ diff --git a/applications/corrosion_microgalvanic/tex_files/corrosion_microgalvanic.pdf b/applications/corrosion_microgalvanic/tex_files/corrosion_microgalvanic.pdf deleted file mode 100644 index d28f5f2b0..000000000 Binary files a/applications/corrosion_microgalvanic/tex_files/corrosion_microgalvanic.pdf and /dev/null differ diff --git a/applications/corrosion_microgalvanic/tex_files/corrosion_microgalvanic.tex b/applications/corrosion_microgalvanic/tex_files/corrosion_microgalvanic.tex deleted file mode 100644 index 36fd8cdc8..000000000 --- a/applications/corrosion_microgalvanic/tex_files/corrosion_microgalvanic.tex +++ /dev/null @@ -1,329 +0,0 @@ -\documentclass[11pt]{article} -\usepackage{multicol} % Allows for multiple columns -\usepackage[dvips,letterpaper,margin=0.75in,bottom=0.5in]{geometry} -\usepackage{physics,amsmath} -\usepackage{hyperref} -\usepackage{mathtools} -\usepackage{setspace} -\usepackage{multirow} -\usepackage{array} -\usepackage{longtable} -\usepackage{cleveref} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - % Sets margins and page size -\pagestyle{empty} % Removes page numbers -\makeatletter % Need for anything that contains an @ command -\renewcommand{\maketitle} % Redefine maketitle to conserve space -{ \begingroup \vskip 10pt \begin{center} \large {\bf \@title} - \vskip 10pt \end{center} - \vskip 10pt \endgroup \setcounter{footnote}{0} } - -% no paragraph indentation -\setlength{\parindent}{0pt} - -% hyperlink settings -\hypersetup{ - colorlinks=true, - linkcolor=blue, - filecolor=magenta, - urlcolor=cyan, - pdfpagemode=FullScreen, -} - -\makeindex -\title{\huge Microgalvanic Corrosion} -\begin{document} -\maketitle -\centerline{\today} -%\printnomenclature[1cm] -\vspace{.25in} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -This application simulates the evolution of the metal-electrolyte interface due to the microgalvanic coupling between the anodic and cathodic metals when immersed in the electrolyte. This model uses phase-field and smooth boundary methods to track the moving electrolyte/metal interface of the anodic phase. The electrolyte in this model is considered well-mixed; therefore, the model does not consider the effect of diffusion in the electrolyte. See Table 1 for the variable/parameter names in the code corresponding to each of the terms defined below. - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\bigskip -\section{Free Energy Functional} - -Consider the free energy functional of the form - -\begin{equation} \label{free_energy} - \widetilde {\mathcal F} = \int_\Omega \left(f_0\left(\{\varphi_j\},\psi\right)+\frac{\widetilde\epsilon^2}{2}\left(\sum^2_{j=1}|\nabla\varphi_j|^2+|\nabla\psi|^2\right)\right)d\Omega, -\end{equation} - -where $\widetilde {\mathcal F}$ represents the total free energy of the system scaled by the bulk free energy density coefficient, $W$, and $\tilde{\epsilon}^2=\epsilon/W$ is the rescaled gradient energy coefficient. Here $\psi$ and $\varphi_j$ represent the order parameter for the electrolyte phase and for the $j^{th}$ metal phase respectively. The dimensionless bulk free energy density, $f_0$, is given by - -\begin{equation} \label{f0} -f_0\left(\{\varphi_j\},\psi\right)= \sum^N_{j=1}\left(\frac{\varphi_j^4}{4}-\frac{\varphi_j^2}{2}\right)+\left(\frac{\psi^4}{4}-\frac{\psi^2}{2}\right)+\frac{3}{2}\sum^N_{j=1}\sum^N_{k>j}\varphi_j^2\varphi_k^2+\frac{3}{2}\sum^N_{j=1} \varphi_j^2\psi^2. -\end{equation} - -In this application, we only consider two phases in the metal: the anodic phase, $\varphi_1$, and the cathodic phase, $\varphi_2$. - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\bigskip -\section{Phase-field Equations} -The evolution of the anodic metal/electrolyte interface is governed by Cahn-Hilliard equations with a source term for $\varphi_1$ and $\psi$, - -\begin{equation} \label{dphi1dt} -\frac{\partial \varphi_1}{\partial t} = \nabla \cdot \left(M\nabla\frac{\delta \widetilde \mathcal F}{\delta \varphi_1} \right)+v\big|\nabla \psi \big| -\end{equation} - -and - -\begin{equation} \label{dpsidt} -\frac{\partial \psi}{\partial t} = \nabla \cdot \left(M\nabla\frac{\delta \widetilde \mathcal F}{\delta \psi} \right)-v\big|\nabla \psi \big|. -\end{equation} - -Since we do not consider any deposition on the cathodic phase, the evolution of $\varphi_2$ is given by the Cahn-Hilliard equation, - -\begin{equation} \label{dphi2dt} -\frac{\partial\varphi_2}{\partial t}=\nabla \cdot \left(M\nabla\frac{\delta \widetilde \mathcal F}{\delta \varphi_2} \right) -\end{equation} - -In Eqs. \eqref{dphi1dt}, \eqref{dpsidt}, and \eqref{dphi2dt}, $M$ is the Cahn-Hilliard mobility coefficient, assumed to be equal for all phases, and $v$ is the velocity of the interface normal to the surface, which is related to the reaction current at the interface via Faraday’s law of electrolysis: - -\begin{equation} \label{int_vel} -v = -\frac{V_m \xi_1 i_{rxn,1}}{z_mF}. -\end{equation} - -Here $V_m$ is the molar volume of the metal, $i_{rxn,1}$, is the anodic current density, $z_m$ is the dissolved metal cation charge number, and $F$ is Faraday’s constant. The variable $\xi_1$ is used as a weighing factor for the contribution of the anodic current density over the total current density. This factor is defined in the following section. The interfacial mobility, $M$, is set as a function of the local current density, - -\begin{equation} \label{mobility} -M = 2\delta\frac{V_m|\xi_1 i_{rxn,1}|\psi}{z_mF}, -\end{equation} - -where $2\delta=2\sqrt{2\widetilde{\epsilon}^2}$ gives the equilibrium interfacial thickness. - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\bigskip -\section{Electrochemical Equations} - -In general, the transport of the ionic species in the electrolyte is controlled by migration, diffusion, and convection. Though PRISMS-PF is capable of including diffusion, in this application, the electrolyte is considered to be well-stirred. The current density $\vb*{i_e}$ in the electrolyte is given by - -\begin{equation} \label{electrolyte_i_e} -\vb*{i_e} = -\kappa_e\nabla\Phi_e -\end{equation} - -where $\kappa_e$ is the conductivity of the electrolyte while $\Phi_e$ is the electrostatic potential in the electrolyte. To satisfy the current continuity in the electrolyte, - -\begin{equation} \label{curr_continuity} -\nabla \cdot \vb*{i_e} = 0. -\end{equation} - -At the metal/electrolyte interface, the normal component of $\vb*{i_e}$ is equal to $i_{rxn}$ - -\begin{equation} \label{i_e_BC} -\vb*{i_e}\cdot\vb*{\hat n_{m/e}}=i_{rxn}. -\end{equation} - -where $\vb*{\hat n_{m/e}}$ is the unit normal vector of the metal/electrolyte interface pointing out of the metal. \Cref{electrolyte_i_e,curr_continuity,i_e_BC} can combined using the Smoothed Boundary Method (SBM) [H.-C. Yu, H.-Y. Chen, and K. Thornton, Model. Simul. Mater. Sci. Eng. {\bf 20}, 075008 -(2012)] to obtain an expression for $\Phi_e$ within the electrolyte that includes the appropriate boundary condition at the metal/electrolyte interface. For this system, the SBM is applied with $\psi$ as the domain parameter. The resulting equation for $\Phi_e$ is given by - -\begin{equation} \label{Phi_e} -\nabla\cdot\left(\psi\kappa_e\nabla\Phi_e\right) =-|\nabla\psi|i_{rxn}. -\end{equation} - -The anodic current density is given by - -\begin{equation} \label{i_rxn_1} -i_{rxn,1} = \frac{i_{corr,1}\cdot e^{\frac{\eta_1}{A_1}}}{1+\frac{i_{corr,1}\cdot e^{\frac{\eta_1}{A_{1}}}}{i_{max}}}, -\end{equation} - -where $i_{corr,1}$ is the corrosion current density of the anodic phase, $\eta_1$ is the anodic overpotential, given by - -\begin{equation} \label{eta_1} -\eta_1 = \Phi_m - \Phi_e - E_{corr,1}, -\end{equation} - -where $\Phi_m$ and $E_{corr,1}$ represent the applied electrostatic potential (we set is as zero because we consider free immersion) and the corrosion potential of the anodic metal, respectively. The constant $A_1$ is the Tafel slope of the anodic metal and $i_{max}$ is the maximum current density. The cathodic current density is given as - -\begin{equation} \label{i_rxn_2} -i_{rxn,2}=-i_{corr,2}\cdot e^{\frac{\eta_2}{A_2}}, -\end{equation} - -where $i_{corr,2}$ is the corrosion current density of the cathodic phase, $\eta_2$ is the cathodic overpotential which is given in the same form as its anodic counterpart: - -\begin{equation} \label{eta_2} -\eta_2 = \Phi_m - \Phi_e - E_{corr,2}, -\end{equation} - -where $E_{corr,2}$ represents the corrosion potential of the cathodic metal. The reaction current density $i_{rxn}$ is formulated as a linear combination of $i_{rxn,1}$ and $i_{rxn,2}$ - -\begin{equation} \label{i_rxn} -i_{rxn} = \sum^{2}_{j=1}\xi_{j}i_{rxn,j}, -\end{equation} - -where $\xi_j$ is an interpolation function that varies from 0 to 1, which indicates the region of each of the metal phases. We define $\xi$ for each of the metal phases as - -\begin{equation} \label{xi_2} -\xi_{2} = \frac{\varphi_{2}}{max\left(\varphi_1 + \varphi_2,\zeta\right)}, -\end{equation} - -and - -\begin{equation} \label{xi_1} -\xi_{1} = 1- \varphi_2, -\end{equation} - -where $\zeta$ is small regularization constant added to the denominator to avoid division by zero. - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\bigskip -\section{Time Discretization} - -The fields $\varphi_1$, $\varphi_2$ and $\psi$ are solved using an explicit Euler method for time integration. For we employ a splitting strategy to transform Eqs. \eqref{dphi1dt}, \eqref{dpsidt}, and \eqref{dphi2dt}, into second order PDEs - -\begin{equation} \label{dphi1dt_split} -\frac{\partial \varphi_1}{\partial t} = \nabla \cdot \left(M\nabla\mu_1 \right)+v\big|\nabla \psi \big|, -\end{equation} - -\begin{equation} \label{dphi2dt_split} -\frac{\partial\varphi_2}{\partial t}=\nabla \cdot \left(M\nabla\mu_2 \right), -\end{equation} -and -\begin{equation} \label{dpsidt_split} -\frac{\partial \psi}{\partial t} = \nabla \cdot \left(M\nabla\mu_{\psi} \right)-v\big|\nabla \psi \big|, -\end{equation} - -where - -\begin{equation} \label{mu_phi1} -\mu_{1}=f_1-\widetilde{\epsilon}^2\nabla^2\varphi_{1}, -\end{equation} - -\begin{equation} \label{mu_phi2} -\mu_{2}=f_2-\widetilde{\epsilon}^2\nabla^2\varphi_{2}, -\end{equation} -and -\begin{equation} \label{mu_psi} -\mu_{\psi}=f_{\psi}-\widetilde{\epsilon}^2\nabla^2\psi. -\end{equation} - -The terms $f_1$, $f_2$ and $f_\psi$ are given by - -\begin{equation} \label{f_1} -f_1=W\left(\varphi_{1}^3-\varphi_{1}+3\varphi_{1}\varphi_{2}^2+3\varphi_{1}\psi^2\right), -\end{equation} - -\begin{equation} \label{f_2} -f_2=W\left(\varphi_{2}^3-\varphi_{2}+3\varphi_{2}\varphi_{1}^2+3\varphi_{2}\psi^2\right). -\end{equation} -and -\begin{equation} \label{f_psi} -f_{\psi}= W\left(\psi^3-\psi+3\psi\varphi_{1}^2+3\psi\varphi_{2}^2\right), -\end{equation} - -Considering forward Euler explicit time stepping, the time-discretized versions of the equations above are - -\begin{equation} \label{phi1_np1} -\varphi^{n+1}_1 = \varphi^n_1+\Delta t \left(\nabla\cdot \left(M\nabla\mu^n_1\right)+v|\nabla \psi^n|\right), -\end{equation} - -\begin{equation} \label{phi2_np1} -\varphi^{n+1}_2 = \varphi^n_2+\Delta t \nabla\cdot \left(M\nabla\mu^n_2\right), -\end{equation} -and -\begin{equation} \label{psi_np1} -\psi^{n+1} = \psi^n+\Delta t \left(\nabla\cdot\left(M\nabla\mu^n_{\psi}\right)-v|\nabla\psi^n|\right), -\end{equation} -where -\begin{equation} \label{mu1_n} -\mu^n_1=f^n_1-\widetilde{\epsilon}^2\nabla^2\varphi^n_1, -\end{equation} - -\begin{equation} \label{mu2_n} -\mu^n_2=f^n_2-\widetilde{\epsilon}^2\nabla^2\varphi^n_2, -\end{equation} -and -\begin{equation} \label{mu_psi_n} -\mu^n_{\psi}=f^n_{\psi}-\widetilde{\epsilon}^2\nabla^2\psi^n. -\end{equation} - - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\bigskip -\section{Weak Formulation} - -The weak formulation for Eqs. \labelcref{phi1_np1,phi2_np1,psi_np1,mu1_n,mu2_n,mu_psi_n} is derived by multiplying by a test function, $\omega$, and integrating over the whole system. After applying the divergence theorem and rearranging in order to obtain only first-order spatial derivatives, the terms denoted as 'value' terms are those that multiply the test function and the terms denoted as 'gradient' terms are those that multiply by the gradient of the test function, $\nabla \omega$(see \href{https://prisms-center.github.io/phaseField/doxygen_files/app_files.html}{User Manual - equations.cc} for details). The 'value' and 'gradient' terms are obtained from the following equations: - -\begin{equation} \label{phi1_weak} -\int_\Omega \omega \varphi^{n+1}_1dV = \int_\Omega \omega\underbrace{\left(\varphi^{n}_1+\Delta tv|\nabla\psi^n|\right)}_{r_1}dV + \int_\Omega \nabla\omega\cdot\underbrace{\left(-\Delta t M\nabla\mu^{n}_1\right)}_{r_{1 x}}dV -\end{equation} - -\begin{equation} \label{phi2_weak} -\int_\Omega \omega \varphi^{n+1}_2dV = \int_\Omega \omega\underbrace{\varphi^n_2}_{r_2}dV + \int_\Omega \nabla\omega\cdot\underbrace{\left(-\Delta t M\nabla\mu^{n}_2\right)}_{r_{2x}}dV -\end{equation} - -\begin{equation} \label{psi_weak} -\int_\Omega \omega \psi^{n+1}dV = \int_\Omega \omega\underbrace{\left(\psi^n-\Delta tv|\nabla\psi^n|\right)}_{r_{\psi}}dV + \int_\Omega \nabla\omega\cdot\underbrace{\left(-\Delta t M\nabla\mu^n_{\psi}\right)}_{r_{\psi x}}dV -\end{equation} - -\begin{equation} \label{mu1_weak} -\int_\Omega \omega\mu^{n+1}_1dV = \int_\Omega \omega \underbrace{f^n_1}_{r_{\mu 1}} dV +\int_\Omega \nabla\omega\cdot\underbrace{\left(\widetilde{\epsilon}^2\nabla\varphi^n_1\right)}_{r_{\mu 1 x}}dV -\end{equation} - -\begin{equation} \label{mu2_weak} -\int_\Omega \omega\mu^{n+1}_2dV = \int_\Omega \omega \underbrace{f^n_2}_{r_{\mu 2}} dV +\int_\Omega \nabla\omega\cdot\underbrace{\left(\widetilde{\epsilon}^2\nabla\varphi^n_2\right)}_{r_{\mu 2 x}}dV -\end{equation} - -\begin{equation} \label{mu_psi_weak} -\int_\Omega \omega\mu^{n+1}_{\psi}dV = \int_\Omega \omega \underbrace{f^n_{\psi}}_{r_{\mu\psi}} dV +\int_\Omega \nabla\omega\cdot\underbrace{\left(\widetilde{\epsilon}^2\nabla\psi^n\right)}_{r_{\mu\psi x}}dV -\end{equation} - -For the weak formulation of the time-independent electrostatic potential equation \labelcref{Phi_e} we need to specify LHS and RHS terms. To write the equation in terms of a Newton iteration, the solution, $\Phi_e$, can be written as the sum of an initial guess, $\Phi^0_e$, and an update, $\Delta \Phi_e$ (see \href{https://prisms-center.github.io/phaseField/doxygen_files/app_files.html}{User Manual - nonExplicitEquationRHS} for details): - -\begin{equation} \label{Phi_weak} -\int _\Omega \omega\underbrace{\left(\left(\frac{\partial i_{rxn}}{\partial\Phi_e}\right)_{\Phi_e = \Phi^0_e}|\nabla\psi|\Delta\Phi_e\right)}_{r_{\Delta \Phi_e}}dV+\int_\Omega \nabla\omega \cdot\underbrace{\left(-\psi\kappa_e\nabla\left(\Delta\Phi_e\right)\right)}_{r_{\Delta \Phi_e x}}dV=\int_\Omega\omega\underbrace{\left(-|\nabla\psi|i_{rxn}\right)}_{r_{\Phi^0_e}}dV+\int_\Omega\nabla\omega\cdot\underbrace{\left(\psi\kappa_e\nabla\Phi^0_e\right)}_{r_{\Phi^0_ex}}dV, -\end{equation} - -where - -\begin{equation} \label{dirxndPhi} -\frac{\partial i_{rxn}}{\partial \Phi_e} = -\xi_{1}\left(\frac{i_{max}}{i_{max}+i_{corr,1}\cdot e^{\frac{\eta_1}{A_{1}}}}\right)^2\left(\frac{i_{corr,1}\cdot e^{\frac{\eta_1}{A_{1}}}}{A_1}\right)-\xi_{2}\left(\frac{i_{rxn,2}}{A_2}\right). -\end{equation} - -The above values of are used to define the equation terms in the input file:\\ -{\it applications/corrosion\_microgalvanic/equations.cc} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\begin{table}[h] -\label{code_vars} -\begin{center} -\begin{tabular}{|c|c|} - \hline - Name in the model equations& Variable/parameter name in the code\\ - \hline - $\varphi_1$ &nAnodic \\ - $\varphi_2$ &nCathodic \\ - $\psi$ &psi \\ - $v$ &v \\ - $M$ &MnV \\ - $V_m$ &VMV \\ - $z_m$ &zMV \\ - $\delta$ &delta \\ - $\widetilde{{\epsilon}}^2$ &epssqV \\ - $\kappa_e$ &kappa \\ - $\Phi_e$ &Phi \\ - $i_{corr,1}$ &i0Anodic \\ - $i_{corr,2}$ &i0Cathodic \\ - $i_{rxn,1}$ &iAnodic \\ - $i_{rxn,2}$ &iCathodic \\ - $i_{max}$ &iMax \\ - $\eta_1$ &etaAnodic \\ - $\eta_2$ &etaCathodic \\ - $\xi_1$ &xiAnodic \\ - $\xi_2$ &xiCathodic \\ - $A_1$ &AAnodic \\ - $A_2$ &ACathodic \\ - $E_{corr,1}$ &EcorrAnodic \\ - $E_{corr,2}$ &EcorrCathodic \\ - $\zeta$ <hresh \\ - \hline -\end{tabular} -\caption{Variables/parameters names used in the model equations and the corresponding names used in the code} -\end{center} -\end{table} - - -\end{document} \ No newline at end of file diff --git a/applications/coupledCahnHilliardAllenCahn/formulation_coupledCHAC.md b/applications/coupledCahnHilliardAllenCahn/formulation_coupledCHAC.md new file mode 100644 index 000000000..8ce7290ed --- /dev/null +++ b/applications/coupledCahnHilliardAllenCahn/formulation_coupledCHAC.md @@ -0,0 +1,128 @@ +# PRISMS PhaseField: Coupled Cahn-Hilliard and Allen-Cahn Dynamics + +Consider a free energy expression of the form: + +$$ +\begin{equation} + \Pi(c, \eta, \nabla \eta) = \int_{\Omega} \left( f_{\alpha}(1-H) + f_{\beta}H \right) + \frac{\kappa}{2} \nabla \eta \cdot \nabla \eta ~dV +\end{equation} +$$ + +where $f_{\alpha}$ and $f_{\beta}$ are the free energy densities corresponding to $\alpha$ and $\beta$ phases, respectively, and are functions of composition $c$. $H$ is a function of the structural order parameter $\eta$. Note that we don't have the gradient terms for the composition, i.e, $\nabla c$ terms, unlike classical Cahn-Hillard formulation. + +## Variational treatment +Following standard variational arguments (see Cahn-Hilliard formulation), we obtain the chemical potentials: + +$$ +\begin{align} + \mu_{c} &= (f_{\alpha,c}(1-H)+f_{\beta,c}H) +\end{align} +$$ + +$$ +\begin{align} + \mu_{\eta} &= (f_{\beta}-f_{\alpha})H_{,\eta} - \kappa \Delta \eta +\end{align} +$$ + +## Kinetics +Now the PDE for Cahn-Hilliard dynamics is given by: + +$$ +\begin{align} + \frac{\partial c}{\partial t} &= -~\nabla \cdot (-M_c\nabla \mu_c) +\end{align} +$$ + +$$ +\begin{align} + &=M_c~\nabla \cdot (\nabla (f_{\alpha,c}(1-H)+f_{\beta,c}H)) + \end{align} +$$ + +and the PDE for Allen-Cahn dynamics is given by: + +$$ + \begin{align} + \frac{\partial \eta}{\partial t} &= -M_\eta \mu_\eta +\end{align} +$$ + +$$ +\begin{align} + &=-M_\eta ~ ((f_{\beta}-f_{\alpha})H_{,\eta} - \kappa \Delta \eta) +\end{align} +$$ + +where $M_c$ and $M_\eta$ are the constant mobilities. + +## Time discretization +Considering forward Euler explicit time stepping, we have the time discretized kinetics equation: + +$$ +\begin{align} + \eta^{n+1} &= \eta^{n} - \Delta t M_{\eta}~ ((f_{\beta,c}^n-f_{\alpha,c}^n)H_{,\eta}^n - \kappa \Delta \eta^n) +\end{align} +$$ + +$$ +\begin{align} +c^{n+1} &= c^{n} + \Delta t M_{\eta}~\nabla \cdot (\nabla (f_{\alpha,c}^n(1-H^{n})+f_{\beta,c}^n H^{n})) +\end{align} +$$ + +## Weak formulation +In the weak formulation, considering an arbitrary variation $w$, the above equations can be expressed as residual equations: + +$$ +\begin{align} + \int_{\Omega} w \eta^{n+1} ~dV &= \int_{\Omega} w \eta^{n} - w \Delta t M_{\eta}~ ((f_{\beta,c}^n-f_{\alpha,c}^n)H_{,\eta}^n - \kappa \Delta \eta^n) ~dV +\end{align} +$$ + +$$ +\begin{align} + &=\int_{\Omega} w \left(\eta^{n} - \Delta t M_{\eta}~ ((f_{\beta,c}^n-f_{\alpha,c}^n)H_{,\eta}^n) \right)+ \nabla w \cdot (- \Delta t M_{\eta}\kappa) \nabla \eta^{n} ~dV +\end{align} +$$ + +$$ +\begin{align} +r_{\eta} &= \eta^{n} - \Delta t M_{\eta}~ ((f_{\beta,c}^n-f_{\alpha,c}^n)H_{,\eta}^n) +\end{align} +$$ + +$$ +\begin{align} +r_{\eta x} &= (- \Delta t M_{\eta}\kappa) \nabla \eta^{n} +\end{align} +$$ + +and + +$$ +\begin{align} + \int_{\Omega} w c^{n+1} ~dV &= \int_{\Omega} w c^{n} + w \Delta t M_{c}~ \nabla \cdot (\nabla (f_{\alpha,c}^n(1-H^{n})+f_{\beta,c}^n H^{n})) ~dV +\end{align} +$$ + +$$ +\begin{align} + &= \int_{\Omega} w c^{n} + \nabla w (-\Delta t M_{c})~ [~(f_{\alpha,cc}^n(1-H^{n})+f_{\beta,cc}^n H^{n}) \nabla c + ~((f_{\beta,c}^n-f_{\alpha,c}^n)H^{n}_{,\eta} \nabla \eta) ] ~dV +\end{align} +$$ + +$$ +\begin{align} +r_c &= c^{n} +\end{align} +$$ + +$$ +\begin{align} +r_{cx} &= (-\Delta t M_{c})~ [~(f_{\alpha,cc}^n(1-H^{n})+f_{\beta,cc}^n H^{n}) \nabla c + ~((f_{\beta,c}^n-f_{\alpha,c}^n)H^{n}_{,\eta} \nabla \eta) ] +\end{align} +$$ + +The above values of $r_{\eta}$, $r_{\eta x}$, $r_{c}$ and $r_{cx}$ are used to define the residuals in the following parameters file: +`applications/coupledCahnHilliardAllenCahn/parameters.h` diff --git a/applications/coupledCahnHilliardAllenCahn/formulation_coupledCHAC.pdf b/applications/coupledCahnHilliardAllenCahn/formulation_coupledCHAC.pdf deleted file mode 100644 index e37e836e7..000000000 Binary files a/applications/coupledCahnHilliardAllenCahn/formulation_coupledCHAC.pdf and /dev/null differ diff --git a/applications/coupledCahnHilliardAllenCahn/tex_files/coupledCHAC.tex b/applications/coupledCahnHilliardAllenCahn/tex_files/coupledCHAC.tex deleted file mode 100644 index 0eecb018c..000000000 --- a/applications/coupledCahnHilliardAllenCahn/tex_files/coupledCHAC.tex +++ /dev/null @@ -1,233 +0,0 @@ -\documentclass[10pt]{article} -\usepackage{amsmath} -\usepackage{bm} -\usepackage{bbm} -\usepackage{mathrsfs} -\usepackage{graphicx} -\usepackage{wrapfig} -\usepackage{subcaption} -\usepackage{epsfig} -\usepackage{amsfonts} -\usepackage{amssymb} -\usepackage{amsmath} -\usepackage{wrapfig} -\usepackage{graphicx} -\usepackage{psfrag} -\newcommand{\sun}{\ensuremath{\odot}} % sun symbol is \sun -\let\vaccent=\v % rename builtin command \v{} to \vaccent{} -\renewcommand{\v}[1]{\ensuremath{\mathbf{#1}}} % for vectors -\newcommand{\gv}[1]{\ensuremath{\mbox{\boldmath$ #1 $}}} -\newcommand{\grad}[1]{\gv{\nabla} #1} -\renewcommand{\baselinestretch}{1.2} -\jot 5mm -\graphicspath{{./figures/}} -%text dimensions -\textwidth 6.5 in -\oddsidemargin .2 in -\topmargin -0.2 in -\textheight 8.5 in -\headheight 0.2in -\overfullrule = 0pt -\pagestyle{plain} -\def\newpar{\par\vskip 0.5cm} -\begin{document} -% -%---------------------------------------------------------------------- -% Define symbols -%---------------------------------------------------------------------- -% -\def\iso{\mathbbm{1}} -\def\half{{\textstyle{1 \over 2}}} -\def\third{{\textstyle{1 \over 3}}} -\def\fourth{{\textstyle{{1 \over 4}}}} -\def\twothird{{\textstyle {{2 \over 3}}}} -\def\ndim{{n_{\rm dim}}} -\def\nint{n_{\rm int}} -\def\lint{l_{\rm int}} -\def\nel{n_{\rm el}} -\def\nf{n_{\rm f}} -\def\DIV {\hbox{\af div}} -\def\GRAD{\hbox{\af Grad}} -\def\sym{\mathop{\rm sym}\nolimits} -\def\tr{\mathop{\rm tr}\nolimits} -\def\dev{\mathop{\rm dev}\nolimits} -\def\Dev{\mathop{\rm Dev}\nolimits} -\def\DEV{\mathop {\rm DEV}\nolimits} -\def\bfb {{\bi b}} -\def\Bnabla{\nabla} -\def\bG{{\bi G}} -\def\jmpdelu{{\lbrack\!\lbrack \Delta u\rbrack\!\rbrack}} -\def\jmpudot{{\lbrack\!\lbrack\dot u\rbrack\!\rbrack}} -\def\jmpu{{\lbrack\!\lbrack u\rbrack\!\rbrack}} -\def\jmphi{{\lbrack\!\lbrack\varphi\rbrack\!\rbrack}} -\def\ljmp{{\lbrack\!\lbrack}} -\def\rjmp{{\rbrack\!\rbrack}} -\def\sign{{\rm sign}} -\def\nn{{n+1}} -\def\na{{n+\vartheta}} -\def\nna{{n+(1-\vartheta)}} -\def\nt{{n+{1\over 2}}} -\def\nb{{n+\beta}} -\def\nbb{{n+(1-\beta)}} -%--------------------------------------------------------- -% Bold Face Math Characters: -% All In Format: \B***** . -%--------------------------------------------------------- -\def\bOne{\mbox{\boldmath$1$}} -\def\BGamma{\mbox{\boldmath$\Gamma$}} -\def\BDelta{\mbox{\boldmath$\Delta$}} -\def\BTheta{\mbox{\boldmath$\Theta$}} -\def\BLambda{\mbox{\boldmath$\Lambda$}} -\def\BXi{\mbox{\boldmath$\Xi$}} -\def\BPi{\mbox{\boldmath$\Pi$}} -\def\BSigma{\mbox{\boldmath$\Sigma$}} -\def\BUpsilon{\mbox{\boldmath$\Upsilon$}} -\def\BPhi{\mbox{\boldmath$\Phi$}} -\def\BPsi{\mbox{\boldmath$\Psi$}} -\def\BOmega{\mbox{\boldmath$\Omega$}} -\def\Balpha{\mbox{\boldmath$\alpha$}} -\def\Bbeta{\mbox{\boldmath$\beta$}} -\def\Bgamma{\mbox{\boldmath$\gamma$}} -\def\Bdelta{\mbox{\boldmath$\delta$}} -\def\Bepsilon{\mbox{\boldmath$\epsilon$}} -\def\Bzeta{\mbox{\boldmath$\zeta$}} -\def\Beta{\mbox{\boldmath$\eta$}} -\def\Btheta{\mbox{\boldmath$\theta$}} -\def\Biota{\mbox{\boldmath$\iota$}} -\def\Bkappa{\mbox{\boldmath$\kappa$}} -\def\Blambda{\mbox{\boldmath$\lambda$}} -\def\Bmu{\mbox{\boldmath$\mu$}} -\def\Bnu{\mbox{\boldmath$\nu$}} -\def\Bxi{\mbox{\boldmath$\xi$}} -\def\Bpi{\mbox{\boldmath$\pi$}} -\def\Brho{\mbox{\boldmath$\rho$}} -\def\Bsigma{\mbox{\boldmath$\sigma$}} -\def\Btau{\mbox{\boldmath$\tau$}} -\def\Bupsilon{\mbox{\boldmath$\upsilon$}} -\def\Bphi{\mbox{\boldmath$\phi$}} -\def\Bchi{\mbox{\boldmath$\chi$}} -\def\Bpsi{\mbox{\boldmath$\psi$}} -\def\Bomega{\mbox{\boldmath$\omega$}} -\def\Bvarepsilon{\mbox{\boldmath$\varepsilon$}} -\def\Bvartheta{\mbox{\boldmath$\vartheta$}} -\def\Bvarpi{\mbox{\boldmath$\varpi$}} -\def\Bvarrho{\mbox{\boldmath$\varrho$}} -\def\Bvarsigma{\mbox{\boldmath$\varsigma$}} -\def\Bvarphi{\mbox{\boldmath$\varphi$}} -\def\bone{\mathbf{1}} -\def\bzero{\mathbf{0}} -%--------------------------------------------------------- -% Bold Face Math Italic: -% All In Format: \b* . -%--------------------------------------------------------- -\def\bA{\mbox{\boldmath$ A$}} -\def\bB{\mbox{\boldmath$ B$}} -\def\bC{\mbox{\boldmath$ C$}} -\def\bD{\mbox{\boldmath$ D$}} -\def\bE{\mbox{\boldmath$ E$}} -\def\bF{\mbox{\boldmath$ F$}} -\def\bG{\mbox{\boldmath$ G$}} -\def\bH{\mbox{\boldmath$ H$}} -\def\bI{\mbox{\boldmath$ I$}} -\def\bJ{\mbox{\boldmath$ J$}} -\def\bK{\mbox{\boldmath$ K$}} -\def\bL{\mbox{\boldmath$ L$}} -\def\bM{\mbox{\boldmath$ M$}} -\def\bN{\mbox{\boldmath$ N$}} -\def\bO{\mbox{\boldmath$ O$}} -\def\bP{\mbox{\boldmath$ P$}} -\def\bQ{\mbox{\boldmath$ Q$}} -\def\bR{\mbox{\boldmath$ R$}} -\def\bS{\mbox{\boldmath$ S$}} -\def\bT{\mbox{\boldmath$ T$}} -\def\bU{\mbox{\boldmath$ U$}} -\def\bV{\mbox{\boldmath$ V$}} -\def\bW{\mbox{\boldmath$ W$}} -\def\bX{\mbox{\boldmath$ X$}} -\def\bY{\mbox{\boldmath$ Y$}} -\def\bZ{\mbox{\boldmath$ Z$}} -\def\ba{\mbox{\boldmath$ a$}} -\def\bb{\mbox{\boldmath$ b$}} -\def\bc{\mbox{\boldmath$ c$}} -\def\bd{\mbox{\boldmath$ d$}} -\def\be{\mbox{\boldmath$ e$}} -\def\bff{\mbox{\boldmath$ f$}} -\def\bg{\mbox{\boldmath$ g$}} -\def\bh{\mbox{\boldmath$ h$}} -\def\bi{\mbox{\boldmath$ i$}} -\def\bj{\mbox{\boldmath$ j$}} -\def\bk{\mbox{\boldmath$ k$}} -\def\bl{\mbox{\boldmath$ l$}} -\def\bm{\mbox{\boldmath$ m$}} -\def\bn{\mbox{\boldmath$ n$}} -\def\bo{\mbox{\boldmath$ o$}} -\def\bp{\mbox{\boldmath$ p$}} -\def\bq{\mbox{\boldmath$ q$}} -\def\br{\mbox{\boldmath$ r$}} -\def\bs{\mbox{\boldmath$ s$}} -\def\bt{\mbox{\boldmath$ t$}} -\def\bu{\mbox{\boldmath$ u$}} -\def\bv{\mbox{\boldmath$ v$}} -\def\bw{\mbox{\boldmath$ w$}} -\def\bx{\mbox{\boldmath$ x$}} -\def\by{\mbox{\boldmath$ y$}} -\def\bz{\mbox{\boldmath$ z$}} -%********************************* -%Start main paper -%********************************* -\centerline{\Large{\bf PRISMS PhaseField}} -\smallskip -\centerline{\Large{\bf Coupled Cahn-Hilliard and Allen-Cahn Dynamics}} -\bigskip - -Consider a free energy expression of the form: -\begin{equation} - \Pi(c, \eta, \grad \eta) = \int_{\Omega} \left( f_{\alpha}(1-H) + f_{\beta}H \right) + \frac{\kappa}{2} \grad \eta \cdot \grad \eta ~dV -\end{equation} -where $f_{\alpha}$ and $f_{\beta}$ are the free energy densities corresponding to $\alpha$ and $\beta$ phases, respectively, and are functions of composition $c$. $H$ is a function of the structural order parameter $\eta$. Note that we don't have the gradient terms for the composition, i.e, $\grad c$ terms, unlike classical Cahn-Hillard formulation. - -\section{Variational treatment} -Following standard variational arguments (see Cahn-Hilliard formulation), we obtain the chemical potentials: -\begin{align} - \mu_{c} &= (f_{\alpha,c}(1-H)+f_{\beta,c}H) \\ - \mu_{\eta} &= (f_{\beta}-f_{\alpha})H_{,\eta} - \kappa \Delta \eta -\end{align} - -\section{Kinetics} -Now the PDE for Cahn-Hilliard dynamics is given by: -\begin{align} - \frac{\partial c}{\partial t} &= -~\grad \cdot (-M_c\grad \mu_c)\\ - &=M_c~\grad \cdot (\grad (f_{\alpha,c}(1-H)+f_{\beta,c}H)) - \end{align} - and the PDE for Allen-Cahn dynamics is given by: - \begin{align} - \frac{\partial \eta}{\partial t} &= -M_\eta \mu_\eta \\ - &=-M_\eta ~ ((f_{\beta}-f_{\alpha})H_{,\eta} - \kappa \Delta \eta) -\end{align} -where $M_c$ and $M_\eta$ are the constant mobilities. - -\section{Time discretization} -Considering forward Euler explicit time stepping, we have the time discretized kinetics equation: -\begin{align} - \eta^{n+1} &= \eta^{n} - \Delta t M_{\eta}~ ((f_{\beta,c}^n-f_{\alpha,c}^n)H_{,\eta}^n - \kappa \Delta \eta^n) \\ -c^{n+1} &= c^{n} + \Delta t M_{\eta}~\grad \cdot (\grad (f_{\alpha,c}^n(1-H^{n})+f_{\beta,c}^n H^{n})) -\end{align} - -\section{Weak formulation} -In the weak formulation, considering an arbitrary variation $w$, the above equations can be expressed as residual equations: -\begin{align} - \int_{\Omega} w \eta^{n+1} ~dV &= \int_{\Omega} w \eta^{n} - w \Delta t M_{\eta}~ ((f_{\beta,c}^n-f_{\alpha,c}^n)H_{,\eta}^n - \kappa \Delta \eta^n) ~dV\\ - &=\int_{\Omega} w \left( \underbrace{\eta^{n} - \Delta t M_{\eta}~ ((f_{\beta,c}^n-f_{\alpha,c}^n)H_{,\eta}^n)}_{r_{\eta}} \right)+ \grad w \cdot \underbrace{(- \Delta t M_{\eta}\kappa) \grad \eta^{n}}_{r_{\eta x}} ~dV -\end{align} -and -\begin{align} - \int_{\Omega} w c^{n+1} ~dV &= \int_{\Omega} w c^{n} + w \Delta t M_{c}~ \grad \cdot (\grad (f_{\alpha,c}^n(1-H^{n})+f_{\beta,c}^n H^{n})) ~dV\\ - &= \int_{\Omega} w \underbrace{c^{n}}_{r_c} + \grad w \underbrace{(-\Delta t M_{c})~ [~(f_{\alpha,cc}^n(1-H^{n})+f_{\beta,cc}^n H^{n}) \grad c + ~((f_{\beta,c}^n-f_{\alpha,c}^n)H^{n}_{,\eta} \grad \eta) ] }_{r_{cx}} ~dV -\end{align} - -\vskip 0.25in -The above values of $r_{\eta}$, $r_{\eta x}$, $r_{c}$ and $r_{cx}$ are used to define the residuals in the following parameters file: \\ -\textit{applications/coupledCahnHilliardAllenCahn/parameters.h} - - -\end{document} \ No newline at end of file diff --git a/applications/dendriticSolidification/dendriticSolidification.md b/applications/dendriticSolidification/dendriticSolidification.md new file mode 100644 index 000000000..2f8d0db99 --- /dev/null +++ b/applications/dendriticSolidification/dendriticSolidification.md @@ -0,0 +1,181 @@ +# PRISMS-PF Application Formulation: dendriticSolidification + +This example application implements a simple model of dendritic solidification based on the CHiMaD Benchmark Problem 3, itself based on the model given in the following article: +`Multiscale Finite-Difference-Diffusion-Monte-Carlo Method for Simulating Dendritic Solidification` by M. Plapp and A. Karma, *Journal of Computational Physics*, 165, 592-619 (2000) + +This example application examines the non-isothermal solidification of a pure substance. The simulation starts with a circular solid seed in a uniformly undercooled liquid. As this seed grows, two variables are tracked, an order parameter, $\phi$, that denotes whether the material a liquid or solid and a nondimensional temperature, $u$. The crystal structure of the solid is offset from the simulation frame for generality and to expose more readily any effects of the mesh on the dendrite shape. + +## Governing Equations + +Consider a free energy density given by: + +$$ +\begin{equation} + \Pi = \int_{\Omega} \left[ \frac{1}{2} W^2(\hat{n})|\nabla \phi|^2+f(\phi,u) \right] ~dV +\end{equation} +$$ + +where $\phi$ is an order parameter for the solid phase and $u$ is the dimensionaless temperature: + +$$ +\begin{equation} +u = \frac{T - T_m}{L/c_p} +\end{equation} +$$ + +for temperature $T$, melting temperature $T_m$, latent heat $L$, and specific heat $c_p$. The free energy density, $f(\phi,u)$ is given by a double-well potential: + +$$ +\begin{equation} +f(\phi,u) = -\frac{1}{2}\phi^2 + \frac{1}{4}\phi^4 + \lambda u \phi \left(1-\frac{2}{3} \phi^2+\frac{1}{5}\phi^4 \right) +\end{equation} +$$ + +where $\lambda$ is a dimensionless coupling constant. The gradient energy coefficient, $W$, is given by + +$$ +\begin{equation} +W(\theta) = W_0 [1+\epsilon_m \cos[m(\theta-\theta_0)]] +\end{equation} +$$ + +where, $W_0$, $\epsilon_m$, and $\theta_0$ are constants and $\theta$ is the in-plane azimuthal angle, where $\tan(\theta) = \frac{\partial \phi}{\partial y} / \frac{\partial \phi}{\partial x}$. + +The evolution equations are: + +$$ +\begin{gather} +\frac{\partial u}{\partial t} = D \nabla^2 u + \frac{1}{2} \frac{\partial \phi}{\partial t} \\ +\tau(\hat{n}) \frac{\partial \phi}{\partial t} = -\frac{\partial f}{\partial \phi} + \nabla \cdot \left[W^2(\theta) \nabla \phi \right]+ \frac{\partial}{\partial x} \left[ |\nabla \phi|^2 W(\theta) \frac{\partial W(\theta)}{\partial \left( \frac{\partial \phi}{\partial x} \right)} \right] + \frac{\partial}{\partial y} \left[ |\nabla \phi|^2 W(\theta) \frac{\partial W(\theta)}{\partial \left( \frac{\partial \phi}{\partial y} \right)} \right] +\end{gather} +$$ + +where + +$$ +\begin{gather} +\tau(\hat{n}) = \tau_0 [1+\epsilon_m \cos[m(\theta-\theta_0)]] \\ +D = \frac{0.6267 \lambda W_0^2}{\tau_0} +\end{gather} +$$ + +The governing equations can be written more compactly using the variable $\mu$, the driving force for the phase transformation: + +$$ +\begin{gather} +\frac{\partial u}{\partial t} = D \nabla^2 u + \frac{\mu}{2 \tau} \\ +\tau(\hat{n}) \frac{\partial \phi}{\partial t} = \mu \\ +\mu = -\frac{\partial f}{\partial \phi} + \nabla \cdot \left[W^2(\theta) \nabla \phi \right]+ \frac{\partial}{\partial x} \left[ |\nabla \phi|^2 W(\theta) \frac{\partial W(\theta)}{\partial \left( \frac{\partial \phi}{\partial x} \right)} \right] + \frac{\partial}{\partial y} \left[ |\nabla \phi|^2 W\theta) \frac{\partial W(\theta)}{\partial \left( \frac{\partial \phi}{\partial y} \right)} \right] +\end{gather} +$$ + +The $\frac{\partial W(\theta)}{\partial \left( \frac{\partial \phi}{\partial x} \right)}$ and $\frac{\partial W(\theta)}{\partial \left( \frac{\partial \phi}{\partial y} \right)}$ expressions can be evaluated using the chain rule, using $\theta$ as an intermediary (i.e. $\frac{\partial W(\theta)}{\partial \left( \frac{\partial \phi}{\partial x} \right)}=\frac{\partial W(\theta)}{\partial \theta} \frac{\partial \theta}{\partial \left( \frac{\partial \phi}{\partial x} \right)}$ and $\frac{\partial W(\theta)}{\partial \left( \frac{\partial \phi}{\partial y} \right)}=\frac{\partial W(\theta)}{\partial \theta} \frac{\partial \theta}{\partial \left( \frac{\partial \phi}{\partial y} \right)}$). Also, the last two terms can be expressed using a divergence operator, allowing them to be grouped with the second term, which will simplify matters later. Carrying out these transformations yields: + +$$ +\begin{align} +\mu = \left[ \phi - \lambda u \left(1 - \phi^2 \right) \right] \left(1-\phi^2\right) + \nabla \cdot \bigg[\left(W^2 \frac{\partial \phi}{\partial x} + W_0 \epsilon_m m W(\theta) \sin \left[ m \left(\theta - \theta_0 \right) \right] \frac{\partial \phi}{\partial y}\right)\hat{x} +\end{align} +$$ + +$$ +\begin{align} +&+ \left(W^2 \frac{\partial \phi}{\partial y} -W_0 \epsilon_m m W(\theta) \sin \left[ m \left(\theta - \theta_0 \right) \right] \frac{\partial \phi}{\partial x}\right) \hat{y} \bigg] +\end{align} +$$ + +## Model Constants +$W_0$: Controls the interfacial thickness, default value of 1.0. + +$\tau_0$: Controls the phase transformation kinetics, default value of 1.0. + +$\epsilon_m$: T the strength of the anisotropy, default value of 0.05. + +$D$: The thermal diffusion constant, default value of 1.0. + +$\Delta: \frac{T_m-T_0}{L/c_p}$: The level of undercooling, default value of 0.75. + +$\theta_0$: The rotation angle of the anisotropy with respect to the simulation frame, default value of 0.125 ($\sim$7.2$^\circ$). + +## Time Discretization +Considering forward Euler explicit time stepping, we have the time discretized kinetics equation: + +$$ +\begin{gather} +u^{n+1} = u^{n} + \Delta t \left( D \nabla^2 u^n + \frac{\mu^n}{2 \tau} \right) \\ +\phi^{n+1} = \phi^n + \frac{\Delta t \mu^n}{\tau} +\end{gather} +$$ + +$$ +\begin{align} +\mu^{n+1} = \left[ \phi^n - \lambda u \left(1 - (\phi^n)^2 \right) \right] \left(1-(\phi^n)^2\right) + \nabla \cdot \bigg[\left(W^2 \frac{\partial \phi^n}{\partial x} + W_0 \epsilon_m m W(\theta^n) \sin \left[ m \left(\theta^n - \theta_0 \right) \right] \frac{\partial \phi^n}{\partial y}\right)\hat{x} +\end{align} +$$ + +$$ +\begin{align} +&+ \left(W^2 \frac{\partial \phi^n}{\partial y} -W_0 \epsilon_m m W(\theta^n) \sin \left[ m \left(\theta^n - \theta_0 \right) \right] \frac{\partial \phi^n}{\partial x}\right) \hat{y} \bigg] +\end{align} +$$ + +## Weak Formulation + +$$ +\begin{align} +\int_{\Omega} w u^{n+1} ~dV = \int_{\Omega} w \left(u^{n} + \frac{\mu^n \Delta t}{2 \tau}\right) + \nabla w \cdot (-D \Delta t \nabla u^n) ~dV +\end{align} +$$ + +$$ +\begin{align} +\int_{\Omega} w \phi^{n+1} ~dV = \int_{\Omega} w \left(\phi^n + \frac{\Delta t \mu^n}{\tau}\right) ~dV +\end{align} +$$ + +$$ +\begin{align} +r_u &= \left(u^{n} + \frac{\mu^n \Delta t}{2 \tau}\right) +\end{align} +$$ + +$$ +\begin{align} +r_{ux} &= (-D \Delta t \nabla u^n) +\end{align} +$$ + +$$ +\begin{align} +r_{\phi} &= \left(\phi^n + \frac{\Delta t \mu^n}{\tau}\right) +\end{align} +$$ + +$$ +\begin{align} +\int_{\Omega} w \mu^{n+1} ~dV = \int_{\Omega} w \left[ \phi^n - \lambda u \left(1 - (\phi^n)^2 \right) \right] \left(1-(\phi^n)^2\right) +\end{align} +$$ + +$$ +\begin{align} +&+ \nabla w \cdot \bigg[-\left(W^2 \frac{\partial \phi^n}{\partial x} + W_0 \epsilon_m m W(\theta^n) \sin \left[ m \left(\theta^n - \theta_0 \right) \right] \frac{\partial \phi^n}{\partial y}\right)\hat{x} +&- \left(W^2 \frac{\partial \phi^n}{\partial y} -W_0 \epsilon_m m W(\theta^n) \sin \left[ m \left(\theta^n - \theta_0 \right) \right] \frac{\partial \phi^n}{\partial x}\right) \hat{y} \bigg] ~dV +\end{align} +$$ + +$$ +\begin{align} +r_{\mu} &= \left[ \phi^n - \lambda u \left(1 - (\phi^n)^2 \right) \right] \left(1-(\phi^n)^2\right) +\end{align} +$$ + +$$ +\begin{align} +r_{\phi x} &= \bigg[-\left(W^2 \frac{\partial \phi^n}{\partial x} + W_0 \epsilon_m m W(\theta^n) \sin \left[ m \left(\theta^n - \theta_0 \right) \right] \frac{\partial \phi^n}{\partial y}\right)\hat{x} +&- \left(W^2 \frac{\partial \phi^n}{\partial y} -W_0 \epsilon_m m W(\theta^n) \sin \left[ m \left(\theta^n - \theta_0 \right) \right] \frac{\partial \phi^n}{\partial x}\right) \hat{y} \bigg] +\end{align} +$$ + + +The above values of $r_{u}$, $r_{ux}$, $r_{\phi}$, and $r_{\phi x}$ and $r_{\mu}$ are used to define the residuals in the following parameters file: +`applications/dendriticSolification/parameters.h` diff --git a/applications/dendriticSolidification/dendriticSolidification.pdf b/applications/dendriticSolidification/dendriticSolidification.pdf deleted file mode 100644 index 5bd106cb3..000000000 Binary files a/applications/dendriticSolidification/dendriticSolidification.pdf and /dev/null differ diff --git a/applications/dendriticSolidification/tex_files/dendriticSolidification.tex b/applications/dendriticSolidification/tex_files/dendriticSolidification.tex deleted file mode 100644 index 5c7aaa00c..000000000 --- a/applications/dendriticSolidification/tex_files/dendriticSolidification.tex +++ /dev/null @@ -1,273 +0,0 @@ -\documentclass[10pt]{article} -\usepackage{amsmath} -\usepackage{bm} -\usepackage{bbm} -\usepackage{mathrsfs} -\usepackage{graphicx} -\usepackage{wrapfig} -\usepackage{subcaption} -\usepackage{epsfig} -\usepackage{amsfonts} -\usepackage{amssymb} -\usepackage{amsmath} -\usepackage{wrapfig} -\usepackage{graphicx} -\usepackage{psfrag} -\newcommand{\sun}{\ensuremath{\odot}} % sun symbol is \sun -\let\vaccent=\v % rename builtin command \v{} to \vaccent{} -\renewcommand{\v}[1]{\ensuremath{\mathbf{#1}}} % for vectors -\newcommand{\gv}[1]{\ensuremath{\mbox{\boldmath$ #1 $}}} -\newcommand{\grad}[1]{\gv{\nabla} #1} -\renewcommand{\baselinestretch}{1.2} -\jot 5mm -\graphicspath{{./figures/}} -%text dimensions -\textwidth 6.5 in -\oddsidemargin .2 in -\topmargin -0.2 in -\textheight 8.5 in -\headheight 0.2in -\overfullrule = 0pt -\pagestyle{plain} -\def\newpar{\par\vskip 0.5cm} -\begin{document} -% -%---------------------------------------------------------------------- -% Define symbols -%---------------------------------------------------------------------- -% -\def\iso{\mathbbm{1}} -\def\half{{\textstyle{1 \over 2}}} -\def\third{{\textstyle{1 \over 3}}} -\def\fourth{{\textstyle{{1 \over 4}}}} -\def\twothird{{\textstyle {{2 \over 3}}}} -\def\ndim{{n_{\rm dim}}} -\def\nint{n_{\rm int}} -\def\lint{l_{\rm int}} -\def\nel{n_{\rm el}} -\def\nf{n_{\rm f}} -\def\DIV {\hbox{\af div}} -\def\GRAD{\hbox{\af Grad}} -\def\sym{\mathop{\rm sym}\nolimits} -\def\tr{\mathop{\rm tr}\nolimits} -\def\dev{\mathop{\rm dev}\nolimits} -\def\Dev{\mathop{\rm Dev}\nolimits} -\def\DEV{\mathop {\rm DEV}\nolimits} -\def\bfb {{\bi b}} -\def\Bnabla{\nabla} -\def\bG{{\bi G}} -\def\jmpdelu{{\lbrack\!\lbrack \Delta u\rbrack\!\rbrack}} -\def\jmpudot{{\lbrack\!\lbrack\dot u\rbrack\!\rbrack}} -\def\jmpu{{\lbrack\!\lbrack u\rbrack\!\rbrack}} -\def\jmphi{{\lbrack\!\lbrack\varphi\rbrack\!\rbrack}} -\def\ljmp{{\lbrack\!\lbrack}} -\def\rjmp{{\rbrack\!\rbrack}} -\def\sign{{\rm sign}} -\def\nn{{n+1}} -\def\na{{n+\vartheta}} -\def\nna{{n+(1-\vartheta)}} -\def\nt{{n+{1\over 2}}} -\def\nb{{n+\beta}} -\def\nbb{{n+(1-\beta)}} -%--------------------------------------------------------- -% Bold Face Math Characters: -% All In Format: \B***** . -%--------------------------------------------------------- -\def\bOne{\mbox{\boldmath$1$}} -\def\BGamma{\mbox{\boldmath$\Gamma$}} -\def\BDelta{\mbox{\boldmath$\Delta$}} -\def\BTheta{\mbox{\boldmath$\Theta$}} -\def\BLambda{\mbox{\boldmath$\Lambda$}} -\def\BXi{\mbox{\boldmath$\Xi$}} -\def\BPi{\mbox{\boldmath$\Pi$}} -\def\BSigma{\mbox{\boldmath$\Sigma$}} -\def\BUpsilon{\mbox{\boldmath$\Upsilon$}} -\def\BPhi{\mbox{\boldmath$\Phi$}} -\def\BPsi{\mbox{\boldmath$\Psi$}} -\def\BOmega{\mbox{\boldmath$\Omega$}} -\def\Balpha{\mbox{\boldmath$\alpha$}} -\def\Bbeta{\mbox{\boldmath$\beta$}} -\def\Bgamma{\mbox{\boldmath$\gamma$}} -\def\Bdelta{\mbox{\boldmath$\delta$}} -\def\Bepsilon{\mbox{\boldmath$\epsilon$}} -\def\Bzeta{\mbox{\boldmath$\zeta$}} -\def\Beta{\mbox{\boldmath$\eta$}} -\def\Btheta{\mbox{\boldmath$\theta$}} -\def\Biota{\mbox{\boldmath$\iota$}} -\def\Bkappa{\mbox{\boldmath$\kappa$}} -\def\Blambda{\mbox{\boldmath$\lambda$}} -\def\Bmu{\mbox{\boldmath$\mu$}} -\def\Bnu{\mbox{\boldmath$\nu$}} -\def\Bxi{\mbox{\boldmath$\xi$}} -\def\Bpi{\mbox{\boldmath$\pi$}} -\def\Brho{\mbox{\boldmath$\rho$}} -\def\Bsigma{\mbox{\boldmath$\sigma$}} -\def\Btau{\mbox{\boldmath$\tau$}} -\def\Bupsilon{\mbox{\boldmath$\upsilon$}} -\def\Bphi{\mbox{\boldmath$\phi$}} -\def\Bchi{\mbox{\boldmath$\chi$}} -\def\Bpsi{\mbox{\boldmath$\psi$}} -\def\Bomega{\mbox{\boldmath$\omega$}} -\def\Bvarepsilon{\mbox{\boldmath$\varepsilon$}} -\def\Bvartheta{\mbox{\boldmath$\vartheta$}} -\def\Bvarpi{\mbox{\boldmath$\varpi$}} -\def\Bvarrho{\mbox{\boldmath$\varrho$}} -\def\Bvarsigma{\mbox{\boldmath$\varsigma$}} -\def\Bvarphi{\mbox{\boldmath$\varphi$}} -\def\bone{\mathbf{1}} -\def\bzero{\mathbf{0}} -%--------------------------------------------------------- -% Bold Face Math Italic: -% All In Format: \b* . -%--------------------------------------------------------- -\def\bA{\mbox{\boldmath$ A$}} -\def\bB{\mbox{\boldmath$ B$}} -\def\bC{\mbox{\boldmath$ C$}} -\def\bD{\mbox{\boldmath$ D$}} -\def\bE{\mbox{\boldmath$ E$}} -\def\bF{\mbox{\boldmath$ F$}} -\def\bG{\mbox{\boldmath$ G$}} -\def\bH{\mbox{\boldmath$ H$}} -\def\bI{\mbox{\boldmath$ I$}} -\def\bJ{\mbox{\boldmath$ J$}} -\def\bK{\mbox{\boldmath$ K$}} -\def\bL{\mbox{\boldmath$ L$}} -\def\bM{\mbox{\boldmath$ M$}} -\def\bN{\mbox{\boldmath$ N$}} -\def\bO{\mbox{\boldmath$ O$}} -\def\bP{\mbox{\boldmath$ P$}} -\def\bQ{\mbox{\boldmath$ Q$}} -\def\bR{\mbox{\boldmath$ R$}} -\def\bS{\mbox{\boldmath$ S$}} -\def\bT{\mbox{\boldmath$ T$}} -\def\bU{\mbox{\boldmath$ U$}} -\def\bV{\mbox{\boldmath$ V$}} -\def\bW{\mbox{\boldmath$ W$}} -\def\bX{\mbox{\boldmath$ X$}} -\def\bY{\mbox{\boldmath$ Y$}} -\def\bZ{\mbox{\boldmath$ Z$}} -\def\ba{\mbox{\boldmath$ a$}} -\def\bb{\mbox{\boldmath$ b$}} -\def\bc{\mbox{\boldmath$ c$}} -\def\bd{\mbox{\boldmath$ d$}} -\def\be{\mbox{\boldmath$ e$}} -\def\bff{\mbox{\boldmath$ f$}} -\def\bg{\mbox{\boldmath$ g$}} -\def\bh{\mbox{\boldmath$ h$}} -\def\bi{\mbox{\boldmath$ i$}} -\def\bj{\mbox{\boldmath$ j$}} -\def\bk{\mbox{\boldmath$ k$}} -\def\bl{\mbox{\boldmath$ l$}} -\def\bm{\mbox{\boldmath$ m$}} -\def\bn{\mbox{\boldmath$ n$}} -\def\bo{\mbox{\boldmath$ o$}} -\def\bp{\mbox{\boldmath$ p$}} -\def\bq{\mbox{\boldmath$ q$}} -\def\br{\mbox{\boldmath$ r$}} -\def\bs{\mbox{\boldmath$ s$}} -\def\bt{\mbox{\boldmath$ t$}} -\def\bu{\mbox{\boldmath$ u$}} -\def\bv{\mbox{\boldmath$ v$}} -\def\bw{\mbox{\boldmath$ w$}} -\def\bx{\mbox{\boldmath$ x$}} -\def\by{\mbox{\boldmath$ y$}} -\def\bz{\mbox{\boldmath$ z$}} -%********************************* -%Start main paper -%********************************* -\centerline{\Large{\bf PRISMS-PF Application Formulation:}} -\smallskip -\centerline{\Large{\bf dendriticSolidification}} -\bigskip - -This example application implements a simple model of dendritic solidification based on the CHiMaD Benchmark Problem 3, itself based on the model given in the following article: \\ -``Multiscale Finite-Difference-Diffusion-Monte-Carlo Method for Simulating Dendritic Solidification'' by M. Plapp and A. Karma, \emph{Journal of Computational Physics}, 165, 592-619 (2000) - -This example application examines the non-isothermal solidification of a pure substance. The simulation starts with a circular solid seed in a uniformly undercooled liquid. As this seed grows, two variables are tracked, an order parameter, $\phi$, that denotes whether the material a liquid or solid and a nondimensional temperature, $u$. The crystal structure of the solid is offset from the simulation frame for generality and to expose more readily any effects of the mesh on the dendrite shape. - -\section{Governing Equations} - -Consider a free energy density given by: -\begin{equation} - \Pi = \int_{\Omega} \left[ \frac{1}{2} W^2(\hat{n})|\nabla \phi|^2+f(\phi,u) \right] ~dV -\end{equation} -where $\phi$ is an order parameter for the solid phase and $u$ is the dimensionaless temperature: -\begin{equation} -u = \frac{T - T_m}{L/c_p} -\end{equation} -for temperature $T$, melting temperature $T_m$, latent heat $L$, and specific heat $c_p$. The free energy density, $f(\phi,u)$ is given by a double-well potential: -\begin{equation} -f(\phi,u) = -\frac{1}{2}\phi^2 + \frac{1}{4}\phi^4 + \lambda u \phi \left(1-\frac{2}{3} \phi^2+\frac{1}{5}\phi^4 \right) -\end{equation} -where $\lambda$ is a dimensionless coupling constant. The gradient energy coefficient, $W$, is given by -\begin{equation} -W(\theta) = W_0 [1+\epsilon_m \cos[m(\theta-\theta_0)]] -\end{equation} -where, $W_0$, $\epsilon_m$, and $\theta_0$ are constants and $\theta$ is the in-plane azimuthal angle, where $\tan(\theta) = \frac{\partial \phi}{\partial y} / \frac{\partial \phi}{\partial x}$. - -The evolution equations are: -\begin{gather} -\frac{\partial u}{\partial t} = D \nabla^2 u + \frac{1}{2} \frac{\partial \phi}{\partial t} \\ -\tau(\hat{n}) \frac{\partial \phi}{\partial t} = -\frac{\partial f}{\partial \phi} + \nabla \cdot \left[W^2(\theta) \nabla \phi \right]+ \frac{\partial}{\partial x} \left[ |\nabla \phi|^2 W(\theta) \frac{\partial W(\theta)}{\partial \left( \frac{\partial \phi}{\partial x} \right)} \right] + \frac{\partial}{\partial y} \left[ |\nabla \phi|^2 W(\theta) \frac{\partial W(\theta)}{\partial \left( \frac{\partial \phi}{\partial y} \right)} \right] -\end{gather} -where -\begin{gather} -\tau(\hat{n}) = \tau_0 [1+\epsilon_m \cos[m(\theta-\theta_0)]] \\ -D = \frac{0.6267 \lambda W_0^2}{\tau_0} -\end{gather} - -The governing equations can be written more compactly using the variable $\mu$, the driving force for the phase transformation: -\begin{gather} -\frac{\partial u}{\partial t} = D \nabla^2 u + \frac{\mu}{2 \tau} \\ -\tau(\hat{n}) \frac{\partial \phi}{\partial t} = \mu \\ -\mu = -\frac{\partial f}{\partial \phi} + \nabla \cdot \left[W^2(\theta) \nabla \phi \right]+ \frac{\partial}{\partial x} \left[ |\nabla \phi|^2 W(\theta) \frac{\partial W(\theta)}{\partial \left( \frac{\partial \phi}{\partial x} \right)} \right] + \frac{\partial}{\partial y} \left[ |\nabla \phi|^2 W\theta) \frac{\partial W(\theta)}{\partial \left( \frac{\partial \phi}{\partial y} \right)} \right] -\end{gather} - -The $\frac{\partial W(\theta)}{\partial \left( \frac{\partial \phi}{\partial x} \right)}$ and $\frac{\partial W(\theta)}{\partial \left( \frac{\partial \phi}{\partial y} \right)}$ expressions can be evaluated using the chain rule, using $\theta$ as an intermediary (i.e. $\frac{\partial W(\theta)}{\partial \left( \frac{\partial \phi}{\partial x} \right)}=\frac{\partial W(\theta)}{\partial \theta} \frac{\partial \theta}{\partial \left( \frac{\partial \phi}{\partial x} \right)}$ and $\frac{\partial W(\theta)}{\partial \left( \frac{\partial \phi}{\partial y} \right)}=\frac{\partial W(\theta)}{\partial \theta} \frac{\partial \theta}{\partial \left( \frac{\partial \phi}{\partial y} \right)}$). Also, the last two terms can be expressed using a divergence operator, allowing them to be grouped with the second term, which will simplify matters later. Carrying out these transformations yields: -\begin{multline} -\mu = \left[ \phi - \lambda u \left(1 - \phi^2 \right) \right] \left(1-\phi^2\right) + \nabla \cdot \bigg[\left(W^2 \frac{\partial \phi}{\partial x} + W_0 \epsilon_m m W(\theta) \sin \left[ m \left(\theta - \theta_0 \right) \right] \frac{\partial \phi}{\partial y}\right)\hat{x} \\ -+ \left(W^2 \frac{\partial \phi}{\partial y} -W_0 \epsilon_m m W(\theta) \sin \left[ m \left(\theta - \theta_0 \right) \right] \frac{\partial \phi}{\partial x}\right) \hat{y} \bigg] -\end{multline} - -\section{Model Constants} -$W_0$: Controls the interfacial thickness, default value of 1.0. \\ -$\tau_0$: Controls the phase transformation kinetics, default value of 1.0. \\ -$\epsilon_m$: T the strength of the anisotropy, default value of 0.05. \\ -$D$: The thermal diffusion constant, default value of 1.0. \\ -$\Delta: \frac{T_m-T_0}{L/c_p}$: The level of undercooling, default value of 0.75. \\ -$\theta_0$: The rotation angle of the anisotropy with respect to the simulation frame, default value of 0.125 ($\sim$7.2$^\circ$). - -\section{Time Discretization} -Considering forward Euler explicit time stepping, we have the time discretized kinetics equation: -\begin{gather} -u^{n+1} = u^{n} + \Delta t \left( D \nabla^2 u^n + \frac{\mu^n}{2 \tau} \right) \\ -\phi^{n+1} = \phi^n + \frac{\Delta t \mu^n}{\tau} -\end{gather} -\begin{multline} -\mu^{n+1} = \left[ \phi^n - \lambda u \left(1 - (\phi^n)^2 \right) \right] \left(1-(\phi^n)^2\right) + \nabla \cdot \bigg[\left(W^2 \frac{\partial \phi^n}{\partial x} + W_0 \epsilon_m m W(\theta^n) \sin \left[ m \left(\theta^n - \theta_0 \right) \right] \frac{\partial \phi^n}{\partial y}\right)\hat{x} \\ -+ \left(W^2 \frac{\partial \phi^n}{\partial y} -W_0 \epsilon_m m W(\theta^n) \sin \left[ m \left(\theta^n - \theta_0 \right) \right] \frac{\partial \phi^n}{\partial x}\right) \hat{y} \bigg] -\end{multline} - -\section{Weak Formulation} - -\begin{gather} -\int_{\Omega} w u^{n+1} ~dV = \int_{\Omega} w \underbrace{\left(u^{n} + \frac{\mu^n \Delta t}{2 \tau}\right)}_{r_u} + \nabla w \cdot \underbrace{(-D \Delta t \nabla u^n)}_{r_{ux}} ~dV \\ -\int_{\Omega} w \phi^{n+1} ~dV = \int_{\Omega} w \underbrace{\left(\phi^n + \frac{\Delta t \mu^n}{\tau}\right)}_{r_{\phi}} ~dV -\end{gather} \small -\begin{multline} -\int_{\Omega} w \mu^{n+1} ~dV = \int_{\Omega} w \underbrace{\left[ \phi^n - \lambda u \left(1 - (\phi^n)^2 \right) \right] \left(1-(\phi^n)^2\right)}_{r_{\mu}} \\ -+ \nabla w \cdot \underbrace{\bigg[-\left(W^2 \frac{\partial \phi^n}{\partial x} + W_0 \epsilon_m m W(\theta^n) \sin \left[ m \left(\theta^n - \theta_0 \right) \right] \frac{\partial \phi^n}{\partial y}\right)\hat{x} -- \left(W^2 \frac{\partial \phi^n}{\partial y} -W_0 \epsilon_m m W(\theta^n) \sin \left[ m \left(\theta^n - \theta_0 \right) \right] \frac{\partial \phi^n}{\partial x}\right) \hat{y} \bigg]}_{r_{\phi x}} ~dV -\end{multline} -\normalsize - - - - - -\vskip 0.25in -The above values of $r_{u}$, $r_{ux}$, $r_{\phi}$, and $r_{\phi x}$ and $r_{\mu}$ are used to define the residuals in the following parameters file: \\ -\textit{applications/dendriticSolification/parameters.h} - - -\end{document} \ No newline at end of file diff --git a/applications/eshelbyInclusion/eshelbyInclusion.md b/applications/eshelbyInclusion/eshelbyInclusion.md new file mode 100644 index 000000000..fad356550 --- /dev/null +++ b/applications/eshelbyInclusion/eshelbyInclusion.md @@ -0,0 +1,132 @@ +# PRISMS-PF Application Formulation: eshelbyInclusion + +This example application implements a simple 3D calculation of the displacement field near a homogenous inclusion. + +Consider a strain energy expression of the form: + +$$ +\begin{equation} + \Pi(\varepsilon) = \int_{\Omega} \frac{1}{2} (\epsilon-\epsilon^0):C: (\epsilon-\epsilon^0) ~dV - \int_{\partial \Omega} u \cdot t ~dS +\end{equation} +$$ + +where $\varepsilon$ is the infinitesimal strain tensor, $C_{ijkl}=\lambda \delta_{ij} \delta_{kl}+\mu ( \delta_{ik} \delta_{jl}+ \delta_{il} \delta_{jk} )$ is the fourth order elasticity tensor, ($\lambda$, $\mu$) are the Lame parameters, $u$ is the displacement, and $t=\sigma \cdot n$ is the surface traction. + +## Governing equations +Considering variations on the displacement $u$ of the from $u+\alpha w$, we have + +$$ +\begin{align} +\delta \Pi &= \left. \frac{d}{d\alpha} \left( \int_{\Omega} \frac{1}{2} [\epsilon(u+\alpha w) - \epsilon^0] : C : [\epsilon(u+\alpha w) - \epsilon^0] ~dV - \int_{\partial \Omega} u \cdot t ~dS \right)\right\vert_{\alpha=0} \\ +&= \int_{\Omega} \nabla w : C : (\epsilon-\epsilon^0) ~dV - \int_{\partial \Omega} w \cdot t~dS\\ +&= \int_{\Omega} \nabla w : \sigma ~dV - \int_{\partial \Omega} w\cdot t~dS +\end{align} +$$ + +where $\sigma = C : (\epsilon-\epsilon^0)$ is the stress tensor, $\epsilon^0$ is the misfit strain (eigenstrain), and $t=\sigma \cdot n$ is the surface traction. In this case, we assume that the diagonal elements of $\epsilon^0$ take the form: + +$$ +\begin{equation} +\epsilon^0_{ii} = m \left(\frac{1}{2} + \frac{1}{2} \tanh(l(r-a)) \right) +\end{equation} +$$ + +where $m$ is the magnitide of the misfit strain inside the inclusion, $l$ determines the thickness of the ``interface'' between the inclusion and the matrix, $r$ is the distance from the origin, and $a$ is the radius of the inclusion. The off-diagonal elements of $\epsilon^0$ are zero. + +The minimization of the variation, $\delta \Pi=0$, gives the weak formulation of the governing equation of mechanics: + +$$ +\begin{align} +\int_{\Omega} \nabla w : \sigma ~dV - \int_{\partial \Omega} w \cdot t ~dS = 0 +\end{align} +$$ + +If surface tractions are zero: + +$$ +\begin{align} +R &= \int_{\Omega} \nabla w : \sigma ~dV = 0 +\end{align} +$$ + +## Residual expressions +In PRISMS-PF, two sets of residuals are required for elliptic PDEs (such as this one), one for the left-hand side of the equation (LHS) and one for the right-hand side of the equation (RHS). We solve $R=0$ by casting this in a form that can be solved as a matrix inversion problem. This will involve a brief detour into the discretized form of the equation. First we derive an expression for the solution, given an initial guess, $u_0$: + +$$ +\begin{gather} +0 = R(u) = R(u_0 + \Delta u) +\end{gather} +$$ + +where $\Delta u = u - u_0$. Then, applying the discretization that $u = \sum_i w^i U^i$, we can write the following linearization: + +$$ +\begin{equation} +\frac{\delta R(u)}{\delta u} \Delta U = -R(u_0) +\end{equation} +$$ + +The discretized form of this equation can be written as a matrix inversion problem. However, in PRISMS-PF, we only care about the product $\frac{\delta R(u)}{\delta u} \Delta U$. Taking the variational derivative of $R(u)$ yields: + +$$ +\begin{align} +\frac{\delta R(u)}{\delta u} &= \frac{d}{d\alpha} \int_{\Omega} \nabla w :C: \left[ \epsilon (u+\alpha w) - \epsilon^0 \right] ~dV \bigg{|}_{\alpha=0} +\end{align} +$$ + +$$ +\begin{align} +&= \int_{\Omega} \nabla w :C: \frac{1}{2}\frac{d}{d\alpha}\left[ \nabla(u+\alpha w) + \nabla(u+\alpha w)^T - \epsilon^0\right] ~dV \bigg{|}_{\alpha=0} +\end{align} +$$ + +$$ +\begin{align} +&= \int_{\Omega} \nabla w :C: \frac{d}{d\alpha} \left[ \nabla(u+\alpha w) - \epsilon^0 \right] ~dV \bigg{|}_{\alpha=0} \quad (due ~to ~the ~symmetry ~of ~C) +\end{align} +$$ + +$$ +\begin{align} +&= \int_{\Omega} \nabla w :C: \nabla w ~dV +\end{align} +$$ + +In its discretized form $\frac{\delta R(u)}{\delta u} \Delta U$ is: + +$$ +\begin{equation} +\frac{\delta R(u)}{\delta u} \Delta U = \sum_i \sum_j \int_{\Omega} \nabla N^i : C : \nabla N^j dV ~\Delta U^j +\end{equation} +$$ + +Moving back to the non-discretized form yields: + +$$ +\begin{equation} +\frac{\delta R(u)}{\delta u} \Delta U = \int_{\Omega} \nabla w : C : \nabla (\Delta u) dV +\end{equation} +$$ + +Thus, the full equation relating $u_0$ and $\Delta u$ is: + +$$ +\begin{align} +\int_{\Omega} \nabla w : C : \nabla (\Delta u) dV = -\int_{\Omega} \nabla w : \sigma ~dV +\end{align} +$$ + +$$ +\begin{align} +r_{ux}^{LHS} &= C : \nabla (\Delta u) +\end{align} +$$ + +$$ +\begin{align} +r_{ux} &= \sigma +\end{align} +$$ + +The above values of $r_{ux}^{LHS}$ and $r_{ux}$ are used to define the residuals in the following input file: +`applications/eschelbyInclusion/equations.h` diff --git a/applications/eshelbyInclusion/eshelbyInclusion.pdf b/applications/eshelbyInclusion/eshelbyInclusion.pdf deleted file mode 100644 index f62e54e18..000000000 Binary files a/applications/eshelbyInclusion/eshelbyInclusion.pdf and /dev/null differ diff --git a/applications/eshelbyInclusion/tex_files/eshelbyInclusion.tex b/applications/eshelbyInclusion/tex_files/eshelbyInclusion.tex deleted file mode 100644 index 75efc087a..000000000 --- a/applications/eshelbyInclusion/tex_files/eshelbyInclusion.tex +++ /dev/null @@ -1,246 +0,0 @@ -\documentclass[10pt]{article} -\usepackage{amsmath} -\usepackage{bm} -\usepackage{bbm} -\usepackage{mathrsfs} -\usepackage{graphicx} -\usepackage{wrapfig} -\usepackage{subcaption} -\usepackage{epsfig} -\usepackage{amsfonts} -\usepackage{amssymb} -\usepackage{amsmath} -\usepackage{wrapfig} -\usepackage{graphicx} -\usepackage{psfrag} -\newcommand{\sun}{\ensuremath{\odot}} % sun symbol is \sun -\let\vaccent=\v % rename builtin command \v{} to \vaccent{} -\renewcommand{\v}[1]{\ensuremath{\mathbf{#1}}} % for vectors -\newcommand{\gv}[1]{\ensuremath{\mbox{\boldmath$ #1 $}}} -\newcommand{\grad}[1]{\gv{\nabla} #1} -\renewcommand{\baselinestretch}{1.2} -\jot 5mm -\graphicspath{{./figures/}} -%text dimensions -\textwidth 6.5 in -\oddsidemargin .2 in -\topmargin -0.2 in -\textheight 8.5 in -\headheight 0.2in -\overfullrule = 0pt -\pagestyle{plain} -\def\newpar{\par\vskip 0.5cm} -\begin{document} -% -%---------------------------------------------------------------------- -% Define symbols -%---------------------------------------------------------------------- -% -\def\iso{\mathbbm{1}} -\def\half{{\textstyle{1 \over 2}}} -\def\third{{\textstyle{1 \over 3}}} -\def\fourth{{\textstyle{{1 \over 4}}}} -\def\twothird{{\textstyle {{2 \over 3}}}} -\def\ndim{{n_{\rm dim}}} -\def\nint{n_{\rm int}} -\def\lint{l_{\rm int}} -\def\nel{n_{\rm el}} -\def\nf{n_{\rm f}} -\def\DIV {\hbox{\af div}} -\def\GRAD{\hbox{\af Grad}} -\def\sym{\mathop{\rm sym}\nolimits} -\def\tr{\mathop{\rm tr}\nolimits} -\def\dev{\mathop{\rm dev}\nolimits} -\def\Dev{\mathop{\rm Dev}\nolimits} -\def\DEV{\mathop {\rm DEV}\nolimits} -\def\bfb {{\bi b}} -\def\Bnabla{\nabla} -\def\bG{{\bi G}} -\def\jmpdelu{{\lbrack\!\lbrack \Delta u\rbrack\!\rbrack}} -\def\jmpudot{{\lbrack\!\lbrack\dot u\rbrack\!\rbrack}} -\def\jmpu{{\lbrack\!\lbrack u\rbrack\!\rbrack}} -\def\jmphi{{\lbrack\!\lbrack\varphi\rbrack\!\rbrack}} -\def\ljmp{{\lbrack\!\lbrack}} -\def\rjmp{{\rbrack\!\rbrack}} -\def\sign{{\rm sign}} -\def\nn{{n+1}} -\def\na{{n+\vartheta}} -\def\nna{{n+(1-\vartheta)}} -\def\nt{{n+{1\over 2}}} -\def\nb{{n+\beta}} -\def\nbb{{n+(1-\beta)}} -%--------------------------------------------------------- -% Bold Face Math Characters: -% All In Format: \B***** . -%--------------------------------------------------------- -\def\bOne{\mbox{\boldmath$1$}} -\def\BGamma{\mbox{\boldmath$\Gamma$}} -\def\BDelta{\mbox{\boldmath$\Delta$}} -\def\BTheta{\mbox{\boldmath$\Theta$}} -\def\BLambda{\mbox{\boldmath$\Lambda$}} -\def\BXi{\mbox{\boldmath$\Xi$}} -\def\BPi{\mbox{\boldmath$\Pi$}} -\def\BSigma{\mbox{\boldmath$\Sigma$}} -\def\BUpsilon{\mbox{\boldmath$\Upsilon$}} -\def\BPhi{\mbox{\boldmath$\Phi$}} -\def\BPsi{\mbox{\boldmath$\Psi$}} -\def\BOmega{\mbox{\boldmath$\Omega$}} -\def\Balpha{\mbox{\boldmath$\alpha$}} -\def\Bbeta{\mbox{\boldmath$\beta$}} -\def\Bgamma{\mbox{\boldmath$\gamma$}} -\def\Bdelta{\mbox{\boldmath$\delta$}} -\def\Bepsilon{\mbox{\boldmath$\epsilon$}} -\def\Bzeta{\mbox{\boldmath$\zeta$}} -\def\Beta{\mbox{\boldmath$\eta$}} -\def\Btheta{\mbox{\boldmath$\theta$}} -\def\Biota{\mbox{\boldmath$\iota$}} -\def\Bkappa{\mbox{\boldmath$\kappa$}} -\def\Blambda{\mbox{\boldmath$\lambda$}} -\def\Bmu{\mbox{\boldmath$\mu$}} -\def\Bnu{\mbox{\boldmath$\nu$}} -\def\Bxi{\mbox{\boldmath$\xi$}} -\def\Bpi{\mbox{\boldmath$\pi$}} -\def\Brho{\mbox{\boldmath$\rho$}} -\def\Bsigma{\mbox{\boldmath$\sigma$}} -\def\Btau{\mbox{\boldmath$\tau$}} -\def\Bupsilon{\mbox{\boldmath$\upsilon$}} -\def\Bphi{\mbox{\boldmath$\phi$}} -\def\Bchi{\mbox{\boldmath$\chi$}} -\def\Bpsi{\mbox{\boldmath$\psi$}} -\def\Bomega{\mbox{\boldmath$\omega$}} -\def\Bvarepsilon{\mbox{\boldmath$\varepsilon$}} -\def\Bvartheta{\mbox{\boldmath$\vartheta$}} -\def\Bvarpi{\mbox{\boldmath$\varpi$}} -\def\Bvarrho{\mbox{\boldmath$\varrho$}} -\def\Bvarsigma{\mbox{\boldmath$\varsigma$}} -\def\Bvarphi{\mbox{\boldmath$\varphi$}} -\def\bone{\mathbf{1}} -\def\bzero{\mathbf{0}} -%--------------------------------------------------------- -% Bold Face Math Italic: -% All In Format: \b* . -%--------------------------------------------------------- -\def\bA{\mbox{\boldmath$ A$}} -\def\bB{\mbox{\boldmath$ B$}} -\def\bC{\mbox{\boldmath$ C$}} -\def\bD{\mbox{\boldmath$ D$}} -\def\bE{\mbox{\boldmath$ E$}} -\def\bF{\mbox{\boldmath$ F$}} -\def\bG{\mbox{\boldmath$ G$}} -\def\bH{\mbox{\boldmath$ H$}} -\def\bI{\mbox{\boldmath$ I$}} -\def\bJ{\mbox{\boldmath$ J$}} -\def\bK{\mbox{\boldmath$ K$}} -\def\bL{\mbox{\boldmath$ L$}} -\def\bM{\mbox{\boldmath$ M$}} -\def\bN{\mbox{\boldmath$ N$}} -\def\bO{\mbox{\boldmath$ O$}} -\def\bP{\mbox{\boldmath$ P$}} -\def\bQ{\mbox{\boldmath$ Q$}} -\def\bR{\mbox{\boldmath$ R$}} -\def\bS{\mbox{\boldmath$ S$}} -\def\bT{\mbox{\boldmath$ T$}} -\def\bU{\mbox{\boldmath$ U$}} -\def\bV{\mbox{\boldmath$ V$}} -\def\bW{\mbox{\boldmath$ W$}} -\def\bX{\mbox{\boldmath$ X$}} -\def\bY{\mbox{\boldmath$ Y$}} -\def\bZ{\mbox{\boldmath$ Z$}} -\def\ba{\mbox{\boldmath$ a$}} -\def\bb{\mbox{\boldmath$ b$}} -\def\bc{\mbox{\boldmath$ c$}} -\def\bd{\mbox{\boldmath$ d$}} -\def\be{\mbox{\boldmath$ e$}} -\def\bff{\mbox{\boldmath$ f$}} -\def\bg{\mbox{\boldmath$ g$}} -\def\bh{\mbox{\boldmath$ h$}} -\def\bi{\mbox{\boldmath$ i$}} -\def\bj{\mbox{\boldmath$ j$}} -\def\bk{\mbox{\boldmath$ k$}} -\def\bl{\mbox{\boldmath$ l$}} -\def\bm{\mbox{\boldmath$ m$}} -\def\bn{\mbox{\boldmath$ n$}} -\def\bo{\mbox{\boldmath$ o$}} -\def\bp{\mbox{\boldmath$ p$}} -\def\bq{\mbox{\boldmath$ q$}} -\def\br{\mbox{\boldmath$ r$}} -\def\bs{\mbox{\boldmath$ s$}} -\def\bt{\mbox{\boldmath$ t$}} -\def\bu{\mbox{\boldmath$ u$}} -\def\bv{\mbox{\boldmath$ v$}} -\def\bw{\mbox{\boldmath$ w$}} -\def\bx{\mbox{\boldmath$ x$}} -\def\by{\mbox{\boldmath$ y$}} -\def\bz{\mbox{\boldmath$ z$}} -%********************************* -%Start main paper -%********************************* -\centerline{\Large{\bf PRISMS-PF Application Formulation:}} -\smallskip -\centerline{\Large{\bf eshelbyInclusion}} -\bigskip - -This example application implements a simple 3D calculation of the displacement field near a homogenous inclusion. -\\ -Consider a strain energy expression of the form: -\begin{equation} - \Pi(\varepsilon) = \int_{\Omega} \frac{1}{2} (\epsilon-\epsilon^0):C: (\epsilon-\epsilon^0) ~dV - \int_{\partial \Omega} u \cdot t ~dS -\end{equation} -where $\varepsilon$ is the infinitesimal strain tensor, $C_{ijkl}=\lambda \delta_{ij} \delta_{kl}+\mu ( \delta_{ik} \delta_{jl}+ \delta_{il} \delta_{jk} )$ is the fourth order elasticity tensor, ($\lambda$, $\mu$) are the Lame parameters, $u$ is the displacement, and $t=\sigma \cdot n$ is the surface traction. - -\section{Governing equations} -Considering variations on the displacement $u$ of the from $u+\alpha w$, we have -\begin{align} -\delta \Pi &= \left. \frac{d}{d\alpha} \left( \int_{\Omega} \frac{1}{2} [\epsilon(u+\alpha w) - \epsilon^0] : C : [\epsilon(u+\alpha w) - \epsilon^0] ~dV - \int_{\partial \Omega} u \cdot t ~dS \right)\right\vert_{\alpha=0} \\ -&= \int_{\Omega} \grad w : C : (\epsilon-\epsilon^0) ~dV - \int_{\partial \Omega} w \cdot t~dS\\ -&= \int_{\Omega} \grad w : \sigma ~dV - \int_{\partial \Omega} w\cdot t~dS -\end{align} -where $\sigma = C : (\epsilon-\epsilon^0)$ is the stress tensor, $\epsilon^0$ is the misfit strain (eigenstrain), and $t=\sigma \cdot n$ is the surface traction. In this case, we assume that the diagonal elements of $\epsilon^0$ take the form: -\begin{equation} -\epsilon^0_{ii} = m \left(\frac{1}{2} + \frac{1}{2} \tanh(l(r-a)) \right) -\end{equation} -where $m$ is the magnitide of the misfit strain inside the inclusion, $l$ determines the thickness of the ``interface'' between the inclusion and the matrix, $r$ is the distance from the origin, and $a$ is the radius of the inclusion. The off-diagonal elements of $\epsilon^0$ are zero. - -The minimization of the variation, $\delta \Pi=0$, gives the weak formulation of the governing equation of mechanics: - -\begin{align} -\int_{\Omega} \grad w : \sigma ~dV - \int_{\partial \Omega} w \cdot t ~dS = 0 -\end{align} - -If surface tractions are zero: \\ -\begin{align} -R &= \int_{\Omega} \grad w : \sigma ~dV = 0 -\end{align} - -\section{Residual expressions} -In PRISMS-PF, two sets of residuals are required for elliptic PDEs (such as this one), one for the left-hand side of the equation (LHS) and one for the right-hand side of the equation (RHS). We solve $R=0$ by casting this in a form that can be solved as a matrix inversion problem. This will involve a brief detour into the discretized form of the equation. First we derive an expression for the solution, given an initial guess, $u_0$: -\begin{gather} -0 = R(u) = R(u_0 + \Delta u) -\end{gather} -where $\Delta u = u - u_0$. Then, applying the discretization that $u = \sum_i w^i U^i$, we can write the following linearization: -\begin{equation} -\frac{\delta R(u)}{\delta u} \Delta U = -R(u_0) \label{matrix_eqn} -\end{equation} -The discretized form of this equation can be written as a matrix inversion problem. However, in PRISMS-PF, we only care about the product $\frac{\delta R(u)}{\delta u} \Delta U$. Taking the variational derivative of $R(u)$ yields: -\begin{align} -\frac{\delta R(u)}{\delta u} &= \frac{d}{d\alpha} \int_{\Omega} \nabla w :C: \left[ \epsilon (u+\alpha w) - \epsilon^0 \right] ~dV \bigg{|}_{\alpha=0} \\ -&= \int_{\Omega} \nabla w :C: \frac{1}{2}\frac{d}{d\alpha}\left[ \nabla(u+\alpha w) + \nabla(u+\alpha w)^T - \epsilon^0\right] ~dV \bigg{|}_{\alpha=0}\\ -&= \int_{\Omega} \nabla w :C: \frac{d}{d\alpha} \left[ \nabla(u+\alpha w) - \epsilon^0 \right] ~dV \bigg{|}_{\alpha=0} \quad (due ~to ~the ~symmetry ~of ~C) \\ -&= \int_{\Omega} \nabla w :C: \nabla w ~dV -\end{align} -In its discretized form $\frac{\delta R(u)}{\delta u} \Delta U$ is: -\begin{equation} -\frac{\delta R(u)}{\delta u} \Delta U = \sum_i \sum_j \int_{\Omega} \nabla N^i : C : \nabla N^j dV ~\Delta U^j -\end{equation} -Moving back to the non-discretized form yields: -\begin{equation} -\frac{\delta R(u)}{\delta u} \Delta U = \int_{\Omega} \nabla w : C : \nabla (\Delta u) dV -\end{equation} -Thus, the full equation relating $u_0$ and $\Delta u$ is: -\begin{equation} -\int_{\Omega} \nabla w : \underbrace{C : \nabla (\Delta u)}_{r_{ux}^{LHS}} dV = -\int_{\Omega} \grad w : \underbrace{\sigma}_{r_{ux}} ~dV -\end{equation} -The above values of $r_{ux}^{LHS}$ and $r_{ux}$ are used to define the residuals in the following input file: \\ -$applications/eschelbyInclusion/equations.h$ - -\end{document} \ No newline at end of file diff --git a/applications/fickianDiffusion/formulation_fickianFlux.md b/applications/fickianDiffusion/formulation_fickianFlux.md new file mode 100644 index 000000000..58bf390e4 --- /dev/null +++ b/applications/fickianDiffusion/formulation_fickianFlux.md @@ -0,0 +1,73 @@ +# PRISMS-PF Application Formulation: fickianDiffusion + +In this example application, we implement a Fick's Law for a single component. Two time-dependent Gaussian source terms add concentration over the course of the simulation. + +## Kinetics +The Parabolic PDE for diffusion is given by: + +$$ +\begin{align} + \frac{\partial c}{\partial t} &= -\nabla \cdot (-D~\nabla c) + f +\end{align} +$$ + +where $D$ is the diffusion constant and $f$ is a source term. In this example, $f$ is given by a pair of Gaussian expressions: + +$$ +\begin{multline} +f = A_1 \exp\left(-\left(\frac{t-t_1}{\tau_1}\right)^2\right)\exp\left(-\left(\frac{x-x_1}{L_1}\right)^2-\left(\frac{y-y_1}{L_1}\right)^2\right) + A_2 \exp\left(-\left(\frac{t-t_2}{\tau_2}\right)^2\right)\exp\left(-\left(\frac{x-x_2}{L_2}\right)^2-\left(\frac{y-y_2}{L_2}\right)^2\right) + \end{multline} +$$ + + where $A_1$, $_2$, $t_1$, $t_2$, $\tau_1$, $\tau_2$, $x_1$, $x_2$, $y_1$, $y_2$, $L_1$, and $L_2$ are constants. + +## Time discretization +Considering forward Euler explicit time stepping, we have the time discretized kinetics equation: + +$$ +\begin{align} + c^{n+1} &= c^{n} + (\Delta t D)~\Delta c^n + \Delta t f^n +\end{align} +$$ + +## Weak formulation +In the weak formulation, considering an arbitrary variation $w$, the above equation can be expressed as a residual equation: + +$$ +\begin{align} +\int_{\Omega} w c^{n+1} ~dV &= \int_{\Omega} w c^{n} + w (\Delta t D) \Delta c^n + w \Delta t f^n ~dV +\end{align} +$$ + +$$ +\begin{align} +&= \int_{\Omega} w (c^{n} + \Delta t f^n) - \nabla w \cdot (\Delta t D) \nabla c^n ~dV + \int_{\partial \Omega} w (\Delta t D) \nabla c^n \cdot n ~dS +\end{align} +$$ + +$$ +\begin{align} +&= \int_{\Omega} w (c^{n} + \Delta t f^n) - \nabla w \cdot (\Delta t D) \nabla c^n ~dV + \int_{\partial \Omega} w (\Delta t D) j^n ~dS +\end{align} +$$ + +$$ +\begin{align} +&= \int_{\Omega} w (c^{n}+\Delta t f^n) + \nabla w \cdot (-\Delta t D) \nabla c^n ~dV \quad [\text {assuming flux}~j=0 ] +\end{align} +$$ + +$$ +\begin{align} +r_c &= c^{n}+\Delta t f^n +\end{align} +$$ + +$$ +\begin{align} +r_{cx} &= (-\Delta t D) \nabla c^n +\end{align} +$$ + +The above values of $r_{c}$ and $r_{c x}$ are used to define the residuals in the following parameters file: +`applications/fickianFlux/parameters.h` diff --git a/applications/fickianDiffusion/formulation_fickianFlux.pdf b/applications/fickianDiffusion/formulation_fickianFlux.pdf deleted file mode 100644 index 02402a5de..000000000 Binary files a/applications/fickianDiffusion/formulation_fickianFlux.pdf and /dev/null differ diff --git a/applications/fickianDiffusion/tex_files/fickianFlux.pdf b/applications/fickianDiffusion/tex_files/fickianFlux.pdf deleted file mode 100644 index 02402a5de..000000000 Binary files a/applications/fickianDiffusion/tex_files/fickianFlux.pdf and /dev/null differ diff --git a/applications/fickianDiffusion/tex_files/fickianFlux.tex b/applications/fickianDiffusion/tex_files/fickianFlux.tex deleted file mode 100644 index 01f363d26..000000000 --- a/applications/fickianDiffusion/tex_files/fickianFlux.tex +++ /dev/null @@ -1,214 +0,0 @@ -\documentclass[10pt]{article} -\usepackage{amsmath} -\usepackage{bm} -\usepackage{bbm} -\usepackage{mathrsfs} -\usepackage{graphicx} -\usepackage{wrapfig} -\usepackage{subcaption} -\usepackage{epsfig} -\usepackage{amsfonts} -\usepackage{amssymb} -\usepackage{amsmath} -\usepackage{wrapfig} -\usepackage{graphicx} -\usepackage{psfrag} -\newcommand{\sun}{\ensuremath{\odot}} % sun symbol is \sun -\let\vaccent=\v % rename builtin command \v{} to \vaccent{} -\renewcommand{\v}[1]{\ensuremath{\mathbf{#1}}} % for vectors -\newcommand{\gv}[1]{\ensuremath{\mbox{\boldmath$ #1 $}}} -\newcommand{\grad}[1]{\gv{\nabla} #1} -\renewcommand{\baselinestretch}{1.2} -\jot 5mm -\graphicspath{{./figures/}} -%text dimensions -\textwidth 6.5 in -\oddsidemargin .2 in -\topmargin -0.2 in -\textheight 8.5 in -\headheight 0.2in -\overfullrule = 0pt -\pagestyle{plain} -\def\newpar{\par\vskip 0.5cm} -\begin{document} -% -%---------------------------------------------------------------------- -% Define symbols -%---------------------------------------------------------------------- -% -\def\iso{\mathbbm{1}} -\def\half{{\textstyle{1 \over 2}}} -\def\third{{\textstyle{1 \over 3}}} -\def\fourth{{\textstyle{{1 \over 4}}}} -\def\twothird{{\textstyle {{2 \over 3}}}} -\def\ndim{{n_{\rm dim}}} -\def\nint{n_{\rm int}} -\def\lint{l_{\rm int}} -\def\nel{n_{\rm el}} -\def\nf{n_{\rm f}} -\def\DIV {\hbox{\af div}} -\def\GRAD{\hbox{\af Grad}} -\def\sym{\mathop{\rm sym}\nolimits} -\def\tr{\mathop{\rm tr}\nolimits} -\def\dev{\mathop{\rm dev}\nolimits} -\def\Dev{\mathop{\rm Dev}\nolimits} -\def\DEV{\mathop {\rm DEV}\nolimits} -\def\bfb {{\bi b}} -\def\Bnabla{\nabla} -\def\bG{{\bi G}} -\def\jmpdelu{{\lbrack\!\lbrack \Delta u\rbrack\!\rbrack}} -\def\jmpudot{{\lbrack\!\lbrack\dot u\rbrack\!\rbrack}} -\def\jmpu{{\lbrack\!\lbrack u\rbrack\!\rbrack}} -\def\jmphi{{\lbrack\!\lbrack\varphi\rbrack\!\rbrack}} -\def\ljmp{{\lbrack\!\lbrack}} -\def\rjmp{{\rbrack\!\rbrack}} -\def\sign{{\rm sign}} -\def\nn{{n+1}} -\def\na{{n+\vartheta}} -\def\nna{{n+(1-\vartheta)}} -\def\nt{{n+{1\over 2}}} -\def\nb{{n+\beta}} -\def\nbb{{n+(1-\beta)}} -%--------------------------------------------------------- -% Bold Face Math Characters: -% All In Format: \B***** . -%--------------------------------------------------------- -\def\bOne{\mbox{\boldmath$1$}} -\def\BGamma{\mbox{\boldmath$\Gamma$}} -\def\BDelta{\mbox{\boldmath$\Delta$}} -\def\BTheta{\mbox{\boldmath$\Theta$}} -\def\BLambda{\mbox{\boldmath$\Lambda$}} -\def\BXi{\mbox{\boldmath$\Xi$}} -\def\BPi{\mbox{\boldmath$\Pi$}} -\def\BSigma{\mbox{\boldmath$\Sigma$}} -\def\BUpsilon{\mbox{\boldmath$\Upsilon$}} -\def\BPhi{\mbox{\boldmath$\Phi$}} -\def\BPsi{\mbox{\boldmath$\Psi$}} -\def\BOmega{\mbox{\boldmath$\Omega$}} -\def\Balpha{\mbox{\boldmath$\alpha$}} -\def\Bbeta{\mbox{\boldmath$\beta$}} -\def\Bgamma{\mbox{\boldmath$\gamma$}} -\def\Bdelta{\mbox{\boldmath$\delta$}} -\def\Bepsilon{\mbox{\boldmath$\epsilon$}} -\def\Bzeta{\mbox{\boldmath$\zeta$}} -\def\Beta{\mbox{\boldmath$\eta$}} -\def\Btheta{\mbox{\boldmath$\theta$}} -\def\Biota{\mbox{\boldmath$\iota$}} -\def\Bkappa{\mbox{\boldmath$\kappa$}} -\def\Blambda{\mbox{\boldmath$\lambda$}} -\def\Bmu{\mbox{\boldmath$\mu$}} -\def\Bnu{\mbox{\boldmath$\nu$}} -\def\Bxi{\mbox{\boldmath$\xi$}} -\def\Bpi{\mbox{\boldmath$\pi$}} -\def\Brho{\mbox{\boldmath$\rho$}} -\def\Bsigma{\mbox{\boldmath$\sigma$}} -\def\Btau{\mbox{\boldmath$\tau$}} -\def\Bupsilon{\mbox{\boldmath$\upsilon$}} -\def\Bphi{\mbox{\boldmath$\phi$}} -\def\Bchi{\mbox{\boldmath$\chi$}} -\def\Bpsi{\mbox{\boldmath$\psi$}} -\def\Bomega{\mbox{\boldmath$\omega$}} -\def\Bvarepsilon{\mbox{\boldmath$\varepsilon$}} -\def\Bvartheta{\mbox{\boldmath$\vartheta$}} -\def\Bvarpi{\mbox{\boldmath$\varpi$}} -\def\Bvarrho{\mbox{\boldmath$\varrho$}} -\def\Bvarsigma{\mbox{\boldmath$\varsigma$}} -\def\Bvarphi{\mbox{\boldmath$\varphi$}} -\def\bone{\mathbf{1}} -\def\bzero{\mathbf{0}} -%--------------------------------------------------------- -% Bold Face Math Italic: -% All In Format: \b* . -%--------------------------------------------------------- -\def\bA{\mbox{\boldmath$ A$}} -\def\bB{\mbox{\boldmath$ B$}} -\def\bC{\mbox{\boldmath$ C$}} -\def\bD{\mbox{\boldmath$ D$}} -\def\bE{\mbox{\boldmath$ E$}} -\def\bF{\mbox{\boldmath$ F$}} -\def\bG{\mbox{\boldmath$ G$}} -\def\bH{\mbox{\boldmath$ H$}} -\def\bI{\mbox{\boldmath$ I$}} -\def\bJ{\mbox{\boldmath$ J$}} -\def\bK{\mbox{\boldmath$ K$}} -\def\bL{\mbox{\boldmath$ L$}} -\def\bM{\mbox{\boldmath$ M$}} -\def\bN{\mbox{\boldmath$ N$}} -\def\bO{\mbox{\boldmath$ O$}} -\def\bP{\mbox{\boldmath$ P$}} -\def\bQ{\mbox{\boldmath$ Q$}} -\def\bR{\mbox{\boldmath$ R$}} -\def\bS{\mbox{\boldmath$ S$}} -\def\bT{\mbox{\boldmath$ T$}} -\def\bU{\mbox{\boldmath$ U$}} -\def\bV{\mbox{\boldmath$ V$}} -\def\bW{\mbox{\boldmath$ W$}} -\def\bX{\mbox{\boldmath$ X$}} -\def\bY{\mbox{\boldmath$ Y$}} -\def\bZ{\mbox{\boldmath$ Z$}} -\def\ba{\mbox{\boldmath$ a$}} -\def\bb{\mbox{\boldmath$ b$}} -\def\bc{\mbox{\boldmath$ c$}} -\def\bd{\mbox{\boldmath$ d$}} -\def\be{\mbox{\boldmath$ e$}} -\def\bff{\mbox{\boldmath$ f$}} -\def\bg{\mbox{\boldmath$ g$}} -\def\bh{\mbox{\boldmath$ h$}} -\def\bi{\mbox{\boldmath$ i$}} -\def\bj{\mbox{\boldmath$ j$}} -\def\bk{\mbox{\boldmath$ k$}} -\def\bl{\mbox{\boldmath$ l$}} -\def\bm{\mbox{\boldmath$ m$}} -\def\bn{\mbox{\boldmath$ n$}} -\def\bo{\mbox{\boldmath$ o$}} -\def\bp{\mbox{\boldmath$ p$}} -\def\bq{\mbox{\boldmath$ q$}} -\def\br{\mbox{\boldmath$ r$}} -\def\bs{\mbox{\boldmath$ s$}} -\def\bt{\mbox{\boldmath$ t$}} -\def\bu{\mbox{\boldmath$ u$}} -\def\bv{\mbox{\boldmath$ v$}} -\def\bw{\mbox{\boldmath$ w$}} -\def\bx{\mbox{\boldmath$ x$}} -\def\by{\mbox{\boldmath$ y$}} -\def\bz{\mbox{\boldmath$ z$}} -%********************************* -%Start main paper -%********************************* -\centerline{\Large{\bf PRISMS-PF Application Formulation}} -\smallskip -\centerline{\Large{\bf fickianDiffusion}} -\bigskip - -In this example application, we implement a Fick's Law for a single component. Two time-dependent Gaussian source terms add concentration over the course of the simulation. - -\section{Kinetics} -The Parabolic PDE for diffusion is given by: -\begin{align} - \frac{\partial c}{\partial t} &= -\grad \cdot (-D~\grad c) + f -\end{align} -where $D$ is the diffusion constant and $f$ is a source term. In this example, $f$ is given by a pair of Gaussian expressions: -\begin{multline} -f = A_1 \exp\left(-\left(\frac{t-t_1}{\tau_1}\right)^2\right)\exp\left(-\left(\frac{x-x_1}{L_1}\right)^2-\left(\frac{y-y_1}{L_1}\right)^2\right) \\+ A_2 \exp\left(-\left(\frac{t-t_2}{\tau_2}\right)^2\right)\exp\left(-\left(\frac{x-x_2}{L_2}\right)^2-\left(\frac{y-y_2}{L_2}\right)^2\right) - \end{multline} - where $A_1$, $_2$, $t_1$, $t_2$, $\tau_1$, $\tau_2$, $x_1$, $x_2$, $y_1$, $y_2$, $L_1$, and $L_2$ are constants. -\section{Time discretization} -Considering forward Euler explicit time stepping, we have the time discretized kinetics equation: -\begin{align} - c^{n+1} &= c^{n} + (\Delta t D)~\Delta c^n + \Delta t f^n -\end{align} - -\section{Weak formulation} -In the weak formulation, considering an arbitrary variation $w$, the above equation can be expressed as a residual equation: -\begin{align} -\int_{\Omega} w c^{n+1} ~dV &= \int_{\Omega} w c^{n} + w (\Delta t D) \Delta c^n + w \Delta t f^n ~dV \\ -&= \int_{\Omega} w (c^{n} + \Delta t f^n) - \grad w \cdot (\Delta t D) \grad c^n ~dV + \int_{\partial \Omega} w (\Delta t D) \grad c^n \cdot n ~dS\\ -&= \int_{\Omega} w (c^{n} + \Delta t f^n) - \grad w \cdot (\Delta t D) \grad c^n ~dV + \int_{\partial \Omega} w (\Delta t D) j^n ~dS\\ -&= \int_{\Omega} w (\underbrace{c^{n}+\Delta t f^n}_{r_c}) + \grad w \cdot \underbrace{(-\Delta t D) \grad c^n}_{r_{cx}} ~dV \quad [\text {assuming flux}~j=0 ] -\end{align} -\vskip 0.25in -The above values of $r_{c}$ and $r_{c x}$ are used to define the residuals in the following parameters file: \\ -\textit{applications/fickianFlux/parameters.h} - - -\end{document} \ No newline at end of file diff --git a/applications/grainGrowth/grainGrowth.md b/applications/grainGrowth/grainGrowth.md new file mode 100644 index 000000000..a8e134e25 --- /dev/null +++ b/applications/grainGrowth/grainGrowth.md @@ -0,0 +1,74 @@ +# PRISMS-PF Application Formulation: grainGrowth + +This example application implements a simple set of governing equations for isotropic grain growth. The model is a simplified version of the one in the following publication: + Simulating recrystallization in titanium using the phase field method, S.P. Gentry and K. Thornton, *IOP Conf. Series: Materials Science and Engineering* 89 (2015) 012024. + + +Consider a free energy expression of the form: + +$$ +\begin{equation} + \Pi(\eta_i, \nabla \eta_i) = \int_{\Omega} \left[\sum_{i=1}^N \left(-\frac{1}{2}\eta_i^2+ \frac{1}{4}\eta_i^4 \right) + \alpha \sum_{i=1}^N \sum_{j>i}^N \eta_i^2 \eta_j^2 +\frac{1}{4} \right] + \frac{\kappa}{2} \sum_{i=1}^N |\nabla \eta_i|^2 ~dV +\end{equation} +$$ + +where $\eta_i$ is one of $N$ structural order parameters, $\alpha$ is the grain interaction coefficient, and $\kappa$ is the gradient energy coefficient. + +## Variational treatment +The driving force for grain evolution is determined by the variational derivative of the total energy with respect to each order parameter: + +$$ +\begin{equation} +\mu = \frac{\delta \Pi}{\delta \eta_i} = \left( -\eta_i + \eta_i^3 + 2 \alpha \eta_i \sum_{j \ne i}^N \eta_j^2 - \kappa \nabla^2 \eta_i \right) +\end{equation} +$$ + +## Kinetics +The order parameter for each grain is unconserved, and thus their evolution can be described by Allen-Cahn equations: + +$$ +\begin{equation} +\frac{\partial \eta_i}{\partial t} = -L \mu = \left( -\eta_i + \eta_i^3 + 2 \alpha \eta_i \sum_{j \ne i}^N \eta_j^2 - \kappa \nabla^2 \eta_i \right) +\end{equation} +$$ + +where $L$ is the constant mobility. + +## Time discretization +Considering forward Euler explicit time stepping, we have the time discretized kinetics equation: + +$$ +\begin{align} + \eta_i^{n+1} &= \eta_i^{n} - \Delta t L~\left( -\eta_i^n + (\eta_i^n)^3 + 2 \alpha \eta_i^n \sum_{j \ne i}^N (\eta^n_j)^2 - \kappa \nabla^2 \eta^n_i \right) +\end{align} +$$ + +## Weak formulation +In the weak formulation, considering an arbitrary variation $w$, the above equation can be expressed as a residual equation: + +$$ +\begin{align} +\int_{\Omega} w \eta_i^{n+1} ~dV&= \int_{\Omega} w \eta_i^{n} - w \Delta t L~\left( -\eta_i^n + (\eta_i^n)^3 + 2 \alpha \eta_i^n \sum_{j \ne i}^N (\eta^n_j)^2 - \kappa \nabla^2 \eta^n_i \right) ~dV +\end{align} +$$ + +$$ +\begin{align} +&= \int_{\Omega} w ( \eta^{n} - \Delta t L~\left( -\eta_i^n + (\eta_i^n)^3 + 2 \alpha \eta_i^n \sum_{j \ne i}^N (\eta^n_j)^2\right) + \nabla w (-\Delta t L \kappa)~ \cdot (\nabla \eta_i^{n}) ~dV \quad [\kappa \nabla \eta_i \cdot n = 0 ~ \text{on} ~ \partial \Omega] +\end{align} +$$ + +$$ +\begin{align} +r_{\eta_i} &= \eta^{n} - \Delta t L~\left( -\eta_i^n + (\eta_i^n)^3 + 2 \alpha \eta_i^n \sum_{j \ne i}^N (\eta^n_j)^2\right) +\end{align} +$$ + +$$ +\begin{align} +r_{\eta_i x} &= (-\Delta t L \kappa)~ \cdot (\nabla \eta_i^{n}) +\end{align} +$$ + +The above values of $r_{\eta_i}$ and $r_{\eta_i x}$ are used to define the residuals in the following parameters file: +`applications/grainGrowth/equations.h` diff --git a/applications/grainGrowth/grainGrowth.pdf b/applications/grainGrowth/grainGrowth.pdf deleted file mode 100644 index 915207063..000000000 Binary files a/applications/grainGrowth/grainGrowth.pdf and /dev/null differ diff --git a/applications/grainGrowth/tex_files/grainGrowth.pdf b/applications/grainGrowth/tex_files/grainGrowth.pdf deleted file mode 100644 index 915207063..000000000 Binary files a/applications/grainGrowth/tex_files/grainGrowth.pdf and /dev/null differ diff --git a/applications/grainGrowth/tex_files/grainGrowth.tex b/applications/grainGrowth/tex_files/grainGrowth.tex deleted file mode 100644 index 9d0f9670f..000000000 --- a/applications/grainGrowth/tex_files/grainGrowth.tex +++ /dev/null @@ -1,222 +0,0 @@ -\documentclass[10pt]{article} -\usepackage{amsmath} -\usepackage{bm} -\usepackage{bbm} -\usepackage{mathrsfs} -\usepackage{graphicx} -\usepackage{wrapfig} -\usepackage{subcaption} -\usepackage{epsfig} -\usepackage{amsfonts} -\usepackage{amssymb} -\usepackage{amsmath} -\usepackage{wrapfig} -\usepackage{graphicx} -\usepackage{psfrag} -\newcommand{\sun}{\ensuremath{\odot}} % sun symbol is \sun -\let\vaccent=\v % rename builtin command \v{} to \vaccent{} -\renewcommand{\v}[1]{\ensuremath{\mathbf{#1}}} % for vectors -\newcommand{\gv}[1]{\ensuremath{\mbox{\boldmath$ #1 $}}} -\newcommand{\grad}[1]{\gv{\nabla} #1} -\renewcommand{\baselinestretch}{1.2} -\jot 5mm -\graphicspath{{./figures/}} -%text dimensions -\textwidth 6.5 in -\oddsidemargin .2 in -\topmargin -0.2 in -\textheight 8.5 in -\headheight 0.2in -\overfullrule = 0pt -\pagestyle{plain} -\def\newpar{\par\vskip 0.5cm} -\begin{document} -% -%---------------------------------------------------------------------- -% Define symbols -%---------------------------------------------------------------------- -% -\def\iso{\mathbbm{1}} -\def\half{{\textstyle{1 \over 2}}} -\def\third{{\textstyle{1 \over 3}}} -\def\fourth{{\textstyle{{1 \over 4}}}} -\def\twothird{{\textstyle {{2 \over 3}}}} -\def\ndim{{n_{\rm dim}}} -\def\nint{n_{\rm int}} -\def\lint{l_{\rm int}} -\def\nel{n_{\rm el}} -\def\nf{n_{\rm f}} -\def\DIV {\hbox{\af div}} -\def\GRAD{\hbox{\af Grad}} -\def\sym{\mathop{\rm sym}\nolimits} -\def\tr{\mathop{\rm tr}\nolimits} -\def\dev{\mathop{\rm dev}\nolimits} -\def\Dev{\mathop{\rm Dev}\nolimits} -\def\DEV{\mathop {\rm DEV}\nolimits} -\def\bfb {{\bi b}} -\def\Bnabla{\nabla} -\def\bG{{\bi G}} -\def\jmpdelu{{\lbrack\!\lbrack \Delta u\rbrack\!\rbrack}} -\def\jmpudot{{\lbrack\!\lbrack\dot u\rbrack\!\rbrack}} -\def\jmpu{{\lbrack\!\lbrack u\rbrack\!\rbrack}} -\def\jmphi{{\lbrack\!\lbrack\varphi\rbrack\!\rbrack}} -\def\ljmp{{\lbrack\!\lbrack}} -\def\rjmp{{\rbrack\!\rbrack}} -\def\sign{{\rm sign}} -\def\nn{{n+1}} -\def\na{{n+\vartheta}} -\def\nna{{n+(1-\vartheta)}} -\def\nt{{n+{1\over 2}}} -\def\nb{{n+\beta}} -\def\nbb{{n+(1-\beta)}} -%--------------------------------------------------------- -% Bold Face Math Characters: -% All In Format: \B***** . -%--------------------------------------------------------- -\def\bOne{\mbox{\boldmath$1$}} -\def\BGamma{\mbox{\boldmath$\Gamma$}} -\def\BDelta{\mbox{\boldmath$\Delta$}} -\def\BTheta{\mbox{\boldmath$\Theta$}} -\def\BLambda{\mbox{\boldmath$\Lambda$}} -\def\BXi{\mbox{\boldmath$\Xi$}} -\def\BPi{\mbox{\boldmath$\Pi$}} -\def\BSigma{\mbox{\boldmath$\Sigma$}} -\def\BUpsilon{\mbox{\boldmath$\Upsilon$}} -\def\BPhi{\mbox{\boldmath$\Phi$}} -\def\BPsi{\mbox{\boldmath$\Psi$}} -\def\BOmega{\mbox{\boldmath$\Omega$}} -\def\Balpha{\mbox{\boldmath$\alpha$}} -\def\Bbeta{\mbox{\boldmath$\beta$}} -\def\Bgamma{\mbox{\boldmath$\gamma$}} -\def\Bdelta{\mbox{\boldmath$\delta$}} -\def\Bepsilon{\mbox{\boldmath$\epsilon$}} -\def\Bzeta{\mbox{\boldmath$\zeta$}} -\def\Beta{\mbox{\boldmath$\eta$}} -\def\Btheta{\mbox{\boldmath$\theta$}} -\def\Biota{\mbox{\boldmath$\iota$}} -\def\Bkappa{\mbox{\boldmath$\kappa$}} -\def\Blambda{\mbox{\boldmath$\lambda$}} -\def\Bmu{\mbox{\boldmath$\mu$}} -\def\Bnu{\mbox{\boldmath$\nu$}} -\def\Bxi{\mbox{\boldmath$\xi$}} -\def\Bpi{\mbox{\boldmath$\pi$}} -\def\Brho{\mbox{\boldmath$\rho$}} -\def\Bsigma{\mbox{\boldmath$\sigma$}} -\def\Btau{\mbox{\boldmath$\tau$}} -\def\Bupsilon{\mbox{\boldmath$\upsilon$}} -\def\Bphi{\mbox{\boldmath$\phi$}} -\def\Bchi{\mbox{\boldmath$\chi$}} -\def\Bpsi{\mbox{\boldmath$\psi$}} -\def\Bomega{\mbox{\boldmath$\omega$}} -\def\Bvarepsilon{\mbox{\boldmath$\varepsilon$}} -\def\Bvartheta{\mbox{\boldmath$\vartheta$}} -\def\Bvarpi{\mbox{\boldmath$\varpi$}} -\def\Bvarrho{\mbox{\boldmath$\varrho$}} -\def\Bvarsigma{\mbox{\boldmath$\varsigma$}} -\def\Bvarphi{\mbox{\boldmath$\varphi$}} -\def\bone{\mathbf{1}} -\def\bzero{\mathbf{0}} -%--------------------------------------------------------- -% Bold Face Math Italic: -% All In Format: \b* . -%--------------------------------------------------------- -\def\bA{\mbox{\boldmath$ A$}} -\def\bB{\mbox{\boldmath$ B$}} -\def\bC{\mbox{\boldmath$ C$}} -\def\bD{\mbox{\boldmath$ D$}} -\def\bE{\mbox{\boldmath$ E$}} -\def\bF{\mbox{\boldmath$ F$}} -\def\bG{\mbox{\boldmath$ G$}} -\def\bH{\mbox{\boldmath$ H$}} -\def\bI{\mbox{\boldmath$ I$}} -\def\bJ{\mbox{\boldmath$ J$}} -\def\bK{\mbox{\boldmath$ K$}} -\def\bL{\mbox{\boldmath$ L$}} -\def\bM{\mbox{\boldmath$ M$}} -\def\bN{\mbox{\boldmath$ N$}} -\def\bO{\mbox{\boldmath$ O$}} -\def\bP{\mbox{\boldmath$ P$}} -\def\bQ{\mbox{\boldmath$ Q$}} -\def\bR{\mbox{\boldmath$ R$}} -\def\bS{\mbox{\boldmath$ S$}} -\def\bT{\mbox{\boldmath$ T$}} -\def\bU{\mbox{\boldmath$ U$}} -\def\bV{\mbox{\boldmath$ V$}} -\def\bW{\mbox{\boldmath$ W$}} -\def\bX{\mbox{\boldmath$ X$}} -\def\bY{\mbox{\boldmath$ Y$}} -\def\bZ{\mbox{\boldmath$ Z$}} -\def\ba{\mbox{\boldmath$ a$}} -\def\bb{\mbox{\boldmath$ b$}} -\def\bc{\mbox{\boldmath$ c$}} -\def\bd{\mbox{\boldmath$ d$}} -\def\be{\mbox{\boldmath$ e$}} -\def\bff{\mbox{\boldmath$ f$}} -\def\bg{\mbox{\boldmath$ g$}} -\def\bh{\mbox{\boldmath$ h$}} -\def\bi{\mbox{\boldmath$ i$}} -\def\bj{\mbox{\boldmath$ j$}} -\def\bk{\mbox{\boldmath$ k$}} -\def\bl{\mbox{\boldmath$ l$}} -\def\bm{\mbox{\boldmath$ m$}} -\def\bn{\mbox{\boldmath$ n$}} -\def\bo{\mbox{\boldmath$ o$}} -\def\bp{\mbox{\boldmath$ p$}} -\def\bq{\mbox{\boldmath$ q$}} -\def\br{\mbox{\boldmath$ r$}} -\def\bs{\mbox{\boldmath$ s$}} -\def\bt{\mbox{\boldmath$ t$}} -\def\bu{\mbox{\boldmath$ u$}} -\def\bv{\mbox{\boldmath$ v$}} -\def\bw{\mbox{\boldmath$ w$}} -\def\bx{\mbox{\boldmath$ x$}} -\def\by{\mbox{\boldmath$ y$}} -\def\bz{\mbox{\boldmath$ z$}} -%********************************* -%Start main paper -%********************************* -\centerline{\Large{\bf PRISMS-PF Application Formulation:}} -\smallskip -\centerline{\Large{\bf grainGrowth}} -\bigskip - -This example application implements a simple set of governing equations for isotropic grain growth. The model is a simplified version of the one in the following publication:\\ - Simulating recrystallization in titanium using the phase field method, S.P. Gentry and K. Thornton, \emph{IOP Conf. Series: Materials Science and Engineering} 89 (2015) 012024. -\\ -\\ -Consider a free energy expression of the form: -\begin{equation} - \Pi(\eta_i, \grad \eta_i) = \int_{\Omega} \left[\sum_{i=1}^N \left(-\frac{1}{2}\eta_i^2+ \frac{1}{4}\eta_i^4 \right) + \alpha \sum_{i=1}^N \sum_{j>i}^N \eta_i^2 \eta_j^2 +\frac{1}{4} \right] + \frac{\kappa}{2} \sum_{i=1}^N |\nabla \eta_i|^2 ~dV -\end{equation} -where $\eta_i$ is one of $N$ structural order parameters, $\alpha$ is the grain interaction coefficient, and $\kappa$ is the gradient energy coefficient. - -\section{Variational treatment} -The driving force for grain evolution is determined by the variational derivative of the total energy with respect to each order parameter: -\begin{equation} -\mu = \frac{\delta \Pi}{\delta \eta_i} = \left( -\eta_i + \eta_i^3 + 2 \alpha \eta_i \sum_{j \ne i}^N \eta_j^2 - \kappa \nabla^2 \eta_i \right) -\end{equation} - -\section{Kinetics} -The order parameter for each grain is unconserved, and thus their evolution can be described by Allen-Cahn equations: -\begin{equation} -\frac{\partial \eta_i}{\partial t} = -L \mu = \left( -\eta_i + \eta_i^3 + 2 \alpha \eta_i \sum_{j \ne i}^N \eta_j^2 - \kappa \nabla^2 \eta_i \right) -\end{equation} -where $L$ is the constant mobility. -\section{Time discretization} -Considering forward Euler explicit time stepping, we have the time discretized kinetics equation: -\begin{align} - \eta_i^{n+1} &= \eta_i^{n} - \Delta t L~\left( -\eta_i^n + (\eta_i^n)^3 + 2 \alpha \eta_i^n \sum_{j \ne i}^N (\eta^n_j)^2 - \kappa \nabla^2 \eta^n_i \right) -\end{align} - -\section{Weak formulation} -In the weak formulation, considering an arbitrary variation $w$, the above equation can be expressed as a residual equation: -\begin{align} -\int_{\Omega} w \eta_i^{n+1} ~dV&= \int_{\Omega} w \eta_i^{n} - w \Delta t L~\left( -\eta_i^n + (\eta_i^n)^3 + 2 \alpha \eta_i^n \sum_{j \ne i}^N (\eta^n_j)^2 - \kappa \nabla^2 \eta^n_i \right) ~dV \\ -&= \int_{\Omega} w ( \underbrace{ \eta^{n} - \Delta t L~\left( -\eta_i^n + (\eta_i^n)^3 + 2 \alpha \eta_i^n \sum_{j \ne i}^N (\eta^n_j)^2\right) }_{r_{\eta_i}} + \grad w \underbrace{ (-\Delta t L \kappa)~ \cdot (\grad \eta_i^{n})}_{r_{\eta_i x}} ~dV \quad [\kappa \grad \eta_i \cdot n = 0 ~ \text{on} ~ \partial \Omega] -\end{align} -\vskip 0.25in -The above values of $r_{\eta_i}$ and $r_{\eta_i x}$ are used to define the residuals in the following parameters file: \\ -\textit{applications/grainGrowth/equations.h} - - -\end{document} \ No newline at end of file diff --git a/applications/grainGrowth_dream3d/grainGrowth.md b/applications/grainGrowth_dream3d/grainGrowth.md new file mode 100644 index 000000000..a8e134e25 --- /dev/null +++ b/applications/grainGrowth_dream3d/grainGrowth.md @@ -0,0 +1,74 @@ +# PRISMS-PF Application Formulation: grainGrowth + +This example application implements a simple set of governing equations for isotropic grain growth. The model is a simplified version of the one in the following publication: + Simulating recrystallization in titanium using the phase field method, S.P. Gentry and K. Thornton, *IOP Conf. Series: Materials Science and Engineering* 89 (2015) 012024. + + +Consider a free energy expression of the form: + +$$ +\begin{equation} + \Pi(\eta_i, \nabla \eta_i) = \int_{\Omega} \left[\sum_{i=1}^N \left(-\frac{1}{2}\eta_i^2+ \frac{1}{4}\eta_i^4 \right) + \alpha \sum_{i=1}^N \sum_{j>i}^N \eta_i^2 \eta_j^2 +\frac{1}{4} \right] + \frac{\kappa}{2} \sum_{i=1}^N |\nabla \eta_i|^2 ~dV +\end{equation} +$$ + +where $\eta_i$ is one of $N$ structural order parameters, $\alpha$ is the grain interaction coefficient, and $\kappa$ is the gradient energy coefficient. + +## Variational treatment +The driving force for grain evolution is determined by the variational derivative of the total energy with respect to each order parameter: + +$$ +\begin{equation} +\mu = \frac{\delta \Pi}{\delta \eta_i} = \left( -\eta_i + \eta_i^3 + 2 \alpha \eta_i \sum_{j \ne i}^N \eta_j^2 - \kappa \nabla^2 \eta_i \right) +\end{equation} +$$ + +## Kinetics +The order parameter for each grain is unconserved, and thus their evolution can be described by Allen-Cahn equations: + +$$ +\begin{equation} +\frac{\partial \eta_i}{\partial t} = -L \mu = \left( -\eta_i + \eta_i^3 + 2 \alpha \eta_i \sum_{j \ne i}^N \eta_j^2 - \kappa \nabla^2 \eta_i \right) +\end{equation} +$$ + +where $L$ is the constant mobility. + +## Time discretization +Considering forward Euler explicit time stepping, we have the time discretized kinetics equation: + +$$ +\begin{align} + \eta_i^{n+1} &= \eta_i^{n} - \Delta t L~\left( -\eta_i^n + (\eta_i^n)^3 + 2 \alpha \eta_i^n \sum_{j \ne i}^N (\eta^n_j)^2 - \kappa \nabla^2 \eta^n_i \right) +\end{align} +$$ + +## Weak formulation +In the weak formulation, considering an arbitrary variation $w$, the above equation can be expressed as a residual equation: + +$$ +\begin{align} +\int_{\Omega} w \eta_i^{n+1} ~dV&= \int_{\Omega} w \eta_i^{n} - w \Delta t L~\left( -\eta_i^n + (\eta_i^n)^3 + 2 \alpha \eta_i^n \sum_{j \ne i}^N (\eta^n_j)^2 - \kappa \nabla^2 \eta^n_i \right) ~dV +\end{align} +$$ + +$$ +\begin{align} +&= \int_{\Omega} w ( \eta^{n} - \Delta t L~\left( -\eta_i^n + (\eta_i^n)^3 + 2 \alpha \eta_i^n \sum_{j \ne i}^N (\eta^n_j)^2\right) + \nabla w (-\Delta t L \kappa)~ \cdot (\nabla \eta_i^{n}) ~dV \quad [\kappa \nabla \eta_i \cdot n = 0 ~ \text{on} ~ \partial \Omega] +\end{align} +$$ + +$$ +\begin{align} +r_{\eta_i} &= \eta^{n} - \Delta t L~\left( -\eta_i^n + (\eta_i^n)^3 + 2 \alpha \eta_i^n \sum_{j \ne i}^N (\eta^n_j)^2\right) +\end{align} +$$ + +$$ +\begin{align} +r_{\eta_i x} &= (-\Delta t L \kappa)~ \cdot (\nabla \eta_i^{n}) +\end{align} +$$ + +The above values of $r_{\eta_i}$ and $r_{\eta_i x}$ are used to define the residuals in the following parameters file: +`applications/grainGrowth/equations.h` diff --git a/applications/grainGrowth_dream3d/grainGrowth.pdf b/applications/grainGrowth_dream3d/grainGrowth.pdf deleted file mode 100644 index 915207063..000000000 Binary files a/applications/grainGrowth_dream3d/grainGrowth.pdf and /dev/null differ diff --git a/applications/grainGrowth_dream3d/tex_files/rectilinear_grid_instructions.pdf b/applications/grainGrowth_dream3d/rectilinear_grid_instructions.pdf similarity index 100% rename from applications/grainGrowth_dream3d/tex_files/rectilinear_grid_instructions.pdf rename to applications/grainGrowth_dream3d/rectilinear_grid_instructions.pdf diff --git a/applications/grainGrowth_dream3d/tex_files/grainGrowth.pdf b/applications/grainGrowth_dream3d/tex_files/grainGrowth.pdf deleted file mode 100644 index 915207063..000000000 Binary files a/applications/grainGrowth_dream3d/tex_files/grainGrowth.pdf and /dev/null differ diff --git a/applications/grainGrowth_dream3d/tex_files/grainGrowth.tex b/applications/grainGrowth_dream3d/tex_files/grainGrowth.tex deleted file mode 100644 index 9d0f9670f..000000000 --- a/applications/grainGrowth_dream3d/tex_files/grainGrowth.tex +++ /dev/null @@ -1,222 +0,0 @@ -\documentclass[10pt]{article} -\usepackage{amsmath} -\usepackage{bm} -\usepackage{bbm} -\usepackage{mathrsfs} -\usepackage{graphicx} -\usepackage{wrapfig} -\usepackage{subcaption} -\usepackage{epsfig} -\usepackage{amsfonts} -\usepackage{amssymb} -\usepackage{amsmath} -\usepackage{wrapfig} -\usepackage{graphicx} -\usepackage{psfrag} -\newcommand{\sun}{\ensuremath{\odot}} % sun symbol is \sun -\let\vaccent=\v % rename builtin command \v{} to \vaccent{} -\renewcommand{\v}[1]{\ensuremath{\mathbf{#1}}} % for vectors -\newcommand{\gv}[1]{\ensuremath{\mbox{\boldmath$ #1 $}}} -\newcommand{\grad}[1]{\gv{\nabla} #1} -\renewcommand{\baselinestretch}{1.2} -\jot 5mm -\graphicspath{{./figures/}} -%text dimensions -\textwidth 6.5 in -\oddsidemargin .2 in -\topmargin -0.2 in -\textheight 8.5 in -\headheight 0.2in -\overfullrule = 0pt -\pagestyle{plain} -\def\newpar{\par\vskip 0.5cm} -\begin{document} -% -%---------------------------------------------------------------------- -% Define symbols -%---------------------------------------------------------------------- -% -\def\iso{\mathbbm{1}} -\def\half{{\textstyle{1 \over 2}}} -\def\third{{\textstyle{1 \over 3}}} -\def\fourth{{\textstyle{{1 \over 4}}}} -\def\twothird{{\textstyle {{2 \over 3}}}} -\def\ndim{{n_{\rm dim}}} -\def\nint{n_{\rm int}} -\def\lint{l_{\rm int}} -\def\nel{n_{\rm el}} -\def\nf{n_{\rm f}} -\def\DIV {\hbox{\af div}} -\def\GRAD{\hbox{\af Grad}} -\def\sym{\mathop{\rm sym}\nolimits} -\def\tr{\mathop{\rm tr}\nolimits} -\def\dev{\mathop{\rm dev}\nolimits} -\def\Dev{\mathop{\rm Dev}\nolimits} -\def\DEV{\mathop {\rm DEV}\nolimits} -\def\bfb {{\bi b}} -\def\Bnabla{\nabla} -\def\bG{{\bi G}} -\def\jmpdelu{{\lbrack\!\lbrack \Delta u\rbrack\!\rbrack}} -\def\jmpudot{{\lbrack\!\lbrack\dot u\rbrack\!\rbrack}} -\def\jmpu{{\lbrack\!\lbrack u\rbrack\!\rbrack}} -\def\jmphi{{\lbrack\!\lbrack\varphi\rbrack\!\rbrack}} -\def\ljmp{{\lbrack\!\lbrack}} -\def\rjmp{{\rbrack\!\rbrack}} -\def\sign{{\rm sign}} -\def\nn{{n+1}} -\def\na{{n+\vartheta}} -\def\nna{{n+(1-\vartheta)}} -\def\nt{{n+{1\over 2}}} -\def\nb{{n+\beta}} -\def\nbb{{n+(1-\beta)}} -%--------------------------------------------------------- -% Bold Face Math Characters: -% All In Format: \B***** . -%--------------------------------------------------------- -\def\bOne{\mbox{\boldmath$1$}} -\def\BGamma{\mbox{\boldmath$\Gamma$}} -\def\BDelta{\mbox{\boldmath$\Delta$}} -\def\BTheta{\mbox{\boldmath$\Theta$}} -\def\BLambda{\mbox{\boldmath$\Lambda$}} -\def\BXi{\mbox{\boldmath$\Xi$}} -\def\BPi{\mbox{\boldmath$\Pi$}} -\def\BSigma{\mbox{\boldmath$\Sigma$}} -\def\BUpsilon{\mbox{\boldmath$\Upsilon$}} -\def\BPhi{\mbox{\boldmath$\Phi$}} -\def\BPsi{\mbox{\boldmath$\Psi$}} -\def\BOmega{\mbox{\boldmath$\Omega$}} -\def\Balpha{\mbox{\boldmath$\alpha$}} -\def\Bbeta{\mbox{\boldmath$\beta$}} -\def\Bgamma{\mbox{\boldmath$\gamma$}} -\def\Bdelta{\mbox{\boldmath$\delta$}} -\def\Bepsilon{\mbox{\boldmath$\epsilon$}} -\def\Bzeta{\mbox{\boldmath$\zeta$}} -\def\Beta{\mbox{\boldmath$\eta$}} -\def\Btheta{\mbox{\boldmath$\theta$}} -\def\Biota{\mbox{\boldmath$\iota$}} -\def\Bkappa{\mbox{\boldmath$\kappa$}} -\def\Blambda{\mbox{\boldmath$\lambda$}} -\def\Bmu{\mbox{\boldmath$\mu$}} -\def\Bnu{\mbox{\boldmath$\nu$}} -\def\Bxi{\mbox{\boldmath$\xi$}} -\def\Bpi{\mbox{\boldmath$\pi$}} -\def\Brho{\mbox{\boldmath$\rho$}} -\def\Bsigma{\mbox{\boldmath$\sigma$}} -\def\Btau{\mbox{\boldmath$\tau$}} -\def\Bupsilon{\mbox{\boldmath$\upsilon$}} -\def\Bphi{\mbox{\boldmath$\phi$}} -\def\Bchi{\mbox{\boldmath$\chi$}} -\def\Bpsi{\mbox{\boldmath$\psi$}} -\def\Bomega{\mbox{\boldmath$\omega$}} -\def\Bvarepsilon{\mbox{\boldmath$\varepsilon$}} -\def\Bvartheta{\mbox{\boldmath$\vartheta$}} -\def\Bvarpi{\mbox{\boldmath$\varpi$}} -\def\Bvarrho{\mbox{\boldmath$\varrho$}} -\def\Bvarsigma{\mbox{\boldmath$\varsigma$}} -\def\Bvarphi{\mbox{\boldmath$\varphi$}} -\def\bone{\mathbf{1}} -\def\bzero{\mathbf{0}} -%--------------------------------------------------------- -% Bold Face Math Italic: -% All In Format: \b* . -%--------------------------------------------------------- -\def\bA{\mbox{\boldmath$ A$}} -\def\bB{\mbox{\boldmath$ B$}} -\def\bC{\mbox{\boldmath$ C$}} -\def\bD{\mbox{\boldmath$ D$}} -\def\bE{\mbox{\boldmath$ E$}} -\def\bF{\mbox{\boldmath$ F$}} -\def\bG{\mbox{\boldmath$ G$}} -\def\bH{\mbox{\boldmath$ H$}} -\def\bI{\mbox{\boldmath$ I$}} -\def\bJ{\mbox{\boldmath$ J$}} -\def\bK{\mbox{\boldmath$ K$}} -\def\bL{\mbox{\boldmath$ L$}} -\def\bM{\mbox{\boldmath$ M$}} -\def\bN{\mbox{\boldmath$ N$}} -\def\bO{\mbox{\boldmath$ O$}} -\def\bP{\mbox{\boldmath$ P$}} -\def\bQ{\mbox{\boldmath$ Q$}} -\def\bR{\mbox{\boldmath$ R$}} -\def\bS{\mbox{\boldmath$ S$}} -\def\bT{\mbox{\boldmath$ T$}} -\def\bU{\mbox{\boldmath$ U$}} -\def\bV{\mbox{\boldmath$ V$}} -\def\bW{\mbox{\boldmath$ W$}} -\def\bX{\mbox{\boldmath$ X$}} -\def\bY{\mbox{\boldmath$ Y$}} -\def\bZ{\mbox{\boldmath$ Z$}} -\def\ba{\mbox{\boldmath$ a$}} -\def\bb{\mbox{\boldmath$ b$}} -\def\bc{\mbox{\boldmath$ c$}} -\def\bd{\mbox{\boldmath$ d$}} -\def\be{\mbox{\boldmath$ e$}} -\def\bff{\mbox{\boldmath$ f$}} -\def\bg{\mbox{\boldmath$ g$}} -\def\bh{\mbox{\boldmath$ h$}} -\def\bi{\mbox{\boldmath$ i$}} -\def\bj{\mbox{\boldmath$ j$}} -\def\bk{\mbox{\boldmath$ k$}} -\def\bl{\mbox{\boldmath$ l$}} -\def\bm{\mbox{\boldmath$ m$}} -\def\bn{\mbox{\boldmath$ n$}} -\def\bo{\mbox{\boldmath$ o$}} -\def\bp{\mbox{\boldmath$ p$}} -\def\bq{\mbox{\boldmath$ q$}} -\def\br{\mbox{\boldmath$ r$}} -\def\bs{\mbox{\boldmath$ s$}} -\def\bt{\mbox{\boldmath$ t$}} -\def\bu{\mbox{\boldmath$ u$}} -\def\bv{\mbox{\boldmath$ v$}} -\def\bw{\mbox{\boldmath$ w$}} -\def\bx{\mbox{\boldmath$ x$}} -\def\by{\mbox{\boldmath$ y$}} -\def\bz{\mbox{\boldmath$ z$}} -%********************************* -%Start main paper -%********************************* -\centerline{\Large{\bf PRISMS-PF Application Formulation:}} -\smallskip -\centerline{\Large{\bf grainGrowth}} -\bigskip - -This example application implements a simple set of governing equations for isotropic grain growth. The model is a simplified version of the one in the following publication:\\ - Simulating recrystallization in titanium using the phase field method, S.P. Gentry and K. Thornton, \emph{IOP Conf. Series: Materials Science and Engineering} 89 (2015) 012024. -\\ -\\ -Consider a free energy expression of the form: -\begin{equation} - \Pi(\eta_i, \grad \eta_i) = \int_{\Omega} \left[\sum_{i=1}^N \left(-\frac{1}{2}\eta_i^2+ \frac{1}{4}\eta_i^4 \right) + \alpha \sum_{i=1}^N \sum_{j>i}^N \eta_i^2 \eta_j^2 +\frac{1}{4} \right] + \frac{\kappa}{2} \sum_{i=1}^N |\nabla \eta_i|^2 ~dV -\end{equation} -where $\eta_i$ is one of $N$ structural order parameters, $\alpha$ is the grain interaction coefficient, and $\kappa$ is the gradient energy coefficient. - -\section{Variational treatment} -The driving force for grain evolution is determined by the variational derivative of the total energy with respect to each order parameter: -\begin{equation} -\mu = \frac{\delta \Pi}{\delta \eta_i} = \left( -\eta_i + \eta_i^3 + 2 \alpha \eta_i \sum_{j \ne i}^N \eta_j^2 - \kappa \nabla^2 \eta_i \right) -\end{equation} - -\section{Kinetics} -The order parameter for each grain is unconserved, and thus their evolution can be described by Allen-Cahn equations: -\begin{equation} -\frac{\partial \eta_i}{\partial t} = -L \mu = \left( -\eta_i + \eta_i^3 + 2 \alpha \eta_i \sum_{j \ne i}^N \eta_j^2 - \kappa \nabla^2 \eta_i \right) -\end{equation} -where $L$ is the constant mobility. -\section{Time discretization} -Considering forward Euler explicit time stepping, we have the time discretized kinetics equation: -\begin{align} - \eta_i^{n+1} &= \eta_i^{n} - \Delta t L~\left( -\eta_i^n + (\eta_i^n)^3 + 2 \alpha \eta_i^n \sum_{j \ne i}^N (\eta^n_j)^2 - \kappa \nabla^2 \eta^n_i \right) -\end{align} - -\section{Weak formulation} -In the weak formulation, considering an arbitrary variation $w$, the above equation can be expressed as a residual equation: -\begin{align} -\int_{\Omega} w \eta_i^{n+1} ~dV&= \int_{\Omega} w \eta_i^{n} - w \Delta t L~\left( -\eta_i^n + (\eta_i^n)^3 + 2 \alpha \eta_i^n \sum_{j \ne i}^N (\eta^n_j)^2 - \kappa \nabla^2 \eta^n_i \right) ~dV \\ -&= \int_{\Omega} w ( \underbrace{ \eta^{n} - \Delta t L~\left( -\eta_i^n + (\eta_i^n)^3 + 2 \alpha \eta_i^n \sum_{j \ne i}^N (\eta^n_j)^2\right) }_{r_{\eta_i}} + \grad w \underbrace{ (-\Delta t L \kappa)~ \cdot (\grad \eta_i^{n})}_{r_{\eta_i x}} ~dV \quad [\kappa \grad \eta_i \cdot n = 0 ~ \text{on} ~ \partial \Omega] -\end{align} -\vskip 0.25in -The above values of $r_{\eta_i}$ and $r_{\eta_i x}$ are used to define the residuals in the following parameters file: \\ -\textit{applications/grainGrowth/equations.h} - - -\end{document} \ No newline at end of file diff --git a/applications/mechanics/mechanics.md b/applications/mechanics/mechanics.md new file mode 100644 index 000000000..d3f8d7344 --- /dev/null +++ b/applications/mechanics/mechanics.md @@ -0,0 +1,132 @@ +# PRISMS-PF: Mechanics (Infinitesimal Strain) + +Consider a elastic free energy expression of the form: + +$$ +\begin{equation} + \Pi(\varepsilon) = \int_{\Omega} \frac{1}{2} \varepsilon:C:\varepsilon ~dV - \int_{\partial \Omega} u \cdot t ~dS +\end{equation} +$$ + +where $\varepsilon$ is the infinitesimal strain tensor, given by $\varepsilon = \frac{1}{2}(\nabla u + \nabla u^T)$, $C_{ijkl}=\lambda \delta_{ij} \delta_{kl}+\mu ( \delta_{ik} \delta_{jl}+ \delta_{il} \delta_{jk} )$ is the fourth order elasticity tensor, ($\lambda$, $mu$) are the Lame parameters, $u$ is the displacement, and $t$ is the surface traction. + +## Governing equation +Considering variations on the displacement $u$ of the from $u+\alpha w$, we have + +$$ +\begin{align} +\delta \Pi &= \left. \frac{d}{d\alpha} \left( \int_{\Omega} \frac{1}{2}\epsilon(u+\alpha w) : C : \epsilon(u+\alpha w) ~dV - \int_{\partial \Omega} u \cdot t ~dS \right) \right\vert_{\alpha=0} +\end{align} +$$ + +$$ +\begin{align} +&= \int_{\Omega} \nabla w : C : \epsilon ~dV - \int_{\partial \Omega} w \cdot t~dS +\end{align} +$$ + +$$ +\begin{align} +&= \int_{\Omega} \nabla w : \sigma ~dV - \int_{\partial \Omega} w \cdot t ~dS +\end{align} +$$ + +where $\sigma = C : \varepsilon$ is the stress tensor and $t=\sigma \cdot n$ is the surface traction. + +The minimization of the variation, $\delta \Pi=0$, gives the weak formulation of the governing equation of mechanics: + +$$ +\begin{align} +\int_{\Omega} \nabla w : \sigma ~dV - \int_{\partial \Omega} w \cdot t ~dS = 0 +\end{align} +$$ + +If surface tractions are zero: + +$$ +\begin{align} +R &= \int_{\Omega} \nabla w : \sigma ~dV = 0 +\end{align} +$$ + +## Terms for Input into PRISMS-PF +In PRISMS-PF, two sets of terms are required for elliptic PDEs (such as this one), one for the left-hand side of the equation (LHS) and one for the right-hand side of the equation (RHS). We solve $R=0$ by casting this in a form that can be solved as a matrix inversion problem. This will involve a brief detour into the discretized form of the equation. First we derive an expression for the solution, given an initial guess, $u_0$: + +$$ +\begin{gather} +0 = R(u) = R(u_0 + \Delta u) +\end{gather} +$$ + +where $\Delta u = u - u_0$. Then, applying the discretization that $u = \sum_i w^i U^i$, we can write the following linearization: + +$$ +\begin{equation} +\frac{\delta R(u)}{\delta u} \Delta U = -R(u_0) +\end{equation} +$$ + +The discretized form of this equation can be written as a matrix inversion problem. However, in PRISMS-PF, we only care about the product $\frac{\delta R(u)}{\delta u} \Delta U$. Taking the variational derivative of $R(u)$ yields: + +$$ +\begin{align} +\frac{\delta R(u)}{\delta u} &= \frac{d}{d\alpha} \int_{\Omega} \nabla w :C: \epsilon (u+\alpha w) ~dV \bigg{|}_{\alpha=0} +\end{align} +$$ + +$$ +\begin{align} +&= \int_{\Omega} \nabla w :C: \frac{1}{2}\frac{d}{d\alpha}\left[ \nabla(u+\alpha w) + \nabla(u+\alpha w)^T \right] ~dV \bigg{|}_{\alpha=0} +\end{align} +$$ + +$$ +\begin{align} +&= \int_{\Omega} \nabla w :C: \frac{d}{d\alpha}\nabla(u+\alpha w) ~dV \bigg{|}_{\alpha=0} \quad (due ~to ~the ~symmetry ~of ~C) +\end{align} +$$ + +$$ +\begin{align} +&= \int_{\Omega} \nabla w :C: \nabla w ~dV +\end{align} +$$ + +In its discretized form $\frac{\delta R(u)}{\delta u} \Delta U$ is: + +$$ +\begin{equation} +\frac{\delta R(u)}{\delta u} \Delta U = \sum_i \sum_j \int_{\Omega} \nabla N^i : C : \nabla N^j dV ~\Delta U^j +\end{equation} +$$ + +Moving back to the non-discretized form yields: + +$$ +\begin{equation} +\frac{\delta R(u)}{\delta u} \Delta U = \int_{\Omega} \nabla w : C : \nabla (\Delta u) dV +\end{equation} +$$ + +Thus, the full equation relating $u_0$ and $\Delta u$ is: + +$$ +\begin{equation} +\int_{\Omega} \nabla w : C : \nabla (\Delta u) dV = -\int_{\Omega} \nabla w : \sigma ~dV +\end{equation} +$$ + +$$ +\begin{align} +r_{ux}^{LHS} &= C : \nabla (\Delta u) +\end{align} +$$ + +$$ +\begin{align} +r_{ux} &= \sigma +\end{align} +$$ + +The above values of $r_{ux}^{LHS}$ and $r_{ux}$ are used to define the equation terms in the following input file: +`applications/mechanics/equations.cc` diff --git a/applications/mechanics/mechanics.pdf b/applications/mechanics/mechanics.pdf deleted file mode 100644 index 31bdce8e0..000000000 Binary files a/applications/mechanics/mechanics.pdf and /dev/null differ diff --git a/applications/mechanics/tex_files/mechanics.tex b/applications/mechanics/tex_files/mechanics.tex deleted file mode 100644 index 702d640f5..000000000 --- a/applications/mechanics/tex_files/mechanics.tex +++ /dev/null @@ -1,241 +0,0 @@ -\documentclass[10pt]{article} -\usepackage{amsmath} -\usepackage{bm} -\usepackage{bbm} -\usepackage{mathrsfs} -\usepackage{graphicx} -\usepackage{wrapfig} -\usepackage{subcaption} -\usepackage{epsfig} -\usepackage{amsfonts} -\usepackage{amssymb} -\usepackage{amsmath} -\usepackage{wrapfig} -\usepackage{graphicx} -\usepackage{psfrag} -\newcommand{\sun}{\ensuremath{\odot}} % sun symbol is \sun -\let\vaccent=\v % rename builtin command \v{} to \vaccent{} -\renewcommand{\v}[1]{\ensuremath{\mathbf{#1}}} % for vectors -\newcommand{\gv}[1]{\ensuremath{\mbox{\boldmath$ #1 $}}} -\newcommand{\grad}[1]{\gv{\nabla} #1} -%\renewcommand{\baselinestretch}{1.2} -%\jot 5mm -%\graphicspath{{./figures/}} -%text dimensions -%\textwidth 6.5 in -%\oddsidemargin .2 in -%\topmargin -0.2 in -%\textheight 8.5 in -%\headheight 0.2in -%\overfullrule = 0pt -%\pagestyle{plain} -%\def\newpar{\par\vskip 0.5cm} -\begin{document} -% -%---------------------------------------------------------------------- -% Define symbols -%---------------------------------------------------------------------- -% -\def\iso{\mathbbm{1}} -\def\half{{\textstyle{1 \over 2}}} -\def\third{{\textstyle{1 \over 3}}} -\def\fourth{{\textstyle{{1 \over 4}}}} -\def\twothird{{\textstyle {{2 \over 3}}}} -\def\ndim{{n_{\rm dim}}} -\def\nint{n_{\rm int}} -\def\lint{l_{\rm int}} -\def\nel{n_{\rm el}} -\def\nf{n_{\rm f}} -\def\DIV {\hbox{\af div}} -\def\GRAD{\hbox{\af Grad}} -\def\sym{\mathop{\rm sym}\nolimits} -\def\tr{\mathop{\rm tr}\nolimits} -\def\dev{\mathop{\rm dev}\nolimits} -\def\Dev{\mathop{\rm Dev}\nolimits} -\def\DEV{\mathop {\rm DEV}\nolimits} -\def\bfb {{\bi b}} -\def\Bnabla{\nabla} -\def\bG{{\bi G}} -\def\jmpdelu{{\lbrack\!\lbrack \Delta u\rbrack\!\rbrack}} -\def\jmpudot{{\lbrack\!\lbrack\dot u\rbrack\!\rbrack}} -\def\jmpu{{\lbrack\!\lbrack u\rbrack\!\rbrack}} -\def\jmphi{{\lbrack\!\lbrack\varphi\rbrack\!\rbrack}} -\def\ljmp{{\lbrack\!\lbrack}} -\def\rjmp{{\rbrack\!\rbrack}} -\def\sign{{\rm sign}} -\def\nn{{n+1}} -\def\na{{n+\vartheta}} -\def\nna{{n+(1-\vartheta)}} -\def\nt{{n+{1\over 2}}} -\def\nb{{n+\beta}} -\def\nbb{{n+(1-\beta)}} -%--------------------------------------------------------- -% Bold Face Math Characters: -% All In Format: \B***** . -%--------------------------------------------------------- -\def\bOne{\mbox{\boldmath$1$}} -\def\BGamma{\mbox{\boldmath$\Gamma$}} -\def\BDelta{\mbox{\boldmath$\Delta$}} -\def\BTheta{\mbox{\boldmath$\Theta$}} -\def\BLambda{\mbox{\boldmath$\Lambda$}} -\def\BXi{\mbox{\boldmath$\Xi$}} -\def\BPi{\mbox{\boldmath$\Pi$}} -\def\BSigma{\mbox{\boldmath$\Sigma$}} -\def\BUpsilon{\mbox{\boldmath$\Upsilon$}} -\def\BPhi{\mbox{\boldmath$\Phi$}} -\def\BPsi{\mbox{\boldmath$\Psi$}} -\def\BOmega{\mbox{\boldmath$\Omega$}} -\def\Balpha{\mbox{\boldmath$\alpha$}} -\def\Bbeta{\mbox{\boldmath$\beta$}} -\def\Bgamma{\mbox{\boldmath$\gamma$}} -\def\Bdelta{\mbox{\boldmath$\delta$}} -\def\Bepsilon{\mbox{\boldmath$\epsilon$}} -\def\Bzeta{\mbox{\boldmath$\zeta$}} -\def\Beta{\mbox{\boldmath$\eta$}} -\def\Btheta{\mbox{\boldmath$\theta$}} -\def\Biota{\mbox{\boldmath$\iota$}} -\def\Bkappa{\mbox{\boldmath$\kappa$}} -\def\Blambda{\mbox{\boldmath$\lambda$}} -\def\Bmu{\mbox{\boldmath$\mu$}} -\def\Bnu{\mbox{\boldmath$\nu$}} -\def\Bxi{\mbox{\boldmath$\xi$}} -\def\Bpi{\mbox{\boldmath$\pi$}} -\def\Brho{\mbox{\boldmath$\rho$}} -\def\Bsigma{\mbox{\boldmath$\sigma$}} -\def\Btau{\mbox{\boldmath$\tau$}} -\def\Bupsilon{\mbox{\boldmath$\upsilon$}} -\def\Bphi{\mbox{\boldmath$\phi$}} -\def\Bchi{\mbox{\boldmath$\chi$}} -\def\Bpsi{\mbox{\boldmath$\psi$}} -\def\Bomega{\mbox{\boldmath$\omega$}} -\def\Bvarepsilon{\mbox{\boldmath$\varepsilon$}} -\def\Bvartheta{\mbox{\boldmath$\vartheta$}} -\def\Bvarpi{\mbox{\boldmath$\varpi$}} -\def\Bvarrho{\mbox{\boldmath$\varrho$}} -\def\Bvarsigma{\mbox{\boldmath$\varsigma$}} -\def\Bvarphi{\mbox{\boldmath$\varphi$}} -\def\bone{\mathbf{1}} -\def\bzero{\mathbf{0}} -%--------------------------------------------------------- -% Bold Face Math Italic: -% All In Format: \b* . -%--------------------------------------------------------- -\def\bA{\mbox{\boldmath$ A$}} -\def\bB{\mbox{\boldmath$ B$}} -\def\bC{\mbox{\boldmath$ C$}} -\def\bD{\mbox{\boldmath$ D$}} -\def\bE{\mbox{\boldmath$ E$}} -\def\bF{\mbox{\boldmath$ F$}} -\def\bG{\mbox{\boldmath$ G$}} -\def\bH{\mbox{\boldmath$ H$}} -\def\bI{\mbox{\boldmath$ I$}} -\def\bJ{\mbox{\boldmath$ J$}} -\def\bK{\mbox{\boldmath$ K$}} -\def\bL{\mbox{\boldmath$ L$}} -\def\bM{\mbox{\boldmath$ M$}} -\def\bN{\mbox{\boldmath$ N$}} -\def\bO{\mbox{\boldmath$ O$}} -\def\bP{\mbox{\boldmath$ P$}} -\def\bQ{\mbox{\boldmath$ Q$}} -\def\bR{\mbox{\boldmath$ R$}} -\def\bS{\mbox{\boldmath$ S$}} -\def\bT{\mbox{\boldmath$ T$}} -\def\bU{\mbox{\boldmath$ U$}} -\def\bV{\mbox{\boldmath$ V$}} -\def\bW{\mbox{\boldmath$ W$}} -\def\bX{\mbox{\boldmath$ X$}} -\def\bY{\mbox{\boldmath$ Y$}} -\def\bZ{\mbox{\boldmath$ Z$}} -\def\ba{\mbox{\boldmath$ a$}} -\def\bb{\mbox{\boldmath$ b$}} -\def\bc{\mbox{\boldmath$ c$}} -\def\bd{\mbox{\boldmath$ d$}} -\def\be{\mbox{\boldmath$ e$}} -\def\bff{\mbox{\boldmath$ f$}} -\def\bg{\mbox{\boldmath$ g$}} -\def\bh{\mbox{\boldmath$ h$}} -\def\bi{\mbox{\boldmath$ i$}} -\def\bj{\mbox{\boldmath$ j$}} -\def\bk{\mbox{\boldmath$ k$}} -\def\bl{\mbox{\boldmath$ l$}} -\def\bm{\mbox{\boldmath$ m$}} -\def\bn{\mbox{\boldmath$ n$}} -\def\bo{\mbox{\boldmath$ o$}} -\def\bp{\mbox{\boldmath$ p$}} -\def\bq{\mbox{\boldmath$ q$}} -\def\br{\mbox{\boldmath$ r$}} -\def\bs{\mbox{\boldmath$ s$}} -\def\bt{\mbox{\boldmath$ t$}} -\def\bu{\mbox{\boldmath$ u$}} -\def\bv{\mbox{\boldmath$ v$}} -\def\bw{\mbox{\boldmath$ w$}} -\def\bx{\mbox{\boldmath$ x$}} -\def\by{\mbox{\boldmath$ y$}} -\def\bz{\mbox{\boldmath$ z$}} -%********************************* -%Start main paper -%********************************* -\centerline{\Large{\bf PRISMS-PF}} -\smallskip -\centerline{\Large{\bf Mechanics (Infinitesimal Strain)}} -\bigskip -Consider a elastic free energy expression of the form: -\begin{equation} - \Pi(\varepsilon) = \int_{\Omega} \frac{1}{2} \varepsilon:C:\varepsilon ~dV - \int_{\partial \Omega} u \cdot t ~dS -\end{equation} -where $\varepsilon$ is the infinitesimal strain tensor, given by $\varepsilon = \frac{1}{2}(\grad u + \grad u^T)$, $C_{ijkl}=\lambda \delta_{ij} \delta_{kl}+\mu ( \delta_{ik} \delta_{jl}+ \delta_{il} \delta_{jk} )$ is the fourth order elasticity tensor, ($\lambda$, $mu$) are the Lame parameters, $u$ is the displacement, and $t$ is the surface traction. - -\section{Governing equation} -Considering variations on the displacement $u$ of the from $u+\alpha w$, we have -\begin{align} -\delta \Pi &= \left. \frac{d}{d\alpha} \left( \int_{\Omega} \frac{1}{2}\epsilon(u+\alpha w) : C : \epsilon(u+\alpha w) ~dV - \int_{\partial \Omega} u \cdot t ~dS \right) \right\vert_{\alpha=0}\\ -&= \int_{\Omega} \grad w : C : \epsilon ~dV - \int_{\partial \Omega} w \cdot t~dS\\ -&= \int_{\Omega} \grad w : \sigma ~dV - \int_{\partial \Omega} w \cdot t ~dS -\end{align} -where $\sigma = C : \varepsilon$ is the stress tensor and $t=\sigma \cdot n$ is the surface traction.\\ - -The minimization of the variation, $\delta \Pi=0$, gives the weak formulation of the governing equation of mechanics: - -\begin{align} -\int_{\Omega} \grad w : \sigma ~dV - \int_{\partial \Omega} w \cdot t ~dS = 0 -\end{align} - -If surface tractions are zero: \\ -\begin{align} -R &= \int_{\Omega} \grad w : \sigma ~dV = 0 -\end{align} - -\section{Terms for Input into PRISMS-PF} -In PRISMS-PF, two sets of terms are required for elliptic PDEs (such as this one), one for the left-hand side of the equation (LHS) and one for the right-hand side of the equation (RHS). We solve $R=0$ by casting this in a form that can be solved as a matrix inversion problem. This will involve a brief detour into the discretized form of the equation. First we derive an expression for the solution, given an initial guess, $u_0$: -\begin{gather} -0 = R(u) = R(u_0 + \Delta u) -\end{gather} -where $\Delta u = u - u_0$. Then, applying the discretization that $u = \sum_i w^i U^i$, we can write the following linearization: -\begin{equation} -\frac{\delta R(u)}{\delta u} \Delta U = -R(u_0) \label{matrix_eqn} -\end{equation} -The discretized form of this equation can be written as a matrix inversion problem. However, in PRISMS-PF, we only care about the product $\frac{\delta R(u)}{\delta u} \Delta U$. Taking the variational derivative of $R(u)$ yields: -\begin{align} -\frac{\delta R(u)}{\delta u} &= \frac{d}{d\alpha} \int_{\Omega} \nabla w :C: \epsilon (u+\alpha w) ~dV \bigg{|}_{\alpha=0} \\ -&= \int_{\Omega} \nabla w :C: \frac{1}{2}\frac{d}{d\alpha}\left[ \nabla(u+\alpha w) + \nabla(u+\alpha w)^T \right] ~dV \bigg{|}_{\alpha=0}\\ -&= \int_{\Omega} \nabla w :C: \frac{d}{d\alpha}\nabla(u+\alpha w) ~dV \bigg{|}_{\alpha=0} \quad (due ~to ~the ~symmetry ~of ~C) \\ -&= \int_{\Omega} \nabla w :C: \nabla w ~dV -\end{align} -In its discretized form $\frac{\delta R(u)}{\delta u} \Delta U$ is: -\begin{equation} -\frac{\delta R(u)}{\delta u} \Delta U = \sum_i \sum_j \int_{\Omega} \nabla N^i : C : \nabla N^j dV ~\Delta U^j -\end{equation} -Moving back to the non-discretized form yields: -\begin{equation} -\frac{\delta R(u)}{\delta u} \Delta U = \int_{\Omega} \nabla w : C : \nabla (\Delta u) dV -\end{equation} -Thus, the full equation relating $u_0$ and $\Delta u$ is: -\begin{equation} -\int_{\Omega} \nabla w : \underbrace{C : \nabla (\Delta u)}_{r_{ux}^{LHS}} dV = -\int_{\Omega} \grad w : \underbrace{\sigma}_{r_{ux}} ~dV -\end{equation} -The above values of $r_{ux}^{LHS}$ and $r_{ux}$ are used to define the equation terms in the following input file: \\ -$applications/mechanics/equations.cc$ - - - -\end{document} diff --git a/applications/nucleationModel/KKS_nucleation.md b/applications/nucleationModel/KKS_nucleation.md new file mode 100644 index 000000000..dcffff64b --- /dev/null +++ b/applications/nucleationModel/KKS_nucleation.md @@ -0,0 +1,333 @@ +# KKS Phase Field Model of Precipitate Evolution coupled with nucleation (October 2, 2024) + +The Nucleation Model application for PRISMS-PF incorporates a stochastic method to add nuclei to the KKS phase field model for precipitate growth. Nuclei are seeded throughout the time evolution of the system based on a probability that depends on the local solute supersaturation. This document is divided in two sections. In the first section, the phase field model formulation for precipitate evolution in a binary alloy (without elastic effects) is presented. In the second section the nucleation method is presented. + +## Precipitate Evolution +### Variational formulation +In the absence of elastic effects total free energy of the 2-component system (neglecting boundary terms) is of the form, + +$$ +\begin{equation} +\Pi(c, \eta) = \int_{\Omega} f(c, \eta) ~dV +\end{equation} +$$ + +where $c$ is the concentration of the $\beta$ phase and $\eta$ is the set of structural order parameters. The free energy density, $f$, is given by + +$$ +\begin{equation} + f(c, \eta) = f_{chem}(c, \eta) + f_{grad}(\eta) +\end{equation} +$$ + +where + +$$ +\begin{equation} +f_{chem}(c, \eta) = f_{\alpha}(c,\eta) \left( 1- H(\eta)\right) + f_{\beta}(c,\eta) H(\eta)+ W f_{Landau}(\eta) +\end{equation} +$$ + +and + +$$ +\begin{equation} +f_{grad}(\eta) = \frac{1}{2} \kappa | \nabla \eta |^2 \\ +\end{equation} +$$ + +In the KKS model (Kim 1999), the interfacial region is modeled as a mixture of the $\alpha$ and $\beta$ phases with concentrations $c_{\alpha}$ and $c_{\beta}$, respectively. The homogenous free energies for each phase, $f_{\alpha}$ and $f_{\beta}$ in this case, are typically given as functions of $c_{\alpha}$ and $c_{\beta}$, rather than directly as functions of $c$ and $\eta_p$. Thus, $f_{chem}(c, \eta)$ can be rewritten as + +$$ +\begin{equation} +f_{chem}(c, \eta) = f_{\alpha}(c_\alpha) \left( 1- H(\eta)\right) + f_{\beta}(c_\beta) H(\eta)+ W f_{Landau}(\eta) +\end{equation} +$$ + +The concentration in each phase is determined by the following system of equations: + +$$ +\begin{align} +c = c_{\alpha} \left( 1- H(\eta)\right) + c_{\beta} H(\eta) +\end{align} +$$ + +$$ +\begin{align} +\frac{\partial f_{\alpha}(c_{\alpha})}{\partial c_{\alpha}} = \frac{\partial f_{\beta}(c_{\beta})}{\partial c_{\beta}} +\end{align} +$$ + +Given the following parabolic functions for the single-phase homogenous free energies: + +$$ +\begin{align} +f_{\alpha}(c_{\alpha}) = A_{2} c_{\alpha}^2 + A_{1} c_{\alpha} + A_{0} +\end{align} +$$ + +$$ +\begin{align} +f_{\beta}(c_{\beta}) = B_{2} c_{\beta}^2 + B_{1} c_{\beta} + B_{0} +\end{align} +$$ + +the single-phase concentrations are: + +$$ +\begin{align} +c_{\alpha} = \frac{ B_2 c + \frac{1}{2} (B_1 - A_1) H(\eta) }{A_2 H(\eta) + B_2 \left( 1- H(\eta)\right) } +\end{align} +$$ + +$$ +\begin{align} +c_{\beta} = \frac{ A_2 c + \frac{1}{2} (A_1 - B_1) \left[1-H(\eta)\right] }{A_2 H(\eta) + B_2 \left[ 1- H(\eta)\right] } +\end{align} +$$ + +### Required inputs + +- $f_{\alpha}(c_{\alpha}), f_{\beta}(c_{\beta})$ - Homogeneous chemical free energy of the components of the binary system, example form given above +- $f_{Landau}(\eta)$ - Landau free energy term that controls the interfacial energy. Example form given in Appendix I +- $W$ - Barrier height for the Landau free energy term, used to control the thickness of the interface +- $H(\eta)$ - Interpolation function for connecting the $\alpha$ phase and the $\beta$ phase. Example form given in Appendix I +- $\kappa^{\eta_p}$ - gradient penalty coefficient for the $\alpha - \beta$ interface + +In addition, to drive the kinetics, we need: + +- item $M$ - mobility value for the concentration field +- item $L$ - mobility value for the structural order parameter field + + +### Variational treatment +We obtain chemical potentials for the concentration and the structural order parameter by taking variational derivatives of $\Pi$: + +$$ +\begin{align} + \mu_{c} &= f_{\alpha,c} \left( 1- H(\eta)\right) +f_{\beta,c} H(\eta) +\end{align} +$$ + +$$ +\begin{align} + \mu_{\eta} &= \left[ f_{\beta}-f_{\alpha} -(c_{\beta}-c_{\alpha}) f_{\beta,c_{\beta}} \right] H_{,\eta}(\eta) + W f_{Landau,\eta}- \kappa\nabla^2\eta +\end{align} +$$ + +### Kinetics +Now the PDE for Cahn-Hilliard dynamics is given by: + +$$ +\begin{align} + \frac{\partial c}{\partial t} &= ~\nabla \cdot \left( \frac{1}{f_{,cc}}M \nabla \mu_c \right) + \end{align} +$$ + + where $M$ is a constant mobility and the factor of $\frac{1}{f_{,cc}}$ is added to guarentee constant diffusivity in the two phases. The PDE for Allen-Cahn dynamics is given by: + +$$ + \begin{align} + \frac{\partial \eta}{\partial t} &= - L \mu_{\eta_p} +\end{align} +$$ + +where $L$ is a constant mobility. + +### Time discretization +Using forward Euler explicit time stepping, the equations from the Kinetics section become: + +$$ +\begin{align} +c^{n+1} = c^{n}+\Delta t \left[\nabla \cdot \left(\frac{1}{f_{,cc}} M \nabla \mu_c \right) \right] +\end{align} +$$ + +$$ +\begin{align} +\eta_p^{n+1} = \eta_p^n -\Delta t L \mu_{\eta_p} +\end{align} +$$ + +### Weak formulation +Writing the equations from the Kinetics section in the weak form, with the arbirary variation given by $w$ yields: + +$$ +\begin{align} +\int_\Omega w c^{n+1} dV &= \int_\Omega wc^{n}+w \Delta t \left[\nabla \cdot \left(\frac{1}{f_{,cc}} M \nabla \mu_c \right) \right] dV +\end{align} +$$ + +$$ +\begin{align} +%&= \int_\Omega wc^{n} +\nabla w \cdot (\Delta t M \nabla \mu_c ) dV +\end{align} +$$ + +$$ +\begin{align} +r_c &= c^{n} +\end{align} +$$ + +$$ +\begin{align} +r_{cx} &= \Delta t M \nabla \mu_c +\end{align} +$$ + +$$ +\begin{align} +\int_\Omega w \eta^{n+1} dV &= \int_\Omega w \eta^{n}-w \Delta t L \mu_{\eta} dV +\end{align} +$$ + +$$ +\begin{align} +%&= \int_\Omega wc^{n} +\nabla w \cdot (\Delta t M \nabla \mu_c ) dV +\end{align} +$$ + +$$ +\begin{align} +r_c &= c^{n} +\end{align} +$$ + +$$ +\begin{align} +r_{cx} &= \Delta t M \nabla \mu_c +\end{align} +$$ + +The expression of $\frac{1}{f_{,cc}} \mu_c$ can be written as: + +$$ +\begin{equation} +\frac{1}{f_{,cc}} \nabla \mu_c = \nabla c + (c_{\alpha}-c_{\beta}) H(\eta)_{,\eta} \nabla \eta +\end{equation} +$$ + +Applying the divergence theorem to the weak CH equation, one can derive the residual terms $r_c$ and $r_{cx}$: + +$$ +\begin{equation} +\int_\Omega w c^{n+1} dV = \int_\Omega w c^{n} +\nabla w \cdot (-\Delta t M \frac{1}{f_{,cc}} \nabla \mu_c ) dV +\end{equation} +$$ + +$$ +\begin{align} +r_c &= c^{n} +\end{align} +$$ + +$$ +\begin{align} +r_{cx} &= -\Delta t M \frac{1}{f_{,cc}} \nabla \mu_c +\end{align} +$$ + +Expanding $\mu_{\eta}$ in the weak AC equation and applying the divergence theorem yields the residual terms $r_{\eta}$ and $r_{\eta x}$: + +$$ +\begin{align} +\int_\Omega w \eta^{n+1} dV = &\int_\Omega w \bigg[ \eta^{n}-\Delta t L \bigg[(f_{\beta}-f_{\alpha})H_{,\eta}(\eta^n) -(c_{\beta}-c_{\alpha}) f_{\beta,c_{\beta}}H_{,\eta}(\eta^n) + W f_{Landau,\eta} +\end{align} +$$ + +$$ +\begin{align} +&+ \nabla w \cdot (-\Delta t L \kappa \nabla \eta^n ) dV +\end{align} +$$ + +$$ +\begin{align} +r_{\eta} &= \eta^{n}-\Delta t L \bigg[(f_{\beta}-f_{\alpha})H_{,\eta}(\eta^n) -(c_{\beta}-c_{\alpha}) f_{\beta,c_{\beta}}H_{,\eta}(\eta^n) + W f_{Landau,\eta} +\end{align} +$$ + +$$ +\begin{align} +r_{\eta x} &= -\Delta t L \kappa \nabla \eta^n +\end{align} +$$ + +## Nucleation method + +We follow the same approach as Jokisaari and Thornton [Comput. Mater. Sci. **112**, 128-138 (2016)] which consists of adding nuclei throughout a phase field simulation based on a probability that depends on the local supersaturation. This probability is calculated every fixed number of time steps and for every element of the computational domain. In each nucleation event, nucleation is triggered at a point within the $\alpha$ phase. Each nucleus is then added to the system by modifying the order parameter to it's $\beta$ phase value within a small domain around the selected nucleation center. This domain can be spherical/circular or ellipsoidal/elliptical. + +### Nucleation rate + +From classical nucleation theory, the nucleation rate for critical nuclei $J^*$ is given by + +$$ +\begin{align} +J^* (\mathbf{r},t)=Zn\beta^* \exp \left( -\frac{\Delta G^* }{k_B T} \right) \exp \left( -\frac{\tau}{t} \right), +\end{align} +$$ + +where $Z$ is the Zeldovich factor, $n$ is the number of nucleation sites per volume, $\beta^\*\$ is the frequency at which a critical nucleus becomes supercritical, $\Delta G^*$ is the nucleation energy barrier, $k_B$ is the Boltzmann constant, $T$ is the temperature, $t$ is time and $\tau$ is the incubation time. It can be shown that, in the dilute limit and for constant temperature, the previous equation can be simplified by grouping approximately constant terms in both the exponential and pre-exponential factors: + +$$ +\begin{align} +J^*(\mathbf{r},t)=k_1\exp \left( -\frac{k_2}{(\Delta c)^{d-1}} \right) \exp \left(-\frac{\tau}{t} \right), +\end{align} +$$ + +where $k_1$ and $k_2$ are now taken as constant parameters, $\Delta c=c(\mathbf{r},t)-c_\alpha^{eq}$ is the local supersaturation in the $\alpha$ phase and $d$ is the dimensionality of the system (*e.g.* $d=2$ or $d=3$). + +### Nucleation probability + +Considering $J^*$ to be approximately constant within a small volume, $\Delta V$, and for a small time interval, $\Delta t$, the probability that at least one nucleation event occurs in $\Delta V$ within $\Delta t$ is given by [Simmons et al., Scripta Mater. **43**, 935 (2000)] + +$$ +\begin{align} +P(\mathbf{r},t) = 1 - \exp \left( -J^* \Delta V \Delta t \right) +\end{align} +$$ + +### Hold time + +After each nucleus is added, there is a `hold' time interval, $\Delta t_h$, during which the order parameter value is fixed within a small window that encompasses the new nucleus. The purpose of this hold time is to allow the concentration to evolve within the nucleus to a value close to the coexistance composition for $\beta$ phase, and therefore, to create small a solute depleted zone around the nucleus. After the hold time, the nucleus is allowed to evolve into a precipitate. + +### Required nucleation inputs + +- $k_1$ - Constant pre-exponential factor in the equation for simple nucleation rate +- $k_2$ - Parameter that groups all constant terms of the first exponential factor in the equation for simple nucleation rate +- $\tau$ - Incubation time constant in the equation for simple nucleation rate +- $\Delta t_h$ - Nucleation hold time. + +Dimensions (ellipsoidal semiaxes) of precipitate seeds + +- a - semiaxis in the x-direction +- b - semiaxis in the y-direction +- c - semiaxis in the x-direction + + +## Appendix I: Example functions for $f_{\alpha}$, $f_{\beta}$, $f_{Landau}$, $H(\eta)$ + +$$ +\begin{align} +f_{\alpha}(c_{\alpha}) = A_{2} c_{\alpha}^2 + A_{1} c_{\alpha} + A_{0} +\end{align} +$$ + +$$ +\begin{align} +f_{\beta}(c_{\beta}) = B_{2} c_{\beta}^2 + B_{1} c_{\beta} + B_{0} +\end{align} +$$ + +$$ +\begin{align} +f_{Landau}(\eta) = \eta^2 - 2\eta^3 + \eta^4 +\end{align} +$$ + +$$ +\begin{align} +H(\eta) = 3 \eta^2 - 2 \eta^3 +\end{align} +$$ diff --git a/applications/nucleationModel/KKS_nucleation.pdf b/applications/nucleationModel/KKS_nucleation.pdf deleted file mode 100644 index 6c5eee004..000000000 Binary files a/applications/nucleationModel/KKS_nucleation.pdf and /dev/null differ diff --git a/applications/nucleationModel/tex_files/KKS_nucleation.tex b/applications/nucleationModel/tex_files/KKS_nucleation.tex deleted file mode 100644 index 1a0ed7920..000000000 --- a/applications/nucleationModel/tex_files/KKS_nucleation.tex +++ /dev/null @@ -1,360 +0,0 @@ -% *********************************************************** -% ******************* PHYSICS HEADER ************************ -% *********************************************************** -% Version 2 -\documentclass[11pt]{article} -\usepackage{amsmath} % AMS Math Package -\usepackage{amsthm} % Theorem Formatting -\usepackage{amssymb} % Math symbols such as \mathbb -\usepackage{graphicx} % Allows for eps images -\usepackage{multicol} % Allows for multiple columns -\usepackage[dvips,letterpaper,margin=0.75in,bottom=0.5in]{geometry} - % Sets margins and page size -\pagestyle{empty} % Removes page numbers -\makeatletter % Need for anything that contains an @ command -\renewcommand{\maketitle} % Redefine maketitle to conserve space -{ \begingroup \vskip 10pt \begin{center} \large {\bf \@title} - \vskip 10pt \end{center} - \vskip 10pt \endgroup \setcounter{footnote}{0} } -\makeatother % End of region containing @ commands -\renewcommand{\labelenumi}{(\alph{enumi})} % Use letters for enumerate -% \DeclareMathOperator{\Sample}{Sample} -\let\vaccent=\v % rename builtin command \v{} to \vaccent{} -\renewcommand{\v}[1]{\ensuremath{\mathbf{#1}}} % for vectors -\newcommand{\gv}[1]{\ensuremath{\mbox{\boldmath$ #1 $}}} -% for vectors of Greek letters -\newcommand{\uv}[1]{\ensuremath{\mathbf{\hat{#1}}}} % for unit vector -\newcommand{\abs}[1]{\left| #1 \right|} % for absolute value -\newcommand{\avg}[1]{\left< #1 \right>} % for average -\let\underdot=\d % rename builtin command \d{} to \underdot{} -\renewcommand{\d}[2]{\frac{d #1}{d #2}} % for derivatives -\newcommand{\dd}[2]{\frac{d^2 #1}{d #2^2}} % for double derivatives -\newcommand{\pd}[2]{\frac{\partial #1}{\partial #2}} -% for partial derivatives -\newcommand{\pdd}[2]{\frac{\partial^2 #1}{\partial #2^2}} -% for double partial derivatives -\newcommand{\pdc}[3]{\left( \frac{\partial #1}{\partial #2} - \right)_{#3}} % for thermodynamic partial derivatives -\newcommand{\ket}[1]{\left| #1 \right>} % for Dirac bras -\newcommand{\bra}[1]{\left< #1 \right|} % for Dirac kets -\newcommand{\braket}[2]{\left< #1 \vphantom{#2} \right| - \left. #2 \vphantom{#1} \right>} % for Dirac brackets -\newcommand{\matrixel}[3]{\left< #1 \vphantom{#2#3} \right| - #2 \left| #3 \vphantom{#1#2} \right>} % for Dirac matrix elements -\newcommand{\grad}[1]{\gv{\nabla} #1} % for gradient -\let\divsymb=\div % rename builtin command \div to \divsymb -\renewcommand{\div}[1]{\gv{\nabla} \cdot #1} % for divergence -\newcommand{\curl}[1]{\gv{\nabla} \times #1} % for curl -\let\baraccent=\= % rename builtin command \= to \baraccent -\renewcommand{\=}[1]{\stackrel{#1}{=}} % for putting numbers above = -\newtheorem{prop}{Proposition} -\newtheorem{thm}{Theorem}[section] -\newtheorem{lem}[thm]{Lemma} -\theoremstyle{definition} -\newtheorem{dfn}{Definition} -\theoremstyle{remark} -\newtheorem*{rmk}{Remark} - -% *********************************************************** -% ********************** END HEADER ************************* -% *********************************************************** - - -\usepackage[noprefix]{nomencl} -\usepackage{amsfonts} -\usepackage{amssymb} -\usepackage{amsmath} - -%--------------------------------------------------------- -% Bold Face Math Characters: -% All In Format: \B***** . -%--------------------------------------------------------- -\def\BGamma{\mbox{\boldmath$\Gamma$}} -\def\BDelta{\mbox{\boldmath$\Delta$}} -\def\BTheta{\mbox{\boldmath$\Theta$}} -\def\BLambda{\mbox{\boldmath$\Lambda$}} -\def\BXi{\mbox{\boldmath$\Xi$}} -\def\BPi{\mbox{\boldmath$\Pi$}} -\def\BSigma{\mbox{\boldmath$\Sigma$}} -\def\BUpsilon{\mbox{\boldmath$\Upsilon$}} -\def\BPhi{\mbox{\boldmath$\Phi$}} -\def\BPsi{\mbox{\boldmath$\Psi$}} -\def\BOmega{\mbox{\boldmath$\Omega$}} -\def\Balpha{\mbox{\boldmath$\alpha$}} -\def\Bbeta{\mbox{\boldmath$\beta$}} -\def\Bgamma{\mbox{\boldmath$\gamma$}} -\def\Bdelta{\mbox{\boldmath$\delta$}} -\def\Bepsilon{\mbox{\boldmath$\epsilon$}} -\def\Bzeta{\mbox{\boldmath$\zeta$}} -\def\Beta{\mbox{\boldmath$\eta$}} -\def\Btheta{\mbox{\boldmath$\theta$}} -\def\Biota{\mbox{\boldmath$\iota$}} -\def\Bkappa{\mbox{\boldmath$\kappa$}} -\def\Blambda{\mbox{\boldmath$\lambda$}} -\def\Bmu{\mbox{\boldmath$\mu$}} -\def\Bnu{\mbox{\boldmath$\nu$}} -\def\Bxi{\mbox{\boldmath$\xi$}} -\def\Bpi{\mbox{\boldmath$\pi$}} -\def\Brho{\mbox{\boldmath$\rho$}} -\def\Bsigma{\mbox{\boldmath$\sigma$}} -\def\Btau{\mbox{\boldmath$\tau$}} -\def\Bupsilon{\mbox{\boldmath$\upsilon$}} -\def\Bphi{\mbox{\boldmath$\phi$}} -\def\Bchi{\mbox{\boldmath$\chi$}} -\def\Bpsi{\mbox{\boldmath$\psi$}} -\def\Bomega{\mbox{\boldmath$\omega$}} -\def\Bvarepsilon{\mbox{\boldmath$\varepsilon$}} -\def\Bvartheta{\mbox{\boldmath$\vartheta$}} -\def\Bvarpi{\mbox{\boldmath$\varpi$}} -\def\Bvarrho{\mbox{\boldmath$\varrho$}} -\def\Bvarsigma{\mbox{\boldmath$\varsigma$}} -\def\Bvarphi{\mbox{\boldmath$\varphi$}} -\def\bone{\mbox{\boldmath$1$}} -\def\bzero{\mbox{\boldmath$0$}} -%--------------------------------------------------------- -% Bold Face Math Italic: -% All In Format: \b* . -%--------------------------------------------------------- -\def\bA{\mbox{\boldmath$ A$}} -\def\bB{\mbox{\boldmath$ B$}} -\def\bC{\mbox{\boldmath$ C$}} -\def\bD{\mbox{\boldmath$ D$}} -\def\bE{\mbox{\boldmath$ E$}} -\def\bF{\mbox{\boldmath$ F$}} -\def\bG{\mbox{\boldmath$ G$}} -\def\bH{\mbox{\boldmath$ H$}} -\def\bI{\mbox{\boldmath$ I$}} -\def\bJ{\mbox{\boldmath$ J$}} -\def\bK{\mbox{\boldmath$ K$}} -\def\bL{\mbox{\boldmath$ L$}} -\def\bM{\mbox{\boldmath$ M$}} -\def\bN{\mbox{\boldmath$ N$}} -\def\bO{\mbox{\boldmath$ O$}} -\def\bP{\mbox{\boldmath$ P$}} -\def\bQ{\mbox{\boldmath$ Q$}} -\def\bR{\mbox{\boldmath$ R$}} -\def\bS{\mbox{\boldmath$ S$}} -\def\bT{\mbox{\boldmath$ T$}} -\def\bU{\mbox{\boldmath$ U$}} -\def\bV{\mbox{\boldmath$ V$}} -\def\bW{\mbox{\boldmath$ W$}} -\def\bX{\mbox{\boldmath$ X$}} -\def\bY{\mbox{\boldmath$ Y$}} -\def\bZ{\mbox{\boldmath$ Z$}} -\def\ba{\mbox{\boldmath$ a$}} -\def\bb{\mbox{\boldmath$ b$}} -\def\bc{\mbox{\boldmath$ c$}} -\def\bd{\mbox{\boldmath$ d$}} -\def\be{\mbox{\boldmath$ e$}} -\def\bff{\mbox{\boldmath$ f$}} -\def\bg{\mbox{\boldmath$ g$}} -\def\bh{\mbox{\boldmath$ h$}} -\def\bi{\mbox{\boldmath$ i$}} -\def\bj{\mbox{\boldmath$ j$}} -\def\bk{\mbox{\boldmath$ k$}} -\def\bl{\mbox{\boldmath$ l$}} -\def\bm{\mbox{\boldmath$ m$}} -\def\bn{\mbox{\boldmath$ n$}} -\def\bo{\mbox{\boldmath$ o$}} -\def\bp{\mbox{\boldmath$ p$}} -\def\bq{\mbox{\boldmath$ q$}} -\def\br{\mbox{\boldmath$ r$}} -\def\bs{\mbox{\boldmath$ s$}} -\def\bt{\mbox{\boldmath$ t$}} -\def\bu{\mbox{\boldmath$ u$}} -\def\bv{\mbox{\boldmath$ v$}} -\def\bw{\mbox{\boldmath$ w$}} -\def\bx{\mbox{\boldmath$ x$}} -\def\by{\mbox{\boldmath$ y$}} -\def\bz{\mbox{\boldmath$ z$}} - -\makenomenclature -\makeindex -\title{\huge KKS Phase Field Model of Precipitate Evolution coupled with nucleation} -\begin{document} -\maketitle -\nomenclature[a]{$c$}{Concentration (Cahn-Hilliard order parameter)} -\nomenclature[b]{$\eta$}{Structural order parameter (Allen-Cahn order parameter)} -\nomenclature[c]{$\bE$}{Lagrange strain tensor (Mechanics order parameter)} -\nomenclature[d]{$\Pi$}{Total free energy of the system} -\nomenclature[e]{$F$}{Local free energy density} -\nomenclature[f]{$\mathcal{J}$}{Concentration flux} -\nomenclature[g]{$\mu$}{Chemical potential} -\nomenclature[h]{$\kappa^c$}{Cahn-Hilliard gradient coefficient} -\nomenclature[i]{$\kappa^{\eta}$}{Allen-Cahn gradient coefficient} -\nomenclature[j]{$L^{c}$}{Concentration mobility} -\nomenclature[k]{$L^{\eta}$}{Structural order parameter mobility} -\nomenclature[l]{$\omega$}{Variations over primal field} -\nomenclature[m]{$\mathcal{M}$}{Boundary chemical potential like term} -\nomenclature[n]{$\bn$}{Nomal vector in the current configuration} -\nomenclature[o]{$(\theta,~\phi)$}{Polar angles of the interface normal, $\bn$} -\centerline{\today} -%\printnomenclature[1cm] -\vspace{.25in} - -The Nucleation Model application for PRISMS-PF incorporates a stochastic method to add nuclei to the KKS phase field model for precipitate growth. Nuclei are seeded throughout the time evolution of the system based on a probability that depends on the local solute supersaturation. This document is divided in two sections. In the first section, the phase field model formulation for precipitate evolution in a binary alloy (without elastic effects) is presented. In the second section the nucleation method is presented. - -\section{Precipitate Evolution} -\subsection{Variational formulation} -In the absence of elastic effects total free energy of the 2-component system (neglecting boundary terms) is of the form, -\begin{equation} -\Pi(c, \eta) = \int_{\Omega} f(c, \eta) ~dV -\end{equation} -where $c$ is the concentration of the $\beta$ phase and $\eta$ is the set of structural order parameters. The free energy density, $f$, is given by -\begin{equation} - f(c, \eta) = f_{chem}(c, \eta) + f_{grad}(\eta) -\end{equation} -where -\begin{equation} -f_{chem}(c, \eta) = f_{\alpha}(c,\eta) \left( 1- H(\eta)\right) + f_{\beta}(c,\eta) H(\eta)+ W f_{Landau}(\eta) -\end{equation} -and -\begin{equation} -f_{grad}(\eta) = \frac{1}{2} \kappa | \nabla \eta |^2 \\ -\end{equation} - -In the KKS model (Kim 1999), the interfacial region is modeled as a mixture of the $\alpha$ and $\beta$ phases with concentrations $c_{\alpha}$ and $c_{\beta}$, respectively. The homogenous free energies for each phase, $f_{\alpha}$ and $f_{\beta}$ in this case, are typically given as functions of $c_{\alpha}$ and $c_{\beta}$, rather than directly as functions of $c$ and $\eta_p$. Thus, $f_{chem}(c, \eta)$ can be rewritten as -\begin{equation} -f_{chem}(c, \eta) = f_{\alpha}(c_\alpha) \left( 1- H(\eta)\right) + f_{\beta}(c_\beta) H(\eta)+ W f_{Landau}(\eta) -\end{equation} - -The concentration in each phase is determined by the following system of equations: -\begin{gather} -c = c_{\alpha} \left( 1- H(\eta)\right) + c_{\beta} H(\eta) \\ -\frac{\partial f_{\alpha}(c_{\alpha})}{\partial c_{\alpha}} = \frac{\partial f_{\beta}(c_{\beta})}{\partial c_{\beta}} -\end{gather} - -Given the following parabolic functions for the single-phase homogenous free energies: -\begin{gather} -f_{\alpha}(c_{\alpha}) = A_{2} c_{\alpha}^2 + A_{1} c_{\alpha} + A_{0} \\ -f_{\beta}(c_{\beta}) = B_{2} c_{\beta}^2 + B_{1} c_{\beta} + B_{0} -\end{gather} -the single-phase concentrations are: -\begin{gather} -c_{\alpha} = \frac{ B_2 c + \frac{1}{2} (B_1 - A_1) H(\eta) }{A_2 H(\eta) + B_2 \left( 1- H(\eta)\right) } \\ -c_{\beta} = \frac{ A_2 c + \frac{1}{2} (A_1 - B_1) \left[1-H(\eta)\right] }{A_2 H(\eta) + B_2 \left[ 1- H(\eta)\right] } -\end{gather} - -\subsection{Required inputs} -\begin{itemize} -\item $f_{\alpha}(c_{\alpha}), f_{\beta}(c_{\beta})$ - Homogeneous chemical free energy of the components of the binary system, example form given above -\item $f_{Landau}(\eta)$ - Landau free energy term that controls the interfacial energy. Example form given in Appendix I -\item $W$ - Barrier height for the Landau free energy term, used to control the thickness of the interface -\item $H(\eta)$ - Interpolation function for connecting the $\alpha$ phase and the $\beta$ phase. Example form given in Appendix I -\item $\Bkappa^{\eta_p}$ - gradient penalty coefficient for the $\alpha - \beta$ interface -\end{itemize} -In addition, to drive the kinetics, we need: -\begin{itemize} -\item $M$ - mobility value for the concentration field -\item $L$ - mobility value for the structural order parameter field -\end{itemize} - -\subsection{Variational treatment} -We obtain chemical potentials for the concentration and the structural order parameter by taking variational derivatives of $\Pi$: -\begin{align} - \mu_{c} &= f_{\alpha,c} \left( 1- H(\eta)\right) +f_{\beta,c} H(\eta) \\ - \mu_{\eta} &= \left[ f_{\beta}-f_{\alpha} -(c_{\beta}-c_{\alpha}) f_{\beta,c_{\beta}} \right] H(\eta)_{,\eta} + W f_{Landau,\eta}- \kappa\nabla^2\eta -\end{align} - -\subsection{Kinetics} -Now the PDE for Cahn-Hilliard dynamics is given by: -\begin{align} - \frac{\partial c}{\partial t} &= ~\grad \cdot \left( \frac{1}{f_{,cc}}M \grad \mu_c \right) \label{CH_eqn} - \end{align} - where $M$ is a constant mobility and the factor of $\frac{1}{f_{,cc}}$ is added to guarentee constant diffusivity in the two phases. The PDE for Allen-Cahn dynamics is given by: - \begin{align} - \frac{\partial \eta}{\partial t} &= - L \mu_{\eta_p} \label{AC_eqn} -\end{align} -where $L$ is a constant mobility. - -\subsection{Time discretization} -Using forward Euler explicit time stepping, equations \ref{CH_eqn} and \ref{AC_eqn} become: -\begin{align} -c^{n+1} = c^{n}+\Delta t \left[\nabla \cdot \left(\frac{1}{f_{,cc}} M \nabla \mu_c \right) \right]\\ -\eta_p^{n+1} = \eta_p^n -\Delta t L \mu_{\eta_p} -\end{align} - -\subsection{Weak formulation} -Writing equations \ref{CH_eqn} and \ref{AC_eqn} in the weak form, with the arbirary variation given by $w$ yields: -\begin{align} -\int_\Omega w c^{n+1} dV &= \int_\Omega wc^{n}+w \Delta t \left[\nabla \cdot \left(\frac{1}{f_{,cc}} M \nabla \mu_c \right) \right] dV \label{CH_weak} \\ -%&= \int_\Omega w\underbrace{c^{n}}_{r_c}+\nabla w \cdot (\underbrace{\Delta t M \nabla \mu_c}_{r_{cx}} ) dV \\ -\int_\Omega w \eta^{n+1} dV &= \int_\Omega w \eta^{n}-w \Delta t L \mu_{\eta} dV \label{AC_weak} -%&= \int_\Omega w\underbrace{c^{n}}_{r_c}+\nabla w \cdot (\underbrace{\Delta t M \nabla \mu_c}_{r_{cx}} ) dV -\end{align} - -The expression of $\frac{1}{f_{,cc}} \mu_c$ can be written as: -\begin{equation} -\frac{1}{f_{,cc}} \nabla \mu_c = \nabla c + (c_{\alpha}-c_{\beta}) H(\eta)_{,\eta} \nabla \eta \\ -\end{equation} - -Applying the divergence theorem to equation \ref{CH_weak}, one can derive the residual terms $r_c$ and $r_{cx}$: -\begin{equation} -\int_\Omega w c^{n+1} dV = \int_\Omega w\underbrace{c^{n}}_{r_c}+\nabla w \cdot (\underbrace{-\Delta t M \frac{1}{f_{,cc}} \nabla \mu_c}_{r_{cx}} ) dV -\end{equation} - -Expanding $\mu_{\eta}$ in equation \ref{AC_weak} and applying the divergence theorem yields the residual terms $r_{\eta}$ and $r_{\eta x}$: -\begin{equation} -\begin{split} -\int_\Omega w \eta^{n+1} dV = &\int_\Omega w \Bigg\{\underbrace{\eta^{n}-\Delta t L \bigg[(f_{\beta}-f_{\alpha})H(\eta^n)_{,\eta} -(c_{\beta}-c_{\alpha}) f_{\beta,c_{\beta}}H(\eta^n)_{,\eta} + W f_{Landau,\eta}}_{r_{\eta}}\\ -&+ \nabla w \cdot (\underbrace{-\Delta t L \kappa \nabla \eta^n}_{r_{\eta x}} ) dV -\end{split} -\end{equation} - -\section{Nucleation method} - -We follow the same approach as Jokisaari and Thornton [Comput. Mater. Sci. {\bf 112}, 128-138 (2016)] which consists of adding nuclei throughout a phase field simulation based on a probability that depends on the local supersaturation. This probability is calculated every fixed number of time steps and for every element of the computational domain. In each nucleation event, nucleation is triggered at a point within the $\alpha$ phase. Each nucleus is then added to the system by modifying the order parameter to it's $\beta$ phase value within a small domain around the selected nucleation center. This domain can be spherical/circular or ellipsoidal/elliptical. - -\subsection{Nucleation rate} - -From classical nucleation theory, the nucleation rate for critical nuclei $J^*$ is given by -\\ -\begin{equation} -\label{nuc_rate_full} -J^*(\mathbf{r},t)=Zn\beta^*\exp \left( -\frac{\Delta G^*}{k_B T} \right) \exp \left( -\frac{\tau}{t} \right), -\end{equation} -\\ -where $Z$ is the Zeldovich factor, $n$ is the number of nucleation sites per volume, $\beta^*$ is the frequency at which a critical nucleus becomes supercritical, $\Delta G^*$ is the nucleation energy barrier, $k_B$ is the Boltzmann constant, $T$ is the temperature, $t$ is time and $\tau$ is the incubation time. It can be shown that, in the dilute limit and for constant temperature, Eq.~\eqref{nuc_rate_full} can be simplified by grouping approximately constant terms in both the exponential and pre-exponential factors: -\\ -\begin{equation} -\label{nuc_rate_simp} -J^*(\mathbf{r},t)=k_1\exp \left( -\frac{k_2}{(\Delta c)^{d-1}} \right) \exp \left(-\frac{\tau}{t} \right), -\end{equation} -\\ -where $k_1$ and $k_2$ are now taken as constant parameters, $\Delta c=c(\mathbf{r},t)-c_\alpha^{eq}$ is the local supersaturation in the $\alpha$ phase and $d$ is the dimensionality of the system ({\it e.g.} $d=2$ or $d=3$).\\ - -\subsection{Nucleation probability} - -Considering $J^*$ to be approximately constant within a small volume, $\Delta V$, and for a small time interval, $\Delta t$, the probability that at least one nucleation event occurs in $\Delta V$ within $\Delta t$ is given by [Simmons et al., Scripta Mater. {\bf 43}, 935 (2000)] -\\ -\begin{equation} -\label{nuc_prob} -P(\mathbf{r},t) = 1 - \exp \left( -J^* \Delta V \Delta t \right) -\end{equation} -\subsection{Hold time} - -After each nucleus is added, there is a `hold' time interval, $\Delta t_h$, during which the order parameter value is fixed within a small window that encompasses the new nucleus. The purpose of this hold time is to allow the concentration to evolve within the nucleus to a value close to the coexistance composition for $\beta$ phase, and therefore, to create small a solute depleted zone around the nucleus. After the hold time, the nucleus is allowed to evolve into a precipitate. - -\subsection{Required nucleation inputs} -\begin{itemize} -\item $k_1$ - Constant pre-exponential factor in Eq.~\eqref{nuc_rate_simp} -\item $k_2$ - Parameter that groups all constant terms of the first exponential factor in Eq.~\eqref{nuc_rate_simp} -\item $\tau$ - Incubation time constant in Eq.~\eqref{nuc_rate_simp} -\item $\Delta t_h$ - Nucleation hold time. -\end{itemize} -Dimensions (ellipsoidal semiaxes) of precipitate seeds -\begin{itemize} -\item a - semiaxis in the x-direction -\item b - semiaxis in the y-direction -\item c - semiaxis in the x-direction -\end{itemize} - -\section*{Appendix I: Example functions for $f_{\alpha}$, $f_{\beta}$, $f_{Landau}$, $H(\eta)$ } -\begin{gather} -f_{\alpha}(c_{\alpha}) = A_{2} c_{\alpha}^2 + A_{1} c_{\alpha} + A_{0} \\ -f_{\beta}(c_{\beta}) = B_{2} c_{\beta}^2 + B_{1} c_{\beta} + B_{0} \\ -f_{Landau}(\eta) = \eta^2 - 2\eta^3 + \eta^4\\ -H(\eta) = 3 \eta^2 - 2 \eta^3 -\end{gather} - -\end{document} \ No newline at end of file diff --git a/applications/nucleationModel_preferential/KKS_nucleation.md b/applications/nucleationModel_preferential/KKS_nucleation.md new file mode 100644 index 000000000..dcffff64b --- /dev/null +++ b/applications/nucleationModel_preferential/KKS_nucleation.md @@ -0,0 +1,333 @@ +# KKS Phase Field Model of Precipitate Evolution coupled with nucleation (October 2, 2024) + +The Nucleation Model application for PRISMS-PF incorporates a stochastic method to add nuclei to the KKS phase field model for precipitate growth. Nuclei are seeded throughout the time evolution of the system based on a probability that depends on the local solute supersaturation. This document is divided in two sections. In the first section, the phase field model formulation for precipitate evolution in a binary alloy (without elastic effects) is presented. In the second section the nucleation method is presented. + +## Precipitate Evolution +### Variational formulation +In the absence of elastic effects total free energy of the 2-component system (neglecting boundary terms) is of the form, + +$$ +\begin{equation} +\Pi(c, \eta) = \int_{\Omega} f(c, \eta) ~dV +\end{equation} +$$ + +where $c$ is the concentration of the $\beta$ phase and $\eta$ is the set of structural order parameters. The free energy density, $f$, is given by + +$$ +\begin{equation} + f(c, \eta) = f_{chem}(c, \eta) + f_{grad}(\eta) +\end{equation} +$$ + +where + +$$ +\begin{equation} +f_{chem}(c, \eta) = f_{\alpha}(c,\eta) \left( 1- H(\eta)\right) + f_{\beta}(c,\eta) H(\eta)+ W f_{Landau}(\eta) +\end{equation} +$$ + +and + +$$ +\begin{equation} +f_{grad}(\eta) = \frac{1}{2} \kappa | \nabla \eta |^2 \\ +\end{equation} +$$ + +In the KKS model (Kim 1999), the interfacial region is modeled as a mixture of the $\alpha$ and $\beta$ phases with concentrations $c_{\alpha}$ and $c_{\beta}$, respectively. The homogenous free energies for each phase, $f_{\alpha}$ and $f_{\beta}$ in this case, are typically given as functions of $c_{\alpha}$ and $c_{\beta}$, rather than directly as functions of $c$ and $\eta_p$. Thus, $f_{chem}(c, \eta)$ can be rewritten as + +$$ +\begin{equation} +f_{chem}(c, \eta) = f_{\alpha}(c_\alpha) \left( 1- H(\eta)\right) + f_{\beta}(c_\beta) H(\eta)+ W f_{Landau}(\eta) +\end{equation} +$$ + +The concentration in each phase is determined by the following system of equations: + +$$ +\begin{align} +c = c_{\alpha} \left( 1- H(\eta)\right) + c_{\beta} H(\eta) +\end{align} +$$ + +$$ +\begin{align} +\frac{\partial f_{\alpha}(c_{\alpha})}{\partial c_{\alpha}} = \frac{\partial f_{\beta}(c_{\beta})}{\partial c_{\beta}} +\end{align} +$$ + +Given the following parabolic functions for the single-phase homogenous free energies: + +$$ +\begin{align} +f_{\alpha}(c_{\alpha}) = A_{2} c_{\alpha}^2 + A_{1} c_{\alpha} + A_{0} +\end{align} +$$ + +$$ +\begin{align} +f_{\beta}(c_{\beta}) = B_{2} c_{\beta}^2 + B_{1} c_{\beta} + B_{0} +\end{align} +$$ + +the single-phase concentrations are: + +$$ +\begin{align} +c_{\alpha} = \frac{ B_2 c + \frac{1}{2} (B_1 - A_1) H(\eta) }{A_2 H(\eta) + B_2 \left( 1- H(\eta)\right) } +\end{align} +$$ + +$$ +\begin{align} +c_{\beta} = \frac{ A_2 c + \frac{1}{2} (A_1 - B_1) \left[1-H(\eta)\right] }{A_2 H(\eta) + B_2 \left[ 1- H(\eta)\right] } +\end{align} +$$ + +### Required inputs + +- $f_{\alpha}(c_{\alpha}), f_{\beta}(c_{\beta})$ - Homogeneous chemical free energy of the components of the binary system, example form given above +- $f_{Landau}(\eta)$ - Landau free energy term that controls the interfacial energy. Example form given in Appendix I +- $W$ - Barrier height for the Landau free energy term, used to control the thickness of the interface +- $H(\eta)$ - Interpolation function for connecting the $\alpha$ phase and the $\beta$ phase. Example form given in Appendix I +- $\kappa^{\eta_p}$ - gradient penalty coefficient for the $\alpha - \beta$ interface + +In addition, to drive the kinetics, we need: + +- item $M$ - mobility value for the concentration field +- item $L$ - mobility value for the structural order parameter field + + +### Variational treatment +We obtain chemical potentials for the concentration and the structural order parameter by taking variational derivatives of $\Pi$: + +$$ +\begin{align} + \mu_{c} &= f_{\alpha,c} \left( 1- H(\eta)\right) +f_{\beta,c} H(\eta) +\end{align} +$$ + +$$ +\begin{align} + \mu_{\eta} &= \left[ f_{\beta}-f_{\alpha} -(c_{\beta}-c_{\alpha}) f_{\beta,c_{\beta}} \right] H_{,\eta}(\eta) + W f_{Landau,\eta}- \kappa\nabla^2\eta +\end{align} +$$ + +### Kinetics +Now the PDE for Cahn-Hilliard dynamics is given by: + +$$ +\begin{align} + \frac{\partial c}{\partial t} &= ~\nabla \cdot \left( \frac{1}{f_{,cc}}M \nabla \mu_c \right) + \end{align} +$$ + + where $M$ is a constant mobility and the factor of $\frac{1}{f_{,cc}}$ is added to guarentee constant diffusivity in the two phases. The PDE for Allen-Cahn dynamics is given by: + +$$ + \begin{align} + \frac{\partial \eta}{\partial t} &= - L \mu_{\eta_p} +\end{align} +$$ + +where $L$ is a constant mobility. + +### Time discretization +Using forward Euler explicit time stepping, the equations from the Kinetics section become: + +$$ +\begin{align} +c^{n+1} = c^{n}+\Delta t \left[\nabla \cdot \left(\frac{1}{f_{,cc}} M \nabla \mu_c \right) \right] +\end{align} +$$ + +$$ +\begin{align} +\eta_p^{n+1} = \eta_p^n -\Delta t L \mu_{\eta_p} +\end{align} +$$ + +### Weak formulation +Writing the equations from the Kinetics section in the weak form, with the arbirary variation given by $w$ yields: + +$$ +\begin{align} +\int_\Omega w c^{n+1} dV &= \int_\Omega wc^{n}+w \Delta t \left[\nabla \cdot \left(\frac{1}{f_{,cc}} M \nabla \mu_c \right) \right] dV +\end{align} +$$ + +$$ +\begin{align} +%&= \int_\Omega wc^{n} +\nabla w \cdot (\Delta t M \nabla \mu_c ) dV +\end{align} +$$ + +$$ +\begin{align} +r_c &= c^{n} +\end{align} +$$ + +$$ +\begin{align} +r_{cx} &= \Delta t M \nabla \mu_c +\end{align} +$$ + +$$ +\begin{align} +\int_\Omega w \eta^{n+1} dV &= \int_\Omega w \eta^{n}-w \Delta t L \mu_{\eta} dV +\end{align} +$$ + +$$ +\begin{align} +%&= \int_\Omega wc^{n} +\nabla w \cdot (\Delta t M \nabla \mu_c ) dV +\end{align} +$$ + +$$ +\begin{align} +r_c &= c^{n} +\end{align} +$$ + +$$ +\begin{align} +r_{cx} &= \Delta t M \nabla \mu_c +\end{align} +$$ + +The expression of $\frac{1}{f_{,cc}} \mu_c$ can be written as: + +$$ +\begin{equation} +\frac{1}{f_{,cc}} \nabla \mu_c = \nabla c + (c_{\alpha}-c_{\beta}) H(\eta)_{,\eta} \nabla \eta +\end{equation} +$$ + +Applying the divergence theorem to the weak CH equation, one can derive the residual terms $r_c$ and $r_{cx}$: + +$$ +\begin{equation} +\int_\Omega w c^{n+1} dV = \int_\Omega w c^{n} +\nabla w \cdot (-\Delta t M \frac{1}{f_{,cc}} \nabla \mu_c ) dV +\end{equation} +$$ + +$$ +\begin{align} +r_c &= c^{n} +\end{align} +$$ + +$$ +\begin{align} +r_{cx} &= -\Delta t M \frac{1}{f_{,cc}} \nabla \mu_c +\end{align} +$$ + +Expanding $\mu_{\eta}$ in the weak AC equation and applying the divergence theorem yields the residual terms $r_{\eta}$ and $r_{\eta x}$: + +$$ +\begin{align} +\int_\Omega w \eta^{n+1} dV = &\int_\Omega w \bigg[ \eta^{n}-\Delta t L \bigg[(f_{\beta}-f_{\alpha})H_{,\eta}(\eta^n) -(c_{\beta}-c_{\alpha}) f_{\beta,c_{\beta}}H_{,\eta}(\eta^n) + W f_{Landau,\eta} +\end{align} +$$ + +$$ +\begin{align} +&+ \nabla w \cdot (-\Delta t L \kappa \nabla \eta^n ) dV +\end{align} +$$ + +$$ +\begin{align} +r_{\eta} &= \eta^{n}-\Delta t L \bigg[(f_{\beta}-f_{\alpha})H_{,\eta}(\eta^n) -(c_{\beta}-c_{\alpha}) f_{\beta,c_{\beta}}H_{,\eta}(\eta^n) + W f_{Landau,\eta} +\end{align} +$$ + +$$ +\begin{align} +r_{\eta x} &= -\Delta t L \kappa \nabla \eta^n +\end{align} +$$ + +## Nucleation method + +We follow the same approach as Jokisaari and Thornton [Comput. Mater. Sci. **112**, 128-138 (2016)] which consists of adding nuclei throughout a phase field simulation based on a probability that depends on the local supersaturation. This probability is calculated every fixed number of time steps and for every element of the computational domain. In each nucleation event, nucleation is triggered at a point within the $\alpha$ phase. Each nucleus is then added to the system by modifying the order parameter to it's $\beta$ phase value within a small domain around the selected nucleation center. This domain can be spherical/circular or ellipsoidal/elliptical. + +### Nucleation rate + +From classical nucleation theory, the nucleation rate for critical nuclei $J^*$ is given by + +$$ +\begin{align} +J^* (\mathbf{r},t)=Zn\beta^* \exp \left( -\frac{\Delta G^* }{k_B T} \right) \exp \left( -\frac{\tau}{t} \right), +\end{align} +$$ + +where $Z$ is the Zeldovich factor, $n$ is the number of nucleation sites per volume, $\beta^\*\$ is the frequency at which a critical nucleus becomes supercritical, $\Delta G^*$ is the nucleation energy barrier, $k_B$ is the Boltzmann constant, $T$ is the temperature, $t$ is time and $\tau$ is the incubation time. It can be shown that, in the dilute limit and for constant temperature, the previous equation can be simplified by grouping approximately constant terms in both the exponential and pre-exponential factors: + +$$ +\begin{align} +J^*(\mathbf{r},t)=k_1\exp \left( -\frac{k_2}{(\Delta c)^{d-1}} \right) \exp \left(-\frac{\tau}{t} \right), +\end{align} +$$ + +where $k_1$ and $k_2$ are now taken as constant parameters, $\Delta c=c(\mathbf{r},t)-c_\alpha^{eq}$ is the local supersaturation in the $\alpha$ phase and $d$ is the dimensionality of the system (*e.g.* $d=2$ or $d=3$). + +### Nucleation probability + +Considering $J^*$ to be approximately constant within a small volume, $\Delta V$, and for a small time interval, $\Delta t$, the probability that at least one nucleation event occurs in $\Delta V$ within $\Delta t$ is given by [Simmons et al., Scripta Mater. **43**, 935 (2000)] + +$$ +\begin{align} +P(\mathbf{r},t) = 1 - \exp \left( -J^* \Delta V \Delta t \right) +\end{align} +$$ + +### Hold time + +After each nucleus is added, there is a `hold' time interval, $\Delta t_h$, during which the order parameter value is fixed within a small window that encompasses the new nucleus. The purpose of this hold time is to allow the concentration to evolve within the nucleus to a value close to the coexistance composition for $\beta$ phase, and therefore, to create small a solute depleted zone around the nucleus. After the hold time, the nucleus is allowed to evolve into a precipitate. + +### Required nucleation inputs + +- $k_1$ - Constant pre-exponential factor in the equation for simple nucleation rate +- $k_2$ - Parameter that groups all constant terms of the first exponential factor in the equation for simple nucleation rate +- $\tau$ - Incubation time constant in the equation for simple nucleation rate +- $\Delta t_h$ - Nucleation hold time. + +Dimensions (ellipsoidal semiaxes) of precipitate seeds + +- a - semiaxis in the x-direction +- b - semiaxis in the y-direction +- c - semiaxis in the x-direction + + +## Appendix I: Example functions for $f_{\alpha}$, $f_{\beta}$, $f_{Landau}$, $H(\eta)$ + +$$ +\begin{align} +f_{\alpha}(c_{\alpha}) = A_{2} c_{\alpha}^2 + A_{1} c_{\alpha} + A_{0} +\end{align} +$$ + +$$ +\begin{align} +f_{\beta}(c_{\beta}) = B_{2} c_{\beta}^2 + B_{1} c_{\beta} + B_{0} +\end{align} +$$ + +$$ +\begin{align} +f_{Landau}(\eta) = \eta^2 - 2\eta^3 + \eta^4 +\end{align} +$$ + +$$ +\begin{align} +H(\eta) = 3 \eta^2 - 2 \eta^3 +\end{align} +$$ diff --git a/applications/nucleationModel_preferential/KKS_nucleation.pdf b/applications/nucleationModel_preferential/KKS_nucleation.pdf deleted file mode 100644 index 6c5eee004..000000000 Binary files a/applications/nucleationModel_preferential/KKS_nucleation.pdf and /dev/null differ diff --git a/applications/nucleationModel_preferential/tex_files/KKS_nucleation.tex b/applications/nucleationModel_preferential/tex_files/KKS_nucleation.tex deleted file mode 100644 index 1a0ed7920..000000000 --- a/applications/nucleationModel_preferential/tex_files/KKS_nucleation.tex +++ /dev/null @@ -1,360 +0,0 @@ -% *********************************************************** -% ******************* PHYSICS HEADER ************************ -% *********************************************************** -% Version 2 -\documentclass[11pt]{article} -\usepackage{amsmath} % AMS Math Package -\usepackage{amsthm} % Theorem Formatting -\usepackage{amssymb} % Math symbols such as \mathbb -\usepackage{graphicx} % Allows for eps images -\usepackage{multicol} % Allows for multiple columns -\usepackage[dvips,letterpaper,margin=0.75in,bottom=0.5in]{geometry} - % Sets margins and page size -\pagestyle{empty} % Removes page numbers -\makeatletter % Need for anything that contains an @ command -\renewcommand{\maketitle} % Redefine maketitle to conserve space -{ \begingroup \vskip 10pt \begin{center} \large {\bf \@title} - \vskip 10pt \end{center} - \vskip 10pt \endgroup \setcounter{footnote}{0} } -\makeatother % End of region containing @ commands -\renewcommand{\labelenumi}{(\alph{enumi})} % Use letters for enumerate -% \DeclareMathOperator{\Sample}{Sample} -\let\vaccent=\v % rename builtin command \v{} to \vaccent{} -\renewcommand{\v}[1]{\ensuremath{\mathbf{#1}}} % for vectors -\newcommand{\gv}[1]{\ensuremath{\mbox{\boldmath$ #1 $}}} -% for vectors of Greek letters -\newcommand{\uv}[1]{\ensuremath{\mathbf{\hat{#1}}}} % for unit vector -\newcommand{\abs}[1]{\left| #1 \right|} % for absolute value -\newcommand{\avg}[1]{\left< #1 \right>} % for average -\let\underdot=\d % rename builtin command \d{} to \underdot{} -\renewcommand{\d}[2]{\frac{d #1}{d #2}} % for derivatives -\newcommand{\dd}[2]{\frac{d^2 #1}{d #2^2}} % for double derivatives -\newcommand{\pd}[2]{\frac{\partial #1}{\partial #2}} -% for partial derivatives -\newcommand{\pdd}[2]{\frac{\partial^2 #1}{\partial #2^2}} -% for double partial derivatives -\newcommand{\pdc}[3]{\left( \frac{\partial #1}{\partial #2} - \right)_{#3}} % for thermodynamic partial derivatives -\newcommand{\ket}[1]{\left| #1 \right>} % for Dirac bras -\newcommand{\bra}[1]{\left< #1 \right|} % for Dirac kets -\newcommand{\braket}[2]{\left< #1 \vphantom{#2} \right| - \left. #2 \vphantom{#1} \right>} % for Dirac brackets -\newcommand{\matrixel}[3]{\left< #1 \vphantom{#2#3} \right| - #2 \left| #3 \vphantom{#1#2} \right>} % for Dirac matrix elements -\newcommand{\grad}[1]{\gv{\nabla} #1} % for gradient -\let\divsymb=\div % rename builtin command \div to \divsymb -\renewcommand{\div}[1]{\gv{\nabla} \cdot #1} % for divergence -\newcommand{\curl}[1]{\gv{\nabla} \times #1} % for curl -\let\baraccent=\= % rename builtin command \= to \baraccent -\renewcommand{\=}[1]{\stackrel{#1}{=}} % for putting numbers above = -\newtheorem{prop}{Proposition} -\newtheorem{thm}{Theorem}[section] -\newtheorem{lem}[thm]{Lemma} -\theoremstyle{definition} -\newtheorem{dfn}{Definition} -\theoremstyle{remark} -\newtheorem*{rmk}{Remark} - -% *********************************************************** -% ********************** END HEADER ************************* -% *********************************************************** - - -\usepackage[noprefix]{nomencl} -\usepackage{amsfonts} -\usepackage{amssymb} -\usepackage{amsmath} - -%--------------------------------------------------------- -% Bold Face Math Characters: -% All In Format: \B***** . -%--------------------------------------------------------- -\def\BGamma{\mbox{\boldmath$\Gamma$}} -\def\BDelta{\mbox{\boldmath$\Delta$}} -\def\BTheta{\mbox{\boldmath$\Theta$}} -\def\BLambda{\mbox{\boldmath$\Lambda$}} -\def\BXi{\mbox{\boldmath$\Xi$}} -\def\BPi{\mbox{\boldmath$\Pi$}} -\def\BSigma{\mbox{\boldmath$\Sigma$}} -\def\BUpsilon{\mbox{\boldmath$\Upsilon$}} -\def\BPhi{\mbox{\boldmath$\Phi$}} -\def\BPsi{\mbox{\boldmath$\Psi$}} -\def\BOmega{\mbox{\boldmath$\Omega$}} -\def\Balpha{\mbox{\boldmath$\alpha$}} -\def\Bbeta{\mbox{\boldmath$\beta$}} -\def\Bgamma{\mbox{\boldmath$\gamma$}} -\def\Bdelta{\mbox{\boldmath$\delta$}} -\def\Bepsilon{\mbox{\boldmath$\epsilon$}} -\def\Bzeta{\mbox{\boldmath$\zeta$}} -\def\Beta{\mbox{\boldmath$\eta$}} -\def\Btheta{\mbox{\boldmath$\theta$}} -\def\Biota{\mbox{\boldmath$\iota$}} -\def\Bkappa{\mbox{\boldmath$\kappa$}} -\def\Blambda{\mbox{\boldmath$\lambda$}} -\def\Bmu{\mbox{\boldmath$\mu$}} -\def\Bnu{\mbox{\boldmath$\nu$}} -\def\Bxi{\mbox{\boldmath$\xi$}} -\def\Bpi{\mbox{\boldmath$\pi$}} -\def\Brho{\mbox{\boldmath$\rho$}} -\def\Bsigma{\mbox{\boldmath$\sigma$}} -\def\Btau{\mbox{\boldmath$\tau$}} -\def\Bupsilon{\mbox{\boldmath$\upsilon$}} -\def\Bphi{\mbox{\boldmath$\phi$}} -\def\Bchi{\mbox{\boldmath$\chi$}} -\def\Bpsi{\mbox{\boldmath$\psi$}} -\def\Bomega{\mbox{\boldmath$\omega$}} -\def\Bvarepsilon{\mbox{\boldmath$\varepsilon$}} -\def\Bvartheta{\mbox{\boldmath$\vartheta$}} -\def\Bvarpi{\mbox{\boldmath$\varpi$}} -\def\Bvarrho{\mbox{\boldmath$\varrho$}} -\def\Bvarsigma{\mbox{\boldmath$\varsigma$}} -\def\Bvarphi{\mbox{\boldmath$\varphi$}} -\def\bone{\mbox{\boldmath$1$}} -\def\bzero{\mbox{\boldmath$0$}} -%--------------------------------------------------------- -% Bold Face Math Italic: -% All In Format: \b* . -%--------------------------------------------------------- -\def\bA{\mbox{\boldmath$ A$}} -\def\bB{\mbox{\boldmath$ B$}} -\def\bC{\mbox{\boldmath$ C$}} -\def\bD{\mbox{\boldmath$ D$}} -\def\bE{\mbox{\boldmath$ E$}} -\def\bF{\mbox{\boldmath$ F$}} -\def\bG{\mbox{\boldmath$ G$}} -\def\bH{\mbox{\boldmath$ H$}} -\def\bI{\mbox{\boldmath$ I$}} -\def\bJ{\mbox{\boldmath$ J$}} -\def\bK{\mbox{\boldmath$ K$}} -\def\bL{\mbox{\boldmath$ L$}} -\def\bM{\mbox{\boldmath$ M$}} -\def\bN{\mbox{\boldmath$ N$}} -\def\bO{\mbox{\boldmath$ O$}} -\def\bP{\mbox{\boldmath$ P$}} -\def\bQ{\mbox{\boldmath$ Q$}} -\def\bR{\mbox{\boldmath$ R$}} -\def\bS{\mbox{\boldmath$ S$}} -\def\bT{\mbox{\boldmath$ T$}} -\def\bU{\mbox{\boldmath$ U$}} -\def\bV{\mbox{\boldmath$ V$}} -\def\bW{\mbox{\boldmath$ W$}} -\def\bX{\mbox{\boldmath$ X$}} -\def\bY{\mbox{\boldmath$ Y$}} -\def\bZ{\mbox{\boldmath$ Z$}} -\def\ba{\mbox{\boldmath$ a$}} -\def\bb{\mbox{\boldmath$ b$}} -\def\bc{\mbox{\boldmath$ c$}} -\def\bd{\mbox{\boldmath$ d$}} -\def\be{\mbox{\boldmath$ e$}} -\def\bff{\mbox{\boldmath$ f$}} -\def\bg{\mbox{\boldmath$ g$}} -\def\bh{\mbox{\boldmath$ h$}} -\def\bi{\mbox{\boldmath$ i$}} -\def\bj{\mbox{\boldmath$ j$}} -\def\bk{\mbox{\boldmath$ k$}} -\def\bl{\mbox{\boldmath$ l$}} -\def\bm{\mbox{\boldmath$ m$}} -\def\bn{\mbox{\boldmath$ n$}} -\def\bo{\mbox{\boldmath$ o$}} -\def\bp{\mbox{\boldmath$ p$}} -\def\bq{\mbox{\boldmath$ q$}} -\def\br{\mbox{\boldmath$ r$}} -\def\bs{\mbox{\boldmath$ s$}} -\def\bt{\mbox{\boldmath$ t$}} -\def\bu{\mbox{\boldmath$ u$}} -\def\bv{\mbox{\boldmath$ v$}} -\def\bw{\mbox{\boldmath$ w$}} -\def\bx{\mbox{\boldmath$ x$}} -\def\by{\mbox{\boldmath$ y$}} -\def\bz{\mbox{\boldmath$ z$}} - -\makenomenclature -\makeindex -\title{\huge KKS Phase Field Model of Precipitate Evolution coupled with nucleation} -\begin{document} -\maketitle -\nomenclature[a]{$c$}{Concentration (Cahn-Hilliard order parameter)} -\nomenclature[b]{$\eta$}{Structural order parameter (Allen-Cahn order parameter)} -\nomenclature[c]{$\bE$}{Lagrange strain tensor (Mechanics order parameter)} -\nomenclature[d]{$\Pi$}{Total free energy of the system} -\nomenclature[e]{$F$}{Local free energy density} -\nomenclature[f]{$\mathcal{J}$}{Concentration flux} -\nomenclature[g]{$\mu$}{Chemical potential} -\nomenclature[h]{$\kappa^c$}{Cahn-Hilliard gradient coefficient} -\nomenclature[i]{$\kappa^{\eta}$}{Allen-Cahn gradient coefficient} -\nomenclature[j]{$L^{c}$}{Concentration mobility} -\nomenclature[k]{$L^{\eta}$}{Structural order parameter mobility} -\nomenclature[l]{$\omega$}{Variations over primal field} -\nomenclature[m]{$\mathcal{M}$}{Boundary chemical potential like term} -\nomenclature[n]{$\bn$}{Nomal vector in the current configuration} -\nomenclature[o]{$(\theta,~\phi)$}{Polar angles of the interface normal, $\bn$} -\centerline{\today} -%\printnomenclature[1cm] -\vspace{.25in} - -The Nucleation Model application for PRISMS-PF incorporates a stochastic method to add nuclei to the KKS phase field model for precipitate growth. Nuclei are seeded throughout the time evolution of the system based on a probability that depends on the local solute supersaturation. This document is divided in two sections. In the first section, the phase field model formulation for precipitate evolution in a binary alloy (without elastic effects) is presented. In the second section the nucleation method is presented. - -\section{Precipitate Evolution} -\subsection{Variational formulation} -In the absence of elastic effects total free energy of the 2-component system (neglecting boundary terms) is of the form, -\begin{equation} -\Pi(c, \eta) = \int_{\Omega} f(c, \eta) ~dV -\end{equation} -where $c$ is the concentration of the $\beta$ phase and $\eta$ is the set of structural order parameters. The free energy density, $f$, is given by -\begin{equation} - f(c, \eta) = f_{chem}(c, \eta) + f_{grad}(\eta) -\end{equation} -where -\begin{equation} -f_{chem}(c, \eta) = f_{\alpha}(c,\eta) \left( 1- H(\eta)\right) + f_{\beta}(c,\eta) H(\eta)+ W f_{Landau}(\eta) -\end{equation} -and -\begin{equation} -f_{grad}(\eta) = \frac{1}{2} \kappa | \nabla \eta |^2 \\ -\end{equation} - -In the KKS model (Kim 1999), the interfacial region is modeled as a mixture of the $\alpha$ and $\beta$ phases with concentrations $c_{\alpha}$ and $c_{\beta}$, respectively. The homogenous free energies for each phase, $f_{\alpha}$ and $f_{\beta}$ in this case, are typically given as functions of $c_{\alpha}$ and $c_{\beta}$, rather than directly as functions of $c$ and $\eta_p$. Thus, $f_{chem}(c, \eta)$ can be rewritten as -\begin{equation} -f_{chem}(c, \eta) = f_{\alpha}(c_\alpha) \left( 1- H(\eta)\right) + f_{\beta}(c_\beta) H(\eta)+ W f_{Landau}(\eta) -\end{equation} - -The concentration in each phase is determined by the following system of equations: -\begin{gather} -c = c_{\alpha} \left( 1- H(\eta)\right) + c_{\beta} H(\eta) \\ -\frac{\partial f_{\alpha}(c_{\alpha})}{\partial c_{\alpha}} = \frac{\partial f_{\beta}(c_{\beta})}{\partial c_{\beta}} -\end{gather} - -Given the following parabolic functions for the single-phase homogenous free energies: -\begin{gather} -f_{\alpha}(c_{\alpha}) = A_{2} c_{\alpha}^2 + A_{1} c_{\alpha} + A_{0} \\ -f_{\beta}(c_{\beta}) = B_{2} c_{\beta}^2 + B_{1} c_{\beta} + B_{0} -\end{gather} -the single-phase concentrations are: -\begin{gather} -c_{\alpha} = \frac{ B_2 c + \frac{1}{2} (B_1 - A_1) H(\eta) }{A_2 H(\eta) + B_2 \left( 1- H(\eta)\right) } \\ -c_{\beta} = \frac{ A_2 c + \frac{1}{2} (A_1 - B_1) \left[1-H(\eta)\right] }{A_2 H(\eta) + B_2 \left[ 1- H(\eta)\right] } -\end{gather} - -\subsection{Required inputs} -\begin{itemize} -\item $f_{\alpha}(c_{\alpha}), f_{\beta}(c_{\beta})$ - Homogeneous chemical free energy of the components of the binary system, example form given above -\item $f_{Landau}(\eta)$ - Landau free energy term that controls the interfacial energy. Example form given in Appendix I -\item $W$ - Barrier height for the Landau free energy term, used to control the thickness of the interface -\item $H(\eta)$ - Interpolation function for connecting the $\alpha$ phase and the $\beta$ phase. Example form given in Appendix I -\item $\Bkappa^{\eta_p}$ - gradient penalty coefficient for the $\alpha - \beta$ interface -\end{itemize} -In addition, to drive the kinetics, we need: -\begin{itemize} -\item $M$ - mobility value for the concentration field -\item $L$ - mobility value for the structural order parameter field -\end{itemize} - -\subsection{Variational treatment} -We obtain chemical potentials for the concentration and the structural order parameter by taking variational derivatives of $\Pi$: -\begin{align} - \mu_{c} &= f_{\alpha,c} \left( 1- H(\eta)\right) +f_{\beta,c} H(\eta) \\ - \mu_{\eta} &= \left[ f_{\beta}-f_{\alpha} -(c_{\beta}-c_{\alpha}) f_{\beta,c_{\beta}} \right] H(\eta)_{,\eta} + W f_{Landau,\eta}- \kappa\nabla^2\eta -\end{align} - -\subsection{Kinetics} -Now the PDE for Cahn-Hilliard dynamics is given by: -\begin{align} - \frac{\partial c}{\partial t} &= ~\grad \cdot \left( \frac{1}{f_{,cc}}M \grad \mu_c \right) \label{CH_eqn} - \end{align} - where $M$ is a constant mobility and the factor of $\frac{1}{f_{,cc}}$ is added to guarentee constant diffusivity in the two phases. The PDE for Allen-Cahn dynamics is given by: - \begin{align} - \frac{\partial \eta}{\partial t} &= - L \mu_{\eta_p} \label{AC_eqn} -\end{align} -where $L$ is a constant mobility. - -\subsection{Time discretization} -Using forward Euler explicit time stepping, equations \ref{CH_eqn} and \ref{AC_eqn} become: -\begin{align} -c^{n+1} = c^{n}+\Delta t \left[\nabla \cdot \left(\frac{1}{f_{,cc}} M \nabla \mu_c \right) \right]\\ -\eta_p^{n+1} = \eta_p^n -\Delta t L \mu_{\eta_p} -\end{align} - -\subsection{Weak formulation} -Writing equations \ref{CH_eqn} and \ref{AC_eqn} in the weak form, with the arbirary variation given by $w$ yields: -\begin{align} -\int_\Omega w c^{n+1} dV &= \int_\Omega wc^{n}+w \Delta t \left[\nabla \cdot \left(\frac{1}{f_{,cc}} M \nabla \mu_c \right) \right] dV \label{CH_weak} \\ -%&= \int_\Omega w\underbrace{c^{n}}_{r_c}+\nabla w \cdot (\underbrace{\Delta t M \nabla \mu_c}_{r_{cx}} ) dV \\ -\int_\Omega w \eta^{n+1} dV &= \int_\Omega w \eta^{n}-w \Delta t L \mu_{\eta} dV \label{AC_weak} -%&= \int_\Omega w\underbrace{c^{n}}_{r_c}+\nabla w \cdot (\underbrace{\Delta t M \nabla \mu_c}_{r_{cx}} ) dV -\end{align} - -The expression of $\frac{1}{f_{,cc}} \mu_c$ can be written as: -\begin{equation} -\frac{1}{f_{,cc}} \nabla \mu_c = \nabla c + (c_{\alpha}-c_{\beta}) H(\eta)_{,\eta} \nabla \eta \\ -\end{equation} - -Applying the divergence theorem to equation \ref{CH_weak}, one can derive the residual terms $r_c$ and $r_{cx}$: -\begin{equation} -\int_\Omega w c^{n+1} dV = \int_\Omega w\underbrace{c^{n}}_{r_c}+\nabla w \cdot (\underbrace{-\Delta t M \frac{1}{f_{,cc}} \nabla \mu_c}_{r_{cx}} ) dV -\end{equation} - -Expanding $\mu_{\eta}$ in equation \ref{AC_weak} and applying the divergence theorem yields the residual terms $r_{\eta}$ and $r_{\eta x}$: -\begin{equation} -\begin{split} -\int_\Omega w \eta^{n+1} dV = &\int_\Omega w \Bigg\{\underbrace{\eta^{n}-\Delta t L \bigg[(f_{\beta}-f_{\alpha})H(\eta^n)_{,\eta} -(c_{\beta}-c_{\alpha}) f_{\beta,c_{\beta}}H(\eta^n)_{,\eta} + W f_{Landau,\eta}}_{r_{\eta}}\\ -&+ \nabla w \cdot (\underbrace{-\Delta t L \kappa \nabla \eta^n}_{r_{\eta x}} ) dV -\end{split} -\end{equation} - -\section{Nucleation method} - -We follow the same approach as Jokisaari and Thornton [Comput. Mater. Sci. {\bf 112}, 128-138 (2016)] which consists of adding nuclei throughout a phase field simulation based on a probability that depends on the local supersaturation. This probability is calculated every fixed number of time steps and for every element of the computational domain. In each nucleation event, nucleation is triggered at a point within the $\alpha$ phase. Each nucleus is then added to the system by modifying the order parameter to it's $\beta$ phase value within a small domain around the selected nucleation center. This domain can be spherical/circular or ellipsoidal/elliptical. - -\subsection{Nucleation rate} - -From classical nucleation theory, the nucleation rate for critical nuclei $J^*$ is given by -\\ -\begin{equation} -\label{nuc_rate_full} -J^*(\mathbf{r},t)=Zn\beta^*\exp \left( -\frac{\Delta G^*}{k_B T} \right) \exp \left( -\frac{\tau}{t} \right), -\end{equation} -\\ -where $Z$ is the Zeldovich factor, $n$ is the number of nucleation sites per volume, $\beta^*$ is the frequency at which a critical nucleus becomes supercritical, $\Delta G^*$ is the nucleation energy barrier, $k_B$ is the Boltzmann constant, $T$ is the temperature, $t$ is time and $\tau$ is the incubation time. It can be shown that, in the dilute limit and for constant temperature, Eq.~\eqref{nuc_rate_full} can be simplified by grouping approximately constant terms in both the exponential and pre-exponential factors: -\\ -\begin{equation} -\label{nuc_rate_simp} -J^*(\mathbf{r},t)=k_1\exp \left( -\frac{k_2}{(\Delta c)^{d-1}} \right) \exp \left(-\frac{\tau}{t} \right), -\end{equation} -\\ -where $k_1$ and $k_2$ are now taken as constant parameters, $\Delta c=c(\mathbf{r},t)-c_\alpha^{eq}$ is the local supersaturation in the $\alpha$ phase and $d$ is the dimensionality of the system ({\it e.g.} $d=2$ or $d=3$).\\ - -\subsection{Nucleation probability} - -Considering $J^*$ to be approximately constant within a small volume, $\Delta V$, and for a small time interval, $\Delta t$, the probability that at least one nucleation event occurs in $\Delta V$ within $\Delta t$ is given by [Simmons et al., Scripta Mater. {\bf 43}, 935 (2000)] -\\ -\begin{equation} -\label{nuc_prob} -P(\mathbf{r},t) = 1 - \exp \left( -J^* \Delta V \Delta t \right) -\end{equation} -\subsection{Hold time} - -After each nucleus is added, there is a `hold' time interval, $\Delta t_h$, during which the order parameter value is fixed within a small window that encompasses the new nucleus. The purpose of this hold time is to allow the concentration to evolve within the nucleus to a value close to the coexistance composition for $\beta$ phase, and therefore, to create small a solute depleted zone around the nucleus. After the hold time, the nucleus is allowed to evolve into a precipitate. - -\subsection{Required nucleation inputs} -\begin{itemize} -\item $k_1$ - Constant pre-exponential factor in Eq.~\eqref{nuc_rate_simp} -\item $k_2$ - Parameter that groups all constant terms of the first exponential factor in Eq.~\eqref{nuc_rate_simp} -\item $\tau$ - Incubation time constant in Eq.~\eqref{nuc_rate_simp} -\item $\Delta t_h$ - Nucleation hold time. -\end{itemize} -Dimensions (ellipsoidal semiaxes) of precipitate seeds -\begin{itemize} -\item a - semiaxis in the x-direction -\item b - semiaxis in the y-direction -\item c - semiaxis in the x-direction -\end{itemize} - -\section*{Appendix I: Example functions for $f_{\alpha}$, $f_{\beta}$, $f_{Landau}$, $H(\eta)$ } -\begin{gather} -f_{\alpha}(c_{\alpha}) = A_{2} c_{\alpha}^2 + A_{1} c_{\alpha} + A_{0} \\ -f_{\beta}(c_{\beta}) = B_{2} c_{\beta}^2 + B_{1} c_{\beta} + B_{0} \\ -f_{Landau}(\eta) = \eta^2 - 2\eta^3 + \eta^4\\ -H(\eta) = 3 \eta^2 - 2 \eta^3 -\end{gather} - -\end{document} \ No newline at end of file diff --git a/applications/precipitateEvolution/formulation_precipitateEvolution.md b/applications/precipitateEvolution/formulation_precipitateEvolution.md new file mode 100644 index 000000000..f5c7326a9 --- /dev/null +++ b/applications/precipitateEvolution/formulation_precipitateEvolution.md @@ -0,0 +1,559 @@ +# PRISMS-PF Application Formulation: + +## Variational formulation +The total free energy of the system (neglecting boundary terms) is of the form, + +$$ +\begin{equation} +\Pi(c, \eta_1, \eta_2, \eta_3, \epsilon) = \int_{\Omega} f(c, \eta_1, \eta_2, \eta_3, \epsilon) ~dV +\end{equation} +$$ + +where $c$ is the concentration of the $\beta$ phase, $\eta_p$ are the structural order parameters and $\epsilon$ is the small strain tensor. $f$, the free energy density is given by + +$$ +\begin{equation} + f(c, \eta_1, \eta_2, \eta_3, \epsilon) = f_{chem}(c, \eta_1, \eta_2, \eta_3) + f_{grad}(\eta_1, \eta_2, \eta_3) + f_{elastic}(c,\eta_1, \eta_2, \eta_3,\epsilon) +\end{equation} +$$ + +where + +$$ +\begin{align} +f_{chem}(c, \eta_1, \eta_2, \eta_3) = f_{\alpha}(c) \left( 1- H(\eta_1)-H(\eta_2)-H(\eta_3)\right) + f_{\beta}(c) \left( H(\eta_1) + H(\eta_2) + H(\eta_3)) \right) +\end{align} +$$ + +$$ +\begin{align} +f_{grad}(\eta_1, \eta_2, \eta_3) = \frac{1}{2} \sum_{p=1}^3 \kappa_{ij}^{\eta_p} \eta_{p,i} \eta_{p,j} +\end{align} +$$ + +$$ +\begin{align} +f_{elastic}(c,\eta_1, \eta_2, \eta_3,\epsilon) = \frac{1}{2} C_{ijkl}(\eta_1, \eta_2, \eta_3) \left( \epsilon_{ij} - \epsilon ^0_{ij}(c, \eta_1, \eta_2, \eta_3) \right)\left( \epsilon_{kl} - \epsilon^0_{kl}(c, \eta_1, \eta_2, \eta_3)\right) +\end{align} +$$ + +$$ +\begin{align} +\epsilon^0(c, \eta_1, \eta_2, \eta_3) = H(\eta_1) \epsilon^0_{\eta_1} (c)+ H(\eta_2) \epsilon^0_{\eta_2} (c) + H(\eta_3) \epsilon^0_{\eta_3} (c) +\end{align} +$$ + +$$ +\begin{align} +C(\eta_1, \eta_2, \eta_3) = H(\eta_1) C_{\eta_1}+ H(\eta_2) C_{\eta_2} + H(\eta_3) C_{\eta_3} + \left( 1- H(\eta_1)-H(\eta_2)-H(\eta_3)\right) C_{\alpha} +\end{align} +$$ + +Here $\epsilon^0_{\eta_p}$ are the composition dependent stress free strain transformation tensor corresponding to each structural order parameter. + +## Required inputs + +- $f_{\alpha}(c), f_{\beta}(c)$ - Homogeneous chemical free energy of the components of the binary system, example form given in Appendix I +- $H(\eta_p)$ - Interpolation function for connecting the $\alpha$ phase and the $p^{th}$ orientation variant of the $\beta$ phase, example form given in Appendix I +- $\kappa^{\eta_p}$ - gradient penalty tensor for the $p^{th}$ orientation variant of the $\beta$ phase +- $C_{\eta_p}$ - fourth order elasticity tensor (or its equivalent second order Voigt representation) for the $p^{th}$ orientation variant of the $\beta$ phase +- $C_{\alpha}$ - fourth order elasticity tensor (or its equivalent second order Voigt representation) for the $\alpha$ phase +- $\epsilon^0_{\eta_p}$ - stress free strain transformation tensor for the $p^{th}$ orientation variant of the $\beta$ phase + +In addition, to drive the kinetics, we need: + +- $M$ - mobility value for the concentration field +- $L$ - mobility value for the structural order parameter field + + +## Variational treatment +From the variational derivatives given in Appendix II, we obtain the chemical potentials for the concentration and the structural order parameters: + +$$ +\begin{align} + \mu_{c} &= f_{\alpha,c} \left( 1- H(\eta_1)-H(\eta_2)-H(\eta_3)\right) +f_{\beta,c} \left( H(\eta_1) + H(\eta_2) + H(\eta_3) \right) + C_{ijkl} (- \epsilon^0_{ij,c}) \left( \epsilon_{kl} - \epsilon^0_{kl}\right) +\end{align} +$$ + +$$ +\begin{align} + \mu_{\eta_p} &= (f_{\beta}-f_{\alpha})H_{,\eta_p}(\eta_p) - \kappa_{ij}^{\eta_p} \eta_{p,ij} + C_{ijkl} (- \epsilon^0_{ij,\eta_p}) \left( \epsilon_{kl} - \epsilon^0_{kl}\right) + \frac{1}{2} C_{ijkl,\eta_p} \left( \epsilon_{ij} - \epsilon ^0_{ij} \right) \left( \epsilon_{kl} - \epsilon^0_{kl}\right) +\end{align} +$$ + +## Kinetics +Now the PDE for Cahn-Hilliard dynamics is given by: + +$$ +\begin{align} + \frac{\partial c}{\partial t} &= ~\nabla \cdot (M \nabla \mu_c) + \end{align} +$$ + + and the PDE for Allen-Cahn dynamics is given by: + +$$ + \begin{align} + \frac{\partial \eta_p}{\partial t} &= - L \mu_{\eta_p} +\end{align} +$$ + +where $M$ and $L$ are the constant mobilities. + +## Mechanics +Considering variations on the displacement $u$ of the from $u+\epsilon w$, we have + +$$ +\begin{align} +\delta_u \Pi &= \int_{\Omega} \nabla w : C(\eta_1, \eta_2, \eta_3) : \left( \epsilon - \epsilon^0(c,\eta_1, \eta_2, \eta_3)\right) ~dV = 0 +\end{align} +$$ + +where $\sigma = C(\eta_1, \eta_2, \eta_3) : \left( \epsilon - \epsilon^0(c,\eta_1, \eta_2, \eta_3)\right)$ is the stress tensor. + +Now consider + +$$ +\begin{align} +R &= \int_{\Omega} \nabla w : C(\eta_1, \eta_2, \eta_3) : \left( \epsilon - \epsilon^0(c,\eta_1, \eta_2, \eta_3)\right) ~dV = 0 +\end{align} +$$ + +We solve for $R=0$ using a gradient scheme which involves the following linearization: + +$$ +\begin{align} +R_{u}~| + \frac{\delta R}{\delta u} \Delta u &= 0 +\end{align} +$$ + +$$ +\begin{align} +\Rightarrow \frac{\delta R}{\delta u} \Delta u &= -R_{u}~| +\end{align} +$$ + +This is the linear system $Ax=b$ which we solve implicitly using the Conjugate Gradient scheme. For clarity, here in the left hand side (LHS) $A=\frac{\delta R}{\delta u}$, $x=\Delta u$ and the right hand side (RHS) is $b=-R~|_{u}$. + + +## Time discretization +Using forward Euler explicit time stepping, the Cahn-Hillard and Allen-Cahn equations become: + +$$ +\begin{align} +c^{n+1} = c^{n} + \Delta t [\nabla \cdot (M \nabla \mu_c)] +\end{align} +$$ + +$$ +\begin{align} +\eta_p^{n+1} = \eta_p^n -\Delta t L \mu_{\eta_p} +\end{align} +$$ + +## Weak formulation and residual expressions +### The Cahn-Hillard and Allen-Cahn equations +Writing the Cahn-Hillard and Allen-Cahn equations in the weak form, with the arbirary variation given by $w$ yields: + +$$ +\begin{align} +\int_\Omega w c^{n+1} dV &= \int_\Omega wc^{n}+w \Delta t [\nabla \cdot (M \nabla \mu_c) ] dV +\end{align} +$$ + +$$ +\begin{align} +%&= \int_\Omega w c^{n}+\nabla w \cdot (\Delta t M \nabla \mu_c ) dV +\end{align} +$$ + +$$ +\begin{align} +r_c &= c^{n} +\end{align} +$$ + +$$ +\begin{align} +r_{cx} &= \Delta t M \nabla \mu_c +\end{align} +$$ + +$$ +\begin{align} +\int_\Omega w \eta_p^{n+1} dV &= \int_\Omega w \eta_p^{n}-w \Delta t L \mu_{\eta_p} dV +%&= \int_\Omega w\underbrace{c^{n}}_{r_c}+\nabla w \cdot (\Delta t M \nabla \mu_c ) dV +\end{align} +$$ + +$$ +\begin{align} +r_{cx} &= \Delta t M \nabla \mu_c +\end{align} +$$ + +The gradient of $\mu_c$ is: + +$$ +\begin{align} +\nabla \mu_c = & \nabla c \left[f_{\alpha,cc}+ \sum_{p=1}^3 H(\eta_p)(f_{\beta,cc}-f_{\alpha,cc}) \right]+ \sum_{p=1}^3 \nabla \eta_p H_{,\eta_p}(\eta_p) (f_{\beta,c}-f_{\alpha,c}) +\end{align} +$$ + +$$ +\begin{align} +&+ \left[ \sum_{p=1}^3 (C_{ijkl}^{\eta_p} - C_{ijkl}^{\alpha} )\nabla \eta_p H_{,\eta_p}(\eta_p) \right](- \epsilon_{ij,c}^0)(\epsilon_{ij} - \epsilon_{ij}^0) +\end{align} +$$ + +$$ +\begin{align} +&- C_{ijkl} \left[ \sum_{p=1}^3 H_{,\eta_p}(\eta_p) \epsilon_{ij,c}^{0\eta_p} \nabla \eta_p + H(\eta_p) \epsilon_{ij,cc}^{0\eta_p} \nabla c \right] ( \epsilon_{kl}-\epsilon_{kl}^0) +\end{align} +$$ + +$$ +\begin{align} +&+ C_{ijkl} (-\epsilon_{ij,c}^0) \left[ \nabla \epsilon_{ij} - \left( \sum_{p=1}^3 H_{,\eta_p}(\eta_p) \epsilon_{kl}^{0\eta_p} \nabla \eta_p + H(\eta_p) \epsilon_{kl,c}^{0\eta_p} \nabla c \right) \right] +\end{align} +$$ + +Applying the divergence theorem to the weak CH equation, one can derive the residual terms $r_c$ and $r_{cx}$: + +$$ +\begin{equation} +\int_\Omega w c^{n+1} dV = \int_\Omega w c^{n} +\nabla w \cdot (-\Delta t M \nabla \mu_c ) dV +\end{equation} +$$ + +$$ +\begin{align} +r_c &= c^{n} +\end{align} +$$ + +$$ +\begin{align} +r_{cx} &= -\Delta t M \nabla \mu_c +\end{align} +$$ + +Expanding $\mu_{\eta_p}$ in the weak AC equation and applying the divergence theorem yields the residual terms $r_{\eta_p}$ and $r_{\eta_p x}$: + +$$ +\begin{align} +\int_\Omega w \eta_p^{n+1} dV &= +\end{align} +$$ + +$$ +\begin{align} +&\int_\Omega w \Bigg\[\eta_p^{n}-\Delta t L \bigg[(f_{\beta}-f_{\alpha})H_{,\eta_p}(\eta_p^n) - C_{ijkl} \left( H_{,\eta_p}(\eta_p) \epsilon_{ij}^{0 \eta_p}\right)\left(\epsilon_{kl} - \epsilon_{kl}^{0} \right) +\end{align} +$$ + +$$ +\begin{align} +&+ \frac{1}{2} \left[ (C_{ijkl}^{\eta_p} - C_{ijkl}^{\alpha}) H_{,\eta_p}(\eta_p) \right] \left(\epsilon_{ij} - \epsilon_{ij}^{0} \right) \left(\epsilon_{kl} - \epsilon_{kl}^{0} \right) \bigg] \Bigg\] +\end{align} +$$ + +$$ +\begin{align} +&+ \nabla w \cdot (-\Delta t L \kappa_{ij}^{\eta_p} \eta_{p,i}^n ) dV +\end{align} +$$ + +$$ +\begin{align} +r_{\eta_p} &= \eta_p^{n}-\Delta t L \bigg[(f_{\beta}-f_{\alpha})H_{,\eta_p}(\eta_p^n) - C_{ijkl} \left( H_{,\eta_p}(\eta_p) \epsilon_{ij}^{0 \eta_p}\right)\left(\epsilon_{kl} - \epsilon_{kl}^{0} \right) + \frac{1}{2} \left[ (C_{ijkl}^{\eta_p} - C_{ijkl}^{\alpha}) H_{,\eta_p}(\eta_p) \right] \left(\epsilon_{ij} - \epsilon_{ij}^{0} \right) \left(\epsilon_{kl} - \epsilon_{kl}^{0} \right) \bigg] +\end{align} +$$ + +$$ +\begin{align} +r_{\eta_p x} &= -\Delta t L \kappa_{ij}^{\eta_p} \eta_{p,i}^n +\end{align} +$$ + +The above values of $r_c$, $r_{cx}$, $r_{\eta_p}$, and $r_{\eta_p x}$ are used to define the residuals in the following input file: +`applications/precipitateEvolution/equations.h` + +### The mechanical equilbrium equation +In PRISMS-PF, two sets of residuals are required for elliptic PDEs (such as this one), one for the left-hand side of the equation (LHS) and one for the right-hand side of the equation (RHS). We solve $R=\delta_u \Pi$ by casting this in a form that can be solved as a matrix inversion problem. This will involve a brief detour into the discretized form of the equation. First we derive an expression for the solution, given an initial guess, $u_0$: + +$$ +\begin{gather} +0 = R(u) = R(u_0 + \Delta u) +\end{gather} +$$ + +where $\Delta u = u - u_0$. Then, applying the discretization that $u = \sum_i w^i U^i$, we can write the following linearization: + +$$ +\begin{equation} +\frac{\delta R(u)}{\delta u} \Delta U = -R(u_0) +\end{equation} +$$ + +The discretized form of this equation can be written as a matrix inversion problem. However, in PRISMS-PF, we only care about the product $\frac{\delta R(u)}{\delta u} \Delta U$. Taking the variational derivative of $R(u)$ yields: + +$$ +\begin{align} +\frac{\delta R(u)}{\delta u} &= \frac{d}{d\alpha} \int_{\Omega} \nabla w :C: \left[ \epsilon (u+\alpha w) - \epsilon^0 \right] ~dV \bigg{|}_{\alpha=0} +\end{align} +$$ + +$$ +\begin{align} +&= \int_{\Omega} \nabla w :C: \frac{1}{2}\frac{d}{d\alpha}\left[ \nabla(u+\alpha w) + \nabla(u+\alpha w)^T - \epsilon^0\right] ~dV \bigg{|}_{\alpha=0} +\end{align} +$$ + +$$ +\begin{align} +&= \int_{\Omega} \nabla w :C: \frac{d}{d\alpha} \left[ \nabla(u+\alpha w) - \epsilon^0 \right] ~dV \bigg{|}_{\alpha=0} \quad (due ~to ~the ~symmetry ~of ~C) +\end{align} +$$ + +$$ +\begin{align} +&= \int_{\Omega} \nabla w :C: \nabla w ~dV +\end{align} +$$ + +In its discretized form $\frac{\delta R(u)}{\delta u} \Delta U$ is: + +$$ +\begin{equation} +\frac{\delta R(u)}{\delta u} \Delta U = \sum_i \sum_j \int_{\Omega} \nabla N^i : C : \nabla N^j dV ~\Delta U^j +\end{equation} +$$ + +Moving back to the non-discretized form yields: + +$$ +\begin{equation} +\frac{\delta R(u)}{\delta u} \Delta U = \int_{\Omega} \nabla w : C : \nabla (\Delta u) dV +\end{equation} +$$ + +Thus, the full equation relating $u_0$ and $\Delta u$ is: + +$$ +\begin{align} +\int_{\Omega} \nabla w : C : \nabla (\Delta u) dV = -\int_{\Omega} \nabla w : \sigma ~dV +\end{align} +$$ + +$$ +\begin{align} +r_{ux}^{LHS} &= C : \nabla (\Delta u) +\end{align} +$$ + +$$ +\begin{align} +r_{ux} &= \sigma +\end{align} +$$ + +The above values of $r_{ux}^{LHS}$ and $r_{ux}$ are used to define the residuals in the following input file: +`applications/precipitateEvolution/equations.h` + +## Appendix I: Example functions for $f_{\alpha}$, $f_{\beta}$, $H(\eta_p)$ + +$$ +\begin{align} +f_{\alpha}(c) = A_{2, \alpha} c^2 + A_{1, \alpha} c + A_{0, \alpha} +\end{align} +$$ + +$$ +\begin{align} +f_{\beta}(c) = A_{2, \beta} c^2 + A_{1, \beta} c + A_{0, \beta} +\end{align} +$$ + +$$ +\begin{align} +H(\eta_p) = 10 \eta_p^3 - 15 \eta_p^4 + 6 \eta_p^5 +\end{align} +$$ + +## Appendix II: Variational Derivatives +Variational derivative of $\Pi$ with respect to $\eta_p$ (where $\eta_q$ and $\eta_r$ correspond to the structural order parameters for the other two orientational variants): + +$$ +\begin{gather} +\delta_{\eta_p} \Pi = \frac{d}{d\alpha} \left[\int_{\Omega} f_{chem}(c,\eta_p+\alpha w,\eta_q,\eta_r) + f_{grad}(\eta_p+\alpha w,\eta_q,\eta_r) + f_{el}(c,\eta_p+\alpha w,\eta_q,\eta_r,\epsilon) dV \right]_{\alpha=0} +\end{gather} +$$ + +Breaking up each of these terms yields: + +$$ +\begin{align} +\frac{d}{d\alpha} \left[ f_{chem}(c,\eta_p+\alpha w,\eta_q,\eta_r)\right]\_{\alpha=0}\ &= f_{\alpha}(c) \left[ -\frac{\partial H(\eta_p+\alpha w)}{\partial (\eta_p + \alpha w)} \frac{\partial(\eta_p + \alpha w)}{\partial \alpha} \right]_{\alpha=0} +\end{align} +$$ + +$$ +\begin{align} +&+f_{\beta}(c) \left[ \frac{\partial H(\eta_p+\alpha w)}{\partial (\eta_p + \alpha w)} \frac{\partial(\eta_p + \alpha w)}{\partial \alpha} \right]_{\alpha=0} +\end{align} +$$ + +$$ +\begin{align} +&=f_{\alpha}(c) \left[ -\frac{\partial H(\eta_p)}{\partial \eta_p} w \right] ++f_{\beta}(c) \left[ \frac{\partial H(\eta_p)}{\partial \eta_p } w \right] +\end{align} +$$ + +$$ +\begin{align} +\frac{d}{d\alpha} \left[ f_{grad}(\eta_p+\alpha w,\eta_q,\eta_r)\right]\_{\alpha=0} +&= \frac{1}{2} \left[ \kappa_{ij}^{\eta_p} (\eta_p+\alpha w)\_{,i} (\eta_p+\alpha w)\_{,j} +\kappa_{ij}^{\eta_q} (\eta_q)\_{,i}(\eta_q)\_{,j} + \kappa\_{ij}^{\eta_r} (\eta_r)\_{,i}(\eta_r)\_{,j} \right]_{\alpha=0} +\end{align} +$$ + +$$ +\begin{align} +&= \kappa_{ij} w_{,i} \eta_{p,j} +\end{align} +$$ + +$$ +\begin{align} +\frac{d}{d\alpha} \left[ f_{el}(c,\eta_p+\alpha w,\eta_q,\eta_r,\epsilon)\right]\_{\alpha=0} &= \frac{1}{2} \bigg[ \frac{\partial C_{ijkl}(\eta_p+\alpha w,\eta_q,\eta_r)}{\partial (\eta_p + \alpha w)} \frac{\partial(\eta_p + \alpha w)}{\partial \alpha} +\end{align} +$$ + +$$ +\begin{align} +&\cdot\big (\epsilon_{ij}-\epsilon_{ij}^0 (c,\eta_p+\alpha w,\eta_q,\eta_r)\big) \big(\epsilon_{kl}-\epsilon_{kl}^0 (c,\eta_p+\alpha w,\eta_q,\eta_r)\big) +\end{align} +$$ + +$$ +\begin{align} +&+ C_{ijkl}(\eta_p+\alpha w,\eta_q,\eta_r) \bigg (-\frac{\partial\epsilon_{ij}^0 (c,\eta_p+\alpha w,\eta_q,\eta_r)}{\partial (\eta_p + \alpha w)} \frac{\partial(\eta_p + \alpha w)}{\partial \alpha} \bigg) \\ &\cdot \big(\epsilon_{kl}-\epsilon_{kl}^0 (c,\eta_p+\alpha w,\eta_q,\eta_r)\big) +\end{align} +$$ + +$$ +\begin{align} +&+ C_{ijkl}(\eta_p+\alpha w,\eta_q,\eta_r) \big(\epsilon_{ij}-\epsilon_{ij}^0 (c,\eta_p+\alpha w,\eta_q,\eta_r)\big) +\end{align} +$$ + +$$ +\begin{align} +&\cdot\bigg (-\frac{\partial\epsilon_{kl}^0 (c,\eta_p+\alpha w,\eta_q,\eta_r)}{\partial (\eta_p + \alpha w)} \frac{\partial(\eta_p + \alpha w)}{\partial \alpha} \bigg)\bigg]_{\alpha=0} +\end{align} +$$ + +$$ +\begin{align} +&= \frac{1}{2} \bigg[ \frac{\partial C_{ijkl}(\eta_p,\eta_q,\eta_r)}{\partial \eta_p} w \big(\epsilon_{ij}-\epsilon_{ij}^0 (c,\eta_p,\eta_q,\eta_r) \big) \big(\epsilon_{kl}-\epsilon_{kl}^0 (c,\eta_p,\eta_q,\eta_r) \big) \bigg] +\end{align} +$$ + +$$ +\begin{align} +&+ C_{ijkl}(\eta_p,\eta_q,\eta_r) \bigg (-\frac{\partial\epsilon_{ij}^0 (c,\eta_p,\eta_q,\eta_r)}{\partial \eta_p} w \bigg) \big(\epsilon_{kl}-\epsilon_{kl}^0 (c,\eta_p,\eta_q,\eta_r)\big) \\ +\end{align} +$$ + +Putting the terms back together yields: + +$$ +\begin{align} +\delta_{\eta_p} \Pi &= \int_{\Omega} f_{\alpha}(c) \left[ -\frac{\partial H(\eta_p)}{\partial \eta_p} w \right] +f_{\beta}(c) \left[ \frac{\partial H(\eta_p)}{\partial \eta_p } w \right] +\end{align} +$$ + +$$ +\begin{align} +&+ \kappa_{ij} w_{,i} \eta_{p,j} +\end{align} +$$ + +$$ +\begin{align} +&+\frac{1}{2} \bigg[ \frac{\partial C_{ijkl}(\eta_p,\eta_q,\eta_r)}{\partial (\eta_p)} w \big(\epsilon_{ij}-\epsilon_{ij}^0 (c,\eta_p,\eta_q,\eta_r) \big) \big(\epsilon_{kl}-\epsilon_{kl}^0 (c,\eta_p,\eta_q,\eta_r) \big) \bigg] +\end{align} +$$ + +$$ +\begin{align} +&+ C_{ijkl}(\eta_p,\eta_q,\eta_r) \bigg (-\frac{\partial\epsilon_{ij}^0 (c,\eta_p,\eta_q,\eta_r)}{\partial \eta_p} w \bigg) \big(\epsilon_{kl}-\epsilon_{kl}^0 (c,\eta_p,\eta_q,\eta_r)\big) ~dV +\end{align} +$$ + +Variational derivative of $\Pi$ with respect to $c$ : + +$$ +\begin{gather} +\delta_{c} \Pi = \frac{d}{d\alpha} \left[\int_{\Omega} f_{chem}(c+\alpha w,\eta_p,\eta_q,\eta_r) + f_{grad}(\eta_p,\eta_q,\eta_r) + f_{el}(c+\alpha w,\eta_p,\eta_q,\eta_r,\epsilon) dV \right]_{\alpha=0} +\end{gather} +$$ + +Breaking up each of these terms yields: + +$$ +\begin{align} +\frac{d}{d\alpha} \left[ f_{chem}(c+\alpha w,\eta_p,\eta_q,\eta_r)\right]\_{\alpha=0} &= \bigg[ \frac{\partial f_{\alpha}(c + \alpha w)}{\partial(c+\alpha w)} \frac{\partial(c+\alpha w)}{\partial \alpha} \left(1-\sum_{p=1}^3 H(\eta_p)\right) +\end{align} +$$ + +$$ +\begin{align} +&+ \frac{\partial f_{\beta}(c+\alpha w)}{\partial(c+\alpha w)} \frac{\partial(c+\alpha w)}{\partial \alpha} \left(\sum_{p=1}^3 H(\eta_p)\right) +\end{align} +$$ + +$$ +\begin{align} +&= \frac{\partial f_{\alpha}(c)}{\partial c} w \left(1-\sum_{p=1}^3 H(\eta_p)\right) +\frac{\partial f_{\beta}(c)}{\partial c} w \left(\sum_{p=1}^3 H(\eta_p)\right) +\end{align} +$$ + +$$ +\begin{align} +\frac{d}{d\alpha} \left[ f_{grad}(\eta_p,\eta_q,\eta_r)\right]_{\alpha=0} = 0 +\end{align} +$$ + +$$ +\begin{align} +\frac{d}{d\alpha} \left[ f_{el}(c+\alpha w,\eta_p,\eta_q,\eta_r,\epsilon)\right]\_{\alpha=0} &= \frac{1}{2} C_{ijkl}(\eta_p,\eta_q,\eta_r) \bigg[ -\frac{\partial \epsilon_{ij}^0 (c+\alpha w,\eta_p,\eta_q,\eta_r)}{\partial (c + \alpha w)} \frac{\partial(c + \alpha w)}{\partial \alpha} \big(\epsilon_{kl}-\epsilon_{kl}^0 (c+\alpha w,\eta_p,\eta_q,\eta_r)\big) +\end{align} +$$ + +$$ +\begin{align} +&- \big(\epsilon_{ij}-\epsilon_{ij}^0 (c+\alpha w,\eta_p,\eta_q,\eta_r)\big) \frac{\partial \epsilon_{ij}^0 (c+\alpha w,\eta_p,\eta_q,\eta_r)}{\partial (c + \alpha w)} \frac{\partial(c + \alpha w)}{\partial \alpha} \bigg]_{\alpha=0} +\end{align} +$$ + +$$ +\begin{align} +&= -C_{ijkl}(\eta_p,\eta_q,\eta_r) \frac{\partial \epsilon_{ij}^0 (c,\eta_p,\eta_q,\eta_r)}{\partial c} w \big(\epsilon_{kl}-\epsilon_{kl}^0 (c+\alpha w,\eta_p,\eta_q,\eta_r)\big) +\end{align} +$$ + +Putting the terms back together yields: + +$$ +\begin{align} +\delta_{c} \Pi &= \int_{\Omega} \frac{\partial f_{\alpha}(c)}{\partial c} w \left(1-\sum_{p=1}^3 H(\eta_p)\right) +\frac{\partial f_{\beta}(c)}{\partial c} w \left(\sum_{p=1}^3 H(\eta_p)\right) +\end{align} +$$ + +$$ +\begin{align} +&-C_{ijkl}(\eta_p,\eta_q,\eta_r) \frac{\partial \epsilon_{ij}^0 (c,\eta_p,\eta_q,\eta_r)}{\partial c} w \big(\epsilon_{kl}-\epsilon_{kl}^0 (c+\alpha w,\eta_p,\eta_q,\eta_r)\big) ~dV +\end{align} +$$ diff --git a/applications/precipitateEvolution/formulation_precipitateEvolution.pdf b/applications/precipitateEvolution/formulation_precipitateEvolution.pdf deleted file mode 100644 index 8d9eb3c4a..000000000 Binary files a/applications/precipitateEvolution/formulation_precipitateEvolution.pdf and /dev/null differ diff --git a/applications/precipitateEvolution/tex_files/precipitateEvolution.tex b/applications/precipitateEvolution/tex_files/precipitateEvolution.tex deleted file mode 100644 index 8a2f35279..000000000 --- a/applications/precipitateEvolution/tex_files/precipitateEvolution.tex +++ /dev/null @@ -1,437 +0,0 @@ -% *********************************************************** -% ******************* PHYSICS HEADER ************************ -% *********************************************************** -% Version 2 -\documentclass[11pt]{article} -\usepackage{amsmath} % AMS Math Package -\usepackage{amsthm} % Theorem Formatting -\usepackage{amssymb} % Math symbols such as \mathbb -\usepackage{graphicx} % Allows for eps images -\usepackage{multicol} % Allows for multiple columns -\usepackage[dvips,letterpaper,margin=0.75in,bottom=0.5in]{geometry} - % Sets margins and page size -\pagestyle{empty} % Removes page numbers -\makeatletter % Need for anything that contains an @ command -\renewcommand{\maketitle} % Redefine maketitle to conserve space -{ \begingroup \vskip 10pt \begin{center} \large {\bf \@title} - \vskip 10pt \end{center} - \vskip 10pt \endgroup \setcounter{footnote}{0} } -\makeatother % End of region containing @ commands -\renewcommand{\labelenumi}{(\alph{enumi})} % Use letters for enumerate -% \DeclareMathOperator{\Sample}{Sample} -\let\vaccent=\v % rename builtin command \v{} to \vaccent{} -\renewcommand{\v}[1]{\ensuremath{\mathbf{#1}}} % for vectors -\newcommand{\gv}[1]{\ensuremath{\mbox{\boldmath$ #1 $}}} -% for vectors of Greek letters -\newcommand{\uv}[1]{\ensuremath{\mathbf{\hat{#1}}}} % for unit vector -\newcommand{\abs}[1]{\left| #1 \right|} % for absolute value -\newcommand{\avg}[1]{\left< #1 \right>} % for average -\let\underdot=\d % rename builtin command \d{} to \underdot{} -\renewcommand{\d}[2]{\frac{d #1}{d #2}} % for derivatives -\newcommand{\dd}[2]{\frac{d^2 #1}{d #2^2}} % for double derivatives -\newcommand{\pd}[2]{\frac{\partial #1}{\partial #2}} -% for partial derivatives -\newcommand{\pdd}[2]{\frac{\partial^2 #1}{\partial #2^2}} -% for double partial derivatives -\newcommand{\pdc}[3]{\left( \frac{\partial #1}{\partial #2} - \right)_{#3}} % for thermodynamic partial derivatives -\newcommand{\ket}[1]{\left| #1 \right>} % for Dirac bras -\newcommand{\bra}[1]{\left< #1 \right|} % for Dirac kets -\newcommand{\braket}[2]{\left< #1 \vphantom{#2} \right| - \left. #2 \vphantom{#1} \right>} % for Dirac brackets -\newcommand{\matrixel}[3]{\left< #1 \vphantom{#2#3} \right| - #2 \left| #3 \vphantom{#1#2} \right>} % for Dirac matrix elements -\newcommand{\grad}[1]{\gv{\nabla} #1} % for gradient -\let\divsymb=\div % rename builtin command \div to \divsymb -\renewcommand{\div}[1]{\gv{\nabla} \cdot #1} % for divergence -\newcommand{\curl}[1]{\gv{\nabla} \times #1} % for curl -\let\baraccent=\= % rename builtin command \= to \baraccent -\renewcommand{\=}[1]{\stackrel{#1}{=}} % for putting numbers above = -\newtheorem{prop}{Proposition} -\newtheorem{thm}{Theorem}[section] -\newtheorem{lem}[thm]{Lemma} -\theoremstyle{definition} -\newtheorem{dfn}{Definition} -\theoremstyle{remark} -\newtheorem*{rmk}{Remark} - -% *********************************************************** -% ********************** END HEADER ************************* -% *********************************************************** - - -\usepackage[noprefix]{nomencl} -\usepackage{amsfonts} -\usepackage{amssymb} -\usepackage{amsmath} - -%--------------------------------------------------------- -% Bold Face Math Characters: -% All In Format: \B***** . -%--------------------------------------------------------- -\def\BGamma{\mbox{\boldmath$\Gamma$}} -\def\BDelta{\mbox{\boldmath$\Delta$}} -\def\BTheta{\mbox{\boldmath$\Theta$}} -\def\BLambda{\mbox{\boldmath$\Lambda$}} -\def\BXi{\mbox{\boldmath$\Xi$}} -\def\BPi{\mbox{\boldmath$\Pi$}} -\def\BSigma{\mbox{\boldmath$\Sigma$}} -\def\BUpsilon{\mbox{\boldmath$\Upsilon$}} -\def\BPhi{\mbox{\boldmath$\Phi$}} -\def\BPsi{\mbox{\boldmath$\Psi$}} -\def\BOmega{\mbox{\boldmath$\Omega$}} -\def\Balpha{\mbox{\boldmath$\alpha$}} -\def\Bbeta{\mbox{\boldmath$\beta$}} -\def\Bgamma{\mbox{\boldmath$\gamma$}} -\def\Bdelta{\mbox{\boldmath$\delta$}} -\def\Bepsilon{\mbox{\boldmath$\epsilon$}} -\def\Bzeta{\mbox{\boldmath$\zeta$}} -\def\Beta{\mbox{\boldmath$\eta$}} -\def\Btheta{\mbox{\boldmath$\theta$}} -\def\Biota{\mbox{\boldmath$\iota$}} -\def\Bkappa{\mbox{\boldmath$\kappa$}} -\def\Blambda{\mbox{\boldmath$\lambda$}} -\def\Bmu{\mbox{\boldmath$\mu$}} -\def\Bnu{\mbox{\boldmath$\nu$}} -\def\Bxi{\mbox{\boldmath$\xi$}} -\def\Bpi{\mbox{\boldmath$\pi$}} -\def\Brho{\mbox{\boldmath$\rho$}} -\def\Bsigma{\mbox{\boldmath$\sigma$}} -\def\Btau{\mbox{\boldmath$\tau$}} -\def\Bupsilon{\mbox{\boldmath$\upsilon$}} -\def\Bphi{\mbox{\boldmath$\phi$}} -\def\Bchi{\mbox{\boldmath$\chi$}} -\def\Bpsi{\mbox{\boldmath$\psi$}} -\def\Bomega{\mbox{\boldmath$\omega$}} -\def\Bvarepsilon{\mbox{\boldmath$\varepsilon$}} -\def\Bvartheta{\mbox{\boldmath$\vartheta$}} -\def\Bvarpi{\mbox{\boldmath$\varpi$}} -\def\Bvarrho{\mbox{\boldmath$\varrho$}} -\def\Bvarsigma{\mbox{\boldmath$\varsigma$}} -\def\Bvarphi{\mbox{\boldmath$\varphi$}} -\def\bone{\mbox{\boldmath$1$}} -\def\bzero{\mbox{\boldmath$0$}} -%--------------------------------------------------------- -% Bold Face Math Italic: -% All In Format: \b* . -%--------------------------------------------------------- -\def\bA{\mbox{\boldmath$ A$}} -\def\bB{\mbox{\boldmath$ B$}} -\def\bC{\mbox{\boldmath$ C$}} -\def\bD{\mbox{\boldmath$ D$}} -\def\bE{\mbox{\boldmath$ E$}} -\def\bF{\mbox{\boldmath$ F$}} -\def\bG{\mbox{\boldmath$ G$}} -\def\bH{\mbox{\boldmath$ H$}} -\def\bI{\mbox{\boldmath$ I$}} -\def\bJ{\mbox{\boldmath$ J$}} -\def\bK{\mbox{\boldmath$ K$}} -\def\bL{\mbox{\boldmath$ L$}} -\def\bM{\mbox{\boldmath$ M$}} -\def\bN{\mbox{\boldmath$ N$}} -\def\bO{\mbox{\boldmath$ O$}} -\def\bP{\mbox{\boldmath$ P$}} -\def\bQ{\mbox{\boldmath$ Q$}} -\def\bR{\mbox{\boldmath$ R$}} -\def\bS{\mbox{\boldmath$ S$}} -\def\bT{\mbox{\boldmath$ T$}} -\def\bU{\mbox{\boldmath$ U$}} -\def\bV{\mbox{\boldmath$ V$}} -\def\bW{\mbox{\boldmath$ W$}} -\def\bX{\mbox{\boldmath$ X$}} -\def\bY{\mbox{\boldmath$ Y$}} -\def\bZ{\mbox{\boldmath$ Z$}} -\def\ba{\mbox{\boldmath$ a$}} -\def\bb{\mbox{\boldmath$ b$}} -\def\bc{\mbox{\boldmath$ c$}} -\def\bd{\mbox{\boldmath$ d$}} -\def\be{\mbox{\boldmath$ e$}} -\def\bff{\mbox{\boldmath$ f$}} -\def\bg{\mbox{\boldmath$ g$}} -\def\bh{\mbox{\boldmath$ h$}} -\def\bi{\mbox{\boldmath$ i$}} -\def\bj{\mbox{\boldmath$ j$}} -\def\bk{\mbox{\boldmath$ k$}} -\def\bl{\mbox{\boldmath$ l$}} -\def\bm{\mbox{\boldmath$ m$}} -\def\bn{\mbox{\boldmath$ n$}} -\def\bo{\mbox{\boldmath$ o$}} -\def\bp{\mbox{\boldmath$ p$}} -\def\bq{\mbox{\boldmath$ q$}} -\def\br{\mbox{\boldmath$ r$}} -\def\bs{\mbox{\boldmath$ s$}} -\def\bt{\mbox{\boldmath$ t$}} -\def\bu{\mbox{\boldmath$ u$}} -\def\bv{\mbox{\boldmath$ v$}} -\def\bw{\mbox{\boldmath$ w$}} -\def\bx{\mbox{\boldmath$ x$}} -\def\by{\mbox{\boldmath$ y$}} -\def\bz{\mbox{\boldmath$ z$}} - - - -\makenomenclature -\makeindex -\begin{document} -\centerline{\Large{\bf PRISMS-PF Application Formulation:}} -\smallskip -\centerline{\Large{\bf precipitateEvolution}} -\bigskip - - -\nomenclature[a]{$c$}{Concentration (Cahn-Hilliard order parameter)} -\nomenclature[b]{$\eta$}{Structural order parameter (Allen-Cahn order parameter)} -\nomenclature[c]{$\bE$}{Lagrange strain tensor (Mechanics order parameter)} -\nomenclature[d]{$\Pi$}{Total free energy of the system} -\nomenclature[e]{$F$}{Local free energy density} -\nomenclature[f]{$\mathcal{J}$}{Concentration flux} -\nomenclature[g]{$\mu$}{Chemical potential} -\nomenclature[h]{$\kappa^c$}{Cahn-Hilliard gradient coefficient} -\nomenclature[i]{$\kappa^{\eta}$}{Allen-Cahn gradient coefficient} -\nomenclature[j]{$L^{c}$}{Concentration mobility} -\nomenclature[k]{$L^{\eta}$}{Structural order parameter mobility} -\nomenclature[l]{$\omega$}{Variations over primal field} -\nomenclature[m]{$\mathcal{M}$}{Boundary chemical potential like term} -\nomenclature[n]{$\bn$}{Nomal vector in the current configuration} -\nomenclature[o]{$(\theta,~\phi)$}{Polar angles of the interface normal, $\bn$} -%\centerline{\today} -%\printnomenclature[1cm] -%\vspace{.5in} - -\section{Variational formulation} -The total free energy of the system (neglecting boundary terms) is of the form, -\begin{equation} -\Pi(c, \eta_1, \eta_2, \eta_3, \Bepsilon) = \int_{\Omega} f(c, \eta_1, \eta_2, \eta_3, \Bepsilon) ~dV -\end{equation} -where $c$ is the concentration of the $\beta$ phase, $\eta_p$ are the structural order parameters and $\Bvarepsilon$ is the small strain tensor. $f$, the free energy density is given by -\begin{equation} - f(c, \eta_1, \eta_2, \eta_3, \Bepsilon) = f_{chem}(c, \eta_1, \eta_2, \eta_3) + f_{grad}(\eta_1, \eta_2, \eta_3) + f_{elastic}(c,\eta_1, \eta_2, \eta_3,\Bepsilon) -\end{equation} -where -\begin{gather} -f_{chem}(c, \eta_1, \eta_2, \eta_3) = f_{\alpha}(c) \left( 1- H(\eta_1)-H(\eta_2)-H(\eta_3)\right) + f_{\beta}(c) \left( H(\eta_1) + H(\eta_2) + H(\eta_3)) \right) \\ -f_{grad}(\eta_1, \eta_2, \eta_3) = \frac{1}{2} \sum_{p=1}^3 \Bkappa^{\eta_p}_{ij} \eta_{p,i} \eta_{p,j} \\ -f_{elastic}(c,\eta_1, \eta_2, \eta_3,\Bepsilon) = \frac{1}{2} \bC_{ijkl}(\eta_1, \eta_2, \eta_3) \left( \Bvarepsilon_{ij} - \Bvarepsilon ^0_{ij}(c, \eta_1, \eta_2, \eta_3) \right)\left( \Bvarepsilon_{kl} - \Bvarepsilon^0_{kl}(c, \eta_1, \eta_2, \eta_3)\right) \\ -\Bvarepsilon^0(c, \eta_1, \eta_2, \eta_3) = H(\eta_1) \Bvarepsilon^0_{\eta_1} (c)+ H(\eta_2) \Bvarepsilon^0_{\eta_2} (c) + H(\eta_3) \Bvarepsilon^0_{\eta_3} (c) \\ -\bC(\eta_1, \eta_2, \eta_3) = H(\eta_1) \bC_{\eta_1}+ H(\eta_2) \bC_{\eta_2} + H(\eta_3) \bC_{\eta_3} + \left( 1- H(\eta_1)-H(\eta_2)-H(\eta_3)\right) \bC_{\alpha} -\end{gather} -Here $\Bvarepsilon^0_{\eta_p}$ are the composition dependent stress free strain transformation tensor corresponding to each structural order parameter. - -\section{Required inputs} -\begin{itemize} -\item $f_{\alpha}(c), f_{\beta}(c)$ - Homogeneous chemical free energy of the components of the binary system, example form given in Appendix I -\item $H(\eta_p)$ - Interpolation function for connecting the $\alpha$ phase and the $p^{th}$ orientation variant of the $\beta$ phase, example form given in Appendix I -\item $\Bkappa^{\eta_p}$ - gradient penalty tensor for the $p^{th}$ orientation variant of the $\beta$ phase -\item $\bC_{\eta_p}$ - fourth order elasticity tensor (or its equivalent second order Voigt representation) for the $p^{th}$ orientation variant of the $\beta$ phase -\item $\bC_{\alpha}$ - fourth order elasticity tensor (or its equivalent second order Voigt representation) for the $\alpha$ phase -\item $\Bvarepsilon^0_{\eta_p}$ - stress free strain transformation tensor for the $p^{th}$ orientation variant of the $\beta$ phase -\end{itemize} -In addition, to drive the kinetics, we need: -\begin{itemize} -\item $M$ - mobility value for the concentration field -\item $L$ - mobility value for the structural order parameter field -\end{itemize} - -\section{Variational treatment} -From the variational derivatives given in Appendix II, we obtain the chemical potentials for the concentration and the structural order parameters: -\begin{align} - \mu_{c} &= f_{\alpha,c} \left( 1- H(\eta_1)-H(\eta_2)-H(\eta_3)\right) +f_{\beta,c} \left( H(\eta_1) + H(\eta_2) + H(\eta_3) \right) + \bC_{ijkl} (- \Bvarepsilon^0_{ij,c}) \left( \Bvarepsilon_{kl} - \Bvarepsilon^0_{kl}\right) \\ - \mu_{\eta_p} &= (f_{\beta}-f_{\alpha})H(\eta_p)_{,\eta_p} - \Bkappa^{\eta_p}_{ij} \eta_{p,ij} + \bC_{ijkl} (- \Bvarepsilon^0_{ij,\eta_p}) \left( \Bvarepsilon_{kl} - \Bvarepsilon^0_{kl}\right) + \frac{1}{2} \bC_{ijkl,\eta_p} \left( \Bvarepsilon_{ij} - \Bvarepsilon ^0_{ij} \right) \left( \Bvarepsilon_{kl} - \Bvarepsilon^0_{kl}\right) -\end{align} - -\section{Kinetics} -Now the PDE for Cahn-Hilliard dynamics is given by: -\begin{align} - \frac{\partial c}{\partial t} &= ~\grad \cdot (M \grad \mu_c) \label{CH_eqn} - \end{align} - and the PDE for Allen-Cahn dynamics is given by: - \begin{align} - \frac{\partial \eta_p}{\partial t} &= - L \mu_{\eta_p} \label{AC_eqn} -\end{align} -where $M$ and $L$ are the constant mobilities. - -\section{Mechanics} -Considering variations on the displacement $u$ of the from $u+\epsilon w$, we have -\begin{align} -\delta_u \Pi &= \int_{\Omega} \grad w : \bC(\eta_1, \eta_2, \eta_3) : \left( \Bvarepsilon - \Bvarepsilon^0(c,\eta_1, \eta_2, \eta_3)\right) ~dV = 0 \\ -\end{align} -where $\Bsigma = \bC(\eta_1, \eta_2, \eta_3) : \left( \Bvarepsilon - \Bvarepsilon^0(c,\eta_1, \eta_2, \eta_3)\right)$ is the stress tensor. \\ - -Now consider\\ -\begin{align} -R &= \int_{\Omega} \grad w : \bC(\eta_1, \eta_2, \eta_3) : \left( \Bvarepsilon - \Bvarepsilon^0(c,\eta_1, \eta_2, \eta_3)\right) ~dV = 0 -\end{align} -We solve for $R=0$ using a gradient scheme which involves the following linearization: -\begin{align} -R~|_{u}+ \frac{\delta R}{\delta u} \Delta u &= 0 \\ -\Rightarrow \frac{\delta R}{\delta u} \Delta u &= -R~|_{u} -\end{align} -This is the linear system $Ax=b$ which we solve implicitly using the Conjugate Gradient scheme. For clarity, here in the left hand side (LHS) $A=\frac{\delta R}{\delta u}$, $x=\Delta u$ and the right hand side (RHS) is $b=-R~|_{u}$. - - -\section{Time discretization} -Using forward Euler explicit time stepping, equations \ref{CH_eqn} and \ref{AC_eqn} become: -\begin{align} -c^{n+1} = c^{n}+\Delta t [\nabla \cdot (M \nabla \mu_c) ]\\ -\eta_p^{n+1} = \eta_p^n -\Delta t L \mu_{\eta_p} -\end{align} - -\section{Weak formulation and residual expressions} -\subsection{The Cahn-Hillard and Allen-Cahn equations} -Writing equations \ref{CH_eqn} and \ref{AC_eqn} in the weak form, with the arbirary variation given by $w$ yields: -\begin{align} -\int_\Omega w c^{n+1} dV &= \int_\Omega wc^{n}+w \Delta t [\nabla \cdot (M \nabla \mu_c) ] dV \label{CH_weak} \\ -%&= \int_\Omega w\underbrace{c^{n}}_{r_c}+\nabla w \cdot (\underbrace{\Delta t M \nabla \mu_c}_{r_{cx}} ) dV \\ -\int_\Omega w \eta_p^{n+1} dV &= \int_\Omega w \eta_p^{n}-w \Delta t L \mu_{\eta_p} dV \label{AC_weak} -%&= \int_\Omega w\underbrace{c^{n}}_{r_c}+\nabla w \cdot (\underbrace{\Delta t M \nabla \mu_c}_{r_{cx}} ) dV -\end{align} - -The gradient of $\mu_c$ is: -\begin{equation} -\begin{split} -\nabla \mu_c = & \nabla c \left[f_{\alpha,cc}+ \sum_{p=1}^3 H(\eta_p)(f_{\beta,cc}-f_{\alpha,cc}) \right]+ \sum_{p=1}^3 \nabla \eta_p H(\eta_p)_{,\eta_p} (f_{\beta,c}-f_{\alpha,c}) \\ -&+ \left[ \sum_{p=1}^3 (C_{ijkl}^{\eta_p} - C_{ijkl}^{\alpha} )\nabla \eta_p H(\eta_p)_{,\eta_p} \right](-\epsilon_{ij,c}^0)(\epsilon_{ij} - \epsilon_{ij}^0) \\ -&- C_{ijkl} \left[ \sum_{p=1}^3 H(\eta_p)_{,\eta_p} \epsilon_{ij,c}^{0\eta_p} \nabla \eta_p + H(\eta_p) \epsilon_{ij,cc}^{0\eta_p} \nabla c \right](\epsilon_{kl}-\epsilon_{kl}^0)\\ -&+ C_{ijkl} (-\epsilon_{ij,c}^0) \left[ \nabla \epsilon_{ij} - \left( \sum_{p=1}^3 H(\eta_p)_{,\eta_p} \epsilon_{kl}^{0\eta_p} \nabla \eta_p + H(\eta_p) \epsilon_{kl,c}^{0\eta_p} \nabla c \right) \right] -\end{split} -\end{equation} - -Applying the divergence theorem to equation \ref{CH_weak}, one can derive the residual terms $r_c$ and $r_{cx}$: -\begin{equation} -\int_\Omega w c^{n+1} dV = \int_\Omega w\underbrace{c^{n}}_{r_c}+\nabla w \cdot (\underbrace{-\Delta t M \nabla \mu_c}_{r_{cx}} ) dV -\end{equation} - -Expanding $\mu_{\eta_p}$ in equation \ref{AC_weak} and applying the divergence theorem yields the residual terms $r_{\eta_p}$ and $r_{\eta_p x}$: -\begin{equation} -\begin{split} -\int_\Omega w \eta_p^{n+1} dV &= \\ -&\int_\Omega w \Bigg\{\underbrace{\eta_p^{n}-\Delta t L \bigg[(f_{\beta}-f_{\alpha})H(\eta_p^n)_{,\eta_p} - C_{ijkl} \left( H(\eta_p)_{,\eta_p} \epsilon_{ij}^{0 \eta_p}\right)\left(\epsilon_{kl} - \epsilon_{kl}^{0} \right) }_{r_{\eta_p}} \\ -&\underbrace{+ \frac{1}{2} \left[ (C_{ijkl}^{\eta_p} - C_{ijkl}^{\alpha}) H(\eta_p)_{,\eta_p} \right] \left(\epsilon_{ij} - \epsilon_{ij}^{0} \right) \left(\epsilon_{kl} - \epsilon_{kl}^{0} \right) \bigg] \Bigg\}}_{r_{\eta_p}~cont.} \\ -&+ \nabla w \cdot (\underbrace{-\Delta t L \Bkappa^{\eta_p}_{ij} \eta_{p,i}^n}_{r_{\eta_p x}} ) dV -\end{split} -\end{equation} - -The above values of $r_c$, $r_{cx}$, $r_{\eta_p}$, and $r_{\eta_p x}$are used to define the residuals in the following input file: \\ -$applications/precipitateEvolution/equations.h$ - -\subsection{The mechanical equilbrium equation} -In PRISMS-PF, two sets of residuals are required for elliptic PDEs (such as this one), one for the left-hand side of the equation (LHS) and one for the right-hand side of the equation (RHS). We solve $R=\delta_u \Pi$ by casting this in a form that can be solved as a matrix inversion problem. This will involve a brief detour into the discretized form of the equation. First we derive an expression for the solution, given an initial guess, $u_0$: -\begin{gather} -0 = R(u) = R(u_0 + \Delta u) -\end{gather} -where $\Delta u = u - u_0$. Then, applying the discretization that $u = \sum_i w^i U^i$, we can write the following linearization: -\begin{equation} -\frac{\delta R(u)}{\delta u} \Delta U = -R(u_0) \label{matrix_eqn} -\end{equation} -The discretized form of this equation can be written as a matrix inversion problem. However, in PRISMS-PF, we only care about the product $\frac{\delta R(u)}{\delta u} \Delta U$. Taking the variational derivative of $R(u)$ yields: -\begin{align} -\frac{\delta R(u)}{\delta u} &= \frac{d}{d\alpha} \int_{\Omega} \nabla w :C: \left[ \epsilon (u+\alpha w) - \epsilon^0 \right] ~dV \bigg{|}_{\alpha=0} \\ -&= \int_{\Omega} \nabla w :C: \frac{1}{2}\frac{d}{d\alpha}\left[ \nabla(u+\alpha w) + \nabla(u+\alpha w)^T - \epsilon^0\right] ~dV \bigg{|}_{\alpha=0}\\ -&= \int_{\Omega} \nabla w :C: \frac{d}{d\alpha} \left[ \nabla(u+\alpha w) - \epsilon^0 \right] ~dV \bigg{|}_{\alpha=0} \quad (due ~to ~the ~symmetry ~of ~C) \\ -&= \int_{\Omega} \nabla w :C: \nabla w ~dV -\end{align} -In its discretized form $\frac{\delta R(u)}{\delta u} \Delta U$ is: -\begin{equation} -\frac{\delta R(u)}{\delta u} \Delta U = \sum_i \sum_j \int_{\Omega} \nabla N^i : C : \nabla N^j dV ~\Delta U^j -\end{equation} -Moving back to the non-discretized form yields: -\begin{equation} -\frac{\delta R(u)}{\delta u} \Delta U = \int_{\Omega} \nabla w : C : \nabla (\Delta u) dV -\end{equation} -Thus, the full equation relating $u_0$ and $\Delta u$ is: -\begin{equation} -\int_{\Omega} \nabla w : \underbrace{C : \nabla (\Delta u)}_{r_{ux}^{LHS}} dV = -\int_{\Omega} \grad w : \underbrace{\sigma}_{r_{ux}} ~dV -\end{equation} -The above values of $r_{ux}^{LHS}$ and $r_{ux}$ are used to define the residuals in the following input file: \\ -$applications/precipitateEvolution/equations.h$ - -\section{Appendix I: Example functions for $f_{\alpha}$, $f_{\beta}$, $H(\eta_p)$ } -\begin{gather} -f_{\alpha}(c) = A_{2, \alpha} c^2 + A_{1, \alpha} c + A_{0, \alpha} \\ -f_{\beta}(c) = A_{2, \beta} c^2 + A_{1, \beta} c + A_{0, \beta} \\ -H(\eta_p) = 10 \eta_p^3 - 15 \eta_p^4 + 6 \eta_p^5 -\end{gather} - -\section{Appendix II: Variational Derivatives} -Variational derivative of $\Pi$ with respect to $\eta_p$ (where $\eta_q$ and $\eta_r$ correspond to the structural order parameters for the other two orientational variants): -\begin{gather} -\delta_{\eta_p} \Pi = \frac{d}{d\alpha} \left[\int_{\Omega} f_{chem}(c,\eta_p+\alpha w,\eta_q,\eta_r) + f_{grad}(\eta_p+\alpha w,\eta_q,\eta_r) + f_{el}(c,\eta_p+\alpha w,\eta_q,\eta_r,\epsilon) dV \right]_{\alpha=0} -\end{gather} -Breaking up each of these terms yields: - -\begin{align} -\begin{split} -\frac{d}{d\alpha} \left[ f_{chem}(c,\eta_p+\alpha w,\eta_q,\eta_r)\right]_{\alpha=0} &= f_{\alpha}(c) \left[ -\frac{\partial H(\eta_p+\alpha w)}{\partial (\eta_p + \alpha w)} \frac{\partial(\eta_p + \alpha w)}{\partial \alpha} \right]_{\alpha=0} \\ -&+f_{\beta}(c) \left[ \frac{\partial H(\eta_p+\alpha w)}{\partial (\eta_p + \alpha w)} \frac{\partial(\eta_p + \alpha w)}{\partial \alpha} \right]_{\alpha=0} \\ -\\ -&=f_{\alpha}(c) \left[ -\frac{\partial H(\eta_p)}{\partial \eta_p} w \right] -+f_{\beta}(c) \left[ \frac{\partial H(\eta_p)}{\partial \eta_p } w \right] -\end{split} -\end{align} - -\begin{align} -\begin{split} -\frac{d}{d\alpha} \left[ f_{grad}(\eta_p+\alpha w,\eta_q,\eta_r)\right]_{\alpha=0} &= \frac{1}{2} \left[ \kappa_{ij}^{\eta_p} (\eta_p+\alpha w)_{,i}(\eta_p+\alpha w)_{,j} +\kappa_{ij}^{\eta_q} (\eta_q)_{,i}(\eta_q)_{,j} + \kappa_{ij}^{\eta_r} (\eta_r)_{,i}(\eta_r)_{,j} \right]_{\alpha=0} \\ -\\ -&= \kappa_{ij} w_{,i} \eta_{p,j} -\end{split} -\end{align} - -\begin{align} -\begin{split} -\frac{d}{d\alpha} \left[ f_{el}(c,\eta_p+\alpha w,\eta_q,\eta_r,\epsilon)\right]_{\alpha=0} &= \frac{1}{2} \bigg[ \frac{\partial C_{ijkl}(\eta_p+\alpha w,\eta_q,\eta_r)}{\partial (\eta_p + \alpha w)} \frac{\partial(\eta_p + \alpha w)}{\partial \alpha} \\ -&\cdot\big (\epsilon_{ij}-\epsilon_{ij}^0 (c,\eta_p+\alpha w,\eta_q,\eta_r)\big) \big(\epsilon_{kl}-\epsilon_{kl}^0 (c,\eta_p+\alpha w,\eta_q,\eta_r)\big) \\ -&+ C_{ijkl}(\eta_p+\alpha w,\eta_q,\eta_r) \bigg (-\frac{\partial\epsilon_{ij}^0 (c,\eta_p+\alpha w,\eta_q,\eta_r)}{\partial (\eta_p + \alpha w)} \frac{\partial(\eta_p + \alpha w)}{\partial \alpha} \bigg) \\ &\cdot \big(\epsilon_{kl}-\epsilon_{kl}^0 (c,\eta_p+\alpha w,\eta_q,\eta_r)\big) \\ -&+ C_{ijkl}(\eta_p+\alpha w,\eta_q,\eta_r) \big(\epsilon_{ij}-\epsilon_{ij}^0 (c,\eta_p+\alpha w,\eta_q,\eta_r)\big) \\ -&\cdot\bigg (-\frac{\partial\epsilon_{kl}^0 (c,\eta_p+\alpha w,\eta_q,\eta_r)}{\partial (\eta_p + \alpha w)} \frac{\partial(\eta_p + \alpha w)}{\partial \alpha} \bigg)\bigg]_{\alpha=0} \\ -\\ -&= \frac{1}{2} \bigg[ \frac{\partial C_{ijkl}(\eta_p,\eta_q,\eta_r)}{\partial \eta_p} w \big(\epsilon_{ij}-\epsilon_{ij}^0 (c,\eta_p,\eta_q,\eta_r) \big) \big(\epsilon_{kl}-\epsilon_{kl}^0 (c,\eta_p,\eta_q,\eta_r) \big) \bigg] \\ -&+ C_{ijkl}(\eta_p,\eta_q,\eta_r) \bigg (-\frac{\partial\epsilon_{ij}^0 (c,\eta_p,\eta_q,\eta_r)}{\partial \eta_p} w \bigg) \big(\epsilon_{kl}-\epsilon_{kl}^0 (c,\eta_p,\eta_q,\eta_r)\big) \\ -\end{split} -\end{align} - -Putting the terms back together yields: -\begin{gather} -\begin{split} -\delta_{\eta_p} \Pi &= \int_{\Omega} f_{\alpha}(c) \left[ -\frac{\partial H(\eta_p)}{\partial \eta_p} w \right] +f_{\beta}(c) \left[ \frac{\partial H(\eta_p)}{\partial \eta_p } w \right] \\ -&+ \kappa_{ij} w_{,i} \eta_{p,j} \\ -&+\frac{1}{2} \bigg[ \frac{\partial C_{ijkl}(\eta_p,\eta_q,\eta_r)}{\partial (\eta_p)} w \big(\epsilon_{ij}-\epsilon_{ij}^0 (c,\eta_p,\eta_q,\eta_r) \big) \big(\epsilon_{kl}-\epsilon_{kl}^0 (c,\eta_p,\eta_q,\eta_r) \big) \bigg] \\ -&+ C_{ijkl}(\eta_p,\eta_q,\eta_r) \bigg (-\frac{\partial\epsilon_{ij}^0 (c,\eta_p,\eta_q,\eta_r)}{\partial \eta_p} w \bigg) \big(\epsilon_{kl}-\epsilon_{kl}^0 (c,\eta_p,\eta_q,\eta_r)\big) ~dV -\end{split} -\end{gather} - -Variational derivative of $\Pi$ with respect to $c$ : -\begin{gather} -\delta_{c} \Pi = \frac{d}{d\alpha} \left[\int_{\Omega} f_{chem}(c+\alpha w,\eta_p,\eta_q,\eta_r) + f_{grad}(\eta_p,\eta_q,\eta_r) + f_{el}(c+\alpha w,\eta_p,\eta_q,\eta_r,\epsilon) dV \right]_{\alpha=0} -\end{gather} -Breaking up each of these terms yields: -\begin{align} -\begin{split} -\frac{d}{d\alpha} \left[ f_{chem}(c+\alpha w,\eta_p,\eta_q,\eta_r)\right]_{\alpha=0} &= \bigg[ \frac{\partial f_{\alpha}(c + \alpha w)}{\partial(c+\alpha w)} \frac{\partial(c+\alpha w)}{\partial \alpha} \left(1-\sum_{p=1}^3 H(\eta_p)\right) \\ -&+ \frac{\partial f_{\beta}(c+\alpha w)}{\partial(c+\alpha w)} \frac{\partial(c+\alpha w)}{\partial \alpha} \left(\sum_{p=1}^3 H(\eta_p)\right) \\ -&= \frac{\partial f_{\alpha}(c)}{\partial c} w \left(1-\sum_{p=1}^3 H(\eta_p)\right) +\frac{\partial f_{\beta}(c)}{\partial c} w \left(\sum_{p=1}^3 H(\eta_p)\right) -\end{split} -\end{align} - -\begin{align} -\frac{d}{d\alpha} \left[ f_{grad}(\eta_p,\eta_q,\eta_r)\right]_{\alpha=0} = 0 -\end{align} - -\begin{align} -\begin{split} -\frac{d}{d\alpha} \left[ f_{el}(c+\alpha w,\eta_p,\eta_q,\eta_r,\epsilon)\right]_{\alpha=0} &= \frac{1}{2} C_{ijkl}(\eta_p,\eta_q,\eta_r) \bigg[ -\frac{\partial \epsilon_{ij}^0 (c+\alpha w,\eta_p,\eta_q,\eta_r)}{\partial (c + \alpha w)} \frac{\partial(c + \alpha w)}{\partial \alpha} \big(\epsilon_{kl}-\epsilon_{kl}^0 (c+\alpha w,\eta_p,\eta_q,\eta_r)\big) \\ -&- \big(\epsilon_{ij}-\epsilon_{ij}^0 (c+\alpha w,\eta_p,\eta_q,\eta_r)\big) \frac{\partial \epsilon_{ij}^0 (c+\alpha w,\eta_p,\eta_q,\eta_r)}{\partial (c + \alpha w)} \frac{\partial(c + \alpha w)}{\partial \alpha} \bigg]_{\alpha=0} \\ -\\ -&= -C_{ijkl}(\eta_p,\eta_q,\eta_r) \frac{\partial \epsilon_{ij}^0 (c,\eta_p,\eta_q,\eta_r)}{\partial c} w \big(\epsilon_{kl}-\epsilon_{kl}^0 (c+\alpha w,\eta_p,\eta_q,\eta_r)\big) -\end{split} -\end{align} - -Putting the terms back together yields: -\begin{gather} -\begin{split} -\delta_{c} \Pi &= \int_{\Omega} \frac{\partial f_{\alpha}(c)}{\partial c} w \left(1-\sum_{p=1}^3 H(\eta_p)\right) +\frac{\partial f_{\beta}(c)}{\partial c} w \left(\sum_{p=1}^3 H(\eta_p)\right) \\ -&-C_{ijkl}(\eta_p,\eta_q,\eta_r) \frac{\partial \epsilon_{ij}^0 (c,\eta_p,\eta_q,\eta_r)}{\partial c} w \big(\epsilon_{kl}-\epsilon_{kl}^0 (c+\alpha w,\eta_p,\eta_q,\eta_r)\big) ~dV -\end{split} -\end{gather} - -\end{document} \ No newline at end of file diff --git a/applications/spinodalDecomposition/cahnHilliard.md b/applications/spinodalDecomposition/cahnHilliard.md new file mode 100644 index 000000000..53bac1a3c --- /dev/null +++ b/applications/spinodalDecomposition/cahnHilliard.md @@ -0,0 +1,140 @@ +# PRISMS PhaseField: Cahn-Hilliard Dynamics (Mixed-Formulation) +Consider a free energy expression of the form: + +$$ +\begin{equation} + \Pi(c, \nabla c) = \int_{\Omega} f( c ) + \frac{\kappa}{2} \nabla c \cdot \nabla c ~dV +\end{equation} +$$ + +where $c$ is the composition, and $\kappa$ is the gradient length scale parameter. + +## Variational treatment +Considering variations on the primal field $c$ of the from $c+\epsilon w$, we have + +$$ +\begin{align} +\delta \Pi &= \left. \frac{d}{d\epsilon} \int_{\Omega} f(c+\epsilon w) + \frac{\kappa}{2} \nabla (c+\epsilon w) \cdot ~\nabla (c+\epsilon w) ~dV \right\vert_{\epsilon=0} +\end{align} +$$ + +$$ +\begin{align} +&= \int_{\Omega} w f_{,c} + \kappa \nabla w \nabla c ~dV +\end{align} +$$ + +$$ +\begin{align} +&= \int_{\Omega} w \left( f_{,c} - \kappa \Delta c \right) ~dV + \int_{\partial \Omega} w \kappa \nabla c \cdot n ~dS +\end{align} +$$ + +Assuming $\kappa \nabla c \cdot n = 0$, and using standard variational arguments on the equation $\delta \Pi =0$ we have the expression for chemical potential as + +$$ +\begin{equation} + \mu = f_{,c} - \kappa \Delta c +\end{equation} +$$ + +## Kinetics +Now the Parabolic PDE for Cahn-Hilliard dynamics is given by: + +$$ +\begin{align} + \frac{\partial c}{\partial t} &= -~\nabla \cdot (-M\nabla \mu) +\end{align} +$$ + +$$ +\begin{align} + &=-M~\nabla \cdot (-\nabla (f_{,c} - \kappa \Delta c)) +\end{align} +$$ + +where $M$ is the constant mobility. This equation can be split into two equations as follow: + +$$ +\begin{align} + \mu &= f_{,c} - \kappa \Delta c +\end{align} +$$ + +$$ +\begin{align} + \frac{\partial c}{\partial t} &= M~\nabla \cdot (\nabla \mu) +\end{align} +$$ + +## Time discretization + +Considering forward Euler explicit time stepping, we have the time discretized kinetics equation: + +$$ +\begin{align} + \mu^{n+1} &= f_{,c}^{n} - \kappa \Delta c^{n} +\end{align} +$$ + +$$ +\begin{align} + c^{n+1} &= c^{n} + \Delta t M~\nabla \cdot (\nabla \mu^{n}) +\end{align} +$$ + +## Weak formulation +In the weak formulation, considering an arbitrary variation $w$, the above equations can be expressed as residual equations representing a mixed (split) formulation: + +$$ +\begin{align} + \int_{\Omega} w \mu^{n+1} ~dV &= \int_{\Omega} w f_{,c}^{n} - w \kappa \Delta c^{n}~dV +\end{align} +$$ + +$$ +\begin{align} + &=\int_{\Omega} w f_{,c}^{n} + \nabla w \cdot \kappa \nabla c^{n} ~dV +\end{align} +$$ + +$$ +\begin{align} +r_{mu} &= f_{,c}^{n} +\end{align} +$$ + +$$ +\begin{align} +r_{mux} &= \kappa \nabla c^{n} +\end{align} +$$ + +and + +$$ +\begin{align} +\int_{\Omega} w c^{n+1} ~dV&= \int_{\Omega} w c^{n} + w \Delta t M~\nabla \cdot (\nabla \mu^{n}) ~dV +\end{align} +$$ + +$$ +\begin{align} +&= \int_{\Omega} w c^{n} + \nabla w (-\Delta t M)~ \cdot (\nabla \mu^{n}) ~dV \quad \text{[neglecting boundary flux]} +\end{align} +$$ + +$$ +\begin{align} +r_{c} &= c^{n} +\end{align} +$$ + +$$ +\begin{align} +r_{c x} &= (-\Delta t M)~ \cdot (\nabla \mu^{n}) +\end{align} +$$ + +The above values of $r_{mu}$, $r_{mux}$, $r_{c}$ and $r_{cx}$ are used to define the residuals in the following parameters file: +`applications/cahnHilliard/parameters.h` diff --git a/applications/spinodalDecomposition/formulation_cahnHillard.pdf b/applications/spinodalDecomposition/formulation_cahnHillard.pdf deleted file mode 100644 index 2c3a6ccb5..000000000 Binary files a/applications/spinodalDecomposition/formulation_cahnHillard.pdf and /dev/null differ