fvbasefdlocallinearizer.hh File Reference

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

#include <ewoms/common/propertysystem.hh>
#include <ewoms/common/parametersystem.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 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

class  Ewoms::FvBaseFdLocalLinearizer< TypeTag >
 Calculates the Jacobian of the local residual for finite volume spatial discretizations using a finite difference method. More...
 
class  Ewoms::FvBaseFdLocalLinearizer< TypeTag >
 Calculates the Jacobian of the local residual for finite volume spatial discretizations using a finite difference method. More...
 

Namespaces

 Ewoms
 
 Ewoms::Properties
 

Functions

 Ewoms::Properties::NEW_TYPE_TAG (FiniteDifferenceLocalLinearizer)
 
 Ewoms::Properties::NEW_PROP_TAG (LocalLinearizer)
 The type of the local linearizer. More...
 
 Ewoms::Properties::NEW_PROP_TAG (Evaluation)
 Representation of a function evaluation and all necessary derivatives with regard to the intensive quantities of the primary variables. More...
 
 Ewoms::Properties::NEW_PROP_TAG (NumericDifferenceMethod)
 
 Ewoms::Properties::NEW_PROP_TAG (BaseEpsilon)
 
 Ewoms::Properties::NEW_PROP_TAG (LocalResidual)
 The type of the local residual function. More...
 
 Ewoms::Properties::NEW_PROP_TAG (Simulator)
 Manages the simulation time. More...
 
 Ewoms::Properties::NEW_PROP_TAG (Problem)
 The type of the problem. More...
 
 Ewoms::Properties::NEW_PROP_TAG (Model)
 The class dealing with the balance equations. More...
 
 Ewoms::Properties::NEW_PROP_TAG (PrimaryVariables)
 The class storing primary variables plus pseudo primary variables. More...
 
 Ewoms::Properties::NEW_PROP_TAG (ElementContext)
 The secondary variables of all degrees of freedom in an element's stencil. More...
 
 Ewoms::Properties::NEW_PROP_TAG (Scalar)
 Property to specify the type of scalar values. More...
 
 Ewoms::Properties::NEW_PROP_TAG (GridView)
 The type of the grid view. More...
 
 Ewoms::Properties::NEW_PROP_TAG (NumEq)
 The number of balance equations. More...
 
 Ewoms::Properties::SET_TYPE_PROP (FiniteDifferenceLocalLinearizer, LocalLinearizer, Ewoms::FvBaseFdLocalLinearizer< TypeTag >)
 
 Ewoms::Properties::SET_TYPE_PROP (FiniteDifferenceLocalLinearizer, Evaluation, typename GET_PROP_TYPE(TypeTag, Scalar))
 
 Ewoms::Properties::SET_INT_PROP (FiniteDifferenceLocalLinearizer, NumericDifferenceMethod,+1)
 Specify which kind of method should be used to numerically calculate the partial derivatives of the residual. More...
 
 Ewoms::Properties::SET_SCALAR_PROP (FiniteDifferenceLocalLinearizer, BaseEpsilon, 0.9123e-10)
 The base epsilon value for finite difference calculations. More...
 

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.