Use new well implementation Well2 from opm-common

This commit is contained in:
Joakim Hove
2019-05-02 12:51:25 +02:00
parent a3361794cf
commit b6840db604
28 changed files with 241 additions and 257 deletions

View File

@@ -27,7 +27,7 @@
#include <opm/parser/eclipse/Parser/Parser.hpp>
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Group.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/GroupTree.hpp>
@@ -62,7 +62,7 @@ BOOST_AUTO_TEST_CASE(AddWellsAndGroupToCollection) {
// Add wells to WellCollection
WellCollection wellCollection;
auto wells = sched.getWells();
const auto wells = sched.getWells2atEnd();
for (size_t i=0; i<wells.size(); i++) {
collection.addWell(wells[i], 2, pu);
}
@@ -98,7 +98,7 @@ BOOST_AUTO_TEST_CASE(EfficiencyFactor) {
BOOST_CHECK_EQUAL(1.0, collection.findNode("G2")->getParent()->efficiencyFactor());
// Add wells to WellCollection
auto wells1 = sched.getWells(timestep);
const auto wells1 = sched.getWells2(timestep);
for (size_t i=0; i<wells1.size(); i++) {
collection.addWell(wells1[i], timestep, pu);
}

View File

@@ -134,9 +134,9 @@ BOOST_GLOBAL_FIXTURE(GlobalFixture);
BOOST_AUTO_TEST_CASE(TestStandardWellInput) {
const SetupTest setup_test;
const Wells* wells = setup_test.wells_manager->c_wells();
const auto& wells_ecl = setup_test.schedule->getWells(setup_test.current_timestep);
const auto& wells_ecl = setup_test.schedule->getWells2(setup_test.current_timestep);
BOOST_CHECK_EQUAL( wells_ecl.size(), 2);
const Opm::Well* well = wells_ecl[1];
const Opm::Well2& well = wells_ecl[1];
const Opm::BlackoilModelParametersEbos<TTAG(EclFlowProblem) > param;
// For the conversion between the surface volume rate and resrevoir voidage rate
@@ -154,7 +154,6 @@ BOOST_AUTO_TEST_CASE(TestStandardWellInput) {
const int num_comp = wells->number_of_phases;
BOOST_CHECK_THROW( StandardWell( well, -1, wells, param, *rateConverter, pvtIdx, num_comp), std::invalid_argument);
BOOST_CHECK_THROW( StandardWell( nullptr, 4, wells , param, *rateConverter, pvtIdx, num_comp), std::invalid_argument);
BOOST_CHECK_THROW( StandardWell( well, 4, nullptr , param, *rateConverter, pvtIdx, num_comp), std::invalid_argument);
}
@@ -162,7 +161,7 @@ BOOST_AUTO_TEST_CASE(TestStandardWellInput) {
BOOST_AUTO_TEST_CASE(TestBehavoir) {
const SetupTest setup_test;
const Wells* wells_struct = setup_test.wells_manager->c_wells();
const auto& wells_ecl = setup_test.schedule->getWells(setup_test.current_timestep);
const auto& wells_ecl = setup_test.schedule->getWells2(setup_test.current_timestep);
const int current_timestep = setup_test.current_timestep;
std::vector<std::unique_ptr<const StandardWell> > wells;
@@ -175,7 +174,7 @@ BOOST_AUTO_TEST_CASE(TestBehavoir) {
size_t index_well = 0;
for (; index_well < wells_ecl.size(); ++index_well) {
if (well_name == wells_ecl[index_well]->name()) {
if (well_name == wells_ecl[index_well].name()) {
break;
}
}

View File

@@ -37,7 +37,7 @@
#include <opm/parser/eclipse/EclipseState/Schedule/GroupTree.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
using namespace Opm;
@@ -55,21 +55,21 @@ BOOST_AUTO_TEST_CASE(ConstructGroupFromWell) {
PhaseUsage pu = phaseUsageFromDeck(eclipseState);
auto wells = sched.getWells();
auto wells = sched.getWells2atEnd();
for (size_t i=0; i<wells.size(); i++) {
const auto* well = wells[i];
const auto& well = wells[i];
std::shared_ptr<WellsGroupInterface> wellsGroup = createWellWellsGroup(well, 2, pu);
BOOST_CHECK_EQUAL(well->name(), wellsGroup->name());
if (well->isInjector(2)) {
const WellInjectionProperties& properties = well->getInjectionProperties(2);
BOOST_CHECK_EQUAL(well.name(), wellsGroup->name());
if (well.isInjector()) {
const WellInjectionProperties& properties = well.getInjectionProperties();
BOOST_CHECK_EQUAL(properties.surfaceInjectionRate, wellsGroup->injSpec().surface_flow_max_rate_);
BOOST_CHECK_EQUAL(properties.BHPLimit, wellsGroup->injSpec().BHP_limit_);
BOOST_CHECK_EQUAL(properties.reservoirInjectionRate, wellsGroup->injSpec().reservoir_flow_max_rate_);
BOOST_CHECK_EQUAL(0.0, wellsGroup->prodSpec().guide_rate_);
}
if (well->isProducer(2)) {
const WellProductionProperties& properties = well->getProductionProperties(2);
if (well.isProducer()) {
const WellProductionProperties& properties = well.getProductionProperties();
BOOST_CHECK_EQUAL(properties.ResVRate, wellsGroup->prodSpec().reservoir_flow_max_rate_);
BOOST_CHECK_EQUAL(properties.BHPLimit, wellsGroup->prodSpec().BHP_limit_);
BOOST_CHECK_EQUAL(properties.OilRate, wellsGroup->prodSpec().oil_max_rate_);

View File

@@ -74,18 +74,18 @@ namespace {
};
state.init(wmgr.c_wells(), cpress, setup.sched,
setup.sched.getWells(timeStep),
setup.sched.getWells2(timeStep),
timeStep, nullptr, setup.pu);
state.initWellStateMSWell(wmgr.c_wells(),
setup.sched.getWells(timeStep),
setup.sched.getWells2(timeStep),
timeStep, setup.pu, nullptr);
return state;
}
void setSegPress(const std::vector<const Opm::Well*>& wells,
void setSegPress(const std::vector<Opm::Well2>& wells,
const std::size_t tstep,
Opm::WellStateFullyImplicitBlackoil& wstate)
{
@@ -94,7 +94,7 @@ namespace {
auto& segPress = wstate.segPress();
for (auto wellID = 0*nWell; wellID < nWell; ++wellID) {
const auto* well = wells[wellID];
const auto& well = wells[wellID];
const auto topSegIx = wstate.topSegmentIndex(wellID);
const auto pressTop = 100.0 * wellID;
@@ -102,11 +102,11 @@ namespace {
press[0] = pressTop;
if (! well->isMultiSegment(tstep)) {
if (! well.isMultiSegment()) {
continue;
}
const auto& segSet = well->getWellSegments(tstep);
const auto& segSet = well.getSegments();
const auto nSeg = segSet.size();
for (auto segID = 0*nSeg + 1; segID < nSeg; ++segID) {
@@ -118,7 +118,7 @@ namespace {
}
void setSegRates(const std::vector<const Opm::Well*>& wells,
void setSegRates(const std::vector<Opm::Well2>& wells,
const std::size_t tstep,
const Opm::PhaseUsage& pu,
Opm::WellStateFullyImplicitBlackoil& wstate)
@@ -139,7 +139,7 @@ namespace {
auto& segRates = wstate.segRates();
for (auto wellID = 0*nWell; wellID < nWell; ++wellID) {
const auto* well = wells[wellID];
const auto& well = wells[wellID];
const auto topSegIx = wstate.topSegmentIndex(wellID);
const auto rateTop = 1000.0 * wellID;
@@ -147,11 +147,11 @@ namespace {
if (oil) { segRates[np*topSegIx + io] = rateTop; }
if (gas) { segRates[np*topSegIx + ig] = rateTop; }
if (! well->isMultiSegment(tstep)) {
if (! well.isMultiSegment()) {
continue;
}
const auto& segSet = well->getWellSegments(tstep);
const auto& segSet = well.getSegments();
const auto nSeg = segSet.size();
for (auto segID = 0*nSeg + 1; segID < nSeg; ++segID) {
@@ -181,10 +181,10 @@ BOOST_AUTO_TEST_CASE(Linearisation)
BOOST_CHECK_EQUAL(wstate.numSegment(), 6 + 1);
const auto& wells = setup.sched.getWells(tstep);
const auto& wells = setup.sched.getWells2atEnd();
BOOST_CHECK_EQUAL(wells.size(), 2);
const auto prod01_first = wells[0]->name() == "PROD01";
const auto prod01_first = wells[0].name() == "PROD01";
BOOST_CHECK_EQUAL(wstate.topSegmentIndex(0), 0);
BOOST_CHECK_EQUAL(wstate.topSegmentIndex(1),
@@ -200,8 +200,8 @@ BOOST_AUTO_TEST_CASE(Pressure)
auto wstate = buildWellState(setup, tstep);
const auto& wells = setup.sched.getWells(tstep);
const auto prod01_first = wells[0]->name() == "PROD01";
const auto& wells = setup.sched.getWells2(tstep);
const auto prod01_first = wells[0].name() == "PROD01";
setSegPress(wells, tstep, wstate);
@@ -244,8 +244,8 @@ BOOST_AUTO_TEST_CASE(Rates)
auto wstate = buildWellState(setup, tstep);
const auto& wells = setup.sched.getWells(tstep);
const auto prod01_first = wells[0]->name() == "PROD01";
const auto wells = setup.sched.getWells2(tstep);
const auto prod01_first = wells[0].name() == "PROD01";
const auto& pu = setup.pu;