mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge branch 'dev' into pre-proto
This commit is contained in:
@@ -6,6 +6,7 @@ endif()
|
||||
|
||||
set (SOURCE_GROUP_HEADER_FILES
|
||||
${CEE_CURRENT_LIST_DIR}RicCaseAndFileExportSettingsUi.h
|
||||
${CEE_CURRENT_LIST_DIR}RicEditPerforationCollectionFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicExportCompletionDataSettingsUi.h
|
||||
${CEE_CURRENT_LIST_DIR}RicExportFishbonesLateralsFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicExportFishbonesWellSegmentsFeature.h
|
||||
@@ -13,6 +14,8 @@ ${CEE_CURRENT_LIST_DIR}RicExportFractureCompletionsImpl.h
|
||||
${CEE_CURRENT_LIST_DIR}RicExportWellSegmentsSettingsUi.h
|
||||
${CEE_CURRENT_LIST_DIR}RicNewFishbonesSubsAtMeasuredDepthFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicNewFishbonesSubsFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicNewPerforationIntervalFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicNewPerforationIntervalAtMeasuredDepthFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicWellPathExportCompletionDataFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicWellPathImportCompletionsFileFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicWellPathImportPerforationIntervalsFeature.h
|
||||
@@ -20,6 +23,7 @@ ${CEE_CURRENT_LIST_DIR}RicWellPathImportPerforationIntervalsFeature.h
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
${CEE_CURRENT_LIST_DIR}RicCaseAndFileExportSettingsUi.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicEditPerforationCollectionFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicExportCompletionDataSettingsUi.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicExportFishbonesLateralsFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicExportFishbonesWellSegmentsFeature.cpp
|
||||
@@ -27,6 +31,8 @@ ${CEE_CURRENT_LIST_DIR}RicExportFractureCompletionsImpl.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicExportWellSegmentsSettingsUi.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicNewFishbonesSubsAtMeasuredDepthFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicNewFishbonesSubsFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicNewPerforationIntervalFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicNewPerforationIntervalAtMeasuredDepthFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicWellPathExportCompletionDataFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicWellPathImportCompletionsFileFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicWellPathImportPerforationIntervalsFeature.cpp
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2016- 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 "RicEditPerforationCollectionFeature.h"
|
||||
|
||||
#include "WellPathCommands/RicWellPathsUnitSystemSettingsImpl.h"
|
||||
|
||||
#include "RiuEditPerforationCollectionWidget.h"
|
||||
|
||||
#include "RimPerforationCollection.h"
|
||||
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include <QAction>
|
||||
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicEditPerforationCollectionFeature, "RicEditPerforationCollectionFeature");
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicEditPerforationCollectionFeature::isCommandEnabled()
|
||||
{
|
||||
return selectedPerforationCollection() != nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicEditPerforationCollectionFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
this->disableModelChangeContribution();
|
||||
|
||||
RimPerforationCollection* perforationCollection = selectedPerforationCollection();
|
||||
|
||||
if (perforationCollection == nullptr) return;
|
||||
|
||||
RimWellPath* wellPath;
|
||||
perforationCollection->firstAncestorOrThisOfTypeAsserted(wellPath);
|
||||
if (!RicWellPathsUnitSystemSettingsImpl::ensureHasUnitSystem(wellPath)) return;
|
||||
|
||||
RiuEditPerforationCollectionWidget dlg(nullptr, perforationCollection);
|
||||
dlg.exec();
|
||||
|
||||
perforationCollection->updateConnectedEditors();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicEditPerforationCollectionFeature::setupActionLook(QAction* actionToSetup)
|
||||
{
|
||||
actionToSetup->setText("Edit Perforations");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimPerforationCollection* RicEditPerforationCollectionFeature::selectedPerforationCollection()
|
||||
{
|
||||
RimPerforationCollection* objToFind = nullptr;
|
||||
|
||||
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
|
||||
|
||||
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>(pdmUiItem);
|
||||
if (objHandle)
|
||||
{
|
||||
objHandle->firstAncestorOrThisOfType(objToFind);
|
||||
}
|
||||
|
||||
return objToFind;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2016- 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 RimPerforationCollection;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicEditPerforationCollectionFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
protected:
|
||||
virtual bool isCommandEnabled() override;
|
||||
virtual void onActionTriggered( bool isChecked ) override;
|
||||
virtual void setupActionLook(QAction* actionToSetup) override;
|
||||
|
||||
private:
|
||||
static RimPerforationCollection* selectedPerforationCollection();
|
||||
};
|
||||
|
||||
@@ -29,6 +29,8 @@ RicExportCompletionDataSettingsUi::RicExportCompletionDataSettingsUi()
|
||||
|
||||
CAF_PDM_InitField(&timeStep, "TimeStepIndex", 0, "Time Step", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&computeTransmissibility, "ComputeTransmissibility", true, "Compute Transmissibility", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&includePerforations, "IncludePerforations", true, "Include Perforations", "", "", "");
|
||||
CAF_PDM_InitField(&includeFishbones, "IncludeFishbones", true, "Include Fishbones", "", "", "");
|
||||
CAF_PDM_InitField(&includeFractures, "IncludeFractures", true, "Include Fractures", "", "", "");
|
||||
|
||||
@@ -33,6 +33,7 @@ public:
|
||||
RicExportCompletionDataSettingsUi();
|
||||
|
||||
|
||||
caf::PdmField<bool> computeTransmissibility;
|
||||
caf::PdmField<bool> includePerforations;
|
||||
caf::PdmField<bool> includeFishbones;
|
||||
caf::PdmField<bool> includeFractures;
|
||||
|
||||
@@ -79,8 +79,6 @@ void RicExportFishbonesLateralsFeature::onActionTriggered(bool isChecked)
|
||||
// x y TVD MD
|
||||
// separate laterals using -999 on a single line
|
||||
|
||||
size_t fishboneSubIndex = 0;
|
||||
|
||||
QTextStream stream(&exportFile);
|
||||
for (RimFishbonesMultipleSubs* fishbone : fishbonesCollection->fishbonesSubs())
|
||||
{
|
||||
@@ -93,7 +91,7 @@ void RicExportFishbonesLateralsFeature::onActionTriggered(bool isChecked)
|
||||
std::vector<std::pair<cvf::Vec3d, double>> coordsAndMD = fishbone->coordsAndMDForLateral(sub.subIndex, lateralIndex);
|
||||
|
||||
// Pad with "0" to get a total of two characters defining the sub index text
|
||||
QString subIndexText = QString("%1").arg(fishboneSubIndex++, 2, 10, QChar('0'));
|
||||
QString subIndexText = QString("%1").arg(sub.subIndex, 2, 10, QChar('0'));
|
||||
|
||||
QString lateralNameCandidate = QString("%1_%2_%3_%4").arg(wellPath->name()).arg("fishbone").arg(subIndexText).arg(lateralIndex);
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
|
||||
#include "RigMainGrid.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigWellPath.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
|
||||
@@ -185,7 +186,8 @@ void RicExportFishbonesWellSegmentsFeature::generateWelsegsTable(RifEclipseDataT
|
||||
{
|
||||
formatter.keyword("WELSEGS");
|
||||
|
||||
const WellSegmentLocation& firstLocation = locations[0];
|
||||
double startMD = wellPath->fishbonesCollection()->startMD();
|
||||
double startTVD = -wellPath->wellPathGeometry()->interpolatedPointAlongWellPath(startMD).z();
|
||||
|
||||
{
|
||||
std::vector<RifEclipseOutputTableColumn> header = {
|
||||
@@ -199,8 +201,8 @@ void RicExportFishbonesWellSegmentsFeature::generateWelsegsTable(RifEclipseDataT
|
||||
formatter.header(header);
|
||||
|
||||
formatter.add(wellPath->name());
|
||||
formatter.add(firstLocation.trueVerticalDepth);
|
||||
formatter.add(firstLocation.measuredDepth);
|
||||
formatter.add(startTVD);
|
||||
formatter.add(startMD);
|
||||
formatter.add("1*");
|
||||
formatter.add(settings.lengthAndDepth().text());
|
||||
formatter.add(settings.pressureDrop().text());
|
||||
@@ -223,25 +225,24 @@ void RicExportFishbonesWellSegmentsFeature::generateWelsegsTable(RifEclipseDataT
|
||||
}
|
||||
|
||||
{
|
||||
WellSegmentLocation previousLocation = firstLocation;
|
||||
formatter.comment("Main stem");
|
||||
|
||||
double depth = 0;
|
||||
double length = 0;
|
||||
double previousMD = startMD;
|
||||
double previousTVD = startTVD;
|
||||
|
||||
for (size_t i = 0; i < locations.size(); ++i)
|
||||
for (const WellSegmentLocation& location : locations)
|
||||
{
|
||||
const WellSegmentLocation& location = locations[i];
|
||||
|
||||
if (settings.lengthAndDepth() == RicExportWellSegmentsSettingsUi::INC)
|
||||
{
|
||||
depth = location.trueVerticalDepth - previousLocation.trueVerticalDepth;
|
||||
length = location.fishbonesSubs->measuredDepth(location.subIndex) - previousLocation.fishbonesSubs->measuredDepth(previousLocation.subIndex);
|
||||
depth = location.trueVerticalDepth - previousTVD;
|
||||
length = location.fishbonesSubs->measuredDepth(location.subIndex) - previousMD;
|
||||
}
|
||||
else
|
||||
{
|
||||
depth += location.trueVerticalDepth - previousLocation.trueVerticalDepth;
|
||||
length += location.fishbonesSubs->measuredDepth(location.subIndex) - previousLocation.fishbonesSubs->measuredDepth(previousLocation.subIndex);
|
||||
depth += location.trueVerticalDepth - previousTVD;
|
||||
length += location.fishbonesSubs->measuredDepth(location.subIndex) - previousMD;
|
||||
}
|
||||
|
||||
formatter.comment(QString("Segment for sub %1").arg(location.subIndex));
|
||||
@@ -254,7 +255,8 @@ void RicExportFishbonesWellSegmentsFeature::generateWelsegsTable(RifEclipseDataT
|
||||
formatter.add(-1.0); // FIXME : Rough of main stem?
|
||||
formatter.rowCompleted();
|
||||
|
||||
previousLocation = location;
|
||||
previousMD = location.measuredDepth;
|
||||
previousTVD = location.trueVerticalDepth;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "RicNewFishbonesSubsAtMeasuredDepthFeature.h"
|
||||
|
||||
#include "RicNewFishbonesSubsFeature.h"
|
||||
#include "WellPathCommands/RicWellPathsUnitSystemSettingsImpl.h"
|
||||
|
||||
#include "RimFishbonesCollection.h"
|
||||
#include "RimFishbonesMultipleSubs.h"
|
||||
@@ -45,6 +46,8 @@ void RicNewFishbonesSubsAtMeasuredDepthFeature::onActionTriggered(bool isChecked
|
||||
|
||||
RimWellPath* wellPath = wellPathSelItem->m_wellpath;
|
||||
CVF_ASSERT(wellPath);
|
||||
|
||||
if (!RicWellPathsUnitSystemSettingsImpl::ensureHasUnitSystem(wellPath)) return;
|
||||
|
||||
RimFishbonesMultipleSubs* obj = new RimFishbonesMultipleSubs;
|
||||
wellPath->fishbonesCollection()->appendFishbonesSubs(obj);
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
|
||||
#include "RicNewFishbonesSubsFeature.h"
|
||||
|
||||
#include "WellPathCommands/RicWellPathsUnitSystemSettingsImpl.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RimProject.h"
|
||||
@@ -45,6 +47,10 @@ void RicNewFishbonesSubsFeature::onActionTriggered(bool isChecked)
|
||||
RimFishbonesCollection* fishbonesCollection = selectedFishbonesCollection();
|
||||
CVF_ASSERT(fishbonesCollection);
|
||||
|
||||
RimWellPath* wellPath;
|
||||
fishbonesCollection->firstAncestorOrThisOfTypeAsserted(wellPath);
|
||||
if (!RicWellPathsUnitSystemSettingsImpl::ensureHasUnitSystem(wellPath)) return;
|
||||
|
||||
RimFishbonesMultipleSubs* obj = new RimFishbonesMultipleSubs;
|
||||
obj->setName(QString("Fishbones Subs (%1)").arg(fishbonesCollection->fishbonesSubs.size()));
|
||||
fishbonesCollection->appendFishbonesSubs(obj);
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 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 "RicNewPerforationIntervalAtMeasuredDepthFeature.h"
|
||||
|
||||
#include "WellPathCommands/RicWellPathsUnitSystemSettingsImpl.h"
|
||||
|
||||
#include "RimFishbonesMultipleSubs.h"
|
||||
#include "RimPerforationCollection.h"
|
||||
#include "RimPerforationInterval.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
#include "RiuSelectionManager.h"
|
||||
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include <QAction>
|
||||
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicNewPerforationIntervalAtMeasuredDepthFeature, "RicNewPerforationIntervalAtMeasuredDepthFeature");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewPerforationIntervalAtMeasuredDepthFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
RiuWellPathSelectionItem* wellPathSelItem = wellPathSelectionItem();
|
||||
CVF_ASSERT(wellPathSelItem);
|
||||
|
||||
RimWellPath* wellPath = wellPathSelItem->m_wellpath;
|
||||
CVF_ASSERT(wellPath);
|
||||
|
||||
if (!RicWellPathsUnitSystemSettingsImpl::ensureHasUnitSystem(wellPath)) return;
|
||||
|
||||
RimPerforationInterval* perforationInterval = new RimPerforationInterval;
|
||||
int measuredDepth = wellPathSelItem->m_measuredDepth;
|
||||
perforationInterval->setStartAndEndMD(measuredDepth, measuredDepth + 50);
|
||||
|
||||
wellPath->perforationIntervalCollection()->appendPerforation(perforationInterval);
|
||||
|
||||
RimWellPathCollection* wellPathCollection = nullptr;
|
||||
wellPath->firstAncestorOrThisOfTypeAsserted(wellPathCollection);
|
||||
|
||||
wellPathCollection->uiCapability()->updateConnectedEditors();
|
||||
wellPathCollection->scheduleGeometryRegenAndRedrawViews();
|
||||
|
||||
RiuMainWindow::instance()->selectAsCurrentItem(perforationInterval);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuWellPathSelectionItem* RicNewPerforationIntervalAtMeasuredDepthFeature::wellPathSelectionItem()
|
||||
{
|
||||
RiuSelectionManager* riuSelManager = RiuSelectionManager::instance();
|
||||
RiuSelectionItem* selItem = riuSelManager->selectedItem(RiuSelectionManager::RUI_TEMPORARY);
|
||||
|
||||
RiuWellPathSelectionItem* wellPathItem = dynamic_cast<RiuWellPathSelectionItem*>(selItem);
|
||||
|
||||
return wellPathItem;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewPerforationIntervalAtMeasuredDepthFeature::setupActionLook(QAction* actionToSetup)
|
||||
{
|
||||
//actionToSetup->setIcon(QIcon(":/FractureSymbol16x16.png"));
|
||||
actionToSetup->setText("New Perforation Interval");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicNewPerforationIntervalAtMeasuredDepthFeature::isCommandEnabled()
|
||||
{
|
||||
if (wellPathSelectionItem())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 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 RiuWellPathSelectionItem;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicNewPerforationIntervalAtMeasuredDepthFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
protected:
|
||||
virtual void onActionTriggered(bool isChecked) override;
|
||||
virtual void setupActionLook(QAction* actionToSetup) override;
|
||||
virtual bool isCommandEnabled() override;
|
||||
|
||||
private:
|
||||
static RiuWellPathSelectionItem* wellPathSelectionItem();
|
||||
};
|
||||
@@ -0,0 +1,96 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2015- Statoil ASA
|
||||
// Copyright (C) 2015- Ceetron Solutions AS
|
||||
//
|
||||
// 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 "RicNewPerforationIntervalFeature.h"
|
||||
|
||||
#include "WellPathCommands/RicWellPathsUnitSystemSettingsImpl.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
|
||||
#include "RimPerforationInterval.h"
|
||||
#include "RimPerforationCollection.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include <QAction>
|
||||
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicNewPerforationIntervalFeature, "RicNewPerforationIntervalFeature");
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicNewPerforationIntervalFeature::isCommandEnabled()
|
||||
{
|
||||
return selectedPerforationCollection() != nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewPerforationIntervalFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
RimPerforationCollection* perforationCollection = selectedPerforationCollection();
|
||||
if (perforationCollection == nullptr) return;
|
||||
|
||||
RimWellPath* wellPath;
|
||||
perforationCollection->firstAncestorOrThisOfTypeAsserted(wellPath);
|
||||
if (!RicWellPathsUnitSystemSettingsImpl::ensureHasUnitSystem(wellPath)) return;
|
||||
|
||||
RimPerforationInterval* perforationInterval = new RimPerforationInterval;
|
||||
|
||||
perforationCollection->appendPerforation(perforationInterval);
|
||||
|
||||
RimWellPathCollection* wellPathCollection = nullptr;
|
||||
perforationCollection->firstAncestorOrThisOfType(wellPathCollection);
|
||||
if (!wellPathCollection) return;
|
||||
|
||||
wellPathCollection->uiCapability()->updateConnectedEditors();
|
||||
wellPathCollection->scheduleGeometryRegenAndRedrawViews();
|
||||
|
||||
RiuMainWindow::instance()->selectAsCurrentItem(perforationInterval);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewPerforationIntervalFeature::setupActionLook(QAction* actionToSetup)
|
||||
{
|
||||
actionToSetup->setText("New Perforation Interval");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimPerforationCollection* RicNewPerforationIntervalFeature::selectedPerforationCollection()
|
||||
{
|
||||
RimPerforationCollection* objToFind = nullptr;
|
||||
|
||||
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
|
||||
|
||||
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>(pdmUiItem);
|
||||
if (objHandle)
|
||||
{
|
||||
objHandle->firstAncestorOrThisOfType(objToFind);
|
||||
}
|
||||
|
||||
return objToFind;
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2015- Statoil ASA
|
||||
// Copyright (C) 2015- Ceetron Solutions AS
|
||||
//
|
||||
// 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 RimPerforationCollection;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicNewPerforationIntervalFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
protected:
|
||||
|
||||
// Overrides
|
||||
virtual bool isCommandEnabled() override;
|
||||
virtual void onActionTriggered( bool isChecked ) override;
|
||||
virtual void setupActionLook( QAction* actionToSetup ) override;
|
||||
|
||||
private:
|
||||
RimPerforationCollection* selectedPerforationCollection();
|
||||
};
|
||||
@@ -30,6 +30,8 @@
|
||||
#include "RimFishboneWellPathCollection.h"
|
||||
#include "RimPerforationInterval.h"
|
||||
#include "RimPerforationCollection.h"
|
||||
#include "RimReservoirCellResultsStorage.h"
|
||||
|
||||
#include "RicExportCompletionDataSettingsUi.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
@@ -39,6 +41,8 @@
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigMainGrid.h"
|
||||
#include "RigWellPath.h"
|
||||
#include "RigResultAccessorFactory.h"
|
||||
#include "RigTransmissibilityEquations.h"
|
||||
|
||||
#include "cafSelectionManager.h"
|
||||
#include "cafPdmUiPropertyViewDialog.h"
|
||||
@@ -149,6 +153,28 @@ void RicWellPathExportCompletionDataFeature::exportCompletions(const std::vector
|
||||
return;
|
||||
}
|
||||
|
||||
{
|
||||
bool unitSystemMismatch = false;
|
||||
for (const RimWellPath* wellPath : wellPaths)
|
||||
{
|
||||
if (wellPath->unitSystem() == RimUnitSystem::UNITS_FIELD && exportSettings.caseToApply->eclipseCaseData()->unitsType() != RigEclipseCaseData::UNITS_FIELD)
|
||||
{
|
||||
unitSystemMismatch = true;
|
||||
break;
|
||||
}
|
||||
else if (wellPath->unitSystem() == RimUnitSystem::UNITS_METRIC && exportSettings.caseToApply->eclipseCaseData()->unitsType() != RigEclipseCaseData::UNITS_METRIC)
|
||||
{
|
||||
unitSystemMismatch = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (unitSystemMismatch)
|
||||
{
|
||||
RiaLogging::error("Well path unit systems must match unit system of chosen eclipse case.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
QTextStream stream(&exportFile);
|
||||
RifEclipseDataTableFormatter formatter(stream);
|
||||
|
||||
@@ -194,6 +220,8 @@ void RicWellPathExportCompletionDataFeature::exportCompletions(const std::vector
|
||||
{
|
||||
generateWpimultTable(formatter, completions);
|
||||
}
|
||||
|
||||
RiaLogging::info(QString("Successfully exported completion data to %1").arg(exportSettings.fileName()));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -336,8 +364,20 @@ std::vector<RigCompletionData> RicWellPathExportCompletionDataFeature::generateF
|
||||
RigCompletionData completion(wellPath->name(), IJKCellIndex(i, j, k));
|
||||
completion.addMetadata(location.fishbonesSubs->name(), QString("Sub: %1 Lateral: %2").arg(location.subIndex).arg(lateral.lateralIndex));
|
||||
double diameter = location.fishbonesSubs->holeDiameter() / 1000;
|
||||
CellDirection direction = wellPathCellDirectionToCellDirection(intersection.direction);
|
||||
completion.setFromFishbone(diameter, direction);
|
||||
if (settings.computeTransmissibility())
|
||||
{
|
||||
double transmissibility = calculateTransmissibility(settings.caseToApply,
|
||||
wellPath,
|
||||
intersection.lengthsInCell,
|
||||
location.fishbonesSubs->skinFactor(),
|
||||
diameter / 2,
|
||||
intersection.cellIndex);
|
||||
completion.setFromFishbone(transmissibility, location.fishbonesSubs->skinFactor());
|
||||
}
|
||||
else {
|
||||
CellDirection direction = calculateDirectionInCell(settings.caseToApply, intersection.cellIndex, intersection.lengthsInCell);
|
||||
completion.setFromFishbone(diameter, direction);
|
||||
}
|
||||
completionData.push_back(completion);
|
||||
}
|
||||
}
|
||||
@@ -349,22 +389,39 @@ std::vector<RigCompletionData> RicWellPathExportCompletionDataFeature::generateF
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RigCompletionData> RicWellPathExportCompletionDataFeature::generateFishbonesWellPathCompdatValues(const RimWellPath* wellPath, const RicExportCompletionDataSettingsUi & settings)
|
||||
std::vector<RigCompletionData> RicWellPathExportCompletionDataFeature::generateFishbonesWellPathCompdatValues(const RimWellPath* wellPath, const RicExportCompletionDataSettingsUi& settings)
|
||||
{
|
||||
std::vector<RigCompletionData> completionData;
|
||||
|
||||
std::vector<size_t> wellPathCells = findIntersectingCells(settings.caseToApply()->eclipseCaseData(), wellPath->wellPathGeometry()->m_wellPathPoints);
|
||||
|
||||
double diameter = wellPath->fishbonesCollection()->wellPathCollection()->holeDiameter() / 1000;
|
||||
for (const RimFishboneWellPath* fishbonesPath : wellPath->fishbonesCollection()->wellPathCollection()->wellPaths())
|
||||
{
|
||||
std::vector<WellPathCellIntersectionInfo> intersectedCells = RigWellPathIntersectionTools::findCellsIntersectedByPath(settings.caseToApply->eclipseCaseData(), fishbonesPath->coordinates());
|
||||
for (auto& cell : intersectedCells)
|
||||
{
|
||||
if (std::find(wellPathCells.begin(), wellPathCells.end(), cell.cellIndex) != wellPathCells.end()) continue;
|
||||
|
||||
size_t i, j, k;
|
||||
settings.caseToApply->eclipseCaseData()->mainGrid()->ijkFromCellIndex(cell.cellIndex, &i, &j, &k);
|
||||
RigCompletionData completion(wellPath->name(), IJKCellIndex(i, j, k));
|
||||
completion.addMetadata(fishbonesPath->name(), "");
|
||||
CellDirection direction = wellPathCellDirectionToCellDirection(cell.direction);
|
||||
completion.setFromFishbone(diameter, direction);
|
||||
if (settings.computeTransmissibility())
|
||||
{
|
||||
double skinFactor = wellPath->fishbonesCollection()->wellPathCollection()->skinFactor();
|
||||
double transmissibility = calculateTransmissibility(settings.caseToApply(),
|
||||
wellPath,
|
||||
cell.internalCellLengths,
|
||||
skinFactor,
|
||||
diameter / 2,
|
||||
cell.cellIndex);
|
||||
completion.setFromFishbone(transmissibility, skinFactor);
|
||||
}
|
||||
else {
|
||||
CellDirection direction = calculateDirectionInCell(settings.caseToApply, cell.cellIndex, cell.internalCellLengths);
|
||||
completion.setFromFishbone(diameter, direction);
|
||||
}
|
||||
completionData.push_back(completion);
|
||||
}
|
||||
}
|
||||
@@ -392,7 +449,7 @@ std::vector<RigCompletionData> RicWellPathExportCompletionDataFeature::generateP
|
||||
RigCompletionData completion(wellPath->name(), IJKCellIndex(i, j, k));
|
||||
completion.addMetadata("Perforation", QString("StartMD: %1 - EndMD: %2").arg(interval->startMD()).arg(interval->endMD()));
|
||||
double diameter = interval->diameter();
|
||||
CellDirection direction = wellPathCellDirectionToCellDirection(cell.direction);
|
||||
CellDirection direction = calculateDirectionInCell(settings.caseToApply, cell.cellIndex, cell.internalCellLengths);
|
||||
completion.setFromPerforation(diameter, direction);
|
||||
completionData.push_back(completion);
|
||||
}
|
||||
@@ -526,7 +583,7 @@ void RicWellPathExportCompletionDataFeature::calculateLateralIntersections(const
|
||||
depth += intersection->endPoint.z() - startPoint.z();
|
||||
|
||||
WellSegmentLateralIntersection lateralIntersection(++(*segmentNum), attachedSegmentNumber, intersection->cellIndex, length, depth);
|
||||
lateralIntersection.direction = intersection->direction;
|
||||
lateralIntersection.lengthsInCell = intersection->internalCellLengths;
|
||||
lateral.intersections.push_back(lateralIntersection);
|
||||
|
||||
length = 0;
|
||||
@@ -588,20 +645,68 @@ void RicWellPathExportCompletionDataFeature::appendCompletionData(std::map<IJKCe
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
CellDirection RicWellPathExportCompletionDataFeature::wellPathCellDirectionToCellDirection(WellPathCellDirection direction)
|
||||
CellDirection RicWellPathExportCompletionDataFeature::calculateDirectionInCell(RimEclipseCase* eclipseCase, size_t cellIndex, const cvf::Vec3d& lengthsInCell)
|
||||
{
|
||||
switch (direction)
|
||||
RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData();
|
||||
|
||||
eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RimDefines::STATIC_NATIVE, "DX");
|
||||
cvf::ref<RigResultAccessor> dxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "DX");
|
||||
eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RimDefines::STATIC_NATIVE, "DY");
|
||||
cvf::ref<RigResultAccessor> dyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "DY");
|
||||
eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RimDefines::STATIC_NATIVE, "DZ");
|
||||
cvf::ref<RigResultAccessor> dzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "DZ");
|
||||
|
||||
double xLengthFraction = abs(lengthsInCell.x() / dxAccessObject->cellScalarGlobIdx(cellIndex));
|
||||
double yLengthFraction = abs(lengthsInCell.y() / dyAccessObject->cellScalarGlobIdx(cellIndex));
|
||||
double zLengthFraction = abs(lengthsInCell.z() / dzAccessObject->cellScalarGlobIdx(cellIndex));
|
||||
|
||||
if (xLengthFraction > yLengthFraction && xLengthFraction > zLengthFraction)
|
||||
{
|
||||
case POS_I:
|
||||
case NEG_I:
|
||||
return CellDirection::DIR_I;
|
||||
case POS_J:
|
||||
case NEG_J:
|
||||
}
|
||||
else if (yLengthFraction > xLengthFraction && yLengthFraction > zLengthFraction)
|
||||
{
|
||||
return CellDirection::DIR_J;
|
||||
case POS_K:
|
||||
case NEG_K:
|
||||
}
|
||||
else
|
||||
{
|
||||
return CellDirection::DIR_K;
|
||||
default:
|
||||
return CellDirection::DIR_UNDEF;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RicWellPathExportCompletionDataFeature::calculateTransmissibility(RimEclipseCase* eclipseCase, const RimWellPath* wellPath, const cvf::Vec3d& internalCellLengths, double skinFactor, double wellRadius, size_t cellIndex)
|
||||
{
|
||||
RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData();
|
||||
|
||||
eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RimDefines::STATIC_NATIVE, "DX");
|
||||
cvf::ref<RigResultAccessor> dxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "DX");
|
||||
eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RimDefines::STATIC_NATIVE, "DY");
|
||||
cvf::ref<RigResultAccessor> dyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "DY");
|
||||
eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RimDefines::STATIC_NATIVE, "DZ");
|
||||
cvf::ref<RigResultAccessor> dzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "DZ");
|
||||
|
||||
eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RimDefines::STATIC_NATIVE, "PERMX");
|
||||
cvf::ref<RigResultAccessor> permxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "PERMX");
|
||||
eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RimDefines::STATIC_NATIVE, "PERMY");
|
||||
cvf::ref<RigResultAccessor> permyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "PERMY");
|
||||
eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RimDefines::STATIC_NATIVE, "PERMZ");
|
||||
cvf::ref<RigResultAccessor> permzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "PERMZ");
|
||||
|
||||
double dx = dxAccessObject->cellScalarGlobIdx(cellIndex);
|
||||
double dy = dyAccessObject->cellScalarGlobIdx(cellIndex);
|
||||
double dz = dzAccessObject->cellScalarGlobIdx(cellIndex);
|
||||
double permx = permxAccessObject->cellScalarGlobIdx(cellIndex);
|
||||
double permy = permxAccessObject->cellScalarGlobIdx(cellIndex);
|
||||
double permz = permxAccessObject->cellScalarGlobIdx(cellIndex);
|
||||
|
||||
double darcy = RimUnitSystem::darcysConstant(wellPath->unitSystem());
|
||||
|
||||
double transx = RigTransmissibilityEquations::wellBoreTransmissibilityComponent(internalCellLengths.x(), permy, permz, dy, dz, wellRadius, skinFactor, darcy);
|
||||
double transy = RigTransmissibilityEquations::wellBoreTransmissibilityComponent(internalCellLengths.y(), permx, permz, dx, dz, wellRadius, skinFactor, darcy);
|
||||
double transz = RigTransmissibilityEquations::wellBoreTransmissibilityComponent(internalCellLengths.z(), permy, permx, dy, dx, wellRadius, skinFactor, darcy);
|
||||
|
||||
return RigTransmissibilityEquations::totalConnectionFactor(transx, transy, transz);
|
||||
}
|
||||
|
||||
@@ -48,7 +48,6 @@ struct WellSegmentLateralIntersection {
|
||||
cellIndex(cellIndex),
|
||||
length(length),
|
||||
depth(depth),
|
||||
direction(POS_I),
|
||||
mainBoreCell(false)
|
||||
{}
|
||||
|
||||
@@ -58,7 +57,7 @@ struct WellSegmentLateralIntersection {
|
||||
bool mainBoreCell;
|
||||
double length;
|
||||
double depth;
|
||||
WellPathCellDirection direction;
|
||||
cvf::Vec3d lengthsInCell;
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
@@ -151,5 +150,7 @@ private:
|
||||
|
||||
static void appendCompletionData(std::map<IJKCellIndex, RigCompletionData>* completionData, const std::vector<RigCompletionData>& data);
|
||||
|
||||
static CellDirection wellPathCellDirectionToCellDirection(WellPathCellDirection direction);
|
||||
static CellDirection calculateDirectionInCell(RimEclipseCase* eclipseCase, size_t cellIndex, const cvf::Vec3d& lengthsInCell);
|
||||
|
||||
static double calculateTransmissibility(RimEclipseCase* eclipseCase, const RimWellPath* wellPath, const cvf::Vec3d& internalCellLengths, double skinFactor, double wellRadius, size_t cellIndex);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user