2016-09-12 16:28:44 -05:00
|
|
|
/*
|
|
|
|
Copyright 2013 SINTEF ICT, Applied Mathematics.
|
|
|
|
Copyright 2014-2016 IRIS AS
|
|
|
|
Copyright 2015 Andreas Lauser
|
|
|
|
|
|
|
|
This file is part of the Open Porous Media project (OPM).
|
|
|
|
|
|
|
|
OPM is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
OPM is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
#ifndef OPM_SIM_FIBO_DETAILS_HPP
|
|
|
|
#define OPM_SIM_FIBO_DETAILS_HPP
|
|
|
|
|
|
|
|
#include <utility>
|
|
|
|
#include <algorithm>
|
|
|
|
#include <locale>
|
2019-08-27 17:30:12 -05:00
|
|
|
|
2016-09-12 16:28:44 -05:00
|
|
|
#include <opm/parser/eclipse/EclipseState/Schedule/Events.hpp>
|
2019-11-13 16:16:11 -06:00
|
|
|
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp>
|
2019-08-27 17:30:12 -05:00
|
|
|
|
2016-09-12 16:28:44 -05:00
|
|
|
namespace Opm
|
|
|
|
{
|
|
|
|
namespace SimFIBODetails {
|
2019-11-13 16:16:11 -06:00
|
|
|
typedef std::unordered_map<std::string, Well > WellMap;
|
2016-09-12 16:28:44 -05:00
|
|
|
|
|
|
|
inline WellMap
|
2019-11-13 16:16:11 -06:00
|
|
|
mapWells(const std::vector< Well >& wells)
|
2016-09-12 16:28:44 -05:00
|
|
|
{
|
|
|
|
WellMap wmap;
|
|
|
|
|
2019-05-02 05:51:25 -05:00
|
|
|
for (const auto& w : wells)
|
2016-09-12 16:28:44 -05:00
|
|
|
{
|
2019-05-02 05:51:25 -05:00
|
|
|
wmap.insert(std::make_pair(w.name(), w));
|
2016-09-12 16:28:44 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
return wmap;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline void
|
|
|
|
historyRates(const PhaseUsage& pu,
|
2019-11-13 16:16:11 -06:00
|
|
|
const Well::ProductionControls& p,
|
2016-09-12 16:28:44 -05:00
|
|
|
std::vector<double>& rates)
|
|
|
|
{
|
2019-05-21 00:31:54 -05:00
|
|
|
assert (! p.prediction_mode);
|
2016-09-12 16:28:44 -05:00
|
|
|
assert (rates.size() ==
|
|
|
|
std::vector<double>::size_type(pu.num_phases));
|
|
|
|
|
|
|
|
if (pu.phase_used[ BlackoilPhases::Aqua ]) {
|
|
|
|
const std::vector<double>::size_type
|
|
|
|
i = pu.phase_pos[ BlackoilPhases::Aqua ];
|
|
|
|
|
2019-05-21 00:31:54 -05:00
|
|
|
rates[i] = p.water_rate;
|
2016-09-12 16:28:44 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
if (pu.phase_used[ BlackoilPhases::Liquid ]) {
|
|
|
|
const std::vector<double>::size_type
|
|
|
|
i = pu.phase_pos[ BlackoilPhases::Liquid ];
|
|
|
|
|
2019-05-21 00:31:54 -05:00
|
|
|
rates[i] = p.oil_rate;
|
2016-09-12 16:28:44 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
if (pu.phase_used[ BlackoilPhases::Vapour ]) {
|
|
|
|
const std::vector<double>::size_type
|
|
|
|
i = pu.phase_pos[ BlackoilPhases::Vapour ];
|
|
|
|
|
2019-05-21 00:31:54 -05:00
|
|
|
rates[i] = p.gas_rate;
|
2016-09-12 16:28:44 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} // namespace SimFIBODetails
|
|
|
|
} // namespace Opm
|
|
|
|
|
|
|
|
#endif // OPM_SIM_FIBO_DETAILS_HPP
|