version 3.8
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// SPDX-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
13#ifndef DUMUX_PNM_SPATIAL_PARAMS_HH
14#define DUMUX_PNM_SPATIAL_PARAMS_HH
15
16#include <type_traits>
17#include <memory>
18
19#include <dune/common/fvector.hh>
22
23namespace Dumux::PoreNetwork {
24
30template<class GridGeometry, class Scalar, class Implementation>
32: public FVPorousMediumFlowSpatialParams<GridGeometry, Scalar, Implementation>
33{
35 using GridView = typename GridGeometry::GridView;
36 using SubControlVolume = typename GridGeometry::SubControlVolume;
37 using Element = typename GridView::template Codim<0>::Entity;
38
39 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
40 static constexpr auto dimWorld = GridView::dimensionworld;
41
42public:
43 using PermeabilityType = Scalar;
44
45 SpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
47 {}
48
56 template<class ElementVolumeVariables>
57 Scalar throatLength(const Element& element,
58 const ElementVolumeVariables& elemVolVars) const
59 {
60 const auto eIdx = this->gridGeometry().elementMapper().index(element);
61 return this->gridGeometry().throatLength(eIdx);
62 }
63
71 template<class ElementVolumeVariables>
72 Scalar throatInscribedRadius(const Element& element,
73 const ElementVolumeVariables& elemVolVars) const
74 {
75 const auto eIdx = this->gridGeometry().elementMapper().index(element);
76 return this->gridGeometry().throatInscribedRadius(eIdx);
77 }
78
86 template<class ElementVolumeVariables>
87 Scalar throatCrossSectionalArea(const Element& element,
88 const ElementVolumeVariables& elemVolVars) const
89 {
90 const auto eIdx = this->gridGeometry().elementMapper().index(element);
91 return this->gridGeometry().throatCrossSectionalArea(eIdx);
92 }
93
102 template<class ElementSolutionVector>
103 Scalar poreInscribedRadius(const Element& element,
104 const SubControlVolume& scv,
105 const ElementSolutionVector& elemSol) const
106 { return this->gridGeometry().poreInscribedRadius(scv.dofIndex()); }
107
111 const GridView& gridView() const
112 { return this->gridGeometry().gridView(); }
113
115 Scalar permeabilityAtPos(const GlobalPosition& globalPos) const
116 { return 1.0; }
117
119 Scalar porosityAtPos(const GlobalPosition& globalPos) const
120 { return 1.0; }
121
122};
123
124} // namespace Dumux::PoreNetwork
125
126#endif
The base class for spatial parameters of porous-medium-flow problems.
Definition: porousmediumflow/fvspatialparams.hh:46
The base class for spatial parameters used with finite-volume schemes.
Definition: common/fvspatialparams.hh:34
const GridGeometry & gridGeometry() const
The finite volume grid geometry.
Definition: common/fvspatialparams.hh:130
The base class for spatial parameters for pore-network models.
Definition: porenetwork/common/spatialparams.hh:33
Scalar throatInscribedRadius(const Element &element, const ElementVolumeVariables &elemVolVars) const
Inscribed radius of the throat . Can be solution-dependent.
Definition: porenetwork/common/spatialparams.hh:72
Scalar throatLength(const Element &element, const ElementVolumeVariables &elemVolVars) const
Length of the throat . Can be solution-dependent.
Definition: porenetwork/common/spatialparams.hh:57
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:103
Scalar permeabilityAtPos(const GlobalPosition &globalPos) const
Required for compatibility reasons with porous medium-flow models.
Definition: porenetwork/common/spatialparams.hh:115
const GridView & gridView() const
Returns a reference to the gridview.
Definition: porenetwork/common/spatialparams.hh:111
Scalar throatCrossSectionalArea(const Element &element, const ElementVolumeVariables &elemVolVars) const
Cross-sectional area of the throat . Can be solution-dependent.
Definition: porenetwork/common/spatialparams.hh:87
SpatialParams(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: porenetwork/common/spatialparams.hh:45
Scalar porosityAtPos(const GlobalPosition &globalPos) const
Required for compatibility reasons with porous medium-flow models.
Definition: porenetwork/common/spatialparams.hh:119
Scalar PermeabilityType
Definition: porenetwork/common/spatialparams.hh:43
Definition: discretization/porenetwork/fvelementgeometry.hh:24
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.
The base class for spatial parameters in porous-medium-flow problems.