Merge remote-tracking branch 'origin/master' into frankenstein_merge_master

This commit is contained in:
Andreas Lauser 2016-09-28 21:11:25 +02:00
commit 36b00ba570
27 changed files with 358 additions and 141 deletions

View File

@ -145,7 +145,5 @@ if (HAVE_OPM_DATA)
$<TARGET_FILE:flow> ${OPM_DATA_ROOT}/spe1/SPE1CASE2.DATA ${OPM_DATA_ROOT}/spe1/SPE1CASE2_RESTART.DATA ) $<TARGET_FILE:flow> ${OPM_DATA_ROOT}/spe1/SPE1CASE2.DATA ${OPM_DATA_ROOT}/spe1/SPE1CASE2_RESTART.DATA )
endif() endif()
include (${CMAKE_CURRENT_SOURCE_DIR}/compareECLFiles.cmake) include (${CMAKE_CURRENT_SOURCE_DIR}/compareECLFiles.cmake)
endif() endif()

View File

@ -1,29 +1,29 @@
# Set absolute tolerance to be used for testing # Set absolute tolerance to be used for testing
set(abs_tol 2e-2) set(abs_tol 2e-2)
set(rel_tol 1e-5) set(rel_tol 1e-5)
# Define some paths # Define some paths
set(RESULT_PATH ${PROJECT_BINARY_DIR}/tests/results) set(BASE_RESULT_PATH ${PROJECT_BINARY_DIR}/tests/results)
# Create directory to store upscaling results in
########################################################################### ###########################################################################
# TEST: compareECLFiles # TEST: compareECLFiles
########################################################################### ###########################################################################
# Input: # Input:
# - casename: basename (no extension) # - casename: basename (no extension)
# #
macro (add_test_compareECLFiles casename filename) macro (add_test_compareECLFiles casename filename)
set(RESULT_PATH ${BASE_RESULT_PATH}/${casename})
# Add test that runs flow and outputs the results to file # Add test that runs flow and outputs the results to file
opm_add_test(compareECLFiles_${filename} NO_COMPILE opm_add_test(compareECLFiles_${filename} NO_COMPILE
EXE_NAME flow EXE_NAME flow
DRIVER_ARGS ${OPM_DATA_ROOT}/${casename} ${RESULT_PATH} DRIVER_ARGS ${OPM_DATA_ROOT}/${casename} ${RESULT_PATH}
${CMAKE_BINARY_DIR}/bin ${CMAKE_BINARY_DIR}/bin
${filename} ${filename}
${abs_tol} ${rel_tol} ${abs_tol} ${rel_tol}
${SUMMARY_REGRESSION_TEST_COMMAND} ${COMPARE_SUMMARY_COMMAND}
${RESTART_REGRESSION_TEST_COMMAND} ${COMPARE_ECL_COMMAND}
${INIT_REGRESSION_TEST_COMMAND}
TEST_ARGS ${OPM_DATA_ROOT}/${casename}/${filename}.DATA ) TEST_ARGS ${OPM_DATA_ROOT}/${casename}/${filename}.DATA )
endmacro (add_test_compareECLFiles) endmacro (add_test_compareECLFiles)
@ -32,8 +32,8 @@ if(NOT TARGET test-suite)
add_custom_target(test-suite) add_custom_target(test-suite)
endif() endif()
opm_set_test_driver(${PROJECT_SOURCE_DIR}/tests/run-regressionTest.sh "") opm_set_test_driver(${PROJECT_SOURCE_DIR}/tests/run-regressionTest.sh "")
add_test_compareECLFiles(spe9 SPE9_CP) add_test_compareECLFiles(spe1 SPE1CASE2)
add_test_compareECLFiles(spe3 SPE3CASE1)
add_test_compareECLFiles(spe9 SPE9_CP_SHORT)

View File

