24#ifndef DUMUX_INCOMPRESSIBLE_ONEP_CONVERGENCETEST_PROBLEM_HH
25#define DUMUX_INCOMPRESSIBLE_ONEP_CONVERGENCETEST_PROBLEM_HH
28#include <dune/grid/yaspgrid.hh>
29#include <dune/geometry/quadraturerules.hh>
46template<
class TypeTag>
class OnePTestProblem;
59template<
class TypeTag>
60struct Grid<TypeTag, TTag::OnePIncompressible> {
using type = Dune::YaspGrid<2>; };
63template<
class TypeTag>
67template<
class TypeTag>
76template<
class TypeTag>
80template<
class TypeTag>
93template<
class TypeTag>
104 using FVElementGeometry =
typename GridGeometry::LocalView;
105 using SubControlVolume =
typename GridGeometry::SubControlVolume;
106 using GridView =
typename GridGeometry::GridView;
107 using Element =
typename GridView::template Codim<0>::Entity;
108 using GlobalPosition =
typename Element::Geometry::GlobalCoordinate;
126 BoundaryTypes values;
127 values.setAllDirichlet();
136 {
return exact(globalPos); }
145 template<
class ElementVolumeVariables>
146 NumEqVector
source(
const Element& element,
147 const FVElementGeometry& fvGeometry,
148 const ElementVolumeVariables& elemVolVars,
149 const SubControlVolume& scv)
const
151 static const auto order = getParam<Scalar>(
"Problem.SourceIntegrationOrder");
152 static const auto periodLength = getParam<Scalar>(
"Problem.ExactSolPeriodLength");
153 const auto& k = this->
spatialParams().permeabilityAtPos(scv.center());
158 const auto eg = element.geometry();
159 const auto rule = Dune::QuadratureRules<Scalar, GridView::dimension>::rule(eg.type(), order);
164 const auto p = eg.global(qp.position());
168 const auto preFactor = -1.0*periodLength*periodLength*M_PI*M_PI;
169 const auto preFactorArg = periodLength*M_PI;
170 const auto sineTerm = sin(preFactorArg*x);
171 const auto cosTerm = cos(preFactorArg*y);
172 const auto secondDeriv = preFactor*sineTerm*cosTerm;
175 source -= 2.0*k*secondDeriv*qp.weight()*eg.integrationElement(qp.position());
179 return NumEqVector(
source);
192 static PrimaryVariables
exact(
const GlobalPosition& globalPos)
194 const auto x = globalPos[0];
195 const auto y = globalPos[1];
200 static const auto periodLength = getParam<Scalar>(
"Problem.ExactSolPeriodLength");
201 const auto preFactorArg = periodLength*M_PI;
202 const auto u = sin(preFactorArg*x)*cos(preFactorArg*y);
204 return PrimaryVariables(u);
Defines a type tag and some properties for models using the box scheme.
Properties for all models using cell-centered finite volume scheme with mpfa.
Properties for all models using cell-centered finite volume scheme with TPFA.
Setting constant fluid properties via the input file.
A liquid phase consisting of a single component.
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(....
Definition: propertysystem.hh:149
Class to specify the type of a boundary.
Definition: common/boundarytypes.hh:38
Base class for all finite-volume problems.
Definition: common/fvproblem.hh:50
const GridGeometry & gridGeometry() const
The finite volume grid geometry.
Definition: common/fvproblem.hh:588
The DUNE grid type.
Definition: common/properties.hh:57
Property to specify the type of a problem which has to be solved.
Definition: common/properties.hh:69
Definition: common/properties.hh:91
The type of the spatial parameters object.
Definition: common/properties.hh:221
The type of the fluid system to use.
Definition: common/properties.hh:223
A liquid phase consisting of a single component.
Definition: 1pliquid.hh:46
Element-wise calculation of the residual and its derivatives for a single-phase, incompressible,...
Definition: 1p/incompressiblelocalresidual.hh:41
Base class for all fully implicit porous media problems.
Definition: dumux/porousmediumflow/problem.hh:39
SpatialParams & spatialParams()
Returns the spatial parameters object.
Definition: dumux/porousmediumflow/problem.hh:146
NumEqVector source(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolume &scv) const
Evaluates the source term within a sub-control volume.
Definition: test/porousmediumflow/1p/implicit/convergence/problem.hh:146
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
Evaluates the boundary conditions for a Dirichlet control volume.
Definition: test/porousmediumflow/1p/implicit/convergence/problem.hh:135
OnePTestProblem(std::shared_ptr< const GridGeometry > gridGeometry)
The constructor.
Definition: test/porousmediumflow/1p/implicit/convergence/problem.hh:115
static PrimaryVariables exact(const GlobalPosition &globalPos)
Returns the exact solution at a position.
Definition: test/porousmediumflow/1p/implicit/convergence/problem.hh:192
BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const
Specifies which kind of boundary condition should be used for which equation on a given boundary cont...
Definition: test/porousmediumflow/1p/implicit/convergence/problem.hh:124
Scalar temperature() const
Returns the temperature for an isothermal problem.
Definition: test/porousmediumflow/1p/implicit/convergence/problem.hh:185
The spatial parameters class for the test problem using the incompressible 1p model.
Definition: multidomain/boundary/darcydarcy/1p_1p/spatialparams.hh:62
Definition: test/porousmediumflow/1p/implicit/convergence/problem.hh:52
std::tuple< OneP > InheritsFrom
Definition: test/porousmediumflow/1p/implicit/convergence/problem.hh:52
Definition: test/porousmediumflow/1p/implicit/convergence/problem.hh:53
std::tuple< OnePIncompressible, CCTpfaModel > InheritsFrom
Definition: test/porousmediumflow/1p/implicit/convergence/problem.hh:53
Definition: test/porousmediumflow/1p/implicit/convergence/problem.hh:54
std::tuple< OnePIncompressible, CCMpfaModel > InheritsFrom
Definition: test/porousmediumflow/1p/implicit/convergence/problem.hh:54
Definition: test/porousmediumflow/1p/implicit/convergence/problem.hh:55
std::tuple< OnePIncompressible, BoxModel > InheritsFrom
Definition: test/porousmediumflow/1p/implicit/convergence/problem.hh:55
Dune::YaspGrid< 2 > type
Definition: test/porousmediumflow/1p/implicit/convergence/problem.hh:60
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: test/porousmediumflow/1p/implicit/convergence/problem.hh:71
GetPropType< TypeTag, Properties::GridGeometry > GridGeometry
Definition: test/porousmediumflow/1p/implicit/convergence/problem.hh:70
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: test/porousmediumflow/1p/implicit/convergence/problem.hh:83
A single-phase, isothermal flow model using the fully implicit scheme.
Base class for all porous media problems.
Element-wise calculation of the residual and its derivatives for a single-phase, incompressible,...
Definition of the spatial parameters for the MaxwellStefan problem.