mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#478 Allowed static results (INIT-file) to not have values for LGRs
This commit is contained in:
parent
b305202a35
commit
5260a3f870
@ -1566,9 +1566,12 @@ void RifReaderEclipseOutput::readWellCells(const ecl_grid_type* mainEclGrid, boo
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
QStringList RifReaderEclipseOutput::validKeywordsForPorosityModel(const QStringList& keywords, const std::vector<size_t>& keywordDataItemCounts,
|
QStringList RifReaderEclipseOutput::validKeywordsForPorosityModel(const QStringList& keywords,
|
||||||
const RigActiveCellInfo* matrixActiveCellInfo, const RigActiveCellInfo* fractureActiveCellInfo,
|
const std::vector<size_t>& keywordDataItemCounts,
|
||||||
PorosityModelResultType porosityModel, size_t timeStepCount) const
|
const RigActiveCellInfo* matrixActiveCellInfo,
|
||||||
|
const RigActiveCellInfo* fractureActiveCellInfo,
|
||||||
|
PorosityModelResultType porosityModel,
|
||||||
|
size_t timeStepCount) const
|
||||||
{
|
{
|
||||||
CVF_ASSERT(matrixActiveCellInfo);
|
CVF_ASSERT(matrixActiveCellInfo);
|
||||||
|
|
||||||
@ -1636,6 +1639,23 @@ QStringList RifReaderEclipseOutput::validKeywordsForPorosityModel(const QStringL
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check for INIT values that has only values for main grid active cells
|
||||||
|
if (!validKeyword)
|
||||||
|
{
|
||||||
|
if (timeStepCount == 1)
|
||||||
|
{
|
||||||
|
size_t mainGridMatrixActiveCellCount; matrixActiveCellInfo->gridActiveCellCounts(0, mainGridMatrixActiveCellCount);
|
||||||
|
size_t mainGridFractureActiveCellCount; fractureActiveCellInfo->gridActiveCellCounts(0, mainGridFractureActiveCellCount);
|
||||||
|
|
||||||
|
if ( keywordDataItemCount == mainGridMatrixActiveCellCount
|
||||||
|
|| keywordDataItemCount == mainGridFractureActiveCellCount
|
||||||
|
|| keywordDataItemCount == mainGridMatrixActiveCellCount + mainGridFractureActiveCellCount )
|
||||||
|
{
|
||||||
|
validKeyword = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (validKeyword)
|
if (validKeyword)
|
||||||
{
|
{
|
||||||
keywordsWithCorrectNumberOfDataItems.push_back(keyword);
|
keywordsWithCorrectNumberOfDataItems.push_back(keyword);
|
||||||
|
@ -44,9 +44,12 @@ double RigActiveCellsResultAccessor::cellScalar(size_t gridLocalCellIndex) const
|
|||||||
size_t resultValueIndex = m_activeCellInfo->cellResultIndex(reservoirCellIndex);
|
size_t resultValueIndex = m_activeCellInfo->cellResultIndex(reservoirCellIndex);
|
||||||
if (resultValueIndex == cvf::UNDEFINED_SIZE_T) return HUGE_VAL;
|
if (resultValueIndex == cvf::UNDEFINED_SIZE_T) return HUGE_VAL;
|
||||||
|
|
||||||
CVF_TIGHT_ASSERT(resultValueIndex < m_reservoirResultValues->size());
|
if (resultValueIndex < m_reservoirResultValues->size())
|
||||||
|
return m_reservoirResultValues->at(resultValueIndex);
|
||||||
|
|
||||||
return m_reservoirResultValues->at(resultValueIndex);
|
CVF_TIGHT_ASSERT(resultValueIndex < m_activeCellInfo->reservoirActiveCellCount()); // Because some static results might lack LGR data
|
||||||
|
|
||||||
|
return HUGE_VAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -67,9 +70,12 @@ double RigActiveCellsResultAccessor::cellScalarGlobIdx(size_t reservoirCellIndex
|
|||||||
size_t resultValueIndex = m_activeCellInfo->cellResultIndex(reservoirCellIndex);
|
size_t resultValueIndex = m_activeCellInfo->cellResultIndex(reservoirCellIndex);
|
||||||
if (resultValueIndex == cvf::UNDEFINED_SIZE_T) return HUGE_VAL;
|
if (resultValueIndex == cvf::UNDEFINED_SIZE_T) return HUGE_VAL;
|
||||||
|
|
||||||
CVF_TIGHT_ASSERT(resultValueIndex < m_reservoirResultValues->size());
|
if(resultValueIndex < m_reservoirResultValues->size())
|
||||||
|
return m_reservoirResultValues->at(resultValueIndex);
|
||||||
|
|
||||||
return m_reservoirResultValues->at(resultValueIndex);
|
CVF_TIGHT_ASSERT(resultValueIndex < m_activeCellInfo->reservoirActiveCellCount()); // Because some static results might lack LGR data
|
||||||
|
|
||||||
|
return HUGE_VAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user