@ -93,8 +93,8 @@ namespace Opm {
struct SimulatorData { struct SimulatorData {
SimulatorData(int num_phases); SimulatorData(int num_phases);
std::vector<ReservoirResidualQuant> rq; std::vector<ReservoirResidualQuant> rq;
ADB rs; ADB rsSat;
ADB rv; ADB rvSat;
}; };
typedef typename ModelTraits<Implementation>::ReservoirState ReservoirState; typedef typename ModelTraits<Implementation>::ReservoirState ReservoirState;
@ -212,6 +212,9 @@ namespace Opm {
ReservoirState& reservoir_state, ReservoirState& reservoir_state,
WellState& well_state); WellState& well_state);
/// Return true if this is a parallel run.
bool isParallel() const;
/// Return true if output to cout is wanted. /// Return true if output to cout is wanted.
bool terminalOutputEnabled() const; bool terminalOutputEnabled() const;
@ -284,7 +287,7 @@ namespace Opm {
bool use_threshold_pressure_; bool use_threshold_pressure_;
V threshold_pressures_by_connection_; V threshold_pressures_by_connection_;
SimulatorData sd_; mutable SimulatorData sd_;
std::vector<PhasePresence> phaseCondition_; std::vector<PhasePresence> phaseCondition_;
// Well Model // Well Model

View File

@ -185,7 +185,26 @@ typedef Eigen::Array<double,
} }
template <class Grid, class WellModel, class Implementation>
bool
BlackoilModelBase<Grid, WellModel, Implementation>::
isParallel() const
{
#if HAVE_MPI
if ( linsolver_.parallelInformation().type() !=
typeid(ParallelISTLInformation) )
{
return false;
}
else
{
const auto& comm =boost::any_cast<const ParallelISTLInformation&>(linsolver_.parallelInformation()).communicator();
return comm.size() > 1;
}
#else
return false;
#endif
}
template <class Grid, class WellModel, class Implementation> template <class Grid, class WellModel, class Implementation>
@ -403,8 +422,8 @@ typedef Eigen::Array<double,
BlackoilModelBase<Grid, WellModel, Implementation>:: BlackoilModelBase<Grid, WellModel, Implementation>::
SimulatorData::SimulatorData(int num_phases) SimulatorData::SimulatorData(int num_phases)
: rq(num_phases) : rq(num_phases)
, rs(ADB::null()) , rsSat(ADB::null())
, rv(ADB::null()) , rvSat(ADB::null())
{ {
} }
@ -591,17 +610,17 @@ typedef Eigen::Array<double,
if (active_[ Oil ]) { if (active_[ Oil ]) {
// RS and RV is only defined if both oil and gas phase are active. // RS and RV is only defined if both oil and gas phase are active.
const ADB rsSat = fluidRsSat(state.canonical_phase_pressures[ Oil ], so , cells_); sd_.rsSat = fluidRsSat(state.canonical_phase_pressures[ Oil ], so , cells_);
if (has_disgas_) { if (has_disgas_) {
state.rs = (1-isRs_)*rsSat + isRs_*xvar; state.rs = (1-isRs_)*sd_.rsSat + isRs_*xvar;
} else { } else {
state.rs = rsSat; state.rs = sd_.rsSat;
} }
const ADB rvSat = fluidRvSat(state.canonical_phase_pressures[ Gas ], so , cells_); sd_.rvSat = fluidRvSat(state.canonical_phase_pressures[ Gas ], so , cells_);
if (has_vapoil_) { if (has_vapoil_) {
state.rv = (1-isRv_)*rvSat + isRv_*xvar; state.rv = (1-isRv_)*sd_.rvSat + isRv_*xvar;
} else { } else {
state.rv = rvSat; state.rv = sd_.rvSat;
} }
} }
} }
@ -779,7 +798,7 @@ typedef Eigen::Array<double,
{ {
const std::vector<ADB> kr = asImpl().computeRelPerm(state); const std::vector<ADB> kr = asImpl().computeRelPerm(state);
for (int phaseIdx=0; phaseIdx < fluid_.numPhases(); ++phaseIdx) { for (int phaseIdx = 0; phaseIdx < fluid_.numPhases(); ++phaseIdx) {
sd_.rq[phaseIdx].kr = kr[canph_[phaseIdx]]; sd_.rq[phaseIdx].kr = kr[canph_[phaseIdx]];
} }
} }
@ -1219,6 +1238,7 @@ typedef Eigen::Array<double,
if (has_disgas_) { if (has_disgas_) {
const V rsSat0 = fluidRsSat(p_old, s_old.col(pu.phase_pos[Oil]), cells_); const V rsSat0 = fluidRsSat(p_old, s_old.col(pu.phase_pos[Oil]), cells_);
const V rsSat = fluidRsSat(p, so, cells_); const V rsSat = fluidRsSat(p, so, cells_);
sd_.rsSat = ADB::constant(rsSat);
// The obvious case // The obvious case
auto hasGas = (sg > 0 && isRs_ == 0); auto hasGas = (sg > 0 && isRs_ == 0);
@ -1244,6 +1264,7 @@ typedef Eigen::Array<double,
const V gaspress = computeGasPressure(p, sw, so, sg); const V gaspress = computeGasPressure(p, sw, so, sg);
const V rvSat0 = fluidRvSat(gaspress_old, s_old.col(pu.phase_pos[Oil]), cells_); const V rvSat0 = fluidRvSat(gaspress_old, s_old.col(pu.phase_pos[Oil]), cells_);
const V rvSat = fluidRvSat(gaspress, so, cells_); const V rvSat = fluidRvSat(gaspress, so, cells_);
sd_.rvSat = ADB::constant(rvSat);
// The obvious case // The obvious case
auto hasOil = (so > 0 && isRv_ == 0); auto hasOil = (so > 0 && isRv_ == 0);
@ -2160,29 +2181,85 @@ typedef Eigen::Array<double,
fip[4] = rv.value() * fip[pg]; fip[4] = rv.value() * fip[pg];
} }
const int dims = *std::max_element(fipnum.begin(), fipnum.end()); // For a parallel run this is just a local maximum and needs to be updated later
int dims = *std::max_element(fipnum.begin(), fipnum.end());
std::vector<V> values(dims, V::Zero(7)); std::vector<V> values(dims, V::Zero(7));
for (int i = 0; i < 5; ++i) {
const V hydrocarbon = saturation[Oil].value() + saturation[Gas].value();
V hcpv;
V pres;
if ( !isParallel() )
{
for (int i = 0; i < 5; ++i) {
for (int c = 0; c < nc; ++c) {
if (fipnum[c] != 0) {
values[fipnum[c]-1][i] += fip[i][c];
}
}
}
hcpv = V::Zero(dims);
pres = V::Zero(dims);
for (int c = 0; c < nc; ++c) { for (int c = 0; c < nc; ++c) {
if (fipnum[c] != 0) { if (fipnum[c] != 0) {
values[fipnum[c]-1][i] += fip[i][c]; hcpv[fipnum[c]-1] += pv[c] * hydrocarbon[c];
pres[fipnum[c]-1] += pv[c] * pressure.value()[c];
values[fipnum[c]-1][5] += pv[c];
values[fipnum[c]-1][6] += pv[c] * pressure.value()[c] * hydrocarbon[c];
} }
} }
} }
else
{
#if HAVE_MPI
// mask[c] is 1 if we need to compute something in parallel
const auto & pinfo =
boost::any_cast<const ParallelISTLInformation&>(linsolver_.parallelInformation());
const auto& mask = pinfo.getOwnerMask();
auto comm = pinfo.communicator();
// Compute the global dims value and resize values accordingly.
dims = comm.max(dims);
values.resize(dims, V::Zero(7));
// compute PAV and PORV for every regions. for (int i = 0; i < 5; ++i) {
const V hydrocarbon = saturation[Oil].value() + saturation[Gas].value(); for (int c = 0; c < nc; ++c) {
V hcpv = V::Zero(nc); if (fipnum[c] != 0 && mask[c]) {
V pres = V::Zero(nc); values[fipnum[c]-1][i] += fip[i][c];
for (int c = 0; c < nc; ++c) { }
if (fipnum[c] != 0) { }
hcpv[fipnum[c]-1] += pv[c] * hydrocarbon[c];
pres[fipnum[c]-1] += pv[c] * pressure.value()[c];
values[fipnum[c]-1][5] += pv[c];
values[fipnum[c]-1][6] += pv[c] * pressure.value()[c] * hydrocarbon[c];
} }
hcpv = V::Zero(dims);
pres = V::Zero(dims);
for (int c = 0; c < nc; ++c) {
if (fipnum[c] != 0 && mask[c]) {
hcpv[fipnum[c]-1] += pv[c] * hydrocarbon[c];
pres[fipnum[c]-1] += pv[c] * pressure.value()[c];
values[fipnum[c]-1][5] += pv[c];
values[fipnum[c]-1][6] += pv[c] * pressure.value()[c] * hydrocarbon[c];
}
}
// For the frankenstein branch we hopefully can turn values into a vanilla
// std::vector<double>, use some index magic above, use one communication
// to sum up the vector entries instead of looping over the regions.
for(int reg=0; reg < dims; ++reg)
{
comm.sum(values[reg].data(), values[reg].size());
}
comm.sum(hcpv.data(), hcpv.size());
comm.sum(pres.data(), pres.size());
#else
// This should never happen!
OPM_THROW(std::logic_error, "HAVE_MPI should be defined if we are running in parallel");
#endif
} }
// compute PAV and PORV for every regions.
for (int reg = 0; reg < dims; ++reg) { for (int reg = 0; reg < dims; ++reg) {
if (hcpv[reg] != 0) { if (hcpv[reg] != 0) {
values[reg][6] /= hcpv[reg]; values[reg][6] /= hcpv[reg];
@ -2192,7 +2269,6 @@ typedef Eigen::Array<double,
} }
return values; return values;
} }
} // namespace Opm } // namespace Opm

