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
50template<class FluidSystem>
53 using Scalar = typename FluidSystem::Scalar;
54
57 using ScalarBuffer = std::vector<Scalar>;
58
60 static constexpr auto gasPhaseIdx = FluidSystem::gasPhaseIdx;
61
63 static constexpr auto oilPhaseIdx = FluidSystem::oilPhaseIdx;
64
66 static constexpr auto waterPhaseIdx = FluidSystem::waterPhaseIdx;
67
68public:
71 using AssignmentFunc = std::function<Scalar()>;
72
77 using WellQueryFunc = std::function<bool(const std::string&)>;
78
95 RFTContainer(const EclipseState& eclState,
96 const Schedule& schedule,
97 const WellQueryFunc& wellIsOwnedByCurrent,
98 const WellQueryFunc& wellOnCurrent)
99 : eclState_(eclState)
100 , schedule_(schedule)
101 , wellIsOwnedByCurrentRank_(wellIsOwnedByCurrent)
102 , wellOnCurrentRank_(wellOnCurrent)
103 {}
104
122 void addToWells(data::Wells& wellDatas,
123 const std::size_t reportStepNum,
124 const Parallel::Communication& comm);
125
130 void allocate(const std::size_t reportStepNum);
131
152 void assign(const unsigned cartesianIndex,
153 const AssignmentFunc& oil,
154 const AssignmentFunc& water,
155 const AssignmentFunc& gas);
156
157private:
159 const EclipseState& eclState_;
160
162 const Schedule& schedule_;
163
168 WellQueryFunc wellIsOwnedByCurrentRank_;
169
174 WellQueryFunc wellOnCurrentRank_;
175
180 std::map<std::size_t, Scalar> oilConnectionPressures_;
181
187 std::map<std::size_t, Scalar> waterConnectionSaturations_;
188
193 std::map<std::size_t, Scalar> gasConnectionSaturations_;
194};
195
196} // namespace Opm
197
198#endif // OPM_RFT_CONTAINER_HPP
Definition: RFTContainer.hpp:51
void assign(const unsigned cartesianIndex, const AssignmentFunc &oil, const AssignmentFunc &water, const AssignmentFunc &gas)
std::function< Scalar()> AssignmentFunc
Definition: RFTContainer.hpp:71
RFTContainer(const EclipseState &eclState, const Schedule &schedule, const WellQueryFunc &wellIsOwnedByCurrent, const WellQueryFunc &wellOnCurrent)
Definition: RFTContainer.hpp:95
void addToWells(data::Wells &wellDatas, const std::size_t reportStepNum, const Parallel::Communication &comm)
void allocate(const std::size_t reportStepNum)
std::function< bool(const std::string &)> WellQueryFunc
Definition: RFTContainer.hpp:77
Dune::Communication< MPIComm > Communication
Definition: ParallelCommunication.hpp:30
Definition: blackoilboundaryratevector.hh:39