From c3286d9a7e3e86d13cc9cefcd964a408f6c04f80 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Mon, 10 Nov 2025 13:18:32 +0100 Subject: [PATCH] Sector Export: changes to handle model5 from opm-tests. --- .../RicExportEclipseSectorModelFeature.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ApplicationLibCode/Commands/ExportCommands/RicExportEclipseSectorModelFeature.cpp b/ApplicationLibCode/Commands/ExportCommands/RicExportEclipseSectorModelFeature.cpp index 7dcbd5e3dd..e7ffe002c3 100644 --- a/ApplicationLibCode/Commands/ExportCommands/RicExportEclipseSectorModelFeature.cpp +++ b/ApplicationLibCode/Commands/ExportCommands/RicExportEclipseSectorModelFeature.cpp @@ -364,6 +364,8 @@ std::expected RicExportEclipseSectorModelFeature::exportSimulatio // TODO: fix this.. deckFile.removeKeywords( "MAPAXES" ); + deckFile.removeKeywords( "SPECGRID" ); + // Save the modified deck file to the export directory if ( !deckFile.saveDeck( outputFolder.toStdString(), outputFile.toStdString() ) ) { @@ -413,6 +415,13 @@ std::expected std::vector coords = convertToDoubleVector( coordArray ); std::vector zcorn = convertToDoubleVector( zcornArray ); + auto keywords = deckFile.keywords( false ); + if ( std::find( keywords.begin(), keywords.end(), "ACTNUM" ) == keywords.end() ) + { + Opm::DeckKeyword newKw( Opm::ParserKeyword( "ACTNUM" ) ); + deckFile.addKeyword( "GRID", newKw ); + } + if ( !deckFile.replaceKeywordData( "COORD", coords ) ) { return std::unexpected( "Failed to replace COORD keyword in deck file" ); @@ -1025,9 +1034,11 @@ std::expected RicExportEclipseSectorModelFeature::filterAndUpdate "COMPSEGS", "WCONHIST", "WCONINJH", + "WCONINJE", "WCONPROD", "WELSEGS", "WELSPECS", + "WELOPEN", "WELTARG", "WPAVEDEP", "WRFTPLT",