mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5925 NNC computations : Add flag in preferences to include inactive cells
This commit is contained in:
@@ -1279,7 +1279,12 @@ size_t RigCaseCellResultsData::findOrLoadKnownScalarResult( const RigEclipseResu
|
||||
else if ( resultName == RiaDefines::formationAllanResultName() ||
|
||||
resultName == RiaDefines::formationBinaryAllanResultName() )
|
||||
{
|
||||
computeAllanResults( this, m_ownerMainGrid );
|
||||
bool includeInactiveCells = false;
|
||||
if ( m_readerInterface.notNull() )
|
||||
{
|
||||
includeInactiveCells = m_readerInterface->includeInactiveCellsInFaultGeometry();
|
||||
}
|
||||
computeAllanResults( this, m_ownerMainGrid, includeInactiveCells );
|
||||
}
|
||||
}
|
||||
else if ( type == RiaDefines::ResultCatType::DYNAMIC_NATIVE )
|
||||
@@ -1313,8 +1318,8 @@ size_t RigCaseCellResultsData::findOrLoadKnownScalarResult( const RigEclipseResu
|
||||
{
|
||||
if ( this->mustBeCalculated( scalarResultIndex ) )
|
||||
{
|
||||
// Trigger loading of SWAT, SGAS to establish time step count if no data has been loaded from file at this
|
||||
// point
|
||||
// Trigger loading of SWAT, SGAS to establish time step count if no data has been loaded from file at
|
||||
// this point
|
||||
findOrLoadKnownScalarResult( RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SWAT" ) );
|
||||
findOrLoadKnownScalarResult( RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SGAS" ) );
|
||||
|
||||
@@ -1423,7 +1428,13 @@ size_t RigCaseCellResultsData::findOrLoadKnownScalarResult( const RigEclipseResu
|
||||
// Allan results
|
||||
if ( resultName == RiaDefines::formationAllanResultName() || resultName == RiaDefines::formationBinaryAllanResultName() )
|
||||
{
|
||||
computeAllanResults( this, m_ownerMainGrid );
|
||||
bool includeInactiveCells = false;
|
||||
if ( m_readerInterface.notNull() )
|
||||
{
|
||||
includeInactiveCells = m_readerInterface->includeInactiveCellsInFaultGeometry();
|
||||
}
|
||||
|
||||
computeAllanResults( this, m_ownerMainGrid, includeInactiveCells );
|
||||
}
|
||||
|
||||
// Handle SourSimRL reading
|
||||
@@ -3083,7 +3094,9 @@ RigStatisticsDataCache* RigCaseCellResultsData::statistics( const RigEclipseResu
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigCaseCellResultsData::computeAllanResults( RigCaseCellResultsData* cellResultsData, RigMainGrid* mainGrid )
|
||||
void RigCaseCellResultsData::computeAllanResults( RigCaseCellResultsData* cellResultsData,
|
||||
RigMainGrid* mainGrid,
|
||||
bool includeInactiveCells )
|
||||
{
|
||||
CVF_ASSERT( mainGrid );
|
||||
CVF_ASSERT( cellResultsData );
|
||||
@@ -3094,7 +3107,7 @@ void RigCaseCellResultsData::computeAllanResults( RigCaseCellResultsData* cellRe
|
||||
// If import of NNC is disabled in preferences, we must make ensure that computed NNC connections are in place
|
||||
if ( mainGrid->nncData()->nativeConnectionCount() == mainGrid->nncData()->connections().size() )
|
||||
{
|
||||
mainGrid->nncData()->computeCompleteSetOfNncs( mainGrid, cellResultsData->activeCellInfo() );
|
||||
mainGrid->nncData()->computeCompleteSetOfNncs( mainGrid, cellResultsData->activeCellInfo(), includeInactiveCells );
|
||||
mainGrid->distributeNNCsToFaults();
|
||||
}
|
||||
|
||||
|
||||
@@ -191,7 +191,8 @@ private:
|
||||
|
||||
RigStatisticsDataCache* statistics( const RigEclipseResultAddress& resVarAddr );
|
||||
|
||||
static void computeAllanResults( RigCaseCellResultsData* cellResultsData, RigMainGrid* mainGrid );
|
||||
static void
|
||||
computeAllanResults( RigCaseCellResultsData* cellResultsData, RigMainGrid* mainGrid, bool includeInactiveCells );
|
||||
|
||||
private:
|
||||
cvf::ref<RifReaderInterface> m_readerInterface;
|
||||
|
||||
@@ -43,7 +43,7 @@ cvf::StructGridInterface::FaceType
|
||||
{
|
||||
// Try to find the shared face
|
||||
|
||||
bool isPossibleNeighborInDirection[6] = { true, true, true, true, true, true };
|
||||
bool isPossibleNeighborInDirection[6] = {true, true, true, true, true, true};
|
||||
|
||||
if ( c1.hostGrid() == c2.hostGrid() )
|
||||
{
|
||||
@@ -143,7 +143,8 @@ void assignThreadConnections( std::set<std::pair<size_t, size_t>>& existingPairs
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigConnectionContainer RigCellFaceGeometryTools::computeOtherNncs( const RigMainGrid* mainGrid,
|
||||
const RigConnectionContainer& nativeConnections,
|
||||
const RigActiveCellInfo* activeCellInfo )
|
||||
const RigActiveCellInfo* activeCellInfo,
|
||||
bool includeInactiveCells )
|
||||
{
|
||||
// Compute Non-Neighbor Connections (NNC) not reported by Eclipse. NNCs with zero transmissibility are not reported
|
||||
// by Eclipse. Use faults as basis for subset of cells to find NNC connection for. The imported connections from
|
||||
@@ -185,7 +186,7 @@ RigConnectionContainer RigCellFaceGeometryTools::computeOtherNncs( const RigMain
|
||||
const RigFault::FaultFace& f = faultFaces[faceIdx];
|
||||
|
||||
bool atLeastOneCellActive = true;
|
||||
if ( activeCellInfo && activeCellInfo->reservoirActiveCellCount() > 0u )
|
||||
if ( !includeInactiveCells && activeCellInfo && activeCellInfo->reservoirActiveCellCount() > 0u )
|
||||
{
|
||||
atLeastOneCellActive = activeCellInfo->isActive( f.m_nativeReservoirCellIndex ) ||
|
||||
activeCellInfo->isActive( f.m_oppositeReservoirCellIndex );
|
||||
|
||||
@@ -48,7 +48,8 @@ public:
|
||||
|
||||
static RigConnectionContainer computeOtherNncs( const RigMainGrid* mainGrid,
|
||||
const RigConnectionContainer& nativeConnections,
|
||||
const RigActiveCellInfo* activeCellInfo );
|
||||
const RigActiveCellInfo* activeCellInfo,
|
||||
bool includeInactiveCells );
|
||||
|
||||
static RigConnectionContainer extractConnectionsForFace( const RigFault::FaultFace& face,
|
||||
const RigMainGrid* mainGrid,
|
||||
|
||||
@@ -413,7 +413,7 @@ bool RigMainGrid::hasFaultWithName( const QString& name ) const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigMainGrid::calculateFaults( const RigActiveCellInfo* activeCellInfo, bool computeNncs )
|
||||
void RigMainGrid::calculateFaults( const RigActiveCellInfo* activeCellInfo, bool computeNncs, bool includeInactiveCells )
|
||||
{
|
||||
if ( hasFaultWithName( RiaDefines::undefinedGridFaultName() ) &&
|
||||
hasFaultWithName( RiaDefines::undefinedGridFaultWithInactiveName() ) )
|
||||
@@ -558,7 +558,7 @@ void RigMainGrid::calculateFaults( const RigActiveCellInfo* activeCellInfo, bool
|
||||
|
||||
if ( computeNncs )
|
||||
{
|
||||
this->nncData()->computeCompleteSetOfNncs( this, activeCellInfo );
|
||||
this->nncData()->computeCompleteSetOfNncs( this, activeCellInfo, includeInactiveCells );
|
||||
}
|
||||
|
||||
distributeNNCsToFaults();
|
||||
|
||||
@@ -70,7 +70,7 @@ public:
|
||||
void setFaults( const cvf::Collection<RigFault>& faults );
|
||||
const cvf::Collection<RigFault>& faults() const;
|
||||
cvf::Collection<RigFault>& faults();
|
||||
void calculateFaults( const RigActiveCellInfo* activeCellInfo, bool computeNncs );
|
||||
void calculateFaults( const RigActiveCellInfo* activeCellInfo, bool computeNncs, bool includeInactiveCells );
|
||||
|
||||
void distributeNNCsToFaults();
|
||||
|
||||
|
||||
@@ -75,12 +75,14 @@ void RigNNCData::processNativeConnections( const RigMainGrid& mainGrid )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigNNCData::computeCompleteSetOfNncs( const RigMainGrid* mainGrid, const RigActiveCellInfo* activeCellInfo )
|
||||
void RigNNCData::computeCompleteSetOfNncs( const RigMainGrid* mainGrid,
|
||||
const RigActiveCellInfo* activeCellInfo,
|
||||
bool includeInactiveCells )
|
||||
{
|
||||
m_nativeConnectionCount = m_connections.size();
|
||||
|
||||
RigConnectionContainer otherConnections =
|
||||
RigCellFaceGeometryTools::computeOtherNncs( mainGrid, m_connections, activeCellInfo );
|
||||
RigCellFaceGeometryTools::computeOtherNncs( mainGrid, m_connections, activeCellInfo, includeInactiveCells );
|
||||
|
||||
if ( !otherConnections.empty() )
|
||||
{
|
||||
|
||||
@@ -50,7 +50,9 @@ public:
|
||||
RigNNCData();
|
||||
|
||||
void processNativeConnections( const RigMainGrid& mainGrid );
|
||||
void computeCompleteSetOfNncs( const RigMainGrid* mainGrid, const RigActiveCellInfo* activeCellInfo );
|
||||
void computeCompleteSetOfNncs( const RigMainGrid* mainGrid,
|
||||
const RigActiveCellInfo* activeCellInfo,
|
||||
bool includeInactiveCells );
|
||||
|
||||
void setConnections( RigConnectionContainer& connections );
|
||||
size_t nativeConnectionCount() const;
|
||||
|
||||
Reference in New Issue
Block a user