Solution templates#
Class Templates
#
- class multipy.templates.Templates#
Contains solution templates and building blocks for common multicomponent mass trasfer problems.
Templates.stefan_diffusion
#
- multipy.templates.Templates.stefan_diffusion(self, alpha, beta)#
Computes a matrix \(\pmb{\Phi}\) and a vector \(\pmb{\phi}\) such that:
\[ \begin{align}\begin{aligned}\Phi_{i, i} = \frac{\alpha_i}{\beta_{i, n}} + \sum_{j \neq i}^{n} \frac{\alpha_j}{\beta_{i,j}}\\\Phi_{i, j} = - \alpha_i \Big( \frac{1}{\beta_{i, j}} - \frac{1}{\beta_{i, n}} \Big)\end{aligned}\end{align} \]and
\[\phi_i = - \frac{\alpha_i}{\beta_{i, n}}\]where \(n\) is the number of species and \(\alpha_i\) and \(\beta_{i,j}\) are free user-specified coefficients.
This template can be used in Stefan diffusion -type problems.
- Parameters
alpha – scalar
numpy.ndarray
specifying the cofficients \(\alpha_{i}\). It should be of size(n_species,1)
.beta – scalar
numpy.ndarray
specifying the coefficients \(\beta_{i,j}\). It should be of size(n_species,n_species)
.
- Returns
phi - scalar
numpy.ndarray
\(\pmb{\phi}\). It has size(n_species-1,1)
.Phi - scalar
numpy.ndarray
\(\pmb{\Phi}\). It has size(n_species-1,n_species-1)
.