2016-05-20 09:19:11 -05:00
|
|
|
/*
|
|
|
|
Copyright 2016 Statoil ASA
|
2016-09-23 06:25:02 -05:00
|
|
|
2016 IRIS
|
2016-05-20 09:19:11 -05:00
|
|
|
|
|
|
|
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/>.
|
|
|
|
*/
|
|
|
|
|
2016-09-23 06:25:02 -05:00
|
|
|
#ifndef OPM_SIMULATORS_COMPAT_HPP
|
|
|
|
#define OPM_SIMULATORS_COMPAT_HPP
|
2016-05-20 09:19:11 -05:00
|
|
|
|
2018-04-28 13:20:46 -05:00
|
|
|
#include <opm/output/eclipse/RestartValue.hpp>
|
2016-10-04 08:55:29 -05:00
|
|
|
#include <opm/output/data/Solution.hpp>
|
|
|
|
#include <opm/output/data/Wells.hpp>
|
2017-02-23 03:19:21 -06:00
|
|
|
#include <opm/core/props/BlackoilPhases.hpp>
|
|
|
|
#include <vector>
|
2016-05-20 09:19:11 -05:00
|
|
|
|
|
|
|
namespace Opm {
|
|
|
|
|
2017-02-23 03:19:21 -06:00
|
|
|
// Forward declarations
|
|
|
|
class SimulationDataContainer;
|
|
|
|
class WellStateFullyImplicitBlackoil;
|
2016-05-30 07:14:33 -05:00
|
|
|
|
2017-02-23 08:39:58 -06:00
|
|
|
/// Extract single data vector from striped data.
|
|
|
|
/// \return u such that u[i] = v[offset + i*stride].
|
2017-02-23 03:19:21 -06:00
|
|
|
std::vector< double > destripe( const std::vector< double >& v,
|
|
|
|
size_t stride,
|
|
|
|
size_t offset );
|
2016-05-30 07:14:33 -05:00
|
|
|
|
2017-02-23 08:39:58 -06:00
|
|
|
/// Inject single data vector into striped data.
|
|
|
|
/// \return reference to dst input, that is changed so that
|
|
|
|
/// dst[offset + i*stride] = v[i]. This is done for
|
|
|
|
/// i = 0..(dst.size()/stride).
|
2017-02-23 03:19:21 -06:00
|
|
|
std::vector< double >& stripe( const std::vector< double >& v,
|
|
|
|
size_t stride,
|
|
|
|
size_t offset,
|
|
|
|
std::vector< double >& dst );
|
2016-05-20 09:19:11 -05:00
|
|
|
|
2017-02-23 08:39:58 -06:00
|
|
|
/// Returns Solution with the following fields:
|
|
|
|
/// PRESSURE, TEMP (unconditionally)
|
|
|
|
/// SWAT, SGAS, RS, RV, SSOL (if appropriate fields present in input)
|
2017-02-24 10:07:25 -06:00
|
|
|
/// If use_si_units is true, the fields will have the measure UnitSystem::measure::identity,
|
|
|
|
/// and therefore *not* be converted to customary units (depending on family) upon output.
|
2017-02-23 03:19:21 -06:00
|
|
|
data::Solution simToSolution( const SimulationDataContainer& reservoir,
|
2017-02-24 10:07:25 -06:00
|
|
|
const bool use_si_units,
|
2017-02-23 03:19:21 -06:00
|
|
|
PhaseUsage phases );
|
2017-01-05 03:02:50 -06:00
|
|
|
|
2017-02-23 08:39:58 -06:00
|
|
|
/// Copies the following fields from sol into state (all conditionally):
|
|
|
|
/// PRESSURE, TEMP, SWAT, SGAS, RS, RV, SSOL
|
2017-04-07 09:20:35 -05:00
|
|
|
/// Also handles extra data such as hysteresis parameters, SOMAX, etc.
|
2018-04-28 13:20:46 -05:00
|
|
|
void solutionToSim( const RestartValue& restart_value,
|
2017-02-23 03:19:21 -06:00
|
|
|
PhaseUsage phases,
|
|
|
|
SimulationDataContainer& state );
|
2016-05-20 09:19:11 -05:00
|
|
|
|
2017-02-23 08:39:58 -06:00
|
|
|
/// Copies the following fields from wells into state.
|
|
|
|
/// bhp, temperature, currentControls, wellRates, perfPress, perfRates, perfPhaseRates
|
2017-02-23 03:19:21 -06:00
|
|
|
void wellsToState( const data::Wells& wells,
|
|
|
|
PhaseUsage phases,
|
|
|
|
WellStateFullyImplicitBlackoil& state );
|
2016-05-20 09:19:11 -05:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2016-09-23 06:25:02 -05:00
|
|
|
#endif //OPM_SIMULATORS_COMPAT_HPP
|