mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3650 Temp LGR. Process all affected wells in the same operation
This commit is contained in:
parent
12e8c3b9b2
commit
b1e9841964
@ -101,30 +101,22 @@ void RicfCreateLgrForCompletions::execute()
|
|||||||
RicExportLgrFeature::resetLgrNaming();
|
RicExportLgrFeature::resetLgrNaming();
|
||||||
|
|
||||||
caf::VecIjk lgrCellCounts(m_refinementI, m_refinementJ, m_refinementK);
|
caf::VecIjk lgrCellCounts(m_refinementI, m_refinementJ, m_refinementK);
|
||||||
QStringList wellsWithIntersectingLgrs;
|
QStringList wellsIntersectingOtherLgrs;
|
||||||
for (const auto wellPath : wellPaths)
|
|
||||||
{
|
|
||||||
if (wellPath)
|
|
||||||
{
|
|
||||||
bool intersectingLgrs = false;
|
|
||||||
feature->createLgrsForWellPath(
|
|
||||||
wellPath,
|
|
||||||
eclipseCase,
|
|
||||||
m_timeStep,
|
|
||||||
lgrCellCounts,
|
|
||||||
m_splitType(),
|
|
||||||
{RigCompletionData::PERFORATION, RigCompletionData::FRACTURE, RigCompletionData::FISHBONES},
|
|
||||||
&intersectingLgrs);
|
|
||||||
|
|
||||||
if (intersectingLgrs) wellsWithIntersectingLgrs.push_back(wellPath->name());
|
feature->createLgrsForWellPaths(
|
||||||
}
|
wellPaths,
|
||||||
}
|
eclipseCase,
|
||||||
|
m_timeStep,
|
||||||
|
lgrCellCounts,
|
||||||
|
m_splitType(),
|
||||||
|
{RigCompletionData::PERFORATION, RigCompletionData::FRACTURE, RigCompletionData::FISHBONES},
|
||||||
|
&wellsIntersectingOtherLgrs);
|
||||||
|
|
||||||
feature->updateViews(eclipseCase);
|
feature->updateViews(eclipseCase);
|
||||||
|
|
||||||
if (!wellsWithIntersectingLgrs.empty())
|
if (!wellsIntersectingOtherLgrs.empty())
|
||||||
{
|
{
|
||||||
auto wellsList = wellsWithIntersectingLgrs.join(", ");
|
auto wellsList = wellsIntersectingOtherLgrs.join(", ");
|
||||||
RiaLogging::error(
|
RiaLogging::error(
|
||||||
"createLgrForCompletions: No LGRs created for some wells due to existing intersecting LGR(s).Affected wells : " +
|
"createLgrForCompletions: No LGRs created for some wells due to existing intersecting LGR(s).Affected wells : " +
|
||||||
wellsList);
|
wellsList);
|
||||||
|
@ -94,24 +94,14 @@ void RicfExportLgrForCompletions::execute()
|
|||||||
}
|
}
|
||||||
|
|
||||||
caf::VecIjk lgrCellCounts(m_refinementI, m_refinementJ, m_refinementK);
|
caf::VecIjk lgrCellCounts(m_refinementI, m_refinementJ, m_refinementK);
|
||||||
QStringList wellsWithIntersectingLgrs;
|
QStringList wellsIntersectingOtherLgrs;
|
||||||
|
|
||||||
feature->resetLgrNaming();
|
feature->exportLgrsForWellPaths(exportFolder, wellPaths, eclipseCase, m_timeStep, lgrCellCounts, m_splitType(),
|
||||||
for (const auto wellPath : wellPaths)
|
{RigCompletionData::PERFORATION, RigCompletionData::FRACTURE, RigCompletionData::FISHBONES}, &wellsIntersectingOtherLgrs);
|
||||||
{
|
|
||||||
if (wellPath)
|
|
||||||
{
|
|
||||||
bool intersectingLgrs = false;
|
|
||||||
feature->exportLgrsForWellPath(exportFolder, wellPath, eclipseCase, m_timeStep, lgrCellCounts, m_splitType(),
|
|
||||||
{RigCompletionData::PERFORATION, RigCompletionData::FRACTURE, RigCompletionData::FISHBONES}, &intersectingLgrs);
|
|
||||||
|
|
||||||
if (intersectingLgrs) wellsWithIntersectingLgrs.push_back(wellPath->name());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!wellsWithIntersectingLgrs.empty())
|
if (!wellsIntersectingOtherLgrs.empty())
|
||||||
{
|
{
|
||||||
auto wellsList = wellsWithIntersectingLgrs.join(", ");
|
auto wellsList = wellsIntersectingOtherLgrs.join(", ");
|
||||||
RiaLogging::error("exportLgrForCompletions: No export for some wells due to existing intersecting LGR(s).Affected wells : " + wellsList);
|
RiaLogging::error("exportLgrForCompletions: No export for some wells due to existing intersecting LGR(s).Affected wells : " + wellsList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -120,7 +120,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
std::map<RigCompletionData::CompletionType, std::pair<QString, int>> m_counters;
|
std::map<RigCompletionData::CompletionType, std::pair<QString, int>> m_counters;
|
||||||
} lgrNameFactory;
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
// Internal function
|
// Internal function
|
||||||
@ -307,28 +307,31 @@ void RicExportLgrFeature::writeLgrs(QTextStream& stream, const std::vector<LgrIn
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicExportLgrFeature::exportLgrsForWellPath(const QString& exportFolder,
|
void RicExportLgrFeature::exportLgrsForWellPaths(const QString& exportFolder,
|
||||||
RimWellPath* wellPath,
|
std::vector<RimWellPath*> wellPaths,
|
||||||
RimEclipseCase* eclipseCase,
|
RimEclipseCase* eclipseCase,
|
||||||
size_t timeStep,
|
size_t timeStep,
|
||||||
caf::VecIjk lgrCellCounts,
|
caf::VecIjk lgrCellCounts,
|
||||||
Lgr::SplitType splitType,
|
Lgr::SplitType splitType,
|
||||||
const std::set<RigCompletionData::CompletionType>& completionTypes,
|
const std::set<RigCompletionData::CompletionType>& completionTypes,
|
||||||
bool* intersectingOtherLgrs)
|
QStringList* wellsIntersectingOtherLgrs)
|
||||||
{
|
{
|
||||||
std::vector<LgrInfo> lgrs;
|
std::vector<LgrInfo> lgrs;
|
||||||
|
|
||||||
lgrs = buildLgrsForWellPath(wellPath,
|
lgrs = buildLgrsForWellPaths(wellPaths,
|
||||||
eclipseCase,
|
eclipseCase,
|
||||||
timeStep,
|
timeStep,
|
||||||
lgrCellCounts,
|
lgrCellCounts,
|
||||||
splitType,
|
splitType,
|
||||||
completionTypes,
|
completionTypes,
|
||||||
intersectingOtherLgrs);
|
wellsIntersectingOtherLgrs);
|
||||||
|
|
||||||
if (!*intersectingOtherLgrs && !lgrs.empty())
|
for (const auto& wellPath : wellPaths)
|
||||||
{
|
{
|
||||||
exportLgrs(exportFolder, wellPath->name(), lgrs);
|
if (!lgrs.empty())
|
||||||
|
{
|
||||||
|
exportLgrs(exportFolder, wellPath->name(), lgrs);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -354,33 +357,45 @@ void RicExportLgrFeature::exportLgrs(const QString& exportFolder, const QString&
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
std::vector<LgrInfo> RicExportLgrFeature::buildLgrsForWellPath(RimWellPath* wellPath,
|
std::vector<LgrInfo> RicExportLgrFeature::buildLgrsForWellPaths(std::vector<RimWellPath*> wellPaths,
|
||||||
RimEclipseCase* eclipseCase,
|
RimEclipseCase* eclipseCase,
|
||||||
size_t timeStep,
|
size_t timeStep,
|
||||||
caf::VecIjk lgrCellCounts,
|
caf::VecIjk lgrCellCounts,
|
||||||
Lgr::SplitType splitType,
|
Lgr::SplitType splitType,
|
||||||
const std::set<RigCompletionData::CompletionType>& completionTypes,
|
const std::set<RigCompletionData::CompletionType>& completionTypes,
|
||||||
bool* intersectingOtherLgrs)
|
QStringList* wellsIntersectingOtherLgrs)
|
||||||
{
|
{
|
||||||
std::vector<LgrInfo> lgrs;
|
std::vector<LgrInfo> lgrs;
|
||||||
|
LgrNameFactory lgrNameFactory;
|
||||||
|
|
||||||
if (splitType == Lgr::LGR_PER_CELL)
|
wellsIntersectingOtherLgrs->clear();
|
||||||
{
|
|
||||||
auto intersectingCells = cellsIntersectingCompletions(eclipseCase, wellPath, timeStep, completionTypes, intersectingOtherLgrs);
|
|
||||||
lgrs = buildLgrsPerMainCell(eclipseCase, wellPath, intersectingCells, lgrCellCounts);
|
|
||||||
}
|
|
||||||
else if (splitType == Lgr::LGR_PER_COMPLETION)
|
|
||||||
{
|
|
||||||
auto intersectingCells = cellsIntersectingCompletions_PerCompletion(eclipseCase, wellPath, timeStep, completionTypes, intersectingOtherLgrs);
|
|
||||||
lgrs = buildLgrsPerCompletion(eclipseCase, wellPath, intersectingCells, lgrCellCounts);
|
|
||||||
}
|
|
||||||
else if (splitType == Lgr::LGR_PER_WELL)
|
|
||||||
{
|
|
||||||
auto intersectingCells = cellsIntersectingCompletions(eclipseCase, wellPath, timeStep, completionTypes, intersectingOtherLgrs);
|
|
||||||
|
|
||||||
int lgrId = firstAvailableLgrId(eclipseCase->mainGrid());
|
for (const auto& wellPath : wellPaths)
|
||||||
auto lgrName = lgrNameFactory.newName("WELL", lgrId);
|
{
|
||||||
lgrs.push_back(buildLgr(lgrId, lgrName, eclipseCase, wellPath, intersectingCells, lgrCellCounts));
|
bool isIntersectingOtherLgrs = false;
|
||||||
|
std::vector<LgrInfo> newLgrs;
|
||||||
|
|
||||||
|
if (splitType == Lgr::LGR_PER_CELL)
|
||||||
|
{
|
||||||
|
auto intersectingCells = cellsIntersectingCompletions(eclipseCase, wellPath, timeStep, completionTypes, &isIntersectingOtherLgrs);
|
||||||
|
newLgrs = buildLgrsPerMainCell(eclipseCase, wellPath, intersectingCells, lgrCellCounts, lgrNameFactory);
|
||||||
|
}
|
||||||
|
else if (splitType == Lgr::LGR_PER_COMPLETION)
|
||||||
|
{
|
||||||
|
auto intersectingCells = cellsIntersectingCompletions_PerCompletion_old(eclipseCase, wellPath, timeStep, completionTypes, &isIntersectingOtherLgrs);
|
||||||
|
newLgrs = buildLgrsPerCompletion(eclipseCase, wellPath, intersectingCells, lgrCellCounts, lgrNameFactory);
|
||||||
|
}
|
||||||
|
else if (splitType == Lgr::LGR_PER_WELL)
|
||||||
|
{
|
||||||
|
auto intersectingCells = cellsIntersectingCompletions(eclipseCase, wellPath, timeStep, completionTypes, &isIntersectingOtherLgrs);
|
||||||
|
|
||||||
|
int lgrId = firstAvailableLgrId(eclipseCase->mainGrid());
|
||||||
|
auto lgrName = lgrNameFactory.newName("WELL", lgrId);
|
||||||
|
newLgrs.push_back(buildLgr(lgrId, lgrName, eclipseCase, wellPath, intersectingCells, lgrCellCounts));
|
||||||
|
}
|
||||||
|
|
||||||
|
lgrs.insert(lgrs.end(), newLgrs.begin(), newLgrs.end());
|
||||||
|
if (isIntersectingOtherLgrs) wellsIntersectingOtherLgrs->push_back(wellPath->name());
|
||||||
}
|
}
|
||||||
return lgrs;
|
return lgrs;
|
||||||
}
|
}
|
||||||
@ -391,7 +406,8 @@ std::vector<LgrInfo> RicExportLgrFeature::buildLgrsForWellPath(RimWellPath*
|
|||||||
std::vector<LgrInfo> RicExportLgrFeature::buildLgrsPerMainCell(RimEclipseCase* eclipseCase,
|
std::vector<LgrInfo> RicExportLgrFeature::buildLgrsPerMainCell(RimEclipseCase* eclipseCase,
|
||||||
RimWellPath* wellPath,
|
RimWellPath* wellPath,
|
||||||
const std::vector<RigCompletionDataGridCell>& intersectingCells,
|
const std::vector<RigCompletionDataGridCell>& intersectingCells,
|
||||||
const caf::VecIjk& lgrSizes)
|
const caf::VecIjk& lgrSizes,
|
||||||
|
LgrNameFactory& lgrNameFactory)
|
||||||
{
|
{
|
||||||
std::vector<LgrInfo> lgrs;
|
std::vector<LgrInfo> lgrs;
|
||||||
|
|
||||||
@ -411,7 +427,8 @@ std::vector<LgrInfo> RicExportLgrFeature::buildLgrsPerCompletion(
|
|||||||
RimEclipseCase* eclipseCase,
|
RimEclipseCase* eclipseCase,
|
||||||
RimWellPath* wellPath,
|
RimWellPath* wellPath,
|
||||||
const std::map<CompletionInfo, std::vector<RigCompletionDataGridCell>>& completionInfo,
|
const std::map<CompletionInfo, std::vector<RigCompletionDataGridCell>>& completionInfo,
|
||||||
const caf::VecIjk& lgrSizesPerMainGridCell)
|
const caf::VecIjk& lgrSizesPerMainGridCell,
|
||||||
|
LgrNameFactory& lgrNameFactory)
|
||||||
{
|
{
|
||||||
std::vector<LgrInfo> lgrs;
|
std::vector<LgrInfo> lgrs;
|
||||||
|
|
||||||
@ -603,7 +620,7 @@ std::vector<std::pair<RigCompletionDataGridCell, std::vector<RigCompletionData>>
|
|||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
std::map<CompletionInfo, std::vector<RigCompletionDataGridCell>>
|
std::map<CompletionInfo, std::vector<RigCompletionDataGridCell>>
|
||||||
RicExportLgrFeature::cellsIntersectingCompletions_PerCompletion(RimEclipseCase* eclipseCase,
|
RicExportLgrFeature::cellsIntersectingCompletions_PerCompletion_old(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,
|
||||||
@ -656,6 +673,34 @@ std::map<CompletionInfo, std::vector<RigCompletionDataGridCell>>
|
|||||||
return completionToCells;
|
return completionToCells;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
std::map<CompletionInfo, std::vector<RigCompletionDataGridCell>> RicExportLgrFeature::cellsIntersectingCompletions_PerCompletion(
|
||||||
|
RimEclipseCase* eclipseCase,
|
||||||
|
const RimWellPath* wellPath,
|
||||||
|
size_t timeStep,
|
||||||
|
const std::set<RigCompletionData::CompletionType>& completionTypes,
|
||||||
|
bool* isIntersectingOtherLgrs)
|
||||||
|
{
|
||||||
|
std::map<CompletionInfo, std::vector<RigCompletionDataGridCell>> completionToCells;
|
||||||
|
|
||||||
|
*isIntersectingOtherLgrs = false;
|
||||||
|
|
||||||
|
auto completions = eclipseCase->computeAndGetVirtualPerforationTransmissibilities();
|
||||||
|
if (completions)
|
||||||
|
{
|
||||||
|
const auto& intCells = completions->multipleCompletionsPerEclipseCell(wellPath, timeStep);
|
||||||
|
|
||||||
|
const auto& fractures = wellPath->fractureCollection()->allFractures();
|
||||||
|
const auto& fishbones = wellPath->fishbonesCollection()->allFishbonesSubs();
|
||||||
|
const auto& perforations = wellPath->perforationIntervalCollection()->perforations();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -693,25 +738,20 @@ void RicExportLgrFeature::onActionTriggered(bool isChecked)
|
|||||||
auto lgrCellCounts = dialogData->lgrCellCount();
|
auto lgrCellCounts = dialogData->lgrCellCount();
|
||||||
size_t timeStep = dialogData->timeStep();
|
size_t timeStep = dialogData->timeStep();
|
||||||
|
|
||||||
QStringList wellsWithIntersectingLgrs;
|
QStringList wellsIntersectingOtherLgrs;
|
||||||
for (const auto& wellPath : wellPaths)
|
bool intersectingLgrs = false;
|
||||||
{
|
exportLgrsForWellPaths(dialogData->exportFolder(),
|
||||||
bool intersectingLgrs = false;
|
wellPaths,
|
||||||
exportLgrsForWellPath(dialogData->exportFolder(),
|
eclipseCase,
|
||||||
wellPath,
|
timeStep,
|
||||||
eclipseCase,
|
lgrCellCounts,
|
||||||
timeStep,
|
dialogData->splitType(),
|
||||||
lgrCellCounts,
|
dialogData->completionTypes(),
|
||||||
dialogData->splitType(),
|
&wellsIntersectingOtherLgrs);
|
||||||
dialogData->completionTypes(),
|
|
||||||
&intersectingLgrs);
|
|
||||||
|
|
||||||
if (intersectingLgrs) wellsWithIntersectingLgrs.push_back(wellPath->name());
|
if (!wellsIntersectingOtherLgrs.empty())
|
||||||
}
|
|
||||||
|
|
||||||
if (!wellsWithIntersectingLgrs.empty())
|
|
||||||
{
|
{
|
||||||
auto wellsList = wellsWithIntersectingLgrs.join(", ");
|
auto wellsList = wellsIntersectingOtherLgrs.join(", ");
|
||||||
QMessageBox::warning(nullptr,
|
QMessageBox::warning(nullptr,
|
||||||
"LGR cells intersected",
|
"LGR cells intersected",
|
||||||
"No export for some wells due to existing intersecting LGR(s). Affected wells: " + wellsList);
|
"No export for some wells due to existing intersecting LGR(s). Affected wells: " + wellsList);
|
||||||
@ -807,14 +847,6 @@ std::map<QString /*wellName*/, std::vector<LgrInfo>> RicExportLgrFeature::create
|
|||||||
return lgrInfosPerWell;
|
return lgrInfosPerWell;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RicExportLgrFeature::resetLgrNaming()
|
|
||||||
{
|
|
||||||
lgrNameFactory.resetNumbering();
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
#include <limits>
|
#include <limits>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
class LgrNameFactory;
|
||||||
class RigMainGrid;
|
class RigMainGrid;
|
||||||
class RimEclipseCase;
|
class RimEclipseCase;
|
||||||
class RimSimWellInView;
|
class RimSimWellInView;
|
||||||
@ -140,33 +141,31 @@ class RicExportLgrFeature : public caf::CmdFeature
|
|||||||
int defaultTimeStep = 0,
|
int defaultTimeStep = 0,
|
||||||
bool hideExportFolderField = false);
|
bool hideExportFolderField = false);
|
||||||
static bool openFileForExport(const QString& folderName, const QString& fileName, QFile* exportFile);
|
static bool openFileForExport(const QString& folderName, const QString& fileName, QFile* exportFile);
|
||||||
static void exportLgrsForWellPath(const QString& exportFolder,
|
static void exportLgrsForWellPaths(const QString& exportFolder,
|
||||||
RimWellPath* wellPath,
|
std::vector<RimWellPath*> wellPaths,
|
||||||
RimEclipseCase* eclipseCase,
|
RimEclipseCase* eclipseCase,
|
||||||
size_t timeStep,
|
size_t timeStep,
|
||||||
caf::VecIjk lgrCellCounts,
|
caf::VecIjk lgrCellCounts,
|
||||||
Lgr::SplitType splitType,
|
Lgr::SplitType splitType,
|
||||||
const std::set<RigCompletionData::CompletionType>& completionTypes,
|
const std::set<RigCompletionData::CompletionType>& completionTypes,
|
||||||
bool* intersectingOtherLgrs);
|
QStringList* wellsIntersectingOtherLgrs);
|
||||||
|
|
||||||
static void exportLgrs(const QString& exportFolder,
|
static void exportLgrs(const QString& exportFolder,
|
||||||
const QString& wellName,
|
const QString& wellName,
|
||||||
const std::vector<LgrInfo>& lgrInfos);
|
const std::vector<LgrInfo>& lgrInfos);
|
||||||
|
|
||||||
static std::vector<LgrInfo> buildLgrsForWellPath(RimWellPath* wellPath,
|
static std::vector<LgrInfo> buildLgrsForWellPaths(std::vector<RimWellPath*> wellPaths,
|
||||||
RimEclipseCase* eclipseCase,
|
RimEclipseCase* eclipseCase,
|
||||||
size_t timeStep,
|
size_t timeStep,
|
||||||
caf::VecIjk lgrCellCounts,
|
caf::VecIjk lgrCellCounts,
|
||||||
Lgr::SplitType splitType,
|
Lgr::SplitType splitType,
|
||||||
const std::set<RigCompletionData::CompletionType>& completionTypes,
|
const std::set<RigCompletionData::CompletionType>& completionTypes,
|
||||||
bool* intersectingOtherLgrs);
|
QStringList* wellsIntersectingOtherLgrs);
|
||||||
|
|
||||||
static std::vector<RimWellPath*> selectedWellPaths();
|
static std::vector<RimWellPath*> selectedWellPaths();
|
||||||
|
|
||||||
static std::map<QString /*wellName*/, std::vector<LgrInfo>> createLgrInfoListForTemporaryLgrs(const RigMainGrid* mainGrid);
|
static std::map<QString /*wellName*/, std::vector<LgrInfo>> createLgrInfoListForTemporaryLgrs(const RigMainGrid* mainGrid);
|
||||||
|
|
||||||
static void resetLgrNaming();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool isCommandEnabled() override;
|
bool isCommandEnabled() override;
|
||||||
void onActionTriggered(bool isChecked) override;
|
void onActionTriggered(bool isChecked) override;
|
||||||
@ -178,12 +177,14 @@ private:
|
|||||||
static std::vector<LgrInfo> buildLgrsPerMainCell(RimEclipseCase* eclipseCase,
|
static std::vector<LgrInfo> buildLgrsPerMainCell(RimEclipseCase* eclipseCase,
|
||||||
RimWellPath* wellPath,
|
RimWellPath* wellPath,
|
||||||
const std::vector<RigCompletionDataGridCell>& intersectingCells,
|
const std::vector<RigCompletionDataGridCell>& intersectingCells,
|
||||||
const caf::VecIjk& lgrSizes);
|
const caf::VecIjk& lgrSizes,
|
||||||
|
LgrNameFactory& lgrNameFactory);
|
||||||
static std::vector<LgrInfo>
|
static std::vector<LgrInfo>
|
||||||
buildLgrsPerCompletion(RimEclipseCase* eclipseCase,
|
buildLgrsPerCompletion(RimEclipseCase* eclipseCase,
|
||||||
RimWellPath* wellPath,
|
RimWellPath* wellPath,
|
||||||
const std::map<CompletionInfo, std::vector<RigCompletionDataGridCell>>& completionInfo,
|
const std::map<CompletionInfo, std::vector<RigCompletionDataGridCell>>& completionInfo,
|
||||||
const caf::VecIjk& lgrSizesPerMainGridCell);
|
const caf::VecIjk& lgrSizesPerMainGridCell,
|
||||||
|
LgrNameFactory& lgrNameFactory);
|
||||||
static LgrInfo buildLgr(int lgrId,
|
static LgrInfo buildLgr(int lgrId,
|
||||||
const QString& lgrName,
|
const QString& lgrName,
|
||||||
RimEclipseCase* eclipseCase,
|
RimEclipseCase* eclipseCase,
|
||||||
@ -197,11 +198,18 @@ private:
|
|||||||
const std::set<RigCompletionData::CompletionType>& completionTypes,
|
const std::set<RigCompletionData::CompletionType>& completionTypes,
|
||||||
bool* isIntersectingOtherLgrs);
|
bool* isIntersectingOtherLgrs);
|
||||||
static std::map<CompletionInfo, std::vector<RigCompletionDataGridCell>>
|
static std::map<CompletionInfo, std::vector<RigCompletionDataGridCell>>
|
||||||
cellsIntersectingCompletions_PerCompletion(RimEclipseCase* eclipseCase,
|
cellsIntersectingCompletions_PerCompletion_old(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);
|
bool* isIntersectingOtherLgrs);
|
||||||
|
|
||||||
|
static std::map<CompletionInfo, std::vector<RigCompletionDataGridCell>>
|
||||||
|
cellsIntersectingCompletions_PerCompletion(RimEclipseCase* eclipseCase,
|
||||||
|
const RimWellPath* wellPath,
|
||||||
|
size_t timeStep,
|
||||||
|
const std::set<RigCompletionData::CompletionType>& completionTypes,
|
||||||
|
bool* isIntersectingOtherLgrs);
|
||||||
|
|
||||||
static int firstAvailableLgrId(const RigMainGrid* mainGrid);
|
static int firstAvailableLgrId(const RigMainGrid* mainGrid);
|
||||||
};
|
};
|
||||||
|
@ -75,23 +75,20 @@ CAF_CMD_SOURCE_INIT(RicCreateTemporaryLgrFeature, "RicCreateTemporaryLgrFeature"
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicCreateTemporaryLgrFeature::createLgrsForWellPath(RimWellPath* wellPath,
|
void RicCreateTemporaryLgrFeature::createLgrsForWellPaths(std::vector<RimWellPath*> wellPaths,
|
||||||
RimEclipseCase* eclipseCase,
|
RimEclipseCase* eclipseCase,
|
||||||
size_t timeStep,
|
size_t timeStep,
|
||||||
caf::VecIjk lgrCellCounts,
|
caf::VecIjk lgrCellCounts,
|
||||||
Lgr::SplitType splitType,
|
Lgr::SplitType splitType,
|
||||||
const std::set<RigCompletionData::CompletionType>& completionTypes,
|
const std::set<RigCompletionData::CompletionType>& completionTypes,
|
||||||
bool* intersectingOtherLgrs)
|
QStringList* wellsIntersectingOtherLgrs)
|
||||||
{
|
{
|
||||||
auto eclipseCaseData = eclipseCase->eclipseCaseData();
|
auto eclipseCaseData = eclipseCase->eclipseCaseData();
|
||||||
RigActiveCellInfo* activeCellInfo = eclipseCaseData->activeCellInfo(RiaDefines::MATRIX_MODEL);
|
RigActiveCellInfo* activeCellInfo = eclipseCaseData->activeCellInfo(RiaDefines::MATRIX_MODEL);
|
||||||
RigActiveCellInfo* fractureActiveCellInfo = eclipseCaseData->activeCellInfo(RiaDefines::FRACTURE_MODEL);
|
RigActiveCellInfo* fractureActiveCellInfo = eclipseCaseData->activeCellInfo(RiaDefines::FRACTURE_MODEL);
|
||||||
bool intersectingLgrs = false;
|
|
||||||
|
|
||||||
auto lgrs = RicExportLgrFeature::buildLgrsForWellPath(
|
auto lgrs = RicExportLgrFeature::buildLgrsForWellPaths(
|
||||||
wellPath, eclipseCase, timeStep, lgrCellCounts, splitType, completionTypes, &intersectingLgrs);
|
wellPaths, eclipseCase, timeStep, lgrCellCounts, splitType, completionTypes, wellsIntersectingOtherLgrs);
|
||||||
|
|
||||||
if (intersectingLgrs) *intersectingOtherLgrs = true;
|
|
||||||
|
|
||||||
for (const auto& lgr : lgrs)
|
for (const auto& lgr : lgrs)
|
||||||
{
|
{
|
||||||
@ -174,25 +171,19 @@ void RicCreateTemporaryLgrFeature::onActionTriggered(bool isChecked)
|
|||||||
|
|
||||||
RicDeleteTemporaryLgrsFeature::deleteAllTemporaryLgrs(eclipseCase);
|
RicDeleteTemporaryLgrsFeature::deleteAllTemporaryLgrs(eclipseCase);
|
||||||
|
|
||||||
RicExportLgrFeature::resetLgrNaming();
|
QStringList wellsIntersectingOtherLgrs;
|
||||||
bool intersectingOtherLgrs = false;
|
|
||||||
for (const auto& wellPath : wellPaths)
|
|
||||||
{
|
|
||||||
bool intersectingLgrs = false;
|
|
||||||
createLgrsForWellPath(wellPath,
|
|
||||||
eclipseCase,
|
|
||||||
timeStep,
|
|
||||||
lgrCellCounts,
|
|
||||||
splitType,
|
|
||||||
completionTypes,
|
|
||||||
&intersectingLgrs);
|
|
||||||
|
|
||||||
if (intersectingLgrs) intersectingOtherLgrs = true;
|
createLgrsForWellPaths(wellPaths,
|
||||||
}
|
eclipseCase,
|
||||||
|
timeStep,
|
||||||
|
lgrCellCounts,
|
||||||
|
splitType,
|
||||||
|
completionTypes,
|
||||||
|
&wellsIntersectingOtherLgrs);
|
||||||
|
|
||||||
updateViews(eclipseCase);
|
updateViews(eclipseCase);
|
||||||
|
|
||||||
if (intersectingOtherLgrs)
|
if (!wellsIntersectingOtherLgrs.empty())
|
||||||
{
|
{
|
||||||
QMessageBox::warning(nullptr,
|
QMessageBox::warning(nullptr,
|
||||||
"LGR cells intersected",
|
"LGR cells intersected",
|
||||||
|
@ -46,13 +46,13 @@ class RicCreateTemporaryLgrFeature : public caf::CmdFeature
|
|||||||
CAF_CMD_HEADER_INIT;
|
CAF_CMD_HEADER_INIT;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void createLgrsForWellPath(RimWellPath* wellPath,
|
void createLgrsForWellPaths(std::vector<RimWellPath*> wellPaths,
|
||||||
RimEclipseCase* eclipseCase,
|
RimEclipseCase* eclipseCase,
|
||||||
size_t timeStep,
|
size_t timeStep,
|
||||||
caf::VecIjk lgrCellCounts,
|
caf::VecIjk lgrCellCounts,
|
||||||
Lgr::SplitType splitType,
|
Lgr::SplitType splitType,
|
||||||
const std::set<RigCompletionData::CompletionType>& completionTypes,
|
const std::set<RigCompletionData::CompletionType>& completionTypes,
|
||||||
bool* intersectingOtherLgrs);
|
QStringList* wellsIntersectingOtherLgrs);
|
||||||
|
|
||||||
void updateViews(RimEclipseCase* eclipseCase);
|
void updateViews(RimEclipseCase* eclipseCase);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user