mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
If K-value for a well is given in fracture grid, subtract NZ from K to get index in matrix grid.
p4#: 20429
This commit is contained in:
@@ -668,21 +668,14 @@ void RifReaderEclipseOutput::readWellCells(RigReservoir* reservoir)
|
|||||||
int cellI = well_conn_get_i( ert_wellhead );
|
int cellI = well_conn_get_i( ert_wellhead );
|
||||||
int cellJ = well_conn_get_j( ert_wellhead );
|
int cellJ = well_conn_get_j( ert_wellhead );
|
||||||
int cellK = CVF_MAX(0, well_conn_get_k(ert_wellhead)); // Why this ?
|
int cellK = CVF_MAX(0, well_conn_get_k(ert_wellhead)); // Why this ?
|
||||||
|
|
||||||
if (!grids[gridNr]->isCellValid(cellI, cellJ, cellK))
|
// If a well is defined in fracture region, the K-value is from (cellCountK - 1) -> cellCountK*2 - 1
|
||||||
|
// Adjust K so index is always in valid grid region
|
||||||
|
if (cellK >= grids[gridNr]->cellCountK())
|
||||||
{
|
{
|
||||||
int candidateCellK = findSmallestActiveCellIndexK(grids[gridNr], cellI, cellJ);
|
cellK -= static_cast<int>(grids[gridNr]->cellCountK());
|
||||||
|
|
||||||
if (candidateCellK >= 0)
|
|
||||||
{
|
|
||||||
cellK = candidateCellK;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
cellK = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wellResFrame.m_wellHead.m_gridCellIndex = grids[gridNr]->cellIndexFromIJK(cellI, cellJ, cellK);
|
wellResFrame.m_wellHead.m_gridCellIndex = grids[gridNr]->cellIndexFromIJK(cellI, cellJ, cellK);
|
||||||
wellResFrame.m_wellHead.m_gridIndex = gridNr;
|
wellResFrame.m_wellHead.m_gridIndex = gridNr;
|
||||||
}
|
}
|
||||||
@@ -721,18 +714,11 @@ void RifReaderEclipseOutput::readWellCells(RigReservoir* reservoir)
|
|||||||
int branch = well_conn_get_branch( ert_connection );
|
int branch = well_conn_get_branch( ert_connection );
|
||||||
int segment = well_conn_get_segment( ert_connection );
|
int segment = well_conn_get_segment( ert_connection );
|
||||||
|
|
||||||
if (!grids[gridNr]->isCellValid(cellI, cellJ, cellK))
|
// If a well is defined in fracture region, the K-value is from (cellCountK - 1) -> cellCountK*2 - 1
|
||||||
|
// Adjust K so index is always in valid grid region
|
||||||
|
if (cellK >= grids[gridNr]->cellCountK())
|
||||||
{
|
{
|
||||||
int candidateCellK = findSmallestActiveCellIndexK(grids[gridNr], cellI, cellJ);
|
cellK -= static_cast<int>(grids[gridNr]->cellCountK());
|
||||||
|
|
||||||
if (candidateCellK >= 0)
|
|
||||||
{
|
|
||||||
cellK = candidateCellK;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
cellK = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
data.m_gridCellIndex = grids[gridNr]->cellIndexFromIJK(cellI , cellJ , cellK);
|
data.m_gridCellIndex = grids[gridNr]->cellIndexFromIJK(cellI , cellJ , cellK);
|
||||||
|
Reference in New Issue
Block a user