mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3038 Fracture Completion Summary : Add fracture summary to compdat export
This commit is contained in:
@@ -18,6 +18,8 @@
|
||||
|
||||
#include "RicExportFractureCompletionsImpl.h"
|
||||
|
||||
#include "RicWellPathFractureReportItem.h"
|
||||
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include "RimEclipseCase.h"
|
||||
@@ -34,15 +36,19 @@
|
||||
#include "RimWellPathFracture.h"
|
||||
#include "RimWellPathFractureCollection.h"
|
||||
|
||||
#include "RigCaseCellResultsData.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigEclipseToStimPlanCalculator.h"
|
||||
#include "RigEclipseToStimPlanCellTransmissibilityCalculator.h"
|
||||
#include "RigFractureCell.h"
|
||||
#include "RigFractureGrid.h"
|
||||
#include "RigFractureTransmissibilityEquations.h"
|
||||
#include "RigMainGrid.h"
|
||||
#include "RigResultAccessorFactory.h"
|
||||
#include "RigSimWellData.h"
|
||||
#include "RigSimulationWellCoordsAndMD.h"
|
||||
#include "RigTransmissibilityCondenser.h"
|
||||
#include "RigTransmissibilityEquations.h"
|
||||
#include "RigWellPath.h"
|
||||
#include "RigWellPathStimplanIntersector.h"
|
||||
|
||||
@@ -51,10 +57,11 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RigCompletionData>
|
||||
RicExportFractureCompletionsImpl::generateCompdatValuesForWellPath(RimWellPath* wellPath,
|
||||
RimEclipseCase* caseToApply,
|
||||
QTextStream* outputStreamForIntermediateResultsText)
|
||||
std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdatValuesForWellPath(
|
||||
RimWellPath* wellPath,
|
||||
RimEclipseCase* caseToApply,
|
||||
std::vector<RicWellPathFractureReportItem>* fractureDataForReport,
|
||||
QTextStream* outputStreamForIntermediateResultsText)
|
||||
{
|
||||
std::vector<RimFracture*> fracturesAlongWellPath;
|
||||
|
||||
@@ -73,6 +80,7 @@ std::vector<RigCompletionData>
|
||||
wellPath->completions()->wellNameForExport(),
|
||||
wellPath->wellPathGeometry(),
|
||||
fracturesAlongWellPath,
|
||||
fractureDataForReport,
|
||||
outputStreamForIntermediateResultsText);
|
||||
}
|
||||
|
||||
@@ -92,6 +100,7 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
|
||||
wellPath->completions()->wellNameForExport(),
|
||||
wellPath->wellPathGeometry(),
|
||||
fracturesAlongWellPath,
|
||||
nullptr,
|
||||
outputStreamForIntermediateResultsText);
|
||||
}
|
||||
|
||||
@@ -119,7 +128,7 @@ std::vector<RigCompletionData>
|
||||
}
|
||||
|
||||
std::vector<RigCompletionData> branchCompletions = generateCompdatValues(
|
||||
eclipseCase, well->name(), branches[branchIndex], fractures, outputStreamForIntermediateResultsText);
|
||||
eclipseCase, well->name(), branches[branchIndex], fractures, nullptr, outputStreamForIntermediateResultsText);
|
||||
|
||||
completionData.insert(completionData.end(), branchCompletions.begin(), branchCompletions.end());
|
||||
}
|
||||
@@ -131,10 +140,11 @@ std::vector<RigCompletionData>
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RigCompletionData>
|
||||
RicExportFractureCompletionsImpl::generateCompdatValues(RimEclipseCase* caseToApply,
|
||||
const QString& wellPathName,
|
||||
const RigWellPath* wellPathGeometry,
|
||||
const std::vector<RimFracture*>& fractures,
|
||||
RicExportFractureCompletionsImpl::generateCompdatValues(RimEclipseCase* caseToApply,
|
||||
const QString& wellPathName,
|
||||
const RigWellPath* wellPathGeometry,
|
||||
const std::vector<RimFracture*>& fractures,
|
||||
std::vector<RicWellPathFractureReportItem>* fractureDataReportItems,
|
||||
QTextStream* outputStreamForIntermediateResultsText)
|
||||
{
|
||||
std::vector<RigCompletionData> fractureCompletions;
|
||||
@@ -180,57 +190,17 @@ std::vector<RigCompletionData>
|
||||
}
|
||||
}
|
||||
|
||||
using CellIdxSpace = RigTransmissibilityCondenser::CellAddress;
|
||||
RigTransmissibilityCondenser transCondenser;
|
||||
|
||||
//////
|
||||
// Calculate Matrix To Fracture Trans
|
||||
RigEclipseToStimPlanCalculator eclToFractureCalc(caseToApply,
|
||||
fracture->transformMatrix(),
|
||||
fracture->fractureTemplate()->skinFactor(),
|
||||
cDarcyInCorrectUnit,
|
||||
*fractureGrid);
|
||||
|
||||
const std::vector<RigFractureCell>& fractureCells = fractureGrid->fractureCells();
|
||||
|
||||
for (const RigFractureCell& fractureCell : fractureCells)
|
||||
{
|
||||
if (!fractureCell.hasNonZeroConductivity()) continue;
|
||||
|
||||
RigEclipseToStimPlanCellTransmissibilityCalculator eclToFractureTransCalc(caseToApply,
|
||||
fracture->transformMatrix(),
|
||||
fracture->fractureTemplate()->skinFactor(),
|
||||
cDarcyInCorrectUnit,
|
||||
fractureCell);
|
||||
|
||||
const std::vector<size_t>& fractureCellContributingEclipseCells =
|
||||
eclToFractureTransCalc.globalIndiciesToContributingEclipseCells();
|
||||
const std::vector<double>& fractureCellContributingEclipseCellTransmissibilities =
|
||||
eclToFractureTransCalc.contributingEclipseCellTransmissibilities();
|
||||
|
||||
size_t stimPlanCellIndex = fractureGrid->getGlobalIndexFromIJ(fractureCell.getI(), fractureCell.getJ());
|
||||
|
||||
auto truncatedFractureCellIndices =
|
||||
RimFractureContainmentTools::fracturedCellsTruncatedByFaults(caseToApply, fracture);
|
||||
|
||||
for (size_t i = 0; i < fractureCellContributingEclipseCells.size(); i++)
|
||||
{
|
||||
if (fracture->isEclipseCellWithinContainment(caseToApply->eclipseCaseData()->mainGrid(),
|
||||
truncatedFractureCellIndices,
|
||||
fractureCellContributingEclipseCells[i]))
|
||||
{
|
||||
if (useFiniteConductivityInFracture)
|
||||
{
|
||||
transCondenser.addNeighborTransmissibility(
|
||||
{true, CellIdxSpace::ECLIPSE, fractureCellContributingEclipseCells[i]},
|
||||
{false, CellIdxSpace::STIMPLAN, stimPlanCellIndex},
|
||||
fractureCellContributingEclipseCellTransmissibilities[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
transCondenser.addNeighborTransmissibility(
|
||||
{true, CellIdxSpace::ECLIPSE, fractureCellContributingEclipseCells[i]},
|
||||
{true, CellIdxSpace::WELL, 1},
|
||||
fractureCellContributingEclipseCellTransmissibilities[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
eclToFractureCalc.appendDataToTransmissibilityCondenser(fracture, useFiniteConductivityInFracture, &transCondenser);
|
||||
|
||||
//////
|
||||
// Calculate Transmissibility in the fracture: From one StimPlan Cell to the other
|
||||
@@ -415,6 +385,108 @@ std::vector<RigCompletionData>
|
||||
}
|
||||
}
|
||||
|
||||
if (fractureDataReportItems)
|
||||
{
|
||||
QString fractureTemplateName;
|
||||
if (fracture->fractureTemplate())
|
||||
{
|
||||
fractureTemplateName = fracture->fractureTemplate()->name();
|
||||
}
|
||||
RicWellPathFractureReportItem reportItem(wellPathName, fracture->name(), fractureTemplateName);
|
||||
|
||||
double transmissibility = 0.0;
|
||||
double fcd = -1.0;
|
||||
double area = 0.0;
|
||||
|
||||
for (const auto& c : allCompletionsForOneFracture)
|
||||
{
|
||||
transmissibility += c.transmissibility();
|
||||
}
|
||||
|
||||
auto areaPerEclipseCell = eclToFractureCalc.areaPerEclipseCell();
|
||||
for (const auto& areaPerEclipseCell : areaPerEclipseCell)
|
||||
{
|
||||
area += areaPerEclipseCell.second;
|
||||
}
|
||||
|
||||
reportItem.setData(transmissibility, allCompletionsForOneFracture.size(), fcd, area);
|
||||
|
||||
double conductivity = 0.0;
|
||||
double width = 0.0;
|
||||
double height = 0.0;
|
||||
double halfLength = 0.0;
|
||||
{
|
||||
auto* ellipseTemplate = dynamic_cast<RimEllipseFractureTemplate*>(fracTemplate);
|
||||
if (ellipseTemplate)
|
||||
{
|
||||
conductivity = ellipseTemplate->conductivity();
|
||||
width = ellipseTemplate->width();
|
||||
height = ellipseTemplate->height();
|
||||
halfLength = ellipseTemplate->halfLength();
|
||||
}
|
||||
|
||||
auto* stimplanTemplate = dynamic_cast<RimStimPlanFractureTemplate*>(fracTemplate);
|
||||
if (stimplanTemplate)
|
||||
{
|
||||
conductivity = stimplanTemplate->areaWeightedConductivity();
|
||||
width = stimplanTemplate->areaWeightedWidth();
|
||||
|
||||
height = stimplanTemplate->longestYRange();
|
||||
|
||||
double xLength = 0.0;
|
||||
if (height > 1e-9)
|
||||
{
|
||||
xLength = area / height;
|
||||
}
|
||||
|
||||
// Compute half length defined as (total area / (H/2) )
|
||||
halfLength = xLength / 2.0;
|
||||
}
|
||||
}
|
||||
reportItem.setWidthAndConductivity(width, conductivity);
|
||||
reportItem.setHeightAndHalfLength(height, halfLength);
|
||||
|
||||
double areaWeightedEclipseTransmissibility = 0.0;
|
||||
|
||||
if (caseToApply && caseToApply->eclipseCaseData())
|
||||
{
|
||||
RigCaseCellResultsData* gridCellResults = caseToApply->results(RiaDefines::MATRIX_MODEL);
|
||||
if (gridCellResults)
|
||||
{
|
||||
gridCellResults->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "TRANX");
|
||||
gridCellResults->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "TRANY");
|
||||
gridCellResults->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "TRANZ");
|
||||
}
|
||||
|
||||
cvf::ref<RigResultAccessor> tranxAccessObject = RigResultAccessorFactory::createFromUiResultName(
|
||||
caseToApply->eclipseCaseData(), 0, RiaDefines::MATRIX_MODEL, 0, "TRANX");
|
||||
|
||||
cvf::ref<RigResultAccessor> tranyAccessObject = RigResultAccessorFactory::createFromUiResultName(
|
||||
caseToApply->eclipseCaseData(), 0, RiaDefines::MATRIX_MODEL, 0, "TRANY");
|
||||
|
||||
cvf::ref<RigResultAccessor> tranzAccessObject = RigResultAccessorFactory::createFromUiResultName(
|
||||
caseToApply->eclipseCaseData(), 0, RiaDefines::MATRIX_MODEL, 0, "TRANZ");
|
||||
|
||||
if (tranxAccessObject.notNull() && tranyAccessObject.notNull() && tranzAccessObject.notNull())
|
||||
{
|
||||
for (const auto& areaPerEclipseCell : areaPerEclipseCell)
|
||||
{
|
||||
double tranx = tranxAccessObject->cellScalarGlobIdx(areaPerEclipseCell.first);
|
||||
double trany = tranyAccessObject->cellScalarGlobIdx(areaPerEclipseCell.first);
|
||||
double tranz = tranzAccessObject->cellScalarGlobIdx(areaPerEclipseCell.first);
|
||||
|
||||
double transmissibilityForCell = RigTransmissibilityEquations::totalConnectionFactor(tranx, trany, tranz);
|
||||
|
||||
areaWeightedEclipseTransmissibility += transmissibilityForCell * areaPerEclipseCell.second / area;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
reportItem.setAreaWeightedTransmissibility(areaWeightedEclipseTransmissibility);
|
||||
|
||||
fractureDataReportItems->push_back(reportItem);
|
||||
}
|
||||
|
||||
std::copy(
|
||||
allCompletionsForOneFracture.begin(), allCompletionsForOneFracture.end(), std::back_inserter(fractureCompletions));
|
||||
|
||||
@@ -424,18 +496,18 @@ std::vector<RigCompletionData>
|
||||
<< "\n"
|
||||
<< "\n"
|
||||
<< "\n----------- All Transmissibilities " << fracture->name() << " -------------------- \n\n";
|
||||
|
||||
|
||||
(*outputStreamForIntermediateResultsText)
|
||||
<< QString::fromStdString(transCondenser.neighborTransDebugOutput(mainGrid, fractureGrid));
|
||||
|
||||
|
||||
(*outputStreamForIntermediateResultsText)
|
||||
<< "\n"
|
||||
<< "\n"
|
||||
<< "\n----------- Condensed Results " << fracture->name() << " -------------------- \n\n";
|
||||
|
||||
|
||||
(*outputStreamForIntermediateResultsText)
|
||||
<< QString::fromStdString(transCondenser.condensedTransDebugOutput(mainGrid, fractureGrid));
|
||||
|
||||
|
||||
(*outputStreamForIntermediateResultsText) << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ class RigWellPath;
|
||||
class RimEclipseCase;
|
||||
class RimFracture;
|
||||
class RimSimWellInView;
|
||||
class RicWellPathFractureReportItem;
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@@ -36,9 +37,11 @@ class RimSimWellInView;
|
||||
class RicExportFractureCompletionsImpl
|
||||
{
|
||||
public:
|
||||
static std::vector<RigCompletionData> generateCompdatValuesForWellPath(RimWellPath* wellPath,
|
||||
RimEclipseCase* caseToApply,
|
||||
QTextStream* outputStreamForIntermediateResultsText);
|
||||
static std::vector<RigCompletionData>
|
||||
generateCompdatValuesForWellPath(RimWellPath* wellPath,
|
||||
RimEclipseCase* caseToApply,
|
||||
std::vector<RicWellPathFractureReportItem>* fractureDataForReport,
|
||||
QTextStream* outputStreamForIntermediateResultsText);
|
||||
|
||||
static std::vector<RigCompletionData>
|
||||
generateCompdatValuesForWellPathSingleFracture(RimWellPath* wellPath,
|
||||
@@ -51,9 +54,10 @@ public:
|
||||
QTextStream* outputStreamForIntermediateResultsText);
|
||||
|
||||
private:
|
||||
static std::vector<RigCompletionData> generateCompdatValues(RimEclipseCase* caseToApply,
|
||||
const QString& wellPathName,
|
||||
const RigWellPath* wellPathGeometry,
|
||||
const std::vector<RimFracture*>& fractures,
|
||||
static std::vector<RigCompletionData> generateCompdatValues(RimEclipseCase* caseToApply,
|
||||
const QString& wellPathName,
|
||||
const RigWellPath* wellPathGeometry,
|
||||
const std::vector<RimFracture*>& fractures,
|
||||
std::vector<RicWellPathFractureReportItem>* fractureDataForReport,
|
||||
QTextStream* outputStreamForIntermediateResultsText);
|
||||
};
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "RicExportFeatureImpl.h"
|
||||
#include "RicExportFractureCompletionsImpl.h"
|
||||
#include "RicFishbonesTransmissibilityCalculationFeatureImp.h"
|
||||
#include "RicWellPathFractureReportItem.h"
|
||||
|
||||
#include "RifEclipseDataTableFormatter.h"
|
||||
|
||||
@@ -57,6 +58,7 @@
|
||||
|
||||
#include "cvfPlane.h"
|
||||
|
||||
#include "RicWellPathFractureTextReportFeatureImpl.h"
|
||||
#include "RigVirtualPerforationTransmissibilities.h"
|
||||
#include <QDir>
|
||||
|
||||
@@ -73,23 +75,23 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions(const std::ve
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
std::vector<RimWellPath*> usedWellPaths;
|
||||
for (RimWellPath* wellPath : wellPaths)
|
||||
{
|
||||
if (wellPath->unitSystem() == exportSettings.caseToApply->eclipseCaseData()->unitsType())
|
||||
{
|
||||
usedWellPaths.push_back(wellPath);
|
||||
usedWellPaths.push_back(wellPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
int caseId = exportSettings.caseToApply->caseId();
|
||||
int caseId = exportSettings.caseToApply->caseId();
|
||||
QString format = QString("Unit systems for well path \"%1\" must match unit system of chosen eclipse case \"%2\"");
|
||||
QString errMsg = format.arg(wellPath->name()).arg(caseId);
|
||||
QString errMsg = format.arg(wellPath->name()).arg(caseId);
|
||||
RiaLogging::error(errMsg);
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<RicWellPathFractureReportItem> fractureDataReportItems;
|
||||
|
||||
// FractureTransmissibilityExportInformation
|
||||
std::unique_ptr<QTextStream> fractureTransmissibilityExportInformationStream = nullptr;
|
||||
@@ -144,7 +146,7 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions(const std::ve
|
||||
{
|
||||
std::vector<RigCompletionData> perforationCompletionData =
|
||||
generatePerforationsCompdatValues(wellPath, exportSettings);
|
||||
|
||||
|
||||
appendCompletionData(&completionsPerEclipseCellAllCompletionTypes, perforationCompletionData);
|
||||
appendCompletionData(&completionsPerEclipseCellPerforations, perforationCompletionData);
|
||||
}
|
||||
@@ -155,7 +157,7 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions(const std::ve
|
||||
std::vector<RigCompletionData> fishbonesCompletionData =
|
||||
RicFishbonesTransmissibilityCalculationFeatureImp::generateFishboneCompdatValuesUsingAdjustedCellVolume(
|
||||
wellPath, exportSettings);
|
||||
|
||||
|
||||
appendCompletionData(&completionsPerEclipseCellAllCompletionTypes, fishbonesCompletionData);
|
||||
appendCompletionData(&completionsPerEclipseCellFishbones, fishbonesCompletionData);
|
||||
}
|
||||
@@ -165,8 +167,11 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions(const std::ve
|
||||
{
|
||||
std::vector<RigCompletionData> fractureCompletionData =
|
||||
RicExportFractureCompletionsImpl::generateCompdatValuesForWellPath(
|
||||
wellPath, exportSettings.caseToApply(), fractureTransmissibilityExportInformationStream.get());
|
||||
|
||||
wellPath,
|
||||
exportSettings.caseToApply(),
|
||||
&fractureDataReportItems,
|
||||
fractureTransmissibilityExportInformationStream.get());
|
||||
|
||||
appendCompletionData(&completionsPerEclipseCellAllCompletionTypes, fractureCompletionData);
|
||||
appendCompletionData(&completionsPerEclipseCellFracture, fractureCompletionData);
|
||||
}
|
||||
@@ -221,7 +226,12 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions(const std::ve
|
||||
if (exportSettings.fileSplit == RicExportCompletionDataSettingsUi::UNIFIED_FILE)
|
||||
{
|
||||
const QString fileName = QString("UnifiedCompletions_%1").arg(eclipseCaseName);
|
||||
sortAndExportCompletionsToFile(exportSettings.folder, fileName, completions, exportSettings.compdatExport);
|
||||
sortAndExportCompletionsToFile(exportSettings.caseToApply,
|
||||
exportSettings.folder,
|
||||
fileName,
|
||||
completions,
|
||||
fractureDataReportItems,
|
||||
exportSettings.compdatExport);
|
||||
progress.incrementProgress();
|
||||
}
|
||||
else if (exportSettings.fileSplit == RicExportCompletionDataSettingsUi::SPLIT_ON_WELL)
|
||||
@@ -240,7 +250,12 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions(const std::ve
|
||||
if (wellCompletions.empty()) continue;
|
||||
|
||||
QString fileName = QString("%1_unifiedCompletions_%2").arg(wellPath->name()).arg(eclipseCaseName);
|
||||
sortAndExportCompletionsToFile(exportSettings.folder, fileName, wellCompletions, exportSettings.compdatExport);
|
||||
sortAndExportCompletionsToFile(exportSettings.caseToApply,
|
||||
exportSettings.folder,
|
||||
fileName,
|
||||
wellCompletions,
|
||||
fractureDataReportItems,
|
||||
exportSettings.compdatExport);
|
||||
progress.incrementProgress();
|
||||
}
|
||||
}
|
||||
@@ -274,8 +289,12 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions(const std::ve
|
||||
if (completionType == RigCompletionData::PERFORATION) completionTypeText = "Perforation";
|
||||
|
||||
QString fileName = QString("%1_%2_%3").arg(wellPath->name()).arg(completionTypeText).arg(eclipseCaseName);
|
||||
sortAndExportCompletionsToFile(
|
||||
exportSettings.folder, fileName, wellCompletions, exportSettings.compdatExport);
|
||||
sortAndExportCompletionsToFile(exportSettings.caseToApply,
|
||||
exportSettings.folder,
|
||||
fileName,
|
||||
wellCompletions,
|
||||
fractureDataReportItems,
|
||||
exportSettings.compdatExport);
|
||||
}
|
||||
|
||||
progress.incrementProgress();
|
||||
@@ -301,7 +320,12 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions(const std::ve
|
||||
if (wellCompletions.empty()) continue;
|
||||
|
||||
QString fileName = QString("%1_Fractures_%2").arg(simWell->name()).arg(eclipseCaseName);
|
||||
sortAndExportCompletionsToFile(exportSettings.folder, fileName, wellCompletions, exportSettings.compdatExport);
|
||||
sortAndExportCompletionsToFile(exportSettings.caseToApply,
|
||||
exportSettings.folder,
|
||||
fileName,
|
||||
wellCompletions,
|
||||
fractureDataReportItems,
|
||||
exportSettings.compdatExport);
|
||||
|
||||
progress.incrementProgress();
|
||||
}
|
||||
@@ -336,7 +360,7 @@ std::vector<RigCompletionData>
|
||||
|
||||
{
|
||||
std::vector<RigCompletionData> completionData =
|
||||
RicExportFractureCompletionsImpl::generateCompdatValuesForWellPath(wellPath, eclipseCase, nullptr);
|
||||
RicExportFractureCompletionsImpl::generateCompdatValuesForWellPath(wellPath, eclipseCase, nullptr, nullptr);
|
||||
|
||||
std::copy(completionData.begin(), completionData.end(), std::back_inserter(completionsPerEclipseCell));
|
||||
}
|
||||
@@ -490,9 +514,11 @@ RigCompletionData
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicWellPathExportCompletionDataFeatureImpl::sortAndExportCompletionsToFile(
|
||||
RimEclipseCase* eclipseCase,
|
||||
const QString& folderName,
|
||||
const QString& fileName,
|
||||
std::vector<RigCompletionData>& completions,
|
||||
const std::vector<RicWellPathFractureReportItem>& wellPathFractureReportItems,
|
||||
RicExportCompletionDataSettingsUi::CompdatExportType exportType)
|
||||
{
|
||||
// Sort completions based on grid they belong to
|
||||
@@ -527,13 +553,15 @@ void RicWellPathExportCompletionDataFeatureImpl::sortAndExportCompletionsToFile(
|
||||
std::map<QString, std::vector<RigCompletionData>> completionsForGrid;
|
||||
completionsForGrid.insert(std::pair<QString, std::vector<RigCompletionData>>("", completionsForMainGrid));
|
||||
|
||||
exportCompdatAndWpimultTables(folderName, fileName, completionsForGrid, exportType);
|
||||
exportCompdatAndWpimultTables(
|
||||
eclipseCase, folderName, fileName, completionsForGrid, wellPathFractureReportItems, exportType);
|
||||
}
|
||||
|
||||
if (!completionsForSubGrids.empty())
|
||||
{
|
||||
QString lgrFileName = fileName + "_LGR";
|
||||
exportCompdatAndWpimultTables(folderName, lgrFileName, completionsForSubGrids, exportType);
|
||||
exportCompdatAndWpimultTables(
|
||||
eclipseCase, folderName, lgrFileName, completionsForSubGrids, wellPathFractureReportItems, exportType);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -541,9 +569,11 @@ void RicWellPathExportCompletionDataFeatureImpl::sortAndExportCompletionsToFile(
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicWellPathExportCompletionDataFeatureImpl::exportCompdatAndWpimultTables(
|
||||
RimEclipseCase* sourceCase,
|
||||
const QString& folderName,
|
||||
const QString& fileName,
|
||||
const std::map<QString, std::vector<RigCompletionData>>& completionsPerGrid,
|
||||
const std::vector<RicWellPathFractureReportItem>& wellPathFractureReportItems,
|
||||
RicExportCompletionDataSettingsUi::CompdatExportType exportType)
|
||||
{
|
||||
if (completionsPerGrid.empty()) return;
|
||||
@@ -566,7 +596,37 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompdatAndWpimultTables(
|
||||
return;
|
||||
}
|
||||
|
||||
QTextStream stream(&exportFile);
|
||||
QTextStream stream(&exportFile);
|
||||
|
||||
if (!wellPathFractureReportItems.empty())
|
||||
{
|
||||
std::vector<RimWellPath*> wellPathsToReport;
|
||||
{
|
||||
std::set<RimWellPath*> wellPathsSet;
|
||||
|
||||
auto allWellPaths = RicWellPathFractureTextReportFeatureImpl::wellPathsWithFractures();
|
||||
for (const auto& wellPath : allWellPaths)
|
||||
{
|
||||
for (const auto& reportItem : wellPathFractureReportItems)
|
||||
{
|
||||
if (reportItem.wellPathName() == wellPath->name())
|
||||
{
|
||||
wellPathsSet.insert(wellPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::copy(wellPathsSet.begin(), wellPathsSet.end(), std::back_inserter(wellPathsToReport));
|
||||
|
||||
RicWellPathFractureTextReportFeatureImpl reportGenerator;
|
||||
|
||||
QString summaryText =
|
||||
reportGenerator.wellPathFractureReport(sourceCase, wellPathsToReport, wellPathFractureReportItems);
|
||||
|
||||
stream << summaryText;
|
||||
}
|
||||
}
|
||||
|
||||
RifEclipseDataTableFormatter formatter(stream);
|
||||
formatter.setColumnSpacing(3);
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "RigCompletionData.h"
|
||||
|
||||
#include "RicExportCompletionDataSettingsUi.h"
|
||||
#include "RicWellPathFractureReportItem.h"
|
||||
|
||||
#include "cvfBase.h"
|
||||
#include "cvfVector3.h"
|
||||
@@ -163,14 +164,18 @@ private:
|
||||
static RigCompletionData combineEclipseCellCompletions(const std::vector<RigCompletionData>& completions,
|
||||
const RicExportCompletionDataSettingsUi& settings);
|
||||
|
||||
static void sortAndExportCompletionsToFile(const QString& exportFolder,
|
||||
static void sortAndExportCompletionsToFile(RimEclipseCase* eclipseCase,
|
||||
const QString& exportFolder,
|
||||
const QString& fileName,
|
||||
std::vector<RigCompletionData>& completions,
|
||||
const std::vector<RicWellPathFractureReportItem>& wellPathFractureReportItems,
|
||||
RicExportCompletionDataSettingsUi::CompdatExportType exportType);
|
||||
|
||||
static void exportCompdatAndWpimultTables(const QString& folderName,
|
||||
static void exportCompdatAndWpimultTables(RimEclipseCase* sourceCase,
|
||||
const QString& folderName,
|
||||
const QString& fileName,
|
||||
const std::map<QString, std::vector<RigCompletionData>>& completionsPerGrid,
|
||||
const std::vector<RicWellPathFractureReportItem>& wellPathFractureReportItems,
|
||||
RicExportCompletionDataSettingsUi::CompdatExportType exportType);
|
||||
|
||||
static void exportCompdatTableUsingFormatter(RifEclipseDataTableFormatter& formatter,
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "RiuTextDialog.h"
|
||||
|
||||
#include <QAction>
|
||||
#include "RicWellPathFractureReportItem.h"
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicWellPathFractureTextReportFeature, "RicWellPathFractureTextReportFeature");
|
||||
|
||||
@@ -68,7 +69,8 @@ void RicWellPathFractureTextReportFeature::onActionTriggered(bool isChecked)
|
||||
|
||||
RicWellPathFractureTextReportFeatureImpl impl;
|
||||
|
||||
QString reportText = impl.wellPathFractureReport(eclipseCase, wellPaths);
|
||||
std::vector<RicWellPathFractureReportItem> wellPathFractureReportItems;
|
||||
QString reportText = impl.wellPathFractureReport(eclipseCase, wellPaths, wellPathFractureReportItems);
|
||||
|
||||
RiuTextDialog* textDialog = new RiuTextDialog(nullptr);
|
||||
textDialog->resize(QSize(1000, 1000));
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RicExportFractureCompletionsImpl.h"
|
||||
#include "RicWellPathFractureReportItem.h"
|
||||
|
||||
#include "RifEclipseDataTableFormatter.h"
|
||||
|
||||
@@ -30,6 +31,7 @@
|
||||
#include "RimEllipseFractureTemplate.h"
|
||||
#include "RimFileWellPath.h"
|
||||
#include "RimFractureContainment.h"
|
||||
#include "RimFractureTemplate.h"
|
||||
#include "RimFractureTemplateCollection.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimProject.h"
|
||||
@@ -40,8 +42,6 @@
|
||||
#include "RimWellPathFracture.h"
|
||||
#include "RimWellPathFractureCollection.h"
|
||||
|
||||
#include "cvfGeometryTools.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -69,14 +69,11 @@ RifEclipseOutputTableColumn floatNumberColumn(const QString& text)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicWellPathFractureTextReportFeatureImpl::wellPathFractureReport(RimEclipseCase* sourceCase,
|
||||
const std::vector<RimWellPath*>& wellPaths)
|
||||
QString RicWellPathFractureTextReportFeatureImpl::wellPathFractureReport(
|
||||
RimEclipseCase* sourceCase,
|
||||
const std::vector<RimWellPath*>& wellPaths,
|
||||
const std::vector<RicWellPathFractureReportItem>& wellPathFractureReportItems)
|
||||
{
|
||||
if (!sourceCase || wellPaths.empty())
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
QString lineStart = "--";
|
||||
|
||||
QString text;
|
||||
@@ -164,7 +161,7 @@ QString RicWellPathFractureTextReportFeatureImpl::wellPathFractureReport(RimEcli
|
||||
}
|
||||
|
||||
{
|
||||
QString tableText = createFractureCompletionSummaryText(sourceCase, wellPathFractures);
|
||||
QString tableText = createFractureCompletionSummaryText(wellPathFractureReportItems);
|
||||
textStream << tableText;
|
||||
textStream << lineStart << "\n";
|
||||
}
|
||||
@@ -569,8 +566,7 @@ QString RicWellPathFractureTextReportFeatureImpl::createFractureInstancesText(
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicWellPathFractureTextReportFeatureImpl::createFractureCompletionSummaryText(
|
||||
RimEclipseCase* sourceCase,
|
||||
const std::vector<RimWellPathFracture*>& wellPathFractures) const
|
||||
const std::vector<RicWellPathFractureReportItem>& wellPathFractureReportItems) const
|
||||
{
|
||||
QString tableText;
|
||||
|
||||
@@ -606,7 +602,7 @@ QString RicWellPathFractureTextReportFeatureImpl::createFractureCompletionSummar
|
||||
formatter.add("[]"); // Fcd
|
||||
formatter.add("[m2]"); // Area
|
||||
formatter.add("[mDm]"); // KfWf
|
||||
formatter.add("[Md]"); // Kf
|
||||
formatter.add("[mD]"); // Kf
|
||||
formatter.add("[m]"); // wf
|
||||
formatter.add("[m]"); // Xf
|
||||
formatter.add("[m]"); // H
|
||||
@@ -619,80 +615,27 @@ QString RicWellPathFractureTextReportFeatureImpl::createFractureCompletionSummar
|
||||
// Cache the fracture template area, as this is a heavy operation
|
||||
std::map<RimFractureTemplate*, double> templateAreaMap;
|
||||
|
||||
for (auto& fracture : wellPathFractures)
|
||||
for (const auto& reportItem : wellPathFractureReportItems)
|
||||
{
|
||||
QString wellName;
|
||||
QString wellPathName, fractureName, fractureTemplateName;
|
||||
reportItem.getNames(wellPathName, fractureName, fractureTemplateName);
|
||||
|
||||
RimWellPath* wellPath = nullptr;
|
||||
fracture->firstAncestorOrThisOfType(wellPath);
|
||||
if (wellPath)
|
||||
{
|
||||
wellName = wellPath->name();
|
||||
}
|
||||
formatter.add(wellPathName);
|
||||
formatter.add(fractureName);
|
||||
formatter.add(fractureTemplateName);
|
||||
|
||||
formatter.add(wellName);
|
||||
formatter.add(fracture->name());
|
||||
formatter.add(reportItem.transmissibility());
|
||||
formatter.add(reportItem.connectionCount());
|
||||
formatter.add(reportItem.fcd());
|
||||
formatter.add(reportItem.area());
|
||||
|
||||
if (fracture->fractureTemplate())
|
||||
{
|
||||
formatter.add(fracture->fractureTemplate()->name());
|
||||
}
|
||||
else
|
||||
{
|
||||
formatter.add("NA");
|
||||
}
|
||||
formatter.add(reportItem.kfwf()); // KfWf
|
||||
formatter.add(reportItem.kf()); // Kf
|
||||
formatter.add(reportItem.wf()); // wf
|
||||
|
||||
std::vector<RigCompletionData> completionDataOneFracture =
|
||||
RicExportFractureCompletionsImpl::generateCompdatValuesForWellPathSingleFracture(
|
||||
wellPath, sourceCase, fracture, nullptr);
|
||||
|
||||
double aggregatedTransmissibility = 0.0;
|
||||
for (const auto& c : completionDataOneFracture)
|
||||
{
|
||||
aggregatedTransmissibility += c.transmissibility();
|
||||
}
|
||||
|
||||
double fractureArea = 0.0;
|
||||
|
||||
if (fracture->fractureTemplate())
|
||||
{
|
||||
auto it = templateAreaMap.find(fracture->fractureTemplate());
|
||||
if (it != templateAreaMap.end())
|
||||
{
|
||||
fractureArea = it->second;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::vector<cvf::Vec3f> nodeCoords;
|
||||
std::vector<cvf::uint> triangleIndices;
|
||||
|
||||
fracture->fractureTemplate()->fractureTriangleGeometry(&nodeCoords, &triangleIndices);
|
||||
|
||||
for (size_t triangleIndex = 0; triangleIndex < triangleIndices.size(); triangleIndex += 3)
|
||||
{
|
||||
std::vector<cvf::Vec3d> polygon;
|
||||
polygon.push_back(cvf::Vec3d(nodeCoords[triangleIndices[triangleIndex + 0]]));
|
||||
polygon.push_back(cvf::Vec3d(nodeCoords[triangleIndices[triangleIndex + 1]]));
|
||||
polygon.push_back(cvf::Vec3d(nodeCoords[triangleIndices[triangleIndex + 2]]));
|
||||
|
||||
auto areaVector = cvf::GeometryTools::polygonAreaNormal3D(polygon);
|
||||
double polygonArea = areaVector.length();
|
||||
fractureArea += polygonArea;
|
||||
}
|
||||
templateAreaMap[fracture->fractureTemplate()] = fractureArea;
|
||||
}
|
||||
}
|
||||
|
||||
formatter.add(aggregatedTransmissibility); // Tr
|
||||
formatter.add(completionDataOneFracture.size()); // #con
|
||||
formatter.add(1.0); // Fcd
|
||||
formatter.add(fractureArea); // Area
|
||||
formatter.add(3.0); // KfWf
|
||||
formatter.add(4.0); // Kf
|
||||
formatter.add(5.0); // wf
|
||||
formatter.add(6.0); // Xf
|
||||
formatter.add(7.0); // H
|
||||
formatter.add(8.0); // Km
|
||||
formatter.add(reportItem.xf()); // Xf
|
||||
formatter.add(reportItem.h()); // H
|
||||
formatter.add(reportItem.km()); // Km
|
||||
|
||||
formatter.rowCompleted();
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ class RimFractureTemplate;
|
||||
class RimEllipseFractureTemplate;
|
||||
class RimStimPlanFractureTemplate;
|
||||
class RifEclipseDataTableFormatter;
|
||||
class RicWellPathFractureReportItem;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
@@ -34,7 +35,9 @@ class RifEclipseDataTableFormatter;
|
||||
class RicWellPathFractureTextReportFeatureImpl
|
||||
{
|
||||
public:
|
||||
QString wellPathFractureReport(RimEclipseCase* sourceCase, const std::vector<RimWellPath*>& wellPaths);
|
||||
QString wellPathFractureReport(RimEclipseCase* sourceCase,
|
||||
const std::vector<RimWellPath*>& wellPaths,
|
||||
const std::vector<RicWellPathFractureReportItem>& wellPathFractureReportItems);
|
||||
|
||||
static std::vector<RimWellPath*> wellPathsWithFractures();
|
||||
|
||||
@@ -46,8 +49,8 @@ private:
|
||||
QString createFractureText(const std::vector<RimFractureTemplate*>& fractureTemplates) const;
|
||||
QString createFractureInstancesText(const std::vector<RimWellPathFracture*>& fractureTemplates) const;
|
||||
|
||||
QString createFractureCompletionSummaryText(RimEclipseCase* sourceCase,
|
||||
const std::vector<RimWellPathFracture*>& wellPathFractures) const;
|
||||
QString
|
||||
createFractureCompletionSummaryText(const std::vector<RicWellPathFractureReportItem>& wellPathFractureReportItems) const;
|
||||
|
||||
void configureFormatter(RifEclipseDataTableFormatter* formatter) const;
|
||||
};
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
class RimEclipseCase;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
|
||||
Reference in New Issue
Block a user