Allow setting well group for new well in job, with list of existing groups

This commit is contained in:
jonjenssen authored and JJ committed 2025-10-03 08:17:17 +02:00
1 parent e91ec80f89
commit a6da2ab30c
4 files changed
+88 -4

No files matched your search

@@ -533,6 +533,30 @@ bool RifOpmFlowDeckFile::isRestartFile()
return pos.has_value();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::set<std::string> RifOpmFlowDeckFile::wellGroupsInFile()
{
std::set<std::string> values;
if ( m_fileDeck.get() == nullptr ) return values;
for ( auto it = m_fileDeck->start(); it != m_fileDeck->stop(); it++ )
{
auto& kw = m_fileDeck->operator[]( it );
if ( kw.name() == Opm::ParserKeywords::WELSPECS::keywordName )
{
for ( int i = 0; i < (int)kw.size(); i++ )
{
auto& item = kw.getRecord( i ).getItem( Opm::ParserKeywords::WELSPECS::GROUP::itemName );
values.insert( item.get<std::string>( 0 ) );
}
}
}
return values;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -21,6 +21,7 @@
#include <ctime>
#include <memory>
#include <optional>
#include <set>
#include <string>
#include <vector>
@@ -61,6 +62,8 @@ public:
std::vector<std::string> dateStrings();
std::vector<std::time_t> dates();
std::set<std::string> wellGroupsInFile();
std::vector<int> welldims();
bool setWelldims( int maxWells, int maxConnections, int maxGroups, int maxWellsInGroup );