///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2017 Statoil 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 // for more details. // ///////////////////////////////////////////////////////////////////////////////// #pragma once #include "RigCompletionData.h" #include "RicExportCompletionDataSettingsUi.h" #include "cvfVector2.h" #include "cvfVector3.h" #include #include #include #include #include class RigCell; class RigEclipseCaseData; class RigMainGrid; class RimEclipseCase; class RimFishbones; class RimPerforationInterval; class RimWellPath; class RimWellPathValve; class RimWellPathFracture; class RimNonDarcyPerforationParameters; class RifTextDataTableFormatter; class RigVirtualPerforationTransmissibilities; class SubSegmentIntersectionInfo; //================================================================================================== /// //================================================================================================== using QFilePtr = std::shared_ptr; //================================================================================================== /// //================================================================================================== class RicWellPathExportCompletionDataFeatureImpl { public: static void exportCompletions( const std::vector& wellPaths, const RicExportCompletionDataSettingsUi& exportSettings ); static std::vector computeStaticCompletionsForWellPath( RimWellPath* wellPath, RimEclipseCase* eclipseCase ); static std::vector computeDynamicCompletionsForWellPath( RimWellPath* wellPath, RimEclipseCase* eclipseCase, size_t timeStepIndex ); static std::vector completionDataForWellPath( RimWellPath* wellPath, RimEclipseCase* eCase, const std::optional& exportDate = std::nullopt ); // Completion data for several well paths (including their laterals), combined per cell into one connection. // 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). static std::vector completionDataForWellPaths( const std::vector& wellPaths, RimEclipseCase* eCase, const std::optional& exportDate = std::nullopt ); static std::pair wellPathUpperGridIntersectionIJ( const RimEclipseCase* gridCase, const RimWellPath* wellPath, const QString& gridName = "" ); static std::optional exportDateForTimeStep( const RimEclipseCase* eclipseCase, size_t timeStepIndex ); private: static void exportWellPathFractureReport( RimEclipseCase* sourceCase, QFilePtr exportFile, const std::vector& wellPathFractureReportItems ); static void exportWelspecsToFile( RimEclipseCase* gridCase, QFilePtr exportFile, const std::vector& completions, bool exportDataSourceAsComment ); static void exportWelspeclToFile( RimEclipseCase* gridCase, QFilePtr exportFile, const std::map>& completions ); static void sortAndExportCompletionsToFile( RimEclipseCase* eclipseCase, const QString& exportFolder, const QString& fileName, const std::vector& completions, const std::vector& wellPathFractureReportItems, RicExportCompletionDataSettingsUi::CompdatExportType exportType, bool exportDataSourceAsComment, bool exportWelspec ); static void exportCompdatAndWpimultTables( RimEclipseCase* sourceCase, QFilePtr exportFile, const std::map>& completionsPerGrid, RicExportCompletionDataSettingsUi::CompdatExportType exportType, bool exportDataSourceAsComment ); static void exportCarfinForTemporaryLgrs( const RimEclipseCase* sourceCase, const QString& folder ); };