mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1112, #1106 Added and removed fields to make the allocation plot have the needed data to do its calculation. Refacord the CenterLine calculation interface yet again to make it usable.
This commit is contained in:
@@ -59,7 +59,7 @@ void RicShowWellAllocationPlotFeature::onActionTriggered(bool isChecked)
|
|||||||
RimFlowPlotCollection* flowPlotColl = RiaApplication::instance()->project()->mainPlotCollection->flowPlotCollection();
|
RimFlowPlotCollection* flowPlotColl = RiaApplication::instance()->project()->mainPlotCollection->flowPlotCollection();
|
||||||
if (flowPlotColl)
|
if (flowPlotColl)
|
||||||
{
|
{
|
||||||
flowPlotColl->defaultPlot->setSimulationWell(eclWell);
|
flowPlotColl->defaultPlot->setFromSimulationWell(eclWell);
|
||||||
flowPlotColl->defaultPlot->updateConnectedEditors();
|
flowPlotColl->defaultPlot->updateConnectedEditors();
|
||||||
|
|
||||||
// Make sure the summary plot window is created and visible
|
// Make sure the summary plot window is created and visible
|
||||||
|
|||||||
@@ -29,7 +29,12 @@
|
|||||||
#include "RimWellLogPlot.h"
|
#include "RimWellLogPlot.h"
|
||||||
#include "RimWellLogTrack.h"
|
#include "RimWellLogTrack.h"
|
||||||
#include "RigSingleWellResultsData.h"
|
#include "RigSingleWellResultsData.h"
|
||||||
|
#include "RimEclipseResultCase.h"
|
||||||
|
#include "RimEclipseCellColors.h"
|
||||||
|
#include "RimFlowDiagSolution.h"
|
||||||
|
#include "RimEclipseCase.h"
|
||||||
|
#include "RigEclipseCaseData.h"
|
||||||
|
#include "RigSimulationWellCenterLineCalculator.h"
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT(RimWellAllocationPlot, "WellAllocationPlot");
|
CAF_PDM_SOURCE_INIT(RimWellAllocationPlot, "WellAllocationPlot");
|
||||||
|
|
||||||
@@ -45,12 +50,18 @@ RimWellAllocationPlot::RimWellAllocationPlot()
|
|||||||
m_userName.uiCapability()->setUiReadOnly(true);
|
m_userName.uiCapability()->setUiReadOnly(true);
|
||||||
|
|
||||||
CAF_PDM_InitField(&m_showPlotTitle, "ShowPlotTitle", true, "Show Plot Title", "", "", "");
|
CAF_PDM_InitField(&m_showPlotTitle, "ShowPlotTitle", true, "Show Plot Title", "", "", "");
|
||||||
CAF_PDM_InitFieldNoDefault(&m_simulationWell, "SimulationWell", "Simulation Well", "", "", "");
|
|
||||||
|
CAF_PDM_InitFieldNoDefault(&m_case, "CurveCase", "Case", "", "", "");
|
||||||
|
m_case.uiCapability()->setUiTreeChildrenHidden(true);
|
||||||
|
|
||||||
|
CAF_PDM_InitField(&m_timeStep, "PlotTimeStep", 0, "Time Step", "", "", "");
|
||||||
|
CAF_PDM_InitField(&m_wellName, "WellName", QString("None"), "Well", "", "", "");
|
||||||
|
CAF_PDM_InitFieldNoDefault(&m_flowDiagSolution, "FlowDiagSolution", "Flow Diag Solution", "", "", "");
|
||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault(&m_accumulatedWellFlowPlot, "AccumulatedWellFlowPlot", "Accumulated Well Flow", "", "", "");
|
CAF_PDM_InitFieldNoDefault(&m_accumulatedWellFlowPlot, "AccumulatedWellFlowPlot", "Accumulated Well Flow", "", "", "");
|
||||||
m_accumulatedWellFlowPlot.uiCapability()->setUiHidden(true);
|
m_accumulatedWellFlowPlot.uiCapability()->setUiHidden(true);
|
||||||
|
|
||||||
m_accumulatedWellFlowPlot = new RimWellLogPlot;
|
m_accumulatedWellFlowPlot = new RimWellLogPlot;
|
||||||
|
|
||||||
this->setAsPlotMdiWindow();
|
this->setAsPlotMdiWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,9 +80,18 @@ RimWellAllocationPlot::~RimWellAllocationPlot()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimWellAllocationPlot::setSimulationWell(RimEclipseWell* simWell)
|
void RimWellAllocationPlot::setFromSimulationWell(RimEclipseWell* simWell)
|
||||||
{
|
{
|
||||||
m_simulationWell = simWell;
|
RimEclipseView* eclView;
|
||||||
|
simWell->firstAncestorOrThisOfType(eclView);
|
||||||
|
RimEclipseResultCase* eclCase;
|
||||||
|
simWell->firstAncestorOrThisOfType(eclCase);
|
||||||
|
|
||||||
|
m_case = eclCase;
|
||||||
|
m_wellName = simWell->wellResults()->m_wellName;
|
||||||
|
m_timeStep = eclView->currentTimeStep();
|
||||||
|
|
||||||
|
m_flowDiagSolution = eclView->cellResult()->flowDiagSolution();
|
||||||
|
|
||||||
updateFromWell();
|
updateFromWell();
|
||||||
}
|
}
|
||||||
@@ -93,27 +113,31 @@ void RimWellAllocationPlot::deleteViewWidget()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimWellAllocationPlot::updateFromWell()
|
void RimWellAllocationPlot::updateFromWell()
|
||||||
{
|
{
|
||||||
QString simName = "None";
|
if (!m_case) return;
|
||||||
|
|
||||||
|
const RigSingleWellResultsData* wellResults = nullptr;
|
||||||
|
wellResults = m_case->reservoirData()->findWellResult(m_wellName);
|
||||||
|
|
||||||
|
if (!wellResults) return;
|
||||||
|
|
||||||
int branchCount = 0;
|
int branchCount = 0;
|
||||||
|
|
||||||
const RigWellResultFrame* wellResultFrame = nullptr;
|
const RigWellResultFrame* wellResultFrame = nullptr;
|
||||||
|
std::vector< std::vector <cvf::Vec3d> > pipeBranchesCLCoords;
|
||||||
|
std::vector< std::vector <RigWellResultPoint> > pipeBranchesCellIds;
|
||||||
|
|
||||||
if (m_simulationWell && m_simulationWell->wellResults() )// && Timestep Ok )
|
RigSimulationWellCenterLineCalculator::calculateWellPipeCenterlineFromWellFrame(m_case->reservoirData(),
|
||||||
{
|
wellResults,
|
||||||
simName = m_simulationWell->name();
|
m_timeStep,
|
||||||
wellResultFrame = &(m_simulationWell->wellResults()->wellResultFrame(1));
|
true,
|
||||||
branchCount = static_cast<int>( wellResultFrame->m_wellResultBranches.size());
|
true,
|
||||||
// // Todo : Use this instead, and use to calculate accumulated flow
|
pipeBranchesCLCoords,
|
||||||
//
|
pipeBranchesCellIds);
|
||||||
// size_t timeStep = 0; // make field
|
|
||||||
// std::vector< std::vector <cvf::Vec3d> > pipeBranchesCLCoords;
|
branchCount = static_cast<int>(pipeBranchesCLCoords.size());
|
||||||
// std::vector< std::vector <RigWellResultPoint> > pipeBranchesCellIds;
|
|
||||||
// m_simulationWell->calculateWellPipeDynamicCenterLine(timeStep, pipeBranchesCLCoords, pipeBranchesCellIds);
|
|
||||||
// branchCount = static_cast<int>( pipeBranchesCLCoords.size());
|
|
||||||
}
|
|
||||||
|
|
||||||
int existingTrackCount = static_cast<int>(accumulatedWellFlowPlot()->trackCount());
|
int existingTrackCount = static_cast<int>(accumulatedWellFlowPlot()->trackCount());
|
||||||
accumulatedWellFlowPlot()->setDescription("Accumulated Well Flow (" + simName + ")");
|
accumulatedWellFlowPlot()->setDescription("Accumulated Well Flow (" + m_wellName + ")");
|
||||||
|
|
||||||
int neededExtraTrackCount = branchCount - existingTrackCount;
|
int neededExtraTrackCount = branchCount - existingTrackCount;
|
||||||
for (int etc = 0; etc < neededExtraTrackCount; ++etc)
|
for (int etc = 0; etc < neededExtraTrackCount; ++etc)
|
||||||
@@ -136,7 +160,9 @@ void RimWellAllocationPlot::updateFromWell()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setDescription("Well Allocation (" + simName + ")");
|
// Todo: Calculate curve data
|
||||||
|
|
||||||
|
setDescription("Well Allocation (" + m_wellName + ")");
|
||||||
accumulatedWellFlowPlot()->updateConnectedEditors();
|
accumulatedWellFlowPlot()->updateConnectedEditors();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -170,22 +196,23 @@ QList<caf::PdmOptionItemInfo> RimWellAllocationPlot::calculateValueOptions(const
|
|||||||
{
|
{
|
||||||
QList<caf::PdmOptionItemInfo> options;
|
QList<caf::PdmOptionItemInfo> options;
|
||||||
|
|
||||||
if (fieldNeedingOptions == &m_simulationWell)
|
if (fieldNeedingOptions == &m_wellName)
|
||||||
{
|
{
|
||||||
RimView* activeView = RiaApplication::instance()->activeReservoirView();
|
std::set<QString> sortedWellNames;
|
||||||
RimEclipseView* eclView = dynamic_cast<RimEclipseView*>(activeView);
|
if ( m_case )
|
||||||
|
|
||||||
if (eclView && eclView->wellCollection())
|
|
||||||
{
|
{
|
||||||
RimEclipseWellCollection* coll = eclView->wellCollection();
|
const cvf::Collection<RigSingleWellResultsData>& wellRes = m_case->reservoirData()->wellResults();
|
||||||
|
|
||||||
caf::PdmChildArrayField<RimEclipseWell*>& eclWells = coll->wells;
|
for ( size_t wIdx = 0; wIdx < wellRes.size(); ++wIdx )
|
||||||
|
{
|
||||||
|
sortedWellNames.insert(wellRes[wIdx]->m_wellName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QIcon simWellIcon(":/Well.png");
|
QIcon simWellIcon(":/Well.png");
|
||||||
for (RimEclipseWell* eclWell : eclWells)
|
for ( const QString& wname: sortedWellNames )
|
||||||
{
|
{
|
||||||
options.push_back(caf::PdmOptionItemInfo(eclWell->name(), eclWell, false, simWellIcon));
|
options.push_back(caf::PdmOptionItemInfo(wname, wname, false, simWellIcon));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.size() == 0)
|
if (options.size() == 0)
|
||||||
@@ -193,6 +220,20 @@ QList<caf::PdmOptionItemInfo> RimWellAllocationPlot::calculateValueOptions(const
|
|||||||
options.push_front(caf::PdmOptionItemInfo("None", nullptr));
|
options.push_front(caf::PdmOptionItemInfo("None", nullptr));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (fieldNeedingOptions == &m_timeStep)
|
||||||
|
{
|
||||||
|
QStringList timeStepNames;
|
||||||
|
|
||||||
|
if (m_case)
|
||||||
|
{
|
||||||
|
timeStepNames = m_case->timeStepStrings();
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < timeStepNames.size(); i++)
|
||||||
|
{
|
||||||
|
options.push_back(caf::PdmOptionItemInfo(timeStepNames[i], i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
@@ -209,7 +250,7 @@ void RimWellAllocationPlot::fieldChangedByUi(const caf::PdmFieldHandle* changedF
|
|||||||
{
|
{
|
||||||
updateMdiWindowTitle();
|
updateMdiWindowTitle();
|
||||||
}
|
}
|
||||||
else if (changedField == &m_simulationWell)
|
else if (changedField == &m_wellName)
|
||||||
{
|
{
|
||||||
updateFromWell();
|
updateFromWell();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
class RiuWellAllocationPlot;
|
class RiuWellAllocationPlot;
|
||||||
class RimEclipseWell;
|
class RimEclipseWell;
|
||||||
class RimWellLogPlot;
|
class RimWellLogPlot;
|
||||||
|
class RimEclipseResultCase;
|
||||||
|
|
||||||
namespace caf {
|
namespace caf {
|
||||||
class PdmOptionItemInfo;
|
class PdmOptionItemInfo;
|
||||||
@@ -48,7 +49,7 @@ public:
|
|||||||
RimWellAllocationPlot();
|
RimWellAllocationPlot();
|
||||||
virtual ~RimWellAllocationPlot();
|
virtual ~RimWellAllocationPlot();
|
||||||
|
|
||||||
void setSimulationWell(RimEclipseWell* simWell);
|
void setFromSimulationWell(RimEclipseWell* simWell);
|
||||||
|
|
||||||
void setDescription(const QString& description);
|
void setDescription(const QString& description);
|
||||||
QString description() const;
|
QString description() const;
|
||||||
@@ -81,9 +82,11 @@ private:
|
|||||||
private:
|
private:
|
||||||
caf::PdmField<bool> m_showPlotTitle;
|
caf::PdmField<bool> m_showPlotTitle;
|
||||||
caf::PdmField<QString> m_userName;
|
caf::PdmField<QString> m_userName;
|
||||||
//caf::PdmField<bool> m_showAccWellFlowPlot;
|
|
||||||
|
|
||||||
caf::PdmPtrField<RimEclipseWell*> m_simulationWell;
|
caf::PdmPtrField<RimEclipseResultCase*> m_case;
|
||||||
|
caf::PdmField<QString> m_wellName;
|
||||||
|
caf::PdmField<int> m_timeStep;
|
||||||
|
caf::PdmPtrField<RimFlowDiagSolution*> m_flowDiagSolution;
|
||||||
|
|
||||||
QPointer<RiuWellAllocationPlot> m_wellAllocationPlotWidget;
|
QPointer<RiuWellAllocationPlot> m_wellAllocationPlotWidget;
|
||||||
|
|
||||||
|
|||||||
@@ -262,6 +262,20 @@ void RigEclipseCaseData::setWellResults(const cvf::Collection<RigSingleWellResul
|
|||||||
computeWellCellsPrGrid();
|
computeWellCellsPrGrid();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
const RigSingleWellResultsData* RigEclipseCaseData::findWellResult(QString wellName) const
|
||||||
|
{
|
||||||
|
for (size_t wIdx = 0; wIdx < m_wellResults.size(); ++wIdx)
|
||||||
|
{
|
||||||
|
if (m_wellResults[wIdx]->m_wellName == wellName) return m_wellResults[wIdx].p();
|
||||||
|
}
|
||||||
|
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ public:
|
|||||||
|
|
||||||
void setWellResults(const cvf::Collection<RigSingleWellResultsData>& data);
|
void setWellResults(const cvf::Collection<RigSingleWellResultsData>& data);
|
||||||
const cvf::Collection<RigSingleWellResultsData>& wellResults() { return m_wellResults; }
|
const cvf::Collection<RigSingleWellResultsData>& wellResults() { return m_wellResults; }
|
||||||
|
const RigSingleWellResultsData* findWellResult(QString wellName) const;
|
||||||
|
|
||||||
const cvf::UByteArray* wellCellsInGrid(size_t gridIndex);
|
const cvf::UByteArray* wellCellsInGrid(size_t gridIndex);
|
||||||
const cvf::UIntArray* gridCellToResultWellIndex(size_t gridIndex);
|
const cvf::UIntArray* gridCellToResultWellIndex(size_t gridIndex);
|
||||||
|
|||||||
@@ -38,39 +38,7 @@ void RigSimulationWellCenterLineCalculator::calculateWellPipeStaticCenterline(Ri
|
|||||||
std::vector< std::vector <cvf::Vec3d> >& pipeBranchesCLCoords,
|
std::vector< std::vector <cvf::Vec3d> >& pipeBranchesCLCoords,
|
||||||
std::vector< std::vector <RigWellResultPoint> >& pipeBranchesCellIds)
|
std::vector< std::vector <RigWellResultPoint> >& pipeBranchesCellIds)
|
||||||
{
|
{
|
||||||
bool isAutoDetectBranches = false;
|
calculateWellPipeDynamicCenterline(rimWell, -1, pipeBranchesCLCoords, pipeBranchesCellIds);
|
||||||
RigEclipseCaseData* eclipseCaseData = NULL;
|
|
||||||
RigSingleWellResultsData* wellResults = NULL;
|
|
||||||
|
|
||||||
{
|
|
||||||
CVF_ASSERT(rimWell);
|
|
||||||
RimEclipseView* eclipseView;
|
|
||||||
rimWell->firstAncestorOrThisOfType(eclipseView);
|
|
||||||
CVF_ASSERT(eclipseView);
|
|
||||||
|
|
||||||
isAutoDetectBranches = eclipseView->wellCollection()->isAutoDetectingBranches();
|
|
||||||
eclipseCaseData = eclipseView->eclipseCase()->reservoirData();
|
|
||||||
wellResults = rimWell->wellResults();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make sure we have computed the static representation of the well
|
|
||||||
if (wellResults->m_staticWellCells.m_wellResultBranches.size() == 0)
|
|
||||||
{
|
|
||||||
wellResults->computeStaticWellCellPath();
|
|
||||||
}
|
|
||||||
|
|
||||||
const RigWellResultFrame& staticWellFrame = wellResults->m_staticWellCells;
|
|
||||||
bool isMultiSegmentWell = wellResults->isMultiSegmentWell();
|
|
||||||
bool useAllCellCenters = rimWell->isUsingCellCenterForPipe();
|
|
||||||
|
|
||||||
calculateWellPipeCenterlineFromWellFrame(staticWellFrame,
|
|
||||||
eclipseCaseData,
|
|
||||||
isMultiSegmentWell,
|
|
||||||
isAutoDetectBranches,
|
|
||||||
useAllCellCenters,
|
|
||||||
pipeBranchesCLCoords,
|
|
||||||
pipeBranchesCellIds);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -82,31 +50,23 @@ void RigSimulationWellCenterLineCalculator::calculateWellPipeDynamicCenterline(R
|
|||||||
std::vector< std::vector <cvf::Vec3d> >& pipeBranchesCLCoords,
|
std::vector< std::vector <cvf::Vec3d> >& pipeBranchesCLCoords,
|
||||||
std::vector< std::vector <RigWellResultPoint> >& pipeBranchesCellIds)
|
std::vector< std::vector <RigWellResultPoint> >& pipeBranchesCellIds)
|
||||||
{
|
{
|
||||||
bool isAutoDetectBranches = false;
|
|
||||||
RigEclipseCaseData* eclipseCaseData = NULL;
|
|
||||||
RigSingleWellResultsData* wellResults = NULL;
|
|
||||||
|
|
||||||
{
|
|
||||||
CVF_ASSERT(rimWell);
|
CVF_ASSERT(rimWell);
|
||||||
|
|
||||||
|
RigSingleWellResultsData* wellResults = rimWell->wellResults();
|
||||||
|
|
||||||
RimEclipseView* eclipseView;
|
RimEclipseView* eclipseView;
|
||||||
rimWell->firstAncestorOrThisOfType(eclipseView);
|
rimWell->firstAncestorOrThisOfType(eclipseView);
|
||||||
|
|
||||||
CVF_ASSERT(eclipseView);
|
CVF_ASSERT(eclipseView);
|
||||||
|
|
||||||
isAutoDetectBranches = eclipseView->wellCollection()->isAutoDetectingBranches();
|
RigEclipseCaseData* eclipseCaseData = eclipseView->eclipseCase()->reservoirData();
|
||||||
eclipseCaseData = eclipseView->eclipseCase()->reservoirData();
|
bool isAutoDetectBranches = eclipseView->wellCollection()->isAutoDetectingBranches();
|
||||||
wellResults = rimWell->wellResults();
|
|
||||||
|
|
||||||
if ( !wellResults || !wellResults->hasWellResult(timeStepIndex) ) return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const RigWellResultFrame& wellFrame = wellResults->wellResultFrame(timeStepIndex);
|
|
||||||
bool isMultiSegmentWell = wellResults->isMultiSegmentWell();
|
|
||||||
bool useAllCellCenters = rimWell->isUsingCellCenterForPipe();
|
bool useAllCellCenters = rimWell->isUsingCellCenterForPipe();
|
||||||
|
|
||||||
calculateWellPipeCenterlineFromWellFrame(wellFrame,
|
calculateWellPipeCenterlineFromWellFrame(eclipseCaseData,
|
||||||
eclipseCaseData,
|
wellResults,
|
||||||
isMultiSegmentWell,
|
static_cast<int>(timeStepIndex),
|
||||||
isAutoDetectBranches,
|
isAutoDetectBranches,
|
||||||
useAllCellCenters,
|
useAllCellCenters,
|
||||||
pipeBranchesCLCoords,
|
pipeBranchesCLCoords,
|
||||||
@@ -118,14 +78,37 @@ void RigSimulationWellCenterLineCalculator::calculateWellPipeDynamicCenterline(R
|
|||||||
/// The returned CellIds is one less than the number of centerline points,
|
/// The returned CellIds is one less than the number of centerline points,
|
||||||
/// and are describing the lines between the points, starting with the first line
|
/// and are describing the lines between the points, starting with the first line
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RigSimulationWellCenterLineCalculator::calculateWellPipeCenterlineFromWellFrame(const RigWellResultFrame &wellFrame,
|
void RigSimulationWellCenterLineCalculator::calculateWellPipeCenterlineFromWellFrame(const RigEclipseCaseData* eclipseCaseData,
|
||||||
const RigEclipseCaseData* eclipseCaseData,
|
const RigSingleWellResultsData* wellResults,
|
||||||
bool isMultiSegmentWell,
|
int timeStepIndex,
|
||||||
bool isAutoDetectBranches,
|
bool isAutoDetectBranches,
|
||||||
bool useAllCellCenters,
|
bool useAllCellCenters,
|
||||||
std::vector<std::vector<cvf::Vec3d>> &pipeBranchesCLCoords,
|
std::vector<std::vector<cvf::Vec3d>> &pipeBranchesCLCoords,
|
||||||
std::vector<std::vector<RigWellResultPoint>> &pipeBranchesCellIds)
|
std::vector<std::vector<RigWellResultPoint>> &pipeBranchesCellIds)
|
||||||
{
|
{
|
||||||
|
if ( !wellResults) return;
|
||||||
|
if ( timeStepIndex >= 0 && !wellResults->hasWellResult(timeStepIndex) ) return;
|
||||||
|
|
||||||
|
const RigWellResultFrame* wellFramePtr = nullptr;
|
||||||
|
|
||||||
|
if (timeStepIndex < 0)
|
||||||
|
{
|
||||||
|
// Make sure we have computed the static representation of the well
|
||||||
|
if (wellResults->m_staticWellCells.m_wellResultBranches.size() == 0)
|
||||||
|
{
|
||||||
|
wellResults->computeStaticWellCellPath();
|
||||||
|
}
|
||||||
|
|
||||||
|
wellFramePtr = &wellResults->m_staticWellCells;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
wellFramePtr = &(wellResults->wellResultFrame(timeStepIndex));
|
||||||
|
}
|
||||||
|
|
||||||
|
const RigWellResultFrame& wellFrame = *wellFramePtr;
|
||||||
|
bool isMultiSegmentWell = wellResults->isMultiSegmentWell();
|
||||||
|
|
||||||
// Initialize the return arrays
|
// Initialize the return arrays
|
||||||
pipeBranchesCLCoords.clear();
|
pipeBranchesCLCoords.clear();
|
||||||
pipeBranchesCellIds.clear();
|
pipeBranchesCellIds.clear();
|
||||||
|
|||||||
@@ -38,14 +38,14 @@ public:
|
|||||||
std::vector< std::vector <RigWellResultPoint> >& pipeBranchesCellIds) ;
|
std::vector< std::vector <RigWellResultPoint> >& pipeBranchesCellIds) ;
|
||||||
|
|
||||||
|
|
||||||
private:
|
static void calculateWellPipeCenterlineFromWellFrame(const RigEclipseCaseData* eclipseCaseData,
|
||||||
static void calculateWellPipeCenterlineFromWellFrame(const RigWellResultFrame& wellFrame,
|
const RigSingleWellResultsData* wellResults,
|
||||||
const RigEclipseCaseData* eclipseCaseData,
|
int timeStepIndex,
|
||||||
bool isMultiSegmentWell,
|
|
||||||
bool isAutoDetectBranches,
|
bool isAutoDetectBranches,
|
||||||
bool useAllCellCenters,
|
bool useAllCellCenters,
|
||||||
std::vector<std::vector<cvf::Vec3d>> & pipeBranchesCLCoords,
|
std::vector<std::vector<cvf::Vec3d>> &pipeBranchesCLCoords,
|
||||||
std::vector<std::vector<RigWellResultPoint>> & pipeBranchesCellIds);
|
std::vector<std::vector<RigWellResultPoint>> &pipeBranchesCellIds);
|
||||||
|
private:
|
||||||
|
|
||||||
static bool hasAnyResultCells(const std::vector<RigWellResultBranch> &resBranches);
|
static bool hasAnyResultCells(const std::vector<RigWellResultBranch> &resBranches);
|
||||||
static bool hasAnyValidDataCells(const RigWellResultBranch& branch);
|
static bool hasAnyValidDataCells(const RigWellResultBranch& branch);
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ bool operator== (const RigWellResultPoint& p1, const RigWellResultPoint& p2)
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RigSingleWellResultsData::computeStaticWellCellPath()
|
void RigSingleWellResultsData::computeStaticWellCellPath() const
|
||||||
{
|
{
|
||||||
if (m_wellCellsTimeSteps.size() == 0) return;
|
if (m_wellCellsTimeSteps.size() == 0) return;
|
||||||
|
|
||||||
@@ -133,7 +133,7 @@ void RigSingleWellResultsData::computeStaticWellCellPath()
|
|||||||
for (size_t bIdx = 0; bIdx < m_wellCellsTimeSteps[0].m_wellResultBranches.size(); ++bIdx)
|
for (size_t bIdx = 0; bIdx < m_wellCellsTimeSteps[0].m_wellResultBranches.size(); ++bIdx)
|
||||||
{
|
{
|
||||||
int branchErtId = m_wellCellsTimeSteps[0].m_wellResultBranches[bIdx].m_ertBranchId;
|
int branchErtId = m_wellCellsTimeSteps[0].m_wellResultBranches[bIdx].m_ertBranchId;
|
||||||
std::vector<RigWellResultPoint>& frameCells = m_wellCellsTimeSteps[0].m_wellResultBranches[bIdx].m_branchResultPoints;
|
const std::vector<RigWellResultPoint>& frameCells = m_wellCellsTimeSteps[0].m_wellResultBranches[bIdx].m_branchResultPoints;
|
||||||
|
|
||||||
std::list< RigWellResultPoint >& branch = staticWellBranches[branchErtId];
|
std::list< RigWellResultPoint >& branch = staticWellBranches[branchErtId];
|
||||||
|
|
||||||
@@ -152,7 +152,7 @@ void RigSingleWellResultsData::computeStaticWellCellPath()
|
|||||||
for (size_t bIdx = 0; bIdx < m_wellCellsTimeSteps[tIdx].m_wellResultBranches.size(); ++bIdx)
|
for (size_t bIdx = 0; bIdx < m_wellCellsTimeSteps[tIdx].m_wellResultBranches.size(); ++bIdx)
|
||||||
{
|
{
|
||||||
int branchId = m_wellCellsTimeSteps[tIdx].m_wellResultBranches[bIdx].m_ertBranchId;
|
int branchId = m_wellCellsTimeSteps[tIdx].m_wellResultBranches[bIdx].m_ertBranchId;
|
||||||
std::vector<RigWellResultPoint>& resBranch = m_wellCellsTimeSteps[tIdx].m_wellResultBranches[bIdx].m_branchResultPoints;
|
const std::vector<RigWellResultPoint>& resBranch = m_wellCellsTimeSteps[tIdx].m_wellResultBranches[bIdx].m_branchResultPoints;
|
||||||
|
|
||||||
std::list< RigWellResultPoint >& stBranch = staticWellBranches[branchId];
|
std::list< RigWellResultPoint >& stBranch = staticWellBranches[branchId];
|
||||||
std::list< RigWellResultPoint >::iterator sEndIt;
|
std::list< RigWellResultPoint >::iterator sEndIt;
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ public:
|
|||||||
|
|
||||||
const RigWellResultFrame& wellResultFrame(size_t resultTimeStepIndex) const;
|
const RigWellResultFrame& wellResultFrame(size_t resultTimeStepIndex) const;
|
||||||
|
|
||||||
void computeStaticWellCellPath();
|
void computeStaticWellCellPath() const ;
|
||||||
|
|
||||||
void computeMappingFromResultTimeIndicesToWellTimeIndices(const std::vector<QDateTime>& resultTimes);
|
void computeMappingFromResultTimeIndicesToWellTimeIndices(const std::vector<QDateTime>& resultTimes);
|
||||||
|
|
||||||
@@ -137,6 +137,6 @@ public:
|
|||||||
|
|
||||||
std::vector<size_t> m_resultTimeStepIndexToWellTimeStepIndex; // Well result timesteps may differ from result timesteps
|
std::vector<size_t> m_resultTimeStepIndexToWellTimeStepIndex; // Well result timesteps may differ from result timesteps
|
||||||
std::vector< RigWellResultFrame > m_wellCellsTimeSteps;
|
std::vector< RigWellResultFrame > m_wellCellsTimeSteps;
|
||||||
RigWellResultFrame m_staticWellCells;
|
mutable RigWellResultFrame m_staticWellCells;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user