mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Fixes test for WellStateFullyImplicitBlackoil
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
|
||||
#define BOOST_TEST_MODULE WellStateFIBOTest
|
||||
|
||||
#include "MpiFixture.hpp"
|
||||
#include <opm/simulators/wells/WellStateFullyImplicitBlackoil.hpp>
|
||||
#include <opm/parser/eclipse/Python/Python.hpp>
|
||||
|
||||
@@ -42,6 +43,8 @@
|
||||
#include <cstddef>
|
||||
#include <string>
|
||||
|
||||
BOOST_GLOBAL_FIXTURE(MPIFixture);
|
||||
|
||||
struct Setup
|
||||
{
|
||||
Setup(const std::string& filename)
|
||||
@@ -114,7 +117,8 @@ struct Setup
|
||||
|
||||
namespace {
|
||||
Opm::WellStateFullyImplicitBlackoil
|
||||
buildWellState(const Setup& setup, const std::size_t timeStep)
|
||||
buildWellState(const Setup& setup, const std::size_t timeStep,
|
||||
std::vector<Opm::ParallelWellInfo>& pinfos)
|
||||
{
|
||||
auto state = Opm::WellStateFullyImplicitBlackoil{};
|
||||
|
||||
@@ -123,7 +127,7 @@ namespace {
|
||||
100.0*Opm::unit::barsa);
|
||||
|
||||
auto wells = setup.sched.getWells(timeStep);
|
||||
std::vector<Opm::ParallelWellInfo> pinfos(wells.size());
|
||||
pinfos.resize(wells.size());
|
||||
std::vector<Opm::ParallelWellInfo*> ppinfos(wells.size());
|
||||
auto pw = pinfos.begin();
|
||||
auto ppw = ppinfos.begin();
|
||||
@@ -132,6 +136,7 @@ namespace {
|
||||
{
|
||||
*pw = {well.name()};
|
||||
*ppw = &(*pw);
|
||||
pw->communicateFirstPerforation(true);
|
||||
++pw;
|
||||
++ppw;
|
||||
}
|
||||
@@ -237,7 +242,8 @@ BOOST_AUTO_TEST_CASE(Linearisation)
|
||||
const Setup setup{ "msw.data" };
|
||||
const auto tstep = std::size_t{0};
|
||||
|
||||
const auto wstate = buildWellState(setup, tstep);
|
||||
std::vector<Opm::ParallelWellInfo> pinfos;
|
||||
const auto wstate = buildWellState(setup, tstep, pinfos);
|
||||
|
||||
BOOST_CHECK_EQUAL(wstate.numSegment(), 6 + 1);
|
||||
|
||||
@@ -258,7 +264,8 @@ BOOST_AUTO_TEST_CASE(Pressure)
|
||||
const Setup setup{ "msw.data" };
|
||||
const auto tstep = std::size_t{0};
|
||||
|
||||
auto wstate = buildWellState(setup, tstep);
|
||||
std::vector<Opm::ParallelWellInfo> pinfos;
|
||||
auto wstate = buildWellState(setup, tstep, pinfos);
|
||||
|
||||
const auto& wells = setup.sched.getWells(tstep);
|
||||
const auto prod01_first = wells[0].name() == "PROD01";
|
||||
@@ -304,7 +311,8 @@ BOOST_AUTO_TEST_CASE(Rates)
|
||||
const Setup setup{ "msw.data" };
|
||||
const auto tstep = std::size_t{0};
|
||||
|
||||
auto wstate = buildWellState(setup, tstep);
|
||||
std::vector<Opm::ParallelWellInfo> pinfos;
|
||||
auto wstate = buildWellState(setup, tstep, pinfos);
|
||||
|
||||
const auto wells = setup.sched.getWells(tstep);
|
||||
const auto prod01_first = wells[0].name() == "PROD01";
|
||||
@@ -375,7 +383,9 @@ BOOST_AUTO_TEST_CASE(STOP_well)
|
||||
also for wells in the STOP state.
|
||||
*/
|
||||
const Setup setup{ "wells_manager_data_wellSTOP.data" };
|
||||
auto wstate = buildWellState(setup, 0);
|
||||
|
||||
std::vector<Opm::ParallelWellInfo> pinfos;
|
||||
auto wstate = buildWellState(setup, 0, pinfos);
|
||||
for (const auto& p : wstate.perfPress())
|
||||
BOOST_CHECK(p > 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user