View File

@ -220,17 +220,17 @@ namespace Opm {
if (active_[ Oil ]) { if (active_[ Oil ]) {
// RS and RV is only defined if both oil and gas phase are active. // RS and RV is only defined if both oil and gas phase are active.
state.canonical_phase_pressures = computePressures(state.pressure, state.saturation[pu.phase_pos[ Water ]], so, sg, state.solvent_saturation); state.canonical_phase_pressures = computePressures(state.pressure, state.saturation[pu.phase_pos[ Water ]], so, sg, state.solvent_saturation);
const ADB rsSat = fluidRsSat(state.canonical_phase_pressures[ Oil ], so , cells_); sd_.rsSat = fluidRsSat(state.canonical_phase_pressures[ Oil ], so , cells_);
if (has_disgas_) { if (has_disgas_) {
state.rs = (1-Base::isRs_)*rsSat + Base::isRs_*xvar; state.rs = (1-Base::isRs_)*sd_.rsSat + Base::isRs_*xvar;
} else { } else {
state.rs = rsSat; state.rs = sd_.rsSat;
} }
const ADB rvSat = fluidRvSat(state.canonical_phase_pressures[ Gas ], so , cells_); sd_.rvSat = fluidRvSat(state.canonical_phase_pressures[ Gas ], so , cells_);
if (has_vapoil_) { if (has_vapoil_) {
state.rv = (1-Base::isRv_)*rvSat + Base::isRv_*xvar; state.rv = (1-Base::isRv_)*sd_.rvSat + Base::isRv_*xvar;
} else { } else {
state.rv = rvSat; state.rv = sd_.rvSat;
} }
} }
} }
@ -549,6 +549,7 @@ namespace Opm {
if (has_disgas_) { if (has_disgas_) {
const V rsSat0 = fluidRsSat(p_old, s_old.col(pu.phase_pos[Oil]), cells_); const V rsSat0 = fluidRsSat(p_old, s_old.col(pu.phase_pos[Oil]), cells_);
const V rsSat = fluidRsSat(p, so, cells_); const V rsSat = fluidRsSat(p, so, cells_);
sd_.rsSat = ADB::constant(rsSat);
// The obvious case // The obvious case
auto hasGas = (sg > 0 && Base::isRs_ == 0); auto hasGas = (sg > 0 && Base::isRs_ == 0);
@ -574,6 +575,7 @@ namespace Opm {
const V gaspress = computeGasPressure(p, sw, so, sg); const V gaspress = computeGasPressure(p, sw, so, sg);
const V rvSat0 = fluidRvSat(gaspress_old, s_old.col(pu.phase_pos[Oil]), cells_); const V rvSat0 = fluidRvSat(gaspress_old, s_old.col(pu.phase_pos[Oil]), cells_);
const V rvSat = fluidRvSat(gaspress, so, cells_); const V rvSat = fluidRvSat(gaspress, so, cells_);
sd_.rvSat = ADB::constant(rvSat);
// The obvious case // The obvious case
auto hasOil = (so > 0 && Base::isRv_ == 0); auto hasOil = (so > 0 && Base::isRv_ == 0);

View File

@ -215,6 +215,9 @@ namespace Opm
std::unique_ptr<Simulator> simulator_; std::unique_ptr<Simulator> simulator_;
// create log file // create log file
std::string logFile_; std::string logFile_;
// The names of wells that are artifically defunct in parallel runs.
// Those wells are handled on a another process.
std::unordered_set<std::string> defunct_well_names_;
// ------------ Methods ------------ // ------------ Methods ------------
@ -599,10 +602,11 @@ namespace Opm
// If there are more than one processors involved, we now repartition the grid // If there are more than one processors involved, we now repartition the grid
// and initilialize new properties and states for it. // and initilialize new properties and states for it.
if (must_distribute_) { if (must_distribute_) {
distributeGridAndData(grid_init_->grid(), deck_, eclipse_state_, defunct_well_names_ =
*state_, *fluidprops_, *geoprops_, distributeGridAndData(grid_init_->grid(), deck_, eclipse_state_,
material_law_manager_, threshold_pressures_, *state_, *fluidprops_, *geoprops_,
parallel_information_, use_local_perm_); material_law_manager_, threshold_pressures_,
parallel_information_, use_local_perm_);
} }
} }
@ -812,7 +816,8 @@ namespace Opm
Base::deck_->hasKeyword("VAPOIL"), Base::deck_->hasKeyword("VAPOIL"),
Base::eclipse_state_, Base::eclipse_state_,
*Base::output_writer_, *Base::output_writer_,
Base::threshold_pressures_)); Base::threshold_pressures_,
Base::defunct_well_names_));
} }
}; };

View File

