#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 "RiaWellNameComparer.h"
#include <QStringList>
#include "cafCmdFeatureManager.h"
@ -91,7 +92,7 @@ void RicfExportLgrForCompletions::execute()
}
caf::VecIjk lgrCellCounts(m_refinementI, m_refinementJ, m_refinementK);
bool intersectingOtherLgrs = false;
QStringList wellsWithIntersectingLgrs;
for (const auto wellPath : wellPaths)
{
if (wellPath)
@ -100,13 +101,14 @@ void RicfExportLgrForCompletions::execute()
feature->exportLgrsForWellPath(exportFolder, wellPath, eclipseCase, m_timeStep, lgrCellCounts, m_splitType(),
{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 <QMessageBox>
#include <QTextStream>
#include <QStringList>
#include <cafPdmUiPropertyViewDialog.h>
#include <cafSelectionManager.h>
@ -270,15 +271,18 @@ void RicExportLgrFeature::exportLgrsForWellPath(const QString& export
completionTypes,
intersectingOtherLgrs);
// Export
QFile file;
QString fileName = caf::Utils::makeValidFileBasename(QString("LGR_%1").arg(wellPath->name())) + ".dat";
openFileForExport(exportFolder, fileName, &file);
QTextStream stream(&file);
stream.setRealNumberNotation(QTextStream::FixedNotation);
stream.setRealNumberPrecision(2);
exportLgrs(stream, lgrs);
file.close();
if (!*intersectingOtherLgrs)
{
// Export
QFile file;
QString fileName = caf::Utils::makeValidFileBasename(QString("LGR_%1").arg(wellPath->name())) + ".dat";
openFileForExport(exportFolder, fileName, &file);
QTextStream stream(&file);
stream.setRealNumberNotation(QTextStream::FixedNotation);
stream.setRealNumberPrecision(2);
exportLgrs(stream, lgrs);
file.close();
}
}
//--------------------------------------------------------------------------------------------------
@ -509,7 +513,7 @@ void RicExportLgrFeature::onActionTriggered(bool isChecked)
auto lgrCellCounts = dialogData->lgrCellCount();
size_t timeStep = dialogData->timeStep();
bool intersectingOtherLgrs = false;
QStringList wellsWithIntersectingLgrs;
for (const auto& wellPath : wellPaths)
{
bool intersectingLgrs = false;
@ -522,14 +526,15 @@ void RicExportLgrFeature::onActionTriggered(bool isChecked)
dialogData->completionTypes(),
&intersectingLgrs);
if (intersectingLgrs) intersectingOtherLgrs = true;
if (intersectingLgrs) wellsWithIntersectingLgrs.push_back(wellPath->name());
}
if (intersectingOtherLgrs)
if (!wellsWithIntersectingLgrs.empty())
{
auto wellsList = wellsWithIntersectingLgrs.join(", ");
QMessageBox::warning(nullptr,
"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);
}
}
}