///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2018 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 // for more details. // ///////////////////////////////////////////////////////////////////////////////// #pragma once #include "RicMswBranch.h" #include "RicMswCompletions.h" #include "RicMswExportInfo.h" #include "RicMswSegment.h" #include #include class RicExportCompletionDataSettingsUi; class RigActiveCellInfo; class RimEclipseCase; class RimFishbones; class RimPerforationInterval; class RimWellPath; class RimWellPathFracture; class RimMswCompletionParameters; class RigWellPath; class RimModeledWellPath; struct WellPathCellIntersectionInfo; class QFile; class RicWellPathExportMswCompletionsImpl { private: public: static void exportWellSegmentsForAllCompletions( const RicExportCompletionDataSettingsUi& exportSettings, const std::vector& wellPaths ); static void exportWellSegmentsForFractures( RimEclipseCase* eclipseCase, std::shared_ptr exportFile, std::shared_ptr lgrExportFile, const RimWellPath* wellPath, bool exportDataSourceAsComment, bool completionSegmentsAfterMainBore ); static void exportWellSegmentsForFishbones( RimEclipseCase* eclipseCase, std::shared_ptr exportFile, std::shared_ptr lgrExportFile, const RimWellPath* wellPath, bool exportDataSourceAsComment, bool completionSegmentsAfterMainBore ); static void updateDataForMultipleItemsInSameGridCell( gsl::not_null branch ); static void exportWellSegmentsForPerforations( RimEclipseCase* eclipseCase, std::shared_ptr exportFile, std::shared_ptr lgrExportFile, const RimWellPath* wellPath, int timeStep, bool exportDataSourceAsComment, bool completionSegmentsAfterMainBore ); static void generateFishbonesMswExportInfoForWell( const RimEclipseCase* eclipseCase, const RimWellPath* wellPath, gsl::not_null exportInfo, gsl::not_null branch ); private: static void generateFishbonesMswExportInfo( const RimEclipseCase* eclipseCase, const RimWellPath* wellPath, double initialMD, const std::vector& cellIntersections, bool enableSegmentSplitting, gsl::not_null exportInfo, gsl::not_null branch ); static void generateFishbonesMswExportInfo( const RimEclipseCase* eclipseCase, const RimWellPath* wellPath, double initialMD, const std::vector& cellIntersections, const std::vector& fishbonesSubs, bool enableSegmentSplitting, gsl::not_null exportInfo, gsl::not_null branch ); static bool generateFracturesMswExportInfo( RimEclipseCase* eclipseCase, const RimWellPath* wellPath, double initialMD, const std::vector& cellIntersections, gsl::not_null exportInfo, gsl::not_null branch ); static bool generatePerforationsMswExportInfo( RimEclipseCase* eclipseCase, const RimWellPath* wellPath, int timeStep, double initialMD, const std::vector& cellIntersections, gsl::not_null exportInfo, gsl::not_null branch ); static std::vector generateCellSegments( const RimEclipseCase* eclipseCase, const RimWellPath* wellPath ); static double computeIntitialMeasuredDepth( const RimEclipseCase* eclipseCase, const RimWellPath* wellPath, const RimMswCompletionParameters* mswParameters, const std::vector& allIntersections ); static std::vector filterIntersections( const std::vector& intersections, double initialMD, gsl::not_null wellPathGeometry, gsl::not_null eclipseCase ); static std::pair calculateOverlapWithActiveCells( double startMD, double endMD, const std::vector& wellPathIntersections, const RigActiveCellInfo* activeCellInfo ); static void createWellPathSegments( gsl::not_null branch, const std::vector& cellSegmentIntersections, const std::vector& perforationIntervals, const RimWellPath* wellPath, int timeStep, const RimEclipseCase* eclipseCase, bool* foundSubGridIntersections ); static void createValveCompletions( gsl::not_null branch, const std::vector& perforationIntervals, const RimWellPath* wellPath, RiaDefines::EclipseUnitSystem unitSystem ); static void assignValveContributionsToSuperICDsOrAICDs( gsl::not_null branch, const std::vector& perforationIntervals, const std::vector& wellPathIntersections, const RigActiveCellInfo* activeCellInfo, RiaDefines::EclipseUnitSystem unitSystem ); static void moveIntersectionsToICVs( gsl::not_null branch, const std::vector& perforationIntervals, RiaDefines::EclipseUnitSystem unitSystem ); static void moveIntersectionsToSuperICDsOrAICDs( gsl::not_null branch ); static void assignFishbonesLateralIntersections( const RimEclipseCase* eclipseCase, const RimWellPath* wellPath, const RimFishbones* fishbonesSubs, gsl::not_null segment, bool* foundSubGridIntersections, double maxSegmentLength, RiaDefines::EclipseUnitSystem unitSystem ); static void assignFractureCompletionsToCellSegment( const RimEclipseCase* eclipseCase, const RimWellPath* wellPath, const RimWellPathFracture* fracture, const std::vector& completionData, gsl::not_null segment, bool* foundSubGridIntersections ); static std::vector generatePerforationIntersections( gsl::not_null wellPath, gsl::not_null perforationInterval, int timeStep, gsl::not_null eclipseCase ); static void assignPerforationIntersections( const std::vector& completionData, gsl::not_null perforationCompletion, const WellPathCellIntersectionInfo& cellIntInfo, double overlapStart, double overlapEnd, bool* foundSubGridIntersections ); static void assignBranchNumbersToPerforations( const RimEclipseCase* eclipseCase, gsl::not_null segment, gsl::not_null branchNumber ); static void assignBranchNumbersToOtherCompletions( const RimEclipseCase* eclipseCase, gsl::not_null segment, gsl::not_null branchNumber ); static void assignBranchNumbersToBranch( const RimEclipseCase* eclipseCase, RicMswExportInfo* exportInfo, gsl::not_null branch, gsl::not_null branchNumber ); static std::unique_ptr createChildMswBranch( const RimWellPath* childWellPath ); static std::vector wellPathsWithTieIn( const RimWellPath* wellPath ); };