@ -111,21 +111,8 @@ namespace Opm
// Get grid from parser. // Get grid from parser.
EclipseGridConstPtr eclgrid = eclState->getInputGrid(); EclipseGridConstPtr eclgrid = eclState->getInputGrid();
// Pore volume. // update the pore volume of all active cells in the grid
// New keywords MINPVF will add some PV due to OPM cpgrid process algorithm. computePoreVolume_(grid, eclState);
// But the default behavior is to get the comparable pore volume with ECLIPSE.
for (int cellIdx = 0; cellIdx < numCells; ++cellIdx) {
int cartesianCellIdx = AutoDiffGrid::globalCell(grid)[cellIdx];
pvol_[cellIdx] =
props.porosity()[cellIdx]
* multpv[cartesianCellIdx]
* ntg[cartesianCellIdx];
if (eclgrid->getMinpvMode() == MinpvMode::ModeEnum::OpmFIL) {
pvol_[cellIdx] *= AutoDiffGrid::cellVolume(grid, cellIdx);
} else {
pvol_[cellIdx] *= eclgrid->getCellVolume(cartesianCellIdx);
}
}
// Non-neighbour connections. // Non-neighbour connections.
nnc_ = eclState->getInputNNC(); nnc_ = eclState->getInputNNC();
@ -304,6 +291,59 @@ namespace Opm
Opm::EclipseStateConstPtr eclState, Opm::EclipseStateConstPtr eclState,
std::vector<double> &ntg); std::vector<double> &ntg);
template <class GridType>
void computePoreVolume_(const GridType &grid,
Opm::EclipseStateConstPtr eclState)
{
int numCells = Opm::AutoDiffGrid::numCells(grid);
const int* globalCell = Opm::UgGridHelpers::globalCell(grid);
EclipseGridConstPtr eclGrid = eclState->getInputGrid();
const int nx = eclGrid->getNX();
const int ny = eclGrid->getNY();
// the "raw" pore volume.
const std::vector<double>& porvData =
eclState->get3DProperties().getDoubleGridProperty("PORV").getData();
pvol_.resize(numCells);
// the "activation number" grid property
const std::vector<int>& actnumData =
eclState->get3DProperties().getIntGridProperty("ACTNUM").getData();
for (int cellIdx = 0; cellIdx < numCells; ++cellIdx) {
const int cellCartIdx = globalCell[cellIdx];
double cellPoreVolume = porvData[cellCartIdx];
if (eclGrid->getMinpvMode() == MinpvMode::ModeEnum::OpmFIL) {
// Sum the pore volumes of the cells above which have been deactivated
// because their volume less is less than the MINPV threshold
for (int aboveCellCartIdx = cellCartIdx - nx*ny;
aboveCellCartIdx >= 0;
aboveCellCartIdx -= nx*ny)
{
if (porvData[aboveCellCartIdx] >= eclGrid->getMinpvValue()) {
// stop if we encounter a cell which has a pore volume which is
// at least as large as the minimum one
break;
}
const double aboveCellVolume = eclGrid->getCellVolume(aboveCellCartIdx);
if (actnumData[aboveCellCartIdx] == 0 && aboveCellVolume > 1e-6) {
// stop at explicitly disabled cells, but only if their volume is
// greater than 10^-6 m^3
break;
}
cellPoreVolume += porvData[aboveCellCartIdx];
}
}
pvol_[cellIdx] = cellPoreVolume;
}
}
template <class Grid> template <class Grid>
void pinchProcess_(const Grid& grid, void pinchProcess_(const Grid& grid,
const Opm::EclipseState& eclState, const Opm::EclipseState& eclState,

View File

@ -698,7 +698,7 @@ namespace Opm
SolutionVector dx = newtonIncrement.computeNewtonIncrement( residual ); SolutionVector dx = newtonIncrement.computeNewtonIncrement( residual );
// get number of linear iterations // get number of linear iterations
iterations_ = newtonIncrement.iterations(); iterations_ = newtonIncrement.iterations();
return std::move(dx); return dx;
} }
const boost::any& NewtonIterationBlackoilInterleaved::parallelInformation() const const boost::any& NewtonIterationBlackoilInterleaved::parallelInformation() const

View File

@ -19,6 +19,8 @@
#ifndef OPM_PARALLELDEBUGOUTPUT_HEADER_INCLUDED #ifndef OPM_PARALLELDEBUGOUTPUT_HEADER_INCLUDED
#define OPM_PARALLELDEBUGOUTPUT_HEADER_INCLUDED #define OPM_PARALLELDEBUGOUTPUT_HEADER_INCLUDED
#include <unordered_set>
#include <opm/common/data/SimulationDataContainer.hpp> #include <opm/common/data/SimulationDataContainer.hpp>
@ -543,7 +545,14 @@ namespace Opm
Opm::UgGridHelpers::beginFaceCentroids( globalGrid ), Opm::UgGridHelpers::beginFaceCentroids( globalGrid ),
permeability_, permeability_,
dynamic_list_econ_limited, dynamic_list_econ_limited,
false); false
// We need to pass the optionaly arguments
// as we get the following error otherwise
// with c++ (Debian 4.9.2-10) 4.9.2 and -std=c++11
// converting to const std::unordered_set<std::basic_string<char> > from initializer list would use explicit constructor
, std::vector<double>(),
std::unordered_set<std::string>()
);
const Wells* wells = wells_manager.c_wells(); const Wells* wells = wells_manager.c_wells();
globalWellState_.init(wells, *globalReservoirState_, globalWellState_ ); globalWellState_.init(wells, *globalReservoirState_, globalWellState_ );

View File

