3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
porousmediumflow/mpnc/implicit/thermalnonequilibrium/spatialparams.hh
Go to the documentation of this file.
1/*****************************************************************************
2 * Institute for Modelling Hydraulic and Environmental Systems *
3 * University of Stuttgart, Germany *
4 * email: <givenname>.<name>@iws.uni-stuttgart.de *
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_COMBUSTION_SPATIALPARAMS_HH
28#define DUMUX_COMBUSTION_SPATIALPARAMS_HH
29
30#include <dune/common/parametertreeparser.hh>
31
39
40namespace Dumux {
41
45template<class GridGeometry, class Scalar>
47: public FVNonEquilibriumSpatialParams<GridGeometry, Scalar,
48 CombustionSpatialParams<GridGeometry, Scalar>>
49{
50 using GridView = typename GridGeometry::GridView;
51 using FVElementGeometry = typename GridGeometry::LocalView;
52 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
53 using Element = typename GridView::template Codim<0>::Entity;
56
57 enum {dimWorld = GridView::dimensionworld};
58 using GlobalPosition = typename SubControlVolume::GlobalPosition;
59
61
62public:
64 using PermeabilityType = Scalar;
69
70 CombustionSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry) : ParentType(gridGeometry)
71 {
72 // this is the parameter value from file part
73 porosity_ = getParam<Scalar>("SpatialParams.PorousMedium.porosity");
74 intrinsicPermeabilityOutFlow_ = getParam<Scalar>("SpatialParams.Outflow.permeabilityOutFlow");
75 porosityOutFlow_ = getParam<Scalar>("SpatialParams.Outflow.porosityOutFlow");
76 interfacialTension_ = getParam<Scalar>("Constants.interfacialTension");
77
78 Swr_ = getParam<Scalar>("SpatialParams.soil.Swr");
79 Snr_ = getParam<Scalar>("SpatialParams.soil.Snr");
80
81 characteristicLength_ =getParam<Scalar>("SpatialParams.PorousMedium.meanPoreSize");
82
83 using std::pow;
84 intrinsicPermeability_ = (pow(characteristicLength_,2.0) * pow(porosity_, 3.0)) / (150.0 * pow((1.0-porosity_),2.0)); // 1.69e-10 ; //
85
86 factorEnergyTransfer_ = getParam<Scalar>("SpatialParams.PorousMedium.factorEnergyTransfer");
87 lengthPM_ = getParam<Scalar>("Grid.lengthPM");
88
89 // residual saturations
90 materialParams_.setSwr(Swr_) ;
91 materialParams_.setSnr(Snr_) ;
92
93 using std::sqrt;
94 materialParams_.setP0(sqrt(porosity_/intrinsicPermeability_));
95 materialParams_.setGamma(interfacialTension_); // interfacial tension of water-air at 100°C
96 }
97
98 template<class ElementSolution>
99 PermeabilityType permeability(const Element& element,
100 const SubControlVolume& scv,
101 const ElementSolution& elemSol) const
102 {
103 const auto& globalPos = scv.dofPosition();
104 if ( inOutFlow(globalPos) )
105 return intrinsicPermeabilityOutFlow_ ;
106 else
107 return intrinsicPermeability_ ;
108 }
109
118 template<class ElementSolution>
119 Scalar porosity(const Element& element,
120 const SubControlVolume& scv,
121 const ElementSolution& elemSol) const
122 {
123 if (inOutFlow(scv.dofPosition()))
124 return porosityOutFlow_;
125 else
126 return porosity_;
127 }
128
138 template<class SolidSystem, class ElementSolution>
139 Scalar inertVolumeFraction(const Element& element,
140 const SubControlVolume& scv,
141 const ElementSolution& elemSol,
142 int compIdx) const
143 {
144 if (compIdx == SolidSystem::comp0Idx)
145 {
146 if (inOutFlow(scv.dofPosition()))
147 return 1.0-porosityOutFlow_;
148 else
149 return 0;
150 }
151 else
152 {
153 if (inOutFlow(scv.dofPosition()))
154 return 0;
155 else
156 return 1.0-porosity_;
157 }
158 }
159
166 template<class FluidSystem>
167 int wettingPhaseAtPos(const GlobalPosition& globalPos) const
168 {
169 return FluidSystem::phase0Idx;
170 }
171
176 const MaterialLawParams& materialLawParamsAtPos(const GlobalPosition & globalPos) const
177 { return materialParams_ ; }
178
183 const Scalar characteristicLengthAtPos(const GlobalPosition & globalPos) const
184 { return characteristicLength_ ; }
185
190 const Scalar factorEnergyTransferAtPos(const GlobalPosition & globalPos) const
191 { return factorEnergyTransfer_; }
192
194 bool inOutFlow(const GlobalPosition & globalPos) const { return globalPos[0] > (lengthPM_ - eps_) ; }
196 Scalar lengthPM() const { return lengthPM_ ; }
198 Scalar interfacialTension() const { return interfacialTension_ ; }
199
200private:
201 static constexpr Scalar eps_ = 1e-6;
202
203 // Porous Medium Domain
204 Scalar intrinsicPermeability_ ;
205 Scalar porosity_ ;
206 Scalar factorEnergyTransfer_ ;
207 Scalar characteristicLength_ ;
208 MaterialLawParams materialParams_ ;
209
210 // Outflow Domain
211 Scalar intrinsicPermeabilityOutFlow_ ;
212 Scalar porosityOutFlow_ ;
213
214 // solid parameters
215 Scalar interfacialTension_ ;
216
217
218 // capillary pressures parameters
219 Scalar Swr_ ;
220 Scalar Snr_ ;
221
222 // grid
223 Scalar lengthPM_ ;
224};
225
226}
227
228#endif // GUARDIAN
Description of a interfacial area between solid and fluid phase.
Implementation of the capillary pressure <-> saturation relation for the heatpipe problem.
Linear capillary pressure and relative permeability <-> saturation relations.
The base class for spatial parameters of multi-phase problems using a fully implicit discretization m...
Base class for spatial parameters dealing with thermal and chemical non-equilibrium.
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
Description of a interfacial area between solid and fluid phase.
Definition: fluidsolidinterfacialareashiwang.hh:35
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 capillary pressure <-> saturation relation for the heatpipe problem.
Definition: heatpipelaw.hh:49
const GridGeometry & gridGeometry() const
The finite volume grid geometry.
Definition: fv1p.hh:334
Definition of the spatial parameters for non-equilibrium.
Definition: fvnonequilibrium.hh:39
Definition of the spatial parameters for the one component combustion problem.
Definition: porousmediumflow/mpnc/implicit/thermalnonequilibrium/spatialparams.hh:49
Scalar porosity(const Element &element, const SubControlVolume &scv, const ElementSolution &elemSol) const
Function for defining the porosity which is possibly solution dependent.
Definition: porousmediumflow/mpnc/implicit/thermalnonequilibrium/spatialparams.hh:119
PermeabilityType permeability(const Element &element, const SubControlVolume &scv, const ElementSolution &elemSol) const
Definition: porousmediumflow/mpnc/implicit/thermalnonequilibrium/spatialparams.hh:99
Scalar interfacialTension() const
Returns the interfacial tension.
Definition: porousmediumflow/mpnc/implicit/thermalnonequilibrium/spatialparams.hh:198
bool inOutFlow(const GlobalPosition &globalPos) const
Returns if the tested position is at the right end of the porous medium.
Definition: porousmediumflow/mpnc/implicit/thermalnonequilibrium/spatialparams.hh:194
const Scalar characteristicLengthAtPos(const GlobalPosition &globalPos) const
Returns the characteristic length for the mass transfer.
Definition: porousmediumflow/mpnc/implicit/thermalnonequilibrium/spatialparams.hh:183
Scalar PermeabilityType
Export the type used for the permeability.
Definition: porousmediumflow/mpnc/implicit/thermalnonequilibrium/spatialparams.hh:64
typename MaterialLaw::Params MaterialLawParams
Definition: porousmediumflow/mpnc/implicit/thermalnonequilibrium/spatialparams.hh:67
int wettingPhaseAtPos(const GlobalPosition &globalPos) const
Function for defining which phase is to be considered as the wetting phase.
Definition: porousmediumflow/mpnc/implicit/thermalnonequilibrium/spatialparams.hh:167
Scalar inertVolumeFraction(const Element &element, const SubControlVolume &scv, const ElementSolution &elemSol, int compIdx) const
Function for defining the porosity which is possibly solution dependent.
Definition: porousmediumflow/mpnc/implicit/thermalnonequilibrium/spatialparams.hh:139
const MaterialLawParams & materialLawParamsAtPos(const GlobalPosition &globalPos) const
Returns a reference to the material parameters of the material law.
Definition: porousmediumflow/mpnc/implicit/thermalnonequilibrium/spatialparams.hh:176
const Scalar factorEnergyTransferAtPos(const GlobalPosition &globalPos) const
Returns the pre factor the the energy transfer.
Definition: porousmediumflow/mpnc/implicit/thermalnonequilibrium/spatialparams.hh:190
Scalar lengthPM() const
Returns the length of the porous medium domain.
Definition: porousmediumflow/mpnc/implicit/thermalnonequilibrium/spatialparams.hh:196
CombustionSpatialParams(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: porousmediumflow/mpnc/implicit/thermalnonequilibrium/spatialparams.hh:70
Defines a type tag and some properties for models using the box scheme.
This material law takes a material law defined for effective saturations and converts it to a materia...