Only active cells (#1298)
Use FieldProps implementation for 3D properties
This commit is contained in:
parent
13b3d1e17b
commit
ecb5fce19b
@ -98,7 +98,6 @@ namespace Opm {
|
||||
bool hasInputEDITNNC() const;
|
||||
|
||||
const FieldPropsManager& fieldProps() const;
|
||||
const Eclipse3DProperties& get3DProperties() const;
|
||||
const TableManager& getTableManager() const;
|
||||
const EclipseConfig& getEclipseConfig() const;
|
||||
const EclipseConfig& cfg() const;
|
||||
@ -132,7 +131,6 @@ namespace Opm {
|
||||
NNC m_inputNnc;
|
||||
EDITNNC m_inputEditNnc;
|
||||
EclipseGrid m_inputGrid;
|
||||
Eclipse3DProperties m_eclipseProperties;
|
||||
FieldPropsManager field_props;
|
||||
const SimulationConfig m_simulationConfig;
|
||||
TransMult m_transMult;
|
||||
|
@ -213,6 +213,18 @@ public:
|
||||
template <typename T>
|
||||
std::vector<std::string> keys() const;
|
||||
|
||||
/*
|
||||
Don't understand why - but these are needed to work with opm-simulators heavily templated code?!
|
||||
*/
|
||||
const std::vector<int>& get_int(const std::string& keyword) const { return this->get<int>(keyword); }
|
||||
std::vector<int> get_global_int(const std::string& keyword) const { return this->get_global<int>(keyword); }
|
||||
|
||||
const std::vector<double>& get_double(const std::string& keyword) const { return this->get<double>(keyword); }
|
||||
std::vector<double> get_global_double(const std::string& keyword) const { return this->get_global<double>(keyword); }
|
||||
|
||||
bool has_int(const std::string& keyword) const { return this->has<int>(keyword); }
|
||||
bool has_double(const std::string& keyword) const { return this->has<double>(keyword); }
|
||||
|
||||
private:
|
||||
std::shared_ptr<FieldProps> fp;
|
||||
};
|
||||
|
@ -22,7 +22,6 @@
|
||||
#define OPM_PARSER_MULTREGTSCANNER_HPP
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/FieldPropsManager.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Eclipse3DProperties.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/FaceDir.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Util/Value.hpp>
|
||||
|
||||
@ -70,7 +69,6 @@ namespace Opm {
|
||||
public:
|
||||
MULTREGTScanner(const GridDims& grid,
|
||||
const FieldPropsManager& fp_arg,
|
||||
const Eclipse3DProperties& e3DProps,
|
||||
const std::vector< const DeckKeyword* >& keywords);
|
||||
double getRegionMultiplier(size_t globalCellIdx1, size_t globalCellIdx2, FaceDir::DirEnum faceDir) const;
|
||||
|
||||
@ -79,7 +77,6 @@ namespace Opm {
|
||||
void assertKeywordSupported(const DeckKeyword& deckKeyword);
|
||||
std::size_t nx,ny,nz;
|
||||
const FieldPropsManager& fp;
|
||||
const Eclipse3DProperties& m_e3DProps;
|
||||
std::vector< MULTREGTRecord > m_records;
|
||||
std::map<std::string , MULTREGTSearchMap> m_searchMap;
|
||||
std::map<std::string, std::vector<int>> regions;
|
||||
|
@ -41,14 +41,13 @@ namespace Opm {
|
||||
template< typename > class GridProperty;
|
||||
class Fault;
|
||||
class FaultCollection;
|
||||
class Eclipse3DProperties;
|
||||
class DeckKeyword;
|
||||
class FieldPropsManager;
|
||||
|
||||
class TransMult {
|
||||
|
||||
public:
|
||||
TransMult(const GridDims& dims, const Deck& deck, const FieldPropsManager& fp, const Eclipse3DProperties& props);
|
||||
TransMult(const GridDims& dims, const Deck& deck, const FieldPropsManager& fp);
|
||||
double getMultiplier(size_t globalIndex, FaceDir::DirEnum faceDir) const;
|
||||
double getMultiplier(size_t i , size_t j , size_t k, FaceDir::DirEnum faceDir) const;
|
||||
double getRegionMultiplier( size_t globalCellIndex1, size_t globalCellIndex2, FaceDir::DirEnum faceDir) const;
|
||||
|
@ -95,7 +95,6 @@ namespace Opm
|
||||
class DeckKeyword;
|
||||
class DeckRecord;
|
||||
class EclipseGrid;
|
||||
class Eclipse3DProperties;
|
||||
class EclipseState;
|
||||
class FieldPropsManager;
|
||||
class Runspec;
|
||||
@ -119,7 +118,6 @@ namespace Opm
|
||||
Schedule(const Deck& deck,
|
||||
const EclipseGrid& grid,
|
||||
const FieldPropsManager& fp,
|
||||
const Eclipse3DProperties& eclipseProperties,
|
||||
const Runspec &runspec,
|
||||
const ParseContext& parseContext,
|
||||
ErrorGuard& errors);
|
||||
@ -128,7 +126,6 @@ namespace Opm
|
||||
Schedule(const Deck& deck,
|
||||
const EclipseGrid& grid,
|
||||
const FieldPropsManager& fp,
|
||||
const Eclipse3DProperties& eclipseProperties,
|
||||
const Runspec &runspec,
|
||||
const ParseContext& parseContext,
|
||||
T&& errors);
|
||||
@ -136,7 +133,6 @@ namespace Opm
|
||||
Schedule(const Deck& deck,
|
||||
const EclipseGrid& grid,
|
||||
const FieldPropsManager& fp,
|
||||
const Eclipse3DProperties& eclipseProperties,
|
||||
const Runspec &runspec);
|
||||
|
||||
Schedule(const Deck& deck,
|
||||
@ -316,8 +312,7 @@ namespace Opm
|
||||
bool updateWellStatus( const std::string& well, size_t reportStep , Well::Status status, bool update_connections);
|
||||
void addWellToGroup( const std::string& group_name, const std::string& well_name , size_t timeStep);
|
||||
void iterateScheduleSection(const ParseContext& parseContext , ErrorGuard& errors, const SCHEDULESection& , const EclipseGrid& grid,
|
||||
const FieldPropsManager& fp,
|
||||
const Eclipse3DProperties& eclipseProperties);
|
||||
const FieldPropsManager& fp);
|
||||
void addACTIONX(const Action::ActionX& action, std::size_t currentStep);
|
||||
void addGroupToGroup( const std::string& parent_group, const std::string& child_group, size_t timeStep);
|
||||
void addGroupToGroup( const std::string& parent_group, const Group& child_group, size_t timeStep);
|
||||
@ -330,7 +325,7 @@ namespace Opm
|
||||
void handleWCONHIST( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleWCONPROD( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleWGRUPCON( const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleCOMPDAT( const DeckKeyword& keyword, size_t currentStep, const EclipseGrid& grid, const FieldPropsManager& fp, const Eclipse3DProperties& eclipseProperties, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleCOMPDAT( const DeckKeyword& keyword, size_t currentStep, const EclipseGrid& grid, const FieldPropsManager& fp, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleCOMPLUMP( const DeckKeyword& keyword, size_t currentStep );
|
||||
void handleWELSEGS( const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleCOMPSEGS( const DeckKeyword& keyword, size_t currentStep, const EclipseGrid& grid, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
@ -387,7 +382,6 @@ namespace Opm
|
||||
const ParseContext& parseContext, ErrorGuard& errors,
|
||||
const EclipseGrid& grid,
|
||||
const FieldPropsManager& fp,
|
||||
const Eclipse3DProperties& eclipseProperties,
|
||||
const UnitSystem& unit_system,
|
||||
std::vector<std::pair<const DeckKeyword*, size_t > >& rftProperties);
|
||||
void addWellGroupEvent(const std::string& wellGroup, ScheduleEvents::Events event, size_t reportStep);
|
||||
|
@ -25,7 +25,6 @@
|
||||
namespace Opm {
|
||||
|
||||
class Deck;
|
||||
class Eclipse3DProperties;
|
||||
class FieldPropsManager;
|
||||
|
||||
class SimulationConfig {
|
||||
@ -35,8 +34,7 @@ namespace Opm {
|
||||
SimulationConfig();
|
||||
SimulationConfig(bool restart,
|
||||
const Deck& deck,
|
||||
const FieldPropsManager& fp,
|
||||
const Eclipse3DProperties& gridProperties);
|
||||
const FieldPropsManager& fp);
|
||||
SimulationConfig(const ThresholdPressure& thresholdPressure,
|
||||
bool useCPR, bool DISGAS, bool VAPOIL, bool isThermal);
|
||||
|
||||
|
@ -27,7 +27,6 @@ namespace Opm {
|
||||
|
||||
|
||||
class Deck;
|
||||
class Eclipse3DProperties;
|
||||
class FieldPropsManager;
|
||||
|
||||
class ThresholdPressure {
|
||||
@ -38,8 +37,7 @@ namespace Opm {
|
||||
|
||||
ThresholdPressure(bool restart,
|
||||
const Deck& deck,
|
||||
const FieldPropsManager& fp,
|
||||
const Eclipse3DProperties& eclipseProperties);
|
||||
const FieldPropsManager& fp);
|
||||
|
||||
ThresholdPressure(bool active, bool restart,
|
||||
const ThresholdPressureTable& thpTable,
|
||||
|
@ -86,22 +86,16 @@ namespace {
|
||||
}
|
||||
|
||||
const FieldPropsManager& get_field_props(const EclipseState& state) {
|
||||
if (enable3DPropsTesting())
|
||||
return state.fieldProps();
|
||||
else
|
||||
throw std::logic_error("Field properties not implemented for this compilation.");
|
||||
return state.fieldProps();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void python::common::export_EclipseState(py::module& module) {
|
||||
|
||||
module.def("test_field_props", &enable3DPropsTesting);
|
||||
|
||||
py::class_< EclipseState >( module, "EclipseState" )
|
||||
.def(py::init<const Deck&>())
|
||||
.def_property_readonly( "title", &EclipseState::getTitle )
|
||||
.def( "ecl3d_props", &EclipseState::get3DProperties, ref_internal)
|
||||
.def( "field_props", &get_field_props, ref_internal)
|
||||
.def( "grid", &EclipseState::getInputGrid, ref_internal)
|
||||
.def( "config", &EclipseState::cfg, ref_internal)
|
||||
|
@ -13,7 +13,7 @@ namespace {
|
||||
if (manager.has<int>(kw))
|
||||
return true;
|
||||
if (manager.has<double>(kw))
|
||||
return true;
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -32,13 +32,26 @@ namespace {
|
||||
throw std::invalid_argument("Keyword '" + kw + "'is not of type int.");
|
||||
}
|
||||
|
||||
|
||||
py::array get_array(const FieldPropsManager& m, const std::string& kw) {
|
||||
if (m.has<double>(kw))
|
||||
return convert::numpy_array(m.get<double>(kw));
|
||||
|
||||
if (m.has<int>(kw))
|
||||
return convert::numpy_array(m.get<int>(kw));
|
||||
|
||||
throw std::invalid_argument("No such keyword: " + kw);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
void python::common::export_FieldProperties(py::module& module) {
|
||||
|
||||
|
||||
py::class_< FieldPropsManager >( module, "FieldProperties")
|
||||
.def( "__contains__", &contains )
|
||||
.def("__getitem__", &get_array)
|
||||
.def( "get_double_array", &get_double_array )
|
||||
.def( "get_int_array", &get_int_array )
|
||||
;
|
||||
|
@ -15,7 +15,6 @@ from .libopmcommon_python import Parser, ParseContext
|
||||
from .libopmcommon_python import DeckKeyword
|
||||
|
||||
from .libopmcommon_python import EclipseState
|
||||
from .libopmcommon_python import test_field_props
|
||||
from .libopmcommon_python import FieldProperties
|
||||
from .libopmcommon_python import Schedule
|
||||
from .libopmcommon_python import OpmLog
|
||||
|
@ -1 +1 @@
|
||||
from opm._common import EclipseState, test_field_props
|
||||
from opm._common import EclipseState
|
||||
|
@ -5,78 +5,76 @@ import numpy as np
|
||||
|
||||
from opm.io.parser import Parser
|
||||
from opm.io.deck import DeckKeyword
|
||||
from opm.io.ecl_state import EclipseState, test_field_props
|
||||
from opm.io.ecl_state import EclipseState
|
||||
try:
|
||||
from tests.utils import test_path
|
||||
except ImportError:
|
||||
from utils import test_path
|
||||
|
||||
|
||||
if (test_field_props()):
|
||||
class TestFieldProps(unittest.TestCase):
|
||||
|
||||
class TestFieldProps(unittest.TestCase):
|
||||
def assertClose(self, expected, observed, epsilon=1e-08):
|
||||
diff = abs(expected - observed)
|
||||
err_msg = '|%g - %g| = %g > %g' % (expected, observed, diff, epsilon)
|
||||
self.assertTrue(diff <= epsilon, msg=err_msg)
|
||||
|
||||
def assertClose(self, expected, observed, epsilon=1e-08):
|
||||
diff = abs(expected - observed)
|
||||
err_msg = '|%g - %g| = %g > %g' % (expected, observed, diff, epsilon)
|
||||
self.assertTrue(diff <= epsilon, msg=err_msg)
|
||||
def setUp(self):
|
||||
parser = Parser()
|
||||
deck = parser.parse(test_path('spe3/SPE3CASE1.DATA'))
|
||||
int_array = np.ones(324)
|
||||
actnum_kw = DeckKeyword( parser["ACTNUM"], int_array)
|
||||
deck.add(actnum_kw)
|
||||
self.spe3 = EclipseState(deck)
|
||||
self.props = self.spe3.field_props()
|
||||
|
||||
def setUp(self):
|
||||
parser = Parser()
|
||||
deck = parser.parse(test_path('spe3/SPE3CASE1.DATA'))
|
||||
int_array = np.ones(324)
|
||||
actnum_kw = DeckKeyword( parser["ACTNUM"], int_array)
|
||||
deck.add(actnum_kw)
|
||||
self.spe3 = EclipseState(deck)
|
||||
self.props = self.spe3.field_props()
|
||||
def test_contains(self):
|
||||
p = self.props
|
||||
self.assertTrue('PORO' in p)
|
||||
self.assertFalse('NONO' in p)
|
||||
self.assertTrue('PORV' in p)
|
||||
self.assertTrue('ACTNUM' in p)
|
||||
|
||||
def test_contains(self):
|
||||
p = self.props
|
||||
self.assertTrue('PORO' in p)
|
||||
self.assertFalse('NONO' in p)
|
||||
self.assertTrue('PORV' in p)
|
||||
self.assertTrue('ACTNUM' in p)
|
||||
|
||||
|
||||
def test_getitem(self):
|
||||
p = self.props
|
||||
poro = p.get_double_array('PORO')
|
||||
self.assertEqual(324, len(poro))
|
||||
self.assertEqual(0.13, poro[0])
|
||||
self.assertTrue( 'PERMX' in p )
|
||||
px = p.get_double_array('PERMX')
|
||||
print(len(px))
|
||||
self.assertEqual(324, len(px))
|
||||
self.assertEqual(324, len(p.get_int_array('ACTNUM')))
|
||||
def test_getitem(self):
|
||||
p = self.props
|
||||
poro = p.get_double_array('PORO')
|
||||
self.assertEqual(324, len(poro))
|
||||
self.assertEqual(0.13, poro[0])
|
||||
self.assertTrue( 'PERMX' in p )
|
||||
px = p.get_double_array('PERMX')
|
||||
print(len(px))
|
||||
self.assertEqual(324, len(px))
|
||||
self.assertEqual(324, len(p.get_int_array('ACTNUM')))
|
||||
|
||||
def test_permx_values(self):
|
||||
def md2si(md):
|
||||
#millidarcy->SI
|
||||
return md * 1e-3 * 9.869233e-13
|
||||
field_props = self.props
|
||||
def test_permx_values(self):
|
||||
def md2si(md):
|
||||
#millidarcy->SI
|
||||
return md * 1e-3 * 9.869233e-13
|
||||
field_props = self.props
|
||||
|
||||
grid = self.spe3.grid()
|
||||
permx = field_props.get_double_array('PERMX')
|
||||
print('set(PERMX) = %s' % set(permx))
|
||||
# 130mD, 40mD, 20mD, and 150mD, respectively, top to bottom
|
||||
darcys = {0:md2si(130), 1:md2si(40), 2:md2si(20), 3:md2si(150)}
|
||||
for i in range(grid.nx):
|
||||
for j in range(grid.ny):
|
||||
for k in range(grid.nz):
|
||||
g_idx = grid.globalIndex(i,j,k)
|
||||
perm = permx[g_idx]
|
||||
darcy = darcys[k]
|
||||
self.assertClose(darcy, perm)
|
||||
grid = self.spe3.grid()
|
||||
permx = field_props.get_double_array('PERMX')
|
||||
print('set(PERMX) = %s' % set(permx))
|
||||
# 130mD, 40mD, 20mD, and 150mD, respectively, top to bottom
|
||||
darcys = {0:md2si(130), 1:md2si(40), 2:md2si(20), 3:md2si(150)}
|
||||
for i in range(grid.nx):
|
||||
for j in range(grid.ny):
|
||||
for k in range(grid.nz):
|
||||
g_idx = grid.globalIndex(i,j,k)
|
||||
perm = permx[g_idx]
|
||||
darcy = darcys[k]
|
||||
self.assertClose(darcy, perm)
|
||||
|
||||
def test_volume(self):
|
||||
grid = self.spe3.grid()
|
||||
for i in range(grid.nx):
|
||||
for j in range(grid.ny):
|
||||
for k in range(grid.nz):
|
||||
g_idx = grid.globalIndex(i,j,k)
|
||||
exp = 293.3 * 293.3 * 30 # cubicfeet = 73 078.6084 cubic meter
|
||||
exp *= (12*0.0254)**3 # cubic feet to cubic meter
|
||||
if k == 0:
|
||||
self.assertClose(exp, grid.getCellVolume(g_idx))
|
||||
self.assertEqual(grid.getCellVolume(g_idx), grid.getCellVolume(i, j, k))
|
||||
def test_volume(self):
|
||||
grid = self.spe3.grid()
|
||||
for i in range(grid.nx):
|
||||
for j in range(grid.ny):
|
||||
for k in range(grid.nz):
|
||||
g_idx = grid.globalIndex(i,j,k)
|
||||
exp = 293.3 * 293.3 * 30 # cubicfeet = 73 078.6084 cubic meter
|
||||
exp *= (12*0.0254)**3 # cubic feet to cubic meter
|
||||
if k == 0:
|
||||
self.assertClose(exp, grid.getCellVolume(g_idx))
|
||||
self.assertEqual(grid.getCellVolume(g_idx), grid.getCellVolume(i, j, k))
|
||||
|
||||
|
@ -3,7 +3,7 @@ import opm.io
|
||||
import numpy as np
|
||||
|
||||
from opm.io.parser import Parser
|
||||
from opm.io.ecl_state import EclipseState, test_field_props
|
||||
from opm.io.ecl_state import EclipseState
|
||||
try:
|
||||
from tests.utils import test_path
|
||||
except ImportError:
|
||||
@ -21,10 +21,7 @@ class TestProps(unittest.TestCase):
|
||||
parser = Parser()
|
||||
deck = parser.parse(test_path('spe3/SPE3CASE1.DATA'))
|
||||
self.spe3 = EclipseState(deck)
|
||||
self.props = self.spe3.ecl3d_props()
|
||||
if (not test_field_props()):
|
||||
with self.assertRaises(RuntimeError):
|
||||
self.field = self.spe3.field_props()
|
||||
self.props = self.spe3.field_props()
|
||||
|
||||
def test_contains(self):
|
||||
p = self.props
|
||||
|
@ -2074,11 +2074,7 @@ SummaryImplementation(const EclipseState& es,
|
||||
const Schedule& sched,
|
||||
const std::string& basename)
|
||||
: grid_ (std::cref(grid))
|
||||
#ifdef ENABLE_3DPROPS_TESTING
|
||||
, regCache_ (es.fieldProps().get<int>("FIPNUM"), grid, sched)
|
||||
#else
|
||||
, regCache_ (es.get3DProperties().getIntGridProperty("FIPNUM").compressedCopy(grid), grid, sched)
|
||||
#endif
|
||||
, deferredSMSpec_(makeDeferredSMSpecCreation(es, grid, sched))
|
||||
, rset_ (makeResultSet(es.cfg().io(), basename))
|
||||
, fmt_ { es.cfg().io().getFMTOUT() }
|
||||
|
@ -313,7 +313,6 @@ namespace {
|
||||
}
|
||||
|
||||
|
||||
#ifdef ENABLE_3DPROPS_TESTING
|
||||
|
||||
void writePoreVolume(const ::Opm::EclipseState& es,
|
||||
const ::Opm::UnitSystem& units,
|
||||
@ -344,53 +343,6 @@ namespace {
|
||||
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void writePoreVolume(const ::Opm::EclipseState& es,
|
||||
const ::Opm::EclipseGrid& grid,
|
||||
const ::Opm::UnitSystem& units,
|
||||
::Opm::EclIO::OutputStream::Init& initFile)
|
||||
{
|
||||
auto porv = es.get3DProperties()
|
||||
.getDoubleGridProperty("PORV").getData();
|
||||
for (auto nGlob = porv.size(),
|
||||
globCell = 0*nGlob; globCell < nGlob; ++globCell)
|
||||
{
|
||||
if (! grid.cellActive(globCell)) {
|
||||
porv[globCell] = 0.0;
|
||||
}
|
||||
}
|
||||
units.from_si(::Opm::UnitSystem::measure::volume, porv);
|
||||
initFile.write("PORV", singlePrecision(porv));
|
||||
}
|
||||
|
||||
|
||||
void writeIntegerCellProperties(const ::Opm::EclipseState& es,
|
||||
const ::Opm::EclipseGrid& grid,
|
||||
::Opm::EclIO::OutputStream::Init& initFile)
|
||||
{
|
||||
|
||||
// The INIT file should always contain PVT, saturation function,
|
||||
// equilibration, and fluid-in-place region vectors. Call
|
||||
// assertKeyword() here--on a 'const' GridProperties object--to
|
||||
// invoke the autocreation property, and ensure that the keywords
|
||||
// exist in the properties container.
|
||||
const auto& properties = es.get3DProperties().getIntProperties();
|
||||
properties.assertKeyword("PVTNUM");
|
||||
properties.assertKeyword("SATNUM");
|
||||
properties.assertKeyword("EQLNUM");
|
||||
properties.assertKeyword("FIPNUM");
|
||||
|
||||
for (const auto& property : properties) {
|
||||
if (property.getKeywordName() == "ACTNUM")
|
||||
continue;
|
||||
|
||||
auto ecl_data = property.compressedCopy(grid);
|
||||
initFile.write(property.getKeywordName(), ecl_data);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
void writeGridGeometry(const ::Opm::EclipseGrid& grid,
|
||||
@ -423,79 +375,41 @@ namespace {
|
||||
|
||||
template <typename T, class WriteVector>
|
||||
void writeCellPropertiesWithDefaultFlag(const Properties& propList,
|
||||
const ::Opm::GridProperties<T>&
|
||||
#ifndef ENABLE_3DPROPS_TESTING
|
||||
propValues
|
||||
#endif
|
||||
, const ::Opm::FieldPropsManager& fp,
|
||||
const ::Opm::EclipseGrid&
|
||||
#ifndef ENABLE_3DPROPS_TESTING
|
||||
grid
|
||||
#endif
|
||||
, WriteVector&& write)
|
||||
const ::Opm::FieldPropsManager& fp,
|
||||
WriteVector&& write)
|
||||
{
|
||||
for (const auto& prop : propList) {
|
||||
#ifdef ENABLE_3DPROPS_TESTING
|
||||
if (! fp.has<T>(prop.name))
|
||||
continue;
|
||||
|
||||
auto data = fp.get<T>(prop.name);
|
||||
auto defaulted = fp.defaulted<T>(prop.name);
|
||||
write(prop, std::move(defaulted), std::move(data));
|
||||
#else
|
||||
if (! propValues.hasKeyword(prop.name)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const auto& opm_property = propValues.getKeyword(prop.name);
|
||||
const auto& dflt = opm_property.wasDefaulted();
|
||||
|
||||
write(prop, grid.compressedVector(dflt),
|
||||
opm_property.compressedCopy(grid));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T, class WriteVector>
|
||||
template <class WriteVector>
|
||||
void writeCellPropertiesValuesOnly(const Properties& propList,
|
||||
const ::Opm::GridProperties<T>&
|
||||
#ifndef ENABLE_3DPROPS_TESTING
|
||||
propValues
|
||||
#endif
|
||||
, const ::Opm::FieldPropsManager& fp,
|
||||
const ::Opm::EclipseGrid&
|
||||
#ifndef ENABLE_3DPROPS_TESTING
|
||||
grid
|
||||
#endif
|
||||
, WriteVector&& write)
|
||||
const ::Opm::FieldPropsManager& fp,
|
||||
WriteVector&& write)
|
||||
{
|
||||
for (const auto& prop : propList) {
|
||||
|
||||
#ifdef ENABLE_3DPROPS_TESTING
|
||||
if (!fp.has<T>(prop.name))
|
||||
if (!fp.has<double>(prop.name))
|
||||
continue;
|
||||
auto data = fp.get<T>(prop.name);
|
||||
auto data = fp.get<double>(prop.name);
|
||||
write(prop, std::move(data));
|
||||
#else
|
||||
if (! propValues.hasKeyword(prop.name)) {
|
||||
continue;
|
||||
}
|
||||
const auto& opm_property = propValues.getKeyword(prop.name);
|
||||
write(prop, opm_property.compressedCopy(grid));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void writeDoubleCellProperties(const Properties& propList,
|
||||
const ::Opm::GridProperties<double>& propValues,
|
||||
const ::Opm::FieldPropsManager& fp,
|
||||
const ::Opm::EclipseGrid& grid,
|
||||
const ::Opm::UnitSystem& units,
|
||||
const bool needDflt,
|
||||
::Opm::EclIO::OutputStream::Init& initFile)
|
||||
{
|
||||
if (needDflt) {
|
||||
writeCellPropertiesWithDefaultFlag(propList, propValues, fp, grid,
|
||||
writeCellPropertiesWithDefaultFlag<double>(propList, fp,
|
||||
[&units, &initFile](const CellProperty& prop,
|
||||
std::vector<bool>&& dflt,
|
||||
std::vector<double>&& value)
|
||||
@ -517,7 +431,7 @@ namespace {
|
||||
});
|
||||
}
|
||||
else {
|
||||
writeCellPropertiesValuesOnly(propList, propValues, fp, grid,
|
||||
writeCellPropertiesValuesOnly(propList, fp,
|
||||
[&units, &initFile](const CellProperty& prop,
|
||||
std::vector<double>&& value)
|
||||
{
|
||||
@ -528,7 +442,6 @@ namespace {
|
||||
}
|
||||
|
||||
void writeDoubleCellProperties(const ::Opm::EclipseState& es,
|
||||
const ::Opm::EclipseGrid& grid,
|
||||
const ::Opm::UnitSystem& units,
|
||||
::Opm::EclIO::OutputStream::Init& initFile)
|
||||
{
|
||||
@ -543,15 +456,10 @@ namespace {
|
||||
// The INIT file should always contain the NTG property, we
|
||||
// therefore invoke the auto create functionality to ensure
|
||||
// that "NTG" is included in the properties container.
|
||||
const auto& properties = es.get3DProperties().getDoubleProperties();
|
||||
const auto& fp = es.fieldProps();
|
||||
#ifdef ENABLE_3DPROPS_TESTING
|
||||
es.fieldProps().get<double>("NTG");
|
||||
#else
|
||||
properties.assertKeyword("NTG");
|
||||
#endif
|
||||
writeDoubleCellProperties(doubleKeywords, properties, fp,
|
||||
grid, units, false, initFile);
|
||||
writeDoubleCellProperties(doubleKeywords, fp,
|
||||
units, false, initFile);
|
||||
}
|
||||
|
||||
void writeSimulatorProperties(const ::Opm::EclipseGrid& grid,
|
||||
@ -596,27 +504,19 @@ namespace {
|
||||
}
|
||||
|
||||
void writeFilledSatFuncScaling(const Properties& propList,
|
||||
::Opm::GridProperties<double>&& propValues,
|
||||
::Opm::FieldPropsManager&& fp,
|
||||
const ::Opm::EclipseGrid& grid,
|
||||
const ::Opm::UnitSystem& units,
|
||||
::Opm::EclIO::OutputStream::Init& initFile)
|
||||
{
|
||||
for (const auto& prop : propList) {
|
||||
#ifdef ENABLE_3DPROPS_TESTING
|
||||
for (const auto& prop : propList)
|
||||
fp.get<double>(prop.name);
|
||||
#else
|
||||
propValues.assertKeyword(prop.name);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Don't write sentinel value if input defaulted.
|
||||
writeDoubleCellProperties(propList, propValues, fp, grid,
|
||||
writeDoubleCellProperties(propList, fp,
|
||||
units, false, initFile);
|
||||
}
|
||||
|
||||
void writeSatFuncScaling(const ::Opm::EclipseState& es,
|
||||
const ::Opm::EclipseGrid& grid,
|
||||
const ::Opm::UnitSystem& units,
|
||||
::Opm::EclIO::OutputStream::Init& initFile)
|
||||
{
|
||||
@ -630,7 +530,6 @@ namespace {
|
||||
+ ph.active(Opm::Phase::OIL)
|
||||
+ ph.active(Opm::Phase::GAS);
|
||||
|
||||
const auto& props = es.get3DProperties().getDoubleProperties();
|
||||
const auto& fp = es.fieldProps();
|
||||
if (! es.cfg().init().filleps() || (nactph < 3)) {
|
||||
if (nactph < 3) {
|
||||
@ -648,8 +547,8 @@ namespace {
|
||||
//
|
||||
// Output only those endpoint arrays that exist in the input
|
||||
// deck. Write sentinel value if input defaulted.
|
||||
writeDoubleCellProperties(epsVectors.getVectors(), props, fp,
|
||||
grid, units, true, initFile);
|
||||
writeDoubleCellProperties(epsVectors.getVectors(), fp,
|
||||
units, true, initFile);
|
||||
}
|
||||
else {
|
||||
// Input deck specified FILLEPS so we should output all endpoint
|
||||
@ -659,12 +558,10 @@ namespace {
|
||||
// make a copy of the properties object and modify that copy in
|
||||
// order to leave the original intact. Don't write sentinel
|
||||
// value if input defaulted.
|
||||
auto propsCopy = props;
|
||||
auto fp_copy = fp;
|
||||
writeFilledSatFuncScaling(epsVectors.getVectors(),
|
||||
std::move(propsCopy),
|
||||
std::move(fp_copy),
|
||||
grid, units, initFile);
|
||||
units, initFile);
|
||||
}
|
||||
}
|
||||
|
||||
@ -702,29 +599,14 @@ void Opm::InitIO::write(const ::Opm::EclipseState& es,
|
||||
// set to zero for inactive cells. This treatment implies that the
|
||||
// active/inactive cell mapping can be inferred by reading the PORV
|
||||
// vector from the result set.
|
||||
#ifdef ENABLE_3DPROPS_TESTING
|
||||
writePoreVolume(es, units, initFile);
|
||||
#else
|
||||
writePoreVolume(es, grid, units, initFile);
|
||||
#endif
|
||||
|
||||
writeGridGeometry(grid, units, initFile);
|
||||
|
||||
writeDoubleCellProperties(es, grid, units, initFile);
|
||||
|
||||
writeDoubleCellProperties(es, units, initFile);
|
||||
writeSimulatorProperties(grid, simProps, initFile);
|
||||
|
||||
writeTableData(es, units, initFile);
|
||||
|
||||
#ifdef ENABLE_3DPROPS_TESTING
|
||||
writeIntegerCellProperties(es, initFile);
|
||||
#else
|
||||
writeIntegerCellProperties(es, grid, initFile);
|
||||
#endif
|
||||
|
||||
writeIntegerMaps(std::move(int_data), initFile);
|
||||
|
||||
writeSatFuncScaling(es, grid, units, initFile);
|
||||
writeSatFuncScaling(es, units, initFile);
|
||||
|
||||
if (nnc.numNNC() > std::size_t{0}) {
|
||||
writeNonNeighbourConnections(nnc, units, initFile);
|
||||
|
@ -62,82 +62,6 @@ bool enable3DPropsTesting() {
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
|
||||
#ifdef ENABLE_3DPROPS_TESTING
|
||||
void assert_field_properties(const EclipseGrid& grid, const FieldPropsManager& fp, const Eclipse3DProperties& ep) {
|
||||
std::vector<std::string> int_keywords = {"FLUXNUM",
|
||||
"MULTNUM",
|
||||
"OPERNUM",
|
||||
"ROCKNUM",
|
||||
//"ENDNUM",
|
||||
"EQLNUM",
|
||||
"FIPNUM",
|
||||
"IMBNUM",
|
||||
"MISCNUM",
|
||||
"OPERNUM",
|
||||
"PVTNUM",
|
||||
"SATNUM"};
|
||||
|
||||
std::vector<std::string> double_keywords = {//"MULTPV",
|
||||
//"NTG",
|
||||
"PORO",
|
||||
"PERMX",
|
||||
"PERMY",
|
||||
"PERMZ",
|
||||
"SWATINIT",
|
||||
"TEMPI",
|
||||
"THCONR"};
|
||||
|
||||
for (const auto& kw : double_keywords) {
|
||||
if (fp.has<double>(kw) != ep.hasDeckDoubleGridProperty(kw)) {
|
||||
std::cerr << "FieldPropsManager: " << fp.has<double>(kw) << std::endl;
|
||||
std::cerr << "Eclipse3dProperties: " << ep.hasDeckDoubleGridProperty(kw) << std::endl;
|
||||
throw std::logic_error("Exist Error for: " + kw);
|
||||
}
|
||||
|
||||
if (fp.has<double>(kw)) {
|
||||
const auto& fp_data = fp.get<double>(kw);
|
||||
const auto& ep_data = ep.getDoubleGridProperty(kw).compressedCopy(grid);
|
||||
if (fp_data != ep_data) {
|
||||
printf("size: %ld %ld \n", fp_data.size(), ep_data.size());
|
||||
for (std::size_t i=0; i< fp_data.size(); i++) {
|
||||
if (fp_data[i] == ep_data[i])
|
||||
printf("fp[%ld]: %lg ep[%ld]: %lg \n", i, fp_data[i], i, ep_data[i]);
|
||||
else
|
||||
printf("fp[%ld]: %lg ep[%ld]: %lg ** \n", i, fp_data[i], i, ep_data[i]);
|
||||
}
|
||||
|
||||
throw std::logic_error("Data error for: " + kw);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (const auto& kw : int_keywords) {
|
||||
if (fp.has<int>(kw) != ep.hasDeckIntGridProperty(kw)) {
|
||||
std::cerr << "FieldPropsManager: " << fp.has<int>(kw) << std::endl;
|
||||
std::cerr << "Eclipse3dProperties: " << ep.hasDeckIntGridProperty(kw) << std::endl;
|
||||
throw std::logic_error("Exists error for: " + kw);
|
||||
}
|
||||
|
||||
if (fp.has<int>(kw)) {
|
||||
const auto& fp_data = fp.get<int>(kw);
|
||||
const auto& ep_data = ep.getIntGridProperty(kw).compressedCopy(grid);
|
||||
if (fp_data != ep_data) {
|
||||
printf("size: %ld %ld \n", fp_data.size(), ep_data.size());
|
||||
for (std::size_t i=0; i< fp_data.size(); i++)
|
||||
printf("fp[%ld]: %d ep[%ld]: %d \n", i, fp_data[i], i, ep_data[i]);
|
||||
|
||||
throw std::logic_error("Data error for: " + kw);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -150,19 +74,11 @@ void assert_field_properties(const EclipseGrid& grid, const FieldPropsManager& f
|
||||
m_inputNnc( deck ),
|
||||
m_inputEditNnc( deck ),
|
||||
m_inputGrid( deck, nullptr ),
|
||||
m_eclipseProperties( deck, m_tables, m_inputGrid ),
|
||||
#ifdef ENABLE_3DPROPS_TESTING
|
||||
field_props( deck, m_inputGrid, m_tables),
|
||||
#endif
|
||||
m_simulationConfig( m_eclipseConfig.getInitConfig().restartRequested(), deck, field_props, m_eclipseProperties ),
|
||||
m_transMult( GridDims(deck), deck, field_props, m_eclipseProperties )
|
||||
m_simulationConfig( m_eclipseConfig.getInitConfig().restartRequested(), deck, field_props),
|
||||
m_transMult( GridDims(deck), deck, field_props)
|
||||
{
|
||||
#ifdef ENABLE_3DPROPS_TESTING
|
||||
m_eclipseProperties.getIntGridProperty("ACTNUM").getData();
|
||||
m_inputGrid.resetACTNUM(this->field_props.actnum());
|
||||
#else
|
||||
m_inputGrid.resetACTNUM(m_eclipseProperties.getIntGridProperty("ACTNUM").getData());
|
||||
#endif
|
||||
if( this->runspec().phases().size() < 3 )
|
||||
OpmLog::info("Only " + std::to_string( this->runspec().phases().size() )
|
||||
+ " fluid phases are enabled" );
|
||||
@ -176,10 +92,7 @@ void assert_field_properties(const EclipseGrid& grid, const FieldPropsManager& f
|
||||
|
||||
initTransMult();
|
||||
initFaults(deck);
|
||||
#ifdef ENABLE_3DPROPS_TESTING
|
||||
this->field_props.reset_actnum( this->m_inputGrid.getACTNUM() );
|
||||
assert_field_properties(this->m_inputGrid, this->field_props, this->m_eclipseProperties);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -219,10 +132,6 @@ void assert_field_properties(const EclipseGrid& grid, const FieldPropsManager& f
|
||||
return const_cast< RestartConfig& >( m_eclipseConfig.getRestartConfig() );
|
||||
}
|
||||
|
||||
const Eclipse3DProperties& EclipseState::get3DProperties() const {
|
||||
return m_eclipseProperties;
|
||||
}
|
||||
|
||||
|
||||
const FieldPropsManager& EclipseState::fieldProps() const {
|
||||
return this->field_props;
|
||||
@ -290,7 +199,6 @@ void assert_field_properties(const EclipseGrid& grid, const FieldPropsManager& f
|
||||
}
|
||||
|
||||
void EclipseState::initTransMult() {
|
||||
#ifdef ENABLE_3DPROPS_TESTING
|
||||
const auto& fp = this->field_props;
|
||||
if (fp.has<double>("MULTX")) this->m_transMult.applyMULT(fp.get_global<double>("MULTX") , FaceDir::XPlus);
|
||||
if (fp.has<double>("MULTX-")) this->m_transMult.applyMULT(fp.get_global<double>("MULTX-"), FaceDir::XMinus);
|
||||
@ -300,23 +208,6 @@ void assert_field_properties(const EclipseGrid& grid, const FieldPropsManager& f
|
||||
|
||||
if (fp.has<double>("MULTZ")) this->m_transMult.applyMULT(fp.get_global<double>("MULTZ") , FaceDir::ZPlus);
|
||||
if (fp.has<double>("MULTZ-")) this->m_transMult.applyMULT(fp.get_global<double>("MULTZ-"), FaceDir::ZMinus);
|
||||
#else
|
||||
const auto& p = m_eclipseProperties;
|
||||
if (m_eclipseProperties.hasDeckDoubleGridProperty("MULTX"))
|
||||
m_transMult.applyMULT(p.getDoubleGridProperty("MULTX").getData(), FaceDir::XPlus);
|
||||
if (m_eclipseProperties.hasDeckDoubleGridProperty("MULTX-"))
|
||||
m_transMult.applyMULT(p.getDoubleGridProperty("MULTX-").getData(), FaceDir::XMinus);
|
||||
|
||||
if (m_eclipseProperties.hasDeckDoubleGridProperty("MULTY"))
|
||||
m_transMult.applyMULT(p.getDoubleGridProperty("MULTY").getData(), FaceDir::YPlus);
|
||||
if (m_eclipseProperties.hasDeckDoubleGridProperty("MULTY-"))
|
||||
m_transMult.applyMULT(p.getDoubleGridProperty("MULTY-").getData(), FaceDir::YMinus);
|
||||
|
||||
if (m_eclipseProperties.hasDeckDoubleGridProperty("MULTZ"))
|
||||
m_transMult.applyMULT(p.getDoubleGridProperty("MULTZ").getData(), FaceDir::ZPlus);
|
||||
if (m_eclipseProperties.hasDeckDoubleGridProperty("MULTZ-"))
|
||||
m_transMult.applyMULT(p.getDoubleGridProperty("MULTZ-").getData(), FaceDir::ZMinus);
|
||||
#endif
|
||||
}
|
||||
|
||||
void EclipseState::initFaults(const Deck& deck) {
|
||||
|
@ -23,7 +23,6 @@
|
||||
#include <opm/parser/eclipse/Deck/DeckItem.hpp>
|
||||
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
|
||||
#include <opm/parser/eclipse/Deck/DeckRecord.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Eclipse3DProperties.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/FaceDir.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/GridProperties.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/MULTREGTScanner.hpp>
|
||||
@ -108,31 +107,20 @@ std::vector<int> unique(const std::vector<int> data) {
|
||||
*/
|
||||
MULTREGTScanner::MULTREGTScanner(const GridDims& grid,
|
||||
const FieldPropsManager& fp_arg,
|
||||
const Eclipse3DProperties& e3DProps,
|
||||
const std::vector< const DeckKeyword* >& keywords) :
|
||||
nx(grid.getNX()),
|
||||
ny(grid.getNY()),
|
||||
nz(grid.getNZ()),
|
||||
fp(fp_arg),
|
||||
m_e3DProps(e3DProps) {
|
||||
|
||||
#ifdef ENABLE_3DPROPS_TESTING
|
||||
this->default_region = this->fp.default_region();
|
||||
#else
|
||||
this->default_region = this->m_e3DProps.getDefaultRegionKeyword();
|
||||
#endif
|
||||
fp(fp_arg) {
|
||||
|
||||
this->default_region = this->fp.default_region();
|
||||
for (size_t idx = 0; idx < keywords.size(); idx++)
|
||||
this->addKeyword(*keywords[idx] , this->default_region);
|
||||
|
||||
MULTREGTSearchMap searchPairs;
|
||||
for (std::vector<MULTREGTRecord>::const_iterator record = m_records.begin(); record != m_records.end(); ++record) {
|
||||
const std::string& region_name = record->region_name;
|
||||
#ifdef ENABLE_3DPROPS_TESTING
|
||||
if (this->fp.has<int>( region_name)) {
|
||||
#else
|
||||
if (this->m_e3DProps.hasDeckIntGridProperty( region_name)) {
|
||||
#endif
|
||||
int srcRegion = record->src_value;
|
||||
int targetRegion = record->target_value;
|
||||
|
||||
@ -151,13 +139,8 @@ std::vector<int> unique(const std::vector<int> data) {
|
||||
+ region_name
|
||||
+ " which is not in the deck");
|
||||
|
||||
#ifdef ENABLE_3DPROPS_TESTING
|
||||
if (this->regions.count(region_name) == 0)
|
||||
this->regions[region_name] = this->fp.get_global<int>(region_name);
|
||||
#else
|
||||
if (this->regions.count(region_name) == 0)
|
||||
this->regions[region_name] = this->m_e3DProps.getIntGridProperty(region_name).getData();
|
||||
#endif
|
||||
}
|
||||
|
||||
for (auto iter = searchPairs.begin(); iter != searchPairs.end(); ++iter) {
|
||||
@ -212,20 +195,12 @@ std::vector<int> unique(const std::vector<int> data) {
|
||||
region_name = MULTREGT::RegionNameFromDeckValue( regionItem.get<std::string>(0) );
|
||||
|
||||
if (srcItem.defaultApplied(0) || srcItem.get<int>(0) < 0)
|
||||
#ifdef ENABLE_3DPROPS_TESTING
|
||||
src_regions = unique(this->fp.get<int>(region_name));
|
||||
#else
|
||||
src_regions = unique(this->m_e3DProps.getIntGridProperty( region_name ).getData());
|
||||
#endif
|
||||
else
|
||||
src_regions.push_back(srcItem.get<int>(0));
|
||||
|
||||
if (targetItem.defaultApplied(0) || targetItem.get<int>(0) < 0)
|
||||
#ifdef ENABLE_3DPROPS_TESTING
|
||||
target_regions = unique(fp.get<int>(region_name));
|
||||
#else
|
||||
target_regions = unique(this->m_e3DProps.getIntGridProperty(region_name).getData());
|
||||
#endif
|
||||
else
|
||||
target_regions.push_back(targetItem.get<int>(0));
|
||||
|
||||
|
@ -21,8 +21,8 @@
|
||||
|
||||
#include <opm/common/OpmLog/OpmLog.hpp>
|
||||
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
|
||||
#include <opm/parser/eclipse/Deck/DeckSection.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/FieldPropsManager.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Eclipse3DProperties.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/Fault.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/FaultFace.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/FaultCollection.hpp>
|
||||
@ -34,7 +34,7 @@
|
||||
|
||||
namespace Opm {
|
||||
|
||||
TransMult::TransMult(const GridDims& dims, const Deck& deck, const FieldPropsManager& fp, const Eclipse3DProperties& props) :
|
||||
TransMult::TransMult(const GridDims& dims, const Deck& deck, const FieldPropsManager& fp) :
|
||||
m_nx( dims.getNX()),
|
||||
m_ny( dims.getNY()),
|
||||
m_nz( dims.getNZ()),
|
||||
@ -44,7 +44,7 @@ namespace Opm {
|
||||
{ FaceDir::XMinus, "MULTX-" },
|
||||
{ FaceDir::YMinus, "MULTY-" },
|
||||
{ FaceDir::ZMinus, "MULTZ-" }}),
|
||||
m_multregtScanner( dims, fp, props, deck.getKeywordList( "MULTREGT" ))
|
||||
m_multregtScanner( dims, fp, deck.getKeywordList( "MULTREGT" ))
|
||||
{
|
||||
EDITSection edit_section(deck);
|
||||
if (edit_section.hasKeyword("MULTREGT")) {
|
||||
|
@ -112,7 +112,6 @@ namespace {
|
||||
Schedule::Schedule( const Deck& deck,
|
||||
const EclipseGrid& grid,
|
||||
const FieldPropsManager& fp,
|
||||
const Eclipse3DProperties& eclipseProperties,
|
||||
const Runspec &runspec,
|
||||
const ParseContext& parseContext,
|
||||
ErrorGuard& errors) :
|
||||
@ -152,7 +151,7 @@ namespace {
|
||||
}
|
||||
|
||||
if (DeckSection::hasSCHEDULE(deck))
|
||||
iterateScheduleSection( parseContext, errors, SCHEDULESection( deck ), grid, fp, eclipseProperties );
|
||||
iterateScheduleSection( parseContext, errors, SCHEDULESection( deck ), grid, fp);
|
||||
}
|
||||
|
||||
|
||||
@ -160,20 +159,18 @@ namespace {
|
||||
Schedule::Schedule( const Deck& deck,
|
||||
const EclipseGrid& grid,
|
||||
const FieldPropsManager& fp,
|
||||
const Eclipse3DProperties& eclipseProperties,
|
||||
const Runspec &runspec,
|
||||
const ParseContext& parseContext,
|
||||
T&& errors) :
|
||||
Schedule(deck, grid, fp, eclipseProperties, runspec, parseContext, errors)
|
||||
Schedule(deck, grid, fp, runspec, parseContext, errors)
|
||||
{}
|
||||
|
||||
|
||||
Schedule::Schedule( const Deck& deck,
|
||||
const EclipseGrid& grid,
|
||||
const FieldPropsManager& fp,
|
||||
const Eclipse3DProperties& eclipseProperties,
|
||||
const Runspec &runspec) :
|
||||
Schedule(deck, grid, fp, eclipseProperties, runspec, ParseContext(), ErrorGuard())
|
||||
Schedule(deck, grid, fp, runspec, ParseContext(), ErrorGuard())
|
||||
{}
|
||||
|
||||
|
||||
@ -181,7 +178,6 @@ namespace {
|
||||
Schedule(deck,
|
||||
es.getInputGrid(),
|
||||
es.fieldProps(),
|
||||
es.get3DProperties(),
|
||||
es.runspec(),
|
||||
parse_context,
|
||||
errors)
|
||||
@ -194,7 +190,6 @@ namespace {
|
||||
Schedule(deck,
|
||||
es.getInputGrid(),
|
||||
es.fieldProps(),
|
||||
es.get3DProperties(),
|
||||
es.runspec(),
|
||||
parse_context,
|
||||
errors)
|
||||
@ -278,7 +273,6 @@ namespace {
|
||||
ErrorGuard& errors,
|
||||
const EclipseGrid& grid,
|
||||
const FieldPropsManager& fp,
|
||||
const Eclipse3DProperties& eclipseProperties,
|
||||
const UnitSystem& unit_system,
|
||||
std::vector<std::pair<const DeckKeyword*, size_t > >& rftProperties) {
|
||||
/*
|
||||
@ -373,7 +367,7 @@ namespace {
|
||||
handleWGRUPCON(keyword, currentStep);
|
||||
|
||||
else if (keyword.name() == "COMPDAT")
|
||||
handleCOMPDAT(keyword, currentStep, grid, fp, eclipseProperties, parseContext, errors);
|
||||
handleCOMPDAT(keyword, currentStep, grid, fp, parseContext, errors);
|
||||
|
||||
else if (keyword.name() == "WELSEGS")
|
||||
handleWELSEGS(keyword, currentStep);
|
||||
@ -485,7 +479,7 @@ namespace {
|
||||
|
||||
|
||||
void Schedule::iterateScheduleSection(const ParseContext& parseContext , ErrorGuard& errors, const SCHEDULESection& section , const EclipseGrid& grid,
|
||||
const FieldPropsManager& fp, const Eclipse3DProperties& eclipseProperties) {
|
||||
const FieldPropsManager& fp) {
|
||||
size_t currentStep = 0;
|
||||
const auto& unit_system = section.unitSystem();
|
||||
std::vector<std::pair< const DeckKeyword* , size_t> > rftProperties;
|
||||
@ -513,7 +507,7 @@ namespace {
|
||||
}
|
||||
this->addACTIONX(action, currentStep);
|
||||
} else
|
||||
this->handleKeyword(currentStep, section, keywordIdx, keyword, parseContext, errors, grid, fp, eclipseProperties, unit_system, rftProperties);
|
||||
this->handleKeyword(currentStep, section, keywordIdx, keyword, parseContext, errors, grid, fp, unit_system, rftProperties);
|
||||
|
||||
keywordIdx++;
|
||||
if (keywordIdx == section.size())
|
||||
@ -579,7 +573,7 @@ namespace {
|
||||
if (prop->whistctl_cmode != controlMode) {
|
||||
prop->whistctl_cmode = controlMode;
|
||||
well2->updateProduction(prop);
|
||||
this->updateWell(well2, currentStep);
|
||||
this->updateWell(std::move(well2), currentStep);
|
||||
}
|
||||
}
|
||||
|
||||
@ -591,7 +585,7 @@ namespace {
|
||||
if (prop->whistctl_cmode != controlMode) {
|
||||
prop->whistctl_cmode = controlMode;
|
||||
well2->updateProduction(prop);
|
||||
this->updateWell(well2, currentStep);
|
||||
this->updateWell(std::move(well2), currentStep);
|
||||
}
|
||||
}
|
||||
|
||||
@ -603,7 +597,7 @@ namespace {
|
||||
if (prop->whistctl_cmode != controlMode) {
|
||||
prop->whistctl_cmode = controlMode;
|
||||
well2->updateProduction(prop);
|
||||
this->updateWell(well2, currentStep);
|
||||
this->updateWell(std::move(well2), currentStep);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -725,8 +719,8 @@ namespace {
|
||||
update |= well2->updateDrainageRadius(drainageRadius);
|
||||
|
||||
if (update) {
|
||||
this->updateWell(well2, currentStep);
|
||||
this->addWellGroupEvent(well2->name(), ScheduleEvents::WELL_WELSPECS_UPDATE, currentStep);
|
||||
this->updateWell(std::move(well2), currentStep);
|
||||
this->addWellGroupEvent(wellName, ScheduleEvents::WELL_WELSPECS_UPDATE, currentStep);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -905,7 +899,7 @@ namespace {
|
||||
if (update_well) {
|
||||
m_events.addEvent( ScheduleEvents::PRODUCTION_UPDATE , currentStep);
|
||||
this->addWellGroupEvent( well2->name(), ScheduleEvents::PRODUCTION_UPDATE, currentStep);
|
||||
this->updateWell(well2, currentStep);
|
||||
this->updateWell(std::move(well2), currentStep);
|
||||
}
|
||||
|
||||
auto udq = std::make_shared<UDQActive>(this->udqActive(currentStep));
|
||||
@ -931,7 +925,7 @@ namespace {
|
||||
|
||||
void Schedule::updateWell(std::shared_ptr<Well> well, size_t reportStep) {
|
||||
auto& dynamic_state = this->wells_static.at(well->name());
|
||||
dynamic_state.update(reportStep, well);
|
||||
dynamic_state.update(reportStep, std::move(well));
|
||||
}
|
||||
|
||||
|
||||
@ -964,7 +958,7 @@ namespace {
|
||||
auto& dynamic_state = this->wells_static.at(wname);
|
||||
auto well_ptr = std::make_shared<Well>( *dynamic_state[currentStep] );
|
||||
if (well_ptr->handleWPIMULT(record))
|
||||
this->updateWell(well_ptr, currentStep);
|
||||
this->updateWell(std::move(well_ptr), currentStep);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1095,7 +1089,7 @@ namespace {
|
||||
auto foam_properties = std::make_shared<WellFoamProperties>(well2->getFoamProperties());
|
||||
foam_properties->handleWFOAM(record);
|
||||
if (well2->updateFoamProperties(foam_properties))
|
||||
this->updateWell(well2, currentStep);
|
||||
this->updateWell(std::move(well2), currentStep);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1115,7 +1109,7 @@ namespace {
|
||||
auto polymer_properties = std::make_shared<WellPolymerProperties>( well2->getPolymerProperties() );
|
||||
polymer_properties->handleWPOLYMER(record);
|
||||
if (well2->updatePolymerProperties(polymer_properties))
|
||||
this->updateWell(well2, currentStep);
|
||||
this->updateWell(std::move(well2), currentStep);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1158,7 +1152,7 @@ namespace {
|
||||
auto polymer_properties = std::make_shared<WellPolymerProperties>( well2->getPolymerProperties() );
|
||||
polymer_properties->handleWPMITAB(record);
|
||||
if (well2->updatePolymerProperties(polymer_properties))
|
||||
this->updateWell(well2, currentStep);
|
||||
this->updateWell(std::move(well2), currentStep);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1182,7 +1176,7 @@ namespace {
|
||||
auto polymer_properties = std::make_shared<WellPolymerProperties>( well2->getPolymerProperties() );
|
||||
polymer_properties->handleWSKPTAB(record);
|
||||
if (well2->updatePolymerProperties(polymer_properties))
|
||||
this->updateWell(well2, currentStep);
|
||||
this->updateWell(std::move(well2), currentStep);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1203,7 +1197,7 @@ namespace {
|
||||
auto well2 = std::make_shared<Well>(*dynamic_state[currentStep]);
|
||||
auto econ_limits = std::make_shared<WellEconProductionLimits>( record );
|
||||
if (well2->updateEconLimits(econ_limits))
|
||||
this->updateWell(well2, currentStep);
|
||||
this->updateWell(std::move(well2), currentStep);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1223,7 +1217,7 @@ namespace {
|
||||
auto& dynamic_state = this->wells_static.at(well_name);
|
||||
auto well2 = std::make_shared<Well>(*dynamic_state[currentStep]);
|
||||
if (well2->updateEfficiencyFactor(efficiencyFactor))
|
||||
this->updateWell(well2, currentStep);
|
||||
this->updateWell(std::move(well2), currentStep);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1326,7 +1320,7 @@ namespace {
|
||||
if (well.getSolventFraction() != fraction) {
|
||||
auto new_well = std::make_shared<Well>(well);
|
||||
new_well->updateSolventFraction(fraction);
|
||||
this->updateWell(new_well, currentStep);
|
||||
this->updateWell(std::move(new_well), currentStep);
|
||||
}
|
||||
} else
|
||||
throw std::invalid_argument("The WSOLVENT keyword can only be applied to gas injectors");
|
||||
@ -1352,7 +1346,7 @@ namespace {
|
||||
auto wellTracerProperties = std::make_shared<WellTracerProperties>( well->getTracerProperties() );
|
||||
wellTracerProperties->setConcentration(tracerName, tracerConcentration);
|
||||
if (well->updateTracer(wellTracerProperties))
|
||||
this->updateWell(well, currentStep);
|
||||
this->updateWell(std::move(well), currentStep);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1382,7 +1376,7 @@ namespace {
|
||||
auto inj = std::make_shared<Well::WellInjectionProperties>(well_ptr->getInjectionProperties());
|
||||
inj->temperature = temp;
|
||||
well_ptr->updateInjection(inj);
|
||||
this->updateWell(well_ptr, currentStep);
|
||||
this->updateWell(std::move(well_ptr), currentStep);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1416,7 +1410,7 @@ namespace {
|
||||
auto inj = std::make_shared<Well::WellInjectionProperties>(well_ptr->getInjectionProperties());
|
||||
inj->temperature = temp;
|
||||
well_ptr->updateInjection(inj);
|
||||
this->updateWell(well_ptr, currentStep);
|
||||
this->updateWell(std::move(well_ptr), currentStep);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1434,7 +1428,7 @@ namespace {
|
||||
auto& dynamic_state = this->wells_static.at(wname);
|
||||
auto well_ptr = std::make_shared<Well>( *dynamic_state[timestep] );
|
||||
if (well_ptr->handleCOMPLUMP(record))
|
||||
this->updateWell(well_ptr, timestep);
|
||||
this->updateWell(std::move(well_ptr), timestep);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1558,7 +1552,7 @@ namespace {
|
||||
update |= well2->updateWellGuideRate(newValue);
|
||||
}
|
||||
if (update)
|
||||
this->updateWell(well2, currentStep);
|
||||
this->updateWell(std::move(well2), currentStep);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1969,11 +1963,7 @@ namespace {
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef ENABLE_3DPROPS_TESTING
|
||||
void Schedule::handleCOMPDAT( const DeckKeyword& keyword, size_t currentStep, const EclipseGrid& grid, const FieldPropsManager& fp, const Eclipse3DProperties&, const ParseContext& parseContext, ErrorGuard& errors) {
|
||||
#else
|
||||
void Schedule::handleCOMPDAT( const DeckKeyword& keyword, size_t currentStep, const EclipseGrid& grid, const FieldPropsManager& , const Eclipse3DProperties& eclipseProperties, const ParseContext& parseContext, ErrorGuard& errors) {
|
||||
#endif
|
||||
void Schedule::handleCOMPDAT( const DeckKeyword& keyword, size_t currentStep, const EclipseGrid& grid, const FieldPropsManager& fp, const ParseContext& parseContext, ErrorGuard& errors) {
|
||||
for (const auto& record : keyword) {
|
||||
const std::string& wellNamePattern = record.getItem("WELL").getTrimmedString(0);
|
||||
auto wellnames = this->wellNames(wellNamePattern, currentStep);
|
||||
@ -1984,11 +1974,7 @@ namespace {
|
||||
{
|
||||
auto well2 = std::shared_ptr<Well>(new Well( this->getWell(name, currentStep)));
|
||||
auto connections = std::shared_ptr<WellConnections>( new WellConnections( well2->getConnections()));
|
||||
#ifdef ENABLE_3DPROPS_TESTING
|
||||
connections->loadCOMPDAT(record, grid, fp);
|
||||
#else
|
||||
connections->loadCOMPDAT(record, grid, eclipseProperties);
|
||||
#endif
|
||||
/*
|
||||
This block implements the following dubious logic.
|
||||
|
||||
@ -2038,7 +2024,7 @@ namespace {
|
||||
auto& dynamic_state = this->wells_static.at(wname);
|
||||
auto well_ptr = std::make_shared<Well>( *dynamic_state[currentStep] );
|
||||
if (well_ptr->handleWELSEGS(keyword))
|
||||
this->updateWell(well_ptr, currentStep);
|
||||
this->updateWell(std::move(well_ptr), currentStep);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2050,7 +2036,7 @@ namespace {
|
||||
auto& dynamic_state = this->wells_static.at(well_name);
|
||||
auto well_ptr = std::make_shared<Well>( *dynamic_state[currentStep] );
|
||||
if (well_ptr->handleCOMPSEGS(keyword, grid, parseContext, errors))
|
||||
this->updateWell(well_ptr, currentStep);
|
||||
this->updateWell(std::move(well_ptr), currentStep);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2068,7 +2054,7 @@ namespace {
|
||||
auto& dynamic_state = this->wells_static.at(well_name);
|
||||
auto well_ptr = std::make_shared<Well>( *dynamic_state[currentStep] );
|
||||
if (well_ptr -> updateWSEGSICD(sicd_pairs) )
|
||||
this->updateWell(well_ptr, currentStep);
|
||||
this->updateWell(std::move(well_ptr), currentStep);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2085,7 +2071,7 @@ namespace {
|
||||
auto& dynamic_state = this->wells_static.at(well_name);
|
||||
auto well_ptr = std::make_shared<Well>( *dynamic_state[currentStep] );
|
||||
if (well_ptr -> updateWSEGVALV(valve_pairs) )
|
||||
this->updateWell(well_ptr, currentStep);
|
||||
this->updateWell(std::move(well_ptr), currentStep);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2107,11 +2093,11 @@ namespace {
|
||||
auto& dynamic_state = this->wells_static.at(well_name);
|
||||
auto well_ptr = std::make_shared<Well>( *dynamic_state[currentStep] );
|
||||
if (well_ptr->updateWellGuideRate(availableForGroupControl, guide_rate, phase, scaling_factor)) {
|
||||
this->updateWell(well_ptr, currentStep);
|
||||
|
||||
auto new_config = std::make_shared<GuideRateConfig>( this->guideRateConfig(currentStep) );
|
||||
new_config->update_well(*well_ptr);
|
||||
this->guide_rate_config.update( currentStep, std::move(new_config) );
|
||||
|
||||
this->updateWell(std::move(well_ptr), currentStep);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -55,9 +55,8 @@ namespace Opm {
|
||||
|
||||
SimulationConfig::SimulationConfig(bool restart,
|
||||
const Deck& deck,
|
||||
const FieldPropsManager& fp,
|
||||
const Eclipse3DProperties& eclipseProperties) :
|
||||
m_ThresholdPressure( restart, deck, fp, eclipseProperties ),
|
||||
const FieldPropsManager& fp) :
|
||||
m_ThresholdPressure( restart, deck, fp),
|
||||
m_useCPR(false),
|
||||
m_DISGAS(false),
|
||||
m_VAPOIL(false),
|
||||
|
@ -30,17 +30,9 @@
|
||||
|
||||
namespace Opm {
|
||||
|
||||
#ifdef ENABLE_3DPROPS_TESTING
|
||||
ThresholdPressure::ThresholdPressure(bool restart,
|
||||
const Deck& deck,
|
||||
const FieldPropsManager& fp,
|
||||
const Eclipse3DProperties& ) :
|
||||
#else
|
||||
ThresholdPressure::ThresholdPressure(bool restart,
|
||||
const Deck& deck,
|
||||
const FieldPropsManager& ,
|
||||
const Eclipse3DProperties& eclipseProperties) :
|
||||
#endif
|
||||
const FieldPropsManager& fp) :
|
||||
m_active(false),
|
||||
m_restart(restart)
|
||||
{
|
||||
@ -97,18 +89,11 @@ namespace Opm {
|
||||
|
||||
//Option is set and keyword is found
|
||||
if( m_active && thpresKeyword ) {
|
||||
#ifdef ENABLE_3DPROPS_TESTING
|
||||
if (!fp.has<int>("EQLNUM"))
|
||||
throw std::runtime_error("Error when internalizing THPRES: EQLNUM keyword not found in deck");
|
||||
|
||||
const auto& eqlnum = fp.get<int>("EQLNUM");
|
||||
#else
|
||||
if( !eclipseProperties.hasDeckIntGridProperty("EQLNUM"))
|
||||
throw std::runtime_error("Error when internalizing THPRES: EQLNUM keyword not found in deck");
|
||||
|
||||
const auto& eqlnumKeyword = eclipseProperties.getIntGridProperty( "EQLNUM" );
|
||||
const auto& eqlnum = eqlnumKeyword.getData();
|
||||
#endif
|
||||
//Find max of eqlnum
|
||||
int maxEqlnum = *std::max_element(eqlnum.begin(), eqlnum.end());
|
||||
|
||||
|
@ -127,21 +127,20 @@ TSTEP
|
||||
auto deck3 = parser.parseString(WITH_GRID);
|
||||
EclipseGrid grid1(10,10,10);
|
||||
TableManager table ( deck1 );
|
||||
Eclipse3DProperties eclipseProperties ( deck1 , table, grid1);
|
||||
FieldPropsManager fp( deck1 , grid1, table);
|
||||
Runspec runspec (deck1);
|
||||
|
||||
// The ACTIONX keyword has no matching 'ENDACTIO' -> exception
|
||||
BOOST_CHECK_THROW(Schedule(deck1, grid1, fp, eclipseProperties, runspec ), std::invalid_argument);
|
||||
BOOST_CHECK_THROW(Schedule(deck1, grid1, fp, runspec ), std::invalid_argument);
|
||||
|
||||
Schedule sched(deck2, grid1, fp, eclipseProperties, runspec);
|
||||
Schedule sched(deck2, grid1, fp, runspec);
|
||||
BOOST_CHECK( !sched.hasWell("W1") );
|
||||
BOOST_CHECK( sched.hasWell("W2"));
|
||||
|
||||
// The deck3 contains the 'GRID' keyword in the ACTIONX block - that is not a whitelisted keyword.
|
||||
ParseContext parseContext( {{ParseContext::ACTIONX_ILLEGAL_KEYWORD, InputError::THROW_EXCEPTION}} );
|
||||
ErrorGuard errors;
|
||||
BOOST_CHECK_THROW(Schedule(deck3, grid1, fp, eclipseProperties, runspec, parseContext, errors), std::invalid_argument);
|
||||
BOOST_CHECK_THROW(Schedule(deck3, grid1, fp, runspec, parseContext, errors), std::invalid_argument);
|
||||
}
|
||||
|
||||
|
||||
@ -222,11 +221,10 @@ TSTEP
|
||||
auto deck = parser.parseString(deck_string);
|
||||
EclipseGrid grid1(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid1);
|
||||
FieldPropsManager fp( deck , grid1, table);
|
||||
Runspec runspec(deck);
|
||||
|
||||
return Schedule(deck, grid1, fp, eclipseProperties, runspec);
|
||||
return Schedule(deck, grid1, fp, runspec);
|
||||
}
|
||||
|
||||
|
||||
@ -693,11 +691,10 @@ TSTEP
|
||||
auto deck = parser.parseString(deck_string);
|
||||
EclipseGrid grid1(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid1);
|
||||
FieldPropsManager fp( deck , grid1, table);
|
||||
|
||||
Runspec runspec (deck);
|
||||
Schedule sched(deck, grid1, fp, eclipseProperties, runspec);
|
||||
Schedule sched(deck, grid1, fp, runspec);
|
||||
const auto& actions0 = sched.actions(0);
|
||||
BOOST_CHECK_EQUAL(actions0.size(), 0);
|
||||
|
||||
|
@ -966,10 +966,10 @@ static Opm::Deck createActnumBoxDeck() {
|
||||
BOOST_AUTO_TEST_CASE(GridBoxActnum) {
|
||||
auto deck = createActnumBoxDeck();
|
||||
Opm::EclipseState es( deck);
|
||||
auto ep = es.get3DProperties();
|
||||
const auto& fp = es.fieldProps();
|
||||
const auto& grid = es.getInputGrid();
|
||||
|
||||
BOOST_CHECK_NO_THROW(ep.getIntGridProperty("ACTNUM"));
|
||||
BOOST_CHECK_NO_THROW(fp.get<int>("ACTNUM"));
|
||||
|
||||
size_t active = 10 * 10 * 10 // 1000
|
||||
- (10 * 10 * 1) // - top layer
|
||||
@ -1017,14 +1017,14 @@ BOOST_AUTO_TEST_CASE(GridActnumVia3D) {
|
||||
auto deck = createActnumDeck();
|
||||
|
||||
Opm::EclipseState es( deck);
|
||||
auto ep = es.get3DProperties();
|
||||
const auto& fp = es.fieldProps();
|
||||
const auto& grid = es.getInputGrid();
|
||||
Opm::EclipseGrid grid2( grid );
|
||||
|
||||
std::vector<int> actnum = {1, 1, 0, 1, 1, 0, 1, 1};
|
||||
Opm::EclipseGrid grid3( grid , actnum);
|
||||
|
||||
BOOST_CHECK_NO_THROW(ep.getIntGridProperty("ACTNUM"));
|
||||
BOOST_CHECK_NO_THROW(fp.get<int>("ACTNUM"));
|
||||
BOOST_CHECK_NO_THROW(grid.getNumActive());
|
||||
BOOST_CHECK_EQUAL(grid.getNumActive(), 2 * 2 * 2 - 1);
|
||||
|
||||
|
@ -100,18 +100,14 @@ static Deck createDeckTOP() {
|
||||
BOOST_AUTO_TEST_CASE(GetPOROTOPBased) {
|
||||
auto deck = createDeckTOP();
|
||||
EclipseState state(deck );
|
||||
const Eclipse3DProperties& props = state.get3DProperties();
|
||||
const auto& fp = state.fieldProps();
|
||||
|
||||
const GridProperty<double>& poro = props.getDoubleGridProperty( "PORO" );
|
||||
const GridProperty<double>& permx = props.getDoubleGridProperty( "PERMX" );
|
||||
const auto& poro = fp.get<double>( "PORO" );
|
||||
const auto& permx = fp.get<double>( "PERMX" );
|
||||
|
||||
BOOST_CHECK_EQUAL(1000U , poro.getCartesianSize() );
|
||||
BOOST_CHECK_EQUAL(1000U , permx.getCartesianSize() );
|
||||
const auto& poro_data = poro.getData();
|
||||
const auto& permx_data = permx.getData();
|
||||
for (size_t i=0; i < poro.getCartesianSize(); i++) {
|
||||
BOOST_CHECK_EQUAL( 0.10 , poro_data[i]);
|
||||
BOOST_CHECK_EQUAL( 0.25 * Metric::Permeability , permx_data[i]);
|
||||
for (size_t i=0; i < poro.size(); i++) {
|
||||
BOOST_CHECK_EQUAL( 0.10 , poro[i]);
|
||||
BOOST_CHECK_EQUAL( 0.25 * Metric::Permeability , permx[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -278,9 +274,9 @@ BOOST_AUTO_TEST_CASE(IntProperties) {
|
||||
auto deck = createDeck();
|
||||
EclipseState state( deck );
|
||||
|
||||
BOOST_CHECK_EQUAL( false, state.get3DProperties().supportsGridProperty( "NONO" ) );
|
||||
BOOST_CHECK_EQUAL( true, state.get3DProperties().supportsGridProperty( "SATNUM" ) );
|
||||
BOOST_CHECK_EQUAL( true, state.get3DProperties().hasDeckIntGridProperty( "SATNUM" ) );
|
||||
BOOST_CHECK_EQUAL( false, state.fieldProps().supported<int>( "NONO" ) );
|
||||
BOOST_CHECK_EQUAL( true, state.fieldProps().supported<int>( "SATNUM" ) );
|
||||
BOOST_CHECK_EQUAL( true, state.fieldProps().has<int>( "SATNUM" ) );
|
||||
}
|
||||
|
||||
|
||||
@ -288,11 +284,10 @@ BOOST_AUTO_TEST_CASE(GetProperty) {
|
||||
auto deck = createDeck();
|
||||
EclipseState state(deck);
|
||||
|
||||
const auto& satNUM = state.get3DProperties().getIntGridProperty( "SATNUM" );
|
||||
const auto& satnum_data = satNUM.getData();
|
||||
BOOST_CHECK_EQUAL(1000U , satNUM.getCartesianSize() );
|
||||
for (size_t i=0; i < satNUM.getCartesianSize(); i++)
|
||||
BOOST_CHECK_EQUAL( 2 , satnum_data[i]);
|
||||
const auto& satnum = state.fieldProps().get_global<int>("SATNUM");
|
||||
BOOST_CHECK_EQUAL(1000U , satnum.size() );
|
||||
for (size_t i=0; i < satnum.size(); i++)
|
||||
BOOST_CHECK_EQUAL( 2 , satnum[i]);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(GetTransMult) {
|
||||
@ -427,11 +422,11 @@ static Deck createDeckWithGridOpts() {
|
||||
BOOST_AUTO_TEST_CASE(NoGridOptsDefaultRegion) {
|
||||
auto deck = createDeckNoGridOpts();
|
||||
EclipseState state(deck);
|
||||
const auto& props = state.get3DProperties();
|
||||
const auto& multnum = props.getIntGridProperty("MULTNUM");
|
||||
const auto& fluxnum = props.getIntGridProperty("FLUXNUM");
|
||||
const auto default_kw = props.getDefaultRegionKeyword();
|
||||
const auto& def_pro = props.getIntGridProperty(default_kw);
|
||||
const auto& fp = state.fieldProps();
|
||||
const auto& multnum = fp.get<int>("MULTNUM");
|
||||
const auto& fluxnum = fp.get<int>("FLUXNUM");
|
||||
const auto default_kw = fp.default_region();
|
||||
const auto& def_pro = fp.get<int>(default_kw);
|
||||
|
||||
BOOST_CHECK_EQUAL( &fluxnum , &def_pro );
|
||||
BOOST_CHECK_NE( &fluxnum , &multnum );
|
||||
@ -441,11 +436,11 @@ BOOST_AUTO_TEST_CASE(NoGridOptsDefaultRegion) {
|
||||
BOOST_AUTO_TEST_CASE(WithGridOptsDefaultRegion) {
|
||||
auto deck = createDeckWithGridOpts();
|
||||
EclipseState state(deck);
|
||||
const auto& props = state.get3DProperties();
|
||||
const auto& multnum = props.getIntGridProperty("MULTNUM");
|
||||
const auto& fluxnum = props.getIntGridProperty("FLUXNUM");
|
||||
const auto default_kw = props.getDefaultRegionKeyword();
|
||||
const auto& def_pro = props.getIntGridProperty(default_kw);
|
||||
const auto& fp = state.fieldProps();
|
||||
const auto& multnum = fp.get<int>("MULTNUM");
|
||||
const auto& fluxnum = fp.get<int>("FLUXNUM");
|
||||
const auto default_kw = fp.default_region();
|
||||
const auto& def_pro = fp.get<int>(default_kw);
|
||||
|
||||
BOOST_CHECK_EQUAL( &multnum , &def_pro );
|
||||
BOOST_CHECK_NE( &fluxnum , &multnum );
|
||||
|
@ -76,13 +76,12 @@ BOOST_AUTO_TEST_CASE( CheckUnsoppertedInSCHEDULE ) {
|
||||
auto deck = parser.parseString( deckString, parseContext, errors);
|
||||
EclipseGrid grid( deck );
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
|
||||
parseContext.update( ParseContext::UNSUPPORTED_SCHEDULE_GEO_MODIFIER , InputError::IGNORE );
|
||||
{
|
||||
Runspec runspec ( deck );
|
||||
Schedule schedule( deck, grid , fp, eclipseProperties, runspec , parseContext, errors);
|
||||
Schedule schedule( deck, grid , fp, runspec , parseContext, errors);
|
||||
auto events = schedule.getEvents( );
|
||||
BOOST_CHECK_EQUAL( false , events.hasEvent( ScheduleEvents::GEO_MODIFIER , 1 ));
|
||||
BOOST_CHECK_EQUAL( true , events.hasEvent( ScheduleEvents::GEO_MODIFIER , 2 ));
|
||||
|
@ -128,10 +128,9 @@ BOOST_AUTO_TEST_CASE(createDeckWithGEFAC) {
|
||||
auto deck = parser.parseString(input);
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
Runspec runspec (deck );
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Opm::Schedule schedule(deck, grid, fp, eclipseProperties, runspec);
|
||||
Opm::Schedule schedule(deck, grid, fp, runspec);
|
||||
|
||||
auto group_names = schedule.groupNames("PRODUC");
|
||||
BOOST_CHECK_EQUAL(group_names.size(), 1);
|
||||
@ -182,10 +181,9 @@ BOOST_AUTO_TEST_CASE(createDeckWithWGRUPCONandWCONPROD) {
|
||||
auto deck = parser.parseString(input);
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck );
|
||||
Opm::Schedule schedule(deck, grid, fp, eclipseProperties, runspec);
|
||||
Opm::Schedule schedule(deck, grid, fp, runspec);
|
||||
const auto& currentWell = schedule.getWell("B-37T2", 0);
|
||||
const Opm::Well::WellProductionProperties& wellProductionProperties = currentWell.getProductionProperties();
|
||||
BOOST_CHECK(wellProductionProperties.controlMode == Opm::Well::ProducerCMode::GRUP);
|
||||
@ -227,10 +225,9 @@ BOOST_AUTO_TEST_CASE(createDeckWithGRUPNET) {
|
||||
auto deck = parser.parseString(input);
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck );
|
||||
Opm::Schedule schedule(deck, grid, fp, eclipseProperties, runspec);
|
||||
Opm::Schedule schedule(deck, grid, fp, runspec);
|
||||
|
||||
const auto& group1 = schedule.getGroup("PROD", 0);
|
||||
const auto& group2 = schedule.getGroup("MANI-E2", 0);
|
||||
@ -286,10 +283,9 @@ BOOST_AUTO_TEST_CASE(createDeckWithGCONPROD) {
|
||||
auto deck = parser.parseString(input);
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck );
|
||||
Opm::Schedule schedule(deck, grid, fp, eclipseProperties, runspec);
|
||||
Opm::Schedule schedule(deck, grid, fp, runspec);
|
||||
SummaryState st(std::chrono::system_clock::now());
|
||||
|
||||
const auto& group1 = schedule.getGroup("G1", 0);
|
||||
@ -340,12 +336,11 @@ BOOST_AUTO_TEST_CASE(TESTGuideRateLINCOM) {
|
||||
auto deck = parser.parseString(input);
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck );
|
||||
|
||||
/* The 'COMB' target mode is not supported */
|
||||
BOOST_CHECK_THROW(Opm::Schedule schedule(deck, grid, fp, eclipseProperties, runspec), std::logic_error);
|
||||
BOOST_CHECK_THROW(Opm::Schedule schedule(deck, grid, fp, runspec), std::logic_error);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(TESTGuideRate) {
|
||||
@ -378,10 +373,9 @@ BOOST_AUTO_TEST_CASE(TESTGuideRate) {
|
||||
auto deck = parser.parseString(input);
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck );
|
||||
Schedule schedule(deck, grid, fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck, grid, fp, runspec);
|
||||
|
||||
GuideRate gr(schedule);
|
||||
}
|
||||
@ -412,10 +406,9 @@ BOOST_AUTO_TEST_CASE(TESTGCONSALE) {
|
||||
auto deck = parser.parseString(input);
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck );
|
||||
Schedule schedule(deck, grid, fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck, grid, fp, runspec);
|
||||
|
||||
double metric_to_si = 1.0 / (24.0 * 3600.0); //cubic meters / day
|
||||
|
||||
|
@ -31,7 +31,6 @@
|
||||
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/Eclipse3DProperties.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/MULTREGTScanner.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/GridProperties.hpp>
|
||||
@ -110,26 +109,25 @@ BOOST_AUTO_TEST_CASE(InvalidInput) {
|
||||
Opm::EclipseGrid grid( deck );
|
||||
Opm::TableManager tm(deck);
|
||||
Opm::EclipseGrid eg( deck );
|
||||
Opm::Eclipse3DProperties props(deck, tm, eg);
|
||||
Opm::FieldPropsManager fp(deck, eg, tm);
|
||||
|
||||
// Invalid direction
|
||||
std::vector<const Opm::DeckKeyword*> keywords0;
|
||||
const auto& multregtKeyword0 = deck.getKeyword( "MULTREGT", 0 );
|
||||
keywords0.push_back( &multregtKeyword0 );
|
||||
BOOST_CHECK_THROW( Opm::MULTREGTScanner scanner( grid, fp, props, keywords0 ); , std::invalid_argument );
|
||||
BOOST_CHECK_THROW( Opm::MULTREGTScanner scanner( grid, fp, keywords0 ); , std::invalid_argument );
|
||||
|
||||
// Not supported region
|
||||
std::vector<const Opm::DeckKeyword*> keywords1;
|
||||
const auto& multregtKeyword1 = deck.getKeyword( "MULTREGT", 1 );
|
||||
keywords1.push_back( &multregtKeyword1 );
|
||||
BOOST_CHECK_THROW( Opm::MULTREGTScanner scanner( grid, fp, props, keywords1 ); , std::invalid_argument );
|
||||
BOOST_CHECK_THROW( Opm::MULTREGTScanner scanner( grid, fp, keywords1 ); , std::invalid_argument );
|
||||
|
||||
// The keyword is ok; but it refers to a region which is not in the deck.
|
||||
std::vector<const Opm::DeckKeyword*> keywords2;
|
||||
const auto& multregtKeyword2 = deck.getKeyword( "MULTREGT", 2 );
|
||||
keywords2.push_back( &multregtKeyword2 );
|
||||
BOOST_CHECK_THROW( Opm::MULTREGTScanner scanner( grid, fp, props, keywords2 ); , std::logic_error );
|
||||
BOOST_CHECK_THROW( Opm::MULTREGTScanner scanner( grid, fp, keywords2 ); , std::logic_error );
|
||||
}
|
||||
|
||||
|
||||
@ -177,7 +175,6 @@ BOOST_AUTO_TEST_CASE(NotSupported) {
|
||||
Opm::EclipseGrid grid( deck );
|
||||
Opm::TableManager tm(deck);
|
||||
Opm::EclipseGrid eg( deck );
|
||||
Opm::Eclipse3DProperties props(deck, tm, eg);
|
||||
Opm::FieldPropsManager fp(deck, eg, tm);
|
||||
|
||||
|
||||
@ -185,13 +182,13 @@ BOOST_AUTO_TEST_CASE(NotSupported) {
|
||||
std::vector<const Opm::DeckKeyword*> keywords0;
|
||||
const auto& multregtKeyword0 = deck.getKeyword( "MULTREGT", 0 );
|
||||
keywords0.push_back( &multregtKeyword0 );
|
||||
BOOST_CHECK_THROW( Opm::MULTREGTScanner scanner( grid, fp, props, keywords0 ); , std::invalid_argument );
|
||||
BOOST_CHECK_THROW( Opm::MULTREGTScanner scanner( grid, fp, keywords0 ); , std::invalid_argument );
|
||||
|
||||
// srcValue == targetValue - not supported
|
||||
std::vector<const Opm::DeckKeyword*> keywords1;
|
||||
const Opm::DeckKeyword& multregtKeyword1 = deck.getKeyword( "MULTREGT", 1 );
|
||||
keywords1.push_back( &multregtKeyword1 );
|
||||
BOOST_CHECK_THROW( Opm::MULTREGTScanner scanner( grid, fp, props, keywords1 ); , std::invalid_argument );
|
||||
BOOST_CHECK_THROW( Opm::MULTREGTScanner scanner( grid, fp, keywords1 ); , std::invalid_argument );
|
||||
}
|
||||
|
||||
static Opm::Deck createDefaultedRegions() {
|
||||
@ -239,14 +236,13 @@ BOOST_AUTO_TEST_CASE(DefaultedRegions) {
|
||||
Opm::EclipseGrid grid( deck );
|
||||
Opm::TableManager tm(deck);
|
||||
Opm::EclipseGrid eg( deck );
|
||||
Opm::Eclipse3DProperties props(deck, tm, eg);
|
||||
Opm::FieldPropsManager fp(deck, eg, tm);
|
||||
|
||||
|
||||
std::vector<const Opm::DeckKeyword*> keywords0;
|
||||
const auto& multregtKeyword0 = deck.getKeyword( "MULTREGT", 0 );
|
||||
keywords0.push_back( &multregtKeyword0 );
|
||||
Opm::MULTREGTScanner scanner0(grid, fp, props, keywords0);
|
||||
Opm::MULTREGTScanner scanner0(grid, fp, keywords0);
|
||||
BOOST_CHECK_EQUAL( scanner0.getRegionMultiplier(grid.getGlobalIndex(0,0,1), grid.getGlobalIndex(1,0,1), Opm::FaceDir::XPlus ), 1.25);
|
||||
BOOST_CHECK_EQUAL( scanner0.getRegionMultiplier(grid.getGlobalIndex(1,0,0), grid.getGlobalIndex(2,0,0), Opm::FaceDir::XPlus ), 1.0);
|
||||
BOOST_CHECK_EQUAL( scanner0.getRegionMultiplier(grid.getGlobalIndex(2,0,1), grid.getGlobalIndex(2,0,0), Opm::FaceDir::ZMinus ), 0.0);
|
||||
@ -254,7 +250,7 @@ BOOST_AUTO_TEST_CASE(DefaultedRegions) {
|
||||
std::vector<const Opm::DeckKeyword*> keywords1;
|
||||
const Opm::DeckKeyword& multregtKeyword1 = deck.getKeyword( "MULTREGT", 1 );
|
||||
keywords1.push_back( &multregtKeyword1 );
|
||||
Opm::MULTREGTScanner scanner1(grid, fp, props, keywords1 );
|
||||
Opm::MULTREGTScanner scanner1(grid, fp, keywords1 );
|
||||
BOOST_CHECK_EQUAL( scanner1.getRegionMultiplier(grid.getGlobalIndex(2,0,0), grid.getGlobalIndex(1,0,0), Opm::FaceDir::XMinus ), 0.75);
|
||||
BOOST_CHECK_EQUAL( scanner1.getRegionMultiplier(grid.getGlobalIndex(2,0,0), grid.getGlobalIndex(2,0,1), Opm::FaceDir::ZPlus), 0.75);
|
||||
}
|
||||
@ -300,13 +296,12 @@ BOOST_AUTO_TEST_CASE(MULTREGT_COPY_MULTNUM) {
|
||||
Opm::Deck deck = createCopyMULTNUMDeck();
|
||||
Opm::TableManager tm(deck);
|
||||
Opm::EclipseGrid eg(deck);
|
||||
Opm::Eclipse3DProperties props(deck, tm, eg);
|
||||
Opm::FieldPropsManager fp(deck, eg, tm);
|
||||
|
||||
BOOST_CHECK_NO_THROW(props.hasDeckIntGridProperty("FLUXNUM"));
|
||||
BOOST_CHECK_NO_THROW(props.hasDeckIntGridProperty("MULTNUM"));
|
||||
const auto& fdata = props.getIntGridProperty("FLUXNUM").getData();
|
||||
const auto& mdata = props.getIntGridProperty("MULTNUM").getData();
|
||||
BOOST_CHECK_NO_THROW(fp.has<int>("FLUXNUM"));
|
||||
BOOST_CHECK_NO_THROW(fp.has<int>("MULTNUM"));
|
||||
const auto& fdata = fp.get_global<int>("FLUXNUM");
|
||||
const auto& mdata = fp.get_global<int>("MULTNUM");
|
||||
std::vector<int> data = { 1, 2, 1, 2, 3, 4, 3, 4 };
|
||||
|
||||
for (auto i = 0; i < 2 * 2 * 2; i++) {
|
||||
|
@ -78,10 +78,9 @@ BOOST_AUTO_TEST_CASE(MESSAGES) {
|
||||
auto deck = parser.parseString(input);
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule(deck, grid, fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck, grid, fp, runspec);
|
||||
const MessageLimits limits = schedule.getMessageLimits();
|
||||
|
||||
BOOST_CHECK_EQUAL( limits.getBugPrintLimit( 0 ) , 77 ); // The pre Schedule initialization
|
||||
|
@ -332,17 +332,16 @@ BOOST_AUTO_TEST_CASE( CheckUnsupportedInSCHEDULE ) {
|
||||
auto deckUnSupported = parser.parseString( deckStringUnSupported , parseContext, errors );
|
||||
EclipseGrid grid( deckSupported );
|
||||
TableManager table ( deckSupported );
|
||||
Eclipse3DProperties eclipseProperties ( deckSupported , table, grid);
|
||||
FieldPropsManager fp(deckSupported, grid, table);
|
||||
Runspec runspec(deckSupported);
|
||||
|
||||
parseContext.update( ParseContext::UNSUPPORTED_SCHEDULE_GEO_MODIFIER , InputError::IGNORE );
|
||||
BOOST_CHECK_NO_THROW( Schedule( deckSupported , grid , fp, eclipseProperties, runspec, parseContext, errors ));
|
||||
BOOST_CHECK_NO_THROW( Schedule( deckUnSupported, grid , fp, eclipseProperties, runspec, parseContext, errors ));
|
||||
BOOST_CHECK_NO_THROW( Schedule( deckSupported , grid , fp, runspec, parseContext, errors ));
|
||||
BOOST_CHECK_NO_THROW( Schedule( deckUnSupported, grid , fp, runspec, parseContext, errors ));
|
||||
|
||||
parseContext.update( ParseContext::UNSUPPORTED_SCHEDULE_GEO_MODIFIER , InputError::THROW_EXCEPTION );
|
||||
BOOST_CHECK_THROW( Schedule( deckUnSupported , grid , fp, eclipseProperties, runspec , parseContext , errors), std::invalid_argument );
|
||||
BOOST_CHECK_NO_THROW( Schedule( deckSupported , grid , fp, eclipseProperties, runspec , parseContext, errors));
|
||||
BOOST_CHECK_THROW( Schedule( deckUnSupported , grid , fp, runspec , parseContext , errors), std::invalid_argument );
|
||||
BOOST_CHECK_NO_THROW( Schedule( deckSupported , grid , fp, runspec , parseContext, errors));
|
||||
}
|
||||
|
||||
|
||||
@ -411,15 +410,14 @@ BOOST_AUTO_TEST_CASE(TestCOMPORD) {
|
||||
|
||||
EclipseGrid grid( deck );
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec(deck);
|
||||
|
||||
parseContext.update( ParseContext::UNSUPPORTED_COMPORD_TYPE , InputError::IGNORE);
|
||||
BOOST_CHECK_NO_THROW( Schedule( deck , grid , fp, eclipseProperties, runspec, parseContext, errors ));
|
||||
BOOST_CHECK_NO_THROW( Schedule( deck , grid , fp, runspec, parseContext, errors ));
|
||||
|
||||
parseContext.update( ParseContext::UNSUPPORTED_COMPORD_TYPE , InputError::THROW_EXCEPTION);
|
||||
BOOST_CHECK_THROW( Schedule( deck, grid , fp, eclipseProperties, runspec , parseContext, errors), std::invalid_argument );
|
||||
BOOST_CHECK_THROW( Schedule( deck, grid , fp, runspec , parseContext, errors), std::invalid_argument );
|
||||
}
|
||||
|
||||
|
||||
@ -762,11 +760,10 @@ BOOST_AUTO_TEST_CASE( test_invalid_wtemplate_config ) {
|
||||
|
||||
EclipseGrid grid( deckUnSupported );
|
||||
TableManager table ( deckUnSupported );
|
||||
Eclipse3DProperties eclipseProperties ( deckUnSupported , table, grid);
|
||||
FieldPropsManager fp( deckUnSupported , grid, table);
|
||||
Runspec runspec( deckUnSupported);
|
||||
|
||||
BOOST_CHECK_THROW( Schedule( deckUnSupported , grid , fp, eclipseProperties, runspec , parseContext, errors), std::invalid_argument );
|
||||
BOOST_CHECK_THROW( Schedule( deckUnSupported , grid , fp, runspec , parseContext, errors), std::invalid_argument );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -361,10 +361,9 @@ BOOST_AUTO_TEST_CASE(CreateScheduleDeckMissingReturnsDefaults) {
|
||||
deck.addKeyword( DeckKeyword( parser.getKeyword("SCHEDULE" )));
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule(deck, grid , fp, eclipseProperties, runspec );
|
||||
Schedule schedule(deck, grid , fp, runspec );
|
||||
BOOST_CHECK_EQUAL( schedule.getStartTime() , TimeMap::mkdate(1983, 1 , 1));
|
||||
}
|
||||
|
||||
@ -372,10 +371,9 @@ BOOST_AUTO_TEST_CASE(CreateScheduleDeckWellsOrdered) {
|
||||
auto deck = createDeckWithWellsOrdered();
|
||||
EclipseGrid grid(100,100,100);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck, grid , fp, runspec);
|
||||
auto well_names = schedule.wellNames();
|
||||
|
||||
BOOST_CHECK_EQUAL( "CW_1" , well_names[0]);
|
||||
@ -402,10 +400,9 @@ BOOST_AUTO_TEST_CASE(CreateScheduleDeckWellsOrderedGRUPTREE) {
|
||||
auto deck = createDeckWithWellsOrderedGRUPTREE();
|
||||
EclipseGrid grid(100,100,100);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck, grid , fp, runspec);
|
||||
|
||||
BOOST_CHECK_THROW( schedule.getChildWells2( "NO_SUCH_GROUP" , 1 ), std::invalid_argument);
|
||||
{
|
||||
@ -454,10 +451,9 @@ BOOST_AUTO_TEST_CASE(GroupTree2TEST) {
|
||||
auto deck = createDeckWithWellsOrderedGRUPTREE();
|
||||
EclipseGrid grid(100,100,100);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck, grid , fp, runspec);
|
||||
|
||||
BOOST_CHECK_THROW( schedule.groupTree("NO_SUCH_GROUP", 0), std::invalid_argument);
|
||||
auto cg1 = schedule.getGroup("CG1", 0);
|
||||
@ -485,11 +481,10 @@ BOOST_AUTO_TEST_CASE(CreateScheduleDeckWithStart) {
|
||||
auto deck = createDeck();
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
|
||||
Schedule schedule(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck, grid , fp, runspec);
|
||||
BOOST_CHECK_EQUAL( schedule.getStartTime() , TimeMap::mkdate(1998, 3 , 8 ));
|
||||
}
|
||||
|
||||
@ -498,22 +493,20 @@ BOOST_AUTO_TEST_CASE(CreateScheduleDeckWithSCHEDULENoThrow) {
|
||||
Deck deck;
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
deck.addKeyword( DeckKeyword( parser.getKeyword("SCHEDULE" )));
|
||||
Runspec runspec (deck);
|
||||
|
||||
BOOST_CHECK_NO_THROW( Schedule( deck, grid , fp, eclipseProperties, runspec));
|
||||
BOOST_CHECK_NO_THROW( Schedule( deck, grid , fp, runspec));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(EmptyScheduleHasNoWells) {
|
||||
EclipseGrid grid(10,10,10);
|
||||
auto deck = createDeck();
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);;
|
||||
Schedule schedule(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck, grid , fp, runspec);
|
||||
BOOST_CHECK_EQUAL( 0U , schedule.numWells() );
|
||||
BOOST_CHECK_EQUAL( false , schedule.hasWell("WELL1") );
|
||||
BOOST_CHECK_THROW( schedule.getWell("WELL2", 0) , std::invalid_argument );
|
||||
@ -525,10 +518,9 @@ BOOST_AUTO_TEST_CASE(EmptyScheduleHasFIELDGroup) {
|
||||
EclipseGrid grid(10,10,10);
|
||||
auto deck = createDeck();
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule(deck , grid , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck , grid , fp, runspec);
|
||||
|
||||
BOOST_CHECK_EQUAL( 1U , schedule.numGroups() );
|
||||
BOOST_CHECK_EQUAL( true , schedule.hasGroup("FIELD") );
|
||||
@ -621,10 +613,9 @@ BOOST_AUTO_TEST_CASE(WellsIterator_Empty_EmptyVectorReturned) {
|
||||
EclipseGrid grid(10,10,10);
|
||||
auto deck = createDeck();
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule(deck , grid , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck , grid , fp, runspec);
|
||||
|
||||
const auto wells_alltimesteps = schedule.getWellsatEnd();
|
||||
BOOST_CHECK_EQUAL(0U, wells_alltimesteps.size());
|
||||
@ -640,10 +631,9 @@ BOOST_AUTO_TEST_CASE(WellsIterator_HasWells_WellsReturned) {
|
||||
EclipseGrid grid(10,10,10);
|
||||
auto deck = createDeckWithWells();
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule(deck , grid , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck , grid , fp, runspec);
|
||||
size_t timeStep = 0;
|
||||
|
||||
const auto wells_alltimesteps = schedule.getWellsatEnd();
|
||||
@ -660,10 +650,9 @@ BOOST_AUTO_TEST_CASE(ReturnNumWellsTimestep) {
|
||||
EclipseGrid grid(10,10,10);
|
||||
auto deck = createDeckWithWells();
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck, grid , fp, runspec);
|
||||
|
||||
BOOST_CHECK_EQUAL(schedule.numWells(0), 1);
|
||||
BOOST_CHECK_EQUAL(schedule.numWells(1), 1);
|
||||
@ -675,10 +664,9 @@ BOOST_AUTO_TEST_CASE(TestCrossFlowHandling) {
|
||||
EclipseGrid grid(10,10,10);
|
||||
auto deck = createDeckForTestingCrossFlow();
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck, grid , fp, runspec);
|
||||
|
||||
BOOST_CHECK_EQUAL(schedule.getWell("BAN", 0).getAllowCrossFlow(), false);
|
||||
BOOST_CHECK_EQUAL(schedule.getWell("ALLOW", 0).getAllowCrossFlow(), true);
|
||||
@ -749,10 +737,9 @@ BOOST_AUTO_TEST_CASE(CreateScheduleDeckWellsAndConnectionDataWithWELOPEN) {
|
||||
EclipseGrid grid(10,10,10);
|
||||
auto deck = createDeckWithWellsAndConnectionDataWithWELOPEN();
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule(deck ,grid , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck ,grid , fp, runspec);
|
||||
{
|
||||
constexpr auto well_shut = Well::Status::SHUT;
|
||||
constexpr auto well_open = Well::Status::OPEN;
|
||||
@ -834,10 +821,9 @@ BOOST_AUTO_TEST_CASE(CreateScheduleDeckWithWELOPEN_TryToOpenWellWithShutCompleti
|
||||
EclipseGrid grid(10,10,10);
|
||||
auto deck = parser.parseString(input);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule(deck , grid , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck , grid , fp, runspec);
|
||||
const auto& well2_3 = schedule.getWell("OP_1",3);
|
||||
const auto& well2_4 = schedule.getWell("OP_1",4);
|
||||
BOOST_CHECK(Well::Status::SHUT == well2_3.getStatus());
|
||||
@ -895,10 +881,9 @@ BOOST_AUTO_TEST_CASE(CreateScheduleDeckWithWELOPEN_CombineShutCompletionsAndAddN
|
||||
EclipseGrid grid(10,10,10);
|
||||
auto deck = parser.parseString(input);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck, grid , fp, runspec);
|
||||
const auto& well_3 = schedule.getWell("OP_1", 3);
|
||||
const auto& well_4 = schedule.getWell("OP_1", 4);
|
||||
const auto& well_5 = schedule.getWell("OP_1", 5);
|
||||
@ -954,10 +939,9 @@ BOOST_AUTO_TEST_CASE(CreateScheduleDeckWithWRFT) {
|
||||
EclipseGrid grid(10,10,10);
|
||||
auto deck = parser.parseString(input);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck, grid , fp, runspec);
|
||||
const auto& rft_config = schedule.rftConfig();
|
||||
|
||||
BOOST_CHECK_EQUAL(2 , rft_config.firstRFTOutput());
|
||||
@ -1013,10 +997,9 @@ BOOST_AUTO_TEST_CASE(CreateScheduleDeckWithWRFTPLT) {
|
||||
EclipseGrid grid(10,10,10);
|
||||
auto deck = parser.parseString(input);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck, grid , fp, runspec);
|
||||
const auto& well = schedule.getWell("OP_1", 4);
|
||||
BOOST_CHECK(Well::Status::OPEN == well.getStatus());
|
||||
|
||||
@ -1064,10 +1047,9 @@ BOOST_AUTO_TEST_CASE(createDeckWithWeltArg) {
|
||||
auto deck = parser.parseString(input);
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck, grid , fp, runspec);
|
||||
Opm::UnitSystem unitSystem = deck.getActiveUnitSystem();
|
||||
double siFactorL = unitSystem.parse("LiquidSurfaceVolume/Time").getSIScaling();
|
||||
double siFactorG = unitSystem.parse("GasSurfaceVolume/Time").getSIScaling();
|
||||
@ -1105,11 +1087,10 @@ BOOST_AUTO_TEST_CASE(createDeckWithWeltArgException) {
|
||||
auto deck = parser.parseString(input);
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
|
||||
BOOST_CHECK_THROW(Schedule(deck, grid , fp, eclipseProperties, runspec),
|
||||
BOOST_CHECK_THROW(Schedule(deck, grid , fp, runspec),
|
||||
std::invalid_argument);
|
||||
}
|
||||
|
||||
@ -1125,10 +1106,9 @@ BOOST_AUTO_TEST_CASE(createDeckWithWeltArgException2) {
|
||||
auto deck = parser.parseString(input);
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
BOOST_CHECK_THROW(Schedule(deck, grid , fp, eclipseProperties, runspec), std::invalid_argument);
|
||||
BOOST_CHECK_THROW(Schedule(deck, grid , fp, runspec), std::invalid_argument);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(createDeckWithWPIMULT) {
|
||||
@ -1172,10 +1152,9 @@ BOOST_AUTO_TEST_CASE(createDeckWithWPIMULT) {
|
||||
auto deck = parser.parseString(input);
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck, grid , fp, runspec);
|
||||
|
||||
const auto& cs2 = schedule.getWell("OP_1", 2).getConnections();
|
||||
const auto& cs3 = schedule.getWell("OP_1", 3).getConnections();
|
||||
@ -1244,17 +1223,16 @@ BOOST_AUTO_TEST_CASE(WELSPECS_WGNAME_SPACE) {
|
||||
auto deck = parser.parseString(input);
|
||||
EclipseGrid grid( deck );
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
ParseContext parseContext;
|
||||
ErrorGuard errors;
|
||||
|
||||
parseContext.update(ParseContext::PARSE_WGNAME_SPACE, InputError::THROW_EXCEPTION);
|
||||
BOOST_CHECK_THROW( Opm::Schedule(deck, grid, fp, eclipseProperties, runspec, parseContext, errors), std::invalid_argument);
|
||||
BOOST_CHECK_THROW( Opm::Schedule(deck, grid, fp, runspec, parseContext, errors), std::invalid_argument);
|
||||
|
||||
parseContext.update(ParseContext::PARSE_WGNAME_SPACE, InputError::IGNORE);
|
||||
BOOST_CHECK_NO_THROW( Opm::Schedule(deck, grid, fp, eclipseProperties, runspec, parseContext, errors));
|
||||
BOOST_CHECK_NO_THROW( Opm::Schedule(deck, grid, fp, runspec, parseContext, errors));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(createDeckModifyMultipleGCONPROD) {
|
||||
@ -1297,10 +1275,9 @@ BOOST_AUTO_TEST_CASE(createDeckModifyMultipleGCONPROD) {
|
||||
auto deck = parser.parseString(input);
|
||||
EclipseGrid grid( deck );
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
Opm::Schedule schedule(deck, grid, fp, eclipseProperties, runspec);
|
||||
Opm::Schedule schedule(deck, grid, fp, runspec);
|
||||
Opm::SummaryState st(std::chrono::system_clock::now());
|
||||
|
||||
Opm::UnitSystem unitSystem = deck.getActiveUnitSystem();
|
||||
@ -1347,10 +1324,9 @@ BOOST_AUTO_TEST_CASE(createDeckWithDRSDT) {
|
||||
auto deck = parser.parseString(input);
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck, grid , fp, runspec);
|
||||
size_t currentStep = 1;
|
||||
BOOST_CHECK_EQUAL(schedule.hasOilVaporizationProperties(), true);
|
||||
const auto& ovap = schedule.getOilVaporizationProperties(currentStep);
|
||||
@ -1382,10 +1358,9 @@ BOOST_AUTO_TEST_CASE(createDeckWithDRSDTR) {
|
||||
auto deck = parser.parseString(input);
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp(deck, grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck, grid , fp, runspec);
|
||||
size_t currentStep = 1;
|
||||
BOOST_CHECK_EQUAL(schedule.hasOilVaporizationProperties(), true);
|
||||
const auto& ovap = schedule.getOilVaporizationProperties(currentStep);
|
||||
@ -1430,10 +1405,9 @@ BOOST_AUTO_TEST_CASE(createDeckWithDRSDTthenDRVDT) {
|
||||
auto deck = parser.parseString(input);
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck, grid , fp, runspec);
|
||||
BOOST_CHECK_EQUAL(schedule.hasOilVaporizationProperties(), true);
|
||||
|
||||
const OilVaporizationProperties& ovap1 = schedule.getOilVaporizationProperties(1);
|
||||
@ -1472,10 +1446,9 @@ BOOST_AUTO_TEST_CASE(createDeckWithVAPPARS) {
|
||||
auto deck = parser.parseString(input);
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck, grid , fp, runspec);
|
||||
size_t currentStep = 1;
|
||||
BOOST_CHECK_EQUAL(schedule.hasOilVaporizationProperties(), true);
|
||||
const OilVaporizationProperties& ovap = schedule.getOilVaporizationProperties(currentStep);
|
||||
@ -1504,10 +1477,9 @@ BOOST_AUTO_TEST_CASE(createDeckWithOutOilVaporizationProperties) {
|
||||
auto deck = parser.parseString(input);
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck, grid , fp, runspec);
|
||||
|
||||
BOOST_CHECK_EQUAL(schedule.hasOilVaporizationProperties(), false);
|
||||
|
||||
@ -1566,12 +1538,11 @@ BOOST_AUTO_TEST_CASE(changeBhpLimitInHistoryModeWithWeltarg) {
|
||||
auto deck = parser.parseString(input);
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule sched(deck, grid , fp, eclipseProperties, runspec);
|
||||
SummaryState st(std::chrono::system_clock::now());
|
||||
const auto& unit_system = deck.getActiveUnitSystem();
|
||||
Schedule sched(deck, grid , fp, runspec);
|
||||
|
||||
// The BHP limit should not be effected by WCONHIST
|
||||
{
|
||||
@ -1664,10 +1635,9 @@ BOOST_AUTO_TEST_CASE(changeModeWithWHISTCTL) {
|
||||
auto deck = parser.parseString(input);
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck, grid , fp, runspec);
|
||||
|
||||
//Start
|
||||
BOOST_CHECK_THROW(schedule.getWell("P1", 0), std::invalid_argument);
|
||||
@ -1771,10 +1741,9 @@ BOOST_AUTO_TEST_CASE(fromWCONHISTtoWCONPROD) {
|
||||
auto deck = parser.parseString(input);
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck, grid , fp, runspec);
|
||||
|
||||
//Start
|
||||
BOOST_CHECK_THROW(schedule.getWell("P1", 0), std::invalid_argument);
|
||||
@ -1860,10 +1829,9 @@ BOOST_AUTO_TEST_CASE(WHISTCTL_NEW_WELL) {
|
||||
auto deck = parser.parseString(input);
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck, grid , fp, runspec);
|
||||
|
||||
//10 OKT 2008
|
||||
BOOST_CHECK(schedule.getWell("P1", 1).getProductionProperties().controlMode == Opm::Well::ProducerCMode::GRAT);
|
||||
@ -1937,10 +1905,9 @@ BOOST_AUTO_TEST_CASE(unsupportedOptionWHISTCTL) {
|
||||
auto deck = parser.parseString(input);
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
BOOST_CHECK_THROW(Schedule(deck, grid, fp, eclipseProperties, runspec), std::invalid_argument);
|
||||
BOOST_CHECK_THROW(Schedule(deck, grid, fp, runspec), std::invalid_argument);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(move_HEAD_I_location) {
|
||||
@ -1967,10 +1934,9 @@ BOOST_AUTO_TEST_CASE(move_HEAD_I_location) {
|
||||
auto deck = Parser().parseString(input);
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule( deck, grid, fp, eclipseProperties,runspec);
|
||||
Schedule schedule( deck, grid, fp, runspec);
|
||||
BOOST_CHECK_EQUAL(2, schedule.getWell("W1", 1).getHeadI());
|
||||
BOOST_CHECK_EQUAL(3, schedule.getWell("W1", 2).getHeadI());
|
||||
}
|
||||
@ -1999,10 +1965,9 @@ BOOST_AUTO_TEST_CASE(change_ref_depth) {
|
||||
auto deck = Parser().parseString(input);
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule( deck, grid, fp, eclipseProperties,runspec);
|
||||
Schedule schedule( deck, grid, fp, runspec);
|
||||
BOOST_CHECK_CLOSE(2873.94, schedule.getWell("W1", 1).getRefDepth(), 1e-5);
|
||||
BOOST_CHECK_EQUAL(12.0, schedule.getWell("W1", 2).getRefDepth());
|
||||
}
|
||||
@ -2039,10 +2004,9 @@ BOOST_AUTO_TEST_CASE(WTEMP_well_template) {
|
||||
auto deck = Parser().parseString(input);
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule( deck, grid, fp, eclipseProperties,runspec);
|
||||
Schedule schedule( deck, grid, fp, runspec);
|
||||
|
||||
BOOST_CHECK_CLOSE(288.71, schedule.getWell("W1", 1).getInjectionProperties().temperature, 1e-5);
|
||||
BOOST_CHECK_CLOSE(288.71, schedule.getWell("W1", 2).getInjectionProperties().temperature, 1e-5);
|
||||
@ -2086,10 +2050,9 @@ BOOST_AUTO_TEST_CASE(WTEMPINJ_well_template) {
|
||||
auto deck = Parser().parseString(input);
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule( deck, grid, fp, eclipseProperties,runspec);
|
||||
Schedule schedule( deck, grid, fp, runspec);
|
||||
|
||||
// Producerwell - currently setting temperature only acts on injectors.
|
||||
BOOST_CHECK_CLOSE(288.71, schedule.getWell("W1", 1).getInjectionProperties().temperature, 1e-5);
|
||||
@ -2139,10 +2102,9 @@ BOOST_AUTO_TEST_CASE( COMPDAT_sets_automatic_complnum ) {
|
||||
auto deck = Parser().parseString(input);
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule( deck, grid, fp, eclipseProperties,runspec);
|
||||
Schedule schedule( deck, grid, fp, runspec);
|
||||
const auto& cs1 = schedule.getWell( "W1", 1 ).getConnections( );
|
||||
BOOST_CHECK_EQUAL( 1, cs1.get( 0 ).complnum() );
|
||||
BOOST_CHECK_EQUAL( 2, cs1.get( 1 ).complnum() );
|
||||
@ -2190,10 +2152,9 @@ BOOST_AUTO_TEST_CASE( COMPDAT_multiple_wells ) {
|
||||
auto deck = Parser().parseString( input);
|
||||
EclipseGrid grid( 10, 10, 10 );
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule( deck, grid, fp, eclipseProperties,runspec);
|
||||
Schedule schedule( deck, grid, fp, runspec);
|
||||
|
||||
{
|
||||
const auto& w1cs = schedule.getWell( "W1", 1 ).getConnections();
|
||||
@ -2260,10 +2221,9 @@ BOOST_AUTO_TEST_CASE( COMPDAT_multiple_records_same_completion ) {
|
||||
auto deck = Parser().parseString(input);
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule( deck, grid, fp, eclipseProperties,runspec);
|
||||
Schedule schedule( deck, grid, fp, runspec);
|
||||
const auto& cs = schedule.getWell( "W1", 1 ).getConnections();
|
||||
BOOST_CHECK_EQUAL( 3U, cs.size() );
|
||||
BOOST_CHECK_EQUAL( 1, cs.get( 0 ).complnum() );
|
||||
@ -2301,10 +2261,9 @@ BOOST_AUTO_TEST_CASE( complump_less_than_1 ) {
|
||||
auto deck = Parser().parseString( input);
|
||||
EclipseGrid grid( 10, 10, 10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
BOOST_CHECK_THROW( Schedule( deck , grid, fp, eclipseProperties, runspec), std::invalid_argument );
|
||||
BOOST_CHECK_THROW( Schedule( deck , grid, fp, runspec), std::invalid_argument );
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( complump ) {
|
||||
@ -2354,10 +2313,9 @@ BOOST_AUTO_TEST_CASE( complump ) {
|
||||
auto deck = Parser().parseString(input);
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule( deck, grid, fp, eclipseProperties,runspec);
|
||||
Schedule schedule( deck, grid, fp, runspec);
|
||||
|
||||
const auto& sc0 = schedule.getWell("W1", 0).getConnections();
|
||||
/* complnum should be modified by COMPLNUM */
|
||||
@ -2445,10 +2403,9 @@ BOOST_AUTO_TEST_CASE( COMPLUMP_specific_coordinates ) {
|
||||
auto deck = Parser().parseString( input);
|
||||
EclipseGrid grid( 10, 10, 10 );
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule( deck, grid, fp, eclipseProperties,runspec);
|
||||
Schedule schedule( deck, grid, fp, runspec);
|
||||
|
||||
const auto& cs1 = schedule.getWell("W1", 1).getConnections();
|
||||
const auto& cs2 = schedule.getWell("W1", 2).getConnections();
|
||||
@ -2916,10 +2873,9 @@ BOOST_AUTO_TEST_CASE(handleWEFAC) {
|
||||
auto deck = parser.parseString(input);
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck, grid , fp, runspec);
|
||||
|
||||
//1
|
||||
BOOST_CHECK_EQUAL(schedule.getWell("P", 1).getEfficiencyFactor(), 0.5);
|
||||
@ -2962,10 +2918,9 @@ BOOST_AUTO_TEST_CASE(historic_BHP_and_THP) {
|
||||
auto deck = parser.parseString(input);
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule( deck, grid, fp, eclipseProperties,runspec);
|
||||
Schedule schedule( deck, grid, fp, runspec);
|
||||
|
||||
{
|
||||
const auto& prod = schedule.getWell("P", 1).getProductionProperties();
|
||||
@ -2996,10 +2951,9 @@ BOOST_AUTO_TEST_CASE(FilterCompletions2) {
|
||||
std::vector<int> actnum(1000,1);
|
||||
auto deck = createDeckWithWellsAndCompletionData();
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid1);
|
||||
FieldPropsManager fp( deck , grid1, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule(deck, grid1 , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck, grid1 , fp, runspec);
|
||||
{
|
||||
const auto& c1_1 = schedule.getWell("OP_1", 1).getConnections();
|
||||
const auto& c1_3 = schedule.getWell("OP_1", 3).getConnections();
|
||||
@ -3090,10 +3044,9 @@ VFPINJ \n \
|
||||
auto deck = parser.parseString(deckData);
|
||||
EclipseGrid grid1(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid1);
|
||||
FieldPropsManager fp( deck , grid1, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule(deck, grid1 , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck, grid1 , fp, runspec);
|
||||
|
||||
BOOST_CHECK( schedule.getEvents().hasEvent(ScheduleEvents::VFPINJ_UPDATE, 0));
|
||||
BOOST_CHECK( !schedule.getEvents().hasEvent(ScheduleEvents::VFPINJ_UPDATE, 1));
|
||||
@ -3218,10 +3171,9 @@ BOOST_AUTO_TEST_CASE(POLYINJ_TEST) {
|
||||
auto deck = parser.parseString(deckData);
|
||||
EclipseGrid grid1(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid1);
|
||||
FieldPropsManager fp( deck , grid1, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule(deck, grid1 , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck, grid1 , fp, runspec);
|
||||
|
||||
const auto& poly0 = schedule.getWell("INJE01", 0).getPolymerProperties();
|
||||
const auto& poly1 = schedule.getWell("INJE01", 1).getPolymerProperties();
|
||||
@ -3279,10 +3231,9 @@ BOOST_AUTO_TEST_CASE(WFOAM_TEST) {
|
||||
auto deck = parser.parseString(deckData);
|
||||
EclipseGrid grid1(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid1);
|
||||
FieldPropsManager fp( deck , grid1, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule(deck, grid1 , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck, grid1 , fp, runspec);
|
||||
|
||||
const auto& f0 = schedule.getWell("INJE01", 0).getFoamProperties();
|
||||
const auto& f1 = schedule.getWell("INJE01", 1).getFoamProperties();
|
||||
@ -3298,10 +3249,9 @@ BOOST_AUTO_TEST_CASE(WTEST_CONFIG) {
|
||||
auto deck = createDeckWTEST();
|
||||
EclipseGrid grid1(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid1);
|
||||
FieldPropsManager fp( deck , grid1, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule(deck, grid1 , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck, grid1 , fp, runspec);
|
||||
|
||||
const auto& wtest_config1 = schedule.wtestConfig(0);
|
||||
BOOST_CHECK_EQUAL(wtest_config1.size(), 2);
|
||||
@ -3328,10 +3278,9 @@ BOOST_AUTO_TEST_CASE(WELL_STATIC) {
|
||||
auto deck = createDeckWithWells();
|
||||
EclipseGrid grid1(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid1);
|
||||
FieldPropsManager fp( deck , grid1, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule(deck, grid1 , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck, grid1 , fp, runspec);
|
||||
BOOST_CHECK_THROW( schedule.getWell("NO_SUCH_WELL", 0), std::invalid_argument);
|
||||
BOOST_CHECK_THROW( schedule.getWell("W_3", 0), std::invalid_argument);
|
||||
|
||||
@ -3377,10 +3326,9 @@ BOOST_AUTO_TEST_CASE(WellNames) {
|
||||
auto deck = createDeckWTEST();
|
||||
EclipseGrid grid1(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid1);
|
||||
FieldPropsManager fp( deck , grid1, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule(deck, grid1 , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck, grid1 , fp, runspec);
|
||||
|
||||
auto names = schedule.wellNames("NO_SUCH_WELL", 0);
|
||||
BOOST_CHECK_EQUAL(names.size(), 0);
|
||||
@ -3492,10 +3440,9 @@ BOOST_AUTO_TEST_CASE(RFT_CONFIG2) {
|
||||
auto deck = createDeckRFTConfig();
|
||||
EclipseGrid grid1(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid1);
|
||||
FieldPropsManager fp( deck , grid1, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule(deck, grid1 , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck, grid1 , fp, runspec);
|
||||
const auto& rft_config = schedule.rftConfig();
|
||||
BOOST_CHECK_EQUAL(1, rft_config.firstRFTOutput());
|
||||
}
|
||||
@ -3526,10 +3473,9 @@ BOOST_AUTO_TEST_CASE(nupcol) {
|
||||
auto deck = parser.parseString(input);
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule( deck, grid, fp, eclipseProperties,runspec);
|
||||
Schedule schedule( deck, grid, fp, runspec);
|
||||
|
||||
{
|
||||
// Flow uses 12 as default
|
||||
@ -3619,10 +3565,9 @@ DATES -- 4
|
||||
auto deck = parser.parseString(input);
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule( deck, grid, fp, eclipseProperties,runspec);
|
||||
Schedule schedule( deck, grid, fp, runspec);
|
||||
|
||||
{
|
||||
const auto& grc = schedule.guideRateConfig(0);
|
||||
|
@ -139,9 +139,8 @@ BOOST_AUTO_TEST_CASE(SimulationConfigGetThresholdPressureTableTest) {
|
||||
auto deck = createDeck(inputStr);
|
||||
TableManager tm(deck);
|
||||
EclipseGrid eg(10, 3, 4);
|
||||
Eclipse3DProperties ep(deck, tm, eg);
|
||||
FieldPropsManager fp(deck, eg, tm);
|
||||
BOOST_CHECK_NO_THROW( SimulationConfig(false, deck, fp, ep ) );
|
||||
BOOST_CHECK_NO_THROW( SimulationConfig(false, deck, fp) );
|
||||
}
|
||||
|
||||
|
||||
@ -149,9 +148,8 @@ BOOST_AUTO_TEST_CASE(SimulationConfigNOTHPRES) {
|
||||
auto deck = createDeck(inputStr_noTHPRES);
|
||||
TableManager tm(deck);
|
||||
EclipseGrid eg(10, 3, 4);
|
||||
Eclipse3DProperties ep(deck, tm, eg);
|
||||
FieldPropsManager fp(deck, eg, tm);
|
||||
SimulationConfig simulationConfig(false, deck, fp, ep);
|
||||
SimulationConfig simulationConfig(false, deck, fp);
|
||||
BOOST_CHECK( !simulationConfig.useThresholdPressure() );
|
||||
}
|
||||
|
||||
@ -159,9 +157,8 @@ BOOST_AUTO_TEST_CASE(SimulationConfigCPRNotUsed) {
|
||||
auto deck = createDeck(inputStr_noTHPRES);
|
||||
TableManager tm(deck);
|
||||
EclipseGrid eg(10, 3, 4);
|
||||
Eclipse3DProperties ep(deck, tm, eg);
|
||||
FieldPropsManager fp(deck, eg, tm);
|
||||
SimulationConfig simulationConfig(false, deck, fp, ep);
|
||||
SimulationConfig simulationConfig(false, deck, fp);
|
||||
BOOST_CHECK( ! simulationConfig.useCPR());
|
||||
}
|
||||
|
||||
@ -169,10 +166,9 @@ BOOST_AUTO_TEST_CASE(SimulationConfigCPRUsed) {
|
||||
auto deck = createDeck(inputStr_cpr);
|
||||
TableManager tm(deck);
|
||||
EclipseGrid eg(10, 3, 4);
|
||||
Eclipse3DProperties ep(deck, tm, eg);
|
||||
SUMMARYSection summary(deck);
|
||||
FieldPropsManager fp(deck, eg, tm);
|
||||
SimulationConfig simulationConfig(false, deck, fp, ep);
|
||||
SimulationConfig simulationConfig(false, deck, fp);
|
||||
BOOST_CHECK( simulationConfig.useCPR() );
|
||||
BOOST_CHECK( ! summary.hasKeyword("CPR") );
|
||||
}
|
||||
@ -182,10 +178,9 @@ BOOST_AUTO_TEST_CASE(SimulationConfigCPRInSUMMARYSection) {
|
||||
auto deck = createDeck(inputStr_cpr_in_SUMMARY);
|
||||
TableManager tm(deck);
|
||||
EclipseGrid eg(10, 3, 4);
|
||||
Eclipse3DProperties ep(deck, tm, eg);
|
||||
SUMMARYSection summary(deck);
|
||||
FieldPropsManager fp(deck, eg, tm);
|
||||
SimulationConfig simulationConfig(false, deck, fp, ep);
|
||||
SimulationConfig simulationConfig(false, deck, fp);
|
||||
BOOST_CHECK( ! simulationConfig.useCPR());
|
||||
BOOST_CHECK( summary.hasKeyword("CPR"));
|
||||
}
|
||||
@ -195,10 +190,9 @@ BOOST_AUTO_TEST_CASE(SimulationConfigCPRBoth) {
|
||||
auto deck = createDeck(inputStr_cpr_BOTH);
|
||||
TableManager tm(deck);
|
||||
EclipseGrid eg(10, 3, 4);
|
||||
Eclipse3DProperties ep(deck, tm, eg);
|
||||
SUMMARYSection summary(deck);
|
||||
FieldPropsManager fp(deck, eg, tm);
|
||||
SimulationConfig simulationConfig(false, deck, fp, ep);
|
||||
SimulationConfig simulationConfig(false, deck, fp);
|
||||
BOOST_CHECK( simulationConfig.useCPR());
|
||||
BOOST_CHECK( summary.hasKeyword("CPR"));
|
||||
|
||||
@ -221,18 +215,16 @@ BOOST_AUTO_TEST_CASE(SimulationConfig_VAPOIL_DISGAS) {
|
||||
auto deck = createDeck(inputStr);
|
||||
TableManager tm(deck);
|
||||
EclipseGrid eg(10, 3, 4);
|
||||
Eclipse3DProperties ep(deck, tm, eg);
|
||||
FieldPropsManager fp(deck, eg, tm);
|
||||
SimulationConfig simulationConfig(false, deck, fp, ep);
|
||||
SimulationConfig simulationConfig(false, deck, fp);
|
||||
BOOST_CHECK_EQUAL( false , simulationConfig.hasDISGAS());
|
||||
BOOST_CHECK_EQUAL( false , simulationConfig.hasVAPOIL());
|
||||
|
||||
auto deck_vd = createDeck(inputStr_vap_dis);
|
||||
TableManager tm_vd(deck_vd);
|
||||
EclipseGrid eg_vd(10, 3, 4);
|
||||
Eclipse3DProperties ep_vd(deck_vd, tm, eg);
|
||||
FieldPropsManager fp_vd(deck_vd, eg, tm);
|
||||
SimulationConfig simulationConfig_vd(false, deck_vd, fp_vd, ep_vd);
|
||||
SimulationConfig simulationConfig_vd(false, deck_vd, fp_vd);
|
||||
BOOST_CHECK_EQUAL( true , simulationConfig_vd.hasDISGAS());
|
||||
BOOST_CHECK_EQUAL( true , simulationConfig_vd.hasVAPOIL());
|
||||
}
|
||||
@ -244,9 +236,8 @@ BOOST_AUTO_TEST_CASE(SimulationConfig_TEMP_THERMAL)
|
||||
const auto deck = createDeck(inputStr);
|
||||
const auto tm = TableManager(deck);
|
||||
const auto eg = EclipseGrid(10, 3, 4);
|
||||
const auto ep = Eclipse3DProperties(deck, tm, eg);
|
||||
const auto fp = FieldPropsManager(deck, eg, tm);
|
||||
const auto simulationConfig = Opm::SimulationConfig(false, deck, fp, ep);
|
||||
const auto simulationConfig = Opm::SimulationConfig(false, deck, fp);
|
||||
|
||||
BOOST_CHECK(! simulationConfig.isThermal());
|
||||
}
|
||||
@ -255,9 +246,8 @@ BOOST_AUTO_TEST_CASE(SimulationConfig_TEMP_THERMAL)
|
||||
const auto deck = createDeck(simDeckStringTEMP());
|
||||
const auto tm = TableManager(deck);
|
||||
const auto eg = EclipseGrid(10, 3, 4);
|
||||
const auto ep = Eclipse3DProperties(deck, tm, eg);
|
||||
const auto fp = FieldPropsManager(deck, eg, tm);
|
||||
const auto simulationConfig = Opm::SimulationConfig(false, deck, fp, ep);
|
||||
const auto simulationConfig = Opm::SimulationConfig(false, deck, fp);
|
||||
|
||||
BOOST_CHECK(simulationConfig.isThermal());
|
||||
}
|
||||
@ -266,9 +256,8 @@ BOOST_AUTO_TEST_CASE(SimulationConfig_TEMP_THERMAL)
|
||||
const auto deck = createDeck(simDeckStringTHERMAL());
|
||||
const auto tm = TableManager(deck);
|
||||
const auto eg = EclipseGrid(10, 3, 4);
|
||||
const auto ep = Eclipse3DProperties(deck, tm, eg);
|
||||
const auto fp = FieldPropsManager(deck, eg, tm);
|
||||
const auto simulationConfig = Opm::SimulationConfig(false, deck, fp, ep);
|
||||
const auto simulationConfig = Opm::SimulationConfig(false, deck, fp);
|
||||
|
||||
BOOST_CHECK(simulationConfig.isThermal());
|
||||
}
|
||||
|
@ -148,7 +148,7 @@ static SummaryConfig createSummary( std::string input , const ParseContext& pars
|
||||
ErrorGuard errors;
|
||||
auto deck = createDeck( input );
|
||||
EclipseState state( deck, parseContext, errors );
|
||||
Schedule schedule(deck, state.getInputGrid(), state.fieldProps(), state.get3DProperties(), state.runspec(), parseContext, errors);
|
||||
Schedule schedule(deck, state, parseContext, errors);
|
||||
return SummaryConfig( deck, schedule, state.getTableManager( ), parseContext, errors );
|
||||
}
|
||||
|
||||
|
@ -210,7 +210,6 @@ struct Setup
|
||||
Deck deck;
|
||||
TableManager tablemanager;
|
||||
EclipseGrid grid;
|
||||
Eclipse3DProperties props;
|
||||
FieldPropsManager fp;
|
||||
InitConfig initConfig;
|
||||
ThresholdPressure threshPres;
|
||||
@ -219,10 +218,9 @@ struct Setup
|
||||
deck(createDeck(ParseContext(), input)),
|
||||
tablemanager(deck),
|
||||
grid(10, 3, 4),
|
||||
props(deck, tablemanager, grid),
|
||||
fp(deck, grid, tablemanager),
|
||||
initConfig(deck),
|
||||
threshPres(initConfig.restartRequested(), deck, fp, props)
|
||||
threshPres(initConfig.restartRequested(), deck, fp)
|
||||
{
|
||||
}
|
||||
|
||||
@ -230,10 +228,9 @@ struct Setup
|
||||
deck(createDeck(parseContextArg, input)),
|
||||
tablemanager(deck),
|
||||
grid(10, 3, 4),
|
||||
props(deck, tablemanager, grid),
|
||||
fp(deck, grid, tablemanager),
|
||||
initConfig(deck),
|
||||
threshPres(initConfig.restartRequested(), deck, fp, props)
|
||||
threshPres(initConfig.restartRequested(), deck, fp)
|
||||
{
|
||||
}
|
||||
|
||||
@ -242,7 +239,7 @@ struct Setup
|
||||
BOOST_AUTO_TEST_CASE(ThresholdPressureDeckHasEqlnum) {
|
||||
Setup s(inputStrWithEqlNum);
|
||||
|
||||
BOOST_CHECK(s.props.hasDeckIntGridProperty("EQLNUM"));
|
||||
BOOST_CHECK(s.fp.has<int>("EQLNUM"));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(ThresholdPressureTest) {
|
||||
|
@ -39,7 +39,7 @@ BOOST_AUTO_TEST_CASE(Empty) {
|
||||
Opm::Eclipse3DProperties props;
|
||||
Opm::EclipseGrid grid(10,10,10);
|
||||
Opm::FieldPropsManager fp(Opm::Deck(), grid, Opm::TableManager());
|
||||
Opm::TransMult transMult(grid ,{} , fp, props);
|
||||
Opm::TransMult transMult(grid ,{} , fp);
|
||||
|
||||
BOOST_CHECK_THROW( transMult.getMultiplier(12,10,10 , Opm::FaceDir::XPlus) , std::invalid_argument );
|
||||
BOOST_CHECK_THROW( transMult.getMultiplier(1000 , Opm::FaceDir::XPlus) , std::invalid_argument );
|
||||
@ -72,10 +72,9 @@ MULTZ
|
||||
Opm::Deck deck = parser.parseString(deck_string);
|
||||
Opm::TableManager tables(deck);
|
||||
Opm::EclipseGrid grid(5,5,5);
|
||||
Opm::Eclipse3DProperties props(deck, tables, grid);
|
||||
Opm::FieldPropsManager fp(deck, grid, tables);
|
||||
Opm::TransMult transMult(grid, deck, fp, props);
|
||||
Opm::TransMult transMult(grid, deck, fp);
|
||||
|
||||
transMult.applyMULT(props.getDoubleGridProperty("MULTZ").getData(), Opm::FaceDir::ZPlus);
|
||||
transMult.applyMULT(fp.get_global<double>("MULTZ"), Opm::FaceDir::ZPlus);
|
||||
BOOST_CHECK_EQUAL( transMult.getMultiplier(0,0,0 , Opm::FaceDir::ZPlus) , 4.0 );
|
||||
}
|
||||
|
@ -71,10 +71,9 @@ BOOST_AUTO_TEST_CASE(TuningTest) {
|
||||
auto deck = createDeck(deckStr);
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp(deck, grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule( deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule schedule( deck, grid , fp, runspec);
|
||||
auto tuning = schedule.getTuning();
|
||||
auto event = schedule.getEvents();
|
||||
|
||||
@ -331,10 +330,9 @@ BOOST_AUTO_TEST_CASE(TuningInitTest) {
|
||||
auto deck = createDeck(deckStr);
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp(deck, grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule(deck , grid , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck , grid , fp, runspec);
|
||||
auto tuning = schedule.getTuning();
|
||||
|
||||
|
||||
@ -363,10 +361,9 @@ BOOST_AUTO_TEST_CASE(TuningResetTest) {
|
||||
auto deck = createDeck(deckStr);
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp(deck, grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck, grid , fp, runspec);
|
||||
auto tuning = schedule.getTuning();
|
||||
|
||||
|
||||
|
@ -144,10 +144,9 @@ Schedule make_schedule(const std::string& input) {
|
||||
} else {
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
return Schedule(deck, grid , fp, eclipseProperties, runspec);
|
||||
return Schedule(deck, grid , fp, runspec);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -143,10 +143,9 @@ static Opm::Schedule createSchedule(const std::string& schedule) {
|
||||
auto deck = parser.parseString(input);
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
return Schedule(deck, grid , fp, eclipseProperties, runspec );
|
||||
return Schedule(deck, grid , fp, runspec );
|
||||
}
|
||||
|
||||
|
||||
@ -168,7 +167,7 @@ BOOST_AUTO_TEST_CASE(WlistInvalid) {
|
||||
std::string wlist_invalid_well = WELSPECS() +
|
||||
"WLIST\n"
|
||||
" \'*LIST1\' \'NEW\' WELLX /\n"
|
||||
"/\n"
|
||||
"/\n"
|
||||
"DATES\n"
|
||||
"10 JLY 2007 /\n"
|
||||
"10 AUG 2007 /\n"
|
||||
|
@ -176,10 +176,9 @@ BOOST_AUTO_TEST_CASE(TestNoSolvent) {
|
||||
auto deck = createDeckWithOutSolvent();
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp(deck, grid, table);
|
||||
Runspec runspec(deck);
|
||||
Schedule schedule(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck, grid , fp, runspec);
|
||||
BOOST_CHECK(!deck.hasKeyword("WSOLVENT"));
|
||||
}
|
||||
|
||||
@ -187,10 +186,9 @@ BOOST_AUTO_TEST_CASE(TestGasInjector) {
|
||||
auto deck = createDeckWithGasInjector();
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp(deck, grid, table);
|
||||
Runspec runspec(deck);
|
||||
Schedule schedule(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck, grid , fp, runspec);
|
||||
BOOST_CHECK(deck.hasKeyword("WSOLVENT"));
|
||||
|
||||
}
|
||||
@ -199,10 +197,9 @@ BOOST_AUTO_TEST_CASE(TestDynamicWSOLVENT) {
|
||||
auto deck = createDeckWithDynamicWSOLVENT();
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp(deck, grid, table);
|
||||
Runspec runspec(deck);
|
||||
Schedule schedule(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck, grid , fp, runspec);
|
||||
BOOST_CHECK(deck.hasKeyword("WSOLVENT"));
|
||||
const auto& keyword = deck.getKeyword("WSOLVENT");
|
||||
BOOST_CHECK_EQUAL(keyword.size(),1);
|
||||
@ -219,18 +216,16 @@ BOOST_AUTO_TEST_CASE(TestOilInjector) {
|
||||
auto deck = createDeckWithOilInjector();
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp(deck, grid, table);
|
||||
Runspec runspec(deck);
|
||||
BOOST_CHECK_THROW (Schedule(deck , grid , fp, eclipseProperties, runspec), std::invalid_argument);
|
||||
BOOST_CHECK_THROW (Schedule(deck , grid , fp, runspec), std::invalid_argument);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(TestWaterInjector) {
|
||||
auto deck = createDeckWithWaterInjector();
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp(deck, grid, table);
|
||||
Runspec runspec(deck);
|
||||
BOOST_CHECK_THROW (Schedule(deck, grid , fp, eclipseProperties, runspec), std::invalid_argument);
|
||||
BOOST_CHECK_THROW (Schedule(deck, grid , fp, runspec), std::invalid_argument);
|
||||
}
|
||||
|
@ -86,10 +86,9 @@ BOOST_AUTO_TEST_CASE(WellCOMPDATtestTRACK) {
|
||||
auto deck = parser.parseString(input);
|
||||
Opm::EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Opm::Runspec runspec (deck);
|
||||
Opm::Schedule schedule(deck, grid , fp, eclipseProperties, runspec);
|
||||
Opm::Schedule schedule(deck, grid , fp, runspec);
|
||||
const auto& op_1 = schedule.getWell("OP_1", 2);
|
||||
|
||||
const auto& completions = op_1.getConnections();
|
||||
@ -127,10 +126,9 @@ BOOST_AUTO_TEST_CASE(WellCOMPDATtestDefaultTRACK) {
|
||||
auto deck = parser.parseString(input);
|
||||
Opm::EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Opm::Runspec runspec (deck);
|
||||
Opm::Schedule schedule(deck, grid , fp, eclipseProperties, runspec);
|
||||
Opm::Schedule schedule(deck, grid , fp, runspec);
|
||||
const auto& op_1 = schedule.getWell("OP_1", 2);
|
||||
|
||||
const auto& completions = op_1.getConnections();
|
||||
@ -171,10 +169,9 @@ BOOST_AUTO_TEST_CASE(WellCOMPDATtestINPUT) {
|
||||
Opm::EclipseGrid grid(10,10,10);
|
||||
Opm::ErrorGuard errors;
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Opm::Runspec runspec (deck);
|
||||
Opm::Schedule schedule(deck, grid , fp, eclipseProperties, runspec, Opm::ParseContext(), errors);
|
||||
Opm::Schedule schedule(deck, grid , fp, runspec, Opm::ParseContext(), errors);
|
||||
const auto& op_1 = schedule.getWell("OP_1", 2);
|
||||
|
||||
const auto& completions = op_1.getConnections();
|
||||
@ -847,10 +844,9 @@ BOOST_AUTO_TEST_CASE(WELOPEN) {
|
||||
auto deck = parser.parseString(input);
|
||||
Opm::EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp(deck, grid, table);
|
||||
Opm::Runspec runspec (deck);
|
||||
Opm::Schedule schedule(deck, grid , fp, eclipseProperties, runspec);
|
||||
Opm::Schedule schedule(deck, grid , fp, runspec);
|
||||
{
|
||||
const auto& op_1 = schedule.getWell("OP_1", 1);
|
||||
BOOST_CHECK(op_1.getStatus() == Well::Status::OPEN);
|
||||
|
@ -133,10 +133,9 @@ BOOST_AUTO_TEST_CASE(TestNoTracer) {
|
||||
auto deck = createDeckWithOutTracer();
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp(deck, grid, table);
|
||||
Runspec runspec ( deck );
|
||||
Schedule schedule(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck, grid , fp, runspec);
|
||||
BOOST_CHECK(!deck.hasKeyword("WTRACER"));
|
||||
}
|
||||
|
||||
@ -145,10 +144,9 @@ BOOST_AUTO_TEST_CASE(TestDynamicWTRACER) {
|
||||
auto deck = createDeckWithDynamicWTRACER();
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec ( deck );
|
||||
Schedule schedule(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck, grid , fp, runspec);
|
||||
BOOST_CHECK(deck.hasKeyword("WTRACER"));
|
||||
const auto& keyword = deck.getKeyword("WTRACER");
|
||||
BOOST_CHECK_EQUAL(keyword.size(),1);
|
||||
@ -168,10 +166,9 @@ BOOST_AUTO_TEST_CASE(TestTracerInProducerTHROW) {
|
||||
auto deck = createDeckWithTracerInProducer();
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec ( deck );
|
||||
|
||||
BOOST_CHECK_THROW(Schedule(deck, grid, fp, eclipseProperties, runspec), std::invalid_argument);
|
||||
BOOST_CHECK_THROW(Schedule(deck, grid, fp, runspec), std::invalid_argument);
|
||||
}
|
||||
|
||||
|
@ -51,9 +51,9 @@ inline EclipseState makeState(const std::string& fileName) {
|
||||
|
||||
BOOST_AUTO_TEST_CASE( PERMX ) {
|
||||
EclipseState state = makeState( prefix() + "BOX/BOXTEST1" );
|
||||
const auto& permx = state.get3DProperties().getDoubleGridProperty( "PERMX" ).getData();
|
||||
const auto& permy = state.get3DProperties().getDoubleGridProperty( "PERMY" ).getData();
|
||||
const auto& permz = state.get3DProperties().getDoubleGridProperty( "PERMZ" ).getData();
|
||||
const auto& permx = state.fieldProps().get_global<double>( "PERMX" );
|
||||
const auto& permy = state.fieldProps().get_global<double>( "PERMY" );
|
||||
const auto& permz = state.fieldProps().get_global<double>( "PERMZ" );
|
||||
size_t i, j, k;
|
||||
const EclipseGrid& grid = state.getInputGrid();
|
||||
|
||||
@ -74,7 +74,7 @@ BOOST_AUTO_TEST_CASE( PERMX ) {
|
||||
|
||||
BOOST_AUTO_TEST_CASE( PARSE_BOX_OK ) {
|
||||
EclipseState state = makeState( prefix() + "BOX/BOXTEST1" );
|
||||
const auto& satnum = state.get3DProperties().getIntGridProperty( "SATNUM" ).getData();
|
||||
const auto& satnum = state.fieldProps().get_global<int>( "SATNUM" );
|
||||
{
|
||||
size_t i, j, k;
|
||||
const EclipseGrid& grid = state.getInputGrid();
|
||||
@ -96,8 +96,8 @@ BOOST_AUTO_TEST_CASE( PARSE_BOX_OK ) {
|
||||
|
||||
BOOST_AUTO_TEST_CASE( PARSE_MULTIPLY_COPY ) {
|
||||
EclipseState state = makeState( prefix() + "BOX/BOXTEST1" );
|
||||
const auto& satnum = state.get3DProperties().getIntGridProperty( "SATNUM" ).getData();
|
||||
const auto& fipnum = state.get3DProperties().getIntGridProperty( "FIPNUM" ).getData();
|
||||
const auto& satnum = state.fieldProps().get_global<int>( "SATNUM" );
|
||||
const auto& fipnum = state.fieldProps().get_global<int>( "FIPNUM" );
|
||||
size_t i, j, k;
|
||||
const EclipseGrid& grid = state.getInputGrid();
|
||||
|
||||
@ -121,9 +121,9 @@ BOOST_AUTO_TEST_CASE( PARSE_MULTIPLY_COPY ) {
|
||||
|
||||
BOOST_AUTO_TEST_CASE( EQUALS ) {
|
||||
EclipseState state = makeState( prefix() + "BOX/BOXTEST1" );
|
||||
const auto& pvtnum = state.get3DProperties().getIntGridProperty( "PVTNUM" ).getData();
|
||||
const auto& eqlnum = state.get3DProperties().getIntGridProperty( "EQLNUM" ).getData();
|
||||
const auto& poro = state.get3DProperties().getDoubleGridProperty( "PORO" ).getData();
|
||||
const auto& pvtnum = state.fieldProps().get_global<int>( "PVTNUM" );
|
||||
const auto& eqlnum = state.fieldProps().get_global<int>( "EQLNUM" );
|
||||
const auto& poro = state.fieldProps().get_global<double>( "PORO" );
|
||||
size_t i, j, k;
|
||||
const EclipseGrid& grid = state.getInputGrid();
|
||||
|
||||
@ -144,11 +144,7 @@ BOOST_AUTO_TEST_CASE( EQUALS ) {
|
||||
BOOST_AUTO_TEST_CASE( OPERATE ) {
|
||||
EclipseState state = makeState( prefix() + "BOX/BOXTEST1" );
|
||||
const EclipseGrid& grid = state.getInputGrid();
|
||||
#ifdef ENABLE_3DPROPS_TESTING
|
||||
const auto& ntg = state.fieldProps().get_global<double>("NTG");
|
||||
#else
|
||||
const auto& ntg = state.get3DProperties().getDoubleGridProperty("NTG").getData();
|
||||
#endif
|
||||
BOOST_CHECK_EQUAL( ntg[grid.getGlobalIndex(0,0,0)], 8.50 ); // MULTA
|
||||
BOOST_CHECK_EQUAL( ntg[grid.getGlobalIndex(0,5,0)], 5.00 ); // POLY
|
||||
BOOST_CHECK_EQUAL( ntg[grid.getGlobalIndex(0,0,1)], 4.0 ); // COPY
|
||||
|
@ -591,9 +591,7 @@ BOOST_AUTO_TEST_CASE( MULTISEGMENT_ABS ) {
|
||||
|
||||
|
||||
const EclipseState state(deck);
|
||||
const auto& grid = state.getInputGrid();
|
||||
const TableManager table ( deck );
|
||||
const Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
Runspec runspec (deck);
|
||||
const Schedule sched(deck, state);
|
||||
|
||||
@ -1368,10 +1366,9 @@ BOOST_AUTO_TEST_CASE( WCONPROD ) {
|
||||
auto deck = parser.parseFile(wconprodFile);
|
||||
EclipseGrid grid(30,30,30);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp( deck , grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule sched(deck, grid, fp, eclipseProperties, runspec );
|
||||
Schedule sched(deck, grid, fp, runspec );
|
||||
|
||||
BOOST_CHECK_EQUAL(5U, sched.numWells());
|
||||
BOOST_CHECK(sched.hasWell("INJE1"));
|
||||
@ -1415,10 +1412,9 @@ BOOST_AUTO_TEST_CASE( WCONINJE ) {
|
||||
auto deck = parser.parseFile(wconprodFile);
|
||||
EclipseGrid grid(30,30,30);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties( deck , table, grid );
|
||||
FieldPropsManager fp(deck, grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule sched( deck, grid, fp, eclipseProperties, runspec);
|
||||
Schedule sched( deck, grid, fp, runspec);
|
||||
SummaryState st(std::chrono::system_clock::now());
|
||||
|
||||
BOOST_CHECK_EQUAL(5U, sched.numWells());
|
||||
|
@ -53,10 +53,9 @@ BOOST_AUTO_TEST_CASE(CreateSchedule) {
|
||||
auto deck2 = parser.parseString( ss.str());
|
||||
for (const auto& deck : {deck1 , deck2}) {
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp(deck, grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule sched(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule sched(deck, grid , fp, runspec);
|
||||
const auto& timeMap = sched.getTimeMap();
|
||||
BOOST_CHECK_EQUAL(TimeMap::mkdate(2007 , 5 , 10), sched.getStartTime());
|
||||
BOOST_CHECK_EQUAL(9U, timeMap.size());
|
||||
@ -71,10 +70,9 @@ BOOST_AUTO_TEST_CASE(CreateSchedule_Comments_After_Keywords) {
|
||||
auto deck = parser.parseFile(scheduleFile);
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp(deck, grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule sched(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule sched(deck, grid , fp, runspec);
|
||||
const auto& timeMap = sched.getTimeMap();
|
||||
BOOST_CHECK_EQUAL(TimeMap::mkdate(2007, 5 , 10) , sched.getStartTime());
|
||||
BOOST_CHECK_EQUAL(9U, timeMap.size());
|
||||
@ -87,10 +85,9 @@ BOOST_AUTO_TEST_CASE(WCONPROD_MissingCmode) {
|
||||
auto deck = parser.parseFile(scheduleFile);
|
||||
EclipseGrid grid(10,10,3);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp(deck, grid, table);
|
||||
Runspec runspec (deck);
|
||||
BOOST_CHECK_NO_THROW( Schedule(deck, grid , fp, eclipseProperties, runspec) );
|
||||
BOOST_CHECK_NO_THROW( Schedule(deck, grid , fp, runspec) );
|
||||
}
|
||||
|
||||
|
||||
@ -100,10 +97,9 @@ BOOST_AUTO_TEST_CASE(WCONPROD_Missing_DATA) {
|
||||
auto deck = parser.parseFile(scheduleFile);
|
||||
EclipseGrid grid(10,10,3);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp(deck, grid, table);
|
||||
Runspec runspec (deck);
|
||||
BOOST_CHECK_THROW( Schedule(deck, grid , fp, eclipseProperties, runspec) , std::invalid_argument );
|
||||
BOOST_CHECK_THROW( Schedule(deck, grid , fp, runspec) , std::invalid_argument );
|
||||
}
|
||||
|
||||
|
||||
@ -113,10 +109,9 @@ BOOST_AUTO_TEST_CASE(WellTestRefDepth) {
|
||||
auto deck = parser.parseFile(scheduleFile);
|
||||
EclipseGrid grid(40,60,30);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp(deck, grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule sched(deck , grid , fp, eclipseProperties, runspec);
|
||||
Schedule sched(deck , grid , fp, runspec);
|
||||
|
||||
const auto& well1 = sched.getWellatEnd("W_1");
|
||||
const auto& well2 = sched.getWellatEnd("W_2");
|
||||
@ -136,10 +131,9 @@ BOOST_AUTO_TEST_CASE(WellTesting) {
|
||||
auto deck = parser.parseFile(scheduleFile);
|
||||
EclipseGrid grid(40,60,30);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp(deck, grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule sched(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule sched(deck, grid , fp, runspec);
|
||||
|
||||
BOOST_CHECK_EQUAL(4U, sched.numWells());
|
||||
BOOST_CHECK(sched.hasWell("W_1"));
|
||||
@ -282,10 +276,9 @@ BOOST_AUTO_TEST_CASE(WellTestCOMPDAT_DEFAULTED_ITEMS) {
|
||||
auto deck = parser.parseFile(scheduleFile);
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp(deck, grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule sched(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule sched(deck, grid , fp, runspec);
|
||||
}
|
||||
|
||||
|
||||
@ -295,10 +288,9 @@ BOOST_AUTO_TEST_CASE(WellTestCOMPDAT) {
|
||||
auto deck = parser.parseFile(scheduleFile);
|
||||
EclipseGrid grid(40,60,30);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp(deck, grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule sched(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule sched(deck, grid , fp, runspec);
|
||||
|
||||
BOOST_CHECK_EQUAL(4U, sched.numWells());
|
||||
BOOST_CHECK(sched.hasWell("W_1"));
|
||||
@ -331,10 +323,9 @@ BOOST_AUTO_TEST_CASE(GroupTreeTest_GRUPTREE_correct) {
|
||||
auto deck = parser.parseFile(scheduleFile);
|
||||
EclipseGrid grid(10,10,3);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp(deck, grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule schedule(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule schedule(deck, grid , fp, runspec);
|
||||
|
||||
BOOST_CHECK( schedule.hasGroup( "FIELD" ));
|
||||
BOOST_CHECK( schedule.hasGroup( "PROD" ));
|
||||
@ -354,10 +345,9 @@ BOOST_AUTO_TEST_CASE(GroupTreeTest_GRUPTREE_WITH_REPARENT_correct_tree) {
|
||||
auto deck = parser.parseFile(scheduleFile);
|
||||
EclipseGrid grid(10,10,3);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp(deck, grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule sched(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule sched(deck, grid , fp, runspec);
|
||||
|
||||
const auto& field_group = sched.getGroup("FIELD", 1);
|
||||
const auto& new_group = sched.getGroup("GROUP_NEW", 1);
|
||||
@ -376,10 +366,9 @@ BOOST_AUTO_TEST_CASE( WellTestGroups ) {
|
||||
auto deck = parser.parseFile(scheduleFile);
|
||||
EclipseGrid grid(10,10,3);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp(deck, grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule sched(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule sched(deck, grid , fp, runspec);
|
||||
SummaryState st(std::chrono::system_clock::now());
|
||||
|
||||
BOOST_CHECK_EQUAL( 3U , sched.numGroups() );
|
||||
@ -428,10 +417,9 @@ BOOST_AUTO_TEST_CASE( WellTestGroupAndWellRelation ) {
|
||||
auto deck = parser.parseFile(scheduleFile);
|
||||
EclipseGrid grid(10,10,3);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp(deck, grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule sched(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule sched(deck, grid , fp, runspec);
|
||||
|
||||
{
|
||||
auto& group1 = sched.getGroup("GROUP1", 0);
|
||||
@ -491,10 +479,9 @@ BOOST_AUTO_TEST_CASE(WellTestWGRUPCONWellPropertiesSet) {
|
||||
auto deck = parser.parseFile(scheduleFile);
|
||||
EclipseGrid grid(10,10,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp(deck, grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule sched(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule sched(deck, grid , fp, runspec);
|
||||
|
||||
const auto& well1 = sched.getWell("W_1", 0);
|
||||
BOOST_CHECK(well1.isAvailableForGroupControl( ));
|
||||
@ -540,10 +527,9 @@ COMPDAT \n\
|
||||
auto deck = parser.parseString(deckString);
|
||||
EclipseGrid grid(30,30,10);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp(deck, grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule sched(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule sched(deck, grid , fp, runspec);
|
||||
const auto& connections = sched.getWell("W1", 0).getConnections();
|
||||
BOOST_CHECK_EQUAL( 10 , connections.get(0).getI() );
|
||||
BOOST_CHECK_EQUAL( 20 , connections.get(0).getJ() );
|
||||
@ -560,10 +546,9 @@ BOOST_AUTO_TEST_CASE(OpmCode) {
|
||||
auto deck = parser.parseFile(scheduleFile);
|
||||
EclipseGrid grid(10,10,5);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp(deck, grid, table);
|
||||
Runspec runspec (deck);
|
||||
BOOST_CHECK_NO_THROW( Schedule(deck , grid , fp, eclipseProperties, runspec) );
|
||||
BOOST_CHECK_NO_THROW( Schedule(deck , grid , fp, runspec) );
|
||||
}
|
||||
|
||||
|
||||
@ -574,10 +559,9 @@ BOOST_AUTO_TEST_CASE(WELLS_SHUT) {
|
||||
auto deck = parser.parseFile(scheduleFile);
|
||||
EclipseGrid grid(20,40,1);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp(deck, grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule sched(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule sched(deck, grid , fp, runspec);
|
||||
|
||||
|
||||
{
|
||||
@ -605,10 +589,9 @@ BOOST_AUTO_TEST_CASE(WellTestWPOLYMER) {
|
||||
auto deck = parser.parseFile(scheduleFile);
|
||||
EclipseGrid grid(30,30,30);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp(deck, grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule sched(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule sched(deck, grid , fp, runspec);
|
||||
|
||||
|
||||
BOOST_CHECK_EQUAL(4U, sched.numWells());
|
||||
@ -673,10 +656,9 @@ BOOST_AUTO_TEST_CASE(WellTestWFOAM) {
|
||||
auto deck = parser.parseFile(scheduleFile);
|
||||
EclipseGrid grid(30,30,30);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp(deck, grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule sched(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule sched(deck, grid , fp, runspec);
|
||||
|
||||
|
||||
BOOST_CHECK_EQUAL(4U, sched.numWells());
|
||||
@ -741,10 +723,9 @@ BOOST_AUTO_TEST_CASE(WellTestWECON) {
|
||||
auto deck = parser.parseFile(scheduleFile);
|
||||
EclipseGrid grid(30,30,30);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp(deck, grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule sched(deck, grid , fp, eclipseProperties, runspec);
|
||||
Schedule sched(deck, grid , fp, runspec);
|
||||
|
||||
BOOST_CHECK_EQUAL(3U, sched.numWells());
|
||||
BOOST_CHECK(sched.hasWell("INJE01"));
|
||||
@ -852,10 +833,9 @@ BOOST_AUTO_TEST_CASE(TestEvents) {
|
||||
auto deck = parser.parseFile(scheduleFile);
|
||||
EclipseGrid grid(40,40,30);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp(deck, grid, table);
|
||||
Runspec runspec (deck);
|
||||
Schedule sched(deck , grid , fp, eclipseProperties, runspec);
|
||||
Schedule sched(deck , grid , fp, runspec);
|
||||
const Events& events = sched.getEvents();
|
||||
|
||||
BOOST_CHECK( events.hasEvent(ScheduleEvents::NEW_WELL , 0 ) );
|
||||
@ -887,10 +867,9 @@ BOOST_AUTO_TEST_CASE(TestWellEvents) {
|
||||
auto deck = parser.parseFile(scheduleFile);
|
||||
EclipseGrid grid(40,40,30);
|
||||
TableManager table ( deck );
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
FieldPropsManager fp(deck, grid, table);
|
||||
Runspec runspec(deck);
|
||||
Schedule sched(deck , grid , fp, eclipseProperties, runspec);
|
||||
Schedule sched(deck , grid , fp, runspec);
|
||||
|
||||
BOOST_CHECK( sched.hasWellGroupEvent( "W_1", ScheduleEvents::NEW_WELL , 0 ));
|
||||
BOOST_CHECK( sched.hasWellGroupEvent( "W_2", ScheduleEvents::NEW_WELL , 2 ));
|
||||
|
@ -30,7 +30,7 @@ inline void loadDeck( const char * deck_file) {
|
||||
|
||||
auto deck = parser.parseFile(deck_file);
|
||||
Opm::EclipseState state( deck);
|
||||
Opm::Schedule schedule( deck, state.getInputGrid(), state.fieldProps(), state.get3DProperties(), state.runspec());
|
||||
Opm::Schedule schedule( deck, state);
|
||||
Opm::SummaryConfig summary( deck, schedule, state.getTableManager( ));
|
||||
{
|
||||
std::stringstream ss;
|
||||
|
@ -44,8 +44,7 @@ BOOST_AUTO_TEST_CASE(create) {
|
||||
EclipseState es(deck);
|
||||
const EclipseGrid& grid = es.getInputGrid();
|
||||
Schedule schedule( deck, es);
|
||||
out::RegionCache rc(es.get3DProperties().getIntGridProperty("FIPNUM").compressedCopy(grid) , grid, schedule);
|
||||
|
||||
out::RegionCache rc(es.fieldProps().get<int>("FIPNUM"), grid, schedule);
|
||||
{
|
||||
const auto& empty = rc.connections( 4 );
|
||||
BOOST_CHECK_EQUAL( empty.size() , 0 );
|
||||
|
Loading…
Reference in New Issue
Block a user