mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3553 Temp LGR. Error handling, bug fixes
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
|
||||
#include "RigActiveCellInfo.h"
|
||||
#include "RigCaseCellResultsData.h"
|
||||
#include "RigCell.h"
|
||||
#include "RigCellGeometryTools.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigMainGrid.h"
|
||||
@@ -111,37 +112,37 @@ void RicCreateTemporaryLgrFeature::onActionTriggered(bool isChecked)
|
||||
RigActiveCellInfo* activeCellInfo = eclipseCaseData->activeCellInfo(RiaDefines::MATRIX_MODEL);
|
||||
RigActiveCellInfo* fractureActiveCellInfo = eclipseCaseData->activeCellInfo(RiaDefines::FRACTURE_MODEL);
|
||||
|
||||
bool intersectsExistingLgr = false;
|
||||
bool intersectingOtherLgr = false;
|
||||
for (const auto& wellPath : wellPaths)
|
||||
{
|
||||
try
|
||||
bool intersectingLgrs = false;
|
||||
|
||||
auto lgrs = RicExportLgrFeature::buildLgrsForWellPath(wellPath,
|
||||
eclipseCase,
|
||||
timeStep,
|
||||
lgrCellCounts,
|
||||
splitType,
|
||||
completionTypes,
|
||||
&intersectingLgrs);
|
||||
|
||||
if (intersectingLgrs) intersectingOtherLgr = true;
|
||||
|
||||
auto mainGrid = eclipseCase->eclipseCaseData()->mainGrid();
|
||||
|
||||
for (auto lgr : lgrs)
|
||||
{
|
||||
std::vector<LgrInfo> lgrs = RicExportLgrFeature::buildLgrsForWellPath(
|
||||
wellPath, eclipseCase, timeStep, lgrCellCounts, splitType, completionTypes);
|
||||
createLgr(lgr, eclipseCase->eclipseCaseData()->mainGrid());
|
||||
|
||||
auto mainGrid = eclipseCase->eclipseCaseData()->mainGrid();
|
||||
size_t lgrCellCount = lgr.cellCount();
|
||||
|
||||
for (auto lgr : lgrs)
|
||||
activeCellInfo->addLgr(lgrCellCount);
|
||||
if (fractureActiveCellInfo->reservoirActiveCellCount() > 0)
|
||||
{
|
||||
createLgr(lgr, eclipseCase->eclipseCaseData()->mainGrid());
|
||||
|
||||
size_t lgrCellCount = lgr.cellCount();
|
||||
|
||||
activeCellInfo->addLgr(lgrCellCount);
|
||||
if (fractureActiveCellInfo->reservoirActiveCellCount() > 0)
|
||||
{
|
||||
fractureActiveCellInfo->addLgr(lgrCellCount);
|
||||
}
|
||||
fractureActiveCellInfo->addLgr(lgrCellCount);
|
||||
}
|
||||
|
||||
mainGrid->calculateFaults(activeCellInfo, true);
|
||||
}
|
||||
catch (CreateLgrException& e)
|
||||
{
|
||||
RiaLogging::error(e.message);
|
||||
|
||||
intersectsExistingLgr = true;
|
||||
}
|
||||
mainGrid->calculateFaults(activeCellInfo, true);
|
||||
}
|
||||
|
||||
RiuSelectionManager::instance()->deleteAllItems(RiuSelectionManager::RUI_APPLICATION_GLOBAL);
|
||||
@@ -164,11 +165,11 @@ void RicCreateTemporaryLgrFeature::onActionTriggered(bool isChecked)
|
||||
}
|
||||
}
|
||||
|
||||
if (intersectsExistingLgr)
|
||||
if (intersectingOtherLgr)
|
||||
{
|
||||
QMessageBox::warning(nullptr,
|
||||
"LGR cells intersected",
|
||||
"At least one completion intersects with an LGR. No output for those completions produced");
|
||||
"At least one completion intersects with an LGR. No LGR(s) for those cells are produced");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -231,7 +232,8 @@ void RicCreateTemporaryLgrFeature::createLgr(const LgrInfo& lgrInfo, RigMainGrid
|
||||
size_t mainI = lgrInfo.mainGridStartCell.i() + lgrI / lgrSizePerMainCell.i();
|
||||
|
||||
size_t mainCellIndex = mainGrid->cellIndexFromIJK(mainI, mainJ, mainK);
|
||||
mainGrid->globalCellArray()[mainCellIndex].setSubGrid(localGrid);
|
||||
auto mainGridCell = mainGrid->globalCellArray()[mainCellIndex];
|
||||
mainGridCell.setSubGrid(localGrid);
|
||||
|
||||
RigCell& cell = mainGrid->globalCellArray()[cellStartIndex + gridLocalCellIndex];
|
||||
cell.setGridLocalCellIndex(gridLocalCellIndex);
|
||||
|
||||
Reference in New Issue
Block a user