fvbasefdlocallinearizer.hh File Reference
#include <opm/models/utils/propertysystem.hh>
#include <opm/models/utils/parametersystem.hh>
#include <opm/models/discretization/common/fvbaseproperties.hh>
#include <opm/material/common/MathToolbox.hpp>
#include <opm/material/common/Valgrind.hpp>
#include <dune/istl/bvector.hh>
#include <dune/istl/matrix.hh>
#include <dune/common/fvector.hh>
#include <dune/common/fmatrix.hh>
#include <limits>
Include dependency graph for fvbasefdlocallinearizer.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Opm::Properties::TTag::FiniteDifferenceLocalLinearizer
 
struct  Opm::Properties::BaseEpsilon< TypeTag, MyTypeTag >
 
struct  Opm::Properties::LocalLinearizer< TypeTag, TTag::FiniteDifferenceLocalLinearizer >
 
struct  Opm::Properties::Evaluation< TypeTag, TTag::FiniteDifferenceLocalLinearizer >
 
struct  Opm::Properties::BaseEpsilon< TypeTag, TTag::FiniteDifferenceLocalLinearizer >
 The base epsilon value for finite difference calculations. More...
 
struct  Opm::Parameters::NumericDifferenceMethod
 Specify which kind of method should be used to numerically calculate the partial derivatives of the residual. More...
 
class  Opm::FvBaseFdLocalLinearizer< TypeTag >
 Calculates the Jacobian of the local residual for finite volume spatial discretizations using a finite difference method. More...
 

Namespaces

namespace  Opm
 
namespace  Opm::Properties
 
namespace  Opm::Properties::TTag
 The generic type tag for problems using the immiscible multi-phase model.
 
namespace  Opm::Parameters
 

Detailed Description

Calculates the Jacobian of the local residual for finite volume spatial discretizations using a finite difference method.

The local Jacobian for a given context is defined as the derivatives of the residuals of all degrees of freedom featured by the stencil with regard to the primary variables of the stencil's "primary" degrees of freedom.

This class implements numeric differentiation using finite difference methods, i.e. forward or backward differences (2nd order), or central differences (3rd order). The method used is determined by the "NumericDifferenceMethod" property:

  • If the value of this property is smaller than 0, backward differences are used, i.e.:

    \[
    \frac{\partial f(x)}{\partial x} \approx \frac{f(x) - f(x - \epsilon)}{\epsilon}
  \]

  • If the value of this property is 0, central differences are used, i.e.:

    \[
    \frac{\partial f(x)}{\partial x} \approx
         \frac{f(x + \epsilon) - f(x - \epsilon)}{2 \epsilon}
  \]

  • if the value of this property is larger than 0, forward differences are used, i.e.:

    \[
    \frac{\partial f(x)}{\partial x} \approx
         \frac{f(x + \epsilon) - f(x)}{\epsilon}
  \]

Here, $ f $ is the residual function for all equations, $x$ is the value of a sub-control volume's primary variable at the evaluation point and $\epsilon$ is a small scalar value larger than 0.