@ -1,8 +1,8 @@
/* /*
Copyright 2015 Dr. Blatt - HPC-Simulation-Software & Services. Copyright 2015-2016 Dr. Blatt - HPC-Simulation-Software & Services.
Coypright 2015 NTNU Coypright 2015 NTNU
Copyright 2015 Statoil AS Copyright 2015-2016 Statoil AS
Copyright 2015 IRIS AS Copyright 2015 IRIS AS
This file is part of the Open Porous Media project (OPM). This file is part of the Open Porous Media project (OPM).
@ -22,6 +22,9 @@
#ifndef OPM_REDISTRIBUTEDATAHANDLES_HEADER #ifndef OPM_REDISTRIBUTEDATAHANDLES_HEADER
#define OPM_REDISTRIBUTEDATAHANDLES_HEADER #define OPM_REDISTRIBUTEDATAHANDLES_HEADER
#include <unordered_set>
#include <string>
#include <opm/core/simulator/BlackoilState.hpp> #include <opm/core/simulator/BlackoilState.hpp>
#include <opm/autodiff/BlackoilPropsAdFromDeck.hpp> #include <opm/autodiff/BlackoilPropsAdFromDeck.hpp>
@ -33,17 +36,19 @@ namespace Opm
{ {
template <class Grid> template <class Grid>
inline void distributeGridAndData( Grid& , inline std::unordered_set<std::string>
Opm::DeckConstPtr , distributeGridAndData( Grid& ,
EclipseStateConstPtr , Opm::DeckConstPtr ,
BlackoilState& , EclipseStateConstPtr ,
BlackoilPropsAdFromDeck& , BlackoilState& ,
DerivedGeology&, BlackoilPropsAdFromDeck& ,
std::shared_ptr<BlackoilPropsAdFromDeck::MaterialLawManager>&, DerivedGeology&,
std::vector<double>&, std::shared_ptr<BlackoilPropsAdFromDeck::MaterialLawManager>&,
boost::any& , std::vector<double>&,
const bool ) boost::any& ,
const bool )
{ {
return std::unordered_set<std::string>();
} }
#if HAVE_OPM_GRID && HAVE_MPI #if HAVE_OPM_GRID && HAVE_MPI
@ -413,22 +418,25 @@ private:
}; };
inline inline
void distributeGridAndData( Dune::CpGrid& grid, std::unordered_set<std::string>
Opm::DeckConstPtr deck, distributeGridAndData( Dune::CpGrid& grid,
EclipseStateConstPtr eclipseState, Opm::DeckConstPtr deck,
BlackoilState& state, EclipseStateConstPtr eclipseState,
BlackoilPropsAdFromDeck& properties, BlackoilState& state,
DerivedGeology& geology, BlackoilPropsAdFromDeck& properties,
std::shared_ptr<BlackoilPropsAdFromDeck::MaterialLawManager>& material_law_manager, DerivedGeology& geology,
std::vector<double>& threshold_pressures, std::shared_ptr<BlackoilPropsAdFromDeck::MaterialLawManager>& material_law_manager,
boost::any& parallelInformation, std::vector<double>& threshold_pressures,
const bool useLocalPerm) boost::any& parallelInformation,
const bool useLocalPerm)
{ {
Dune::CpGrid global_grid ( grid ); Dune::CpGrid global_grid ( grid );
global_grid.switchToGlobalView(); global_grid.switchToGlobalView();
// distribute the grid and switch to the distributed view // distribute the grid and switch to the distributed view
grid.loadBalance(eclipseState, geology.transmissibility().data()); using std::get;
auto my_defunct_wells = get<1>(grid.loadBalance(eclipseState,
geology.transmissibility().data()));
grid.switchToDistributedView(); grid.switchToDistributedView();
std::vector<int> compressedToCartesianIdx; std::vector<int> compressedToCartesianIdx;
Opm::createGlobalCellArray(grid, compressedToCartesianIdx); Opm::createGlobalCellArray(grid, compressedToCartesianIdx);
@ -493,6 +501,8 @@ void distributeGridAndData( Dune::CpGrid& grid,
material_law_manager = distributed_material_law_manager; material_law_manager = distributed_material_law_manager;
threshold_pressures = distributed_pressures; threshold_pressures = distributed_pressures;
extractParallelGridInformationToISTL(grid, parallelInformation); extractParallelGridInformationToISTL(grid, parallelInformation);
return my_defunct_wells;
} }
#endif #endif

View File

@ -130,7 +130,8 @@ namespace Opm
const bool vapoil, const bool vapoil,
std::shared_ptr<EclipseState> eclipse_state, std::shared_ptr<EclipseState> eclipse_state,
OutputWriter& output_writer, OutputWriter& output_writer,
const std::vector<double>& threshold_pressures_by_face); const std::vector<double>& threshold_pressures_by_face,
const std::unordered_set<std::string>& defunct_well_names);
/// Run the simulation. /// Run the simulation.
/// This will run succesive timesteps until timer.done() is true. It will /// This will run succesive timesteps until timer.done() is true. It will
@ -214,6 +215,10 @@ namespace Opm
std::vector<double> threshold_pressures_by_face_; std::vector<double> threshold_pressures_by_face_;
// Whether this a parallel simulation or not // Whether this a parallel simulation or not
bool is_parallel_run_; bool is_parallel_run_;
// The names of wells that should be defunct
// (e.g. in a parallel run when they are handeled by
// a different process)
std::unordered_set<std::string> defunct_well_names_;
}; };
} // namespace Opm } // namespace Opm

View File

@ -20,6 +20,7 @@
*/ */
#include <utility> #include <utility>
#include <functional>
#include <algorithm> #include <algorithm>
#include <locale> #include <locale>
#include <opm/parser/eclipse/EclipseState/Schedule/Events.hpp> #include <opm/parser/eclipse/EclipseState/Schedule/Events.hpp>
@ -43,7 +44,8 @@ namespace Opm
const bool has_vapoil, const bool has_vapoil,
std::shared_ptr<EclipseState> eclipse_state, std::shared_ptr<EclipseState> eclipse_state,
OutputWriter& output_writer, OutputWriter& output_writer,
const std::vector<double>& threshold_pressures_by_face) const std::vector<double>& threshold_pressures_by_face,
const std::unordered_set<std::string>& defunct_well_names)
: param_(param), : param_(param),
model_param_(param), model_param_(param),
solver_param_(param), solver_param_(param),
@ -60,7 +62,8 @@ namespace Opm
output_writer_(output_writer), output_writer_(output_writer),
rateConverter_(props_, std::vector<int>(AutoDiffGrid::numCells(grid_), 0)), rateConverter_(props_, std::vector<int>(AutoDiffGrid::numCells(grid_), 0)),
threshold_pressures_by_face_(threshold_pressures_by_face), threshold_pressures_by_face_(threshold_pressures_by_face),
is_parallel_run_( false ) is_parallel_run_( false ),
defunct_well_names_(defunct_well_names)
{ {
// Misc init. // Misc init.
const int num_cells = AutoDiffGrid::numCells(grid); const int num_cells = AutoDiffGrid::numCells(grid);
@ -167,7 +170,8 @@ namespace Opm
props_.permeability(), props_.permeability(),
dynamic_list_econ_limited, dynamic_list_econ_limited,
is_parallel_run_, is_parallel_run_,
well_potentials); well_potentials,
defunct_well_names_);
const Wells* wells = wells_manager.c_wells(); const Wells* wells = wells_manager.c_wells();
WellState well_state; WellState well_state;
well_state.init(wells, state, prev_well_state); well_state.init(wells, state, prev_well_state);
@ -698,9 +702,38 @@ namespace Opm
const V sg = pu.phase_used[BlackoilPhases::Vapour] ? V(s.col(BlackoilPhases::Vapour)) : V::Zero(nc); const V sg = pu.phase_used[BlackoilPhases::Vapour] ? V(s.col(BlackoilPhases::Vapour)) : V::Zero(nc);
const V hydrocarbon = so + sg; const V hydrocarbon = so + sg;
const V p = Eigen::Map<const V>(& state.pressure()[0], nc); const V p = Eigen::Map<const V>(& state.pressure()[0], nc);
totals[5] = geo_.poreVolume().sum(); if ( ! is_parallel_run_ )
totals[6] = unit::convert::to((p * geo_.poreVolume() * hydrocarbon).sum() / ((geo_.poreVolume() * hydrocarbon).sum()), unit::barsa); {
totals[5] = geo_.poreVolume().sum();
totals[6] = unit::convert::to((p * geo_.poreVolume() * hydrocarbon).sum() / ((geo_.poreVolume() * hydrocarbon).sum()), unit::barsa);
}
else
{
#if HAVE_MPI
const auto & pinfo =
boost::any_cast<const ParallelISTLInformation&>(solver_.parallelInformation());
auto operators = std::make_tuple(Opm::Reduction::makeGlobalSumFunctor<double>(),
Opm::Reduction::makeGlobalSumFunctor<double>(),
Opm::Reduction::makeGlobalSumFunctor<double>());
auto pav_nom = p * geo_.poreVolume() * hydrocarbon;
auto pav_denom = geo_.poreVolume() * hydrocarbon;
// using ref cref to prevent copying
auto inputs = std::make_tuple(std::cref(geo_.poreVolume()),
std::cref(pav_nom), std::cref(pav_denom));
std::tuple<double, double, double> results(0.0, 0.0, 0.0);
pinfo.computeReduction(inputs, operators, results);
using std::get;
totals[5] = get<0>(results);
totals[6] = unit::convert::to(get<1>(results)/get<2>(results),
unit::barsa);
#else
// This should never happen!
OPM_THROW(std::logic_error, "HAVE_MPI should be defined if we are running in parallel");
#endif
}
return totals; return totals;
} }

