From 3a99b4170bdfd1f06aaaae627d32ef37c71ef1a0 Mon Sep 17 00:00:00 2001 From: Svenn Tveit Date: Tue, 21 May 2024 19:07:59 +0200 Subject: [PATCH] Included all tracers from TRACERS keyword --- opm/input/eclipse/EclipseState/Runspec.cpp | 4 ++-- opm/input/eclipse/EclipseState/Runspec.hpp | 2 +- opm/io/eclipse/rst/well.cpp | 2 +- opm/output/eclipse/AggregateMSWData.cpp | 2 +- opm/output/eclipse/AggregateWellData.cpp | 8 ++++---- opm/output/eclipse/CreateInteHead.cpp | 20 ++++++++++---------- opm/output/eclipse/LoadRestart.cpp | 4 ++-- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/opm/input/eclipse/EclipseState/Runspec.cpp b/opm/input/eclipse/EclipseState/Runspec.cpp index d482891a75b..7660713c9ce 100644 --- a/opm/input/eclipse/EclipseState/Runspec.cpp +++ b/opm/input/eclipse/EclipseState/Runspec.cpp @@ -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; } diff --git a/opm/input/eclipse/EclipseState/Runspec.hpp b/opm/input/eclipse/EclipseState/Runspec.hpp index 284ef6f2164..dc8b06ddacf 100644 --- a/opm/input/eclipse/EclipseState/Runspec.hpp +++ b/opm/input/eclipse/EclipseState/Runspec.hpp @@ -449,7 +449,7 @@ class Tracers { Tracers() = default; explicit Tracers(const Deck& ); - int water_tracers() const; + int all_tracers() const; template void serializeOp(Serializer& serializer) { diff --git a/opm/io/eclipse/rst/well.cpp b/opm/io/eclipse/rst/well.cpp index 3e6a6f8b19b..fda4c1820b6 100644 --- a/opm/io/eclipse/rst/well.cpp +++ b/opm/io/eclipse/rst/well.cpp @@ -184,7 +184,7 @@ Opm::RestartIO::RstWell::RstWell(const UnitSystem& unit_system, { for (std::size_t tracer_index = 0; - tracer_index < static_cast(header.runspec.tracers().water_tracers()); + tracer_index < static_cast(header.runspec.tracers().all_tracers()); ++tracer_index) { this->tracer_concentration_injection.push_back(swel[VI::SWell::TracerOffset + tracer_index]); diff --git a/opm/output/eclipse/AggregateMSWData.cpp b/opm/output/eclipse/AggregateMSWData.cpp index 61a1cfcf24e..60315304f79 100644 --- a/opm/output/eclipse/AggregateMSWData.cpp +++ b/opm/output/eclipse/AggregateMSWData.cpp @@ -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); } diff --git a/opm/output/eclipse/AggregateWellData.cpp b/opm/output/eclipse/AggregateWellData.cpp index 28377ef8d0b..43946624af0 100644 --- a/opm/output/eclipse/AggregateWellData.cpp +++ b/opm/output/eclipse/AggregateWellData.cpp @@ -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; @@ -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; @@ -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); @@ -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; } diff --git a/opm/output/eclipse/CreateInteHead.cpp b/opm/output/eclipse/CreateInteHead.cpp index 9c18b761277..0f9ae18a9af 100644 --- a/opm/output/eclipse/CreateInteHead.cpp +++ b/opm/output/eclipse/CreateInteHead.cpp @@ -307,7 +307,7 @@ namespace { std::array 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(); @@ -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 {{ @@ -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, @@ -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) }; } @@ -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()) @@ -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)) diff --git a/opm/output/eclipse/LoadRestart.cpp b/opm/output/eclipse/LoadRestart.cpp index 0bd1be413cc..712a2038369 100644 --- a/opm/output/eclipse/LoadRestart.cpp +++ b/opm/output/eclipse/LoadRestart.cpp @@ -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]);