mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2553 Well CF Visualization: Add recompute of virtual conn factors
This commit is contained in:
parent
50212fff0d
commit
c0054cff91
@ -394,31 +394,39 @@ const RigVirtualPerforationTransmissibilities* RimEclipseCase::computeAndGetVirt
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rigEclipseCase->setVirtualPerforationTransmissibilities(perfTrans.p());
|
;
|
||||||
|
for (const auto& wellRes : rigEclipseCase->wellResults())
|
||||||
{
|
{
|
||||||
double minValue = HUGE_VAL;
|
std::vector<std::vector<RigCompletionData>> completionsPerTimeStep;
|
||||||
double maxValue = -HUGE_VAL;
|
for (size_t i = 0; i < timeStepDates().size(); i++)
|
||||||
double posClosestToZero = HUGE_VAL;
|
|
||||||
double negClosestToZero = -HUGE_VAL;
|
|
||||||
|
|
||||||
perfTrans->computeMinMax(&minValue, &maxValue, &posClosestToZero, &negClosestToZero);
|
|
||||||
|
|
||||||
if (minValue != HUGE_VAL)
|
|
||||||
{
|
{
|
||||||
for (const auto& v : views())
|
std::vector<RigCompletionData> completionData;
|
||||||
{
|
|
||||||
RimEclipseView* eclView = dynamic_cast<RimEclipseView*>(v);
|
|
||||||
if (eclView)
|
|
||||||
{
|
|
||||||
RimLegendConfig* legendConfig = eclView->virtualPerforationResult()->legendConfig();
|
|
||||||
|
|
||||||
legendConfig->setAutomaticRanges(minValue, maxValue, minValue, maxValue);
|
if (wellRes->hasWellResult(i))
|
||||||
legendConfig->setClosestToZeroValues(posClosestToZero, negClosestToZero, posClosestToZero, negClosestToZero);
|
{
|
||||||
|
for (const auto& wellResultBranch : wellRes->wellResultFrame(i).m_wellResultBranches)
|
||||||
|
{
|
||||||
|
for (const auto& r : wellResultBranch.m_branchResultPoints)
|
||||||
|
{
|
||||||
|
if (r.isValid() && r.m_isOpen)
|
||||||
|
{
|
||||||
|
RigCompletionData compData(wellRes->m_wellName, RigCompletionDataGridCell(r.m_gridCellIndex, rigEclipseCase->mainGrid()), 0);
|
||||||
|
compData.setTransmissibility(r.connectionFactor());
|
||||||
|
|
||||||
|
completionData.push_back(compData);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
completionsPerTimeStep.push_back(completionData);
|
||||||
|
|
||||||
|
perfTrans->setCompletionDataForSimWell(wellRes.p(), completionsPerTimeStep);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rigEclipseCase->setVirtualPerforationTransmissibilities(perfTrans.p());
|
||||||
}
|
}
|
||||||
|
|
||||||
return rigEclipseCase->virtualPerforationTransmissibilities();
|
return rigEclipseCase->virtualPerforationTransmissibilities();
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
#include "RigResultAccessor.h"
|
#include "RigResultAccessor.h"
|
||||||
#include "RigResultAccessorFactory.h"
|
#include "RigResultAccessorFactory.h"
|
||||||
#include "RigSimWellData.h"
|
#include "RigSimWellData.h"
|
||||||
|
#include "RigVirtualPerforationTransmissibilities.h"
|
||||||
|
|
||||||
#include "Rim3dOverlayInfoConfig.h"
|
#include "Rim3dOverlayInfoConfig.h"
|
||||||
#include "RimCellEdgeColors.h"
|
#include "RimCellEdgeColors.h"
|
||||||
@ -310,8 +311,6 @@ void RimEclipseView::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c
|
|||||||
|
|
||||||
scheduleCreateDisplayModelAndRedraw();
|
scheduleCreateDisplayModelAndRedraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -843,6 +842,11 @@ void RimEclipseView::onLoadDataAndUpdate()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this->isVirtualConnectionFactorGeometryVisible())
|
||||||
|
{
|
||||||
|
m_virtualPerforationResult->loadData();
|
||||||
|
}
|
||||||
|
|
||||||
this->scheduleCreateDisplayModelAndRedraw();
|
this->scheduleCreateDisplayModelAndRedraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1103,6 +1107,8 @@ void RimEclipseView::updateLegends()
|
|||||||
|
|
||||||
if (m_virtualPerforationResult->isActive())
|
if (m_virtualPerforationResult->isActive())
|
||||||
{
|
{
|
||||||
|
updateVirtualConnectionLegendRanges();
|
||||||
|
|
||||||
RimLegendConfig* virtLegend = m_virtualPerforationResult->legendConfig();
|
RimLegendConfig* virtLegend = m_virtualPerforationResult->legendConfig();
|
||||||
|
|
||||||
m_viewer->addColorLegendToBottomLeftCorner(virtLegend->legend());
|
m_viewer->addColorLegendToBottomLeftCorner(virtLegend->legend());
|
||||||
@ -1593,6 +1599,33 @@ void RimEclipseView::resetLegendsInViewer()
|
|||||||
m_viewer->addColorLegendToBottomLeftCorner(this->cellEdgeResult()->legendConfig()->legend());
|
m_viewer->addColorLegendToBottomLeftCorner(this->cellEdgeResult()->legendConfig()->legend());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimEclipseView::updateVirtualConnectionLegendRanges()
|
||||||
|
{
|
||||||
|
if (!eclipseCase()) return;
|
||||||
|
|
||||||
|
const RigVirtualPerforationTransmissibilities* virtualTransmissibilities = eclipseCase()->computeAndGetVirtualPerforationTransmissibilities();
|
||||||
|
if (virtualTransmissibilities)
|
||||||
|
{
|
||||||
|
double minValue = HUGE_VAL;
|
||||||
|
double maxValue = -HUGE_VAL;
|
||||||
|
double posClosestToZero = HUGE_VAL;
|
||||||
|
double negClosestToZero = -HUGE_VAL;
|
||||||
|
|
||||||
|
virtualTransmissibilities->computeMinMax(&minValue, &maxValue, &posClosestToZero, &negClosestToZero);
|
||||||
|
|
||||||
|
if (minValue != HUGE_VAL)
|
||||||
|
{
|
||||||
|
RimLegendConfig* legendConfig = virtualPerforationResult()->legendConfig();
|
||||||
|
|
||||||
|
legendConfig->setAutomaticRanges(minValue, maxValue, minValue, maxValue);
|
||||||
|
legendConfig->setClosestToZeroValues(posClosestToZero, negClosestToZero, posClosestToZero, negClosestToZero);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -162,6 +162,7 @@ private:
|
|||||||
void updateLegends();
|
void updateLegends();
|
||||||
void updateMinMaxValuesAndAddLegendToView(QString legendLabel, RimEclipseCellColors* resultColors, RigCaseCellResultsData* cellResultsData);
|
void updateMinMaxValuesAndAddLegendToView(QString legendLabel, RimEclipseCellColors* resultColors, RigCaseCellResultsData* cellResultsData);
|
||||||
virtual void resetLegendsInViewer() override;
|
virtual void resetLegendsInViewer() override;
|
||||||
|
void updateVirtualConnectionLegendRanges();
|
||||||
|
|
||||||
std::set<RivCellSetEnum> allVisibleFaultGeometryTypes() const;
|
std::set<RivCellSetEnum> allVisibleFaultGeometryTypes() const;
|
||||||
void updateFaultColors();
|
void updateFaultColors();
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
#include "RimVirtualPerforationResults.h"
|
#include "RimVirtualPerforationResults.h"
|
||||||
|
|
||||||
|
#include "RimEclipseCase.h"
|
||||||
#include "RimEclipseView.h"
|
#include "RimEclipseView.h"
|
||||||
#include "RimLegendConfig.h"
|
#include "RimLegendConfig.h"
|
||||||
|
|
||||||
@ -35,7 +36,7 @@ RimVirtualPerforationResults::RimVirtualPerforationResults()
|
|||||||
CAF_PDM_InitObject(connectionFactorUiName, ":/CellResult.png", "", "");
|
CAF_PDM_InitObject(connectionFactorUiName, ":/CellResult.png", "", "");
|
||||||
|
|
||||||
CAF_PDM_InitField(&m_isActive, "ShowConnectionFactors", false, "", "", "", "");
|
CAF_PDM_InitField(&m_isActive, "ShowConnectionFactors", false, "", "", "", "");
|
||||||
CAF_PDM_InitField(&m_geometryScaleFactor, "GeometryScaleFactor", 0.2, "Geometry Scale Factor", "", "", "");
|
CAF_PDM_InitField(&m_geometryScaleFactor, "GeometryScaleFactor", 1.0, "Geometry Scale Factor", "", "", "");
|
||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault(&m_legendConfig, "LegendDefinition", "Legend Definition", "", "", "");
|
CAF_PDM_InitFieldNoDefault(&m_legendConfig, "LegendDefinition", "Legend Definition", "", "", "");
|
||||||
m_legendConfig.uiCapability()->setUiHidden(true);
|
m_legendConfig.uiCapability()->setUiHidden(true);
|
||||||
@ -75,6 +76,19 @@ RimLegendConfig* RimVirtualPerforationResults::legendConfig() const
|
|||||||
return m_legendConfig();
|
return m_legendConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimVirtualPerforationResults::loadData()
|
||||||
|
{
|
||||||
|
RimEclipseCase* eclipseCase = nullptr;
|
||||||
|
this->firstAncestorOrThisOfType(eclipseCase);
|
||||||
|
if (eclipseCase)
|
||||||
|
{
|
||||||
|
eclipseCase->computeAndGetVirtualPerforationTransmissibilities();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -85,6 +99,8 @@ void RimVirtualPerforationResults::fieldChangedByUi(const caf::PdmFieldHandle* c
|
|||||||
if (changedField == &m_isActive)
|
if (changedField == &m_isActive)
|
||||||
{
|
{
|
||||||
updateUiIconFromToggleField();
|
updateUiIconFromToggleField();
|
||||||
|
|
||||||
|
loadData();
|
||||||
}
|
}
|
||||||
|
|
||||||
RimEclipseView* eclView = nullptr;
|
RimEclipseView* eclView = nullptr;
|
||||||
|
@ -39,10 +39,11 @@ public:
|
|||||||
RimVirtualPerforationResults();
|
RimVirtualPerforationResults();
|
||||||
virtual ~RimVirtualPerforationResults();
|
virtual ~RimVirtualPerforationResults();
|
||||||
|
|
||||||
bool isActive() const;
|
bool isActive() const;
|
||||||
double geometryScaleFactor() const;
|
double geometryScaleFactor() const;
|
||||||
RimLegendConfig* legendConfig() const;
|
RimLegendConfig* legendConfig() const;
|
||||||
|
|
||||||
|
void loadData();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||||
|
@ -129,6 +129,14 @@ void RigCompletionData::setDiameter(double diameter)
|
|||||||
m_diameter = diameter;
|
m_diameter = diameter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RigCompletionData::setTransmissibility(double transmissibility)
|
||||||
|
{
|
||||||
|
m_transmissibility = transmissibility;
|
||||||
|
}
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
|
@ -70,6 +70,7 @@ public:
|
|||||||
|
|
||||||
RigCompletionData(const QString wellName, const RigCompletionDataGridCell& cellIndex, double orderingValue);
|
RigCompletionData(const QString wellName, const RigCompletionDataGridCell& cellIndex, double orderingValue);
|
||||||
~RigCompletionData();
|
~RigCompletionData();
|
||||||
|
|
||||||
RigCompletionData(const RigCompletionData& other);
|
RigCompletionData(const RigCompletionData& other);
|
||||||
|
|
||||||
bool operator<(const RigCompletionData& other) const;
|
bool operator<(const RigCompletionData& other) const;
|
||||||
@ -78,6 +79,7 @@ public:
|
|||||||
void setFromFracture(double transmissibility, double skinFactor, double diameter);
|
void setFromFracture(double transmissibility, double skinFactor, double diameter);
|
||||||
void setSecondOrderingValue(double orderingValue);
|
void setSecondOrderingValue(double orderingValue);
|
||||||
void setDiameter(double diameter);
|
void setDiameter(double diameter);
|
||||||
|
void setTransmissibility(double transmissibility);
|
||||||
|
|
||||||
void setTransAndWPImultBackgroundDataFromFishbone(double transmissibility,
|
void setTransAndWPImultBackgroundDataFromFishbone(double transmissibility,
|
||||||
double skinFactor,
|
double skinFactor,
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "RigVirtualPerforationTransmissibilities.h"
|
#include "RigVirtualPerforationTransmissibilities.h"
|
||||||
|
|
||||||
#include "RigStatisticsMath.h"
|
#include "RigStatisticsMath.h"
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -113,6 +114,33 @@ const std::map<RigCompletionDataGridCell, std::vector<RigCompletionData>>&
|
|||||||
return dummy;
|
return dummy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RigVirtualPerforationTransmissibilities::setCompletionDataForSimWell(
|
||||||
|
const RigSimWellData* simWellData,
|
||||||
|
std::vector<std::vector<RigCompletionData>>& completionsPerTimeStep)
|
||||||
|
{
|
||||||
|
m_mapFromSimWellToCompletionData[simWellData] = completionsPerTimeStep;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
const std::vector<RigCompletionData>&
|
||||||
|
RigVirtualPerforationTransmissibilities::completionsForSimWell(const RigSimWellData* simWellData, size_t timeStepIndex) const
|
||||||
|
{
|
||||||
|
static std::vector<RigCompletionData> dummayVector;
|
||||||
|
|
||||||
|
auto item = m_mapFromSimWellToCompletionData.find(simWellData);
|
||||||
|
if (item != m_mapFromSimWellToCompletionData.end())
|
||||||
|
{
|
||||||
|
return item->second[timeStepIndex];
|
||||||
|
}
|
||||||
|
|
||||||
|
return dummayVector;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -143,6 +171,22 @@ void RigVirtualPerforationTransmissibilities::computeMinMax(double* minValue,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (const auto& item : m_mapFromSimWellToCompletionData)
|
||||||
|
{
|
||||||
|
auto dataForSimWell = item.second;
|
||||||
|
|
||||||
|
for (const auto& timeStepFrame : dataForSimWell)
|
||||||
|
{
|
||||||
|
for (const auto& completionData : timeStepFrame)
|
||||||
|
{
|
||||||
|
double transmissibility = completionData.transmissibility();
|
||||||
|
|
||||||
|
minMaxAccumulator.addValue(transmissibility);
|
||||||
|
posNegAccumulator.addValue(transmissibility);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (*minValue) *minValue = minMaxAccumulator.min;
|
if (*minValue) *minValue = minMaxAccumulator.min;
|
||||||
if (*maxValue) *maxValue = minMaxAccumulator.max;
|
if (*maxValue) *maxValue = minMaxAccumulator.max;
|
||||||
if (*posClosestToZero) *posClosestToZero = posNegAccumulator.pos;
|
if (*posClosestToZero) *posClosestToZero = posNegAccumulator.pos;
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
class RigCompletionData;
|
class RigCompletionData;
|
||||||
class RigCompletionDataGridCell;
|
class RigCompletionDataGridCell;
|
||||||
|
class RigSimWellData;
|
||||||
class RimWellPath;
|
class RimWellPath;
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -60,7 +61,13 @@ public:
|
|||||||
const std::map<RigCompletionDataGridCell, std::vector<RigCompletionData>>&
|
const std::map<RigCompletionDataGridCell, std::vector<RigCompletionData>>&
|
||||||
multipleCompletionsPerEclipseCell(RimWellPath* wellPath, size_t timeStepIndex) const;
|
multipleCompletionsPerEclipseCell(RimWellPath* wellPath, size_t timeStepIndex) const;
|
||||||
|
|
||||||
|
void setCompletionDataForSimWell(const RigSimWellData* simWellData, std::vector<std::vector<RigCompletionData>>& completionsPerTimeStep);
|
||||||
|
|
||||||
|
const std::vector<RigCompletionData>&
|
||||||
|
completionsForSimWell(const RigSimWellData* simWellData, size_t timeStepIndex) const;
|
||||||
|
|
||||||
void computeMinMax(double* minValue, double* maxValue, double* posClosestToZero, double* negClosestToZero) const;
|
void computeMinMax(double* minValue, double* maxValue, double* posClosestToZero, double* negClosestToZero) const;
|
||||||
private:
|
private:
|
||||||
std::map<RimWellPath*, std::vector<CompletionDataFrame>> m_mapFromWellToCompletionData;
|
std::map<RimWellPath*, std::vector<CompletionDataFrame>> m_mapFromWellToCompletionData;
|
||||||
|
std::map<const RigSimWellData*, std::vector<std::vector<RigCompletionData>>> m_mapFromSimWellToCompletionData;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user