3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
multidomain/facet/tracer_tracer/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 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 *****************************************************************************/
25#ifndef DUMUX_TEST_TPFAFACETCOUPLING_TRACER_SPATIALPARAMS_HH
26#define DUMUX_TEST_TPFAFACETCOUPLING_TRACER_SPATIALPARAMS_HH
27
30
31namespace Dumux {
32
37template<class GridGeometry, class Scalar>
39: public FVSpatialParamsOneP<GridGeometry, Scalar,
40 TracerSpatialParams<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 = FVSpatialParamsOneP<GridGeometry, Scalar,
49
50 static constexpr bool isBox = GridGeometry::discMethod == DiscretizationMethod::box;
51 static constexpr int dimWorld = GridView::dimensionworld;
52 using GlobalPosition = typename Dune::FieldVector<Scalar, dimWorld>;
53
54public:
55
56 TracerSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry,
57 const std::vector< std::vector<Scalar> >& volumeFluxes,
58 const std::string& paramGroup = "")
60 , volumeFlux_(volumeFluxes)
61 , porosity_(getParamFromGroup<Scalar>(paramGroup, "SpatialParams.Porosity"))
62 {}
63
69 Scalar porosityAtPos(const GlobalPosition& globalPos) const
70 { return porosity_; }
71
75 Scalar fluidDensity(const Element &element,
76 const SubControlVolume& scv) const
77 { return 1000; }
78
80 Scalar fluidMolarMass(const Element &element,
81 const SubControlVolume& scv) const
82 { return 18.0; }
83
84 Scalar fluidMolarMass(const GlobalPosition &globalPos) const
85 { return 18.0; }
86
88 template<class ElementVolumeVariables>
89 Scalar volumeFlux(const Element &element,
90 const FVElementGeometry& fvGeometry,
91 const ElementVolumeVariables& elemVolVars,
92 const SubControlVolumeFace& scvf) const
93 {
94 return isBox ? volumeFlux_[this->gridGeometry().elementMapper().index(element)][scvf.index()]
95 : volumeFlux_[scvf.index()][0];
96 }
97
98private:
99 std::vector< std::vector<Scalar> > volumeFlux_;
100 Scalar porosity_;
101};
102
103} // end namespace Dumux
104
105#endif
The base class for spatial parameters of one-phase problems using a fully implicit discretization met...
T getParamFromGroup(Args &&... args)
A free function to get a parameter from the parameter tree singleton with a model group.
Definition: parameters.hh:438
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
The base class for spatial parameters of one-phase problems using a fully implicit discretization met...
Definition: fv1p.hh:77
const GridGeometry & gridGeometry() const
The finite volume grid geometry.
Definition: fv1p.hh:334
Definition of the spatial parameters for the tracer problem.
Definition: multidomain/facet/tracer_tracer/spatialparams_tracer.hh:41
Scalar porosityAtPos(const GlobalPosition &globalPos) const
Defines the porosity .
Definition: multidomain/facet/tracer_tracer/spatialparams_tracer.hh:69
TracerSpatialParams(std::shared_ptr< const GridGeometry > gridGeometry, const std::vector< std::vector< Scalar > > &volumeFluxes, const std::string &paramGroup="")
Definition: multidomain/facet/tracer_tracer/spatialparams_tracer.hh:56
Scalar fluidMolarMass(const GlobalPosition &globalPos) const
Definition: multidomain/facet/tracer_tracer/spatialparams_tracer.hh:84
Scalar fluidDensity(const Element &element, const SubControlVolume &scv) const
Definition: multidomain/facet/tracer_tracer/spatialparams_tracer.hh:75
Scalar fluidMolarMass(const Element &element, const SubControlVolume &scv) const
Fluid molar mass.
Definition: multidomain/facet/tracer_tracer/spatialparams_tracer.hh:80
Scalar volumeFlux(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolumeFace &scvf) const
Velocity field.
Definition: multidomain/facet/tracer_tracer/spatialparams_tracer.hh:89
Defines a type tag and some properties for models using the box scheme.