version 3.11-dev
Loading...
Searching...
No Matches
Dumux::Experimental::Problem< TypeTag > Class Template Reference

Base class for all standard finite volume or finite element problems. More...

#include <dumux/common/problem.hh>

Inheritance diagram for Dumux::Experimental::Problem< TypeTag >:

Description

template<class TypeTag>
class Dumux::Experimental::Problem< TypeTag >
Note
All quantities (regarding the units) are specified assuming a three-dimensional world. Problems discretized using 2D grids are assumed to be extruded by \(1 m\) and 1D grids are assumed to have a cross section of \(1m \times 1m\).

Classes

struct  Traits
 export traits of this problem More...

Public Member Functions

 Problem (std::shared_ptr< const GridDiscretization > gridDiscretization, const std::string &paramGroup="")
 Constructor.
const std::string & name () const
 The problem name.
void setName (const std::string &newName)
 Set the problem name.

Boundary conditions and sources defining the problem

BoundaryTypes boundaryTypes (const ElementDiscretization &elemDisc, const typename ElementDiscretization::BoundaryFace &boundaryFace) const
 Specifies which kind of boundary condition should be used for which equation on a given boundary face.
BoundaryTypes boundaryTypesAtPos (const GlobalPosition &globalPos) const
 Specifies which kind of boundary condition should be used for which equation on a given boundary segment.
template<class ResidualVector, class ElementVariables, class BoundaryTypes>
void addFEBoundaryFluxIntegral (ResidualVector &residual, const ElementDiscretization &elemDisc, const ElementVariables &elemVars, const typename ElementDiscretization::BoundaryFace &boundaryFace, const BoundaryTypes &bcTypes) const
 Evaluates finite-element boundary flux integral contributions for a given boundary face.
template<class ResidualVector, class ElementVariables, class BoundaryTypes>
void addFVBoundaryFluxIntegral (ResidualVector &residual, const ElementDiscretization &elemDisc, const ElementVariables &elemVars, const typename ElementDiscretization::SubControlVolumeFace &scvf, const BoundaryTypes &bcTypes) const
 Evaluates finite-volume boundary flux integral contributions for a given scvf.
template<class ElementVariables, class FaceIpData>
NumEqVector boundaryFlux (const ElementDiscretization &elemDisc, const ElementVariables &elemVars, const FaceIpData &faceIpData) const
 Evaluate the boundary conditions for a neumann boundary segment.
NumEqVector boundaryFluxAtPos (const GlobalPosition &globalPos) const
 Evaluate the boundary flux at a given position.
template<class ElementVariables, class IpData>
NumEqVector source (const ElementDiscretization &elemDisc, const ElementVariables &elemVars, const IpData &ipData) const
 Evaluate the source term at a given interpolation point.
NumEqVector sourceAtPos (const GlobalPosition &globalPos) const
 Evaluate the source term for all phases at a given position.
template<class MatrixBlock, class Variables, class IpData>
void addSourceDerivatives (MatrixBlock &block, const Element &element, const ElementDiscretization &elemDisc, const Variables &volVars, const IpData &ipData) const
 Add source term derivative to the Jacobian.
EmptyPointSources pointSources () const
 Return the point sources for this problem.
const GridDiscretization & gridGeometry () const
 The grid discretization.
const GridDiscretization & gridDiscretization () const
 The grid discretization.
const std::string & paramGroup () const
 The parameter group in which to retrieve runtime parameters.
Implementation & asImp_ ()
 Returns the implementation of the problem (i.e. static polymorphism).
const Implementation & asImp_ () const
 Returns the implementation of the problem (i.e. static polymorphism).

Constructor & Destructor Documentation

◆ Problem()

template<class TypeTag>
Dumux::Experimental::Problem< TypeTag >::Problem ( std::shared_ptr< const GridDiscretization > gridDiscretization,
const std::string & paramGroup = "" )
inline
Parameters
gridDiscretizationThe grid discretization
paramGroupThe parameter group in which to look for runtime parameters first (default is "")

Member Function Documentation

◆ addFEBoundaryFluxIntegral()

template<class TypeTag>
template<class ResidualVector, class ElementVariables, class BoundaryTypes>
void Dumux::Experimental::Problem< TypeTag >::addFEBoundaryFluxIntegral ( ResidualVector & residual,
const ElementDiscretization & elemDisc,
const ElementVariables & elemVars,
const typename ElementDiscretization::BoundaryFace & boundaryFace,
const BoundaryTypes & bcTypes ) const
inline
Parameters
residualThe residual vector to which the boundary flux contributions are added
elemDiscThe element discretization
elemVarsAll variables for the element
boundaryFaceThe boundary face for which the boundary flux integral is evaluated
bcTypesThe boundary types

◆ addFVBoundaryFluxIntegral()

template<class TypeTag>
template<class ResidualVector, class ElementVariables, class BoundaryTypes>
void Dumux::Experimental::Problem< TypeTag >::addFVBoundaryFluxIntegral ( ResidualVector & residual,
const ElementDiscretization & elemDisc,
const ElementVariables & elemVars,
const typename ElementDiscretization::SubControlVolumeFace & scvf,
const BoundaryTypes & bcTypes ) const
inline
Parameters
residualThe residual vector to which the boundary flux contributions are added
elemDiscThe element discretization
elemVarsAll variables for the element
scvfThe scvf for which the boundary flux integral is evaluated
bcTypesThe boundary types

◆ addSourceDerivatives()

