Files
ResInsight/ApplicationLibCode/Commands/CompletionExportCommands/MswExport/RicWellPathExportMswGeometryPath.h
T
Magne Sjaastad f796801a7a #14496 MSW export: Assign branch ID to well path laterals before completions
Branch numbers are handed out from two counters. The well path laterals are numbered first, so that the main bore and the laterals occupy the lowest branch numbers. The completion branches (valves, fractures and fishbones) are numbered after all laterals, and are still listed immediately after the lateral they are connected to.

The multiple_laterals test project is reduced to a single Eclipse case, and is used by two new unit tests covering the branch numbers and the order the branches are listed in.
2026-08-10 09:42:17 +02:00

71 lines
3.9 KiB
C++

/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2026 Equinor ASA
//
// ResInsight 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.
//
// ResInsight 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 at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RicMswBranchBuilder.h"
#include "RicWellPathExportMswTableData.h"
#include "CompletionsMsw/RigMswSegment.h"
#include "CompletionsMsw/RigMswTableData.h"
#include <optional>
#include <vector>
#include <QDateTime>
class RimEclipseCase;
class RimWellPath;
class RigMainGrid;
//--------------------------------------------------------------------------------------------------
/// Free functions that implement the direct geometry path for MSW export.
/// These build WELSEGS/COMPSEGS/valve segment data directly from well-path geometry
//--------------------------------------------------------------------------------------------------
namespace RicWellPathExportMswGeometryPath
{
//--------------------------------------------------------------------------------------------------
/// Branch numbers are handed out from two separate counters. The well path laterals are numbered
/// first (lateralBranchNumber), so that the main bore and the laterals occupy the lowest branch
/// numbers. The completion branches follow (completionBranchNumber), but are listed immediately
/// after the lateral they are connected to.
//--------------------------------------------------------------------------------------------------
std::vector<RigMswBranch> buildLateralBranches( RimEclipseCase* eclipseCase,
const RimWellPath* wellPath,
const RigMainGrid* mainGrid,
int outletSegNum,
RicWellPathExportMswTableData::CompletionType completionType,
const std::optional<QDateTime>& exportDate,
int& segmentNumber,
int& lateralBranchNumber,
int& completionBranchNumber,
RiaDefines::EclipseUnitSystem unitSystem,
RicMswBranchBuilder::FishbonesExportContext& fishbonesContext );
RigMswWellExportData buildMswWellExportData( RimEclipseCase* eclipseCase,
const RimWellPath* wellPath,
double maxSegmentLength,
const std::vector<std::pair<double, double>>& customSegmentIntervals,
RicWellPathExportMswTableData::CompletionType completionType,
const std::optional<QDateTime>& exportDate );
RigMswTableData collectTableData( const RigMswWellExportData& exportData, RiaDefines::EclipseUnitSystem unitSystem );
} // namespace RicWellPathExportMswGeometryPath