Added corrections to SWEL and ISEG plus InteHead[179] to 146

This commit is contained in:
Jostein Alvestad 2018-08-21 14:11:33 +02:00
parent a41596004a
commit 4f9f952e77
6 changed files with 22 additions and 13 deletions

View File

@ -30,6 +30,7 @@
namespace Opm {
class Phases;
class Schedule;
class EclipseGrid;
class UnitSystem;
} // Opm
@ -51,7 +52,8 @@ namespace Opm { namespace RestartIO { namespace Helpers {
void captureDeclaredMSWData(const Opm::Schedule& sched,
const std::size_t rptStep,
const Opm::UnitSystem& units,
const std::vector<int>& inteHead);
const std::vector<int>& inteHead,
const Opm::EclipseGrid& grid);
/// Retrieve Integer Multisegment well data Array.
const std::vector<int>& getISeg() const

View File

@ -134,15 +134,19 @@ namespace {
int firstConnectionInSegment(const Opm::WellConnections& compSet,
const Opm::WellSegments& segSet,
const size_t segIndex)
const size_t segIndex,
const Opm::EclipseGrid& grid)
{
auto segNumber = segSet[segIndex].segmentNumber();
int firstConnection = std::numeric_limits<int>::max();
for (auto it : compSet) {
auto c_Segment = it.segment_number;
//auto c_SeqIndex = it.seqIndex;
auto c_SeqIndex = it.getSeqIndex();
if ((segNumber == c_Segment) && (c_SeqIndex < firstConnection)) {
const auto ci = it.getI();
const auto cj = it.getJ();
const auto ck = it.getK();
const auto c_active = grid.cellActive(ci, cj, ck);
if ((segNumber == c_Segment) && (c_SeqIndex < firstConnection) && c_active) {
firstConnection = c_SeqIndex;
}
}
@ -303,7 +307,9 @@ namespace {
void staticContrib(const Opm::Well& well,
const std::size_t rptStep,
const std::vector<int>& inteHead,
ISegArray& iSeg)
const Opm::EclipseGrid& grid,
ISegArray& iSeg
)
{
if (well.isMultiSegment(rptStep)) {
//loop over segment set and print out information
@ -320,7 +326,7 @@ namespace {
iSeg[iS + 4] = noInFlowBranches(welSegSet, ind);
iSeg[iS + 5] = sumNoInFlowBranches(welSegSet, ind);
iSeg[iS + 6] = noConnectionsSegment(completionSet, welSegSet, ind);
iSeg[iS + 7] = firstConnectionInSegment(completionSet, welSegSet, ind);
iSeg[iS + 7] = firstConnectionInSegment(completionSet, welSegSet, ind, grid);
iSeg[iS + 8] = iSeg[iS+0];
}
}
@ -524,7 +530,8 @@ Opm::RestartIO::Helpers::AggregateMSWData::
captureDeclaredMSWData(const Schedule& sched,
const std::size_t rptStep,
const Opm::UnitSystem& units,
const std::vector<int>& inteHead)
const std::vector<int>& inteHead,
const Opm::EclipseGrid& grid)
{
const auto& wells = sched.getWells(rptStep);
auto msw = std::vector<const Opm::Well*>{};
@ -536,12 +543,12 @@ captureDeclaredMSWData(const Schedule& sched,
// Extract Contributions to ISeg Array
{
MSWLoop(msw, [rptStep, inteHead, this]
MSWLoop(msw, [rptStep, inteHead, grid, this]
(const Well& well, const std::size_t mswID) -> void
{
auto imsw = this->iSeg_[mswID];
ISeg::staticContrib(well, rptStep, inteHead, imsw);
ISeg::staticContrib(well, rptStep, inteHead, grid, imsw);
});
}

View File

@ -433,7 +433,7 @@ namespace {
// Initial data by Statoil ASA.
return { // 122 Items (0..121)
// 0 1 2 3 4 5
zero , zero , zero , zero ,infty , zero, // 0.. 5 ( 0)
infty , infty , infty , infty ,infty , infty, // 0.. 5 ( 0)
one , zero , zero , zero , zero , 1.0e-05f, // 6.. 11 ( 1)
zero , zero , infty, infty, zero , dflt , // 12.. 17 ( 2)
infty, infty, infty, infty, infty, zero , // 18.. 23 ( 3)

View File

@ -161,7 +161,7 @@ namespace {
const auto nsegmx = wsd.maxSegmentsPerWell();
const auto nlbrmx = wsd.maxLateralBranchesPerWell();
const auto nisegz = 22; // Number of entries per segment in ISEG.
const auto nrsegz = 140; // Number of entries per segment in RSEG array.
const auto nrsegz = 146; // Number of entries per segment in RSEG array. (Eclipse v.2017)
const auto nilbrz = 10; // Number of entries per segment in ILBR array.
return {

View File

@ -198,7 +198,7 @@ enum index : std::vector<int>::size_type {
NSEGMX = VI::intehead::NSEGMX , // NSEGMX 0 Item 2 in WSEGDIMS keyword (runspec section) NSEGMX = maximum number of segments per well
NLBRMX = VI::intehead::NLBRMX , // NLBRMX 0 Item 3 in WSEGDIMS keyword (runspec section) NLBRMX = maximum number of lateral branches per well
NISEGZ = VI::intehead::NISEGZ , // 22 0 22 NISEGZ = number of entries per segment in ISEG array
NRSEGZ = VI::intehead::NRSEGZ , // 140 0 140 NRSEGZ = number of entries per segment in RSEG array
NRSEGZ = VI::intehead::NRSEGZ , // 146 0 140 NRSEGZ = number of entries per segment in RSEG array
NILBRZ = VI::intehead::NILBRZ , // 10 10 NILBRZ = number of entries per segment in ILBR array
RSTSIZE = 181 , // 0
ih_182 = 182 , // 0

View File

@ -510,7 +510,7 @@ void writeMSWData(::Opm::RestartIO::ecl_rst_file_type * rst_file,
// write ISEG, RSEG, ILBS and ILBR to restart file
const size_t simStep = static_cast<size_t> (sim_step);
auto MSWData = Helpers::AggregateMSWData(ih);
MSWData.captureDeclaredMSWData(schedule, simStep, units, ih);
MSWData.captureDeclaredMSWData(schedule, simStep, units, ih, grid);
write_kw(rst_file, EclKW<int> ("ISEG", MSWData.getISeg()));
write_kw(rst_file, EclKW<int> ("ILBS", MSWData.getILBs()));
write_kw(rst_file, EclKW<int> ("ILBR", MSWData.getILBr()));