eliminated WellDims and used WellTableDims instead

This commit is contained in:
Jostein Alvestad
2021-03-19 13:38:29 +01:00
parent d0f177d94c
commit 278cd0a240
4 changed files with 13 additions and 44 deletions

View File

@@ -41,9 +41,6 @@ namespace RestartIO {
int maxWellInGroup;
int maxGroupInField;
int maxWellsInField;
};
struct WellDims {
int mxwlstprwel;
int mxdynwlst;
};
@@ -161,7 +158,6 @@ namespace RestartIO {
InteHEAD& stepParam(const int tstep, const int report_step);
InteHEAD& tuningParam(const TuningPar& tunpar);
InteHEAD& variousParam(const int version, const int iprog);
InteHEAD& wellDimensions(const WellDims& wdims);
InteHEAD& wellSegDimensions(const WellSegDims& wsdim);
InteHEAD& networkDimensions(const NetworkDims& nwdim);
InteHEAD& regionDimensions(const RegDims& rdim);

View File

@@ -256,7 +256,9 @@ namespace {
maxPerf,
maxWellInGroup,
maxGroupInField,
(report_step > 0) ? std::max(nWMaxz, numWells) : nWMaxz
(report_step > 0) ? std::max(nWMaxz, numWells) : nWMaxz,
wd.maxWellListsPrWell(),
wd.maxDynamicWellLists()
};
}
@@ -362,17 +364,6 @@ namespace {
};
}
Opm::RestartIO::InteHEAD::WellDims
getWellDims(const ::Opm::Runspec& rspec)
{
const auto& wdims = rspec.wellDimensions();
return {
wdims.maxWellListsPrWell(),
wdims.maxDynamicWellLists()
};
}
Opm::RestartIO::InteHEAD::WellSegDims
getWellSegDims(const ::Opm::Runspec& rspec,
const ::Opm::Schedule& sched,
@@ -559,7 +550,6 @@ createInteHead(const EclipseState& es,
.stepParam (num_solver_steps, report_step)
.tuningParam (getTuningPars(sched[lookup_step].tuning()))
.liftOptParam (getLiftOptPar(sched, lookup_step))
.wellDimensions (getWellDims(rspec))
.wellSegDimensions (getWellSegDims(rspec, sched, report_step, lookup_step))
.regionDimensions (getRegDims(tdim, rdim))
.ngroups ({ ngmax })

View File

@@ -492,6 +492,9 @@ Opm::RestartIO::InteHEAD::wellTableDimensions(const WellTableDim& wtdim)
this->data_[NWMAXZ] = wtdim.maxWellsInField;
this->data_[MXWLSTPW] = wtdim.mxwlstprwel;
this->data_[MXDYNWLST] = wtdim.mxdynwlst;
return *this;
}
@@ -641,15 +644,6 @@ Opm::RestartIO::InteHEAD::variousParam(const int version,
return *this;
}
Opm::RestartIO::InteHEAD&
Opm::RestartIO::InteHEAD::wellDimensions(const WellDims& wdims)
{
this->data_[MXWLSTPW] = wdims.mxwlstprwel;
this->data_[MXDYNWLST] = wdims.mxdynwlst;
return *this;
}
Opm::RestartIO::InteHEAD&
Opm::RestartIO::InteHEAD::wellSegDimensions(const WellSegDims& wsdim)
{

View File

@@ -161,10 +161,13 @@ BOOST_AUTO_TEST_CASE(WellTableDimensions)
const auto maxWellsInGroup = 3;
const auto maxGroupInField = 14;
const auto maxWellsInField = 25;
const auto mxwlstprwel = 3;
const auto mxdynwlst = 4;
const auto ih = Opm::RestartIO::InteHEAD{}
.wellTableDimensions({
numWells, maxPerf, maxWellsInGroup, maxGroupInField, maxWellsInField
numWells, maxPerf, maxWellsInGroup, maxGroupInField, maxWellsInField,
mxwlstprwel, mxdynwlst
});
const auto& v = ih.data();
@@ -174,7 +177,9 @@ BOOST_AUTO_TEST_CASE(WellTableDimensions)
BOOST_CHECK_EQUAL(v[VI::intehead::NCWMAX], maxPerf);
BOOST_CHECK_EQUAL(v[VI::intehead::NWGMAX], nwgmax);
BOOST_CHECK_EQUAL(v[VI::intehead::NGMAXZ], maxGroupInField + 1);
//BOOST_CHECK_EQUAL(v[VI::intehead::NWMAXZ], maxWellsInField);
BOOST_CHECK_EQUAL(v[VI::intehead::NWMAXZ], maxWellsInField);
BOOST_CHECK_EQUAL(v[VI::intehead::MXWLSTPRWELL], mxwlstprwel);
BOOST_CHECK_EQUAL(v[VI::intehead::MAXDYNWELLST], mxdynwlst);
}
BOOST_AUTO_TEST_CASE(CalendarDate)
@@ -374,22 +379,6 @@ BOOST_AUTO_TEST_CASE(Various_Parameters)
BOOST_CHECK_EQUAL(v[101], 1); // IH_101
}
BOOST_AUTO_TEST_CASE(wellDimensions)
{
const auto mxwlstprwel = 3;
const auto mxdynwlst = 4;
const auto ih = Opm::RestartIO::InteHEAD{}
.wellDimensions({
mxwlstprwel, mxdynwlst
});
const auto& v = ih.data();
BOOST_CHECK_EQUAL(v[VI::intehead::MXWLSTPRWELL], mxwlstprwel);
BOOST_CHECK_EQUAL(v[VI::intehead::MAXDYNWELLST], mxdynwlst);
}
BOOST_AUTO_TEST_CASE(wellSegDimensions)
{
const auto nsegwl = 3;