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

computes a numerical diffusive flux for a diffusion problem More...

Go to the source code of this file.

Functions

function
num_flux_mat = 
fv_num_diff_flux_gradient (model, model_data, U, NU_ind)
 computes a numerical diffusive flux for a diffusion problem More...
 

Detailed Description

computes a numerical diffusive flux for a diffusion problem

Definition in file fv_num_diff_flux_gradient.m.

Function Documentation

function num_flux_mat = fv_num_diff_flux_gradient (   model,
  model_data,
  U,
  NU_ind 
)

computes a numerical diffusive flux for a diffusion problem

This function computes a numerical diffusive flux matrix for a diffusion problem. Dirichlet boundary treatment is performed, but neuman values are set to NaN. These must be handled by the calling function.

The analytical term inspiring this flux 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})) - l(u)}{|d_{ij}|} |e_{ij}|, \]

where \(\{u,v\}\) refers to the average of \(u\) and \(v\).

Parameters
modelmodel
model_datamodel data
UDof vector of finite volume function \(u\), i.e. argument for this operator.
NU_indNU ind
Return values
num_flux_matnum flux mat
Required fields of model:
  • diffusivity_ptr —  function pointer to diffusivity function \(d\)
  • laplacian_ptr —  function pointer to non-linear function \(l\)
  • verbose —  flag indicating the verbosity level of informative output
  • mean_ptr —  mean ptr
  • dirichlet_values_ptr —  dirichlet values ptr
Required fields of model_data:
  • grid —  a structure containing geometry information of a mesh used for discretizations
Generated fields of num_flux_mat:
  • epsilon —  diffusion coefficient bound
  • G —  the matrix of numerical flux values across the edges. boundary treatment is performed as follows: in dirichlet-boundary edges, the neighbour-values are simply set to this value and the flux is computed.

Definition at line 17 of file fv_num_diff_flux_gradient.m.

Here is the caller graph for this function: