rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
Functions
fv_num_diff_flux_pressure_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_pressure_gradient (model, model_data, P, S)
 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_pressure_gradient.m.

Function Documentation

function num_flux_mat = fv_num_diff_flux_pressure_gradient (   model,
  model_data,
  P,
  S 
)

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
PDof vector of finite volume function \(p\), i.e. pressure argument for this operator.
SS
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
  • two_phase.total_mobility —  two phase.total mobility
  • mean_ptr —  mean ptr
  • dirichlet_values_s_ptr —  dirichlet values s ptr
  • dirichlet_values_p_ptr —  dirichlet values p ptr
  • two_phase.toal_mobility —  two phase.toal mobility
Required fields of model_data:
  • grid —  a structure containing geometry information of a mesh used for discretizations
  • gn_edges —  gn edges
  • gn_inner_edges —  gn inner edges
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_pressure_gradient.m.