3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
multidomain/poromechanics/el1p/spatialparams_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 *****************************************************************************/
26#ifndef DUMUX_1P_TEST_SPATIALPARAMS_HH
27#define DUMUX_1P_TEST_SPATIALPARAMS_HH
28
30
34
35namespace Dumux {
36
42template<class GridGeometry, class Scalar, class CouplingManager>
43class OnePSpatialParams : public FVSpatialParamsOneP<GridGeometry, Scalar,
44 OnePSpatialParams<GridGeometry, Scalar, CouplingManager>>
45{
46 using SubControlVolume = typename GridGeometry::SubControlVolume;
47 using GridView = typename GridGeometry::GridView;
48 using Element = typename GridView::template Codim<0>::Entity;
49 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
50
51 using ThisType = OnePSpatialParams<GridGeometry, Scalar, CouplingManager>;
52 using ParentType = FVSpatialParamsOneP<GridGeometry, Scalar, ThisType>;
53
54public:
55 // export permeability type
56 using PermeabilityType = Scalar;
57
58 OnePSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry,
59 std::shared_ptr<CouplingManager> couplingManagerPtr)
61 , couplingManagerPtr_(couplingManagerPtr)
62 , permeability_(getParam<Scalar>("SpatialParams.Permeability"))
63 , initPorosity_(getParam<Scalar>("SpatialParams.InitialPorosity"))
64 {}
65
67 PermeabilityType permeabilityAtPos(const GlobalPosition& globalPoss) const
68 { return permeability_; }
69
71 template<class ElementSolution>
72 Scalar porosity(const Element& element,
73 const SubControlVolume& scv,
74 const ElementSolution& elemSol) const
75 {
76 static constexpr auto poroMechId = CouplingManager::poroMechId;
77
78 const auto& poroMechGridGeom = couplingManagerPtr_->problem(poroMechId).gridGeometry();
79 const auto poroMechElemSol = elementSolution(element, couplingManagerPtr_->curSol()[poroMechId], poroMechGridGeom);
80
81 // evaluate the deformation-dependent porosity at the scv center
82 return PorosityDeformation<Scalar>::evaluatePorosity(poroMechGridGeom, element, scv.center(), poroMechElemSol, initPorosity_);
83 }
84
87 { return *couplingManagerPtr_; }
88
89private:
90 std::shared_ptr<const CouplingManager> couplingManagerPtr_;
91 Scalar permeability_;
92 Scalar initPorosity_;
93};
94
95} // end namespace Dumux
96
97#endif
Element solution classes and factory functions.
A relationship for the porosity of a porous medium under mechanical deformation.
The base class for spatial parameters of one-phase problems using a fully implicit discretization met...
Creating random fields using gstat.
auto elementSolution(const Element &element, const SolutionVector &sol, const GridGeometry &gg) -> std::enable_if_t< GridGeometry::discMethod==DiscretizationMethod::box, BoxElementSolution< typename GridGeometry::LocalView, std::decay_t< decltype(std::declval< SolutionVector >()[0])> > >
Make an element solution for box schemes.
Definition: box/elementsolution.hh:115
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
static Scalar evaluatePorosity(const FVGridGeom &gridGeometry, const typename FVGridGeom::GridView::template Codim< 0 >::Entity &element, const typename FVGridGeom::GridView::template Codim< 0 >::Entity::Geometry::GlobalCoordinate &globalPos, const ElemSol &elemSol, Scalar refPoro, Scalar minPoro=0.0, Scalar maxPoro=1.0)
Calculates the porosity at a position inside an element.
Definition: porositydeformation.hh:65
const GridGeometry & gridGeometry() const
The finite volume grid geometry.
Definition: fv1p.hh:334
Definition: multidomain/couplingmanager.hh:46
PermeabilityType permeabilityAtPos(const GlobalPosition &globalPoss) const
Returns the permeability at a given position.
Definition: multidomain/poromechanics/el1p/spatialparams_1p.hh:67
Scalar porosity(const Element &element, const SubControlVolume &scv, const ElementSolution &elemSol) const
Returns the porosity for a sub-control volume.
Definition: multidomain/poromechanics/el1p/spatialparams_1p.hh:72
OnePSpatialParams(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< CouplingManager > couplingManagerPtr)
Definition: multidomain/poromechanics/el1p/spatialparams_1p.hh:58
Scalar PermeabilityType
Definition: multidomain/boundary/stokesdarcy/1p2c_1p2c/spatialparams.hh:51
const CouplingManager & couplingManager() const
Returns reference to the coupling manager.
Definition: multidomain/poromechanics/el1p/spatialparams_1p.hh:86