Skip to content

Commit fbbaefc

Browse files
committed
Review fixes 2
1 parent f57e51a commit fbbaefc

File tree

6 files changed

+8
-28
lines changed

6 files changed

+8
-28
lines changed

opm/input/eclipse/Schedule/MSW/Compsegs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ namespace {
370370
{
371371
std::vector<Record> compsegs;
372372

373-
for (auto [startMD, endMD, ijk] : segments_md_and_ijk) {
373+
for (const auto& [startMD, endMD, ijk] : segments_md_and_ijk) {
374374
// Defaulted values:
375375
auto direction = Connection::Direction::X;
376376
const double center_depth = 0.0;

opm/input/eclipse/Schedule/MSW/WellSegments.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,6 @@ namespace Opm {
189189
const std::vector<std::pair<double, double>>& lengths_and_depths,
190190
double diameter, const UnitSystem& unit_system)
191191
{
192-
// Only LengthDepth::ABS is supported:
193-
assert (this->m_length_depth_type == WellSegments::LengthDepth::ABS);
194-
195192
const int branchID = 1; // Only main branch for now.
196193

197194
const double roughness = 0.0; // Defaulted: ROUGHNESS in WELSEGS.
@@ -242,8 +239,6 @@ namespace Opm {
242239
const auto nodeX_top = record1.getItem("TOP_X").getSIDouble(0);
243240
const auto nodeY_top = record1.getItem("TOP_Y").getSIDouble(0);
244241

245-
this->m_length_depth_type = length_depth_type;
246-
247242
// The main branch is 1 instead of 0. The segment number for top
248243
// segment is also 1.
249244
if (length_depth_type == LengthDepth::INC) {

opm/input/eclipse/Schedule/MSW/WellSegments.hpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,6 @@ namespace Opm {
123123
serializer(m_comp_pressure_drop);
124124
serializer(m_segments);
125125
serializer(segment_number_to_index);
126-
serializer(m_length_depth_type);
127-
}
128-
129-
LengthDepth getLengthDepthType() const
130-
{
131-
return this->m_length_depth_type;
132126
}
133127

134128
private:
@@ -160,9 +154,6 @@ namespace Opm {
160154
// the mapping from the segment number to the
161155
// storage index in the vector
162156
std::map<int, int> segment_number_to_index{};
163-
164-
// The length/depth type, incremental or absolute
165-
LengthDepth m_length_depth_type{LengthDepth::ABS};
166157
};
167158
}
168159

opm/input/eclipse/Schedule/Well/GridIndependentWellKeywordHandlers.cpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2020 Statoil ASA.
2+
Copyright 2025 Equinor ASA.
33
44
This file is part of the Open Porous Media project (OPM).
55
@@ -81,9 +81,9 @@ void add_segments(HandlerContext& handlerContext,
8181
}
8282

8383

84-
void process_connections(HandlerContext& handlerContext,
85-
const std::string& name,
86-
const std::vector<std::tuple<double, double, std::array<int, 3>>> intersections_md_and_ijk)
84+
void process_segment_connections(HandlerContext& handlerContext,
85+
const std::string& name,
86+
const std::vector<std::tuple<double, double, std::array<int, 3>>>& intersections_md_and_ijk)
8787
{
8888
auto well = handlerContext.state().wells.get(name);
8989
auto [new_connections, new_segments] = Compsegs::getConnectionsAndSegmentsFromTrajectory(
@@ -103,11 +103,6 @@ void process_segments(HandlerContext& handlerContext, const std::string& name,
103103
{
104104
const auto& well = handlerContext.state().wells.get(name);
105105
if (well.isMultiSegment()) {
106-
// COMPTRAJ is in absolute units, INC in WELSEGS is not supported:
107-
if (well.getSegments().getLengthDepthType() == WellSegments::LengthDepth::INC) {
108-
const auto msg = fmt::format(" WELSEGS/{} defines segments as incremental (INC): only ABS allowed", name);
109-
throw Opm::OpmInputError(msg, handlerContext.keyword.location());
110-
}
111106
// For now, no segments may be defined via WELSEGS, except for the top:
112107
if (well.getSegments().size() > 1) {
113108
const auto msg = fmt::format(" {} already defines segments with the WELSEGS keyword", name);
@@ -116,7 +111,7 @@ void process_segments(HandlerContext& handlerContext, const std::string& name,
116111

117112
auto [intersections_md_and_ijk, cell_md_and_tvd] = get_segment_geometries(handlerContext, intersections, wellPathGeometry);
118113
add_segments(handlerContext, name, cell_md_and_tvd, diameter);
119-
process_connections(handlerContext, name, intersections_md_and_ijk);
114+
process_segment_connections(handlerContext, name, intersections_md_and_ijk);
120115
}
121116

122117
}

opm/input/eclipse/Schedule/Well/GridIndependentWellKeywordHandlers.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2020 Statoil ASA.
2+
Copyright 2025 Equinor ASA.
33
44
This file is part of the Open Porous Media project (OPM).
55
@@ -27,7 +27,7 @@
2727

2828
namespace Opm {
2929

30-
//! \brief Obtain a list of well completion keyword handlers.
30+
//! \brief Obtain a list of grid independent well keyword handlers.
3131
std::vector<std::pair<std::string,KeywordHandlers::handler_function>> getGridIndependentWellKeywordHandlers();
3232

3333
}

opm/input/eclipse/Schedule/Well/WellCompletionKeywordHandlers.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828

2929
#include <opm/input/eclipse/Parser/ParserKeywords/C.hpp>
3030

31-
3231
#include "../HandlerContext.hpp"
3332

3433
#include <fmt/format.h>

0 commit comments

Comments
 (0)