mirror of
https://github.com/OPM/ResInsight.git
synced 2026-08-27 05:37:21 -05:00
Handle active cells in files with thermal data (rockv) (#13159)
* Handle active cells in files with thermal data from intersect
This commit is contained in:
@@ -445,6 +445,14 @@ QString RiaResultNames::porv()
|
||||
return "PORV";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaResultNames::rockv()
|
||||
{
|
||||
return "ROCKV";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -84,6 +84,7 @@ QString faultDistanceName();
|
||||
QString facies();
|
||||
|
||||
QString porv();
|
||||
QString rockv();
|
||||
QString soil();
|
||||
QString sgas();
|
||||
QString swat();
|
||||
|
||||
@@ -1101,6 +1101,8 @@ std::vector<std::vector<int>> RifReaderOpmCommon::readActiveCellInfoFromPorv( Ri
|
||||
|
||||
std::vector<std::vector<int>> activeCellsAllGrids;
|
||||
|
||||
bool hasThermalData = m_initFile->hasArray( RiaResultNames::rockv().toStdString() );
|
||||
|
||||
bool divideCellCountByTwo = isDualPorosity;
|
||||
|
||||
const int nGrids = (int)m_gridNames.size();
|
||||
@@ -1108,6 +1110,10 @@ std::vector<std::vector<int>> RifReaderOpmCommon::readActiveCellInfoFromPorv( Ri
|
||||
for ( int gridIdx = 0; gridIdx < nGrids; gridIdx++ )
|
||||
{
|
||||
auto porvValues = m_initFile->getInitData<float>( RiaResultNames::porv().toStdString(), m_gridNames[gridIdx] );
|
||||
auto rockValues = hasThermalData ? m_initFile->getInitData<float>( RiaResultNames::rockv().toStdString(), m_gridNames[gridIdx] )
|
||||
: std::vector<float>();
|
||||
|
||||
rockValues.resize( porvValues.size(), 0.0f ); // Ensure rockValues has same size as porvValues, fill with 0.0f if not present
|
||||
|
||||
int activeCellCount = (int)porvValues.size();
|
||||
if ( divideCellCountByTwo )
|
||||
@@ -1118,19 +1124,19 @@ std::vector<std::vector<int>> RifReaderOpmCommon::readActiveCellInfoFromPorv( Ri
|
||||
std::vector<int> activeCellsOneGrid;
|
||||
activeCellsOneGrid.resize( activeCellCount, 0 );
|
||||
|
||||
for ( int poreValueIndex = 0; poreValueIndex < static_cast<int>( porvValues.size() ); poreValueIndex++ )
|
||||
for ( int resultIndex = 0; resultIndex < static_cast<int>( porvValues.size() ); resultIndex++ )
|
||||
{
|
||||
int indexToCell = poreValueIndex;
|
||||
int indexToCell = resultIndex;
|
||||
if ( indexToCell >= activeCellCount )
|
||||
{
|
||||
indexToCell = poreValueIndex - activeCellCount;
|
||||
indexToCell = resultIndex - activeCellCount;
|
||||
}
|
||||
|
||||
if ( porvValues[poreValueIndex] > 0.0f )
|
||||
if ( porvValues[resultIndex] > 0.0f )
|
||||
{
|
||||
if ( isDualPorosity )
|
||||
{
|
||||
if ( poreValueIndex < activeCellCount )
|
||||
if ( resultIndex < activeCellCount )
|
||||
{
|
||||
activeCellsOneGrid[indexToCell] += (int)ActiveType::ACTIVE_MATRIX_VALUE;
|
||||
}
|
||||
@@ -1144,6 +1150,13 @@ std::vector<std::vector<int>> RifReaderOpmCommon::readActiveCellInfoFromPorv( Ri
|
||||
activeCellsOneGrid[indexToCell] += (int)ActiveType::ACTIVE_MATRIX_VALUE;
|
||||
}
|
||||
}
|
||||
if ( rockValues[resultIndex] > 0.0f )
|
||||
{
|
||||
if ( activeCellsOneGrid[indexToCell] == 0 )
|
||||
{
|
||||
activeCellsOneGrid[indexToCell] += (int)ActiveType::ACTIVE_MATRIX_VALUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
activeCellsAllGrids.push_back( activeCellsOneGrid );
|
||||
|
||||
+1
-1
Submodule ThirdParty/custom-opm-common/opm-common updated: ffd18df3b6...8f5e3d8d7d
Reference in New Issue
Block a user