3.6-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
porenetwork/common/spatialparams.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_PNM_SPATIAL_PARAMS_HH
26#define DUMUX_PNM_SPATIAL_PARAMS_HH
27
28#include <type_traits>
29#include <memory>
30
31#include <dune/common/fvector.hh>
34
35namespace Dumux::PoreNetwork {
36
42template<class GridGeometry, class Scalar, class Implementation>
44: public FVPorousMediumFlowSpatialParams<GridGeometry, Scalar, Implementation>
45{
47 using GridView = typename GridGeometry::GridView;
48 using SubControlVolume = typename GridGeometry::SubControlVolume;
49 using Element = typename GridView::template Codim<0>::Entity;
50
51 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
52 static constexpr auto dimWorld = GridView::dimensionworld;
53
54public:
55 using PermeabilityType = Scalar;
56
57 SpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
59 {}
60
68 template<class ElementVolumeVariables>
69 Scalar throatLength(const Element& element,
70 const ElementVolumeVariables& elemVolVars) const
71 {
72 const auto eIdx = this->gridGeometry().elementMapper().index(element);
73 return this->gridGeometry().throatLength(eIdx);
74 }
75
83 template<class ElementVolumeVariables>
84 Scalar throatInscribedRadius(const Element& element,
85 const ElementVolumeVariables& elemVolVars) const
86 {
87 const auto eIdx = this->gridGeometry().elementMapper().index(element);
88 return this->gridGeometry().throatInscribedRadius(eIdx);
89 }
90
98 template<class ElementVolumeVariables>
99 Scalar throatCrossSectionalArea(const Element& element,
100 const ElementVolumeVariables& elemVolVars) const
101 {
102 const auto eIdx = this->gridGeometry().elementMapper().index(element);
103 return this->gridGeometry().throatCrossSectionalArea(eIdx);
104 }
105
114 template<class ElementSolutionVector>
115 Scalar poreInscribedRadius(const Element& element,
116 const SubControlVolume& scv,
117 const ElementSolutionVector& elemSol) const
118 { return this->gridGeometry().poreInscribedRadius(scv.dofIndex()); }
119
123 const GridView& gridView() const
124 { return this->gridGeometry().gridView(); }
125
127 Scalar permeabilityAtPos(const GlobalPosition& globalPos) const
128 { return 1.0; }
129
131 Scalar porosityAtPos(const GlobalPosition& globalPos) const
132 { return 1.0; }
133
134};
135
136} // namespace Dumux::PoreNetwork
137
138#endif
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.
Definition: discretization/porenetwork/fvelementgeometry.hh:34
The base class for spatial parameters used with finite-volume schemes.
Definition: common/fvspatialparams.hh:46
const GridGeometry & gridGeometry() const
The finite volume grid geometry.
Definition: common/fvspatialparams.hh:142
The base class for spatial parameters for pore-network models.
Definition: porenetwork/common/spatialparams.hh:45
Scalar throatInscribedRadius(const Element &element, const ElementVolumeVariables &elemVolVars) const
Inscribed radius of the throat . Can be solution-dependent.
Definition: porenetwork/common/spatialparams.hh:84
Scalar throatLength(const Element &element, const ElementVolumeVariables &elemVolVars) const
Length of the throat . Can be solution-dependent.
Definition: porenetwork/common/spatialparams.hh:69
Scalar poreInscribedRadius(const Element &element, const SubControlVolume &scv, const ElementSolutionVector &elemSol) const
Inscribed radius of the pore body . Can be solution-dependent.
Definition: porenetwork/common/spatialparams.hh:115
Scalar permeabilityAtPos(const GlobalPosition &globalPos) const
Required for compatibility reasons with porous medium-flow models.
Definition: porenetwork/common/spatialparams.hh:127
const GridView & gridView() const
Returns a reference to the gridview.
Definition: porenetwork/common/spatialparams.hh:123
Scalar throatCrossSectionalArea(const Element &element, const ElementVolumeVariables &elemVolVars) const
Cross-sectional area of the throat . Can be solution-dependent.
Definition: porenetwork/common/spatialparams.hh:99
SpatialParams(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: porenetwork/common/spatialparams.hh:57
Scalar porosityAtPos(const GlobalPosition &globalPos) const
Required for compatibility reasons with porous medium-flow models.
Definition: porenetwork/common/spatialparams.hh:131
Scalar PermeabilityType
Definition: porenetwork/common/spatialparams.hh:55
The base class for spatial parameters of porous-medium-flow problems.
Definition: porousmediumflow/fvspatialparams.hh:58
The base class for spatial parameters in porous-medium-flow problems.