///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2025 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 #include #include #include #include #include namespace Opm { class FileDeck; class DeckKeyword; class DeckItem; class DeckRecord; class ParseContext; } // namespace Opm namespace RigEclipseResultTools { struct BorderCellFace; } //================================================================================================== /// /// //================================================================================================== class RifOpmFlowDeckFile { public: RifOpmFlowDeckFile(); ~RifOpmFlowDeckFile(); bool loadDeck( std::string filename ); bool saveDeck( std::string folder, std::string filename ); bool mergeWellDeckAtTimeStep( int timeStep, std::string filename ); int mergeWellDeckAtPosition( int position, std::string filename ); bool mergeMswData( std::vector& mswFileData ); bool openWellAtTimeStep( int timeStep, Opm::DeckKeyword& openKeyword ); bool openWellAtDeckPosition( int deckPosition, Opm::DeckKeyword& openKeyword ); bool restartAtTimeStep( int timeStep, std::string deckName ); bool stopAtTimeStep( int timeStep ); std::vector keywords( bool includeDates = true ); bool hasDatesKeyword(); bool isRestartFile(); std::vector dateStrings(); std::vector dates(); bool appendDateKeywords( const std::vector& dates ); std::set wellGroupsInFile(); std::vector welldims(); bool setWelldims( int maxWells, int maxConnections, int maxGroups, int maxWellsInGroup ); std::vector regdims(); bool setRegdims( int maxRegions, int maxRegionDefinitions, int maxRegionFlowConnections, int maxFIPRegions ); bool ensureRegdimsKeyword(); bool addIncludeKeyword( std::string section, std::string keyword, std::string filePath ); bool addOperaterKeyword( std::string section, std::string targetProperty, int regionId, std::string equation, std::string inputProperty, std::optional alpha, std::optional beta ); bool addBcconKeyword( std::string section, const std::vector& borderCellFaces ); bool addBcpropKeyword( std::string section, const std::vector& boundaryConditions, const std::vector& boundaryConditionProperties ); bool replaceKeywordData( const std::string& keyword, const std::vector& data ); bool replaceKeywordData( const std::string& keyword, const std::vector& data ); private: void splitDatesIfNecessary(); private: std::unique_ptr m_fileDeck; };