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

Base class for all problems using spatial parameters.

#include <dumux/common/problemwithspatialparams.hh>

Inheritance diagram for Dumux::Experimental::ProblemWithSpatialParams< TypeTag, BaseProblem >:

Public Types

using SpatialParams = GetPropType<TypeTag, Properties::SpatialParams>

Public Member Functions

 ProblemWithSpatialParams (std::shared_ptr< const GridDiscretization > gridDiscretization, const std::string &paramGroup="")
 Constructor.
 ProblemWithSpatialParams (std::shared_ptr< const GridDiscretization > gridDiscretization, std::shared_ptr< SpatialParams > spatialParams, const std::string &paramGroup="")
 Constructor.
const SpatialParamsspatialParams () const
 Return a reference to the underlying spatial parameters.
SpatialParamsspatialParams ()
 Return a reference to the underlying spatial parameters.
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).

Member Typedef Documentation

◆ SpatialParams

template<class TypeTag, class BaseProblem = Problem<TypeTag>>
using Dumux::Experimental::ProblemWithSpatialParams< TypeTag, BaseProblem >::SpatialParams = GetPropType<TypeTag, Properties::SpatialParams>

Constructor & Destructor Documentation

◆ ProblemWithSpatialParams() [1/2]

template<class TypeTag, class BaseProblem = Problem<TypeTag>>
Dumux::Experimental::ProblemWithSpatialParams< TypeTag, BaseProblem >::ProblemWithSpatialParams ( 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 "")
Note
This constructor assumes the spatial parameters to be constructible from a grid discretization

◆ ProblemWithSpatialParams() [2/2]

template<class TypeTag, class BaseProblem = Problem<TypeTag>>
Dumux::Experimental::ProblemWithSpatialParams< TypeTag, BaseProblem >::ProblemWithSpatialParams ( std::shared_ptr< const GridDiscretization > gridDiscretization,
std::shared_ptr< SpatialParams > spatialParams,
const std::string & paramGroup = "" )
inline
Parameters
gridDiscretizationThe grid discretization
spatialParamsThe spatially varying parameters
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
inlineinherited
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
inlineinherited
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
inlineinherited
Note
Only needed in case of analytic differentiation and solution dependent sources

◆ asImp_() [1/2]

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

◆ asImp_() [2/2]

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

◆ 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
inlineinherited

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
inlineinherited
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
inlineinherited
Parameters
elemDiscThe element discretization
boundaryFaceThe boundary face

◆ boundaryTypesAtPos()

template<class TypeTag>
BoundaryTypes Dumux::Experimental::Problem< TypeTag >::boundaryTypesAtPos ( const GlobalPosition & globalPos) const
inlineinherited
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
inlineinherited

◆ gridGeometry()

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

◆ name()

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

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
inlineinherited

◆ pointSources()

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

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)
inlineinherited
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
inlineinherited

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
inlineinherited
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)

◆ spatialParams() [1/2]

template<class TypeTag, class BaseProblem = Problem<TypeTag>>
SpatialParams & Dumux::Experimental::ProblemWithSpatialParams< TypeTag, BaseProblem >::spatialParams ( )
inline

◆ spatialParams() [2/2]

template<class TypeTag, class BaseProblem = Problem<TypeTag>>
const SpatialParams & Dumux::Experimental::ProblemWithSpatialParams< TypeTag, BaseProblem >::spatialParams ( ) const
inline

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