Skeleton for INTEHEAD Writing
Based on reverse-engineering of several ECL runs.
This commit is contained in:
committed by
Joakim Hove
parent
e864031bf4
commit
ce1f66b4e5
Regular → Executable
+12
-8
@@ -136,8 +136,10 @@ if(ENABLE_ECL_OUTPUT)
|
||||
src/opm/test_util/summaryRegressionTest.cpp
|
||||
src/opm/test_util/summaryComparator.cpp
|
||||
src/opm/test_util/EclFilesComparator.cpp
|
||||
src/opm/output/eclipse/CreateInteHead.cpp
|
||||
src/opm/output/eclipse/EclipseGridInspector.cpp
|
||||
src/opm/output/eclipse/EclipseIO.cpp
|
||||
src/opm/output/eclipse/InteHEAD.cpp
|
||||
src/opm/output/eclipse/LinearisedOutputTable.cpp
|
||||
src/opm/output/eclipse/RestartIO.cpp
|
||||
src/opm/output/eclipse/Summary.cpp
|
||||
@@ -223,15 +225,16 @@ if(ENABLE_ECL_OUTPUT)
|
||||
tests/test_compareSummary.cpp
|
||||
tests/test_EclFilesComparator.cpp
|
||||
tests/test_EclipseIO.cpp
|
||||
tests/test_InteHEAD.cpp
|
||||
tests/test_LinearisedOutputTable.cpp
|
||||
tests/test_Restart.cpp
|
||||
tests/test_regionCache.cpp
|
||||
tests/test_RFT.cpp
|
||||
tests/test_Solution.cpp
|
||||
tests/test_Summary.cpp
|
||||
tests/test_Tables.cpp
|
||||
tests/test_Wells.cpp
|
||||
tests/test_writenumwells.cpp
|
||||
tests/test_Solution.cpp
|
||||
tests/test_regionCache.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -468,20 +471,21 @@ if(ENABLE_ECL_OUTPUT)
|
||||
opm/output/OutputWriter.hpp
|
||||
opm/output/data/Wells.hpp
|
||||
opm/output/data/Cells.hpp
|
||||
opm/test_util/summaryRegressionTest.hpp
|
||||
opm/test_util/summaryIntegrationTest.hpp
|
||||
opm/test_util/summaryComparator.hpp
|
||||
opm/output/eclipse/EclipseGridInspector.hpp
|
||||
opm/output/eclipse/EclipseIOUtil.hpp
|
||||
opm/output/eclipse/EclipseIO.hpp
|
||||
opm/output/eclipse/EclipseIOUtil.hpp
|
||||
opm/output/eclipse/InteHEAD.hpp
|
||||
opm/output/eclipse/LinearisedOutputTable.hpp
|
||||
opm/output/eclipse/RegionCache.hpp
|
||||
opm/output/eclipse/RestartIO.hpp
|
||||
opm/output/eclipse/RestartValue.hpp
|
||||
opm/output/eclipse/Summary.hpp
|
||||
opm/output/eclipse/Tables.hpp
|
||||
opm/output/eclipse/RegionCache.hpp
|
||||
opm/output/eclipse/WriteRestartHelpers.hpp
|
||||
opm/output/data/Solution.hpp
|
||||
opm/test_util/EclFilesComparator.hpp
|
||||
opm/test_util/summaryComparator.hpp
|
||||
opm/test_util/summaryIntegrationTest.hpp
|
||||
opm/test_util/summaryRegressionTest.hpp
|
||||
opm/test_util/summaryComparator.hpp)
|
||||
)
|
||||
endif()
|
||||
|
||||
Executable
+126
@@ -0,0 +1,126 @@
|
||||
/*
|
||||
Copyright 2016, 2017 Statoil ASA.
|
||||
|
||||
This file is part of the Open Porous Media Project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPM_INTEHEAD_HEADER_INCLUDED
|
||||
#define OPM_INTEHEAD_HEADER_INCLUDED
|
||||
|
||||
#include <array>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
namespace Opm { namespace RestartIO {
|
||||
|
||||
class InteHEAD
|
||||
{
|
||||
public:
|
||||
enum class UnitSystem {
|
||||
Metric, Field, Lab, PVT_M
|
||||
};
|
||||
|
||||
struct WellTableDim {
|
||||
int numWells;
|
||||
int maxPerf;
|
||||
int maxWellInGroup;
|
||||
int maxGroupInField;
|
||||
};
|
||||
|
||||
struct WellSegDims {
|
||||
int nsegwl;
|
||||
int nswlmx;
|
||||
int nsegmx;
|
||||
int nlbrmx;
|
||||
int nisegz;
|
||||
int nrsegz;
|
||||
int nilbrz;
|
||||
|
||||
};
|
||||
|
||||
struct RegDims {
|
||||
int ntfip;
|
||||
int nmfipr;
|
||||
int nrfreg;
|
||||
int ntfreg;
|
||||
int nplmix;
|
||||
|
||||
};
|
||||
|
||||
struct Date {
|
||||
int year;
|
||||
int month; // 1..12
|
||||
int day; // 1..31
|
||||
|
||||
int hour; // 0..23
|
||||
int minute; // 0..59
|
||||
int second; // 0..59
|
||||
};
|
||||
|
||||
struct Phases {
|
||||
int oil;
|
||||
int water;
|
||||
int gas;
|
||||
};
|
||||
|
||||
struct TuningPar {
|
||||
int newtmx;
|
||||
int newtmn;
|
||||
int litmax;
|
||||
int litmin;
|
||||
int mxwsit;
|
||||
int mxwpit;
|
||||
};
|
||||
|
||||
InteHEAD();
|
||||
~InteHEAD() = default;
|
||||
|
||||
InteHEAD(const InteHEAD& rhs) = default;
|
||||
InteHEAD(InteHEAD&& rhs) = default;
|
||||
|
||||
InteHEAD& operator=(const InteHEAD& rhs) = default;
|
||||
InteHEAD& operator=(InteHEAD&& rhs) = default;
|
||||
|
||||
InteHEAD& dimensions(const int nx, const int ny, const int nz);
|
||||
InteHEAD& dimensions(const std::array<int,3>& cartDims);
|
||||
InteHEAD& numActive(const int nactive);
|
||||
|
||||
InteHEAD& unitConventions(const UnitSystem& usys);
|
||||
InteHEAD& wellTableDimensions(const WellTableDim& wtdim);
|
||||
InteHEAD& calenderDate(const Date& date);
|
||||
InteHEAD& activePhases(const Phases& phases);
|
||||
InteHEAD& params_NWELZ(const int niwelz, const int nswelz, const int nxwelz, const int nzwelz);
|
||||
InteHEAD& params_NCON(const int niconz, const int nsconz, const int nxconz);
|
||||
InteHEAD& params_GRPZ(const std::array<int, 4>& grpz);
|
||||
InteHEAD& params_NAAQZ(const int ncamax, const int niaaqz, const int nsaaqz, const int nxaaqz, const int nicaqz, const int nscaqz, const int nacaqz);
|
||||
InteHEAD& stepParam(const int tstep, const int repstep);
|
||||
InteHEAD& tuningParam(const TuningPar& tunpar);
|
||||
InteHEAD& variousParam(const int iprog, const int ih101, const int ih103);
|
||||
InteHEAD& wellSegDimensions(const WellSegDims& wsdim);
|
||||
InteHEAD& regionDimensions(const RegDims& rdim);
|
||||
|
||||
const std::vector<int>& data() const
|
||||
{
|
||||
return this->data_;
|
||||
}
|
||||
|
||||
private:
|
||||
std::vector<int> data_;
|
||||
};
|
||||
|
||||
}} // Opm::RestartIO
|
||||
|
||||
#endif // OPM_INTEHEAD_HEADER_INCLUDED
|
||||
Executable
+47
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
Copyright (c) 2018 Statoil ASA
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPM_WRITE_RESTART_HELPERS_HPP
|
||||
#define OPM_WRITE_RESTART_HELPERS_HPP
|
||||
|
||||
#include <vector>
|
||||
|
||||
// Forward declarations
|
||||
|
||||
namespace Opm {
|
||||
|
||||
class EclipseGrid;
|
||||
class EclipseState;
|
||||
class Schedule;
|
||||
class Tuning;
|
||||
|
||||
} // Opm
|
||||
|
||||
namespace Opm { namespace RestartIO { namespace Helpers {
|
||||
|
||||
std::vector<int>
|
||||
createInteHead(const EclipseState& es,
|
||||
const EclipseGrid& grid,
|
||||
const Schedule& sched,
|
||||
const double simTime,
|
||||
const int report_step);
|
||||
|
||||
}}} // Opm::RestartIO::Helpers
|
||||
|
||||
#endif // OPM_WRITE_RESTART_HELPERS_HPP
|
||||
Executable
+273
@@ -0,0 +1,273 @@
|
||||
/*
|
||||
Copyright (c) 2018 Statoil ASA
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <opm/output/eclipse/WriteRestartHelpers.hpp>
|
||||
|
||||
#include <opm/output/eclipse/InteHEAD.hpp>
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/IOConfig/RestartConfig.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Runspec.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Tuning.hpp>
|
||||
#include <opm/parser/eclipse/Units/UnitSystem.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/TableManager.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/Regdims.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <chrono>
|
||||
#include <exception>
|
||||
#include <stdexcept>
|
||||
#include <vector>
|
||||
|
||||
namespace {
|
||||
Opm::RestartIO::InteHEAD::WellTableDim
|
||||
getWellTableDims(const ::Opm::Runspec& rspec,
|
||||
const ::Opm::Schedule& sched)
|
||||
{
|
||||
const auto& td = rspec.tabdims();
|
||||
const auto& wd = rspec.wellDimensions();
|
||||
|
||||
const auto numWells = static_cast<int>(sched.numWells());
|
||||
|
||||
const auto maxPerf = wd.maxConnPerWell();
|
||||
const auto maxWellInGroup = wd.maxWellsPerGroup();
|
||||
const auto maxGroupInField = wd.maxGroupsInField();
|
||||
|
||||
return {
|
||||
numWells,
|
||||
maxPerf,
|
||||
maxWellInGroup,
|
||||
maxGroupInField,
|
||||
};
|
||||
}
|
||||
|
||||
std::array<int, 4> getNGRPZ(const ::Opm::Runspec& rspec)
|
||||
{
|
||||
const auto& wd = rspec.wellDimensions();
|
||||
const auto maxWellInGroup = wd.maxWellsPerGroup();
|
||||
const int nigrpz = 97 + maxWellInGroup;
|
||||
const int nsgrpz = 112;
|
||||
const int nxgrpz = 180;
|
||||
const int nzgrpz = 5;
|
||||
|
||||
return {
|
||||
nigrpz,
|
||||
nsgrpz,
|
||||
nxgrpz,
|
||||
nzgrpz
|
||||
};
|
||||
}
|
||||
|
||||
Opm::RestartIO::InteHEAD::UnitSystem
|
||||
getUnitConvention(const ::Opm::UnitSystem& us)
|
||||
{
|
||||
using US = ::Opm::RestartIO::InteHEAD::UnitSystem;
|
||||
|
||||
switch (us.getType()) {
|
||||
case ::Opm::UnitSystem::UnitType::UNIT_TYPE_METRIC:
|
||||
return US::Metric;
|
||||
|
||||
case ::Opm::UnitSystem::UnitType::UNIT_TYPE_FIELD:
|
||||
return US::Field;
|
||||
|
||||
case ::Opm::UnitSystem::UnitType::UNIT_TYPE_LAB:
|
||||
return US::Lab;
|
||||
|
||||
case ::Opm::UnitSystem::UnitType::UNIT_TYPE_PVT_M:
|
||||
return US::PVT_M;
|
||||
|
||||
case ::Opm::UnitSystem::UnitType::UNIT_TYPE_INPUT:
|
||||
throw std::invalid_argument {
|
||||
"Cannot Run Simulation With Non-Standard Units"
|
||||
};
|
||||
}
|
||||
|
||||
return US::Metric;
|
||||
}
|
||||
|
||||
Opm::RestartIO::InteHEAD::Date
|
||||
getSimulationDate(const ::Opm::Schedule& sched,
|
||||
const double simTime)
|
||||
{
|
||||
// Would have liked to use H.Hinnant's "date" library here
|
||||
// (https://github.com/HowardHinnant/date), especially to avoid
|
||||
// dealing with std::time_t and the threading issues of calendar
|
||||
// function std::gmtime(). Library proposed (LEWG) for C++20.
|
||||
//
|
||||
// Pray that we're on a system for which std::time_t is 64 bits (or
|
||||
// more) so that we at least don't run into 2k38 with the typical
|
||||
// definition of time_point::time_since_epoch(system_clock::now())
|
||||
|
||||
using namespace std::chrono;
|
||||
|
||||
const auto start = system_clock::
|
||||
from_time_t(sched.posixStartTime());
|
||||
|
||||
// Discard sub-second resolution.
|
||||
const auto now = start + duration_cast<seconds>(
|
||||
duration<double, seconds::period>(simTime));
|
||||
|
||||
const auto t = system_clock::to_time_t(now);
|
||||
|
||||
// Not thread-safe (returns pointer to internal, static storage).
|
||||
// May wish to add some locking here...
|
||||
const auto timepoint = *std::localtime(&t);
|
||||
|
||||
return {
|
||||
timepoint.tm_year + 1900,
|
||||
timepoint.tm_mon + 1,
|
||||
timepoint.tm_mday ,
|
||||
timepoint.tm_hour ,
|
||||
timepoint.tm_min ,
|
||||
std::min(timepoint.tm_sec, 59), // Ignore leap seconds...
|
||||
};
|
||||
}
|
||||
|
||||
Opm::RestartIO::InteHEAD::Phases
|
||||
getActivePhases(const ::Opm::Runspec& rspec)
|
||||
{
|
||||
auto phases = ::Opm::RestartIO::InteHEAD::Phases{};
|
||||
|
||||
const auto& phasePred = rspec.phases();
|
||||
|
||||
phases.oil = phasePred.active(Opm::Phase::OIL);
|
||||
phases.water = phasePred.active(Opm::Phase::WATER);
|
||||
phases.gas = phasePred.active(Opm::Phase::GAS);
|
||||
|
||||
return phases;
|
||||
}
|
||||
|
||||
Opm::RestartIO::InteHEAD::TuningPar
|
||||
getTuningPars(const ::Opm::Tuning& tuning, const size_t step)
|
||||
{
|
||||
const auto& newtmx = tuning.getNEWTMX(step);
|
||||
const auto& newtmn = tuning.getNEWTMN(step);
|
||||
const auto& litmax = tuning.getLITMAX(step);
|
||||
const auto& litmin = tuning.getLITMIN(step);
|
||||
const auto& mxwsit = tuning.getMXWSIT(step);
|
||||
const auto& mxwpit = tuning.getMXWPIT(step);
|
||||
|
||||
return {
|
||||
newtmx,
|
||||
newtmn,
|
||||
litmax,
|
||||
litmin,
|
||||
mxwsit,
|
||||
mxwpit,
|
||||
};
|
||||
}
|
||||
|
||||
Opm::RestartIO::InteHEAD::WellSegDims
|
||||
getWellSegDims(const ::Opm::Runspec& rspec,
|
||||
const ::Opm::Schedule sched,
|
||||
const size_t step)
|
||||
{
|
||||
const auto& wsd = rspec.wellSegmentDimensions();
|
||||
const auto& sched_wells = sched.getWells( step );
|
||||
int n_act_seg_wels = 0;
|
||||
for (const auto& wl : sched_wells) {
|
||||
/*if (wl->isMultiSegment(step)) {
|
||||
std::cout << "sched_well wl: " << wl->name() << std::endl;
|
||||
n_act_seg_wels += 1;
|
||||
}
|
||||
else {
|
||||
std::cout << "non_sched_well wl: " << wl->name() << std::endl;
|
||||
}*/
|
||||
n_act_seg_wels = (wl->isMultiSegment(step))
|
||||
? n_act_seg_wels +1 : n_act_seg_wels;
|
||||
}
|
||||
|
||||
const auto nsegwl = n_act_seg_wels;
|
||||
const auto nswlmx = wsd.maxSegmentedWells();
|
||||
const auto nsegmx = wsd.maxSegmentsPerWell();
|
||||
const auto nlbrmx = wsd.maxLateralBranchesPerWell();
|
||||
const auto nisegz = 22;
|
||||
const auto nrsegz = 140;
|
||||
const auto nilbrz = 10;
|
||||
|
||||
return {
|
||||
nsegwl,
|
||||
nswlmx,
|
||||
nsegmx,
|
||||
nlbrmx,
|
||||
nisegz,
|
||||
nrsegz,
|
||||
nilbrz
|
||||
};
|
||||
}
|
||||
|
||||
Opm::RestartIO::InteHEAD::RegDims
|
||||
getRegDims(const ::Opm::TableManager tdims, const ::Opm::Regdims& rdims)
|
||||
{
|
||||
const auto& ntfip = tdims.numFIPRegions();
|
||||
const auto& nmfipr = rdims.getNMFIPR();
|
||||
const auto& nrfreg = rdims.getNRFREG();
|
||||
const auto& ntfreg = rdims.getNTFREG();
|
||||
const auto& nplmix = rdims.getNPLMIX();
|
||||
|
||||
|
||||
return {
|
||||
ntfip,
|
||||
nmfipr,
|
||||
nrfreg,
|
||||
ntfreg,
|
||||
nplmix
|
||||
};
|
||||
}
|
||||
}
|
||||
// Anonymous
|
||||
|
||||
// #####################################################################
|
||||
// Public Interface (createInteHead()) Below Separator
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
std::vector<int>
|
||||
Opm::RestartIO::Helpers::
|
||||
createInteHead(const EclipseState& es,
|
||||
const EclipseGrid& grid,
|
||||
const Schedule& sched,
|
||||
const double simTime,
|
||||
const int report_step)
|
||||
{
|
||||
const auto& rspec = es.runspec();
|
||||
const auto& tdim = es.getTableManager();
|
||||
const auto& rdim = tdim.getRegdims();
|
||||
|
||||
const auto ih = InteHEAD{}
|
||||
.dimensions (grid.getNXYZ())
|
||||
.numActive (static_cast<int>(grid.getNumActive()))
|
||||
.unitConventions (getUnitConvention(es.getDeckUnitSystem()))
|
||||
.wellTableDimensions(getWellTableDims(rspec, sched))
|
||||
.calenderDate (getSimulationDate(sched, simTime))
|
||||
.activePhases (getActivePhases(rspec))
|
||||
.params_NWELZ (155, 122, 130, 3)
|
||||
.params_NCON (25, 40, 58)
|
||||
.params_GRPZ (getNGRPZ(rspec))
|
||||
.params_NAAQZ (1, 18, 24, 10, 7, 2, 4)
|
||||
.stepParam(report_step, report_step)
|
||||
.tuningParam(getTuningPars(sched.getTuning(), report_step))
|
||||
.wellSegDimensions(getWellSegDims(rspec, sched, report_step))
|
||||
.regionDimensions(getRegDims(tdim, rdim))
|
||||
.variousParam(100, 1, 1)
|
||||
;
|
||||
|
||||
return ih.data();
|
||||
}
|
||||
Executable
+633
@@ -0,0 +1,633 @@
|
||||
#include <opm/output/eclipse/InteHEAD.hpp>
|
||||
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
enum index : std::vector<int>::size_type {
|
||||
ISNUM = 0 , // 0 0 An encoded integer corresponding to the time the file was created. For files not originating from ECLIPSE, this value may be set to zero.
|
||||
METRIC = 1 , // 0 0
|
||||
UNIT = 2 , // (1,2,3) 1 units type: 1 - METRIC, 2 - FIELD, 3 - LAB
|
||||
ih_003 = 3 , // 0 0
|
||||
ih_004 = 4 , // 0 0
|
||||
ih_005 = 5 , // 0 0
|
||||
ih_006 = 6 , // 0 0
|
||||
ih_007 = 7 , // 0 0
|
||||
NX = 8 , // NX 137 Grid x-direction dimension, NX
|
||||
NY = 9 , // NY 236 Grid x-direction dimension, NY
|
||||
NZ = 10 , // NZ 58 Grid x-direction dimension, NZ
|
||||
NACTIV = 11 , // NACTIV? 89022 NACTIV = number of active cells
|
||||
ih_012 = 12 , // 0 0
|
||||
ih_013 = 13 , // 0 0
|
||||
PHASE = 14 , // IPHS 7 IPHS = phase indicator: 1 - oil, 2 - water, 3 - oil/water, 4 - gas, 5 – oil/gas, 6 - gas/water, 7 - oil/water/gas (ECLIPSE output only)
|
||||
ih_015 = 15 , // 0 0
|
||||
NWELLS = 16 , // NWELLS 39 NWELL = number of wells
|
||||
NCWMAX = 17 , // NCWMAX 108 Weldims item2 NCWMAX = maximum number of completions per well
|
||||
ih_018 = 18 , // NGRP? 0 Number of actual groups
|
||||
NWGMAX = 19 , // NWGMAX 0 maximum of weldims item3 or item4 NWGMAX = maximum number of wells in any well group
|
||||
NGMAXZ = 20 , // NGMAXZ 0 weldims item3 + 1 NGMAXZ = maximum number of groups in field
|
||||
ih_021 = 21 , // 0 0
|
||||
ih_022 = 22 , // 0 0
|
||||
ih_023 = 23 , // 0 0
|
||||
NIWELZ = 24 , // NIWELZ 155 155 NIWELZ = no of data elements per well in IWEL array (default 97 for ECLIPSE, 94 for ECLIPSE 300)
|
||||
NSWELZ = 25 , // NSWELZ 122 122 NSWELZ = number of daelements per well in SWEL array
|
||||
NXWELZ = 26 , // NXWELZ 130 130 NXWELZ = number of delements per well in XWEL array
|
||||
NZWELZ = 27 , // NZWEL 3 3 NZWEL = no of 8-character words per well in ZWEL array (= 3)
|
||||
ih_028 = 28 , // 0 0
|
||||
ih_029 = 29 , // 0 0
|
||||
ih_030 = 30 , // 0 0
|
||||
ih_031 = 31 , // 0 0
|
||||
NICONZ = 32 , // 25 15 25 NICON = no of data elements per completion in ICON array (default 19)
|
||||
NSCONZ = 33 , // 40 0 NSCONZ = number of data elements per completion in SCON array
|
||||
NXCONZ = 34 , // 58 0 58 NXCONZ = number of data elements per completion in XCON array
|
||||
ih_035 = 35 , // 0 0
|
||||
NIGRPZ = 36 , // 97+intehead_array[19] 0 97 + intehead[19] NIGRPZ = no of data elements per group in IGRP array
|
||||
NSGRPZ = 37 , // 112 0 112 NSGRPZ = number of data elements per group in SGRP array
|
||||
NXGRPZ = 38 , // 180 0 180 NXGRPZ = number of data elements per group in XGRP array
|
||||
NZGRPZ = 39 , // 5 0 NZGRPZ = number of data elements per group in ZGRP array
|
||||
ih_040 = 40 , // 0 0
|
||||
NCAMAX = 41 , // 1 0 NCAMAX = maximum number of analytic aquifer connections
|
||||
NIAAQZ = 42 , // 18 0 NIAAQZ = number of data elements per aquifer in IAAQ array
|
||||
NSAAQZ = 43 , // 24 0 NSAAQZ = number of data elements per aquifer in SAAQ array
|
||||
NXAAQZ = 44 , // 10 0 NXAAQZ = number of data elements per aquifer in XAAQ array
|
||||
NICAQZ = 45 , // 7 0 NSCAQZ= number of data elements per aquifer connection in SCAQ array
|
||||
NSCAQZ = 46 , // 2 0
|
||||
NACAQZ = 47 , // 4 0
|
||||
ih_048 = 48 , // 0 0
|
||||
ih_049 = 49 , // 0 0
|
||||
ih_050 = 50 , // 0 0
|
||||
ih_051 = 51 , // 0 0
|
||||
ih_052 = 52 , // 0 0
|
||||
ih_053 = 53 , // 0 0
|
||||
ih_054 = 54 , // 0 0
|
||||
ih_055 = 55 , // 0 0
|
||||
ih_056 = 56 , // 0 0
|
||||
ih_057 = 57 , // 0 0
|
||||
ih_058 = 58 , // 0 0
|
||||
ih_059 = 59 , // 0 0
|
||||
ih_060 = 60 , // 0 0
|
||||
ih_061 = 61 , // 0 0
|
||||
ih_062 = 62 , // 0 0
|
||||
ih_063 = 63 , // 0 0
|
||||
DAY = 64 , // IDAY 2 IDAY = calendar day at this report time
|
||||
MONTH = 65 , // IMON 6 IMON = calendar month at this report time
|
||||
YEAR = 66 , // IYEAR 2016 IYEAR = calendar year at this report time
|
||||
TSTEP = 67 , // CurrentTimestep 0
|
||||
REPSTEP = 68 , // CurrentReportStep 0
|
||||
ih_069 = 69 , // 0 0
|
||||
ih_070 = 70 , // 0 0
|
||||
ih_071 = 71 , // 0 0
|
||||
ih_072 = 72 , // 0 0
|
||||
ih_073 = 73 , // 0 0
|
||||
ih_074 = 74 , // 0 0
|
||||
ih_075 = 75 , // 0 0
|
||||
ih_076 = 76 , // 0 0 2
|
||||
ih_077 = 77 , // 0 0
|
||||
ih_078 = 78 , // 0 0
|
||||
ih_079 = 79 , // 0 0
|
||||
NEWTMX = 80 , // 0 0 Tuning,Record3,Item1
|
||||
NEWTMN = 81 , // 0 0 Tuning,Record3,Item2
|
||||
LITMAX = 82 , // 0 0 Tuning,Record3,Item3
|
||||
LITMIN = 83 , // 0 0 Tuning,Record3,Item4
|
||||
MXWSIT = 84 , // 0 0
|
||||
MXWPIT = 85 , // 0 0
|
||||
ih_086 = 86 , // 0 0 Tuning,Record3,Item5
|
||||
ih_087 = 87 , // 0 0 Tuning,Record3,Item6
|
||||
NTFIP = 88 , // 0 0 REGDIMS item1, or TABDIMS item 5
|
||||
ih_089 = 89 , // 0 0
|
||||
ih_090 = 90 , // 0 0
|
||||
ih_091 = 91 , // 0 0
|
||||
ih_092 = 92 , // 0 0
|
||||
ih_093 = 93 , // 0 0
|
||||
IPROG = 94 , // 0 100 IPROG = simulation program identifier: 100 - ECLIPSE 100, 300 - ECLIPSE 300, 500 - ECLIPSE 300 (thermal option), negative - Other simulator
|
||||
INITSIZE = 95 , // 0 0
|
||||
ih_096 = 96 , // 0 0
|
||||
ih_097 = 97 , // 0 0
|
||||
ih_098 = 98 , // 0 0
|
||||
NMFIPR = 99 , // 0 0 REGDIMS item2
|
||||
ih_100 = 100 , // 0 0
|
||||
ih_101 = 101 , // 0 0 1
|
||||
ih_102 = 102 , // 0 0
|
||||
ih_103 = 103 , // 0 0 1
|
||||
ih_104 = 104 , // 0 0
|
||||
ih_105 = 105 , // 0 0
|
||||
ih_106 = 106 , // 0 0
|
||||
ih_107 = 107 , // 0 0
|
||||
ih_108 = 108 , // 0 0
|
||||
ih_109 = 109 , // 0 0
|
||||
ih_110 = 110 , // 0 0
|
||||
ih_111 = 111 , // 0 0
|
||||
ih_112 = 112 , // 0 0
|
||||
ih_113 = 113 , // 0 0
|
||||
ih_114 = 114 , // 0 0
|
||||
ih_115 = 115 , // 0 0
|
||||
ih_116 = 116 , // 0 0
|
||||
ih_117 = 117 , // 0 0
|
||||
ih_118 = 118 , // 0 0
|
||||
ih_119 = 119 , // 0 0
|
||||
ih_120 = 120 , // 0 0
|
||||
ih_121 = 121 , // 0 0
|
||||
ih_122 = 122 , // 0 0
|
||||
ih_123 = 123 , // 0 0
|
||||
ih_124 = 124 , // 0 0
|
||||
ih_125 = 125 , // 0 0
|
||||
ih_126 = 126 , // 0 0
|
||||
ih_127 = 127 , // 0 0
|
||||
ih_128 = 128 , // 0 0
|
||||
ih_129 = 129 , // 0 0
|
||||
ih_130 = 130 , // 0 0
|
||||
NODMAX = 131 , // 0 0 NODMAX = maximum number of nodes in extended network option
|
||||
NBRMAX = 132 , // 0 0 NBRMAX = maximum number of branches in extended network option
|
||||
NIBRAN = 133 , // 0 0 NIBRAN = number of entries per branch in the IBRAN array
|
||||
NRBRAN = 134 , // 0 0 NRBRAN = number of tries per branch in the RBRAN array
|
||||
NINODE = 135 , // 0 0 NINODE = number of entries per node in the INODE array
|
||||
NRNODE = 136 , // 0 0 NRNODE = number of entries per node in the RNODE array
|
||||
NZNODE = 137 , // 0 0 NZNODE = number of entries per node in the ZNODE array
|
||||
NINOBR = 138 , // 0 0 NINOBR = size of the INOBR array
|
||||
ih_139 = 139 , // 0 0
|
||||
ih_140 = 140 , // 0 0
|
||||
ih_141 = 141 , // 0 0
|
||||
ih_142 = 142 , // 0 0
|
||||
ih_143 = 143 , // 0 0
|
||||
ih_144 = 144 , // 0 0
|
||||
ih_145 = 145 , // 0 0
|
||||
ih_146 = 146 , // 0 0
|
||||
ih_147 = 147 , // 0 0
|
||||
ih_148 = 148 , // 0 0
|
||||
ih_149 = 149 , // 0 0
|
||||
ih_150 = 150 , // 0 0
|
||||
ih_151 = 151 , // 0 0
|
||||
ih_152 = 152 , // 0 0
|
||||
ih_153 = 153 , // 0 0
|
||||
ih_154 = 154 , // 0 0
|
||||
ih_155 = 155 , // 0 0
|
||||
ih_156 = 156 , // 0 0
|
||||
ih_157 = 157 , // 0 0
|
||||
ih_158 = 158 , // 0 0
|
||||
ih_159 = 159 , // 0 0
|
||||
ih_160 = 160 , // 0 0
|
||||
ih_161 = 161 , // 0 0
|
||||
NGCAUS = 162 , // 0 0 NGCAUS = maximum number of aquifer connections actually used.
|
||||
ih_163 = 163 , // 0 0
|
||||
ih_164 = 164 , // 0 0
|
||||
ih_165 = 165 , // 0 0
|
||||
ih_166 = 166 , // 0 0
|
||||
ih_167 = 167 , // 0 0
|
||||
ih_168 = 168 , // 0 0
|
||||
ih_169 = 169 , // 0 0
|
||||
ih_170 = 170 , // 0 0
|
||||
ih_171 = 171 , // 0 0
|
||||
ih_172 = 172 , // 0 0
|
||||
ih_173 = 173 , // 0 0
|
||||
NSEGWL = 174 , // 0 0 number of mswm wells defined with WELSEG
|
||||
NSWLMX = 175 , // NSWLMX 0 Item 1 in WSEGDIMS keyword (runspec section) NSWLMX = maximum number of segmented wells
|
||||
NSEGMX = 176 , // NSEGMX 0 Item 2 in WSEGDIMS keyword (runspec section) NSEGMX = maximum number of segments per well
|
||||
NLBRMX = 177 , // NLBRMX 0 Item 3 in WSEGDIMS keyword (runspec section) NLBRMX = maximum number of lateral branches per well
|
||||
NISEGZ = 178 , // 22 0 22 NISEGZ = number of entries per segment in ISEG array
|
||||
NRSEGZ = 179 , // 140 0 140 NRSEGZ = number of entries per segment in RSEG array
|
||||
NILBRZ = 180 , // 10 10 NILBRZ = number of entries per segment in ILBR array
|
||||
RSTSIZE = 181 , // 0
|
||||
ih_182 = 182 , // 0
|
||||
ih_183 = 183 , // 0
|
||||
ih_184 = 184 , // 0
|
||||
ih_185 = 185 , // 0
|
||||
ih_186 = 186 , // 0
|
||||
ih_187 = 187 , // 0
|
||||
ih_188 = 188 , // 0
|
||||
ih_189 = 189 , // 0
|
||||
ih_190 = 190 , // 0
|
||||
ih_191 = 191 , // 0
|
||||
ih_192 = 192 , // 0
|
||||
ih_193 = 193 , // 0
|
||||
ih_194 = 194 , // 0
|
||||
ih_195 = 195 , // 0
|
||||
ih_196 = 196 , // 0
|
||||
ih_197 = 197 , // 0
|
||||
ih_198 = 198 , // 0
|
||||
ih_199 = 199 , // 0
|
||||
ih_200 = 200 , // 0
|
||||
ih_201 = 201 , // 0
|
||||
ih_202 = 202 , // 0
|
||||
ih_203 = 203 , // 0
|
||||
ih_204 = 204 , // 0
|
||||
ih_205 = 205 , // 0
|
||||
IHOURZ = 206 , // IHOURZ IHOURZ = current simulation time HH:MM:SS – number of hours (HH) (0-23).
|
||||
IMINTS = 207 , // IMINTS IMINTS = current simulation time HH:MM:SS - number of minutes (MM) (0-59).
|
||||
ih_208 = 208 , // 0
|
||||
ih_209 = 209 , // 0
|
||||
ih_210 = 210 , // 0
|
||||
ih_211 = 211 , // 0
|
||||
ih_212 = 212 , // 0
|
||||
ih_213 = 213 , // 0
|
||||
ih_214 = 214 , // 0
|
||||
ih_215 = 215 , // 0
|
||||
ih_216 = 216 , // 0
|
||||
ih_217 = 217 , // 0
|
||||
ih_218 = 218 , // 0
|
||||
ih_219 = 219 , // 0
|
||||
ih_220 = 220 , // 0
|
||||
ih_221 = 221 , // 0
|
||||
ih_222 = 222 , // 0
|
||||
NIIAQN = 223 , // 0 NIIAQN = number of lines of integer AQUNUM data.
|
||||
NIRAQN = 224 , // 0 NIRAQN = number of lines of real AQUNUM data.
|
||||
ih_225 = 225 , // 0
|
||||
NUMAQN = 226 , // 0 NUMAQN = number of lines of AQUNUM data entered.
|
||||
ih_227 = 227 , // 0
|
||||
ih_228 = 228 , // 0
|
||||
ih_229 = 229 , // 0
|
||||
ih_230 = 230 , // 0
|
||||
ih_231 = 231 , // 0
|
||||
ih_232 = 232 , // 0
|
||||
ih_233 = 233 , // 0
|
||||
NICOTZ = 234 , // 0 NICOTZ = number of entries in the ICOT array
|
||||
NXCOTZ = 235 , // 0 NXCOTZ = number of entries in the XCOT array
|
||||
NIWETZ = 236 , // 0 NIWETZ = number of entries in the IWET array
|
||||
NXWETZ = 237 , // 0 NXWETZ = number of entries in the XWET array
|
||||
NIGRTZ = 238 , // 0 NIGRTZ = number of entries in the IGRT array
|
||||
NXGRTZ = 239 , // 0 NXGRTZ = number of entries in the XGRT array
|
||||
NSTRA2 = 240 , // 0 NSTRA2 = number of tracers + 2
|
||||
ih_241 = 241 , // 0
|
||||
ih_242 = 242 , // 0
|
||||
ih_243 = 243 , // 0
|
||||
ih_244 = 244 , // 0
|
||||
ih_245 = 245 , // 0
|
||||
ih_246 = 246 , // 0
|
||||
ih_247 = 247 , // 0
|
||||
ih_248 = 248 , // 0
|
||||
ih_249 = 249 , // 0
|
||||
ih_250 = 250 , // 0
|
||||
ih_251 = 251 , // 0
|
||||
MAAQID = 252 , // 0 MAAQID = maximum number of analytic aquifers
|
||||
ih_253 = 253 , // 0
|
||||
ih_254 = 254 , // 0
|
||||
ih_255 = 255 , // 0
|
||||
ih_256 = 256 , // 0
|
||||
ih_257 = 257 , // 0
|
||||
ih_258 = 258 , // 0
|
||||
ih_259 = 259 , // 0
|
||||
ih_260 = 260 , // 0
|
||||
ih_261 = 261 , // 0
|
||||
ih_262 = 262 , // 0
|
||||
ih_263 = 263 , // 0
|
||||
ih_264 = 264 , // 0
|
||||
ih_265 = 265 , // 0
|
||||
ih_266 = 266 , // 0
|
||||
ih_267 = 267 , // 0
|
||||
ih_268 = 268 , // 0
|
||||
ih_269 = 269 , // 0
|
||||
ih_270 = 270 , // 0
|
||||
NCRDMX = 271 , // 0 NCRDMX = maximum number of chord segment links per well
|
||||
ih_272 = 272 , // 0
|
||||
ih_273 = 273 , // 0
|
||||
ih_274 = 274 , // 0
|
||||
ih_275 = 275 , // 0
|
||||
ih_276 = 276 , // 0
|
||||
ih_277 = 277 , // 0
|
||||
ih_278 = 278 , // 0
|
||||
ih_279 = 279 , // 0
|
||||
ih_280 = 280 , // 0
|
||||
ih_281 = 281 , // 0
|
||||
ih_282 = 282 , // 0
|
||||
ih_283 = 283 , // 0
|
||||
ih_284 = 284 , // 0
|
||||
ih_285 = 285 , // 0
|
||||
ih_286 = 286 , // 0
|
||||
ih_287 = 287 , // 0
|
||||
ih_288 = 288 , // 0
|
||||
ih_289 = 289 , // 0
|
||||
ih_290 = 290 , // 0
|
||||
ih_291 = 291 , // 0
|
||||
ih_292 = 292 , // 0
|
||||
ih_293 = 293 , // 0
|
||||
ih_294 = 294 , // 0
|
||||
ih_295 = 295 , // 0
|
||||
ih_296 = 296 , // 0
|
||||
ih_297 = 297 , // 0
|
||||
ih_298 = 298 , // 0
|
||||
ih_299 = 299 , // 0
|
||||
ih_300 = 300 , // 0
|
||||
ih_301 = 301 , // 0
|
||||
ih_302 = 302 , // 0
|
||||
ih_303 = 303 , // 0
|
||||
ih_304 = 304 , // 0
|
||||
ih_305 = 305 , // 0
|
||||
ih_306 = 306 , // 0
|
||||
ih_307 = 307 , // 0
|
||||
ih_308 = 308 , // 0
|
||||
ih_309 = 309 , // 0
|
||||
ih_310 = 310 , // 0
|
||||
ih_311 = 311 , // 0
|
||||
ih_312 = 312 , // 0
|
||||
ih_313 = 313 , // 0
|
||||
ih_314 = 314 , // 0
|
||||
ih_315 = 315 , // 0
|
||||
ih_316 = 316 , // 0
|
||||
ih_317 = 317 , // 0
|
||||
ih_318 = 318 , // 0
|
||||
ih_319 = 319 , // 0
|
||||
ih_320 = 320 , // 0
|
||||
ih_321 = 321 , // 0
|
||||
ih_322 = 322 , // 0
|
||||
ih_323 = 323 , // 0
|
||||
ih_324 = 324 , // 0
|
||||
ih_325 = 325 , // 0
|
||||
ih_326 = 326 , // 0
|
||||
ih_327 = 327 , // 0
|
||||
ih_328 = 328 , // 0
|
||||
ih_329 = 329 , // 0
|
||||
ih_330 = 330 , // 0
|
||||
ih_331 = 331 , // 0
|
||||
ih_332 = 332 , // 0
|
||||
ih_333 = 333 , // 0
|
||||
ih_334 = 334 , // 0
|
||||
ih_335 = 335 , // 0
|
||||
ih_336 = 336 , // 0
|
||||
ih_337 = 337 , // 0
|
||||
ih_338 = 338 , // 0
|
||||
ih_339 = 339 , // 0
|
||||
ih_340 = 340 , // 0
|
||||
ih_341 = 341 , // 0
|
||||
ih_342 = 342 , // 0
|
||||
ih_343 = 343 , // 0
|
||||
ih_344 = 344 , // 0
|
||||
ih_345 = 345 , // 0
|
||||
ih_346 = 346 , // 0
|
||||
ih_347 = 347 , // 0
|
||||
ih_348 = 348 , // 0
|
||||
ih_349 = 349 , // 0
|
||||
ih_350 = 350 , // 0
|
||||
ih_351 = 351 , // 0
|
||||
ih_352 = 352 , // 0
|
||||
ih_353 = 353 , // 0
|
||||
ih_354 = 354 , // 0
|
||||
ih_355 = 355 , // 0
|
||||
ih_356 = 356 , // 0
|
||||
ih_357 = 357 , // 0
|
||||
ih_358 = 358 , // 0
|
||||
ih_359 = 359 , // 0
|
||||
ih_360 = 360 , // 0
|
||||
ih_361 = 361 , // 0
|
||||
ih_362 = 362 , // 0
|
||||
ih_363 = 363 , // 0
|
||||
ih_364 = 364 , // 0
|
||||
ih_365 = 365 , // 0
|
||||
ih_366 = 366 , // 0
|
||||
ih_367 = 367 , // 0
|
||||
ih_368 = 368 , // 0
|
||||
ih_369 = 369 , // 0
|
||||
ih_370 = 370 , // 0
|
||||
ih_371 = 371 , // 0
|
||||
ih_372 = 372 , // 0
|
||||
ih_373 = 373 , // 0
|
||||
ih_374 = 374 , // 0
|
||||
ih_375 = 375 , // 0
|
||||
ih_376 = 376 , // 0
|
||||
ih_377 = 377 , // 0
|
||||
ih_378 = 378 , // 0
|
||||
ih_379 = 379 , // 0
|
||||
ih_380 = 380 , // 0
|
||||
ih_381 = 381 , // 0
|
||||
ih_382 = 382 , // 0
|
||||
ih_383 = 383 , // 0
|
||||
ih_384 = 384 , // 0
|
||||
ih_385 = 385 , // 0
|
||||
ih_386 = 386 , // 0
|
||||
ih_387 = 387 , // 0
|
||||
ih_388 = 388 , // 0
|
||||
ih_389 = 389 , // 0
|
||||
ih_390 = 390 , // 0
|
||||
ih_391 = 391 , // 0
|
||||
ih_392 = 392 , // 0
|
||||
ih_393 = 393 , // 0
|
||||
ih_394 = 394 , // 0
|
||||
ih_395 = 395 , // 0
|
||||
ih_396 = 396 , // 0
|
||||
ih_397 = 397 , // 0
|
||||
ih_398 = 398 , // 0
|
||||
ih_399 = 399 , // 0
|
||||
ih_400 = 400 , // 0
|
||||
ih_401 = 401 , // 0
|
||||
ih_402 = 402 , // 0
|
||||
ih_403 = 403 , // 0
|
||||
ih_404 = 404 , // 0
|
||||
ih_405 = 405 , // 0
|
||||
ih_406 = 406 , // 0
|
||||
ih_407 = 407 , // 0
|
||||
ih_408 = 408 , // 0
|
||||
ih_409 = 409 , // 0
|
||||
ISECND = 410 , // 0 ISECND = current simulation time HH:MM:SS - number of seconds (SS), reported in microseconds (0-59,999,999)
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
INTEHEAD_NUMBER_OF_ITEMS // MUST be last element of enum.
|
||||
};
|
||||
|
||||
// =====================================================================
|
||||
// Public Interface Below Separator
|
||||
// =====================================================================
|
||||
|
||||
Opm::RestartIO::InteHEAD::InteHEAD()
|
||||
: data_(INTEHEAD_NUMBER_OF_ITEMS, 0)
|
||||
{}
|
||||
|
||||
Opm::RestartIO::InteHEAD&
|
||||
Opm::RestartIO::InteHEAD::
|
||||
dimensions(const int nx, const int ny, const int nz)
|
||||
{
|
||||
this -> data_[NX] = nx;
|
||||
this -> data_[NY] = ny;
|
||||
this -> data_[NZ] = nz;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
Opm::RestartIO::InteHEAD&
|
||||
Opm::RestartIO::InteHEAD::
|
||||
dimensions(const std::array<int,3>& cartDims)
|
||||
{
|
||||
return this->dimensions(cartDims[0], cartDims[1], cartDims[2]);
|
||||
}
|
||||
|
||||
Opm::RestartIO::InteHEAD&
|
||||
Opm::RestartIO::InteHEAD::numActive(const int nactive)
|
||||
{
|
||||
this->data_[NACTIV] = nactive;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
Opm::RestartIO::InteHEAD&
|
||||
Opm::RestartIO::InteHEAD::unitConventions(const UnitSystem& usys)
|
||||
{
|
||||
const auto unit = [&usys]()
|
||||
{
|
||||
switch (usys) {
|
||||
case UnitSystem::Metric: return 1;
|
||||
case UnitSystem::Field: return 2;
|
||||
case UnitSystem::Lab: return 3;
|
||||
case UnitSystem::PVT_M: return 4;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}();
|
||||
|
||||
this->data_[UNIT] = unit;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
Opm::RestartIO::InteHEAD&
|
||||
Opm::RestartIO::InteHEAD::wellTableDimensions(const WellTableDim& wtdim)
|
||||
{
|
||||
this->data_[NWELLS] = wtdim.numWells;
|
||||
this->data_[NCWMAX] = wtdim.maxPerf;
|
||||
this->data_[NWGMAX] = wtdim.maxWellInGroup;
|
||||
this->data_[NGMAXZ] = wtdim.maxGroupInField;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
Opm::RestartIO::InteHEAD&
|
||||
Opm::RestartIO::InteHEAD::calenderDate(const Date& date)
|
||||
{
|
||||
this->data_[DAY] = date.day;
|
||||
this->data_[MONTH] = date.month;
|
||||
this->data_[YEAR] = date.year;
|
||||
|
||||
this->data_[IHOURZ] = date.hour;
|
||||
this->data_[IMINTS] = date.minute;
|
||||
|
||||
// Microseonds...
|
||||
this->data_[ISECND] = (date.second * 1000) * 1000;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
Opm::RestartIO::InteHEAD&
|
||||
Opm::RestartIO::InteHEAD::activePhases(const Phases& phases)
|
||||
{
|
||||
const auto iphs =
|
||||
(static_cast<unsigned int> (phases.oil) << 0u)
|
||||
| (static_cast<unsigned int>(phases.water) << 1u)
|
||||
| (static_cast<unsigned int>(phases.gas) << 2u);
|
||||
|
||||
this->data_[PHASE] = static_cast<int>(iphs);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
Opm::RestartIO::InteHEAD&
|
||||
Opm::RestartIO::InteHEAD::
|
||||
params_NWELZ(const int niwelz, const int nswelz, const int nxwelz, const int nzwelz)
|
||||
{
|
||||
this -> data_[NIWELZ] = niwelz;
|
||||
this -> data_[NSWELZ] = nswelz;
|
||||
this -> data_[NXWELZ] = nxwelz;
|
||||
this -> data_[NZWELZ] = nzwelz;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
Opm::RestartIO::InteHEAD&
|
||||
Opm::RestartIO::InteHEAD::
|
||||
params_NCON(const int niconz, const int nsconz, const int nxconz)
|
||||
{
|
||||
this -> data_[NICONZ] = niconz;
|
||||
this -> data_[NSCONZ] = nsconz;
|
||||
this -> data_[NXCONZ] = nxconz;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
Opm::RestartIO::InteHEAD&
|
||||
Opm::RestartIO::InteHEAD::
|
||||
params_GRPZ(const std::array<int, 4>& grpz)
|
||||
{
|
||||
this -> data_[NIGRPZ] = grpz[0];
|
||||
this -> data_[NSGRPZ] = grpz[1];
|
||||
this -> data_[NXGRPZ] = grpz[2];
|
||||
this -> data_[NZGRPZ] = grpz[3];
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
Opm::RestartIO::InteHEAD&
|
||||
Opm::RestartIO::InteHEAD::
|
||||
params_NAAQZ(const int ncamax,
|
||||
const int niaaqz,
|
||||
const int nsaaqz,
|
||||
const int nxaaqz,
|
||||
const int nicaqz,
|
||||
const int nscaqz,
|
||||
const int nacaqz)
|
||||
{
|
||||
this -> data_[NCAMAX] = ncamax;
|
||||
this -> data_[NIAAQZ] = niaaqz;
|
||||
this -> data_[NSAAQZ] = nsaaqz;
|
||||
this -> data_[NXAAQZ] = nxaaqz;
|
||||
this -> data_[NICAQZ] = nicaqz;
|
||||
this -> data_[NSCAQZ] = nscaqz;
|
||||
this -> data_[NACAQZ] = nacaqz;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
Opm::RestartIO::InteHEAD&
|
||||
Opm::RestartIO::InteHEAD::
|
||||
stepParam(const int tstep, const int repstep)
|
||||
{
|
||||
this -> data_[TSTEP] = tstep;
|
||||
this -> data_[REPSTEP] = repstep;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
Opm::RestartIO::InteHEAD&
|
||||
Opm::RestartIO::InteHEAD::tuningParam(const TuningPar& tunpar)
|
||||
{
|
||||
this->data_[NEWTMX] = tunpar.newtmx;
|
||||
this->data_[NEWTMN] = tunpar.newtmn;
|
||||
this->data_[LITMAX] = tunpar.litmax;
|
||||
this->data_[LITMIN] = tunpar.litmin;
|
||||
this->data_[MXWSIT] = tunpar.mxwsit;
|
||||
this->data_[MXWPIT] = tunpar.mxwpit;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
Opm::RestartIO::InteHEAD&
|
||||
Opm::RestartIO::InteHEAD::variousParam(const int iprog, const int ih101, const int ih103)
|
||||
{
|
||||
this->data_[IPROG] = iprog;
|
||||
this->data_[ih_101] = ih101;
|
||||
this->data_[ih_103] = ih103;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
Opm::RestartIO::InteHEAD&
|
||||
Opm::RestartIO::InteHEAD::wellSegDimensions(const WellSegDims& wsdim)
|
||||
{
|
||||
this->data_[NSEGWL] = wsdim.nsegwl;
|
||||
this->data_[NSWLMX] = wsdim.nswlmx;
|
||||
this->data_[NSEGMX] = wsdim.nsegmx;
|
||||
this->data_[NLBRMX] = wsdim.nlbrmx;
|
||||
this->data_[NISEGZ] = wsdim.nisegz;
|
||||
this->data_[NRSEGZ] = wsdim.nrsegz;
|
||||
this->data_[NILBRZ] = wsdim.nilbrz;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
Opm::RestartIO::InteHEAD&
|
||||
Opm::RestartIO::InteHEAD::regionDimensions(const RegDims& rdim)
|
||||
{
|
||||
this->data_[NTFIP] = rdim.ntfip;
|
||||
this->data_[NMFIPR] = rdim.nmfipr;
|
||||
|
||||
return *this;
|
||||
}
|
||||
Executable
+369
@@ -0,0 +1,369 @@
|
||||
/*
|
||||
Copyright 2018 Statoil IT
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#define BOOST_TEST_MODULE InteHEAD_Vector
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <opm/output/eclipse/InteHEAD.hpp>
|
||||
|
||||
#include <array>
|
||||
#include <initializer_list>
|
||||
|
||||
BOOST_AUTO_TEST_SUITE(Member_Functions)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(Dimensions_Individual)
|
||||
{
|
||||
const auto ih = Opm::RestartIO::InteHEAD{}
|
||||
.dimensions(100, 60, 15);
|
||||
|
||||
const auto& v = ih.data();
|
||||
|
||||
BOOST_CHECK_EQUAL(v[ 9 - 1], 100); // Nx
|
||||
BOOST_CHECK_EQUAL(v[10 - 1], 60); // Ny
|
||||
BOOST_CHECK_EQUAL(v[11 - 1], 15); // Nz
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(Dimensions_Array)
|
||||
{
|
||||
const auto ih = Opm::RestartIO::InteHEAD{}
|
||||
.dimensions({100, 60, 15});
|
||||
|
||||
const auto& v = ih.data();
|
||||
|
||||
BOOST_CHECK_EQUAL(v[ 9 - 1], 100); // Nx
|
||||
BOOST_CHECK_EQUAL(v[10 - 1], 60); // Ny
|
||||
BOOST_CHECK_EQUAL(v[11 - 1], 15); // Nz
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(NumActive)
|
||||
{
|
||||
const auto ih = Opm::RestartIO::InteHEAD{}
|
||||
.numActive(72390);
|
||||
|
||||
const auto& v = ih.data();
|
||||
|
||||
BOOST_CHECK_EQUAL(v[12 - 1], 72390); // NACTIVE
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(UnitConventions)
|
||||
{
|
||||
using USys = Opm::RestartIO::InteHEAD::UnitSystem;
|
||||
|
||||
auto ih = Opm::RestartIO::InteHEAD{};
|
||||
|
||||
// Metric
|
||||
{
|
||||
ih.unitConventions(USys::Metric);
|
||||
|
||||
const auto& v = ih.data();
|
||||
|
||||
BOOST_CHECK_EQUAL(v[3 - 1], 1); // Unit
|
||||
}
|
||||
|
||||
// Field
|
||||
{
|
||||
ih.unitConventions(USys::Field);
|
||||
|
||||
const auto& v = ih.data();
|
||||
|
||||
BOOST_CHECK_EQUAL(v[3 - 1], 2); // Unit
|
||||
}
|
||||
|
||||
// Lab
|
||||
{
|
||||
ih.unitConventions(USys::Lab);
|
||||
|
||||
const auto& v = ih.data();
|
||||
|
||||
BOOST_CHECK_EQUAL(v[3 - 1], 3); // Unit
|
||||
}
|
||||
|
||||
// PVT-M
|
||||
{
|
||||
ih.unitConventions(USys::PVT_M);
|
||||
|
||||
const auto& v = ih.data();
|
||||
|
||||
BOOST_CHECK_EQUAL(v[3 - 1], 4); // Unit
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(WellTableDimensions)
|
||||
{
|
||||
const auto numWells = 17;
|
||||
const auto maxPerf = 29;
|
||||
const auto maxWellInGroup = 3;
|
||||
const auto maxGroupInField = 14;
|
||||
|
||||
const auto ih = Opm::RestartIO::InteHEAD{}
|
||||
.wellTableDimensions({
|
||||
numWells, maxPerf, maxWellInGroup, maxGroupInField
|
||||
});
|
||||
|
||||
const auto& v = ih.data();
|
||||
|
||||
BOOST_CHECK_EQUAL(v[17 - 1], numWells); // NWELLS
|
||||
BOOST_CHECK_EQUAL(v[18 - 1], maxPerf); // NCWMAX
|
||||
BOOST_CHECK_EQUAL(v[20 - 1], maxWellInGroup); // NWGMAX
|
||||
BOOST_CHECK_EQUAL(v[21 - 1], maxGroupInField); // NGMAXZ
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(CalendarDate)
|
||||
{
|
||||
// 2015-04-09T11:22:33+0000
|
||||
|
||||
const auto ih = Opm::RestartIO::InteHEAD{}
|
||||
. calenderDate({
|
||||
2015, 4, 9, 11, 22, 33
|
||||
});
|
||||
|
||||
const auto& v = ih.data();
|
||||
|
||||
BOOST_CHECK_EQUAL(v[67 - 1], 2015); // Year
|
||||
BOOST_CHECK_EQUAL(v[66 - 1], 4); // Month
|
||||
BOOST_CHECK_EQUAL(v[65 - 1], 9); // Day
|
||||
|
||||
BOOST_CHECK_EQUAL(v[207 - 1], 11); // Hour
|
||||
BOOST_CHECK_EQUAL(v[208 - 1], 22); // Minute
|
||||
BOOST_CHECK_EQUAL(v[411 - 1], 33000000); // Second (in microseconds)
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(ActivePhases)
|
||||
{
|
||||
using Ph = Opm::RestartIO::InteHEAD::Phases;
|
||||
auto ih = Opm::RestartIO::InteHEAD{};
|
||||
|
||||
// Oil
|
||||
{
|
||||
ih.activePhases(Ph{ 1, 0, 0 });
|
||||
|
||||
const auto& v = ih.data();
|
||||
|
||||
BOOST_CHECK_EQUAL(v[15 - 1], 1);
|
||||
}
|
||||
|
||||
// Water
|
||||
{
|
||||
ih.activePhases(Ph{ 0, 1, 0 });
|
||||
|
||||
const auto& v = ih.data();
|
||||
|
||||
BOOST_CHECK_EQUAL(v[15 - 1], 2);
|
||||
}
|
||||
|
||||
// Gas
|
||||
{
|
||||
ih.activePhases(Ph{ 0, 0, 1 });
|
||||
|
||||
const auto& v = ih.data();
|
||||
|
||||
BOOST_CHECK_EQUAL(v[15 - 1], 4);
|
||||
}
|
||||
|
||||
// Oil/Water
|
||||
{
|
||||
ih.activePhases(Ph{ 1, 1, 0 });
|
||||
|
||||
const auto& v = ih.data();
|
||||
|
||||
BOOST_CHECK_EQUAL(v[15 - 1], 3);
|
||||
}
|
||||
|
||||
// Oil/Gas
|
||||
{
|
||||
ih.activePhases(Ph{ 1, 0, 1 });
|
||||
|
||||
const auto& v = ih.data();
|
||||
|
||||
BOOST_CHECK_EQUAL(v[15 - 1], 5);
|
||||
}
|
||||
|
||||
// Water/Gas
|
||||
{
|
||||
ih.activePhases(Ph{ 0, 1, 1 });
|
||||
|
||||
const auto& v = ih.data();
|
||||
|
||||
BOOST_CHECK_EQUAL(v[15 - 1], 6);
|
||||
}
|
||||
|
||||
// Oil/Water/Gas
|
||||
{
|
||||
ih.activePhases(Ph{ 1, 1, 1 });
|
||||
|
||||
const auto& v = ih.data();
|
||||
|
||||
BOOST_CHECK_EQUAL(v[15 - 1], 7);
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(NWell_Parameters)
|
||||
{
|
||||
const auto ih = Opm::RestartIO::InteHEAD{}
|
||||
.params_NWELZ(27, 18, 28, 1);
|
||||
|
||||
const auto& v = ih.data();
|
||||
|
||||
BOOST_CHECK_EQUAL(v[25 - 1], 27); // NIWELZ
|
||||
BOOST_CHECK_EQUAL(v[26 - 1], 18); // NSWELZ
|
||||
BOOST_CHECK_EQUAL(v[27 - 1], 28); // NXWELZ
|
||||
BOOST_CHECK_EQUAL(v[28 - 1], 1); // NZWELZ
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(NConn_Parameters)
|
||||
{
|
||||
const auto ih = Opm::RestartIO::InteHEAD{}
|
||||
.params_NCON(31, 41, 59);
|
||||
|
||||
const auto& v = ih.data();
|
||||
|
||||
BOOST_CHECK_EQUAL(v[33 - 1], 31); // NICONZ
|
||||
BOOST_CHECK_EQUAL(v[34 - 1], 41); // NSCONZ
|
||||
BOOST_CHECK_EQUAL(v[35 - 1], 59); // NXCONZ
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(GroupSize_Parameters)
|
||||
{
|
||||
const auto ih = Opm::RestartIO::InteHEAD{}
|
||||
.params_GRPZ({ 577, 215, 664, 901 }); // https://oeis.org/A001620
|
||||
|
||||
const auto& v = ih.data();
|
||||
|
||||
BOOST_CHECK_EQUAL(v[37 - 1], 577); // NIGRPZ
|
||||
BOOST_CHECK_EQUAL(v[38 - 1], 215); // NSGRPZ
|
||||
BOOST_CHECK_EQUAL(v[39 - 1], 664); // NXGRPZ
|
||||
BOOST_CHECK_EQUAL(v[40 - 1], 901); // NZGRPZ
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(Analytic_Aquifer_Parameters)
|
||||
{
|
||||
// https://oeis.org/A001622
|
||||
const auto ih = Opm::RestartIO::InteHEAD{}
|
||||
.params_NAAQZ(1, 61, 803, 3988, 74989, 484820, 4586834);
|
||||
|
||||
const auto& v = ih.data();
|
||||
|
||||
BOOST_CHECK_EQUAL(v[42 - 1], 1); // NCAMAX
|
||||
BOOST_CHECK_EQUAL(v[43 - 1], 61); // NIAAQZ
|
||||
BOOST_CHECK_EQUAL(v[44 - 1], 803); // NSAAQZ
|
||||
BOOST_CHECK_EQUAL(v[45 - 1], 3988); // NXAAQZ
|
||||
BOOST_CHECK_EQUAL(v[46 - 1], 74989); // NICAQZ
|
||||
BOOST_CHECK_EQUAL(v[47 - 1], 484820); // NSCAQZ
|
||||
BOOST_CHECK_EQUAL(v[48 - 1], 4586834); // NACAQZ
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(Time_and_report_step)
|
||||
{
|
||||
const auto ih = Opm::RestartIO::InteHEAD{}
|
||||
.stepParam(12, 2);
|
||||
|
||||
const auto& v = ih.data();
|
||||
|
||||
BOOST_CHECK_EQUAL(v[67], 12); // TSTEP
|
||||
BOOST_CHECK_EQUAL(v[68], 2); // REP_STEP
|
||||
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(Tuning_param)
|
||||
{
|
||||
const auto newtmx = 17;
|
||||
const auto newtmn = 5;
|
||||
const auto litmax = 102;
|
||||
const auto litmin = 20;
|
||||
const auto mxwsit = 8;
|
||||
const auto mxwpit = 6;
|
||||
|
||||
const auto ih = Opm::RestartIO::InteHEAD{}
|
||||
.tuningParam({
|
||||
newtmx, newtmn, litmax, litmin, mxwsit, mxwpit
|
||||
});
|
||||
|
||||
const auto& v = ih.data();
|
||||
|
||||
BOOST_CHECK_EQUAL(v[80], newtmx); // NEWTMX
|
||||
BOOST_CHECK_EQUAL(v[81], newtmn); // NEWTMN
|
||||
BOOST_CHECK_EQUAL(v[82], litmax); // LITMAX
|
||||
BOOST_CHECK_EQUAL(v[83], litmin); // LITMIN
|
||||
BOOST_CHECK_EQUAL(v[84], mxwsit); // MXWSIT
|
||||
BOOST_CHECK_EQUAL(v[85], mxwpit); // MXWPIT
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(Various_Parameters)
|
||||
{
|
||||
const auto ih = Opm::RestartIO::InteHEAD{}
|
||||
.variousParam(100, 2, 3);
|
||||
|
||||
const auto& v = ih.data();
|
||||
|
||||
BOOST_CHECK_EQUAL(v[ 94], 100); // IPROG
|
||||
BOOST_CHECK_EQUAL(v[101], 2); // IH_101
|
||||
BOOST_CHECK_EQUAL(v[103], 3); // IH_103
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(wellSegDimensions)
|
||||
{
|
||||
const auto nsegwl = 3;
|
||||
const auto nswlmx = 4;
|
||||
const auto nsegmx = 5;
|
||||
const auto nlbrmx = 6;
|
||||
const auto nisegz = 7;
|
||||
const auto nrsegz = 8;
|
||||
const auto nilbrz = 9;
|
||||
|
||||
const auto ih = Opm::RestartIO::InteHEAD{}
|
||||
.wellSegDimensions({
|
||||
nsegwl, nswlmx, nsegmx, nlbrmx, nisegz, nrsegz, nilbrz
|
||||
});
|
||||
|
||||
const auto& v = ih.data();
|
||||
|
||||
BOOST_CHECK_EQUAL(v[174], nsegwl);
|
||||
BOOST_CHECK_EQUAL(v[175], nswlmx);
|
||||
BOOST_CHECK_EQUAL(v[176], nsegmx);
|
||||
BOOST_CHECK_EQUAL(v[177], nlbrmx);
|
||||
BOOST_CHECK_EQUAL(v[178], nisegz);
|
||||
BOOST_CHECK_EQUAL(v[179], nrsegz);
|
||||
BOOST_CHECK_EQUAL(v[180], nilbrz);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(regionDimensions)
|
||||
{
|
||||
|
||||
const auto ntfip = 12;
|
||||
const auto nmfipr = 22;
|
||||
const auto nrfreg = 5;
|
||||
const auto ntfreg = 6;
|
||||
const auto nplmix = 7;
|
||||
|
||||
const auto ih = Opm::RestartIO::InteHEAD{}
|
||||
.regionDimensions({
|
||||
ntfip, nmfipr, nrfreg, ntfreg, nplmix
|
||||
|
||||
});
|
||||
|
||||
const auto& v = ih.data();
|
||||
|
||||
BOOST_CHECK_EQUAL(v[88], ntfip); // NTFIP
|
||||
BOOST_CHECK_EQUAL(v[99], nmfipr); // NMFIPR
|
||||
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
Reference in New Issue
Block a user