View File

@ -62,9 +62,10 @@ public:
const bool vapoil, const bool vapoil,
std::shared_ptr<EclipseState> eclipse_state, std::shared_ptr<EclipseState> eclipse_state,
BlackoilOutputWriter& output_writer, BlackoilOutputWriter& output_writer,
const std::vector<double>& threshold_pressures_by_face) const std::vector<double>& threshold_pressures_by_face,
const std::unordered_set<std::string>& defunct_well_names)
: Base(param, grid, geo, props, rock_comp_props, linsolver, gravity, disgas, vapoil, : Base(param, grid, geo, props, rock_comp_props, linsolver, gravity, disgas, vapoil,
eclipse_state, output_writer, threshold_pressures_by_face) eclipse_state, output_writer, threshold_pressures_by_face, defunct_well_names)
{} {}
}; };

View File

@ -73,9 +73,10 @@ public:
const bool vapoil, const bool vapoil,
std::shared_ptr<EclipseState> eclipse_state, std::shared_ptr<EclipseState> eclipse_state,
BlackoilOutputWriter& output_writer, BlackoilOutputWriter& output_writer,
const std::vector<double>& threshold_pressures_by_face) const std::vector<double>& threshold_pressures_by_face,
const std::unordered_set<std::string>& defunct_well_names)
: Base(param, grid, geo, props, rock_comp_props, linsolver, gravity, disgas, vapoil, : Base(param, grid, geo, props, rock_comp_props, linsolver, gravity, disgas, vapoil,
eclipse_state, output_writer, threshold_pressures_by_face) eclipse_state, output_writer, threshold_pressures_by_face, defunct_well_names)
{} {}

View File

@ -108,7 +108,13 @@ namespace Opm
Opm::UgGridHelpers::beginFaceCentroids(grid_), Opm::UgGridHelpers::beginFaceCentroids(grid_),
props_.permeability(), props_.permeability(),
dynamic_list_econ_limited, dynamic_list_econ_limited,
is_parallel_run_); is_parallel_run_,
// We need to pass the optionaly arguments
// as we get the following error otherwise
// with c++ (Debian 4.9.2-10) 4.9.2 and -std=c++11
// converting to const std::unordered_set<std::basic_string<char> > from initializer list would use explicit constructor
std::vector<double>(), // null well_potentials
Base::defunct_well_names_);
const Wells* wells = wells_manager.c_wells(); const Wells* wells = wells_manager.c_wells();
WellState well_state; WellState well_state;
// well_state.init(wells, state, prev_well_state); // well_state.init(wells, state, prev_well_state);

View File

@ -379,7 +379,7 @@ namespace Opm
substep, substep,
timer.simulationTimeElapsed(), timer.simulationTimeElapsed(),
simToSolution( state, phaseUsage_ ), simToSolution( state, phaseUsage_ ),
wellState.report(), wellState.report(phaseUsage_),
simProps); simProps);
} }
} }

View File

@ -397,7 +397,14 @@ namespace Opm
Opm::UgGridHelpers::cell2Faces(grid), Opm::UgGridHelpers::cell2Faces(grid),
Opm::UgGridHelpers::beginFaceCentroids(grid), Opm::UgGridHelpers::beginFaceCentroids(grid),
permeability, permeability,
dummy_list_econ_limited); dummy_list_econ_limited
// We need to pass the optionaly arguments
// as we get the following error otherwise
// with c++ (Debian 4.9.2-10) 4.9.2 and -std=c++11
// converting to const std::unordered_set<std::basic_string<char> > from initializer list would use explicit constructo
, false,
std::vector<double>(),
std::unordered_set<std::string>());
const Wells* wells = wellsmanager.c_wells(); const Wells* wells = wellsmanager.c_wells();
wellstate.resize(wells, simulatorstate); //Resize for restart step wellstate.resize(wells, simulatorstate); //Resize for restart step
@ -579,14 +586,14 @@ namespace Opm
simProps.emplace_back(data::CellData{ simProps.emplace_back(data::CellData{
"RSSAT", "RSSAT",
Opm::UnitSystem::measure::gas_oil_ratio, Opm::UnitSystem::measure::gas_oil_ratio,
std::move(adbToDoubleVector(sd.rs))}); std::move(adbToDoubleVector(sd.rsSat))});
} }
if (vapour_active && liquid_active && outKeywords["RVSAT"] > 0) { if (vapour_active && liquid_active && outKeywords["RVSAT"] > 0) {
outKeywords["RVSAT"] = 0; outKeywords["RVSAT"] = 0;
simProps.emplace_back(data::CellData{ simProps.emplace_back(data::CellData{
"RVSAT", "RVSAT",
Opm::UnitSystem::measure::oil_gas_ratio, Opm::UnitSystem::measure::oil_gas_ratio,
std::move(adbToDoubleVector(sd.rv))}); std::move(adbToDoubleVector(sd.rvSat))});
} }

View File

@ -50,7 +50,9 @@ namespace Opm
has_vapoil, has_vapoil,
eclipse_state, eclipse_state,
output_writer, output_writer,
threshold_pressures_by_face) threshold_pressures_by_face,
// names of deactivated wells in parallel run
std::unordered_set<std::string>())
, has_solvent_(has_solvent) , has_solvent_(has_solvent)
, deck_(deck) , deck_(deck)
, solvent_props_(solvent_props) , solvent_props_(solvent_props)

View File

