#11109 Improve visualization of MSW with valve branches

Increase default segment threshold to 4
Add an optional setting to override the default value
Use this threshold to merge short branches into parent branch
This commit is contained in:
Magne Sjaastad committed 2024-01-26 09:32:42 +01:00
1 parent 85672f5ef5
commit 7d601ac067
11 files changed
+87 -39

No files matched your search

@@ -23,6 +23,7 @@
#include "RigEclipseCaseData.h"
#include "RigMainGrid.h"
#include "RigSimulationWellCenterLineCalculator.h"
#include "RigWellPath.h"
#include "Rim2dIntersectionView.h"
@@ -868,11 +869,10 @@ void RimExtrudedCurveIntersection::updateSimulationWellCenterline() const
{
if ( m_simulationWellBranchCenterlines.empty() )
{
auto branches = m_simulationWell->wellPipeBranches();
for ( const auto& branch : branches )
{
m_simulationWellBranchCenterlines.push_back( branch->wellPathPoints() );
}
auto simWells = m_simulationWell()->wellBranchesForVisualization();
const auto& [coords, wellCells] = RigSimulationWellCenterLineCalculator::extractBranchData( simWells );
m_simulationWellBranchCenterlines = coords;
}
}
else
@@ -209,4 +209,4 @@ private:
caf::PdmField<bool> m_kFilterCollectionOverride;
caf::PdmField<QString> m_kFilterCollectionText;
};
};
@@ -49,12 +49,14 @@
#include "RimEclipseInputPropertyCollection.h"
#include "RimEclipseView.h"
#include "RimFlowDiagSolution.h"
#include "RimIntersectionCollection.h"
#include "RimMockModelSettings.h"
#include "RimProject.h"
#include "RimReservoirCellResultsStorage.h"
#include "RimTimeStepFilter.h"
#include "RimTools.h"
#include "cafPdmUiCheckBoxAndTextEditor.h"
#include "cafPdmUiFilePathEditor.h"
#include "cafPdmUiPropertyViewDialog.h"
#include "cafProgressInfo.h"
@@ -102,6 +104,9 @@ RimEclipseResultCase::RimEclipseResultCase()
#ifndef USE_HDF5
m_sourSimFileName.uiCapability()->setUiHidden( true );
#endif
CAF_PDM_InitField( &m_mswMergeThreshold, "MswMergeThreshold", std::make_pair( false, 3 ), "MSW Short Well Merge Threshold" );
m_mswMergeThreshold.uiCapability()->setUiEditorTypeName( caf::PdmUiCheckBoxAndTextEditor::uiEditorTypeName() );
}
//--------------------------------------------------------------------------------------------------
@@ -561,6 +566,21 @@ RifReaderRftInterface* RimEclipseResultCase::rftReader()
return m_readerEclipseRft.p();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
int RimEclipseResultCase::mswMergeThreshold() const
{
// This value is used in RigMswCenterLineCalculator::calculateMswWellPipeGeometry
if ( m_mswMergeThreshold().first )
{
return m_mswMergeThreshold().second;
}
return 4;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -607,6 +627,7 @@ void RimEclipseResultCase::defineUiOrdering( QString uiConfigName, caf::PdmUiOrd
group->add( &m_activeFormationNames );
group->add( &m_flipXAxis );
group->add( &m_flipYAxis );
group->add( &m_mswMergeThreshold );
if ( eclipseCaseData() && eclipseCaseData()->results( RiaDefines::PorosityModelType::MATRIX_MODEL ) &&
eclipseCaseData()->results( RiaDefines::PorosityModelType::MATRIX_MODEL )->maxTimeStepCount() > 0 )
@@ -627,6 +648,16 @@ void RimEclipseResultCase::fieldChangedByUi( const caf::PdmFieldHandle* changedF
loadAndUpdateSourSimData();
}
if ( changedField == &m_mswMergeThreshold )
{
for ( auto resView : reservoirViews() )
{
resView->scheduleSimWellGeometryRegen();
resView->scheduleCreateDisplayModelAndRedraw();
resView->intersectionCollection()->recomputeSimWellBranchData();
}
}
return RimEclipseCase::fieldChangedByUi( changedField, oldValue, newValue );
}
@@ -73,6 +73,10 @@ public:
RifReaderRftInterface* rftReader();
// A multi segment well can have multiple well paths. Valves can be modeled using short branches. This threshold defines the limit for
// merging branches into the upstream branch.
int mswMergeThreshold() const;
protected:
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
@@ -95,6 +99,8 @@ private:
caf::PdmChildArrayField<RimFlowDiagSolution*> m_flowDiagSolutions;
caf::PdmField<caf::FilePath> m_sourSimFileName;
caf::PdmField<std::pair<bool, int>> m_mswMergeThreshold;
bool m_gridAndWellDataIsReadFromFile;
bool m_activeCellInfoIsReadFromFile;
bool m_useOpmRftReader;
@@ -26,6 +26,7 @@
#include "RigCell.h"
#include "RigEclipseCaseData.h"
#include "RigMainGrid.h"
#include "RigMswCenterLineCalculator.h"
#include "RigSimWellData.h"
#include "RigSimulationWellCenterLineCalculator.h"
#include "RigWellResultFrame.h"
@@ -188,6 +189,21 @@ std::vector<const RigWellPath*> RimSimWellInView::wellPipeBranches() const
return std::vector<const RigWellPath*>();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<SimulationWellCellBranch> RimSimWellInView::wellBranchesForVisualization() const
{
const RigSimWellData* simWellData = this->simWellData();
if ( simWellData && simWellData->isMultiSegmentWell() )
{
return RigMswCenterLineCalculator::calculateMswWellPipeGeometry( this );
}
return RigSimulationWellCenterLineCalculator::calculateWellPipeStaticCenterline( this );
}
//--------------------------------------------------------------------------------------------------
/// frameIndex = -1 will use the static well frame
//--------------------------------------------------------------------------------------------------
@@ -23,6 +23,7 @@
#include "Rim3dPropertiesInterface.h"
#include "RigWellDiskData.h"
#include "RigWellResultBranch.h"
#include "cafAppEnum.h"
#include "cafPdmChildField.h"
@@ -76,6 +77,8 @@ public:
std::vector<const RigWellPath*> wellPipeBranches() const;
std::vector<SimulationWellCellBranch> wellBranchesForVisualization() const;
void wellHeadTopBottomPosition( int frameIndex, cvf::Vec3d* top, cvf::Vec3d* bottom );
double pipeRadius();
int pipeCrossSectionVertexCount();