3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
porousmediumflow/2pnc/implicit/fuelcell/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 *****************************************************************************/
26#ifndef DUMUX_FUELCELL_SPATIAL_PARAMS_HH
27#define DUMUX_FUELCELL_SPATIAL_PARAMS_HH
28
35
36namespace Dumux {
42template<class GridGeometry, class Scalar>
44: public FVSpatialParams<GridGeometry, Scalar,
45 FuelCellSpatialParams<GridGeometry, Scalar>>
46{
47 using GridView = typename GridGeometry::GridView;
48 using ParentType = FVSpatialParams<GridGeometry, Scalar,
50
51 static constexpr int dimWorld = GridView::dimensionworld;
52
53 using Element = typename GridGeometry::GridView::template Codim<0>::Entity;
54 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
55
56 using DimWorldMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>;
57
59
60public:
63 using PermeabilityType = DimWorldMatrix;
64
65 FuelCellSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
66 : ParentType(gridGeometry), K_(0)
67 {
68 // intrinsic permeabilities
69 K_[0][0] = 5e-11;
70 K_[1][1] = 5e-11;
71
72 // porosities
73 porosity_ = 0.2;
74
75 // residual saturations
76 materialParams_.setSwr(0.12); // air is wetting phase
77 materialParams_.setSnr(0.0); // water is non-wetting
78
79 //parameters for the vanGenuchten law
80 materialParams_.setVgAlpha(6.66e-5); // alpha = 1/pcb
81 materialParams_.setVgn(3.652);
82 }
83
89 DimWorldMatrix permeabilityAtPos(const GlobalPosition& globalPos) const
90 { return K_; }
91
97 Scalar porosityAtPos(const GlobalPosition& globalPos) const
98 {
99 if (globalPos[1] < eps_)
100 return porosity_;
101 else
102 return 0.2;
103 }
104
111 const MaterialLawParams& materialLawParamsAtPos(const GlobalPosition& globalPos) const
112 { return materialParams_; }
113
121 template<class FluidSystem>
122 int wettingPhaseAtPos(const GlobalPosition& globalPos) const
123 { return FluidSystem::gasPhaseIdx; }
124
125private:
126 DimWorldMatrix K_;
127 Scalar porosity_;
128 static constexpr Scalar eps_ = 1e-6;
129 MaterialLawParams materialParams_;
130};
131
132} // end namespace Dumux
133
134#endif
Linear capillary pressure and relative permeability <-> saturation relations.
Implementation of a regularized version of the Brooks-Corey capillary pressure / relative permeabilit...
Implementation of the regularized version of the van Genuchten's capillary pressure / relative permea...
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
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 van Genuchten's capillary pressure / relative permeability <-> satu...
Definition: regularizedvangenuchten.hh:71
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 FuelCell problem which uses the isothermal 2p2c box mode...
Definition: porousmediumflow/2pnc/implicit/fuelcell/spatialparams.hh:46
DimWorldMatrix permeabilityAtPos(const GlobalPosition &globalPos) const
Returns the hydraulic conductivity .
Definition: porousmediumflow/2pnc/implicit/fuelcell/spatialparams.hh:89
FuelCellSpatialParams(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: porousmediumflow/2pnc/implicit/fuelcell/spatialparams.hh:65
const MaterialLawParams & materialLawParamsAtPos(const GlobalPosition &globalPos) const
Returns the parameter object for the Brooks-Corey material law which depends on the position.
Definition: porousmediumflow/2pnc/implicit/fuelcell/spatialparams.hh:111
DimWorldMatrix PermeabilityType
Definition: porousmediumflow/2pnc/implicit/fuelcell/spatialparams.hh:63
Scalar porosityAtPos(const GlobalPosition &globalPos) const
Defines the porosity of the spatial parameters.
Definition: porousmediumflow/2pnc/implicit/fuelcell/spatialparams.hh:97
int wettingPhaseAtPos(const GlobalPosition &globalPos) const
Function for defining which phase is to be considered as the wetting phase.
Definition: porousmediumflow/2pnc/implicit/fuelcell/spatialparams.hh:122
typename MaterialLaw::Params MaterialLawParams
Definition: porousmediumflow/2pnc/implicit/fuelcell/spatialparams.hh:62
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...