Mesh

The diffusion models treat the mesh as a parameter so that different mesh geometries can be used. Meshes in kawin are defined by a set of nodes, where a node contains a response vector (y) and a spatial coordinate (z). Then the flux of a response is dependent on the response gradient and its respective diffusivity (D).

$$ J = D \nabla y $$

For single phase diffusion, the response vector is the composition and the diffusivity is the interdiffusivity.

$$ J_k^v = -\sum_j \left(D_{kj}^n \frac{\partial x_j}{\partial z} \right) $$

For the homogenization model, the response vector is the chemical potential and u-fraction (both functions of composition) and the diffusivity relates to the homogenization function.

$$ J_k^v = -\sum_j \left((\delta_{jk} - u_k \delta_{k \epsilon S}) \Gamma_j \frac{\partial \mu_j}{\partial z} \right) - \sum_j \left((\delta_{jk} - u_k \delta_{k \epsilon S}) \varepsilon \frac{\Gamma_j}{u_j} RT \frac{\partial u_j}{\partial z} \right)$$

During a simulation, the diffusion model will supply the mesh with the responses and diffusivities on each node based off the current composition. Then the mesh will use this information to determine the fluxes and time derivative. Examples are shown at the bottom of this page on how the full linear system of responses and diffusivities can be constructed for the single phase and homogenization model.

Kawin currently supports meshes that work under the finite volume method (FVM) for 1D and 2D systems as conservation of mass is built into this implementation.

1-D FVM

The finite volume method uses a mesh of cells, where the composition is defined at the cell center. Fluxes are computed between neighboring cells. At the boundaries, boundary conditions can be defined using a Neumann boundary condition (fixed flux) or a Dirichlet boundary condition (fixed composition = fixed flux at 0).

1D finite volume schematic

1D finite volume schematic

This mesh can also be used to define different coordinate systems. Kawin supports cartesian, cylindrical (along $\rho$) and spherical (along r) coordinates for the 1D mesh.

Cartesian: $ \frac{\partial y}{\partial t} = -\nabla J $

Cylindrical: $ \frac{\partial y}{\partial t} = -\frac{1}{\rho} \nabla (\rho J) $

Spherical: $ \frac{\partial y}{\partial t} = -\frac{1}{r^2} \nabla (r^2 J) $

2-D FVM

Extending the finite volume method to 2D is similar to the 1D implementation except that fluxes in both the x and y directions are accounted for. Currently, kawin only supports a 2D mesh in cartesian coordinates with no-flux boundary conditions.

2D finite volume schematic

2D finite volume schematic

Examples

These examples construct a linear system for how the fluxes are defined by the diffusivity and responses in a ternary A-B-C system where A is the independent component and C is an interstitial. The purpose of this example is to provide some clarity in how the model is implemented in kawin.

Single phase diffusion

$$ \left[ \begin{array}{c} J_B^v \newline J_C^v \end{array} \right] = \left[ \begin{array}{cc} D^A_{BB} & D^A_{BC} \newline D^A_{CB} & D^A_{CC} \newline \end{array} \right] \left[ \begin{array}{c} \frac{\partial u_B}{\partial z} \newline \frac{\partial u_C}{\partial z} \end{array} \right] $$

Note that this matrix would be the same if C was a substitutional element since the volume contributions in the fluxes are already accounted for in the interdiffusivity $D^n_{ij}$.

Homogenization model

$$ \left[ \begin{array}{c} J_B^v \newline J_C^v \end{array} \right] = \left[ \begin{array}{cc} -u_B \Gamma_A & (1-u_B) \Gamma_B & 0 \newline -u_C \Gamma_A & -u_C \Gamma_B & \Gamma_C \newline \end{array} \right] \left[ \begin{array}{c} \frac{\partial \mu_A}{\partial z} \newline \frac{\partial \mu_B}{\partial z} \newline \frac{\partial \mu_C}{\partial z} \end{array} \right] + \left[ \begin{array}{cc} u_B \varepsilon \frac{\Gamma_A}{u_A} RT & -(1-u_B) \varepsilon \frac{\Gamma_B}{u_B} RT & 0 \newline u_C \varepsilon \frac{\Gamma_A}{u_A} RT & u_C \varepsilon \frac{\Gamma_B}{u_B} RT & \varepsilon \frac{\Gamma_C}{u_C} RT \newline \end{array} \right] \left[ \begin{array}{c} \frac{\partial u_A}{\partial z} \newline \frac{\partial u_B}{\partial z} \newline \frac{\partial u_C}{\partial z} \end{array} \right] $$