mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3130 Fracture Report : Display fractures report in text dialog
This commit is contained in:
parent
07530534ef
commit
0c1c454cdc
@ -9,6 +9,8 @@ ${CMAKE_CURRENT_LIST_DIR}/RicCaseAndFileExportSettingsUi.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicExportFractureCompletionsImpl.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicExportCompletionsForVisibleWellPathsFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicExportCompletionsForVisibleSimWellsFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathFractureTextReportFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathFractureTextReportFeatureImpl.h
|
||||
)
|
||||
|
||||
|
||||
@ -22,6 +24,8 @@ ${CMAKE_CURRENT_LIST_DIR}/RicCaseAndFileExportSettingsUi.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicExportFractureCompletionsImpl.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicExportCompletionsForVisibleWellPathsFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicExportCompletionsForVisibleSimWellsFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathFractureTextReportFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathFractureTextReportFeatureImpl.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
|
@ -0,0 +1,86 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2018 Statoil ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RicWellPathFractureTextReportFeature.h"
|
||||
#include "RicWellPathFractureTextReportFeatureImpl.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RimCase.h"
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimTools.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
#include "RimWellPathFracture.h"
|
||||
#include "RimWellPathFractureCollection.h"
|
||||
|
||||
#include "RiuTextDialog.h"
|
||||
|
||||
#include <QAction>
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicWellPathFractureTextReportFeature, "RicWellPathFractureTextReportFeature");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicWellPathFractureTextReportFeature::isCommandEnabled()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicWellPathFractureTextReportFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
RimEclipseCase* eclipseCase = nullptr;
|
||||
{
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
|
||||
std::vector<RimCase*> cases;
|
||||
proj->allCases(cases);
|
||||
for (auto c : cases)
|
||||
{
|
||||
if (dynamic_cast<RimEclipseCase*>(c))
|
||||
{
|
||||
eclipseCase = dynamic_cast<RimEclipseCase*>(c);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto wellPaths = RicWellPathFractureTextReportFeatureImpl::wellPathsWithFractures();
|
||||
|
||||
RicWellPathFractureTextReportFeatureImpl impl;
|
||||
|
||||
QString reportText = impl.wellPathFractureReport(eclipseCase, wellPaths);
|
||||
|
||||
RiuTextDialog* textDialog = new RiuTextDialog(nullptr);
|
||||
textDialog->resize(QSize(1000, 1000));
|
||||
textDialog->setWindowTitle("Fracture Report");
|
||||
textDialog->setText(reportText);
|
||||
textDialog->show();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicWellPathFractureTextReportFeature::setupActionLook(QAction* actionToSetup)
|
||||
{
|
||||
actionToSetup->setText("Show Fracture Completion Header for Well Paths");
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2018 Statoil ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicWellPathFractureTextReportFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
private:
|
||||
bool isCommandEnabled() override;
|
||||
void onActionTriggered(bool isChecked) override;
|
||||
void setupActionLook(QAction* actionToSetup) override;
|
||||
};
|
@ -0,0 +1,564 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2018 Statoil ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RicWellPathFractureTextReportFeatureImpl.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RifEclipseDataTableFormatter.h"
|
||||
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEllipseFractureTemplate.h"
|
||||
#include "RimFileWellPath.h"
|
||||
#include "RimFractureContainment.h"
|
||||
#include "RimFractureTemplateCollection.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimStimPlanFractureTemplate.h"
|
||||
#include "RimTools.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
#include "RimWellPathFracture.h"
|
||||
#include "RimWellPathFractureCollection.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString orientationText(RimFractureTemplate::FracOrientationEnum orientation)
|
||||
{
|
||||
return caf::AppEnum<RimFractureTemplate::FracOrientationEnum>::uiText(orientation);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseOutputTableDoubleFormatting floatWithThreeDigits()
|
||||
{
|
||||
return RifEclipseOutputTableDoubleFormatting(RIF_FLOAT, 3);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseOutputTableColumn floatNumberColumn(const QString& text)
|
||||
{
|
||||
return RifEclipseOutputTableColumn(text, RifEclipseOutputTableDoubleFormatting(RIF_FLOAT, 3), RIGHT);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicWellPathFractureTextReportFeatureImpl::wellPathFractureReport(const RimEclipseCase* sourceCase,
|
||||
const std::vector<RimWellPath*>& wellPaths)
|
||||
{
|
||||
if (!sourceCase || wellPaths.empty())
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
QString lineStart = "--";
|
||||
|
||||
QString text;
|
||||
QTextStream textStream(&text);
|
||||
|
||||
textStream << lineStart
|
||||
<< "========================================================================================================\n";
|
||||
|
||||
textStream << lineStart << " RESINSIGHT DATA\n";
|
||||
|
||||
textStream << lineStart << "\n";
|
||||
|
||||
if (sourceCase)
|
||||
{
|
||||
textStream << lineStart << " Grid Model:\n";
|
||||
textStream << lineStart << " " << sourceCase->gridFileName() << "\n";
|
||||
textStream << lineStart << "\n";
|
||||
}
|
||||
|
||||
{
|
||||
QString tableText = createWellFileLocationText(wellPaths);
|
||||
textStream << tableText;
|
||||
textStream << lineStart << "\n";
|
||||
}
|
||||
|
||||
auto proj = RiaApplication::instance()->project();
|
||||
auto fractureTemplates = proj->activeOilField()->fractureDefinitionCollection()->fractureTemplates();
|
||||
|
||||
std::vector<RimStimPlanFractureTemplate*> stimPlanTemplates;
|
||||
std::vector<RimEllipseFractureTemplate*> ellipseTemplates;
|
||||
|
||||
for (const auto fracTemplate : fractureTemplates)
|
||||
{
|
||||
auto stimPlanTemplate = dynamic_cast<RimStimPlanFractureTemplate*>(fracTemplate);
|
||||
if (stimPlanTemplate)
|
||||
{
|
||||
stimPlanTemplates.push_back(stimPlanTemplate);
|
||||
}
|
||||
|
||||
auto ellipseTemplate = dynamic_cast<RimEllipseFractureTemplate*>(fracTemplate);
|
||||
if (ellipseTemplate)
|
||||
{
|
||||
ellipseTemplates.push_back(ellipseTemplate);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
QString tableText = createStimPlanFileLocationText(stimPlanTemplates);
|
||||
textStream << tableText;
|
||||
textStream << lineStart << "\n";
|
||||
}
|
||||
|
||||
{
|
||||
QString tableText = createEllipseFractureText(ellipseTemplates);
|
||||
textStream << tableText;
|
||||
textStream << lineStart << "\n";
|
||||
}
|
||||
|
||||
{
|
||||
QString tableText = createStimPlanFractureText(stimPlanTemplates);
|
||||
textStream << tableText;
|
||||
textStream << lineStart << "\n";
|
||||
}
|
||||
|
||||
{
|
||||
QString tableText = createFractureText(fractureTemplates);
|
||||
textStream << tableText;
|
||||
textStream << lineStart << "\n";
|
||||
}
|
||||
|
||||
{
|
||||
std::vector<RimWellPathFracture*> wellPathFractures;
|
||||
for (const auto& w : wellPaths)
|
||||
{
|
||||
for (const auto& frac : w->fractureCollection()->fractures())
|
||||
{
|
||||
wellPathFractures.push_back(frac);
|
||||
}
|
||||
}
|
||||
|
||||
QString tableText = createFractureInstancesText(wellPathFractures);
|
||||
textStream << tableText;
|
||||
textStream << lineStart << "\n";
|
||||
}
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimWellPath*> RicWellPathFractureTextReportFeatureImpl::wellPathsWithFractures()
|
||||
{
|
||||
std::vector<RimWellPath*> wellPaths;
|
||||
|
||||
auto* wellPathColl = RimTools::wellPathCollection();
|
||||
if (wellPathColl)
|
||||
{
|
||||
for (const auto& wellPath : wellPathColl->wellPaths())
|
||||
{
|
||||
if (!wellPath->fractureCollection()->fractures().empty())
|
||||
{
|
||||
wellPaths.push_back(wellPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return wellPaths;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicWellPathFractureTextReportFeatureImpl::createWellFileLocationText(const std::vector<RimWellPath*>& wellPaths) const
|
||||
{
|
||||
if (wellPaths.empty()) return "";
|
||||
|
||||
QString tableText;
|
||||
|
||||
QTextStream stream(&tableText);
|
||||
RifEclipseDataTableFormatter formatter(stream);
|
||||
configureFormatter(&formatter);
|
||||
|
||||
std::vector<RifEclipseOutputTableColumn> header = {
|
||||
RifEclipseOutputTableColumn("Well"),
|
||||
RifEclipseOutputTableColumn("Location"),
|
||||
};
|
||||
|
||||
formatter.header(header);
|
||||
|
||||
formatter.addHorizontalLine('-');
|
||||
|
||||
if (!wellPaths.empty())
|
||||
{
|
||||
for (const auto& wellPath : wellPaths)
|
||||
{
|
||||
auto fileWellPath = dynamic_cast<RimFileWellPath*>(wellPath);
|
||||
if (fileWellPath)
|
||||
{
|
||||
formatter.add(wellPath->name());
|
||||
formatter.add(fileWellPath->filepath());
|
||||
formatter.rowCompleted();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
formatter.tableCompleted();
|
||||
|
||||
return tableText;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicWellPathFractureTextReportFeatureImpl::createStimPlanFileLocationText(
|
||||
const std::vector<RimStimPlanFractureTemplate*>& stimPlanTemplates) const
|
||||
{
|
||||
if (stimPlanTemplates.empty()) return "";
|
||||
|
||||
QString tableText;
|
||||
|
||||
QTextStream stream(&tableText);
|
||||
RifEclipseDataTableFormatter formatter(stream);
|
||||
configureFormatter(&formatter);
|
||||
|
||||
std::vector<RifEclipseOutputTableColumn> header = {
|
||||
RifEclipseOutputTableColumn("StimPlan Name"),
|
||||
RifEclipseOutputTableColumn("Location"),
|
||||
};
|
||||
|
||||
formatter.header(header);
|
||||
|
||||
formatter.addHorizontalLine('-');
|
||||
|
||||
if (!stimPlanTemplates.empty())
|
||||
{
|
||||
for (const auto& stimPlanTemplate : stimPlanTemplates)
|
||||
{
|
||||
formatter.add(stimPlanTemplate->name());
|
||||
formatter.add(stimPlanTemplate->fileName());
|
||||
formatter.rowCompleted();
|
||||
}
|
||||
}
|
||||
|
||||
formatter.tableCompleted();
|
||||
|
||||
return tableText;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicWellPathFractureTextReportFeatureImpl::createStimPlanFractureText(
|
||||
const std::vector<RimStimPlanFractureTemplate*>& stimPlanTemplates) const
|
||||
{
|
||||
if (stimPlanTemplates.empty()) return "";
|
||||
|
||||
QString tableText;
|
||||
|
||||
QTextStream stream(&tableText);
|
||||
RifEclipseDataTableFormatter formatter(stream);
|
||||
configureFormatter(&formatter);
|
||||
|
||||
std::vector<RifEclipseOutputTableColumn> header = {
|
||||
RifEclipseOutputTableColumn("StimPlan"),
|
||||
RifEclipseOutputTableColumn(" "),
|
||||
floatNumberColumn("WDiam"),
|
||||
floatNumberColumn("Skin"),
|
||||
floatNumberColumn("Dfac"),
|
||||
floatNumberColumn("LPerf"),
|
||||
};
|
||||
|
||||
formatter.header(header);
|
||||
|
||||
// Second header line
|
||||
{
|
||||
formatter.add("Template"); // Template
|
||||
formatter.add("Orientation"); // Orientation
|
||||
formatter.add("[m]"); // WDiam
|
||||
formatter.add("[] "); // Skin
|
||||
formatter.add("[...]"); // DFac
|
||||
formatter.add("[m]"); // LPerf
|
||||
formatter.rowCompleted();
|
||||
}
|
||||
|
||||
formatter.addHorizontalLine('-');
|
||||
|
||||
for (const auto& stimPlanTemplate : stimPlanTemplates)
|
||||
{
|
||||
formatter.add(stimPlanTemplate->name());
|
||||
formatter.add(orientationText(stimPlanTemplate->orientationType()));
|
||||
formatter.add(stimPlanTemplate->wellDiameter());
|
||||
formatter.add(stimPlanTemplate->skinFactor());
|
||||
|
||||
if (stimPlanTemplate->isNonDarcyFlowEnabled())
|
||||
{
|
||||
formatter.add(stimPlanTemplate->dFactor());
|
||||
formatter.add(stimPlanTemplate->perforationLength());
|
||||
}
|
||||
else
|
||||
{
|
||||
formatter.add("NA");
|
||||
formatter.add("NA");
|
||||
}
|
||||
|
||||
formatter.rowCompleted();
|
||||
}
|
||||
|
||||
formatter.tableCompleted();
|
||||
|
||||
return tableText;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicWellPathFractureTextReportFeatureImpl::createEllipseFractureText(
|
||||
const std::vector<RimEllipseFractureTemplate*>& ellipseTemplates) const
|
||||
{
|
||||
if (ellipseTemplates.empty()) return "";
|
||||
|
||||
QString tableText;
|
||||
|
||||
QTextStream stream(&tableText);
|
||||
RifEclipseDataTableFormatter formatter(stream);
|
||||
configureFormatter(&formatter);
|
||||
|
||||
std::vector<RifEclipseOutputTableColumn> header = {
|
||||
RifEclipseOutputTableColumn("Ellipse"),
|
||||
RifEclipseOutputTableColumn(" "),
|
||||
floatNumberColumn("Xf"),
|
||||
floatNumberColumn("Height"),
|
||||
floatNumberColumn("Kf"),
|
||||
floatNumberColumn("Wf"),
|
||||
floatNumberColumn("WDiam"),
|
||||
floatNumberColumn("Skin"),
|
||||
floatNumberColumn("Dfac"),
|
||||
floatNumberColumn("LPerf"),
|
||||
};
|
||||
|
||||
formatter.header(header);
|
||||
|
||||
// Second header line
|
||||
{
|
||||
formatter.add("Template"); // Template
|
||||
formatter.add("Orientation"); // Orientation
|
||||
formatter.add("[m]"); // Xf
|
||||
formatter.add("[m]"); // Height
|
||||
formatter.add("[mD]"); // Kf
|
||||
formatter.add("[m]"); // Wf
|
||||
formatter.add("[m]"); // WDiam
|
||||
formatter.add("[] "); // Skin
|
||||
formatter.add("[...]"); // DFac
|
||||
formatter.add("[m]"); // LPerf
|
||||
formatter.rowCompleted();
|
||||
}
|
||||
|
||||
formatter.addHorizontalLine('-');
|
||||
|
||||
for (const auto& ellipseTemplate : ellipseTemplates)
|
||||
{
|
||||
formatter.add(ellipseTemplate->name());
|
||||
formatter.add(orientationText(ellipseTemplate->orientationType()));
|
||||
|
||||
formatter.add(ellipseTemplate->halfLength());
|
||||
formatter.add(ellipseTemplate->height());
|
||||
formatter.add(ellipseTemplate->conductivity());
|
||||
formatter.add(ellipseTemplate->width());
|
||||
|
||||
formatter.add(ellipseTemplate->wellDiameter());
|
||||
formatter.add(ellipseTemplate->skinFactor());
|
||||
|
||||
if (ellipseTemplate->isNonDarcyFlowEnabled())
|
||||
{
|
||||
formatter.add(ellipseTemplate->dFactor());
|
||||
formatter.add(ellipseTemplate->perforationLength());
|
||||
}
|
||||
else
|
||||
{
|
||||
formatter.add("NA");
|
||||
formatter.add("NA");
|
||||
}
|
||||
|
||||
formatter.rowCompleted();
|
||||
}
|
||||
|
||||
formatter.tableCompleted();
|
||||
|
||||
return tableText;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString
|
||||
RicWellPathFractureTextReportFeatureImpl::createFractureText(const std::vector<RimFractureTemplate*>& fractureTemplates) const
|
||||
{
|
||||
if (fractureTemplates.empty()) return "";
|
||||
|
||||
QString tableText;
|
||||
|
||||
QTextStream stream(&tableText);
|
||||
RifEclipseDataTableFormatter formatter(stream);
|
||||
configureFormatter(&formatter);
|
||||
|
||||
std::vector<RifEclipseOutputTableColumn> header = {
|
||||
RifEclipseOutputTableColumn(" "),
|
||||
floatNumberColumn("Top"),
|
||||
floatNumberColumn("Bot"),
|
||||
floatNumberColumn("Fault"),
|
||||
floatNumberColumn("Height"),
|
||||
floatNumberColumn("Width"),
|
||||
floatNumberColumn("DFac"),
|
||||
floatNumberColumn("Conductivity"),
|
||||
};
|
||||
|
||||
formatter.header(header);
|
||||
|
||||
// Second header line
|
||||
{
|
||||
formatter.add("Template");
|
||||
formatter.add("Cont");
|
||||
formatter.add("Cont");
|
||||
formatter.add("Truncation");
|
||||
formatter.add("Scale");
|
||||
formatter.add("Scale");
|
||||
formatter.add("Scale");
|
||||
formatter.add("Scale");
|
||||
formatter.rowCompleted();
|
||||
}
|
||||
|
||||
formatter.addHorizontalLine('-');
|
||||
|
||||
for (const auto& fracTemplate : fractureTemplates)
|
||||
{
|
||||
formatter.add(fracTemplate->name());
|
||||
|
||||
if (fracTemplate->fractureContainment()->isEnabled())
|
||||
{
|
||||
formatter.add(fracTemplate->fractureContainment()->topKLayer());
|
||||
formatter.add(fracTemplate->fractureContainment()->baseKLayer());
|
||||
}
|
||||
else
|
||||
{
|
||||
formatter.add("NA");
|
||||
formatter.add("NA");
|
||||
}
|
||||
|
||||
if (fracTemplate->fractureContainment()->minimumFaultThrow() >= 0.0)
|
||||
{
|
||||
formatter.add(fracTemplate->fractureContainment()->minimumFaultThrow());
|
||||
}
|
||||
else
|
||||
{
|
||||
formatter.add("NA");
|
||||
}
|
||||
|
||||
double heightScale, widthScale, dfactorScale, conductivityScale;
|
||||
fracTemplate->scaleFactors(&heightScale, &widthScale, &dfactorScale, &conductivityScale);
|
||||
formatter.add(heightScale);
|
||||
formatter.add(widthScale);
|
||||
formatter.add(dfactorScale);
|
||||
formatter.add(conductivityScale);
|
||||
|
||||
formatter.rowCompleted();
|
||||
}
|
||||
|
||||
formatter.tableCompleted();
|
||||
|
||||
return tableText;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicWellPathFractureTextReportFeatureImpl::createFractureInstancesText(
|
||||
const std::vector<RimWellPathFracture*>& fractures) const
|
||||
{
|
||||
if (fractures.empty()) return "";
|
||||
|
||||
QString tableText;
|
||||
|
||||
QTextStream stream(&tableText);
|
||||
RifEclipseDataTableFormatter formatter(stream);
|
||||
configureFormatter(&formatter);
|
||||
|
||||
std::vector<RifEclipseOutputTableColumn> header = {
|
||||
RifEclipseOutputTableColumn("Well"),
|
||||
RifEclipseOutputTableColumn("Fracture"),
|
||||
RifEclipseOutputTableColumn("Template"),
|
||||
floatNumberColumn("MD"),
|
||||
floatNumberColumn("Dip"),
|
||||
floatNumberColumn("Tilt"),
|
||||
floatNumberColumn("LPerf"),
|
||||
floatNumberColumn("PerfEff"),
|
||||
floatNumberColumn("Wdia"),
|
||||
};
|
||||
|
||||
formatter.header(header);
|
||||
|
||||
formatter.addHorizontalLine('-');
|
||||
|
||||
for (const auto& fracture : fractures)
|
||||
{
|
||||
QString wellName;
|
||||
|
||||
RimWellPath* wellPath = nullptr;
|
||||
fracture->firstAncestorOrThisOfType(wellPath);
|
||||
if (wellPath)
|
||||
{
|
||||
wellName = wellPath->name();
|
||||
}
|
||||
|
||||
formatter.add(wellName);
|
||||
formatter.add(fracture->name());
|
||||
|
||||
if (fracture->fractureTemplate())
|
||||
{
|
||||
formatter.add(fracture->fractureTemplate()->name());
|
||||
}
|
||||
else
|
||||
{
|
||||
formatter.add("NA");
|
||||
}
|
||||
|
||||
formatter.add(fracture->fractureMD());
|
||||
formatter.add(fracture->dip());
|
||||
formatter.add(fracture->tilt());
|
||||
formatter.add(fracture->perforationLength());
|
||||
formatter.add(fracture->perforationLength());
|
||||
formatter.add(fracture->wellRadius() * 2.0);
|
||||
|
||||
formatter.rowCompleted();
|
||||
}
|
||||
|
||||
formatter.tableCompleted();
|
||||
|
||||
return tableText;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicWellPathFractureTextReportFeatureImpl::configureFormatter(RifEclipseDataTableFormatter* formatter) const
|
||||
{
|
||||
if (!formatter) return;
|
||||
|
||||
formatter->setColumnSpacing(3);
|
||||
formatter->setTableRowPrependText("-- ");
|
||||
formatter->setTableRowLineAppendText("");
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2018 Statoil ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
|
||||
#include <map>
|
||||
|
||||
class RimWellPath;
|
||||
class RimWellPathFracture;
|
||||
class RimEclipseCase;
|
||||
class RimFractureTemplate;
|
||||
class RimEllipseFractureTemplate;
|
||||
class RimStimPlanFractureTemplate;
|
||||
class RifEclipseDataTableFormatter;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicWellPathFractureTextReportFeatureImpl
|
||||
{
|
||||
public:
|
||||
QString wellPathFractureReport(const RimEclipseCase* sourceCase, const std::vector<RimWellPath*>& wellPaths);
|
||||
|
||||
static std::vector<RimWellPath*> wellPathsWithFractures();
|
||||
|
||||
private:
|
||||
QString createWellFileLocationText(const std::vector<RimWellPath*>& wellPaths) const;
|
||||
QString createStimPlanFileLocationText(const std::vector<RimStimPlanFractureTemplate*>& stimPlanTemplates) const;
|
||||
QString createStimPlanFractureText(const std::vector<RimStimPlanFractureTemplate*>& stimPlanTemplates) const;
|
||||
QString createEllipseFractureText(const std::vector<RimEllipseFractureTemplate*>& ellipseTemplates) const;
|
||||
QString createFractureText(const std::vector<RimFractureTemplate*>& fractureTemplates) const;
|
||||
QString createFractureInstancesText(const std::vector<RimWellPathFracture*>& fractureTemplates) const;
|
||||
|
||||
void configureFormatter(RifEclipseDataTableFormatter* formatter) const;
|
||||
};
|
@ -252,6 +252,7 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
|
||||
menuBuilder << "RicReloadWellPathFormationNamesFeature";
|
||||
menuBuilder << "RicWellPathImportPerforationIntervalsFeature";
|
||||
menuBuilder.subMenuEnd();
|
||||
menuBuilder << "RicWellPathFractureTextReportFeature";
|
||||
}
|
||||
else if (dynamic_cast<RimWellPath*>(uiItem))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user