mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3553 Temp LGR. Fix error in LGR intersection check
This commit is contained in:
parent
d353cfb8ec
commit
eb7303e743
@ -296,23 +296,17 @@ std::vector<LgrInfo> RicExportLgrFeature::buildLgrsForWellPath(RimWellPath*
|
|||||||
|
|
||||||
if (splitType == RicExportLgrUi::LGR_PER_CELL)
|
if (splitType == RicExportLgrUi::LGR_PER_CELL)
|
||||||
{
|
{
|
||||||
auto intersectingCells = cellsIntersectingCompletions(eclipseCase, wellPath, timeStep, completionTypes);
|
auto intersectingCells = cellsIntersectingCompletions(eclipseCase, wellPath, timeStep, completionTypes, intersectingOtherLgrs);
|
||||||
|
|
||||||
*intersectingOtherLgrs = containsAnyNonMainGridCells(intersectingCells);
|
|
||||||
lgrs = buildLgrsPerMainCell(eclipseCase, intersectingCells, lgrCellCounts);
|
lgrs = buildLgrsPerMainCell(eclipseCase, intersectingCells, lgrCellCounts);
|
||||||
}
|
}
|
||||||
else if (splitType == RicExportLgrUi::LGR_PER_COMPLETION)
|
else if (splitType == RicExportLgrUi::LGR_PER_COMPLETION)
|
||||||
{
|
{
|
||||||
auto intersectingCells = cellsIntersectingCompletions_PerCompletion(eclipseCase, wellPath, timeStep, completionTypes);
|
auto intersectingCells = cellsIntersectingCompletions_PerCompletion(eclipseCase, wellPath, timeStep, completionTypes, intersectingOtherLgrs);
|
||||||
|
|
||||||
*intersectingOtherLgrs = containsAnyNonMainGridCells(intersectingCells);
|
|
||||||
lgrs = buildLgrsPerCompletion(eclipseCase, intersectingCells, lgrCellCounts);
|
lgrs = buildLgrsPerCompletion(eclipseCase, intersectingCells, lgrCellCounts);
|
||||||
}
|
}
|
||||||
else if (splitType == RicExportLgrUi::LGR_PER_WELL)
|
else if (splitType == RicExportLgrUi::LGR_PER_WELL)
|
||||||
{
|
{
|
||||||
auto intersectingCells = cellsIntersectingCompletions(eclipseCase, wellPath, timeStep, completionTypes);
|
auto intersectingCells = cellsIntersectingCompletions(eclipseCase, wellPath, timeStep, completionTypes, intersectingOtherLgrs);
|
||||||
|
|
||||||
*intersectingOtherLgrs = containsAnyNonMainGridCells(intersectingCells);
|
|
||||||
|
|
||||||
int lgrId = firstAvailableLgrId(eclipseCase->mainGrid());
|
int lgrId = firstAvailableLgrId(eclipseCase->mainGrid());
|
||||||
lgrs.push_back(buildLgr(lgrId, eclipseCase, intersectingCells, lgrCellCounts));
|
lgrs.push_back(buildLgr(lgrId, eclipseCase, intersectingCells, lgrCellCounts));
|
||||||
@ -396,10 +390,12 @@ std::vector<RigCompletionDataGridCell>
|
|||||||
RicExportLgrFeature::cellsIntersectingCompletions(RimEclipseCase* eclipseCase,
|
RicExportLgrFeature::cellsIntersectingCompletions(RimEclipseCase* eclipseCase,
|
||||||
const RimWellPath* wellPath,
|
const RimWellPath* wellPath,
|
||||||
size_t timeStep,
|
size_t timeStep,
|
||||||
const std::set<RigCompletionData::CompletionType>& completionTypes)
|
const std::set<RigCompletionData::CompletionType>& completionTypes,
|
||||||
|
bool* isIntersectingOtherLgrs)
|
||||||
{
|
{
|
||||||
std::vector<RigCompletionDataGridCell> cells;
|
std::vector<RigCompletionDataGridCell> cells;
|
||||||
|
|
||||||
|
*isIntersectingOtherLgrs = false;
|
||||||
auto completions = eclipseCase->computeAndGetVirtualPerforationTransmissibilities();
|
auto completions = eclipseCase->computeAndGetVirtualPerforationTransmissibilities();
|
||||||
if (completions)
|
if (completions)
|
||||||
{
|
{
|
||||||
@ -407,6 +403,12 @@ RicExportLgrFeature::cellsIntersectingCompletions(RimEclipseCase* eclipseCase,
|
|||||||
|
|
||||||
for (auto intCell : intCells)
|
for (auto intCell : intCells)
|
||||||
{
|
{
|
||||||
|
if (!intCell.first.isMainGridCell())
|
||||||
|
{
|
||||||
|
*isIntersectingOtherLgrs = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
auto filteredCompletions = filterCompletionsOnType(intCell.second, completionTypes);
|
auto filteredCompletions = filterCompletionsOnType(intCell.second, completionTypes);
|
||||||
|
|
||||||
if (filteredCompletions.empty()) continue;
|
if (filteredCompletions.empty()) continue;
|
||||||
@ -424,10 +426,12 @@ std::map<CompletionInfo, std::vector<RigCompletionDataGridCell>>
|
|||||||
RicExportLgrFeature::cellsIntersectingCompletions_PerCompletion(RimEclipseCase* eclipseCase,
|
RicExportLgrFeature::cellsIntersectingCompletions_PerCompletion(RimEclipseCase* eclipseCase,
|
||||||
const RimWellPath* wellPath,
|
const RimWellPath* wellPath,
|
||||||
size_t timeStep,
|
size_t timeStep,
|
||||||
const std::set<RigCompletionData::CompletionType>& completionTypes)
|
const std::set<RigCompletionData::CompletionType>& completionTypes,
|
||||||
|
bool* isIntersectingOtherLgrs)
|
||||||
{
|
{
|
||||||
std::map<CompletionInfo, std::vector<RigCompletionDataGridCell>> completionToCells;
|
std::map<CompletionInfo, std::vector<RigCompletionDataGridCell>> completionToCells;
|
||||||
|
|
||||||
|
*isIntersectingOtherLgrs = false;
|
||||||
auto completions = eclipseCase->computeAndGetVirtualPerforationTransmissibilities();
|
auto completions = eclipseCase->computeAndGetVirtualPerforationTransmissibilities();
|
||||||
if (completions)
|
if (completions)
|
||||||
{
|
{
|
||||||
@ -437,7 +441,11 @@ std::map<CompletionInfo, std::vector<RigCompletionDataGridCell>>
|
|||||||
// This loop assumes that cells are ordered downwards along well path
|
// This loop assumes that cells are ordered downwards along well path
|
||||||
for (auto intCell : intCells)
|
for (auto intCell : intCells)
|
||||||
{
|
{
|
||||||
if (!intCell.first.isMainGridCell()) continue;
|
if (!intCell.first.isMainGridCell())
|
||||||
|
{
|
||||||
|
*isIntersectingOtherLgrs = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
auto filteredCompletions = filterCompletionsOnType(intCell.second, completionTypes);
|
auto filteredCompletions = filterCompletionsOnType(intCell.second, completionTypes);
|
||||||
if (filteredCompletions.empty()) continue;
|
if (filteredCompletions.empty()) continue;
|
||||||
@ -548,29 +556,6 @@ std::vector<RimWellPath*> RicExportLgrFeature::selectedWellPaths()
|
|||||||
return wellPaths;
|
return wellPaths;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
bool RicExportLgrFeature::containsAnyNonMainGridCells(
|
|
||||||
const std::map<CompletionInfo, std::vector<RigCompletionDataGridCell>>& cellsPerCompletion)
|
|
||||||
{
|
|
||||||
for (auto cells : cellsPerCompletion)
|
|
||||||
{
|
|
||||||
if (containsAnyNonMainGridCells(cells.second)) return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
bool RicExportLgrFeature::containsAnyNonMainGridCells(const std::vector<RigCompletionDataGridCell>& cells)
|
|
||||||
{
|
|
||||||
return std::find_if(cells.begin(), cells.end(), [](const RigCompletionDataGridCell& cell) {
|
|
||||||
return !cell.isMainGridCell();
|
|
||||||
}) != cells.end();
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -174,14 +174,14 @@ private:
|
|||||||
static std::vector<RigCompletionDataGridCell> cellsIntersectingCompletions(RimEclipseCase* eclipseCase,
|
static std::vector<RigCompletionDataGridCell> cellsIntersectingCompletions(RimEclipseCase* eclipseCase,
|
||||||
const RimWellPath* wellPath,
|
const RimWellPath* wellPath,
|
||||||
size_t timeStep,
|
size_t timeStep,
|
||||||
const std::set<RigCompletionData::CompletionType>& completionTypes);
|
const std::set<RigCompletionData::CompletionType>& completionTypes,
|
||||||
|
bool* isIntersectingOtherLgrs);
|
||||||
static std::map<CompletionInfo, std::vector<RigCompletionDataGridCell>>
|
static std::map<CompletionInfo, std::vector<RigCompletionDataGridCell>>
|
||||||
cellsIntersectingCompletions_PerCompletion(RimEclipseCase* eclipseCase,
|
cellsIntersectingCompletions_PerCompletion(RimEclipseCase* eclipseCase,
|
||||||
const RimWellPath* wellPath,
|
const RimWellPath* wellPath,
|
||||||
size_t timeStep,
|
size_t timeStep,
|
||||||
const std::set<RigCompletionData::CompletionType>& completionTypes);
|
const std::set<RigCompletionData::CompletionType>& completionTypes,
|
||||||
|
bool* isIntersectingOtherLgrs);
|
||||||
|
|
||||||
static bool containsAnyNonMainGridCells(const std::map<CompletionInfo, std::vector<RigCompletionDataGridCell>>& cellsPerCompletion);
|
|
||||||
static bool containsAnyNonMainGridCells(const std::vector<RigCompletionDataGridCell>& cells);
|
|
||||||
static int firstAvailableLgrId(const RigMainGrid* mainGrid);
|
static int firstAvailableLgrId(const RigMainGrid* mainGrid);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user