rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
Functions
fv_operators_diff_implicit_gradient.m File Reference

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...
 

Detailed Description

computes diffusion contributions to finite volume time evolution matrices, or their Frechet derivative

Definition in file fv_operators_diff_implicit_gradient.m.

Function Documentation

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.

See also
fv_num_diff_flux_gradient()

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\).

Note
that this implementation only works for trivial functions \(l = id\), because otherwise the operator would became non-linear in the space variable.

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!

Parameters
modelmodel
model_datamodel data
UU
NU_indNU ind
Return values
L_I_diffa sparse matrix with diffusion contributions to \(L_I\).
bdir_I_diffand offset vector containing the Dirichlet value contributions of the diffusion parts.
Required fields of model:
  • 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:
    • 0 (complete) : no affine parameter dependence or decomposition is performed.
    • 1 (components) : for each output argument a cell array of output matrices is returned representing the \(q\)-th component independent of the parameters given in mu_names.
    • 2 (coefficients) : returns a vector where each coordinate represents the \(q\)-the coefficient \(\sigma_{\cdot}^{q}(\mu)\) dependent on the parameters given in mu_names.
  • verbose —  flag indicating the verbosity level of informative output
Required fields of model_data:
  • grid —  a structure containing geometry information of a mesh used for discretizations

Definition at line 17 of file fv_operators_diff_implicit_gradient.m.

Here is the caller graph for this function: