3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
problem_1p_bulk.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 *****************************************************************************/
26#ifndef DUMUX_TEST_TPFAFACETCOUPLING_TRACER_ONEP_BULKPROBLEM_HH
27#define DUMUX_TEST_TPFAFACETCOUPLING_TRACER_ONEP_BULKPROBLEM_HH
28
29#include <dune/alugrid/grid.hh>
30
33
37
40
41#include "spatialparams_1p.hh"
42
43namespace Dumux {
44// forward declarations
45template<class TypeTag> class OnePBulkProblem;
46
47namespace Properties {
48// create the type tag nodes
49// Create new type tags
50namespace TTag {
51struct OnePBulk { using InheritsFrom = std::tuple<OneP>; };
52struct OnePBulkTpfa { using InheritsFrom = std::tuple<CCTpfaFacetCouplingModel, OnePBulk>; };
53struct OnePBulkMpfa { using InheritsFrom = std::tuple<CCMpfaFacetCouplingModel, OnePBulk>; };
54struct OnePBulkBox { using InheritsFrom = std::tuple<BoxFacetCouplingModel, OnePBulk>; };
55} // end namespace TTag
56
57// Set the grid type
58template<class TypeTag>
59struct Grid<TypeTag, TTag::OnePBulk> { using type = Dune::ALUGrid<2, 2, Dune::simplex, Dune::conforming>; };
60// Set the problem type
61template<class TypeTag>
62struct Problem<TypeTag, TTag::OnePBulk> { using type = OnePBulkProblem<TypeTag>; };
63// set the spatial params
64template<class TypeTag>
65struct SpatialParams<TypeTag, TTag::OnePBulk>
66{
69};
70
71// the fluid system
72template<class TypeTag>
73struct FluidSystem<TypeTag, TTag::OnePBulk>
74{
75private:
77public:
79};
80
81} // end namespace Properties
82
88template<class TypeTag>
90{
92
94 using PrimaryVariables = typename GridVariables::PrimaryVariables;
95 using Scalar = typename GridVariables::Scalar;
96
97 using GridGeometry = typename GridVariables::GridGeometry;
98 using FVElementGeometry = typename GridGeometry::LocalView;
99 using SubControlVolume = typename GridGeometry::SubControlVolume;
100 using SubControlVolumeFace = typename GridGeometry::SubControlVolumeFace;
101 using GridView = typename GridGeometry::GridView;
102 using Element = typename GridView::template Codim<0>::Entity;
103 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
104
109
110public:
111 OnePBulkProblem(std::shared_ptr<const GridGeometry> gridGeometry,
112 std::shared_ptr<typename ParentType::SpatialParams> spatialParams,
113 std::shared_ptr<CouplingManager> couplingManager,
114 const std::string& paramGroup = "")
116 , couplingManagerPtr_(couplingManager)
117 , overPressure_(getParamFromGroup<Scalar>(paramGroup, "Problem.BoundaryOverpressure"))
118 {
119 problemName_ = getParamFromGroup<std::string>(this->paramGroup(), "Vtk.OutputName") + "_" +
120 getParamFromGroup<std::string>(this->paramGroup(), "Problem.Name");
121 }
122
124 const std::string& name() const
125 { return problemName_; }
126
128 BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const
129 {
130 BoundaryTypes values;
131 values.setAllNeumann();
132 if (globalPos[0] < 1e-6 || globalPos[0] > this->gridGeometry().bBoxMax()[0] - 1e-6)
133 values.setAllDirichlet();
134 return values;
135 }
136
138 BoundaryTypes interiorBoundaryTypes(const Element& element, const SubControlVolumeFace& scvf) const
139 {
140 BoundaryTypes values;
141 values.setAllNeumann();
142 return values;
143 }
144
146 NumEqVector sourceAtPos(const GlobalPosition& globalPos) const
147 { return NumEqVector(0.0); }
148
150 PrimaryVariables dirichletAtPos(const GlobalPosition& globalPos) const
151 {
152 auto values = initialAtPos(globalPos);
153 if (globalPos[0] < 1e-6)
154 values[Indices::pressureIdx] += overPressure_;
155 return values;
156 }
157
159 NumEqVector neumannAtPos(const GlobalPosition& globalPos) const
160 { return NumEqVector(0.0); }
161
163 PrimaryVariables initialAtPos(const GlobalPosition& globalPos) const
164 { return PrimaryVariables(1.0e5); }
165
167 Scalar temperature() const
168 { return 283.15; /*10°*/ }
169
171 const CouplingManager& couplingManager() const
172 { return *couplingManagerPtr_; }
173
174private:
175 std::shared_ptr<CouplingManager> couplingManagerPtr_;
176 Scalar overPressure_;
177 std::string problemName_;
178};
179
180} // end namespace Dumux
181
182#endif
A much simpler (and thus potentially less buggy) version of pure water.
A liquid phase consisting of a single component.
T getParamFromGroup(Args &&... args)
A free function to get a parameter from the parameter tree singleton with a model group.
Definition: parameters.hh:438
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
const GridGeometry & gridGeometry() const
The finite volume grid geometry.
Definition: common/fvproblem.hh:588
Property to specify the type of scalar values.
Definition: common/properties.hh:53
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 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
The spatial parameters class for the test problem using the 1p cc model.
Definition: multidomain/boundary/stokesdarcy/1p2c_1p2c/spatialparams.hh:41
Test problem for the incompressible one-phase model with coupling across the bulk grid facets.
Definition: problem_1p_bulk.hh:90
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
Evaluates the Dirichlet boundary condition for a given position.
Definition: problem_1p_bulk.hh:150
NumEqVector sourceAtPos(const GlobalPosition &globalPos) const
Evaluates the source term at a given position.
Definition: problem_1p_bulk.hh:146
const std::string & name() const
The problem name.
Definition: problem_1p_bulk.hh:124
BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const
Specifies the type of boundary condition at a given position.
Definition: problem_1p_bulk.hh:128
BoundaryTypes interiorBoundaryTypes(const Element &element, const SubControlVolumeFace &scvf) const
Specifies the type of interior boundary condition at a given position.
Definition: problem_1p_bulk.hh:138
NumEqVector neumannAtPos(const GlobalPosition &globalPos) const
Evaluates the Neumann boundary condition for a boundary segment.
Definition: problem_1p_bulk.hh:159
OnePBulkProblem(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< typename ParentType::SpatialParams > spatialParams, std::shared_ptr< CouplingManager > couplingManager, const std::string &paramGroup="")
Definition: problem_1p_bulk.hh:111
Scalar temperature() const
Returns the temperature in in the domain.
Definition: problem_1p_bulk.hh:167
const CouplingManager & couplingManager() const
Returns reference to the coupling manager.
Definition: analytical/problem_bulk.hh:207
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
Evaluates the initial conditions.
Definition: analytical/problem_bulk.hh:199
Definition: analytical/problem_bulk.hh:49
std::tuple< OneP > InheritsFrom
Definition: analytical/problem_bulk.hh:49
Definition: analytical/problem_bulk.hh:50
std::tuple< CCTpfaFacetCouplingModel, OnePBulk > InheritsFrom
Definition: analytical/problem_bulk.hh:50
Definition: analytical/problem_bulk.hh:51
std::tuple< BoxFacetCouplingModel, OnePBulk > InheritsFrom
Definition: analytical/problem_bulk.hh:51
Dune::ALUGrid< 2, 2, Dune::cube, Dune::nonconforming > type
Definition: analytical/problem_bulk.hh:56
Definition: gravity/problem_bulk.hh:55
std::tuple< CCMpfaFacetCouplingModel, OnePBulk > InheritsFrom
Definition: gravity/problem_bulk.hh:55
Properties (and default properties) for all models using the box scheme together with coupling across...
Properties (and default properties) for all models using cell-centered finite volume scheme with MPFA...
Properties (and default properties) for all models using cell-centered finite volume scheme with TPFA...
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.