///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2020- 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 "RiaDefines.h" #include "RiaPorosityModel.h" #include "CompletionExportCommands/RicExportCompletionDataSettingsUi.h" #include "ExportCommands/RicLgrSplitType.h" #include "FractureCommands/RicCreateMultipleFracturesFeature.h" #include "cafAppEnum.h" #include "cafPdmField.h" #include "cafPdmObjectHandle.h" #include "cafPdmObjectMethod.h" #include "cafPdmPtrArrayField.h" #include "cafPdmPtrField.h" #include class RimCellFilter; class RimFractureTemplate; class RimWellPath; //================================================================================================== /// //================================================================================================== class RimcEclipseCase_importProperties : public caf::PdmObjectMethod { CAF_PDM_HEADER_INIT; public: RimcEclipseCase_importProperties( caf::PdmObjectHandle* self ); std::expected execute() override; QString classKeywordReturnedType() const override; private: caf::PdmField> m_fileNames; }; //================================================================================================== /// //================================================================================================== class RimcEclipseCase_exportValuesInternal : public caf::PdmVoidObjectMethod { CAF_PDM_HEADER_INIT; public: RimcEclipseCase_exportValuesInternal( caf::PdmObjectHandle* self ); std::expected execute() override; private: caf::PdmField m_coordinateX; caf::PdmField m_coordinateY; caf::PdmField m_coordinateZ; caf::PdmField m_propertyType; caf::PdmField m_propertyName; caf::PdmField m_timeStep; caf::PdmField m_porosityModel; caf::PdmField m_resultKey; }; //================================================================================================== /// //================================================================================================== class RimcEclipseCase_exportCornerPointGridInternal : public caf::PdmVoidObjectMethod { CAF_PDM_HEADER_INIT; public: RimcEclipseCase_exportCornerPointGridInternal( caf::PdmObjectHandle* self ); std::expected execute() override; private: caf::PdmField m_zcornKey; caf::PdmField m_coordKey; caf::PdmField m_actnumKey; }; //================================================================================================== /// //================================================================================================== class RimcEclipseCase_addResultAlias : public caf::PdmVoidObjectMethod { CAF_PDM_HEADER_INIT; public: RimcEclipseCase_addResultAlias( caf::PdmObjectHandle* self ); std::expected execute() override; private: caf::PdmField m_resultName; caf::PdmField m_aliasName; }; //================================================================================================== /// //================================================================================================== class RimcEclipseCase_clearResultAliases : public caf::PdmVoidObjectMethod { CAF_PDM_HEADER_INIT; public: RimcEclipseCase_clearResultAliases( caf::PdmObjectHandle* self ); std::expected execute() override; }; //================================================================================================== /// Return the data type (one of caf::AppEnum) of a grid property. /// Inverse of the data_type flag passed to set_active_cell_property / set_grid_property. //================================================================================================== class RimcEclipseCase_propertyDataType : public caf::PdmEnumObjectMethod { CAF_PDM_HEADER_INIT; public: explicit RimcEclipseCase_propertyDataType( caf::PdmObjectHandle* self ); std::expected executeEnum() override; QString returnEnumScriptName() const override { return "PropertyDataType"; } private: caf::PdmField> m_propertyType; caf::PdmField m_propertyName; caf::PdmField> m_porosityModel; }; //================================================================================================== /// Apply a cell filter to this case for a given grid + time step and write a per-cell 0/1 mask /// (1 = passes the filter, 0 = filtered out) to the key-value store under m_maskKey. The vector /// length and ordering match case.grid_property(..., grid_index) so the two can be combined /// element-wise. //================================================================================================== class RimcEclipseCase_filteredCellsInternal : public caf::PdmVoidObjectMethod { CAF_PDM_HEADER_INIT; public: RimcEclipseCase_filteredCellsInternal( caf::PdmObjectHandle* self ); std::expected execute() override; private: caf::PdmPtrField m_filter; caf::PdmField m_maskKey; caf::PdmField m_timeStep; caf::PdmField m_gridIndex; }; //================================================================================================== /// Export a cell property (static or dynamic, matrix model) of the case to a GRDECL style text file. //================================================================================================== class RimEclipseCase_exportProperty : public caf::PdmVoidObjectMethod { CAF_PDM_HEADER_INIT; public: RimEclipseCase_exportProperty( caf::PdmObjectHandle* self ); void setTimeStep( int timeStep ); void setPropertyName( const QString& propertyName ); void setEclipseKeyword( const QString& eclipseKeyword ); void setUndefinedValue( double undefinedValue ); void setExportFile( const QString& exportFile ); std::expected execute() override; private: caf::PdmField m_timeStep; caf::PdmField m_propertyName; caf::PdmField m_eclipseKeyword; caf::PdmField m_undefinedValue; caf::PdmField m_exportFile; }; //================================================================================================== /// Export completion data (COMPDAT, WELSPECS, MSW keywords etc.) for well paths in this case. //================================================================================================== class RimEclipseCase_exportCompletions : public caf::PdmVoidObjectMethod { CAF_PDM_HEADER_INIT; public: RimEclipseCase_exportCompletions( caf::PdmObjectHandle* self ); void setWellPaths( const std::vector& wellPaths ); void setTimeStep( int timeStep ); void setExportFolder( const QString& exportFolder ); void setCustomFileName( const QString& customFileName ); void setFileSplit( RicExportCompletionDataSettingsUi::ExportSplit fileSplit ); void setCompdatExport( RicExportCompletionDataSettingsUi::CompdatExport compdatExport ); void setIncludeMsw( bool enable ); void setUseNtgHorizontally( bool enable ); void setIncludePerforations( bool enable ); void setIncludeFishbones( bool enable ); void setIncludeFractures( bool enable ); void setExcludeMainBoreForFishbones( bool enable ); void setPerformTransScaling( bool enable ); void setTransScalingTimeStep( int timeStep ); void setTransScalingWbhpSource( RicExportFractureCompletionsImpl::PressureDepletionWBHPSource source ); void setTransScalingWbhp( double wbhp ); void setExportComments( bool enable ); void setExportWelspec( bool enable ); std::expected execute() override; private: caf::PdmPtrArrayField m_wellPaths; caf::PdmField m_timeStep; caf::PdmField m_exportFolder; caf::PdmField m_customFileName; caf::PdmField m_fileSplit; caf::PdmField m_compdatExport; caf::PdmField m_includeMsw; caf::PdmField m_useNtgHorizontally; caf::PdmField m_includePerforations; caf::PdmField m_includeFishbones; caf::PdmField m_includeFractures; caf::PdmField m_excludeMainBoreForFishbones; caf::PdmField m_performTransScaling; caf::PdmField m_transScalingTimeStep; caf::PdmField m_transScalingWbhpSource; caf::PdmField m_transScalingWbhp; caf::PdmField m_exportComments; caf::PdmField m_exportWelspec; }; //================================================================================================== /// Export the Multi Segment Well (MSW) model keywords (WELSEGS, COMPSEGS, ...) for well paths in this case. //================================================================================================== class RimEclipseCase_exportMswCompletions : public caf::PdmVoidObjectMethod { CAF_PDM_HEADER_INIT; public: RimEclipseCase_exportMswCompletions( caf::PdmObjectHandle* self ); void setWellPaths( const std::vector& wellPaths ); void setExportFolder( const QString& exportFolder ); void setFileSplit( RicExportCompletionDataSettingsUi::ExportSplit fileSplit ); void setIncludePerforations( bool enable ); void setIncludeFishbones( bool enable ); void setIncludeFractures( bool enable ); std::expected execute() override; private: caf::PdmPtrArrayField m_wellPaths; caf::PdmField m_exportFolder; caf::PdmField m_fileSplit; caf::PdmField m_includePerforations; caf::PdmField m_includeFishbones; caf::PdmField m_includeFractures; }; //================================================================================================== /// Create temporary local grid refinements (LGRs) around the completions of the given well paths. /// Existing temporary LGRs in the case are deleted first. //================================================================================================== class RimEclipseCase_createLgrForCompletions : public caf::PdmVoidObjectMethod { CAF_PDM_HEADER_INIT; public: RimEclipseCase_createLgrForCompletions( caf::PdmObjectHandle* self ); void setWellPaths( const std::vector& wellPaths ); void setTimeStep( int timeStep ); void setRefinement( int refinementI, int refinementJ, int refinementK ); void setSplitType( Lgr::SplitType splitType ); std::expected execute() override; /// Wells skipped because they intersect existing LGRs. Valid after execute(). QStringList wellsIntersectingOtherLgrs() const; private: caf::PdmPtrArrayField m_wellPaths; caf::PdmField m_timeStep; caf::PdmField m_refinementI; caf::PdmField m_refinementJ; caf::PdmField m_refinementK; caf::PdmField m_splitType; QStringList m_wellsIntersectingOtherLgrs; }; //================================================================================================== /// Export local grid refinements (LGRs) around the completions of the given well paths to CARFIN files. //================================================================================================== class RimEclipseCase_exportLgrForCompletions : public caf::PdmVoidObjectMethod { CAF_PDM_HEADER_INIT; public: RimEclipseCase_exportLgrForCompletions( caf::PdmObjectHandle* self ); void setWellPaths( const std::vector& wellPaths ); void setTimeStep( int timeStep ); void setExportFolder( const QString& exportFolder ); void setRefinement( int refinementI, int refinementJ, int refinementK ); void setSplitType( Lgr::SplitType splitType ); std::expected execute() override; /// Wells skipped because they intersect existing LGRs. Valid after execute(). QStringList wellsIntersectingOtherLgrs() const; private: caf::PdmPtrArrayField m_wellPaths; caf::PdmField m_timeStep; caf::PdmField m_exportFolder; caf::PdmField m_refinementI; caf::PdmField m_refinementJ; caf::PdmField m_refinementK; caf::PdmField m_splitType; QStringList m_wellsIntersectingOtherLgrs; }; //================================================================================================== /// Create multiple fractures along the given well paths using a fracture template. //================================================================================================== class RimEclipseCase_createMultipleFractures : public caf::PdmVoidObjectMethod { CAF_PDM_HEADER_INIT; public: RimEclipseCase_createMultipleFractures( caf::PdmObjectHandle* self ); void setWellPaths( const std::vector& wellPaths ); void setFractureTemplate( RimFractureTemplate* fractureTemplate ); void setMinDistFromWellTd( double minDist ); void setMaxFracturesPerWell( int maxFractures ); void setTopLayer( int topLayer ); void setBaseLayer( int baseLayer ); void setSpacing( double spacing ); void setAction( MultipleFractures::Action action ); std::expected execute() override; private: caf::PdmPtrArrayField m_wellPaths; caf::PdmPtrField m_fractureTemplate; caf::PdmField m_minDistFromWellTd; caf::PdmField m_maxFracturesPerWell; caf::PdmField m_topLayer; caf::PdmField m_baseLayer; caf::PdmField m_spacing; caf::PdmField> m_action; }; //================================================================================================== /// Export flow characteristics (Lorenz coefficient, flow capacity/storage capacity and sweep /// efficiency) computed by flow diagnostics to a text file. //================================================================================================== class RimEclipseResultCase_exportFlowCharacteristics : public caf::PdmVoidObjectMethod { CAF_PDM_HEADER_INIT; public: RimEclipseResultCase_exportFlowCharacteristics( caf::PdmObjectHandle* self ); void setTimeSteps( const std::vector& timeSteps ); void setInjectors( const std::vector& injectors ); void setProducers( const std::vector& producers ); void setFileName( const QString& fileName ); void setMinimumCommunication( double minimumCommunication ); void setAquiferCellThreshold( double aquiferCellThreshold ); std::expected execute() override; private: caf::PdmField> m_timeSteps; caf::PdmField> m_injectors; caf::PdmField> m_producers; caf::PdmField m_fileName; caf::PdmField m_minimumCommunication; caf::PdmField m_aquiferCellThreshold; }; //================================================================================================== /// Create saturation pressure plots (PRESSURE vs PBUB/PDEW per EQUIL region) for the case. //================================================================================================== class RimEclipseResultCase_createSaturationPressurePlots : public caf::PdmVoidObjectMethod { CAF_PDM_HEADER_INIT; public: RimEclipseResultCase_createSaturationPressurePlots( caf::PdmObjectHandle* self ); void setTimeStep( int timeStep ); std::expected execute() override; private: caf::PdmField m_timeStep; };