Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*****************************************************************************
* See the file COPYING for full copying permissions. *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*****************************************************************************/
/*!
* \file
*
* \brief spatial parameters for the sequential tutorial
*/
#ifndef DUMUX_TUTORIAL_SPATIAL_PARAMS_SEQUENTIAL_HH
#define DUMUX_TUTORIAL_SPATIAL_PARAMS_SEQUENTIAL_HH
#include <dumux/material/spatialparams/fv.hh>
#include <dumux/material/fluidmatrixinteractions/2p/linearmaterial.hh>
#include <dumux/material/fluidmatrixinteractions/2p/regularizedbrookscorey.hh>
#include <dumux/material/fluidmatrixinteractions/2p/efftoabslaw.hh>
namespace Dumux
{
//forward declaration
template<class TypeTag>
class TutorialSpatialParamsSequential;
namespace Properties
{
// The spatial parameters TypeTag
NEW_TYPE_TAG(TutorialSpatialParamsSequential);
// Set the spatial parameters
SET_TYPE_PROP(TutorialSpatialParamsSequential, SpatialParams,
TutorialSpatialParamsSequential<TypeTag>); /*@\label{tutorial-sequential:set-spatialparameters}@*/
// Set the material law
SET_PROP(TutorialSpatialParamsSequential, MaterialLaw)
{
private:
// material law typedefs
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef RegularizedBrooksCorey<Scalar> RawMaterialLaw;
public:
typedef EffToAbsLaw<RawMaterialLaw> type;
};
}
//! Definition of the spatial parameters for the sequential tutorial
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
template<class TypeTag>
class TutorialSpatialParamsSequential: public FVSpatialParams<TypeTag>
{
typedef FVSpatialParams<TypeTag> ParentType;
typedef typename GET_PROP_TYPE(TypeTag, Grid) Grid;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename Grid::ctype CoordScalar;
enum
{dim=Grid::dimension, dimWorld=Grid::dimensionworld};
typedef typename Grid::Traits::template Codim<0>::Entity Element;
typedef Dune::FieldVector<CoordScalar, dimWorld> GlobalPosition;
typedef Dune::FieldMatrix<Scalar,dim,dim> FieldMatrix;
public:
typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw;
typedef typename MaterialLaw::Params MaterialLawParams;
//! Intrinsic permeability tensor K \f$[m^2]\f$ depending
/*! on the position in the domain
*
* \param element The finite volume element
*
* Alternatively, the function intrinsicPermeabilityAtPos(const GlobalPosition& globalPos) could be
* defined, where globalPos is the vector including the global coordinates of the finite volume.
*/
const FieldMatrix& intrinsicPermeability (const Element& element) const
{
return K_;
}
//! Define the porosity \f$[-]\f$ of the porous medium depending
/*! on the position in the domain
*
* \param element The finite volume element
*
* Alternatively, the function porosityAtPos(const GlobalPosition& globalPos) could be
* defined, where globalPos is the vector including the global coordinates of the finite volume.
*/
double porosity(const Element& element) const
{
return 0.2;
}
/*! Return the parameter object for the material law (i.e. Brooks-Corey)
* depending on the position in the domain
*
* \param element The finite volume element
*
* Alternatively, the function materialLawParamsAtPos(const GlobalPosition& globalPos)
* could be defined, where globalPos is the vector including the global coordinates of
* the finite volume.
*/
const MaterialLawParams& materialLawParams(const Element &element) const
{
return materialLawParams_;
}
//! Constructor
TutorialSpatialParamsSequential(const GridView& gridView)
: ParentType(gridView), K_(0)
{
for (int i = 0; i < dim; i++)
K_[i][i] = 1e-7;
// residual saturations
materialLawParams_.setSwr(0);
materialLawParams_.setSnr(0);
// parameters for the Brooks-Corey Law
// entry pressures
materialLawParams_.setPe(500);
// Brooks-Corey shape parameters
materialLawParams_.setLambda(2);
}
private:
MaterialLawParams materialLawParams_;
FieldMatrix K_;
};
} // end namespace
#endif