From b9812a89d170641122f8665e19e271f4f9cb87a3 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Wed, 18 Dec 2024 12:07:21 +0100 Subject: [PATCH] Well Target Candidates: make result grid cell count configurable. --- .../ProjectDataModel/RimRegularGridCase.cpp | 22 +++++++++++++++++-- .../ProjectDataModel/RimRegularGridCase.h | 6 +++++ .../RimWellTargetCandidatesGenerator.cpp | 18 +++++++++++++-- .../RimWellTargetCandidatesGenerator.h | 11 +++++++--- .../Well/RigWellTargetCandidatesGenerator.cpp | 2 ++ .../Well/RigWellTargetCandidatesGenerator.h | 1 + 6 files changed, 53 insertions(+), 7 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/RimRegularGridCase.cpp b/ApplicationLibCode/ProjectDataModel/RimRegularGridCase.cpp index 9804784b4e..49e8ee02c4 100644 --- a/ApplicationLibCode/ProjectDataModel/RimRegularGridCase.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimRegularGridCase.cpp @@ -36,18 +36,36 @@ RimRegularGridCase::RimRegularGridCase() CAF_PDM_InitFieldNoDefault( &m_maximum, "Maximum", "Maximum" ); m_maximum.uiCapability()->setUiReadOnly( true ); + + CAF_PDM_InitField( &m_cellCountI, "CellCountI", 100, "Cell Count I" ); + m_cellCountI.uiCapability()->setUiReadOnly( true ); + + CAF_PDM_InitField( &m_cellCountJ, "CellCountJ", 100, "Cell Count J" ); + m_cellCountJ.uiCapability()->setUiReadOnly( true ); + + CAF_PDM_InitField( &m_cellCountK, "CellCountK", 10, "Cell Count K" ); + m_cellCountK.uiCapability()->setUiReadOnly( true ); } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- - void RimRegularGridCase::setBoundingBox( const cvf::BoundingBox& boundingBox ) { m_minimum = boundingBox.min(); m_maximum = boundingBox.max(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimRegularGridCase::setCellCount( const cvf::Vec3st& cellCount ) +{ + m_cellCountI = cellCount.x(); + m_cellCountJ = cellCount.y(); + m_cellCountK = cellCount.z(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -58,7 +76,7 @@ cvf::ref RimRegularGridCase::createModel( QString modelName reader->setWorldCoordinates( m_minimum, m_maximum ); - cvf::Vec3st gridPointDimensions( 50, 50, 10 ); + cvf::Vec3st gridPointDimensions( m_cellCountI, m_cellCountJ, m_cellCountK ); reader->setGridPointDimensions( gridPointDimensions ); reader->open( "", reservoir.p() ); diff --git a/ApplicationLibCode/ProjectDataModel/RimRegularGridCase.h b/ApplicationLibCode/ProjectDataModel/RimRegularGridCase.h index 898c388bf0..136491e4a6 100644 --- a/ApplicationLibCode/ProjectDataModel/RimRegularGridCase.h +++ b/ApplicationLibCode/ProjectDataModel/RimRegularGridCase.h @@ -39,6 +39,8 @@ class RimRegularGridCase : public RimEclipseResultCase void setBoundingBox( const cvf::BoundingBox& boundingBox ); + void setCellCount( const cvf::Vec3st& cellCount ); + bool openEclipseGridFile() override; cvf::ref createModel( QString modelName ); @@ -46,4 +48,8 @@ class RimRegularGridCase : public RimEclipseResultCase private: caf::PdmField m_minimum; caf::PdmField m_maximum; + + caf::PdmField m_cellCountI; + caf::PdmField m_cellCountJ; + caf::PdmField m_cellCountK; }; diff --git a/ApplicationLibCode/ProjectDataModel/RimWellTargetCandidatesGenerator.cpp b/ApplicationLibCode/ProjectDataModel/RimWellTargetCandidatesGenerator.cpp index 4a76a37d62..f3ab525395 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellTargetCandidatesGenerator.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimWellTargetCandidatesGenerator.cpp @@ -116,6 +116,10 @@ RimWellTargetCandidatesGenerator::RimWellTargetCandidatesGenerator() m_resultDefinition->setResultType( RiaDefines::ResultCatType::DYNAMIC_NATIVE ); m_resultDefinition->setResultVariable( "SOIL" ); + CAF_PDM_InitField( &m_cellCountI, "CellCountI", 100, "Cell Count I" ); + CAF_PDM_InitField( &m_cellCountJ, "CellCountJ", 100, "Cell Count J" ); + CAF_PDM_InitField( &m_cellCountK, "CellCountK", 10, "Cell Count K" ); + CAF_PDM_InitField( &m_generateEnsembleStatistics, "GenerateEnsembleStatistics", true, "Generate Ensemble Statistics" ); caf::PdmUiPushButtonEditor::configureEditorLabelHidden( &m_generateEnsembleStatistics ); @@ -287,6 +291,14 @@ void RimWellTargetCandidatesGenerator::defineEditorAttribute( const caf::PdmFiel } } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +cvf::Vec3st RimWellTargetCandidatesGenerator::getResultGridCellCount() const +{ + return cvf::Vec3st( m_cellCountI, m_cellCountJ, m_cellCountK ); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -304,9 +316,11 @@ void RimWellTargetCandidatesGenerator::generateEnsembleStatistics() auto ensemble = firstAncestorOrThisOfType(); if ( !ensemble ) return; - RigWellTargetCandidatesGenerator::ClusteringLimits limits = getClusteringLimits(); - RimRegularGridCase* regularGridCase = RigWellTargetCandidatesGenerator::generateEnsembleCandidates( *ensemble, + const cvf::Vec3st& resultGridCellCount = getResultGridCellCount(); + RigWellTargetCandidatesGenerator::ClusteringLimits limits = getClusteringLimits(); + RimRegularGridCase* regularGridCase = RigWellTargetCandidatesGenerator::generateEnsembleCandidates( *ensemble, m_timeStep(), + resultGridCellCount, m_volumeType(), m_volumesType(), m_volumeResultType(), diff --git a/ApplicationLibCode/ProjectDataModel/RimWellTargetCandidatesGenerator.h b/ApplicationLibCode/ProjectDataModel/RimWellTargetCandidatesGenerator.h index 93649b6a83..1d012956da 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellTargetCandidatesGenerator.h +++ b/ApplicationLibCode/ProjectDataModel/RimWellTargetCandidatesGenerator.h @@ -50,9 +50,10 @@ class RimWellTargetCandidatesGenerator : public caf::PdmObject void initAfterRead() override; private: - void generateCandidates( RimEclipseCase* eclipseCase ); - void updateAllBoundaries(); - void generateEnsembleStatistics(); + void generateCandidates( RimEclipseCase* eclipseCase ); + void updateAllBoundaries(); + void generateEnsembleStatistics(); + cvf::Vec3st getResultGridCellCount() const; RimEclipseCase* firstCase() const; @@ -74,6 +75,10 @@ class RimWellTargetCandidatesGenerator : public caf::PdmObject caf::PdmChildField m_resultDefinition; + caf::PdmField m_cellCountI; + caf::PdmField m_cellCountJ; + caf::PdmField m_cellCountK; + caf::PdmField m_generateEnsembleStatistics; double m_minimumVolume; diff --git a/ApplicationLibCode/ReservoirDataModel/Well/RigWellTargetCandidatesGenerator.cpp b/ApplicationLibCode/ReservoirDataModel/Well/RigWellTargetCandidatesGenerator.cpp index 58087d6cde..76dde37784 100644 --- a/ApplicationLibCode/ReservoirDataModel/Well/RigWellTargetCandidatesGenerator.cpp +++ b/ApplicationLibCode/ReservoirDataModel/Well/RigWellTargetCandidatesGenerator.cpp @@ -724,6 +724,7 @@ std::vector //-------------------------------------------------------------------------------------------------- RimRegularGridCase* RigWellTargetCandidatesGenerator::generateEnsembleCandidates( RimEclipseCaseEnsemble& ensemble, size_t timeStepIdx, + const cvf::Vec3st& resultGridCellCount, VolumeType volumeType, VolumesType volumesType, VolumeResultType volumeResultType, @@ -754,6 +755,7 @@ RimRegularGridCase* RigWellTargetCandidatesGenerator::generateEnsembleCandidates RimRegularGridCase* targetCase = new RimRegularGridCase; targetCase->setBoundingBox( boundingBox ); + targetCase->setCellCount( resultGridCellCount ); targetCase->createModel( "" ); std::vector occupancy; diff --git a/ApplicationLibCode/ReservoirDataModel/Well/RigWellTargetCandidatesGenerator.h b/ApplicationLibCode/ReservoirDataModel/Well/RigWellTargetCandidatesGenerator.h index 1dbda908b4..a5a6834d4b 100644 --- a/ApplicationLibCode/ReservoirDataModel/Well/RigWellTargetCandidatesGenerator.h +++ b/ApplicationLibCode/ReservoirDataModel/Well/RigWellTargetCandidatesGenerator.h @@ -87,6 +87,7 @@ class RigWellTargetCandidatesGenerator static RimRegularGridCase* generateEnsembleCandidates( RimEclipseCaseEnsemble& ensemble, size_t timeStepIdx, + const cvf::Vec3st& resultGridCellCount, VolumeType volumeType, VolumesType volumesType, VolumeResultType volumeResultType,