Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use options 1-3 in TRACERS #4072

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions opm/input/eclipse/EclipseState/Runspec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -591,8 +591,8 @@ Tracers Tracers::serializationTestObject() {
return tracers;
}

int Tracers::water_tracers() const {
return this->m_water_tracers;
int Tracers::all_tracers() const {
return this->m_water_tracers + this->m_oil_tracers + this->m_gas_tracers;
}


Expand Down
2 changes: 1 addition & 1 deletion opm/input/eclipse/EclipseState/Runspec.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ class Tracers {
Tracers() = default;

explicit Tracers(const Deck& );
int water_tracers() const;
int all_tracers() const;

template<class Serializer>
void serializeOp(Serializer& serializer) {
Expand Down
2 changes: 1 addition & 1 deletion opm/io/eclipse/rst/well.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ Opm::RestartIO::RstWell::RstWell(const UnitSystem& unit_system,
{

for (std::size_t tracer_index = 0;
tracer_index < static_cast<std::size_t>(header.runspec.tracers().water_tracers());
tracer_index < static_cast<std::size_t>(header.runspec.tracers().all_tracers());
++tracer_index)
{
this->tracer_concentration_injection.push_back(swel[VI::SWell::TracerOffset + tracer_index]);
Expand Down
2 changes: 1 addition & 1 deletion opm/output/eclipse/AggregateMSWData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ namespace {
RSegArray& rSeg)
{
auto tracer_offset = segment_offset + Opm::RestartIO::InteHEAD::numRsegElem(runspec.phases());
auto tracer_end = tracer_offset + runspec.tracers().water_tracers() * 8;
auto tracer_end = tracer_offset + runspec.tracers().all_tracers() * 8;

std::fill(rSeg.begin() + tracer_offset, rSeg.begin() + tracer_end, 0.0);
}
Expand Down
8 changes: 4 additions & 4 deletions opm/output/eclipse/AggregateWellData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1354,7 +1354,7 @@ namespace {

for (std::size_t tracer_index=0; tracer_index < tracers.size(); tracer_index++) {
const auto& tracer = tracers[tracer_index];
std::size_t output_index = Ix::TracerOffset + tracer_dims.water_tracers() + tracer_index;
std::size_t output_index = Ix::TracerOffset + tracer_dims.all_tracers() + tracer_index;
if (well.isProducer()) {
const auto& wtpr = smry.get_well_var(well.name(), fmt::format("WTPT{}", tracer.name), 0);
xWell[output_index] = wtpr;
Expand All @@ -1363,7 +1363,7 @@ namespace {

for (std::size_t tracer_index=0; tracer_index < tracers.size(); tracer_index++) {
const auto& tracer = tracers[tracer_index];
std::size_t output_index = Ix::TracerOffset + 2*tracer_dims.water_tracers() + tracer_index;
std::size_t output_index = Ix::TracerOffset + 2*tracer_dims.all_tracers() + tracer_index;
if (well.isInjector()) {
const auto& wtir = smry.get_well_var(well.name(), fmt::format("WTIT{}", tracer.name), 0);
xWell[output_index] = wtir;
Expand All @@ -1373,7 +1373,7 @@ namespace {
for (std::size_t n=0; n < 2; n++) {
for (std::size_t tracer_index=0; tracer_index < tracers.size(); tracer_index++) {
const auto& tracer = tracers[tracer_index];
std::size_t output_index = Ix::TracerOffset + (3 + n)*tracer_dims.water_tracers() + tracer_index;
std::size_t output_index = Ix::TracerOffset + (3 + n)*tracer_dims.all_tracers() + tracer_index;
const auto& wtic = smry.get_well_var(well.name(), fmt::format("WTIC{}", tracer.name), 0);
const auto& wtpc = smry.get_well_var(well.name(), fmt::format("WTPC{}", tracer.name), 0);

Expand All @@ -1384,7 +1384,7 @@ namespace {
}
}

std::size_t output_index = Ix::TracerOffset + 5*tracer_dims.water_tracers();
std::size_t output_index = Ix::TracerOffset + 5*tracer_dims.all_tracers();
xWell[output_index] = 0;
xWell[output_index + 1] = 0;
}
Expand Down
20 changes: 10 additions & 10 deletions opm/output/eclipse/CreateInteHead.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ namespace {
std::array<int, 4>
getNGRPZ(const int grpsz,
const int ngrp,
const int num_water_tracer,
const int num_tracer,
const ::Opm::Runspec& rspec)
{
const auto& wd = rspec.wellDimensions();
Expand All @@ -317,7 +317,7 @@ namespace {

const int nigrpz = 97 + std::max(nwgmax, ngmax);
const int nsgrpz = 112;
const int nxgrpz = 180 + 4*num_water_tracer;
const int nxgrpz = 180 + 4*num_tracer;
const int nzgrpz = 5;

return {{
Expand Down Expand Up @@ -404,7 +404,7 @@ namespace {


Opm::RestartIO::InteHEAD::WellSegDims
getWellSegDims(const int num_water_tracer,
getWellSegDims(const int num_tracer,
const ::Opm::Runspec& rspec,
const ::Opm::Schedule& sched,
const std::size_t report_step,
Expand All @@ -423,7 +423,7 @@ namespace {
std::max(maxNumBr, wsd.maxLateralBranchesPerWell()),
22, // Number of entries per segment in ISEG (2017.2)
Opm::RestartIO::InteHEAD::numRsegElem(rspec.phases())
+ 8*num_water_tracer, // Number of entries per segment in RSEG
+ 8*num_tracer, // Number of entries per segment in RSEG
10 // Number of entries per segment in ILBR (2017.2)
};
}
Expand Down Expand Up @@ -617,8 +617,8 @@ createInteHead(const EclipseState& es,
const auto& tdim = es.getTableManager();
const auto& rdim = tdim.getRegdims();
const auto& rckcfg = es.getSimulationConfig().rock_config();
auto num_water_tracer = es.runspec().tracers().water_tracers();
int nxwelz_tracer_shift = num_water_tracer*5 + 2 * (num_water_tracer > 0);
auto num_tracer = es.runspec().tracers().all_tracers();
int nxwelz_tracer_shift = num_tracer*5 + 2 * (num_tracer > 0);

const auto ih = InteHEAD{}
.dimensions (grid.getNXYZ())
Expand All @@ -631,14 +631,14 @@ createInteHead(const EclipseState& es,
// The numbers below have been determined experimentally to work
// across a range of reference cases, but are not guaranteed to be
// universally valid.
.params_NWELZ (155 + num_water_tracer, 122 + 2*num_water_tracer, 130 + nxwelz_tracer_shift, 3) // n{isxz}welz: number of data elements per well in {ISXZ}WELL
.params_NCON (25, 41, 58 + 5*num_water_tracer) // n{isx}conz: number of data elements per completion in ICON
.params_GRPZ (getNGRPZ(nwgmax, ngmax, num_water_tracer, rspec))
.params_NWELZ (155 + num_tracer, 122 + 2*num_tracer, 130 + nxwelz_tracer_shift, 3) // n{isxz}welz: number of data elements per well in {ISXZ}WELL
.params_NCON (25, 41, 58 + 5*num_tracer) // n{isx}conz: number of data elements per completion in ICON
.params_GRPZ (getNGRPZ(nwgmax, ngmax, num_tracer, rspec))
.aquiferDimensions (inferAquiferDimensions(es, sched[lookup_step]))
.stepParam (num_solver_steps, report_step)
.tuningParam (getTuningPars(sched[lookup_step].tuning()))
.liftOptParam (getLiftOptPar(sched, report_step, lookup_step))
.wellSegDimensions (getWellSegDims(num_water_tracer, rspec, sched, report_step, lookup_step))
.wellSegDimensions (getWellSegDims(num_tracer, rspec, sched, report_step, lookup_step))
.regionDimensions (getRegDims(tdim, rdim))
.ngroups ({ ngmax })
.params_NGCTRL (GroupControl(sched, report_step, lookup_step))
Expand Down
4 changes: 2 additions & 2 deletions opm/output/eclipse/LoadRestart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1488,8 +1488,8 @@ namespace {

for (std::size_t tracer_index = 0; tracer_index < tracer_config.size(); tracer_index++) {
const auto& tracer_name = tracer_config[tracer_index].name;
auto wtpt_offset = VI::XWell::index::TracerOffset + tracer_dims.water_tracers();
auto wtit_offset = VI::XWell::index::TracerOffset + 2*tracer_dims.water_tracers();
auto wtpt_offset = VI::XWell::index::TracerOffset + tracer_dims.all_tracers();
auto wtit_offset = VI::XWell::index::TracerOffset + 2*tracer_dims.all_tracers();

smry.update_well_var(well, fmt::format("WTPT{}", tracer_name), xwel[wtpt_offset + tracer_index]);
smry.update_well_var(well, fmt::format("WTIT{}", tracer_name), xwel[wtit_offset + tracer_index]);
Expand Down