Export Completion: Fix missing segments and connections for LGR grids

* Compute characteristic cell size based on active cells
* Compute cell face normal based on a suitable active cells
Using all cells as basis for face normal is fragile. Some models have highly distorted/twisted cells, but all active cells should be geometrically more stable.
This commit is contained in:
Magne Sjaastad
2023-02-15 15:25:38 +01:00
committed by GitHub
parent a7acbe2c86
commit 20439e1da9
5 changed files with 163 additions and 98 deletions

View File

@@ -979,6 +979,27 @@ bool RimEclipseCase::openReserviorCase()
return false;
}
if ( eclipseCaseData() && eclipseCaseData()->mainGrid() &&
!eclipseCaseData()->mainGrid()->hasValidCharacteristicCellSizes() )
{
RigMainGrid* mainGrid = eclipseCaseData()->mainGrid();
auto activeCellInfo = eclipseCaseData()->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL );
if ( activeCellInfo )
{
std::vector<size_t> reservoirCellIndices;
for ( size_t i = 0; i < mainGrid->cellCount(); i++ )
{
if ( activeCellInfo->isActive( i ) )
{
reservoirCellIndices.push_back( i );
}
}
mainGrid->computeCharacteristicCellSize( reservoirCellIndices );
mainGrid->computeFaceNormalsDirection( reservoirCellIndices );
}
}
bool createPlaceholderEntries = true;
if ( dynamic_cast<RimEclipseStatisticsCase*>( this ) )
{