RFTContainer.hpp
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 Consult the COPYING file in the top-level source directory of this
19 module for the precise wording of the license and the list of
20 copyright holders.
21*/
26#ifndef OPM_RFT_CONTAINER_HPP
27#define OPM_RFT_CONTAINER_HPP
28
30
31#include <cstddef>
32#include <functional>
33#include <map>
34#include <string>
35#include <vector>
36
37namespace Opm {
38
39namespace data { class Wells; }
40class EclipseState;
41class Schedule;
42
43template<class FluidSystem>
45 using Scalar = typename FluidSystem::Scalar;
46 using ScalarBuffer = std::vector<Scalar>;
47
48 static constexpr auto gasPhaseIdx = FluidSystem::gasPhaseIdx;
49 static constexpr auto oilPhaseIdx = FluidSystem::oilPhaseIdx;
50 static constexpr auto waterPhaseIdx = FluidSystem::waterPhaseIdx;
51
52public:
53 using AssignmentFunc = std::function<Scalar()>;
54 using WellQueryFunc = std::function<bool(const std::string&)>;
55
56 RFTContainer(const EclipseState& eclState,
57 const Schedule& schedule,
58 const WellQueryFunc& wellQuery)
59 : eclState_(eclState)
60 , schedule_(schedule)
61 , wellQuery_(wellQuery)
62 {}
63
64 void addToWells(data::Wells& wellDatas,
65 const std::size_t reportStepNum,
66 const Parallel::Communication& comm);
67
68 void allocate(const std::size_t reportStepNum);
69
70 void assign(const unsigned cartesianIndex,
71 const AssignmentFunc& oil,
72 const AssignmentFunc& water,
73 const AssignmentFunc& gas);
74
75private:
76 const EclipseState& eclState_;
77 const Schedule& schedule_;
78 WellQueryFunc wellQuery_;
79
80 std::map<std::size_t, Scalar> oilConnectionPressures_;
81 std::map<std::size_t, Scalar> waterConnectionSaturations_;
82 std::map<std::size_t, Scalar> gasConnectionSaturations_;
83};
84
85} // namespace Opm
86
87#endif // OPM_RFT_CONTAINER_HPP
Definition: RFTContainer.hpp:44
void assign(const unsigned cartesianIndex, const AssignmentFunc &oil, const AssignmentFunc &water, const AssignmentFunc &gas)
std::function< Scalar()> AssignmentFunc
Definition: RFTContainer.hpp:53
void addToWells(data::Wells &wellDatas, const std::size_t reportStepNum, const Parallel::Communication &comm)
RFTContainer(const EclipseState &eclState, const Schedule &schedule, const WellQueryFunc &wellQuery)
Definition: RFTContainer.hpp:56
void allocate(const std::size_t reportStepNum)
std::function< bool(const std::string &)> WellQueryFunc
Definition: RFTContainer.hpp:54
Dune::Communication< MPIComm > Communication
Definition: ParallelCommunication.hpp:30
bool water(const PhaseUsage &pu)
Definition: RegionAttributeHelpers.hpp:309
bool oil(const PhaseUsage &pu)
Definition: RegionAttributeHelpers.hpp:322
bool gas(const PhaseUsage &pu)
Definition: RegionAttributeHelpers.hpp:335
Definition: blackoilboundaryratevector.hh:39