mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #867 from andlaus/frankenstein_merge_master_v4
Frankenstein merge master v4
This commit is contained in:
commit
9dc30cc0ac
@ -26,8 +26,9 @@
|
|||||||
#include <opm/core/simulator/BlackoilState.hpp>
|
#include <opm/core/simulator/BlackoilState.hpp>
|
||||||
#include <opm/core/simulator/WellState.hpp>
|
#include <opm/core/simulator/WellState.hpp>
|
||||||
#include <opm/autodiff/BlackoilSolventState.hpp>
|
#include <opm/autodiff/BlackoilSolventState.hpp>
|
||||||
#include <opm/output/Cells.hpp>
|
#include <opm/output/data/Cells.hpp>
|
||||||
#include <opm/output/Wells.hpp>
|
#include <opm/output/data/Solution.hpp>
|
||||||
|
#include <opm/output/data/Wells.hpp>
|
||||||
|
|
||||||
namespace Opm {
|
namespace Opm {
|
||||||
|
|
||||||
@ -69,13 +70,11 @@ inline std::vector< double >& stripe( const std::vector< double >& v,
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
inline data::Solution simToSolution( const SimulationDataContainer& reservoir,
|
inline data::Solution simToSolution( const SimulationDataContainer& reservoir,
|
||||||
PhaseUsage phases ) {
|
PhaseUsage phases ) {
|
||||||
using ds = data::Solution::key;
|
|
||||||
|
|
||||||
data::Solution sol;
|
data::Solution sol;
|
||||||
sol.insert( ds::PRESSURE, reservoir.pressure() );
|
sol.insert( "PRESSURE", UnitSystem::measure::pressure, reservoir.pressure() , data::TargetType::RESTART_SOLUTION);
|
||||||
sol.insert( ds::TEMP, reservoir.temperature() );
|
sol.insert( "TEMP" , UnitSystem::measure::temperature, reservoir.temperature() , data::TargetType::RESTART_SOLUTION );
|
||||||
|
|
||||||
const auto ph = reservoir.numPhases();
|
const auto ph = reservoir.numPhases();
|
||||||
const auto& sat = reservoir.saturation();
|
const auto& sat = reservoir.saturation();
|
||||||
@ -84,23 +83,23 @@ inline data::Solution simToSolution( const SimulationDataContainer& reservoir,
|
|||||||
const auto vapour = BlackoilPhases::Vapour;
|
const auto vapour = BlackoilPhases::Vapour;
|
||||||
|
|
||||||
if( phases.phase_used[ aqua ] ) {
|
if( phases.phase_used[ aqua ] ) {
|
||||||
sol.insert( ds::SWAT, destripe( sat, ph, phases.phase_pos[ aqua ] ) );
|
sol.insert( "SWAT", UnitSystem::measure::identity, destripe( sat, ph, phases.phase_pos[ aqua ] ) , data::TargetType::RESTART_SOLUTION );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( phases.phase_used[ vapour ] ) {
|
if( phases.phase_used[ vapour ] ) {
|
||||||
sol.insert( ds::SGAS, destripe( sat, ph, phases.phase_pos[ vapour ] ) );
|
sol.insert( "SGAS", UnitSystem::measure::identity, destripe( sat, ph, phases.phase_pos[ vapour ] ) , data::TargetType::RESTART_SOLUTION );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( reservoir.hasCellData( BlackoilState::GASOILRATIO ) ) {
|
if( reservoir.hasCellData( BlackoilState::GASOILRATIO ) ) {
|
||||||
sol.insert( ds::RS, reservoir.getCellData( BlackoilState::GASOILRATIO ) );
|
sol.insert( "RS", UnitSystem::measure::identity, reservoir.getCellData( BlackoilState::GASOILRATIO ) , data::TargetType::RESTART_SOLUTION );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( reservoir.hasCellData( BlackoilState::RV ) ) {
|
if( reservoir.hasCellData( BlackoilState::RV ) ) {
|
||||||
sol.insert( ds::RV, reservoir.getCellData( BlackoilState::RV ) );
|
sol.insert( "RV", UnitSystem::measure::identity, reservoir.getCellData( BlackoilState::RV ) , data::TargetType::RESTART_SOLUTION );
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reservoir.hasCellData( BlackoilSolventState::SSOL)) {
|
if (reservoir.hasCellData( BlackoilSolventState::SSOL)) {
|
||||||
sol.insert( ds::SSOL, reservoir.getCellData( BlackoilSolventState::SSOL ) );
|
sol.insert( "SSOL", UnitSystem::measure::identity, reservoir.getCellData( BlackoilSolventState::SSOL ) , data::TargetType::RESTART_SOLUTION );
|
||||||
}
|
}
|
||||||
|
|
||||||
sol.sdc = &reservoir;
|
sol.sdc = &reservoir;
|
||||||
@ -118,41 +117,40 @@ inline data::Solution simToSolution( const SimulationDataContainer& reservoir,
|
|||||||
inline void solutionToSim( const data::Solution& sol,
|
inline void solutionToSim( const data::Solution& sol,
|
||||||
PhaseUsage phases,
|
PhaseUsage phases,
|
||||||
SimulationDataContainer& state ) {
|
SimulationDataContainer& state ) {
|
||||||
using ds = data::Solution::key;
|
|
||||||
|
|
||||||
const auto stride = phases.num_phases;
|
const auto stride = phases.num_phases;
|
||||||
if( sol.has( ds::SWAT ) ) {
|
if( sol.has( "SWAT" ) ) {
|
||||||
stripe( sol[ ds::SWAT ],
|
stripe( sol.data( "SWAT" ),
|
||||||
stride,
|
stride,
|
||||||
phases.phase_pos[ BlackoilPhases::Aqua ],
|
phases.phase_pos[ BlackoilPhases::Aqua ],
|
||||||
state.saturation() );
|
state.saturation() );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( sol.has( ds::SGAS ) ) {
|
if( sol.has( "SGAS" ) ) {
|
||||||
stripe( sol[ ds::SGAS ],
|
stripe( sol.data( "SGAS" ),
|
||||||
stride,
|
stride,
|
||||||
phases.phase_pos[ BlackoilPhases::Vapour ],
|
phases.phase_pos[ BlackoilPhases::Vapour ],
|
||||||
state.saturation() );
|
state.saturation() );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( sol.has( ds::PRESSURE ) ) {
|
if( sol.has( "PRESSURE" ) ) {
|
||||||
state.pressure() = sol[ ds::PRESSURE ];
|
state.pressure() = sol.data( "PRESSURE" );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( sol.has( ds::TEMP ) ) {
|
if( sol.has( "TEMP" ) ) {
|
||||||
state.temperature() = sol[ ds::TEMP ];
|
state.temperature() = sol.data( "TEMP" );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( sol.has( ds::RS ) ) {
|
if( sol.has( "RS" ) ) {
|
||||||
state.getCellData( "GASOILRATIO" ) = sol[ ds::RS ];
|
state.getCellData( "GASOILRATIO" ) = sol.data( "RS" );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( sol.has( ds::RV ) ) {
|
if( sol.has( "RV" ) ) {
|
||||||
state.getCellData( "RV" ) = sol[ ds::RV ];
|
state.getCellData( "RV" ) = sol.data( "RV" );
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sol.has( ds::SSOL ) ) {
|
if (sol.has( "SSOL" ) ) {
|
||||||
state.getCellData("SSOL") = sol [ ds::SSOL];
|
state.getCellData("SSOL") = sol.data("SSOL");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,8 @@
|
|||||||
#include <opm/parser/eclipse/EclipseState/Grid/TransMult.hpp>
|
#include <opm/parser/eclipse/EclipseState/Grid/TransMult.hpp>
|
||||||
#include <opm/core/grid/PinchProcessor.hpp>
|
#include <opm/core/grid/PinchProcessor.hpp>
|
||||||
#include <opm/common/utility/platform_dependent/disable_warnings.h>
|
#include <opm/common/utility/platform_dependent/disable_warnings.h>
|
||||||
#include <opm/output/Cells.hpp>
|
#include <opm/output/data/Cells.hpp>
|
||||||
|
#include <opm/output/data/Solution.hpp>
|
||||||
|
|
||||||
#include <Eigen/Eigen>
|
#include <Eigen/Eigen>
|
||||||
|
|
||||||
@ -228,15 +229,15 @@ namespace Opm
|
|||||||
/// grid the whole TRAN keyword is quite meaningless.
|
/// grid the whole TRAN keyword is quite meaningless.
|
||||||
|
|
||||||
template <class Grid>
|
template <class Grid>
|
||||||
const std::vector<data::CellData> simProps( const Grid& grid ) const {
|
data::Solution simProps( const Grid& grid ) const {
|
||||||
using namespace UgGridHelpers;
|
using namespace UgGridHelpers;
|
||||||
const int* dims = cartDims( grid );
|
const int* dims = cartDims( grid );
|
||||||
const int globalSize = dims[0] * dims[1] * dims[2];
|
const int globalSize = dims[0] * dims[1] * dims[2];
|
||||||
const auto& trans = this->transmissibility( );
|
const auto& trans = this->transmissibility( );
|
||||||
|
|
||||||
data::CellData tranx = {"TRANX" , UnitSystem::measure::transmissibility, std::vector<double>( globalSize )};
|
data::CellData tranx = {UnitSystem::measure::transmissibility, std::vector<double>( globalSize ), data::TargetType::INIT};
|
||||||
data::CellData trany = {"TRANY" , UnitSystem::measure::transmissibility, std::vector<double>( globalSize )};
|
data::CellData trany = {UnitSystem::measure::transmissibility, std::vector<double>( globalSize ), data::TargetType::INIT};
|
||||||
data::CellData tranz = {"TRANZ" , UnitSystem::measure::transmissibility, std::vector<double>( globalSize )};
|
data::CellData tranz = {UnitSystem::measure::transmissibility, std::vector<double>( globalSize ), data::TargetType::INIT};
|
||||||
|
|
||||||
size_t num_faces = numFaces(grid);
|
size_t num_faces = numFaces(grid);
|
||||||
auto fc = faceCells(grid);
|
auto fc = faceCells(grid);
|
||||||
@ -263,12 +264,9 @@ namespace Opm
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<data::CellData> tran;
|
return { {"TRANX" , tranx},
|
||||||
tran.push_back( std::move( tranx ));
|
{"TRANY" , trany} ,
|
||||||
tran.push_back( std::move( trany ));
|
{"TRANZ" , tranz } };
|
||||||
tran.push_back( std::move( tranz ));
|
|
||||||
|
|
||||||
return tran;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -166,7 +166,6 @@ public:
|
|||||||
std::ofstream tstep_os(tstep_filename.c_str());
|
std::ofstream tstep_os(tstep_filename.c_str());
|
||||||
|
|
||||||
const auto& schedule = eclState()->getSchedule();
|
const auto& schedule = eclState()->getSchedule();
|
||||||
const auto& events = schedule->getEvents();
|
|
||||||
|
|
||||||
// adaptive time stepping
|
// adaptive time stepping
|
||||||
std::unique_ptr< AdaptiveTimeStepping > adaptiveTimeStepping;
|
std::unique_ptr< AdaptiveTimeStepping > adaptiveTimeStepping;
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
#include <opm/common/data/SimulationDataContainer.hpp>
|
#include <opm/common/data/SimulationDataContainer.hpp>
|
||||||
|
|
||||||
#include <opm/parser/eclipse/EclipseState/InitConfig/InitConfig.hpp>
|
#include <opm/parser/eclipse/EclipseState/InitConfig/InitConfig.hpp>
|
||||||
#include <opm/output/Cells.hpp>
|
#include <opm/output/data/Cells.hpp>
|
||||||
#include <opm/core/simulator/BlackoilState.hpp>
|
#include <opm/core/simulator/BlackoilState.hpp>
|
||||||
#include <opm/core/utility/DataMap.hpp>
|
#include <opm/core/utility/DataMap.hpp>
|
||||||
#include <opm/autodiff/Compat.hpp>
|
#include <opm/autodiff/Compat.hpp>
|
||||||
@ -262,14 +262,14 @@ namespace Opm
|
|||||||
std::unique_ptr< SimulatorTimerInterface > timer_;
|
std::unique_ptr< SimulatorTimerInterface > timer_;
|
||||||
const SimulationDataContainer state_;
|
const SimulationDataContainer state_;
|
||||||
const WellState wellState_;
|
const WellState wellState_;
|
||||||
std::vector<data::CellData> simProps_;
|
data::Solution simProps_;
|
||||||
const bool substep_;
|
const bool substep_;
|
||||||
|
|
||||||
explicit WriterCall( BlackoilOutputWriter& writer,
|
explicit WriterCall( BlackoilOutputWriter& writer,
|
||||||
const SimulatorTimerInterface& timer,
|
const SimulatorTimerInterface& timer,
|
||||||
const SimulationDataContainer& state,
|
const SimulationDataContainer& state,
|
||||||
const WellState& wellState,
|
const WellState& wellState,
|
||||||
const std::vector<data::CellData>& simProps,
|
const data::Solution& simProps,
|
||||||
bool substep )
|
bool substep )
|
||||||
: writer_( writer ),
|
: writer_( writer ),
|
||||||
timer_( timer.clone() ),
|
timer_( timer.clone() ),
|
||||||
@ -300,8 +300,7 @@ namespace Opm
|
|||||||
const WellState& localWellState,
|
const WellState& localWellState,
|
||||||
bool substep)
|
bool substep)
|
||||||
{
|
{
|
||||||
std::vector<data::CellData> noCellProperties;
|
writeTimeStepWithCellProperties(timer, localState, localWellState, {} , substep);
|
||||||
writeTimeStepWithCellProperties(timer, localState, localWellState, noCellProperties, substep);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -314,7 +313,7 @@ namespace Opm
|
|||||||
const SimulatorTimerInterface& timer,
|
const SimulatorTimerInterface& timer,
|
||||||
const SimulationDataContainer& localState,
|
const SimulationDataContainer& localState,
|
||||||
const WellState& localWellState,
|
const WellState& localWellState,
|
||||||
const std::vector<data::CellData>& cellData,
|
const data::Solution& cellData,
|
||||||
bool substep)
|
bool substep)
|
||||||
{
|
{
|
||||||
// VTK output (is parallel if grid is parallel)
|
// VTK output (is parallel if grid is parallel)
|
||||||
@ -360,7 +359,7 @@ namespace Opm
|
|||||||
writeTimeStepSerial(const SimulatorTimerInterface& timer,
|
writeTimeStepSerial(const SimulatorTimerInterface& timer,
|
||||||
const SimulationDataContainer& state,
|
const SimulationDataContainer& state,
|
||||||
const WellState& wellState,
|
const WellState& wellState,
|
||||||
const std::vector<data::CellData>& simProps,
|
const data::Solution& simProps,
|
||||||
bool substep)
|
bool substep)
|
||||||
{
|
{
|
||||||
// Matlab output
|
// Matlab output
|
||||||
@ -379,8 +378,7 @@ namespace Opm
|
|||||||
substep,
|
substep,
|
||||||
timer.simulationTimeElapsed(),
|
timer.simulationTimeElapsed(),
|
||||||
simToSolution( state, phaseUsage_ ),
|
simToSolution( state, phaseUsage_ ),
|
||||||
wellState.report(phaseUsage_),
|
wellState.report(phaseUsage_));
|
||||||
simProps);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,7 +31,8 @@
|
|||||||
#include <opm/core/utility/parameters/ParameterGroup.hpp>
|
#include <opm/core/utility/parameters/ParameterGroup.hpp>
|
||||||
#include <opm/core/wells/DynamicListEconLimited.hpp>
|
#include <opm/core/wells/DynamicListEconLimited.hpp>
|
||||||
|
|
||||||
#include <opm/output/Cells.hpp>
|
#include <opm/output/data/Cells.hpp>
|
||||||
|
#include <opm/output/data/Solution.hpp>
|
||||||
#include <opm/output/eclipse/EclipseWriter.hpp>
|
#include <opm/output/eclipse/EclipseWriter.hpp>
|
||||||
|
|
||||||
#include <opm/autodiff/GridHelpers.hpp>
|
#include <opm/autodiff/GridHelpers.hpp>
|
||||||
@ -217,7 +218,7 @@ namespace Opm
|
|||||||
const double* permeability );
|
const double* permeability );
|
||||||
|
|
||||||
/** \copydoc Opm::OutputWriter::writeInit */
|
/** \copydoc Opm::OutputWriter::writeInit */
|
||||||
void writeInit(const std::vector<data::CellData>& simProps, const NNC& nnc);
|
void writeInit(const data::Solution& simProps, const NNC& nnc);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Write a blackoil reservoir state to disk for later inspection with
|
* \brief Write a blackoil reservoir state to disk for later inspection with
|
||||||
@ -242,7 +243,7 @@ namespace Opm
|
|||||||
const SimulatorTimerInterface& timer,
|
const SimulatorTimerInterface& timer,
|
||||||
const SimulationDataContainer& reservoirState,
|
const SimulationDataContainer& reservoirState,
|
||||||
const Opm::WellState& wellState,
|
const Opm::WellState& wellState,
|
||||||
const std::vector<data::CellData>& simProps,
|
const data::Solution& solution,
|
||||||
bool substep = false);
|
bool substep = false);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -264,7 +265,7 @@ namespace Opm
|
|||||||
void writeTimeStepSerial(const SimulatorTimerInterface& timer,
|
void writeTimeStepSerial(const SimulatorTimerInterface& timer,
|
||||||
const SimulationDataContainer& reservoirState,
|
const SimulationDataContainer& reservoirState,
|
||||||
const Opm::WellState& wellState,
|
const Opm::WellState& wellState,
|
||||||
const std::vector<data::CellData>& simProps,
|
const data::Solution& cellData,
|
||||||
bool substep);
|
bool substep);
|
||||||
|
|
||||||
/** \brief return output directory */
|
/** \brief return output directory */
|
||||||
@ -449,18 +450,16 @@ namespace Opm
|
|||||||
* Returns the data requested in the restartConfig
|
* Returns the data requested in the restartConfig
|
||||||
*/
|
*/
|
||||||
template<class Model>
|
template<class Model>
|
||||||
void getRestartData(
|
void getRestartData(data::Solution& output,
|
||||||
std::vector<data::CellData>& output,
|
const Opm::PhaseUsage& phaseUsage,
|
||||||
const Opm::PhaseUsage& phaseUsage,
|
const Model& physicalModel,
|
||||||
const Model& physicalModel,
|
const RestartConfig& restartConfig,
|
||||||
const RestartConfig& restartConfig,
|
const int reportStepNum,
|
||||||
const int reportStepNum,
|
const bool log) {
|
||||||
const bool log) {
|
|
||||||
|
|
||||||
typedef Opm::AutoDiffBlock<double> ADB;
|
typedef Opm::AutoDiffBlock<double> ADB;
|
||||||
|
|
||||||
const typename Model::SimulatorData& sd = physicalModel.getSimulatorData();
|
const typename Model::SimulatorData& sd = physicalModel.getSimulatorData();
|
||||||
|
|
||||||
//Get the value of each of the keys for the restart keywords
|
//Get the value of each of the keys for the restart keywords
|
||||||
std::map<std::string, int> rstKeywords = restartConfig.getRestartKeywords(reportStepNum);
|
std::map<std::string, int> rstKeywords = restartConfig.getRestartKeywords(reportStepNum);
|
||||||
for (auto& keyValue : rstKeywords) {
|
for (auto& keyValue : rstKeywords) {
|
||||||
@ -482,27 +481,24 @@ namespace Opm
|
|||||||
*/
|
*/
|
||||||
if (aqua_active && rstKeywords["BW"] > 0) {
|
if (aqua_active && rstKeywords["BW"] > 0) {
|
||||||
rstKeywords["BW"] = 0;
|
rstKeywords["BW"] = 0;
|
||||||
output.emplace_back(data::CellData{
|
output.insert("1OVERBW",
|
||||||
"1OVERBW",
|
Opm::UnitSystem::measure::water_inverse_formation_volume_factor,
|
||||||
Opm::UnitSystem::measure::water_inverse_formation_volume_factor,
|
adbToDoubleVector(sd.rq[aqua_idx].b),
|
||||||
adbToDoubleVector(sd.rq[aqua_idx].b),
|
data::TargetType::RESTART_AUXILLARY);
|
||||||
true});
|
|
||||||
}
|
}
|
||||||
if (liquid_active && rstKeywords["BO"] > 0) {
|
if (liquid_active && rstKeywords["BO"] > 0) {
|
||||||
rstKeywords["BO"] = 0;
|
rstKeywords["BO"] = 0;
|
||||||
output.emplace_back(data::CellData{
|
output.insert("1OVERBO",
|
||||||
"1OVERBO",
|
Opm::UnitSystem::measure::oil_inverse_formation_volume_factor,
|
||||||
Opm::UnitSystem::measure::oil_inverse_formation_volume_factor,
|
adbToDoubleVector(sd.rq[liquid_idx].b),
|
||||||
adbToDoubleVector(sd.rq[liquid_idx].b),
|
data::TargetType::RESTART_AUXILLARY);
|
||||||
true});
|
|
||||||
}
|
}
|
||||||
if (vapour_active && rstKeywords["BG"] > 0) {
|
if (vapour_active && rstKeywords["BG"] > 0) {
|
||||||
rstKeywords["BG"] = 0;
|
rstKeywords["BG"] = 0;
|
||||||
output.emplace_back(data::CellData{
|
output.insert("1OVERBG",
|
||||||
"1OVERBG",
|
Opm::UnitSystem::measure::gas_inverse_formation_volume_factor,
|
||||||
Opm::UnitSystem::measure::gas_inverse_formation_volume_factor,
|
adbToDoubleVector(sd.rq[vapour_idx].b),
|
||||||
adbToDoubleVector(sd.rq[vapour_idx].b),
|
data::TargetType::RESTART_AUXILLARY);
|
||||||
true});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -511,25 +507,22 @@ namespace Opm
|
|||||||
if (rstKeywords["DEN"] > 0) {
|
if (rstKeywords["DEN"] > 0) {
|
||||||
rstKeywords["DEN"] = 0;
|
rstKeywords["DEN"] = 0;
|
||||||
if (aqua_active) {
|
if (aqua_active) {
|
||||||
output.emplace_back(data::CellData{
|
output.insert("WAT_DEN",
|
||||||
"WAT_DEN",
|
Opm::UnitSystem::measure::density,
|
||||||
Opm::UnitSystem::measure::density,
|
adbToDoubleVector(sd.rq[aqua_idx].rho),
|
||||||
adbToDoubleVector(sd.rq[aqua_idx].rho),
|
data::TargetType::RESTART_AUXILLARY);
|
||||||
true});
|
|
||||||
}
|
}
|
||||||
if (liquid_active) {
|
if (liquid_active) {
|
||||||
output.emplace_back(data::CellData{
|
output.insert("OIL_DEN",
|
||||||
"OIL_DEN",
|
Opm::UnitSystem::measure::density,
|
||||||
Opm::UnitSystem::measure::density,
|
adbToDoubleVector(sd.rq[liquid_idx].rho),
|
||||||
adbToDoubleVector(sd.rq[liquid_idx].rho),
|
data::TargetType::RESTART_AUXILLARY);
|
||||||
true});
|
|
||||||
}
|
}
|
||||||
if (vapour_active) {
|
if (vapour_active) {
|
||||||
output.emplace_back(data::CellData{
|
output.insert("GAS_DEN",
|
||||||
"GAS_DEN",
|
Opm::UnitSystem::measure::density,
|
||||||
Opm::UnitSystem::measure::density,
|
adbToDoubleVector(sd.rq[vapour_idx].rho),
|
||||||
adbToDoubleVector(sd.rq[vapour_idx].rho),
|
data::TargetType::RESTART_AUXILLARY);
|
||||||
true});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -539,25 +532,22 @@ namespace Opm
|
|||||||
if (rstKeywords["VISC"] > 0) {
|
if (rstKeywords["VISC"] > 0) {
|
||||||
rstKeywords["VISC"] = 0;
|
rstKeywords["VISC"] = 0;
|
||||||
if (aqua_active) {
|
if (aqua_active) {
|
||||||
output.emplace_back(data::CellData{
|
output.insert("WAT_VISC",
|
||||||
"WAT_VISC",
|
Opm::UnitSystem::measure::viscosity,
|
||||||
Opm::UnitSystem::measure::viscosity,
|
adbToDoubleVector(sd.rq[aqua_idx].mu),
|
||||||
adbToDoubleVector(sd.rq[aqua_idx].mu),
|
data::TargetType::RESTART_AUXILLARY);
|
||||||
true});
|
|
||||||
}
|
}
|
||||||
if (liquid_active) {
|
if (liquid_active) {
|
||||||
output.emplace_back(data::CellData{
|
output.insert("OIL_VISC",
|
||||||
"OIL_VISC",
|
Opm::UnitSystem::measure::viscosity,
|
||||||
Opm::UnitSystem::measure::viscosity,
|
adbToDoubleVector(sd.rq[liquid_idx].mu),
|
||||||
adbToDoubleVector(sd.rq[liquid_idx].mu),
|
data::TargetType::RESTART_AUXILLARY);
|
||||||
true});
|
|
||||||
}
|
}
|
||||||
if (vapour_active) {
|
if (vapour_active) {
|
||||||
output.emplace_back(data::CellData{
|
output.insert("GAS_VISC",
|
||||||
"GAS_VISC",
|
Opm::UnitSystem::measure::viscosity,
|
||||||
Opm::UnitSystem::measure::viscosity,
|
adbToDoubleVector(sd.rq[vapour_idx].mu),
|
||||||
adbToDoubleVector(sd.rq[vapour_idx].mu),
|
data::TargetType::RESTART_AUXILLARY);
|
||||||
true});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -567,11 +557,10 @@ namespace Opm
|
|||||||
if (aqua_active && rstKeywords["KRW"] > 0) {
|
if (aqua_active && rstKeywords["KRW"] > 0) {
|
||||||
if (sd.rq[aqua_idx].kr.size() > 0) {
|
if (sd.rq[aqua_idx].kr.size() > 0) {
|
||||||
rstKeywords["KRW"] = 0;
|
rstKeywords["KRW"] = 0;
|
||||||
output.emplace_back(data::CellData{
|
output.insert("WATKR",
|
||||||
"WATKR",
|
Opm::UnitSystem::measure::permeability,
|
||||||
Opm::UnitSystem::measure::permeability,
|
adbToDoubleVector(sd.rq[aqua_idx].kr),
|
||||||
adbToDoubleVector(sd.rq[aqua_idx].kr),
|
data::TargetType::RESTART_AUXILLARY);
|
||||||
true});
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ( log )
|
if ( log )
|
||||||
@ -584,11 +573,10 @@ namespace Opm
|
|||||||
if (liquid_active && rstKeywords["KRO"] > 0) {
|
if (liquid_active && rstKeywords["KRO"] > 0) {
|
||||||
if (sd.rq[liquid_idx].kr.size() > 0) {
|
if (sd.rq[liquid_idx].kr.size() > 0) {
|
||||||
rstKeywords["KRO"] = 0;
|
rstKeywords["KRO"] = 0;
|
||||||
output.emplace_back(data::CellData{
|
output.insert("OILKR",
|
||||||
"OILKR",
|
Opm::UnitSystem::measure::permeability,
|
||||||
Opm::UnitSystem::measure::permeability,
|
adbToDoubleVector(sd.rq[liquid_idx].kr),
|
||||||
adbToDoubleVector(sd.rq[liquid_idx].kr),
|
data::TargetType::RESTART_AUXILLARY);
|
||||||
true});
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ( log )
|
if ( log )
|
||||||
@ -601,11 +589,10 @@ namespace Opm
|
|||||||
if (vapour_active && rstKeywords["KRG"] > 0) {
|
if (vapour_active && rstKeywords["KRG"] > 0) {
|
||||||
if (sd.rq[vapour_idx].kr.size() > 0) {
|
if (sd.rq[vapour_idx].kr.size() > 0) {
|
||||||
rstKeywords["KRG"] = 0;
|
rstKeywords["KRG"] = 0;
|
||||||
output.emplace_back(data::CellData{
|
output.insert("GASKR",
|
||||||
"GASKR",
|
Opm::UnitSystem::measure::permeability,
|
||||||
Opm::UnitSystem::measure::permeability,
|
adbToDoubleVector(sd.rq[vapour_idx].kr),
|
||||||
adbToDoubleVector(sd.rq[vapour_idx].kr),
|
data::TargetType::RESTART_AUXILLARY);
|
||||||
true});
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ( log )
|
if ( log )
|
||||||
@ -621,19 +608,17 @@ namespace Opm
|
|||||||
*/
|
*/
|
||||||
if (vapour_active && liquid_active && rstKeywords["RSSAT"] > 0) {
|
if (vapour_active && liquid_active && rstKeywords["RSSAT"] > 0) {
|
||||||
rstKeywords["RSSAT"] = 0;
|
rstKeywords["RSSAT"] = 0;
|
||||||
output.emplace_back(data::CellData{
|
output.insert("RSSAT",
|
||||||
"RSSAT",
|
Opm::UnitSystem::measure::gas_oil_ratio,
|
||||||
Opm::UnitSystem::measure::gas_oil_ratio,
|
adbToDoubleVector(sd.rsSat),
|
||||||
adbToDoubleVector(sd.rsSat),
|
data::TargetType::RESTART_AUXILLARY);
|
||||||
true});
|
|
||||||
}
|
}
|
||||||
if (vapour_active && liquid_active && rstKeywords["RVSAT"] > 0) {
|
if (vapour_active && liquid_active && rstKeywords["RVSAT"] > 0) {
|
||||||
rstKeywords["RVSAT"] = 0;
|
rstKeywords["RVSAT"] = 0;
|
||||||
output.emplace_back(data::CellData{
|
output.insert("RVSAT",
|
||||||
"RVSAT",
|
Opm::UnitSystem::measure::oil_gas_ratio,
|
||||||
Opm::UnitSystem::measure::oil_gas_ratio,
|
adbToDoubleVector(sd.rvSat),
|
||||||
adbToDoubleVector(sd.rvSat),
|
data::TargetType::RESTART_AUXILLARY);
|
||||||
true});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -681,11 +666,10 @@ namespace Opm
|
|||||||
* Returns the data as asked for in the summaryConfig
|
* Returns the data as asked for in the summaryConfig
|
||||||
*/
|
*/
|
||||||
template<class Model>
|
template<class Model>
|
||||||
void getSummaryData(
|
void getSummaryData(data::Solution& output,
|
||||||
std::vector<data::CellData>& output,
|
const Opm::PhaseUsage& phaseUsage,
|
||||||
const Opm::PhaseUsage& phaseUsage,
|
const Model& physicalModel,
|
||||||
const Model& physicalModel,
|
const SummaryConfig& summaryConfig) {
|
||||||
const SummaryConfig& summaryConfig) {
|
|
||||||
|
|
||||||
typedef Opm::AutoDiffBlock<double> ADB;
|
typedef Opm::AutoDiffBlock<double> ADB;
|
||||||
|
|
||||||
@ -701,83 +685,74 @@ namespace Opm
|
|||||||
*/
|
*/
|
||||||
// Water in place
|
// Water in place
|
||||||
if (aqua_active && hasFRBKeyword(summaryConfig, "WIP")) {
|
if (aqua_active && hasFRBKeyword(summaryConfig, "WIP")) {
|
||||||
output.emplace_back(data::CellData{
|
output.insert("WIP",
|
||||||
"WIP",
|
Opm::UnitSystem::measure::volume,
|
||||||
Opm::UnitSystem::measure::volume,
|
adbVToDoubleVector(sd.fip[Model::SimulatorData::FIP_AQUA]),
|
||||||
adbVToDoubleVector(sd.fip[Model::SimulatorData::FIP_AQUA]),
|
data::TargetType::SUMMARY );
|
||||||
false});
|
|
||||||
}
|
}
|
||||||
if (liquid_active) {
|
if (liquid_active) {
|
||||||
//Oil in place (liquid phase only)
|
//Oil in place (liquid phase only)
|
||||||
if (hasFRBKeyword(summaryConfig, "OIPL")) {
|
if (hasFRBKeyword(summaryConfig, "OIPL")) {
|
||||||
output.emplace_back(data::CellData{
|
output.insert("OIPL",
|
||||||
"OIPL",
|
Opm::UnitSystem::measure::volume,
|
||||||
Opm::UnitSystem::measure::volume,
|
adbVToDoubleVector(sd.fip[Model::SimulatorData::FIP_LIQUID]),
|
||||||
adbVToDoubleVector(sd.fip[Model::SimulatorData::FIP_LIQUID]),
|
data::TargetType::SUMMARY );
|
||||||
false});
|
|
||||||
}
|
}
|
||||||
//Oil in place (gas phase only)
|
//Oil in place (gas phase only)
|
||||||
if (hasFRBKeyword(summaryConfig, "OIPG")) {
|
if (hasFRBKeyword(summaryConfig, "OIPG")) {
|
||||||
output.emplace_back(data::CellData{
|
output.insert("OIPG",
|
||||||
"OIPG",
|
Opm::UnitSystem::measure::volume,
|
||||||
Opm::UnitSystem::measure::volume,
|
adbVToDoubleVector(sd.fip[Model::SimulatorData::FIP_VAPORIZED_OIL]),
|
||||||
adbVToDoubleVector(sd.fip[Model::SimulatorData::FIP_VAPORIZED_OIL]),
|
data::TargetType::SUMMARY );
|
||||||
false});
|
|
||||||
}
|
}
|
||||||
// Oil in place (in liquid and gas phases)
|
// Oil in place (in liquid and gas phases)
|
||||||
if (hasFRBKeyword(summaryConfig, "OIP")) {
|
if (hasFRBKeyword(summaryConfig, "OIP")) {
|
||||||
ADB::V oip = sd.fip[Model::SimulatorData::FIP_LIQUID] +
|
ADB::V oip = sd.fip[Model::SimulatorData::FIP_LIQUID] +
|
||||||
sd.fip[Model::SimulatorData::FIP_VAPORIZED_OIL];
|
sd.fip[Model::SimulatorData::FIP_VAPORIZED_OIL];
|
||||||
output.emplace_back(data::CellData{
|
output.insert("OIP",
|
||||||
"OIP",
|
Opm::UnitSystem::measure::volume,
|
||||||
Opm::UnitSystem::measure::volume,
|
adbVToDoubleVector(oip),
|
||||||
adbVToDoubleVector(oip),
|
data::TargetType::SUMMARY );
|
||||||
false});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (vapour_active) {
|
if (vapour_active) {
|
||||||
// Gas in place (gas phase only)
|
// Gas in place (gas phase only)
|
||||||
if (hasFRBKeyword(summaryConfig, "GIPG")) {
|
if (hasFRBKeyword(summaryConfig, "GIPG")) {
|
||||||
output.emplace_back(data::CellData{
|
output.insert("GIPG",
|
||||||
"GIPG",
|
Opm::UnitSystem::measure::volume,
|
||||||
Opm::UnitSystem::measure::volume,
|
adbVToDoubleVector(sd.fip[Model::SimulatorData::FIP_VAPOUR]),
|
||||||
adbVToDoubleVector(sd.fip[Model::SimulatorData::FIP_VAPOUR]),
|
data::TargetType::SUMMARY );
|
||||||
false});
|
|
||||||
}
|
}
|
||||||
// Gas in place (liquid phase only)
|
// Gas in place (liquid phase only)
|
||||||
if (hasFRBKeyword(summaryConfig, "GIPL")) {
|
if (hasFRBKeyword(summaryConfig, "GIPL")) {
|
||||||
output.emplace_back(data::CellData{
|
output.insert("GIPL",
|
||||||
"GIPL",
|
Opm::UnitSystem::measure::volume,
|
||||||
Opm::UnitSystem::measure::volume,
|
adbVToDoubleVector(sd.fip[Model::SimulatorData::FIP_DISSOLVED_GAS]),
|
||||||
adbVToDoubleVector(sd.fip[Model::SimulatorData::FIP_DISSOLVED_GAS]),
|
data::TargetType::SUMMARY );
|
||||||
false});
|
|
||||||
}
|
}
|
||||||
// Gas in place (in both liquid and gas phases)
|
// Gas in place (in both liquid and gas phases)
|
||||||
if (hasFRBKeyword(summaryConfig, "GIP")) {
|
if (hasFRBKeyword(summaryConfig, "GIP")) {
|
||||||
ADB::V gip = sd.fip[Model::SimulatorData::FIP_VAPOUR] +
|
ADB::V gip = sd.fip[Model::SimulatorData::FIP_VAPOUR] +
|
||||||
sd.fip[Model::SimulatorData::FIP_DISSOLVED_GAS];
|
sd.fip[Model::SimulatorData::FIP_DISSOLVED_GAS];
|
||||||
output.emplace_back(data::CellData{
|
output.insert("GIP",
|
||||||
"GIP",
|
Opm::UnitSystem::measure::volume,
|
||||||
Opm::UnitSystem::measure::volume,
|
adbVToDoubleVector(gip),
|
||||||
adbVToDoubleVector(gip),
|
data::TargetType::SUMMARY );
|
||||||
false});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Cell pore volume in reservoir conditions
|
// Cell pore volume in reservoir conditions
|
||||||
if (hasFRBKeyword(summaryConfig, "RPV")) {
|
if (hasFRBKeyword(summaryConfig, "RPV")) {
|
||||||
output.emplace_back(data::CellData{
|
output.insert("RPV",
|
||||||
"RPV",
|
Opm::UnitSystem::measure::volume,
|
||||||
Opm::UnitSystem::measure::volume,
|
adbVToDoubleVector(sd.fip[Model::SimulatorData::FIP_PV]),
|
||||||
adbVToDoubleVector(sd.fip[Model::SimulatorData::FIP_PV]),
|
data::TargetType::SUMMARY );
|
||||||
false});
|
|
||||||
}
|
}
|
||||||
// Pressure averaged value (hydrocarbon pore volume weighted)
|
// Pressure averaged value (hydrocarbon pore volume weighted)
|
||||||
if (summaryConfig.hasKeyword("FPRH") || summaryConfig.hasKeyword("RPRH")) {
|
if (summaryConfig.hasKeyword("FPRH") || summaryConfig.hasKeyword("RPRH")) {
|
||||||
output.emplace_back(data::CellData{
|
output.insert("PRH",
|
||||||
"PRH",
|
Opm::UnitSystem::measure::pressure,
|
||||||
Opm::UnitSystem::measure::pressure,
|
adbVToDoubleVector(sd.fip[Model::SimulatorData::FIP_WEIGHTED_PRESSURE]),
|
||||||
adbVToDoubleVector(sd.fip[Model::SimulatorData::FIP_WEIGHTED_PRESSURE]),
|
data::TargetType::SUMMARY );
|
||||||
false});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -800,8 +775,8 @@ namespace Opm
|
|||||||
const int reportStepNum = timer.reportStepNum();
|
const int reportStepNum = timer.reportStepNum();
|
||||||
bool logMessages = output_ && parallelOutput_->isIORank();
|
bool logMessages = output_ && parallelOutput_->isIORank();
|
||||||
|
|
||||||
std::vector<data::CellData> cellData;
|
data::Solution cellData;
|
||||||
detail::getRestartData( cellData, phaseUsage_, physicalModel,
|
detail::getRestartData( cellData, phaseUsage_, physicalModel,
|
||||||
restartConfig, reportStepNum, logMessages );
|
restartConfig, reportStepNum, logMessages );
|
||||||
detail::getSummaryData( cellData, phaseUsage_, physicalModel, summaryConfig );
|
detail::getSummaryData( cellData, phaseUsage_, physicalModel, summaryConfig );
|
||||||
|
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
#include <opm/common/data/SimulationDataContainer.hpp>
|
#include <opm/common/data/SimulationDataContainer.hpp>
|
||||||
|
|
||||||
#include <opm/parser/eclipse/EclipseState/InitConfig/InitConfig.hpp>
|
#include <opm/parser/eclipse/EclipseState/InitConfig/InitConfig.hpp>
|
||||||
#include <opm/output/Cells.hpp>
|
|
||||||
#include <opm/core/simulator/BlackoilState.hpp>
|
#include <opm/core/simulator/BlackoilState.hpp>
|
||||||
#include <opm/core/utility/DataMap.hpp>
|
#include <opm/core/utility/DataMap.hpp>
|
||||||
#include <opm/autodiff/Compat.hpp>
|
#include <opm/autodiff/Compat.hpp>
|
||||||
@ -63,14 +62,14 @@ namespace Opm
|
|||||||
std::unique_ptr< SimulatorTimerInterface > timer_;
|
std::unique_ptr< SimulatorTimerInterface > timer_;
|
||||||
const SimulationDataContainer state_;
|
const SimulationDataContainer state_;
|
||||||
const WellState wellState_;
|
const WellState wellState_;
|
||||||
std::vector<data::CellData> simProps_;
|
data::Solution simProps_;
|
||||||
const bool substep_;
|
const bool substep_;
|
||||||
|
|
||||||
explicit WriterCallEbos( BlackoilOutputWriterEbos& writer,
|
explicit WriterCallEbos( BlackoilOutputWriterEbos& writer,
|
||||||
const SimulatorTimerInterface& timer,
|
const SimulatorTimerInterface& timer,
|
||||||
const SimulationDataContainer& state,
|
const SimulationDataContainer& state,
|
||||||
const WellState& wellState,
|
const WellState& wellState,
|
||||||
const std::vector<data::CellData>& simProps,
|
const data::Solution& simProps,
|
||||||
bool substep )
|
bool substep )
|
||||||
: writer_( writer ),
|
: writer_( writer ),
|
||||||
timer_( timer.clone() ),
|
timer_( timer.clone() ),
|
||||||
@ -98,7 +97,7 @@ namespace Opm
|
|||||||
const WellState& localWellState,
|
const WellState& localWellState,
|
||||||
bool substep)
|
bool substep)
|
||||||
{
|
{
|
||||||
std::vector<data::CellData> noCellProperties;
|
data::Solution noCellProperties;
|
||||||
writeTimeStepWithCellProperties(timer, localState, localWellState, noCellProperties, substep);
|
writeTimeStepWithCellProperties(timer, localState, localWellState, noCellProperties, substep);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -112,7 +111,7 @@ namespace Opm
|
|||||||
const SimulatorTimerInterface& timer,
|
const SimulatorTimerInterface& timer,
|
||||||
const SimulationDataContainer& localState,
|
const SimulationDataContainer& localState,
|
||||||
const WellState& localWellState,
|
const WellState& localWellState,
|
||||||
const std::vector<data::CellData>& cellData,
|
const data::Solution& sol,
|
||||||
bool substep)
|
bool substep)
|
||||||
{
|
{
|
||||||
bool isIORank = output_ ;
|
bool isIORank = output_ ;
|
||||||
@ -137,11 +136,11 @@ namespace Opm
|
|||||||
{
|
{
|
||||||
if( asyncOutput_ ) {
|
if( asyncOutput_ ) {
|
||||||
// dispatch the write call to the extra thread
|
// dispatch the write call to the extra thread
|
||||||
asyncOutput_->dispatch( detail::WriterCallEbos( *this, timer, state, wellState, cellData, substep ) );
|
asyncOutput_->dispatch( detail::WriterCallEbos( *this, timer, state, wellState, sol, substep ) );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// just write the data to disk
|
// just write the data to disk
|
||||||
writeTimeStepSerial( timer, state, wellState, cellData, substep );
|
writeTimeStepSerial( timer, state, wellState, sol, substep );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -153,7 +152,7 @@ namespace Opm
|
|||||||
writeTimeStepSerial(const SimulatorTimerInterface& timer,
|
writeTimeStepSerial(const SimulatorTimerInterface& timer,
|
||||||
const SimulationDataContainer& state,
|
const SimulationDataContainer& state,
|
||||||
const WellState& wellState,
|
const WellState& wellState,
|
||||||
const std::vector<data::CellData>& simProps,
|
const data::Solution& sol,
|
||||||
bool substep)
|
bool substep)
|
||||||
{
|
{
|
||||||
// ECL output
|
// ECL output
|
||||||
@ -167,8 +166,7 @@ namespace Opm
|
|||||||
substep,
|
substep,
|
||||||
timer.simulationTimeElapsed(),
|
timer.simulationTimeElapsed(),
|
||||||
simToSolution( state, phaseUsage_ ),
|
simToSolution( state, phaseUsage_ ),
|
||||||
wellState.report(phaseUsage_),
|
wellState.report(phaseUsage_));
|
||||||
simProps);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,7 +30,6 @@
|
|||||||
#include <opm/core/utility/parameters/ParameterGroup.hpp>
|
#include <opm/core/utility/parameters/ParameterGroup.hpp>
|
||||||
#include <opm/core/wells/DynamicListEconLimited.hpp>
|
#include <opm/core/wells/DynamicListEconLimited.hpp>
|
||||||
|
|
||||||
#include <opm/output/Cells.hpp>
|
|
||||||
#include <opm/output/eclipse/EclipseWriter.hpp>
|
#include <opm/output/eclipse/EclipseWriter.hpp>
|
||||||
|
|
||||||
#include <opm/autodiff/Compat.hpp>
|
#include <opm/autodiff/Compat.hpp>
|
||||||
@ -96,7 +95,7 @@ namespace Opm
|
|||||||
const SimulatorTimerInterface& timer,
|
const SimulatorTimerInterface& timer,
|
||||||
const SimulationDataContainer& reservoirState,
|
const SimulationDataContainer& reservoirState,
|
||||||
const Opm::WellState& wellState,
|
const Opm::WellState& wellState,
|
||||||
const std::vector<data::CellData>& simProps,
|
const data::Solution& sol,
|
||||||
bool substep = false);
|
bool substep = false);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -118,7 +117,7 @@ namespace Opm
|
|||||||
void writeTimeStepSerial(const SimulatorTimerInterface& timer,
|
void writeTimeStepSerial(const SimulatorTimerInterface& timer,
|
||||||
const SimulationDataContainer& reservoirState,
|
const SimulationDataContainer& reservoirState,
|
||||||
const Opm::WellState& wellState,
|
const Opm::WellState& wellState,
|
||||||
const std::vector<data::CellData>& simProps,
|
const data::Solution& simProps,
|
||||||
bool substep);
|
bool substep);
|
||||||
|
|
||||||
/** \brief return output directory */
|
/** \brief return output directory */
|
||||||
@ -262,7 +261,7 @@ namespace Opm
|
|||||||
|
|
||||||
namespace detail {
|
namespace detail {
|
||||||
template<class Model>
|
template<class Model>
|
||||||
std::vector<data::CellData> getCellDataEbos(
|
Opm::data::Solution getOutputDataEbos(
|
||||||
const Opm::PhaseUsage& phaseUsage,
|
const Opm::PhaseUsage& phaseUsage,
|
||||||
const Model& model,
|
const Model& model,
|
||||||
const RestartConfig& restartConfig,
|
const RestartConfig& restartConfig,
|
||||||
@ -270,7 +269,7 @@ namespace Opm
|
|||||||
{
|
{
|
||||||
typedef typename Model::FluidSystem FluidSystem;
|
typedef typename Model::FluidSystem FluidSystem;
|
||||||
|
|
||||||
std::vector<data::CellData> simProps;
|
Opm::data::Solution sol;
|
||||||
|
|
||||||
//Get the value of each of the keys
|
//Get the value of each of the keys
|
||||||
std::map<std::string, int> outKeywords = restartConfig.getRestartKeywords(reportStepNum);
|
std::map<std::string, int> outKeywords = restartConfig.getRestartKeywords(reportStepNum);
|
||||||
@ -278,15 +277,17 @@ namespace Opm
|
|||||||
keyValue.second = restartConfig.getKeyword(keyValue.first, reportStepNum);
|
keyValue.second = restartConfig.getKeyword(keyValue.first, reportStepNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Get shorthands for water, oil, gas
|
|
||||||
const int aqua_active = phaseUsage.phase_used[Opm::PhaseUsage::Aqua];
|
|
||||||
const int liquid_active = phaseUsage.phase_used[Opm::PhaseUsage::Liquid];
|
|
||||||
const int vapour_active = phaseUsage.phase_used[Opm::PhaseUsage::Vapour];
|
|
||||||
|
|
||||||
const auto& ebosModel = model.ebosSimulator().model();
|
const auto& ebosModel = model.ebosSimulator().model();
|
||||||
|
|
||||||
// extract everything which can possibly be written to disk
|
// extract everything which can possibly be written to disk
|
||||||
int numCells = ebosModel.numGridDof();
|
int numCells = ebosModel.numGridDof();
|
||||||
|
|
||||||
|
std::vector<double> pressureOil(numCells);
|
||||||
|
std::vector<double> temperature(numCells);
|
||||||
|
|
||||||
|
std::vector<double> satWater(numCells);
|
||||||
|
std::vector<double> satGas(numCells);
|
||||||
|
|
||||||
std::vector<double> bWater(numCells);
|
std::vector<double> bWater(numCells);
|
||||||
std::vector<double> bOil(numCells);
|
std::vector<double> bOil(numCells);
|
||||||
std::vector<double> bGas(numCells);
|
std::vector<double> bGas(numCells);
|
||||||
@ -305,15 +306,27 @@ namespace Opm
|
|||||||
|
|
||||||
std::vector<double> Rs(numCells);
|
std::vector<double> Rs(numCells);
|
||||||
std::vector<double> Rv(numCells);
|
std::vector<double> Rv(numCells);
|
||||||
|
std::vector<double> RsSat(numCells);
|
||||||
|
std::vector<double> RvSat(numCells);
|
||||||
|
|
||||||
for (int cellIdx = 0; cellIdx < numCells; ++cellIdx) {
|
for (int cellIdx = 0; cellIdx < numCells; ++cellIdx) {
|
||||||
const auto& intQuants = *ebosModel.cachedIntensiveQuantities(cellIdx, /*timeIdx=*/0);
|
const auto& intQuants = *ebosModel.cachedIntensiveQuantities(cellIdx, /*timeIdx=*/0);
|
||||||
const auto& fs = intQuants.fluidState();
|
const auto& fs = intQuants.fluidState();
|
||||||
|
|
||||||
|
pressureOil[cellIdx] = fs.pressure(FluidSystem::oilPhaseIdx).value;
|
||||||
|
|
||||||
|
temperature[cellIdx] = fs.temperature(FluidSystem::oilPhaseIdx).value;
|
||||||
|
|
||||||
|
satWater[cellIdx] = fs.saturation(FluidSystem::waterPhaseIdx).value;
|
||||||
|
satGas[cellIdx] = fs.saturation(FluidSystem::gasPhaseIdx).value;
|
||||||
|
|
||||||
bWater[cellIdx] = fs.invB(FluidSystem::waterPhaseIdx).value;
|
bWater[cellIdx] = fs.invB(FluidSystem::waterPhaseIdx).value;
|
||||||
bOil[cellIdx] = fs.invB(FluidSystem::oilPhaseIdx).value;
|
bOil[cellIdx] = fs.invB(FluidSystem::oilPhaseIdx).value;
|
||||||
bGas[cellIdx] = fs.invB(FluidSystem::gasPhaseIdx).value;
|
bGas[cellIdx] = fs.invB(FluidSystem::gasPhaseIdx).value;
|
||||||
|
|
||||||
|
Rs[cellIdx] = fs.Rs().value;
|
||||||
|
Rs[cellIdx] = fs.Rv().value;
|
||||||
|
|
||||||
rhoWater[cellIdx] = fs.density(FluidSystem::waterPhaseIdx).value;
|
rhoWater[cellIdx] = fs.density(FluidSystem::waterPhaseIdx).value;
|
||||||
rhoOil[cellIdx] = fs.density(FluidSystem::oilPhaseIdx).value;
|
rhoOil[cellIdx] = fs.density(FluidSystem::oilPhaseIdx).value;
|
||||||
rhoGas[cellIdx] = fs.density(FluidSystem::gasPhaseIdx).value;
|
rhoGas[cellIdx] = fs.density(FluidSystem::gasPhaseIdx).value;
|
||||||
@ -326,39 +339,85 @@ namespace Opm
|
|||||||
krOil[cellIdx] = intQuants.relativePermeability(FluidSystem::oilPhaseIdx).value;
|
krOil[cellIdx] = intQuants.relativePermeability(FluidSystem::oilPhaseIdx).value;
|
||||||
krGas[cellIdx] = intQuants.relativePermeability(FluidSystem::gasPhaseIdx).value;
|
krGas[cellIdx] = intQuants.relativePermeability(FluidSystem::gasPhaseIdx).value;
|
||||||
|
|
||||||
Rs[cellIdx] = FluidSystem::saturatedDissolutionFactor(fs,
|
RsSat[cellIdx] = FluidSystem::saturatedDissolutionFactor(fs,
|
||||||
FluidSystem::oilPhaseIdx,
|
FluidSystem::oilPhaseIdx,
|
||||||
intQuants.pvtRegionIndex(),
|
intQuants.pvtRegionIndex(),
|
||||||
/*maxOilSaturation=*/1.0).value;
|
/*maxOilSaturation=*/1.0).value;
|
||||||
Rv[cellIdx] = FluidSystem::saturatedDissolutionFactor(fs,
|
RvSat[cellIdx] = FluidSystem::saturatedDissolutionFactor(fs,
|
||||||
FluidSystem::gasPhaseIdx,
|
FluidSystem::gasPhaseIdx,
|
||||||
intQuants.pvtRegionIndex(),
|
intQuants.pvtRegionIndex(),
|
||||||
/*maxOilSaturation=*/1.0).value;
|
/*maxOilSaturation=*/1.0).value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Oil Pressures
|
||||||
|
*/
|
||||||
|
outKeywords["PRESSURE"] = 0;
|
||||||
|
sol.insert("PRESSURE",
|
||||||
|
UnitSystem::measure::pressure,
|
||||||
|
std::move(pressureOil),
|
||||||
|
data::TargetType::RESTART_SOLUTION);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Temperatures
|
||||||
|
*/
|
||||||
|
outKeywords["TEMP"] = 0;
|
||||||
|
sol.insert("TEMP",
|
||||||
|
UnitSystem::measure::temperature,
|
||||||
|
std::move(temperature),
|
||||||
|
data::TargetType::RESTART_SOLUTION);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Water and gas saturation.
|
||||||
|
*/
|
||||||
|
outKeywords["SWAT"] = 0;
|
||||||
|
outKeywords["SGAS"] = 0;
|
||||||
|
sol.insert("SWAT",
|
||||||
|
UnitSystem::measure::identity,
|
||||||
|
std::move(satWater),
|
||||||
|
data::TargetType::RESTART_SOLUTION);
|
||||||
|
sol.insert("SGAS",
|
||||||
|
UnitSystem::measure::identity,
|
||||||
|
std::move(satGas),
|
||||||
|
data::TargetType::RESTART_SOLUTION);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* the dissolution factors
|
||||||
|
*/
|
||||||
|
outKeywords["RS"] = 0;
|
||||||
|
outKeywords["RV"] = 0;
|
||||||
|
sol.insert("RS",
|
||||||
|
UnitSystem::measure::gas_oil_ratio,
|
||||||
|
std::move(Rs),
|
||||||
|
data::TargetType::RESTART_SOLUTION);
|
||||||
|
sol.insert("RV",
|
||||||
|
UnitSystem::measure::oil_gas_ratio,
|
||||||
|
std::move(Rv),
|
||||||
|
data::TargetType::RESTART_SOLUTION);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Formation volume factors for water, oil, gas
|
* Formation volume factors for water, oil, gas
|
||||||
*/
|
*/
|
||||||
if (aqua_active && outKeywords["BW"] > 0) {
|
if (outKeywords["BW"] > 0) {
|
||||||
outKeywords["BW"] = 0;
|
outKeywords["BW"] = 0;
|
||||||
simProps.emplace_back(data::CellData{
|
sol.insert("BW",
|
||||||
"1OVERBW",
|
Opm::UnitSystem::measure::water_inverse_formation_volume_factor,
|
||||||
Opm::UnitSystem::measure::water_inverse_formation_volume_factor,
|
std::move(bWater),
|
||||||
std::move(bWater)});
|
data::TargetType::RESTART_AUXILLARY);
|
||||||
}
|
}
|
||||||
if (liquid_active && outKeywords["BO"] > 0) {
|
if (outKeywords["BO"] > 0) {
|
||||||
outKeywords["BO"] = 0;
|
outKeywords["BO"] = 0;
|
||||||
simProps.emplace_back(data::CellData{
|
sol.insert("BO",
|
||||||
"1OVERBO",
|
Opm::UnitSystem::measure::oil_inverse_formation_volume_factor,
|
||||||
Opm::UnitSystem::measure::oil_inverse_formation_volume_factor,
|
std::move(bOil),
|
||||||
std::move(bOil)});
|
data::TargetType::RESTART_AUXILLARY);
|
||||||
}
|
}
|
||||||
if (vapour_active && outKeywords["BG"] > 0) {
|
if (outKeywords["BG"] > 0) {
|
||||||
outKeywords["BG"] = 0;
|
outKeywords["BG"] = 0;
|
||||||
simProps.emplace_back(data::CellData{
|
sol.insert("BG",
|
||||||
"1OVERBG",
|
Opm::UnitSystem::measure::gas_inverse_formation_volume_factor,
|
||||||
Opm::UnitSystem::measure::gas_inverse_formation_volume_factor,
|
std::move(bGas),
|
||||||
std::move(bGas)});
|
data::TargetType::RESTART_AUXILLARY);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -366,24 +425,19 @@ namespace Opm
|
|||||||
*/
|
*/
|
||||||
if (outKeywords["DEN"] > 0) {
|
if (outKeywords["DEN"] > 0) {
|
||||||
outKeywords["DEN"] = 0;
|
outKeywords["DEN"] = 0;
|
||||||
if (aqua_active) {
|
|
||||||
simProps.emplace_back(data::CellData{
|
sol.insert("WAT_DEN",
|
||||||
"WAT_DEN",
|
Opm::UnitSystem::measure::density,
|
||||||
Opm::UnitSystem::measure::density,
|
std::move(rhoWater),
|
||||||
std::move(rhoWater)});
|
data::TargetType::RESTART_AUXILLARY);
|
||||||
}
|
sol.insert("OIL_DEN",
|
||||||
if (liquid_active) {
|
Opm::UnitSystem::measure::density,
|
||||||
simProps.emplace_back(data::CellData{
|
std::move(rhoOil),
|
||||||
"OIL_DEN",
|
data::TargetType::RESTART_AUXILLARY);
|
||||||
Opm::UnitSystem::measure::density,
|
sol.insert("GAS_DEN",
|
||||||
std::move(rhoOil)});
|
Opm::UnitSystem::measure::density,
|
||||||
}
|
std::move(rhoGas),
|
||||||
if (vapour_active) {
|
data::TargetType::RESTART_AUXILLARY);
|
||||||
simProps.emplace_back(data::CellData{
|
|
||||||
"GAS_DEN",
|
|
||||||
Opm::UnitSystem::measure::density,
|
|
||||||
std::move(rhoGas)});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -391,78 +445,71 @@ namespace Opm
|
|||||||
*/
|
*/
|
||||||
if (outKeywords["VISC"] > 0) {
|
if (outKeywords["VISC"] > 0) {
|
||||||
outKeywords["VISC"] = 0;
|
outKeywords["VISC"] = 0;
|
||||||
if (aqua_active) {
|
sol.insert("WAT_VISC",
|
||||||
simProps.emplace_back(data::CellData{
|
Opm::UnitSystem::measure::viscosity,
|
||||||
"WAT_VISC",
|
std::move(muWater),
|
||||||
Opm::UnitSystem::measure::viscosity,
|
data::TargetType::RESTART_AUXILLARY);
|
||||||
std::move(muWater)});
|
sol.insert("OIL_VISC",
|
||||||
}
|
Opm::UnitSystem::measure::viscosity,
|
||||||
if (liquid_active) {
|
std::move(muOil),
|
||||||
simProps.emplace_back(data::CellData{
|
data::TargetType::RESTART_AUXILLARY);
|
||||||
"OIL_VISC",
|
sol.insert("GAS_VISC",
|
||||||
Opm::UnitSystem::measure::viscosity,
|
Opm::UnitSystem::measure::viscosity,
|
||||||
std::move(muOil)});
|
std::move(muGas),
|
||||||
}
|
data::TargetType::RESTART_AUXILLARY);
|
||||||
if (vapour_active) {
|
|
||||||
simProps.emplace_back(data::CellData{
|
|
||||||
"GAS_VISC",
|
|
||||||
Opm::UnitSystem::measure::viscosity,
|
|
||||||
std::move(muGas)});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Relative permeabilities for water, oil, gas
|
* Relative permeabilities for water, oil, gas
|
||||||
*/
|
*/
|
||||||
if (aqua_active && outKeywords["KRW"] > 0) {
|
if (outKeywords["KRW"] > 0) {
|
||||||
outKeywords["KRW"] = 0;
|
outKeywords["KRW"] = 0;
|
||||||
simProps.emplace_back(data::CellData{
|
sol.insert("WATKR",
|
||||||
"WATKR",
|
Opm::UnitSystem::measure::identity,
|
||||||
Opm::UnitSystem::measure::permeability,
|
std::move(krWater),
|
||||||
std::move(krWater)});
|
data::TargetType::RESTART_AUXILLARY);
|
||||||
}
|
}
|
||||||
if (liquid_active && outKeywords["KRO"] > 0) {
|
if (outKeywords["KRO"] > 0) {
|
||||||
outKeywords["KRO"] = 0;
|
outKeywords["KRO"] = 0;
|
||||||
simProps.emplace_back(data::CellData{
|
sol.insert("OILKR",
|
||||||
"OILKR",
|
Opm::UnitSystem::measure::identity,
|
||||||
Opm::UnitSystem::measure::permeability,
|
std::move(krOil),
|
||||||
std::move(krOil)});
|
data::TargetType::RESTART_AUXILLARY);
|
||||||
}
|
}
|
||||||
if (vapour_active && outKeywords["KRG"] > 0) {
|
if (outKeywords["KRG"] > 0) {
|
||||||
outKeywords["KRG"] = 0;
|
outKeywords["KRG"] = 0;
|
||||||
simProps.emplace_back(data::CellData{
|
sol.insert("GASKR",
|
||||||
"GASKR",
|
Opm::UnitSystem::measure::identity,
|
||||||
Opm::UnitSystem::measure::permeability,
|
std::move(krGas),
|
||||||
std::move(krGas)});
|
data::TargetType::RESTART_AUXILLARY);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Vaporized and dissolved gas/oil ratio
|
* Vaporized and dissolved gas/oil ratio
|
||||||
*/
|
*/
|
||||||
if (vapour_active && liquid_active && outKeywords["RSSAT"] > 0) {
|
if (outKeywords["RSSAT"] > 0) {
|
||||||
outKeywords["RSSAT"] = 0;
|
outKeywords["RSSAT"] = 0;
|
||||||
simProps.emplace_back(data::CellData{
|
sol.insert("RSSAT",
|
||||||
"RSSAT",
|
Opm::UnitSystem::measure::gas_oil_ratio,
|
||||||
Opm::UnitSystem::measure::gas_oil_ratio,
|
std::move(RsSat),
|
||||||
std::move(Rs)});
|
data::TargetType::RESTART_AUXILLARY);
|
||||||
}
|
}
|
||||||
if (vapour_active && liquid_active && outKeywords["RVSAT"] > 0) {
|
if (outKeywords["RVSAT"] > 0) {
|
||||||
outKeywords["RVSAT"] = 0;
|
outKeywords["RVSAT"] = 0;
|
||||||
simProps.emplace_back(data::CellData{
|
sol.insert("RVSAT",
|
||||||
"RVSAT",
|
Opm::UnitSystem::measure::oil_gas_ratio,
|
||||||
Opm::UnitSystem::measure::oil_gas_ratio,
|
std::move(RvSat),
|
||||||
std::move(Rv)});
|
data::TargetType::RESTART_AUXILLARY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bubble point and dew point pressures
|
* Bubble point and dew point pressures
|
||||||
*/
|
*/
|
||||||
if (vapour_active && liquid_active && outKeywords["PBPD"] > 0) {
|
if (outKeywords["PBPD"] > 0) {
|
||||||
outKeywords["PBPD"] = 0;
|
|
||||||
Opm::OpmLog::warning("Bubble/dew point pressure output unsupported",
|
Opm::OpmLog::warning("Bubble/dew point pressure output unsupported",
|
||||||
"Writing bubble points and dew points (PBPD) to file is unsupported, "
|
"Writing bubble points and dew points (PBPD) to file is unsupported, "
|
||||||
"as the simulator does not use these internally.");
|
"as the simulator does not use these internally.");
|
||||||
}
|
}
|
||||||
|
|
||||||
//Warn for any unhandled keyword
|
//Warn for any unhandled keyword
|
||||||
@ -475,7 +522,7 @@ namespace Opm
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return simProps;
|
return sol;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -493,8 +540,8 @@ namespace Opm
|
|||||||
{
|
{
|
||||||
const RestartConfig& restartConfig = eclipseState_->getRestartConfig();
|
const RestartConfig& restartConfig = eclipseState_->getRestartConfig();
|
||||||
const int reportStepNum = timer.reportStepNum();
|
const int reportStepNum = timer.reportStepNum();
|
||||||
std::vector<data::CellData> cellData = detail::getCellDataEbos( phaseUsage_, physicalModel, restartConfig, reportStepNum );
|
Opm::data::Solution sol = detail::getOutputDataEbos( phaseUsage_, physicalModel, restartConfig, reportStepNum );
|
||||||
writeTimeStepWithCellProperties(timer, localState, localWellState, cellData, substep);
|
writeTimeStepWithCellProperties(timer, localState, localWellState, sol, substep);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -610,10 +610,9 @@ namespace Opm
|
|||||||
const std::string& output_dir)
|
const std::string& output_dir)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_ERT
|
#ifdef HAVE_ERT
|
||||||
using ds = data::Solution::key;
|
|
||||||
data::Solution sol;
|
data::Solution sol;
|
||||||
sol.insert( ds::PRESSURE, state.pressure() );
|
sol.insert( "PRESSURE", UnitSystem::measure::pressure , state.pressure() , data::TargetType::RESTART_SOLUTION );
|
||||||
sol.insert( ds::SWAT, destripe( state.saturation(), 0, 2 ) );
|
sol.insert( "SWAT", UnitSystem::measure::identity, destripe( state.saturation(), 0, 2 ) , data::TargetType::RESTART_SOLUTION);
|
||||||
|
|
||||||
writeECLData( grid.cartdims[ 0 ],
|
writeECLData( grid.cartdims[ 0 ],
|
||||||
grid.cartdims[ 1 ],
|
grid.cartdims[ 1 ],
|
||||||
|
Loading…
Reference in New Issue
Block a user