#13713 RifReaderOpmCommon: Fix ACTNUM showing undefined when only stored in EGRID

ACTNUM is always present in the EGRID file, but not always in the INIT
file. The OPM reader's staticResult() searched only the INIT file, so
models that omit ACTNUM from INIT returned an empty result vector,
causing all cells to display as undefined.

Fix by deriving ACTNUM values directly from the active cell info, which
is populated from the EGRID during grid import via transferActiveCells().
This commit is contained in:
Magne Sjaastad committed 2026-03-10 13:18:14 +01:00
1 parent 85b3ad4cf5
commit e21097a2fc
1 file changed
+10
@@ -604,6 +604,16 @@ void RifReaderOpmCommon::transferGeometry( Opm::EclIO::EGrid& opmMainGrid,
//--------------------------------------------------------------------------------------------------
bool RifReaderOpmCommon::staticResult( const QString& result, RiaDefines::PorosityModelType matrixOrFracture, std::vector<double>* values )
{
// Active cell info is populated from the EGRID during grid import via transferActiveCells(), which reads ACTNUM from the OPM EGrid
// object. Most simulators also write it to INIT, but some do not. Derive the values directly from the active cell info to handle both
// cases consistently.
if ( result.compare( "ACTNUM", Qt::CaseInsensitive ) == 0 )
{
RigActiveCellInfo* activeCellInfo = m_eclipseCaseData->activeCellInfo( matrixOrFracture );
values->resize( activeCellInfo->reservoirActiveCellCount(), 1.0 );
return true;
}
if ( m_initFile )
{
try