Skip to content

Commit

Permalink
Well Target Candidates: make result grid cell count configurable.
Browse files Browse the repository at this point in the history
  • Loading branch information
kriben committed Dec 18, 2024
1 parent 5aa7b00 commit b9812a8
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 7 deletions.
22 changes: 20 additions & 2 deletions ApplicationLibCode/ProjectDataModel/RimRegularGridCase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
Expand All @@ -58,7 +76,7 @@ cvf::ref<RifReaderInterface> 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() );
Expand Down
6 changes: 6 additions & 0 deletions ApplicationLibCode/ProjectDataModel/RimRegularGridCase.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,17 @@ class RimRegularGridCase : public RimEclipseResultCase

void setBoundingBox( const cvf::BoundingBox& boundingBox );

void setCellCount( const cvf::Vec3st& cellCount );

bool openEclipseGridFile() override;

cvf::ref<RifReaderInterface> createModel( QString modelName );

private:
caf::PdmField<cvf::Vec3d> m_minimum;
caf::PdmField<cvf::Vec3d> m_maximum;

caf::PdmField<int> m_cellCountI;
caf::PdmField<int> m_cellCountJ;
caf::PdmField<int> m_cellCountK;
};
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand Down Expand Up @@ -287,6 +291,14 @@ void RimWellTargetCandidatesGenerator::defineEditorAttribute( const caf::PdmFiel
}
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::Vec3st RimWellTargetCandidatesGenerator::getResultGridCellCount() const
{
return cvf::Vec3st( m_cellCountI, m_cellCountJ, m_cellCountK );
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
Expand All @@ -304,9 +316,11 @@ void RimWellTargetCandidatesGenerator::generateEnsembleStatistics()
auto ensemble = firstAncestorOrThisOfType<RimEclipseCaseEnsemble>();
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(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -74,6 +75,10 @@ class RimWellTargetCandidatesGenerator : public caf::PdmObject

caf::PdmChildField<RimEclipseResultDefinition*> m_resultDefinition;

caf::PdmField<int> m_cellCountI;
caf::PdmField<int> m_cellCountJ;
caf::PdmField<int> m_cellCountK;

caf::PdmField<bool> m_generateEnsembleStatistics;

double m_minimumVolume;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,7 @@ std::vector<RigWellTargetCandidatesGenerator::ClusterStatistics>
//--------------------------------------------------------------------------------------------------
RimRegularGridCase* RigWellTargetCandidatesGenerator::generateEnsembleCandidates( RimEclipseCaseEnsemble& ensemble,
size_t timeStepIdx,
const cvf::Vec3st& resultGridCellCount,
VolumeType volumeType,
VolumesType volumesType,
VolumeResultType volumeResultType,
Expand Down Expand Up @@ -754,6 +755,7 @@ RimRegularGridCase* RigWellTargetCandidatesGenerator::generateEnsembleCandidates

RimRegularGridCase* targetCase = new RimRegularGridCase;
targetCase->setBoundingBox( boundingBox );
targetCase->setCellCount( resultGridCellCount );
targetCase->createModel( "" );

std::vector<int> occupancy;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ class RigWellTargetCandidatesGenerator

static RimRegularGridCase* generateEnsembleCandidates( RimEclipseCaseEnsemble& ensemble,
size_t timeStepIdx,
const cvf::Vec3st& resultGridCellCount,
VolumeType volumeType,
VolumesType volumesType,
VolumeResultType volumeResultType,
Expand Down

0 comments on commit b9812a8

Please sign in to comment.