template<class TypeTag>
template<class MatrixBlock, class Variables, class IpData>
void Dumux::Experimental::Problem< TypeTag >::addSourceDerivatives ( MatrixBlock & block,
const Element & element,
const ElementDiscretization & elemDisc,
const Variables & volVars,
const IpData & ipData ) const
inline
Note
Only needed in case of analytic differentiation and solution dependent sources

◆ asImp_() [1/2]

template<class TypeTag>
Implementation & Dumux::Experimental::Problem< TypeTag >::asImp_ ( )
inlineprotected

◆ asImp_() [2/2]

template<class TypeTag>
const Implementation & Dumux::Experimental::Problem< TypeTag >::asImp_ ( ) const
inlineprotected

◆ boundaryFlux()

template<class TypeTag>
template<class ElementVariables, class FaceIpData>
NumEqVector Dumux::Experimental::Problem< TypeTag >::boundaryFlux ( const ElementDiscretization & elemDisc,
const ElementVariables & elemVars,
const FaceIpData & faceIpData ) const
inline

This is the method for the case where the Neumann condition is potentially solution dependent

Parameters
elemDiscThe element discretization
elemVarsAll variables for the element
faceIpDataFace interpolation point data

Negative values mean influx. E.g. for the mass balance that would be the mass flux in \( [ kg / (m^2 \cdot s)] \).

◆ boundaryFluxAtPos()

template<class TypeTag>
NumEqVector Dumux::Experimental::Problem< TypeTag >::boundaryFluxAtPos ( const GlobalPosition & globalPos) const
inline
Parameters
globalPosThe position of the boundary face's integration point in global coordinates

Negative values mean influx. E.g. for the mass balance that would be the mass flux in \( [ kg / (m^2 \cdot s)] \).

As a default, i.e. if the user's problem does not overload any boundary flux method return no-flux boundary conditions at all boundaries

◆ boundaryTypes()

template<class TypeTag>
BoundaryTypes Dumux::Experimental::Problem< TypeTag >::boundaryTypes ( const ElementDiscretization & elemDisc,
const typename ElementDiscretization::BoundaryFace & boundaryFace ) const
inline
Parameters
elemDiscThe element discretization
boundaryFaceThe boundary face

◆ boundaryTypesAtPos()

template<class TypeTag>
BoundaryTypes Dumux::Experimental::Problem< TypeTag >::boundaryTypesAtPos ( const GlobalPosition & globalPos) const
inline
Parameters
globalPosThe position in global coordinates

As a default, i.e. if the user's problem does not overload any boundaryTypes method we set no-flux everywhere.

◆ gridDiscretization()

template<class TypeTag>
const GridDiscretization & Dumux::Experimental::Problem< TypeTag >::gridDiscretization ( ) const
inline

◆ gridGeometry()

template<class TypeTag>
const GridDiscretization & Dumux::Experimental::Problem< TypeTag >::gridGeometry ( ) const
inline

◆ name()

template<class TypeTag>
const std::string & Dumux::Experimental::Problem< TypeTag >::name ( ) const
inline

This is used as a prefix for files generated by the simulation. It could be either overwritten by the problem files, or simply declared over the setName() function in the application file.

◆ paramGroup()

template<class TypeTag>
const std::string & Dumux::Experimental::Problem< TypeTag >::paramGroup ( ) const
inline

◆ pointSources()

template<class TypeTag>
EmptyPointSources Dumux::Experimental::Problem< TypeTag >::pointSources ( ) const
inline

By default, no point sources are present (returns EmptyPointSources for which empty() returns true). Derived classes can overwrite this function to return a PointSources object containing point sources with contexts and an evaluation function.

The returned object must provide the following interface:

  • bool empty() const Returns true if no point sources are registered; otherwise false.
  • For finite-volume schemes:
    auto contexts(const ElementDiscretization& elemDisc,
    const SubControlVolume& scv) const;
    Returns a range of contexts related to the scv.
  • For finite-element schemes:
    auto contexts(const ElementDiscretization& elemDisc,
    const Element& element) const;
    Returns a range of contexts related to the element.
  • auto eval(const ElementDiscretization& elemDisc, const ElementVariables& elemVars, const Context& context) const Evaluates the point source for the given context.

◆ setName()

template<class TypeTag>
void Dumux::Experimental::Problem< TypeTag >::setName ( const std::string & newName)
inline
Parameters
newNameThe problem's name

◆ source()

template<class TypeTag>
template<class ElementVariables, class IpData>
NumEqVector Dumux::Experimental::Problem< TypeTag >::source ( const ElementDiscretization & elemDisc,
const ElementVariables & elemVars,
const IpData & ipData ) const
inline

This is the method for the case where the source term is potentially solution dependent and requires some quantities that are specific to the fully-implicit method.

Parameters
elemDiscThe element discretization
elemVarsAll variables for the element
ipDataInterpolation point data

For this method, the return parameter stores the conserved quantity rate generated or annihilate per volume unit. Positive values mean that the conserved quantity is created, negative ones mean that it vanishes.

◆ sourceAtPos()

template<class TypeTag>
NumEqVector Dumux::Experimental::Problem< TypeTag >::sourceAtPos ( const GlobalPosition & globalPos) const
inline
Parameters
globalPosThe position in global coordinates

For this method, the values parameter stores the conserved quantity rate generated or annihilate per volume unit. Positive values mean that the conserved quantity is created, negative ones mean that it vanishes. E.g. for the mass balance that would be a mass rate in \( [ kg / (m^3 \cdot s)] \).

As a default, i.e. if the user's problem does not overload any source method return 0.0 (no source terms)


The documentation for this class was generated from the following file: