Simulation Input: set correct SPECGRID properties.

This commit is contained in:
Kristian Bendiksen committed 2025-11-19 16:47:27 +01:00
1 parent 59584b5681
commit eadfb4846d
1 file changed
+11 -2
@@ -108,8 +108,6 @@ std::expected<void, QString> RigSimulationInputTool::exportSimulationInput( RimE
// TODO: fix this..
deckFile.removeKeywords( "MAPAXES" );
deckFile.removeKeywords( "SPECGRID" );
// Save the modified deck file to the export directory
if ( !deckFile.saveDeckInline( outputFolder.toStdString(), outputFile.toStdString() ) )
{
@@ -147,6 +145,17 @@ std::expected<void, QString> RigSimulationInputTool::updateCornerPointGridInDeck
return std::unexpected( "Failed to replace DIMENS keyword in deck file" );
}
// SPECGRID has the same dimensions plus NUMRES and COORD_TYPE
// Format: NX NY NZ (use defaults for NUMRES (1) and COORD_TYPE: 'F'=Cartesian)
std::vector<int> specgrid = { static_cast<int>( gridAdapter.cellCountI() ),
static_cast<int>( gridAdapter.cellCountJ() ),
static_cast<int>( gridAdapter.cellCountK() ) };
if ( !deckFile.replaceKeywordData( "SPECGRID", specgrid ) )
{
return std::unexpected( "Failed to replace SPECGRID keyword in deck file" );
}
auto convertToDoubleVector = []( const std::vector<float>& vec )
{
std::vector<double> outVec;