2018-01-31 07:55:24 +01:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// Copyright (C) 2017 Statoil ASA
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2018-01-31 07:55:24 +01:00
|
|
|
// 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.
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2018-01-31 07:55:24 +01:00
|
|
|
// 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.
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2018-01-31 07:55:24 +01:00
|
|
|
// for more details.
|
|
|
|
|
//
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "RigCompletionData.h"
|
|
|
|
|
|
|
|
|
|
#include "RicExportCompletionDataSettingsUi.h"
|
|
|
|
|
|
2018-11-26 12:46:32 +01:00
|
|
|
#include "cvfVector2.h"
|
2019-09-06 10:40:57 +02:00
|
|
|
#include "cvfVector3.h"
|
2018-01-31 07:55:24 +01:00
|
|
|
|
2026-01-23 08:50:46 +01:00
|
|
|
#include <QDateTime>
|
2020-10-06 12:37:16 +02:00
|
|
|
#include <QFile>
|
|
|
|
|
|
2018-08-29 13:36:33 +02:00
|
|
|
#include <memory>
|
2026-01-23 08:50:46 +01:00
|
|
|
#include <optional>
|
2019-09-06 10:40:57 +02:00
|
|
|
#include <vector>
|
2018-01-31 07:55:24 +01:00
|
|
|
|
|
|
|
|
class RigCell;
|
|
|
|
|
class RigEclipseCaseData;
|
|
|
|
|
class RigMainGrid;
|
|
|
|
|
class RimEclipseCase;
|
2021-02-26 14:27:59 +01:00
|
|
|
class RimFishbones;
|
2018-09-06 08:05:18 +02:00
|
|
|
class RimPerforationInterval;
|
2018-01-31 07:55:24 +01:00
|
|
|
class RimWellPath;
|
2018-12-03 15:37:50 +01:00
|
|
|
class RimWellPathValve;
|
2018-08-15 15:46:32 +02:00
|
|
|
class RimWellPathFracture;
|
2018-10-02 12:36:47 +02:00
|
|
|
class RimNonDarcyPerforationParameters;
|
2019-10-15 11:30:06 +02:00
|
|
|
class RifTextDataTableFormatter;
|
2018-03-12 11:07:46 +01:00
|
|
|
class RigVirtualPerforationTransmissibilities;
|
2018-09-24 11:17:48 +02:00
|
|
|
class SubSegmentIntersectionInfo;
|
2018-01-31 07:55:24 +01:00
|
|
|
|
2018-08-29 13:36:33 +02:00
|
|
|
//==================================================================================================
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2018-08-29 13:36:33 +02:00
|
|
|
//==================================================================================================
|
2023-04-14 14:07:45 +02:00
|
|
|
using QFilePtr = std::shared_ptr<QFile>;
|
2018-08-29 13:36:33 +02:00
|
|
|
|
2018-01-31 07:55:24 +01:00
|
|
|
//==================================================================================================
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2018-01-31 07:55:24 +01:00
|
|
|
//==================================================================================================
|
|
|
|
|
class RicWellPathExportCompletionDataFeatureImpl
|
|
|
|
|
{
|
|
|
|
|
public:
|
2025-02-03 18:19:03 +01:00
|
|
|
static void exportCompletions( const std::vector<RimWellPath*>& wellPaths, const RicExportCompletionDataSettingsUi& exportSettings );
|
2019-09-06 10:40:57 +02:00
|
|
|
|
2023-02-26 10:48:40 +01:00
|
|
|
static std::vector<RigCompletionData> computeStaticCompletionsForWellPath( RimWellPath* wellPath, RimEclipseCase* eclipseCase );
|
2019-09-06 10:40:57 +02:00
|
|
|
|
2020-02-12 11:43:15 +01:00
|
|
|
static std::vector<RigCompletionData>
|
|
|
|
|
computeDynamicCompletionsForWellPath( RimWellPath* wellPath, RimEclipseCase* eclipseCase, size_t timeStepIndex );
|
2019-09-06 10:40:57 +02:00
|
|
|
|
2026-01-23 08:50:46 +01:00
|
|
|
static std::vector<RigCompletionData>
|
|
|
|
|
completionDataForWellPath( RimWellPath* wellPath, RimEclipseCase* eCase, const std::optional<QDateTime>& exportDate = std::nullopt );
|
2025-09-25 12:23:40 +02:00
|
|
|
|
2026-10-12 14:16:50 +02:00
|
|
|
// Completion data for several well paths (including their laterals), combined per cell into one connection.
|
2026-10-20 13:06:00 +02:00
|
|
|
// Connections are ordered with each well path's mainbore connections first, followed by each lateral's
|
|
|
|
|
// (depth-first), matching ResInsight's internal completion ordering (see
|
|
|
|
|
// https://github.com/OPM/ResInsight/issues/14963).
|
2026-10-12 14:16:50 +02:00
|
|
|
static std::vector<RigCompletionData> completionDataForWellPaths( const std::vector<RimWellPath*>& wellPaths,
|
|
|
|
|
RimEclipseCase* eCase,
|
|
|
|
|
const std::optional<QDateTime>& exportDate = std::nullopt );
|
|
|
|
|
|
2026-06-20 11:49:52 +02:00
|
|
|
static std::pair<double, cvf::Vec2i>
|
|
|
|
|
wellPathUpperGridIntersectionIJ( const RimEclipseCase* gridCase, const RimWellPath* wellPath, const QString& gridName = "" );
|
2025-09-25 12:23:40 +02:00
|
|
|
|
2026-02-09 17:25:59 +01:00
|
|
|
static std::optional<QDateTime> exportDateForTimeStep( const RimEclipseCase* eclipseCase, size_t timeStepIndex );
|
|
|
|
|
|
2023-11-13 07:44:44 +01:00
|
|
|
private:
|
2023-02-26 10:48:40 +01:00
|
|
|
static void exportWellPathFractureReport( RimEclipseCase* sourceCase,
|
|
|
|
|
QFilePtr exportFile,
|
|
|
|
|
const std::vector<RicWellPathFractureReportItem>& wellPathFractureReportItems );
|
2018-08-29 14:16:20 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
static void exportWelspecsToFile( RimEclipseCase* gridCase,
|
|
|
|
|
QFilePtr exportFile,
|
2021-03-02 09:25:53 +01:00
|
|
|
const std::vector<RigCompletionData>& completions,
|
|
|
|
|
bool exportDataSourceAsComment );
|
2018-08-29 13:36:33 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
static void exportWelspeclToFile( RimEclipseCase* gridCase,
|
|
|
|
|
QFilePtr exportFile,
|
|
|
|
|
const std::map<QString, std::vector<RigCompletionData>>& completions );
|
2018-08-29 13:36:33 +02:00
|
|
|
|
2023-02-26 10:48:40 +01:00
|
|
|
static void sortAndExportCompletionsToFile( RimEclipseCase* eclipseCase,
|
|
|
|
|
const QString& exportFolder,
|
|
|
|
|
const QString& fileName,
|
|
|
|
|
const std::vector<RigCompletionData>& completions,
|
|
|
|
|
const std::vector<RicWellPathFractureReportItem>& wellPathFractureReportItems,
|
2021-03-02 09:25:53 +01:00
|
|
|
RicExportCompletionDataSettingsUi::CompdatExportType exportType,
|
2023-02-26 10:48:40 +01:00
|
|
|
bool exportDataSourceAsComment,
|
|
|
|
|
bool exportWelspec );
|
2018-01-31 07:55:24 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
static void exportCompdatAndWpimultTables( RimEclipseCase* sourceCase,
|
|
|
|
|
QFilePtr exportFile,
|
|
|
|
|
const std::map<QString, std::vector<RigCompletionData>>& completionsPerGrid,
|
2021-03-02 09:25:53 +01:00
|
|
|
RicExportCompletionDataSettingsUi::CompdatExportType exportType,
|
2023-02-26 10:48:40 +01:00
|
|
|
bool exportDataSourceAsComment );
|
2018-01-31 07:55:24 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
static void exportCarfinForTemporaryLgrs( const RimEclipseCase* sourceCase, const QString& folder );
|
2018-02-07 10:12:07 +01:00
|
|
|
};
|