Skip to content
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
2 changes: 2 additions & 0 deletions CMakeLists_files.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ list(APPEND MAIN_SOURCE_FILES
opm/input/eclipse/EclipseState/SimulationConfig/RockConfig.cpp
opm/input/eclipse/EclipseState/SimulationConfig/SimulationConfig.cpp
opm/input/eclipse/EclipseState/SimulationConfig/ThresholdPressure.cpp
opm/input/eclipse/EclipseState/SummaryConfig/RegionVariableSupport.cpp
opm/input/eclipse/EclipseState/SummaryConfig/SummaryConfig.cpp
opm/input/eclipse/EclipseState/Tables/Aqudims.cpp
opm/input/eclipse/EclipseState/Tables/ColumnSchema.cpp
Expand Down Expand Up @@ -1011,6 +1012,7 @@ list(APPEND PUBLIC_HEADER_FILES
opm/input/eclipse/EclipseState/SimulationConfig/RockConfig.hpp
opm/input/eclipse/EclipseState/SimulationConfig/SimulationConfig.hpp
opm/input/eclipse/EclipseState/SimulationConfig/ThresholdPressure.hpp
opm/input/eclipse/EclipseState/SummaryConfig/RegionVariableSupport.hpp
opm/input/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp
opm/input/eclipse/EclipseState/Tables/Aqudims.hpp
opm/input/eclipse/EclipseState/Tables/AqutabTable.hpp
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
Copyright 2026 Equinor 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/input/eclipse/EclipseState/SummaryConfig/RegionVariableSupport.hpp>

#include <opm/output/data/RegionVariableMapping.hpp>

#include <opm/input/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>

namespace {
void populateOilEfficiencyVariables(const Opm::SummaryConfig& sumcfg,
Opm::data::RegionVariableMapping& regVarMap)
{
// FOEW, ROEW, ROEW_<REG>
const auto oew_kws = sumcfg.keywords(R"(*OEW*)");

if (oew_kws.empty()) {
// No *OEW* vectors requested. Nothing to do.
Comment on lines +30 to +34
return;
}

using RegSet = Opm::data::RegionVariableMapping::RegionSet;

regVarMap.add(Opm::data::RegionVariableMapping::Variable { "ConnOPT" },
/* is_cumulative = */ true);

for (const auto& oew_kw : oew_kws) {
if (oew_kw.category() == Opm::SummaryConfigNode::Category::Region) {
regVarMap.add(RegSet { oew_kw.fip_region() });
}
else {
// Not a region level vector. Typically FOEW. Ensure that
// we have FIPNUM for this case.
regVarMap.add(RegSet { "FIPNUM" });
}
}
}
} // Anonymous namespace

// ===========================================================================
// Public interface below separator
// ===========================================================================

void Opm::populateRegVarMapping(const SummaryConfig& sumcfg,
data::RegionVariableMapping& regVarMap)
{
populateOilEfficiencyVariables(sumcfg, regVarMap);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
Copyright 2026 Equinor 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_REGION_VARIABLE_SUPPORT_HPP
#define OPM_REGION_VARIABLE_SUPPORT_HPP

namespace Opm {
class SummaryConfig;
} // namespace Opm

namespace Opm::data {
class RegionVariableMapping;
} // namespace Opm::data

namespace Opm {
void populateRegVarMapping(const SummaryConfig& sumcfg,
data::RegionVariableMapping& regVarMap);
}

#endif // OPM_REGION_VARIABLE_SUPPORT_HPP