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... | |
computes a numerical diffusive flux for a diffusion problem including a tensor
Definition in file fv_num_diff_flux_gradient_tensor.m.
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
model | model |
model_data | model data |
U | U |
NU_ind | NU ind |
num_flux | num flux |
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 —
gridtypegrid —
a structure containing geometry information of a mesh used for discretizationsepsilon —
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.