computes diffusion contributions to finite volume time evolution matrices, or their Frechet derivative More...
Go to the source code of this file.
Functions | |
function [
L_I_diff , bdir_I_diff ] = | fv_operators_diff_implicit_gradient (model, model_data, U, NU_ind) |
computes diffusion contributions to finite volume time evolution matrices, or their Frechet derivative More... | |
computes diffusion contributions to finite volume time evolution matrices, or their Frechet derivative
Definition in file fv_operators_diff_implicit_gradient.m.
function [ L_I_diff , bdir_I_diff ] = fv_operators_diff_implicit_gradient | ( | model, | |
model_data, | |||
U, | |||
NU_ind | |||
) |
computes diffusion contributions to finite volume time evolution matrices, or their Frechet derivative
This function computes a diffusion operator \(L_{\text{diff}}\) and a corresponding offset vector \(b_{\text{diff}}\) that can be used by fv_operators_implicit_explicit() to build evolution matrices for a finite volume time step \(L_I U^{k+1} = L_E U^k + b_E + b_I\).
The analytical term inspiring this operator looks like
\[ - \nabla \cdot \left(d(u) \nabla l(u) \right). \]
Here, the functions \(d(u)\) and \(l(u)\) differ in the numerical implementation.
The latter is evaluated in cell centers during flux computation, whereas the diffusion functional \(d(u)\) is evaluated on the cell edges by averaging the solutions value there.
The implemented flux then can be written for inner boundaries as
\[ g_{ij}(u,v) = d(\{u,v\}) \frac{l(v) - l(u)}{|d_{ij}|} |e_{ij}| \]
and for Dirichlet boundaries as
\[ g_{dir,ij}(u) = d(u_{dir}(x_{ij})) \frac{l(u_{dir}(x_{ij})) - u}{|d_{ij}|} |e_{ij}|, \]
where \(\{u,v\}\) refers to the average of \(u\) and \(v\).
If, however, \(l(u)\) is non-trivial, the flux arguments are simply scaled by \(l'(u)\) giving rise to the Frechet derivative \(D L_I|_{U}\) that can be used in a Newton scheme. The offset vector bdir_I_diff
can then be ignored, of course!
model | model |
model_data | model data |
U | U |
NU_ind | NU ind |
L_I_diff | a sparse matrix with diffusion contributions to \(L_I\). |
bdir_I_diff | and offset vector containing the Dirichlet value contributions of the diffusion parts. |
diffusivity_ptr —
The diffusivity function \(d(u)\) laplacian_derivative_ptr —
The derivative \(l'(u)\). See above for explanation. dirichlet_values_ptr —
The dirichlet function \(u_{\text{dir}}\) decomp_mode —
flag indicating the operation mode of the function:mu_names
.mu_names
. verbose —
flag indicating the verbosity level of informative outputgrid —
a structure containing geometry information of a mesh used for discretizations Definition at line 17 of file fv_operators_diff_implicit_gradient.m.