#3578 LGR export. Not exporting LGRs for wells that already have intersecting LGRs

This commit is contained in:
Bjørn Erik Jensen
2018-10-30 11:05:27 +01:00
parent 080b8506cd
commit ad3a3f46ee
2 changed files with 24 additions and 17 deletions

View File

@@ -36,6 +36,7 @@
#include "RiaLogging.h" #include "RiaLogging.h"
#include "RiaWellNameComparer.h" #include "RiaWellNameComparer.h"
#include <QStringList>
#include "cafCmdFeatureManager.h" #include "cafCmdFeatureManager.h"
@@ -91,7 +92,7 @@ void RicfExportLgrForCompletions::execute()
} }
caf::VecIjk lgrCellCounts(m_refinementI, m_refinementJ, m_refinementK); caf::VecIjk lgrCellCounts(m_refinementI, m_refinementJ, m_refinementK);
bool intersectingOtherLgrs = false; QStringList wellsWithIntersectingLgrs;
for (const auto wellPath : wellPaths) for (const auto wellPath : wellPaths)
{ {
if (wellPath) if (wellPath)
@@ -100,13 +101,14 @@ void RicfExportLgrForCompletions::execute()
feature->exportLgrsForWellPath(exportFolder, wellPath, eclipseCase, m_timeStep, lgrCellCounts, m_splitType(), feature->exportLgrsForWellPath(exportFolder, wellPath, eclipseCase, m_timeStep, lgrCellCounts, m_splitType(),
{RigCompletionData::PERFORATION, RigCompletionData::FRACTURE, RigCompletionData::FISHBONES}, &intersectingLgrs); {RigCompletionData::PERFORATION, RigCompletionData::FRACTURE, RigCompletionData::FISHBONES}, &intersectingLgrs);
if (intersectingLgrs) intersectingOtherLgrs = true; if (intersectingLgrs) wellsWithIntersectingLgrs.push_back(wellPath->name());
} }
} }
if (intersectingOtherLgrs) if (!wellsWithIntersectingLgrs.empty())
{ {
RiaLogging::error("exportLgrForCompletions: At least one completion intersects with an LGR. No output for those completions produced"); auto wellsList = wellsWithIntersectingLgrs.join(", ");
RiaLogging::error("exportLgrForCompletions: No export for some wells due to existing intersecting LGR(s).Affected wells : " + wellsList);
} }
} }
} }

View File

@@ -52,6 +52,7 @@
#include <QFileInfo> #include <QFileInfo>
#include <QMessageBox> #include <QMessageBox>
#include <QTextStream> #include <QTextStream>
#include <QStringList>
#include <cafPdmUiPropertyViewDialog.h> #include <cafPdmUiPropertyViewDialog.h>
#include <cafSelectionManager.h> #include <cafSelectionManager.h>
@@ -270,15 +271,18 @@ void RicExportLgrFeature::exportLgrsForWellPath(const QString& export
completionTypes, completionTypes,
intersectingOtherLgrs); intersectingOtherLgrs);
// Export if (!*intersectingOtherLgrs)
QFile file; {
QString fileName = caf::Utils::makeValidFileBasename(QString("LGR_%1").arg(wellPath->name())) + ".dat"; // Export
openFileForExport(exportFolder, fileName, &file); QFile file;
QTextStream stream(&file); QString fileName = caf::Utils::makeValidFileBasename(QString("LGR_%1").arg(wellPath->name())) + ".dat";
stream.setRealNumberNotation(QTextStream::FixedNotation); openFileForExport(exportFolder, fileName, &file);
stream.setRealNumberPrecision(2); QTextStream stream(&file);
exportLgrs(stream, lgrs); stream.setRealNumberNotation(QTextStream::FixedNotation);
file.close(); stream.setRealNumberPrecision(2);
exportLgrs(stream, lgrs);
file.close();
}
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -509,7 +513,7 @@ void RicExportLgrFeature::onActionTriggered(bool isChecked)
auto lgrCellCounts = dialogData->lgrCellCount(); auto lgrCellCounts = dialogData->lgrCellCount();
size_t timeStep = dialogData->timeStep(); size_t timeStep = dialogData->timeStep();
bool intersectingOtherLgrs = false; QStringList wellsWithIntersectingLgrs;
for (const auto& wellPath : wellPaths) for (const auto& wellPath : wellPaths)
{ {
bool intersectingLgrs = false; bool intersectingLgrs = false;
@@ -522,14 +526,15 @@ void RicExportLgrFeature::onActionTriggered(bool isChecked)
dialogData->completionTypes(), dialogData->completionTypes(),
&intersectingLgrs); &intersectingLgrs);
if (intersectingLgrs) intersectingOtherLgrs = true; if (intersectingLgrs) wellsWithIntersectingLgrs.push_back(wellPath->name());
} }
if (intersectingOtherLgrs) if (!wellsWithIntersectingLgrs.empty())
{ {
auto wellsList = wellsWithIntersectingLgrs.join(", ");
QMessageBox::warning(nullptr, QMessageBox::warning(nullptr,
"LGR cells intersected", "LGR cells intersected",
"At least one completion intersects with an LGR. No output for those completions produced"); "No export for some wells due to existing intersecting LGR(s). Affected wells: " + wellsList);
} }
} }
} }