mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Add support for grid import using opm-common
Add support for import of geometry and results for main grid. Currently no support for LGR. Add selection in Preferences to either use libecl or opm-common for grid import. If RESINSIGHT_DEVEL flag is set, display reader in an Eclipse case to make it possible to compare Eclipse and opm-common in same project. Add more includes to custom-opm-common to be able to support this functionality. opm-common is unchanged.
This commit is contained in:
@@ -837,62 +837,7 @@ bool RifReaderEclipseOutput::readActiveCellInfo()
|
||||
}
|
||||
}
|
||||
|
||||
size_t reservoirCellCount = 0;
|
||||
for ( const auto& actnumValues : actnumValuesPerGrid )
|
||||
{
|
||||
reservoirCellCount += actnumValues.size();
|
||||
}
|
||||
|
||||
// Check if number of cells is matching
|
||||
if ( m_eclipseCase->mainGrid()->globalCellArray().size() != reservoirCellCount )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
RigActiveCellInfo* activeCellInfo = m_eclipseCase->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL );
|
||||
RigActiveCellInfo* fractureActiveCellInfo = m_eclipseCase->activeCellInfo( RiaDefines::PorosityModelType::FRACTURE_MODEL );
|
||||
|
||||
activeCellInfo->setReservoirCellCount( reservoirCellCount );
|
||||
fractureActiveCellInfo->setReservoirCellCount( reservoirCellCount );
|
||||
activeCellInfo->setGridCount( actnumValuesPerGrid.size() );
|
||||
fractureActiveCellInfo->setGridCount( actnumValuesPerGrid.size() );
|
||||
|
||||
size_t cellIdx = 0;
|
||||
size_t globalActiveMatrixIndex = 0;
|
||||
size_t globalActiveFractureIndex = 0;
|
||||
|
||||
for ( size_t gridIndex = 0; gridIndex < actnumValuesPerGrid.size(); gridIndex++ )
|
||||
{
|
||||
size_t activeMatrixIndex = 0;
|
||||
size_t activeFractureIndex = 0;
|
||||
|
||||
std::vector<int>& actnumValues = actnumValuesPerGrid[gridIndex];
|
||||
|
||||
for ( int actnumValue : actnumValues )
|
||||
{
|
||||
if ( actnumValue == 1 || actnumValue == 3 )
|
||||
{
|
||||
activeCellInfo->setCellResultIndex( cellIdx, globalActiveMatrixIndex++ );
|
||||
activeMatrixIndex++;
|
||||
}
|
||||
|
||||
if ( actnumValue == 2 || actnumValue == 3 )
|
||||
{
|
||||
fractureActiveCellInfo->setCellResultIndex( cellIdx, globalActiveFractureIndex++ );
|
||||
activeFractureIndex++;
|
||||
}
|
||||
|
||||
cellIdx++;
|
||||
}
|
||||
|
||||
activeCellInfo->setGridActiveCellCounts( gridIndex, activeMatrixIndex );
|
||||
fractureActiveCellInfo->setGridActiveCellCounts( gridIndex, activeFractureIndex );
|
||||
}
|
||||
|
||||
activeCellInfo->computeDerivedData();
|
||||
fractureActiveCellInfo->computeDerivedData();
|
||||
|
||||
return true;
|
||||
return RifEclipseOutputFileTools::assignActiveCellData( actnumValuesPerGrid, m_eclipseCase );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -2109,7 +2054,7 @@ std::vector<RifKeywordValueCount>
|
||||
const RigActiveCellInfo* matrixActiveCellInfo,
|
||||
const RigActiveCellInfo* fractureActiveCellInfo,
|
||||
RiaDefines::PorosityModelType porosityModel,
|
||||
size_t timeStepCount ) const
|
||||
size_t timeStepCount )
|
||||
{
|
||||
CVF_ASSERT( matrixActiveCellInfo );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user