3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
porousmediumflow/tracer/2ptracer/spatialparams_tracer.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 2 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 *****************************************************************************/
24#ifndef DUMUX_TWOP_TRACER_TEST_SPATIAL_PARAMS_HH
25#define DUMUX_TWOP_TRACER_TEST_SPATIAL_PARAMS_HH
26
29#include <iostream>
30
31namespace Dumux {
32
37template<class GridGeometry, class Scalar>
39: public FVSpatialParams<GridGeometry, Scalar,
40 TwoPTracerTestSpatialParams<GridGeometry, Scalar>>
41{
42 using GridView = typename GridGeometry::GridView;
43 using FVElementGeometry = typename GridGeometry::LocalView;
44 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
45 using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
46 using Element = typename GridView::template Codim<0>::Entity;
47 using ParentType = FVSpatialParams<GridGeometry, Scalar,
49
50 static const int dimWorld = GridView::dimensionworld;
51 using GlobalPosition = typename Dune::FieldVector<Scalar, dimWorld>;
52
53
54public:
55
56 TwoPTracerTestSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
58
64 Scalar porosityAtPos(const GlobalPosition& globalPos) const
65 { return 0.4; }
66
69
71 Scalar fluidDensity(const Element &element,
72 const SubControlVolume& scv) const
73 { return density_[this->gridGeometry().elementMapper().index(element)];; }
74
75 void setDensity(const std::vector<Scalar>& d)
76 { density_ = d; }
77
79 Scalar fluidMolarMass(const Element &element,
80 const SubControlVolume& scv) const
81 { return 0.018; }
82
83 Scalar fluidMolarMass(const GlobalPosition &globalPos) const
84 { return 0.018; }
85
87 template<class ElementVolumeVariables>
88 Scalar volumeFlux(const Element &element,
89 const FVElementGeometry& fvGeometry,
90 const ElementVolumeVariables& elemVolVars,
91 const SubControlVolumeFace& scvf) const
92 { return volumeFlux_[scvf.index()]; }
93
94 void setVolumeFlux(const std::vector<Scalar>& f)
95 { volumeFlux_ = f; }
96
98 Scalar saturation(const Element &element,
99 const SubControlVolume& scv) const
100 { return saturation_[scv.dofIndex()]; }
101
102 void setSaturation(const std::vector<Scalar>& s)
103 { saturation_ = s; }
104
105private:
106 std::vector<Scalar> volumeFlux_;
107 std::vector<Scalar> density_;
108 std::vector<Scalar> saturation_;
109};
110
111} // end namespace Dumux
112
113#endif
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
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 tracer problem.
Definition: porousmediumflow/tracer/2ptracer/spatialparams_tracer.hh:41
TwoPTracerTestSpatialParams(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: porousmediumflow/tracer/2ptracer/spatialparams_tracer.hh:56
Scalar volumeFlux(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolumeFace &scvf) const
Velocity field.
Definition: porousmediumflow/tracer/2ptracer/spatialparams_tracer.hh:88
Scalar saturation(const Element &element, const SubControlVolume &scv) const
saturation from twoPProblem
Definition: porousmediumflow/tracer/2ptracer/spatialparams_tracer.hh:98
void setDensity(const std::vector< Scalar > &d)
Definition: porousmediumflow/tracer/2ptracer/spatialparams_tracer.hh:75
void setSaturation(const std::vector< Scalar > &s)
Definition: porousmediumflow/tracer/2ptracer/spatialparams_tracer.hh:102
Scalar fluidDensity(const Element &element, const SubControlVolume &scv) const
Fluid density.
Definition: porousmediumflow/tracer/2ptracer/spatialparams_tracer.hh:71
Scalar fluidMolarMass(const GlobalPosition &globalPos) const
Definition: porousmediumflow/tracer/2ptracer/spatialparams_tracer.hh:83
Scalar fluidMolarMass(const Element &element, const SubControlVolume &scv) const
fluid molar mass
Definition: porousmediumflow/tracer/2ptracer/spatialparams_tracer.hh:79
Scalar porosityAtPos(const GlobalPosition &globalPos) const
Defines the porosity .
Definition: porousmediumflow/tracer/2ptracer/spatialparams_tracer.hh:64
void setVolumeFlux(const std::vector< Scalar > &f)
Definition: porousmediumflow/tracer/2ptracer/spatialparams_tracer.hh:94
Defines a type tag and some properties for models using the box scheme.