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

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

Go to the source code of this file.

Functions

function
num_flux = 
fv_num_diff_flux_gradient_tensor (model, model_data, U, NU_ind)
 computes a numerical diffusive flux for a diffusion problem including a tensor More...
 

Detailed Description

computes a numerical diffusive flux for a diffusion problem including a tensor

Definition in file fv_num_diff_flux_gradient_tensor.m.

Function Documentation

function num_flux = fv_num_diff_flux_gradient_tensor (   model,
  model_data,
  U,
  NU_ind 
)

computes a numerical diffusive flux for a diffusion problem including a tensor

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.

For discretization of a gradient_tensor the parameter NU_ind is necessary, if the gradient shall only be approximated on the local grid coordinates given by NU_ind.

The analytical term inspiring this flux looks like

\[ - \nabla \cdot \left( d(x) K(x,u) \nabla u \right),\]

with a function \(d: R \to R\) and a tensor \(K: R \times R \to \text{Lin}(R^2, R^2)\).

The implemented flux then can be written for inner boundaries as

\[g_{ij}(u,v) = d(x_{ij}) \tilde{K}(x,u,v) \tilde{\nabla}(u,v) |e_{ij}|\]

and for Dirichlet boundaries as

\[g_{dir,ij}(u) = d(x_{ij}) \tilde{K}_{dir}(x,u) \tilde{\nabla}(u) |e_{ij}|\]

where the discretizations \(\tilde{K} and \tilde{\nabla}\) of \(K\) respectively \(\nabla\) are given by the function pointer model.diffusivity_tensor_ptr respectively the function gradient_approx(). Note, that the latter is only available for rectangular grids.

if grid is empty, it is generated

Parameters
modelmodel
model_datamodel data
UU
NU_indNU ind
Return values
num_fluxnum flux
Required fields of model:
  • diffusivity_ptr —  function pointer to diffusivity function \(d\)
  • diffusivity_tensor_ptr —  function pointer to a tensor implementation for \(K\)
  • verbose —  flag indicating the verbosity level of informative output
  • debug —  flag indicating wether debug output shall be turned on
  • gridtype —  gridtype
Required fields of model_data:
  • grid —  a structure containing geometry information of a mesh used for discretizations
Generated fields of num_flux:
  • 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_tensor.m.

Here is the caller graph for this function: