3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
problem_facet.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_FACETCOUPLING_THREEDOMAIN_ONEP_FACETPROBLEM_HH
27#define DUMUX_TEST_FACETCOUPLING_THREEDOMAIN_ONEP_FACETPROBLEM_HH
28
29#include <dune/foamgrid/foamgrid.hh>
30
33
39
40#include "spatialparams.hh"
41
42namespace Dumux {
43// forward declarations
44template<class TypeTag> class OnePFacetProblem;
45
46namespace Properties {
47// create the type tag nodes
48// Create new type tags
49namespace TTag {
50struct OnePFacet { using InheritsFrom = std::tuple<OneP>; };
51struct OnePFacetTpfa { using InheritsFrom = std::tuple<CCTpfaFacetCouplingModel, OnePFacet>; };
52struct OnePFacetMpfa { using InheritsFrom = std::tuple<CCMpfaFacetCouplingModel, OnePFacet>; };
53struct OnePFacetBox { using InheritsFrom = std::tuple<BoxFacetCouplingModel, OnePFacet>; };
54} // end namespace TTag
55
56// Set the grid type
57template<class TypeTag>
58struct Grid<TypeTag, TTag::OnePFacet> { using type = Dune::FoamGrid<2, 3>; };
59// Set the problem type
60template<class TypeTag>
61struct Problem<TypeTag, TTag::OnePFacet> { using type = OnePFacetProblem<TypeTag>; };
62// set the spatial params
63template<class TypeTag>
64struct SpatialParams<TypeTag, TTag::OnePFacet>
65{
69};
70
71// the fluid system
72template<class TypeTag>
73struct FluidSystem<TypeTag, TTag::OnePFacet>
74{
75private:
77public:
79};
80
81} // end namespace Properties
82
88template<class TypeTag>
90{
92
95 using ElementVolumeVariables = typename GridVariables::GridVolumeVariables::LocalView;
96 using PrimaryVariables = typename GridVariables::PrimaryVariables;
97 using Scalar = typename GridVariables::Scalar;
98
99 using GridGeometry = typename GridVariables::GridGeometry;
100 using FVElementGeometry = typename GridGeometry::LocalView;
101 using SubControlVolume = typename GridGeometry::SubControlVolume;
102 using SubControlVolumeFace = typename GridGeometry::SubControlVolumeFace;
103 using GridView = typename GridGeometry::GridView;
104 using Element = typename GridView::template Codim<0>::Entity;
105 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
106
109
110public:
111 OnePFacetProblem(std::shared_ptr<const GridGeometry> gridGeometry,
112 std::shared_ptr<typename ParentType::SpatialParams> spatialParams,
113 std::shared_ptr<CouplingManager> couplingManagerPtr,
114 const std::string& paramGroup = "Facet")
116 , couplingManagerPtr_(couplingManagerPtr)
117 , aperture_(getParam<Scalar>("Extrusion.Aperture"))
118 {
119 problemName_ = getParam<std::string>("Vtk.OutputName") + "_" + getParamFromGroup<std::string>(this->paramGroup(), "Problem.Name");
120 }
121
125 const std::string& name() const
126 {
127 return problemName_;
128 }
129
131 BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const
132 {
133 BoundaryTypes values;
134 values.setAllNeumann();
135 return values;
136 }
137
146 BoundaryTypes interiorBoundaryTypes(const Element& element, const SubControlVolumeFace& scvf) const
147 {
148 BoundaryTypes values;
149 values.setAllNeumann();
150 return values;
151 }
152
157 NumEqVector source(const Element& element,
158 const FVElementGeometry& fvGeometry,
159 const ElementVolumeVariables& elemVolVars,
160 const SubControlVolume& scv) const
161 {
162 // forward to solution independent, fully-implicit specific interface
163 auto source = couplingManagerPtr_->evalSourcesFromBulk(element, fvGeometry, elemVolVars, scv);
164 source /= scv.volume()*elemVolVars[scv].extrusionFactor();
165 return source;
166 }
167
169 Scalar extrusionFactorAtPos(const GlobalPosition& globalPos) const
170 { return aperture_; }
171
173 PrimaryVariables initialAtPos(const GlobalPosition& globalPos) const
174 { return PrimaryVariables(1.0); }
175
177 Scalar temperature() const
178 { return 283.15; /*10°*/ }
179
181 const CouplingManager& couplingManager() const
182 { return *couplingManagerPtr_; }
183
184private:
185 std::shared_ptr<CouplingManager> couplingManagerPtr_;
186 std::string problemName_;
187 Scalar aperture_;
188};
189
190} // end namespace Dumux
191
192#endif
Setting constant fluid properties via the input file.
A liquid phase consisting of a single component.
T getParam(Args &&... args)
A free function to get a parameter from the parameter tree singleton.
Definition: parameters.hh:428
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
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
The (d-1)-dimensional test problem for the incompressible one-phase model with coupling across the bu...
Definition: problem_facet.hh:90
const CouplingManager & couplingManager() const
Returns const reference to the coupling manager.
Definition: problem_facet.hh:181
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
Evaluates the initial conditions.
Definition: problem_facet.hh:173
Scalar temperature() const
Returns the temperature for an isothermal problem.
Definition: problem_facet.hh:177
const std::string & name() const
The problem name.
Definition: problem_facet.hh:125
NumEqVector source(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolume &scv) const
Evaluates the source term for all phases within a given sub-control volume.
Definition: problem_facet.hh:157
BoundaryTypes interiorBoundaryTypes(const Element &element, const SubControlVolumeFace &scvf) const
Specifies which kind of interior boundary condition should be used for which equation on a given sub-...
Definition: problem_facet.hh:146
OnePFacetProblem(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< typename ParentType::SpatialParams > spatialParams, std::shared_ptr< CouplingManager > couplingManagerPtr, const std::string &paramGroup="Facet")
Definition: problem_facet.hh:111
BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const
Specifies the kind of boundary condition at a boundary position.
Definition: problem_facet.hh:131
Scalar extrusionFactorAtPos(const GlobalPosition &globalPos) const
Sets the aperture as extrusion factor.
Definition: problem_facet.hh:169
Definition: problem_facet.hh:50
std::tuple< OneP > InheritsFrom
Definition: problem_facet.hh:50
Definition: problem_facet.hh:51
std::tuple< CCTpfaFacetCouplingModel, OnePFacet > InheritsFrom
Definition: problem_facet.hh:51
Definition: problem_facet.hh:52
std::tuple< CCMpfaFacetCouplingModel, OnePFacet > InheritsFrom
Definition: problem_facet.hh:52
Definition: problem_facet.hh:53
std::tuple< BoxFacetCouplingModel, OnePFacet > InheritsFrom
Definition: problem_facet.hh:53
Dune::FoamGrid< 2, 3 > type
Definition: problem_facet.hh:58
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: problem_facet.hh:67
GetPropType< TypeTag, Properties::GridGeometry > GridGeometry
Definition: problem_facet.hh:66
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.
Definition of the spatial parameters for the MaxwellStefan problem.