3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
multidomain/poromechanics/el1p/problem_1p.hh
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3/*****************************************************************************
4 * See the file COPYING for full copying permissions. *
5 * *
6 * This program is free software: you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation, either version 3 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
18 *****************************************************************************/
25#ifndef DUMUX_1P_SUB_PROBLEM_HH
26#define DUMUX_1P_SUB_PROBLEM_HH
27
28#include <dune/grid/yaspgrid.hh>
29
33
36
37#include "spatialparams_1p.hh"
38
39namespace Dumux {
40
41// forward declaration of the problem class
42template <class TypeTag>
43class OnePSubProblem;
44
45namespace Properties {
46
47// Create new type tags
48namespace TTag {
49struct OnePSub { using InheritsFrom = std::tuple<OneP, CCTpfaModel>; };
50} // end namespace TTag
51
52// The fluid phase consists of one constant component
53template<class TypeTag>
54struct FluidSystem<TypeTag, TTag::OnePSub>
55{
58};
59
60// Set the grid type
61template<class TypeTag>
62struct Grid<TypeTag, TTag::OnePSub> { using type = Dune::YaspGrid<2>; };
63// Set the problem property
64template<class TypeTag>
65struct Problem<TypeTag, TTag::OnePSub> { using type = OnePSubProblem<TypeTag> ; };
66// Set the spatial parameters
67template<class TypeTag>
68struct SpatialParams<TypeTag, TTag::OnePSub>
69{
74};
75} // end namespace Properties
76
81template <class TypeTag>
83{
85
88 using Element = typename GridView::template Codim<0>::Entity;
89 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
90
91 // copy pressure index for convenience
93
98
99public:
100 OnePSubProblem(std::shared_ptr<const GridGeometry> gridGeometry,
102 const std::string& paramGroup = "OneP")
104 {
105 problemName_ = getParam<std::string>("Vtk.OutputName") + "_" + getParamFromGroup<std::string>(this->paramGroup(), "Problem.Name");
106 }
107
111 const std::string& name() const
112 {
113 return problemName_;
114 }
115
117 Scalar temperature() const
118 { return 273.15 + 10; } // 10C
119
121 PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
122 { return initialAtPos(globalPos); }
123
125 PrimaryVariables initialAtPos(const GlobalPosition& globalPos) const
126 { return PrimaryVariables(1.0e5); }
127
129 NumEqVector sourceAtPos(const GlobalPosition& globalPos) const
130 {
131 static const Scalar source = getParam<Scalar>("Problem.InjectionRate");
132 if (globalPos[0] > 0.4 && globalPos[0] < 0.6 && globalPos[1] < 0.6 && globalPos[1] > 0.4)
133 return NumEqVector(source);
134 return NumEqVector(0.0);
135 }
136
143 BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const
144 {
145 BoundaryTypes values;
146 values.setAllDirichlet();
147 return values;
148 }
149
150private:
151 static constexpr Scalar eps_ = 1.0e-6;
152 std::string problemName_;
153};
154
155} // end namespace Dumux
156
157#endif
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
Base class for all finite-volume problems.
Definition: common/fvproblem.hh:50
const std::string & paramGroup() const
The parameter group in which to retrieve runtime parameters.
Definition: common/fvproblem.hh:592
NumEqVector source(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolume &scv) const
Evaluate the source term for all phases within a given sub-control-volume.
Definition: common/fvproblem.hh:327
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
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 component which returns run time specified values for all fluid properties.
Definition: constant.hh:58
A liquid phase consisting of a single component.
Definition: 1pliquid.hh:46
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
Definition: multidomain/boundary/darcydarcy/1p_1p/main.cc:66
std::tuple< OneP, CCTpfaModel > InheritsFrom
Definition: multidomain/boundary/darcydarcy/1p_1p/main.cc:66
FullDomainGrid type
Definition: multidomain/boundary/darcydarcy/1p_1p/main.cc:90
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: multidomain/poromechanics/el1p/problem_1p.hh:71
GetPropType< TypeTag, Properties::GridGeometry > GridGeometry
Definition: multidomain/poromechanics/el1p/problem_1p.hh:70
GetPropType< TypeTag, Properties::CouplingManager > CouplingManager
Definition: multidomain/poromechanics/el1p/problem_1p.hh:72
The spatial parameters class for the test problem using the incompressible 1p model.
Definition: multidomain/boundary/darcydarcy/1p_1p/spatialparams.hh:62
The spatial parameters class for the test problem using the 1p cc model.
Definition: multidomain/boundary/stokesdarcy/1p2c_1p2c/spatialparams.hh:41
The single-phase sub problem in the el1p coupled problem.
Definition: multidomain/poromechanics/el1p/problem_1p.hh:83
BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const
Specifies which kind of boundary condition should be used for which equation on a given boundary segm...
Definition: multidomain/poromechanics/el1p/problem_1p.hh:143
OnePSubProblem(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< GetPropType< TypeTag, Properties::SpatialParams > > spatialParams, const std::string &paramGroup="OneP")
Definition: multidomain/poromechanics/el1p/problem_1p.hh:100
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
Evaluates the initial value for a control volume.
Definition: multidomain/poromechanics/el1p/problem_1p.hh:125
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
Evaluates the boundary conditions for a Dirichlet boundary segment.
Definition: multidomain/poromechanics/el1p/problem_1p.hh:121
const std::string & name() const
The problem name.
Definition: multidomain/poromechanics/el1p/problem_1p.hh:111
NumEqVector sourceAtPos(const GlobalPosition &globalPos) const
Evaluates source terms.
Definition: multidomain/poromechanics/el1p/problem_1p.hh:129
Scalar temperature() const
Returns the temperature within the domain in [K].
Definition: multidomain/poromechanics/el1p/problem_1p.hh:117
A single-phase, isothermal flow model using the fully implicit scheme.
Base class for all porous media problems.
The spatial parameters for the incompressible test.