Add RimVfpTableData used to represent connection to file and data

Extract data management from RimVfpPlot. Use pointer from RimVfpPlot to RimVfpTableData.
This commit is contained in:
Magne Sjaastad
2024-05-13 08:54:40 +02:00
parent b8391e6f92
commit ff9b13163a
28 changed files with 1591 additions and 717 deletions

View File

@@ -85,94 +85,6 @@ Opm::VFPProdTable createProductionTable( const Opm::DeckKeyword& keyword )
return { keyword, gaslift_opt_active, unitSystem };
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<Opm::VFPInjTable> extractVfpInjectionTables( const std::string& filename )
{
std::vector<Opm::VFPInjTable> tables;
try
{
Opm::Parser parser( false );
const ::Opm::ParserKeywords::VFPINJ kw1;
const ::Opm::ParserKeywords::VFPIDIMS kw2;
parser.addParserKeyword( kw1 );
parser.addParserKeyword( kw2 );
auto deck = parser.parseFile( filename );
std::string keyword = ::Opm::ParserKeywords::VFPINJ::keywordName;
auto keywordList = deck.getKeywordList( keyword );
for ( auto kw : keywordList )
{
auto table = createInjectionTable( *kw );
tables.push_back( table );
}
}
catch ( Opm::OpmInputError& e )
{
QString text = QString( "Error detected when parsing '%1'. Imported data might be missing or incomplete.\n%2" )
.arg( QString::fromStdString( filename ) )
.arg( QString::fromStdString( e.what() ) );
RiaLogging::warning( text );
}
catch ( ... )
{
QString text =
QString( "Error detected when parsing '%1'. Imported data might be missing or incomplete." ).arg( QString::fromStdString( filename ) );
RiaLogging::warning( text );
}
return tables;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<Opm::VFPProdTable> extractVfpProductionTables( const std::string& filename )
{
std::vector<Opm::VFPProdTable> tables;
try
{
Opm::Parser parser( false );
const ::Opm::ParserKeywords::VFPPROD kw1;
parser.addParserKeyword( kw1 );
auto deck = parser.parseFile( filename );
std::string keyword = ::Opm::ParserKeywords::VFPPROD::keywordName;
auto keywordList = deck.getKeywordList( keyword );
for ( auto kw : keywordList )
{
auto table = createProductionTable( *kw );
tables.push_back( table );
}
}
catch ( Opm::OpmInputError& e )
{
QString text = QString( "Error detected when parsing '%1'. Imported data might be missing or incomplete.\n%2" )
.arg( QString::fromStdString( filename ) )
.arg( QString::fromStdString( e.what() ) );
RiaLogging::warning( text );
}
catch ( ... )
{
QString text =
QString( "Error detected when parsing '%1'. Imported data might be missing or incomplete." ).arg( QString::fromStdString( filename ) );
RiaLogging::warning( text );
}
return tables;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------