Files
ResInsight/ApplicationLibCode/Commands/CompletionExportCommands/MswExport/RicWellPathExportMswGeometryPath.h
T
Magne Sjaastad 6e8e658f6d #14980: Remove global max segment length from segment collection
The global max segment length no longer exists, so segment subdivision is defined only by the segment intervals.
2026-10-19 21:13:13 +02:00

75 lines
4.2 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,
const std::vector<std::pair<double, double>>& customSegmentIntervals,
RicWellPathExportMswTableData::CompletionType completionType,
const std::optional<QDateTime>& exportDate );
//--------------------------------------------------------------------------------------------------
/// Collect the table data of the export. The segment of each COMPSEGS row is written to ISEG if
/// exportSegmentNumbers is set, otherwise the simulator assigns the segment.
//--------------------------------------------------------------------------------------------------
RigMswTableData
collectTableData( const RigMswWellExportData& exportData, RiaDefines::EclipseUnitSystem unitSystem, bool exportSegmentNumbers = false );
} // namespace RicWellPathExportMswGeometryPath