fvbaseextensivequantities.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 This file is part of the Open Porous Media project (OPM).
5
6 OPM 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 OPM 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 OPM. If not, see <http://www.gnu.org/licenses/>.
18
19 Consult the COPYING file in the top-level source directory of this
20 module for the precise wording of the license and the list of
21 copyright holders.
22*/
28#ifndef EWOMS_FV_BASE_EXTENSIVE_QUANTITIES_HH
29#define EWOMS_FV_BASE_EXTENSIVE_QUANTITIES_HH
30
31#include "fvbaseproperties.hh"
32
34
35#include <opm/material/common/Valgrind.hpp>
36
37namespace Opm {
44template <class TypeTag>
46{
50
51public:
55 static void registerParameters()
56 { }
57
66 void update(const ElementContext& elemCtx, unsigned scvfIdx, unsigned timeIdx)
67 {
68 const auto& scvf = elemCtx.stencil(timeIdx).interiorFace(scvfIdx);
69 interiorScvIdx_ = scvf.interiorIndex();
70 exteriorScvIdx_ = scvf.exteriorIndex();
71
72 extrusionFactor_ =
73 (elemCtx.intensiveQuantities(interiorScvIdx_, timeIdx).extrusionFactor()
74 + elemCtx.intensiveQuantities(exteriorScvIdx_, timeIdx).extrusionFactor()) / 2;
75 Valgrind::CheckDefined(extrusionFactor_);
76 assert(extrusionFactor_ > 0);
77 }
78
79
90 template <class Context, class FluidState>
91 void updateBoundary(const Context& context,
92 unsigned bfIdx,
93 unsigned timeIdx,
94 const FluidState&)
95 {
96 unsigned dofIdx = context.interiorScvIndex(bfIdx, timeIdx);
97 interiorScvIdx_ = static_cast<unsigned short>(dofIdx);
98 exteriorScvIdx_ = static_cast<unsigned short>(dofIdx);
99
100 extrusionFactor_ = context.intensiveQuantities(bfIdx, timeIdx).extrusionFactor();
101 Valgrind::CheckDefined(extrusionFactor_);
102 assert(extrusionFactor_ > 0);
103 }
104
108 Scalar extrusionFactor() const
109 { return extrusionFactor_; }
110
115 unsigned short interiorIndex() const
116 { return interiorScvIdx_; }
117
122 unsigned short exteriorIndex() const
123 { return exteriorScvIdx_; }
124
125private:
126 // local indices of the interior and the exterior sub-control-volumes
127 unsigned short interiorScvIdx_;
128 unsigned short exteriorScvIdx_;
129
130 Scalar extrusionFactor_;
131};
132
133} // namespace Opm
134
135#endif
Provide the properties at a face which make sense indepentently of the conserved quantities.
Definition: fvbaseextensivequantities.hh:46
static void registerParameters()
Register all run-time parameters for the extensive quantities.
Definition: fvbaseextensivequantities.hh:55
Scalar extrusionFactor() const
Returns th extrusion factor for the sub-control-volume face.
Definition: fvbaseextensivequantities.hh:108
unsigned short exteriorIndex() const
Return the local index of the control volume which is on the "exterior" of the sub-control volume fac...
Definition: fvbaseextensivequantities.hh:122
void updateBoundary(const Context &context, unsigned bfIdx, unsigned timeIdx, const FluidState &)
Update the extensive quantities for a given boundary face.
Definition: fvbaseextensivequantities.hh:91
unsigned short interiorIndex() const
Return the local index of the control volume which is on the "interior" of the sub-control volume fac...
Definition: fvbaseextensivequantities.hh:115
void update(const ElementContext &elemCtx, unsigned scvfIdx, unsigned timeIdx)
Update the extensive quantities for a given sub-control-volume face.
Definition: fvbaseextensivequantities.hh:66
Declare the properties used by the infrastructure code of the finite volume discretizations.
Defines the common properties required by the porous medium multi-phase models.
Definition: blackoilboundaryratevector.hh:37
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(....
Definition: propertysystem.hh:242