@ -65,7 +65,9 @@ public:
BlackoilOutputWriter& output_writer, BlackoilOutputWriter& output_writer,
const std::vector<double>& threshold_pressures_by_face) const std::vector<double>& threshold_pressures_by_face)
: Base(param, grid, geo, props, rock_comp_props, linsolver, gravity, disgas, vapoil, : Base(param, grid, geo, props, rock_comp_props, linsolver, gravity, disgas, vapoil,
eclipse_state, output_writer, threshold_pressures_by_face) eclipse_state, output_writer, threshold_pressures_by_face,
// names of deactivated wells in parallel run
std::unordered_set<std::string>())
{} {}
}; };

View File

@ -25,6 +25,7 @@
#include <opm/core/well_controls.h> #include <opm/core/well_controls.h>
#include <opm/core/simulator/WellState.hpp> #include <opm/core/simulator/WellState.hpp>
#include <opm/autodiff/BlackoilModelEnums.hpp> #include <opm/autodiff/BlackoilModelEnums.hpp>
#include <opm/core/props/BlackoilPhases.hpp>
#include <opm/common/ErrorMacros.hpp> #include <opm/common/ErrorMacros.hpp>
#include <vector> #include <vector>
#include <cassert> #include <cassert>

View File

@ -257,7 +257,7 @@ namespace Opm {
/// Computing the water velocity without shear-thinning for the cell faces. /// Computing the water velocity without shear-thinning for the cell faces.
/// The water velocity will be used for shear-thinning calculation. /// The water velocity will be used for shear-thinning calculation.
void computeWaterShearVelocityFaces(const V& transi, const std::vector<ADB>& kr, void computeWaterShearVelocityFaces(const V& transi,
const std::vector<ADB>& phasePressure, const SolutionState& state, const std::vector<ADB>& phasePressure, const SolutionState& state,
std::vector<double>& water_vel, std::vector<double>& visc_mult); std::vector<double>& water_vel, std::vector<double>& visc_mult);

View File

@ -291,14 +291,19 @@ namespace Opm {
// Set up the common parts of the mass balance equations // Set up the common parts of the mass balance equations
// for each active phase. // for each active phase.
const V transi = subset(geo_.transmissibility(), ops_.internal_faces); const V transi = subset(geo_.transmissibility(), ops_.internal_faces);
const std::vector<ADB> kr = computeRelPerm(state); {
const std::vector<ADB> kr = computeRelPerm(state);
for (int phaseIdx = 0; phaseIdx < fluid_.numPhases(); ++phaseIdx) {
sd_.rq[phaseIdx].kr = kr[canph_[phaseIdx]];
}
}
if (has_plyshlog_) { if (has_plyshlog_) {
std::vector<double> water_vel; std::vector<double> water_vel;
std::vector<double> visc_mult; std::vector<double> visc_mult;
computeWaterShearVelocityFaces(transi, kr, state.canonical_phase_pressures, state, water_vel, visc_mult); computeWaterShearVelocityFaces(transi, state.canonical_phase_pressures, state, water_vel, visc_mult);
if ( !polymer_props_ad_.computeShearMultLog(water_vel, visc_mult, shear_mult_faces_) ) { if ( !polymer_props_ad_.computeShearMultLog(water_vel, visc_mult, shear_mult_faces_) ) {
// std::cerr << " failed in calculating the shear-multiplier " << std::endl; // std::cerr << " failed in calculating the shear-multiplier " << std::endl;
OPM_THROW(std::runtime_error, " failed in calculating the shear-multiplier. "); OPM_THROW(std::runtime_error, " failed in calculating the shear-multiplier. ");
@ -307,9 +312,9 @@ namespace Opm {
for (int phaseIdx = 0; phaseIdx < fluid_.numPhases(); ++phaseIdx) { for (int phaseIdx = 0; phaseIdx < fluid_.numPhases(); ++phaseIdx) {
const std::vector<PhasePresence>& cond = phaseCondition(); const std::vector<PhasePresence>& cond = phaseCondition();
const ADB mu = fluidViscosity(canph_[phaseIdx], state.canonical_phase_pressures[canph_[phaseIdx]], state.temperature, state.rs, state.rv, cond); sd_.rq[phaseIdx].mu = fluidViscosity(canph_[phaseIdx], state.canonical_phase_pressures[canph_[phaseIdx]], state.temperature, state.rs, state.rv, cond);
const ADB rho = fluidDensity(canph_[phaseIdx], sd_.rq[phaseIdx].b, state.rs, state.rv); sd_.rq[phaseIdx].rho = fluidDensity(canph_[phaseIdx], sd_.rq[phaseIdx].b, state.rs, state.rv);
computeMassFlux(phaseIdx, transi, kr[canph_[phaseIdx]], mu, rho, state.canonical_phase_pressures[canph_[phaseIdx]], state); computeMassFlux(phaseIdx, transi, sd_.rq[phaseIdx].kr, sd_.rq[phaseIdx].mu, sd_.rq[phaseIdx].rho, state.canonical_phase_pressures[canph_[phaseIdx]], state);
residual_.material_balance_eq[ phaseIdx ] = residual_.material_balance_eq[ phaseIdx ] =
pvdt_ * (sd_.rq[phaseIdx].accum[1] - sd_.rq[phaseIdx].accum[0]) pvdt_ * (sd_.rq[phaseIdx].accum[1] - sd_.rq[phaseIdx].accum[0])
@ -585,7 +590,7 @@ namespace Opm {
template<class Grid> template<class Grid>
void void
BlackoilPolymerModel<Grid>::computeWaterShearVelocityFaces(const V& transi, const std::vector<ADB>& kr, BlackoilPolymerModel<Grid>::computeWaterShearVelocityFaces(const V& transi,
const std::vector<ADB>& phasePressure, const SolutionState& state, const std::vector<ADB>& phasePressure, const SolutionState& state,
std::vector<double>& water_vel, std::vector<double>& visc_mult) std::vector<double>& water_vel, std::vector<double>& visc_mult)
{ {
@ -598,7 +603,7 @@ namespace Opm {
const ADB tr_mult = transMult(state.pressure); const ADB tr_mult = transMult(state.pressure);
const ADB mu = fluidViscosity(canonicalPhaseIdx, phasePressure[canonicalPhaseIdx], state.temperature, state.rs, state.rv, cond); const ADB mu = fluidViscosity(canonicalPhaseIdx, phasePressure[canonicalPhaseIdx], state.temperature, state.rs, state.rv, cond);
sd_.rq[phase].mob = tr_mult * kr[canonicalPhaseIdx] / mu; sd_.rq[phase].mob = tr_mult * sd_.rq[phase].kr / mu;
// compute gravity potensial using the face average as in eclipse and MRST // compute gravity potensial using the face average as in eclipse and MRST
const ADB rho = fluidDensity(canonicalPhaseIdx, sd_.rq[phase].b, state.rs, state.rv); const ADB rho = fluidDensity(canonicalPhaseIdx, sd_.rq[phase].b, state.rs, state.rv);
@ -617,7 +622,7 @@ namespace Opm {
const ADB mc = computeMc(state); const ADB mc = computeMc(state);
ADB krw_eff = polymer_props_ad_.effectiveRelPerm(state.concentration, ADB krw_eff = polymer_props_ad_.effectiveRelPerm(state.concentration,
cmax, cmax,
kr[canonicalPhaseIdx]); sd_.rq[phase].kr);
ADB inv_wat_eff_visc = polymer_props_ad_.effectiveInvWaterVisc(state.concentration, mu.value()); ADB inv_wat_eff_visc = polymer_props_ad_.effectiveInvWaterVisc(state.concentration, mu.value());
sd_.rq[ phase ].mob = tr_mult * krw_eff * inv_wat_eff_visc; sd_.rq[ phase ].mob = tr_mult * krw_eff * inv_wat_eff_visc;

View File

@ -78,13 +78,13 @@ namespace Opm {
struct SimulatorData { struct SimulatorData {
SimulatorData(int num_phases) SimulatorData(int num_phases)
: rq(num_phases) : rq(num_phases)
, rs(ADB::null()) , rsSat(ADB::null())
, rv(ADB::null()) , rvSat(ADB::null())
{ {
} }
std::vector<ReservoirResidualQuant> rq; std::vector<ReservoirResidualQuant> rq;
ADB rs; ADB rsSat;
ADB rv; ADB rvSat;
}; };
/// Construct a solver. It will retain references to the /// Construct a solver. It will retain references to the

View File

@ -51,7 +51,9 @@ namespace Opm
has_vapoil, has_vapoil,
eclipse_state, eclipse_state,
output_writer, output_writer,
threshold_pressures_by_face) threshold_pressures_by_face,
// names of deactivated wells in parallel run
std::unordered_set<std::string>())
, polymer_props_(polymer_props) , polymer_props_(polymer_props)
, has_polymer_(has_polymer) , has_polymer_(has_polymer)
, has_plyshlog_(has_plyshlog) , has_plyshlog_(has_plyshlog)

View File

@ -48,7 +48,9 @@ SimulatorFullyImplicitCompressiblePolymer(const parameter::ParameterGroup& param
/*vapoil=*/false, /*vapoil=*/false,
eclipse_state, eclipse_state,
output_writer, output_writer,
/*threshold_pressures_by_face=*/std::vector<double>()) /*threshold_pressures_by_face=*/std::vector<double>(),
// names of deactivated wells in parallel run
std::unordered_set<std::string>())
, deck_(deck) , deck_(deck)
, polymer_props_(polymer_props) , polymer_props_(polymer_props)

View File

@ -7,23 +7,23 @@ BINPATH="$3"
FILENAME="$4" FILENAME="$4"
ABS_TOL="$5" ABS_TOL="$5"
REL_TOL="$6" REL_TOL="$6"
SUMMARY_REGRESSION_TEST_COMMAND="$7" COMPARE_SUMMARY_COMMAND="$7"
RESTART_REGRESSION_TEST_COMMAND="$8" COMPARE_ECL_COMMAND="$8"
INIT_REGRESSION_TEST_COMMAND="$9" EXE_NAME="${9}"
EXE_NAME="${10}" shift 9
shift 10
TEST_ARGS="$@" TEST_ARGS="$@"
rm -Rf ${RESULT_PATH}
rm -Rf ${RESULT_PATH};
mkdir -p ${RESULT_PATH} mkdir -p ${RESULT_PATH}
cd ${RESULT_PATH} cd ${RESULT_PATH}
${BINPATH}/${EXE_NAME} ${TEST_ARGS} ${BINPATH}/${EXE_NAME} ${TEST_ARGS}
cd .. cd ..
${SUMMARY_REGRESSION_TEST_COMMAND} ${RESULT_PATH}/${FILENAME} ${INPUT_DATA_PATH}/opm-simulation-reference/${FILENAME} ${ABS_TOL} ${REL_TOL} ${COMPARE_SUMMARY_COMMAND} -r ${RESULT_PATH}/${FILENAME} ${INPUT_DATA_PATH}/opm-simulation-reference/${FILENAME} ${ABS_TOL} ${REL_TOL}
${COMPARE_ECL_COMMAND} ${RESULT_PATH}/${FILENAME} ${INPUT_DATA_PATH}/opm-simulation-reference/${FILENAME} ${ABS_TOL} ${REL_TOL}
${COMPARE_ECL_COMMAND} -t INIT ${RESULT_PATH}/${FILENAME} ${INPUT_DATA_PATH}/opm-simulation-reference/${FILENAME} ${ABS_TOL} ${REL_TOL}
${RESTART_REGRESSION_TEST_COMMAND} ${RESULT_PATH}/${FILENAME} ${INPUT_DATA_PATH}/opm-simulation-reference/${FILENAME} ${ABS_TOL} ${REL_TOL}
${INIT_REGRESSION_TEST_COMMAND} ${RESULT_PATH}/${FILENAME} ${INPUT_DATA_PATH}/opm-simulation-reference/${FILENAME} ${ABS_TOL} ${REL_TOL}

View File

@ -28,6 +28,7 @@
#define BOOST_TEST_MODULE MultisegmentWellsTest #define BOOST_TEST_MODULE MultisegmentWellsTest
#include <vector> #include <vector>
#include <unordered_set>
#include <memory> #include <memory>
#include <array> #include <array>
@ -106,7 +107,13 @@ struct SetupMSW {
Opm::UgGridHelpers::beginFaceCentroids(grid), Opm::UgGridHelpers::beginFaceCentroids(grid),
fluidprops->permeability(), fluidprops->permeability(),
dummy_dynamic_list, dummy_dynamic_list,
false); false
// We need to pass the optionaly arguments
// as we get the following error otherwise
// with c++ (Debian 4.9.2-10) 4.9.2 and -std=c++11
// converting to const std::unordered_set<std::basic_string<char> > from initializer list would use explicit constructor
, std::vector<double>(), // null well_potentials
std::unordered_set<std::string>());
const Wells* wells = wells_manager.c_wells(); const Wells* wells = wells_manager.c_wells();
const auto wells_ecl = ecl_state->getSchedule()->getWells(current_timestep); const auto wells_ecl = ecl_state->getSchedule()->getWells(current_timestep);