spatialparams.hh 4.34 KB
Newer Older
1 2 3 4 5 6 7
// -*- 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    *
8
 *   the Free Software Foundation, either version 3 of the License, or       *
9 10 11 12 13 14 15 16 17 18 19 20
 *   (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
21
 * \ingroup RichardsTests
22
 * \brief Spatial parameters for the RichardsAnalyticalProblem.
23
 */
24

25 26 27
#ifndef DUMUX_RICHARDS_ANALYTICAL_SPATIAL_PARAMETERS_HH
#define DUMUX_RICHARDS_ANALYTICAL_SPATIAL_PARAMETERS_HH

28
#include <dumux/material/spatialparams/fv.hh>
29 30 31 32 33 34
#include <dumux/material/fluidmatrixinteractions/2p/regularizedvangenuchten.hh>
#include <dumux/material/fluidmatrixinteractions/2p/regularizedbrookscorey.hh>
#include <dumux/material/fluidmatrixinteractions/2p/brookscorey.hh>
#include <dumux/material/fluidmatrixinteractions/2p/linearmaterial.hh>
#include <dumux/material/fluidmatrixinteractions/2p/efftoabslaw.hh>

35
#include <dumux/porousmediumflow/richards/model.hh>
36

37
namespace Dumux {
38 39 40 41

/*!
 * \ingroup RichardsModel
 * \ingroup ImplicitTestProblems
42
 * \brief The spatial parameters for the RichardsAnalyticalProblem.
43
 */
44
template<class FVGridGeometry, class Scalar>
45
class RichardsAnalyticalSpatialParams
46 47
: public FVSpatialParams<FVGridGeometry, Scalar,
                         RichardsAnalyticalSpatialParams<FVGridGeometry, Scalar>>
48
{
49
    using GridView = typename FVGridGeometry::GridView;
50 51
    using ParentType = FVSpatialParams<FVGridGeometry, Scalar,
                                       RichardsAnalyticalSpatialParams<FVGridGeometry, Scalar>>;
52

53
    enum { dimWorld=GridView::dimensionworld };
54
    using Element = typename GridView::template Codim<0>::Entity;
55

56
    using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
57

58 59
    using EffectiveLaw = LinearMaterial<Scalar>;

60
public:
61

62
    using MaterialLaw = EffToAbsLaw<EffectiveLaw>;
63
    using MaterialLawParams = typename MaterialLaw::Params;
64
    // export permeability type
65 66
    using PermeabilityType = Scalar;

67 68
    RichardsAnalyticalSpatialParams(std::shared_ptr<const FVGridGeometry> fvGridGeometry)
        : ParentType(fvGridGeometry)
69 70 71 72 73 74 75 76 77 78 79
    {
        K_ = 5e-12;
        materialParams_.setSwr(0.0);
        materialParams_.setSnr(0.0);
        materialParams_.setEntryPc(0);
        materialParams_.setMaxPc(1e10);
    }

    /*!
     * \brief Returns the intrinsic permeability tensor [m^2] at a given location
     *
80
     * \param globalPos The global position where we evaluate
81
     */
82
    PermeabilityType permeabilityAtPos(const GlobalPosition& globalPos) const
83 84 85 86 87 88 89
    {
        return K_;
    }

    /*!
     * \brief Returns the porosity [] at a given location
     *
90
     * \param globalPos The global position where we evaluate
91
     */
92
    Scalar porosityAtPos(const GlobalPosition& globalPos) const
93 94 95 96 97 98
    { return 0.4; }

    /*!
     * \brief Returns the parameters for the material law at a given location
     *
     * This method is not actually required by the Richards model, but provided
99
     * for the convenience of the RichardsLensProblem
100 101 102
     *
     * \param globalPos A global coordinate vector
     */
103
    const MaterialLawParams& materialLawParamsAtPos(const GlobalPosition &globalPos) const
104 105 106 107 108 109 110 111 112 113 114 115 116
    {
        return materialParams_;
    }

private:
    // intrinsic permeability
    Scalar K_;

    MaterialLawParams materialParams_;
};
} // end namespace

#endif