3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
porousmediumflow/co2/implicit/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 *****************************************************************************/
27#ifndef DUMUX_HETEROGENEOUS_SPATIAL_PARAMS_HH
28#define DUMUX_HETEROGENEOUS_SPATIAL_PARAMS_HH
29
34
36
37namespace Dumux {
38
45template<class GridGeometry, class Scalar>
47: public FVSpatialParams<GridGeometry,
48 Scalar,
49 HeterogeneousSpatialParams<GridGeometry, Scalar>>
50{
51 using Grid = typename GridGeometry::Grid;
52 using GridView = typename GridGeometry::GridView;
53 using FVElementGeometry = typename GridGeometry::LocalView;
54 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
55 using Element = typename GridView::template Codim<0>::Entity;
57
58 using GlobalPosition = typename SubControlVolume::GlobalPosition;
59
61
62public:
65 using PermeabilityType = Scalar;
66
67 HeterogeneousSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry,
68 std::shared_ptr<const GridData<Grid>> gridData)
69 : ParentType(gridGeometry), gridData_(gridData)
70 {
71
72 // Set the permeability for the layers
73 barrierTopK_ = 1e-17; //sqm
74 barrierMiddleK_ = 1e-15; //sqm
75 reservoirK_ = 1e-14; //sqm
76
77 // Set the effective porosity of the layers
78 barrierTopPorosity_ = 0.001;
79 barrierMiddlePorosity_ = 0.05;
80 reservoirPorosity_ = 0.2;
81
82 // Same material parameters for every layer
83 materialParams_.setSwr(0.2);
84 materialParams_.setSwr(0.05);
85 materialParams_.setLambda(2.0);
86 materialParams_.setPe(1e4);
87 }
88
93 {
94 const auto& gridView = this->gridGeometry().gridView();
95 paramIdx_.resize(gridView.size(0));
96
97 for (const auto& element : elements(gridView))
98 {
99 const auto eIdx = this->gridGeometry().elementMapper().index(element);
100 paramIdx_[eIdx] = gridData_->parameters(element)[0];
101 }
102 }
103
114 template<class ElementSolution>
115 PermeabilityType permeability(const Element& element,
116 const SubControlVolume& scv,
117 const ElementSolution& elemSol) const
118 {
119 // Get the global index of the element
120 const auto eIdx = this->gridGeometry().elementMapper().index(element);
121 return permeability(eIdx);
122 }
123
130 PermeabilityType permeability(std::size_t eIdx) const
131 {
132 if (paramIdx_[eIdx] == barrierTop_)
133 return barrierTopK_;
134 else if (paramIdx_[eIdx] == barrierMiddle_)
135 return barrierMiddleK_;
136 else
137 return reservoirK_;
138 }
139
149 template<class SolidSystem, class ElementSolution>
150 Scalar inertVolumeFraction(const Element& element,
151 const SubControlVolume& scv,
152 const ElementSolution& elemSol,
153 int compIdx) const
154 {
155 // Get the global index of the element
156 const auto eIdx = this->gridGeometry().elementMapper().index(element);
157 return inertVolumeFraction(eIdx);
158 }
159
165 Scalar inertVolumeFraction(std::size_t eIdx) const
166 {
167 if (paramIdx_[eIdx] == barrierTop_)
168 return 1- barrierTopPorosity_;
169 else if (paramIdx_[eIdx] == barrierMiddle_)
170 return 1- barrierMiddlePorosity_;
171 else
172 return 1- reservoirPorosity_;
173
174 }
175
176
183 const MaterialLawParams& materialLawParamsAtPos(const GlobalPosition& globalPos) const
184 {
185 return materialParams_;
186 }
187
194 template<class FluidSystem>
195 int wettingPhaseAtPos(const GlobalPosition& globalPos) const
196 { return FluidSystem::BrineIdx; }
197
198private:
199
200 std::shared_ptr<const GridData<Grid>> gridData_;
201
202 int barrierTop_ = 1;
203 int barrierMiddle_ = 2;
204 int reservoir_ = 3;
205
206 Scalar barrierTopPorosity_;
207 Scalar barrierMiddlePorosity_;
208 Scalar reservoirPorosity_;
209
210 Scalar barrierTopK_;
211 Scalar barrierMiddleK_;
212 Scalar reservoirK_;
213
214 MaterialLawParams materialParams_;
215 std::vector<int> paramIdx_;
216};
217
218} // end namespace Dumux
219
220#endif
Class for grid data attached to dgf or gmsh grid files.
Implementation of a regularized version of the Brooks-Corey capillary pressure / relative permeabilit...
The base class for spatial parameters of multi-phase problems using a fully implicit discretization m...
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
Class for grid data attached to dgf or gmsh grid files.
Definition: griddata.hh:66
This material law takes a material law defined for effective saturations and converts it to a materia...
Definition: 2p/efftoabslaw.hh:60
AbsParamsT Params
Definition: 2p/efftoabslaw.hh:64
Implementation of the regularized Brooks-Corey capillary pressure / relative permeability <-> saturat...
Definition: regularizedbrookscorey.hh:62
The base class for spatial parameters of multi-phase problems using a fully implicit discretization m...
Definition: fv.hh:57
const GridGeometry & gridGeometry() const
The finite volume grid geometry.
Definition: fv1p.hh:334
Definition of the spatial parameters for the heterogeneous problem which uses the non-isothermal or i...
Definition: porousmediumflow/co2/implicit/spatialparams.hh:50
Scalar inertVolumeFraction(std::size_t eIdx) const
Returns the porosity .
Definition: porousmediumflow/co2/implicit/spatialparams.hh:165
int wettingPhaseAtPos(const GlobalPosition &globalPos) const
Function for defining which phase is to be considered as the wetting phase.
Definition: porousmediumflow/co2/implicit/spatialparams.hh:195
PermeabilityType permeability(const Element &element, const SubControlVolume &scv, const ElementSolution &elemSol) const
Function for defining the (intrinsic) permeability .
Definition: porousmediumflow/co2/implicit/spatialparams.hh:115
Scalar PermeabilityType
Definition: porousmediumflow/co2/implicit/spatialparams.hh:65
Scalar inertVolumeFraction(const Element &element, const SubControlVolume &scv, const ElementSolution &elemSol, int compIdx) const
Returns the volume fraction of the inert component with index compIdx .
Definition: porousmediumflow/co2/implicit/spatialparams.hh:150
typename MaterialLaw::Params MaterialLawParams
Definition: porousmediumflow/co2/implicit/spatialparams.hh:64
HeterogeneousSpatialParams(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< const GridData< Grid > > gridData)
Definition: porousmediumflow/co2/implicit/spatialparams.hh:67
const MaterialLawParams & materialLawParamsAtPos(const GlobalPosition &globalPos) const
Function for defining the parameters needed by constitutive relationships (kr-sw, pc-sw,...
Definition: porousmediumflow/co2/implicit/spatialparams.hh:183
void getParamsFromGrid()
Reads layer information from the grid.
Definition: porousmediumflow/co2/implicit/spatialparams.hh:92
PermeabilityType permeability(std::size_t eIdx) const
Function for defining the (intrinsic) permeability .
Definition: porousmediumflow/co2/implicit/spatialparams.hh:130
Adaption of the fully implicit scheme to the CO2Model model.
This material law takes a material law defined for effective saturations and converts it to a materia...