mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
6877 well fracture intersection per fracture (#7251)
* #6877 Move well/fracture intersection to fracture (from template). * #6877 Read stimplan xml without scaling and well/fracture intersection offset * #6877 Move fracture grid to RimFracture from template. * #6877 Use RiaDefines::conductivityResultName() where applicable. * #6877 Reintroduce fracture template scaling. * #6877 Hide well/fracture intersection option for elliptical template * #7280: Fix crash when picking in first time step of StimPlan fracture * #7279 Redraw after deleting fracture to make it disappear.
This commit is contained in:
committed by
GitHub
parent
05aceef936
commit
f8aae6691d
@@ -97,8 +97,7 @@ RimStimPlanFractureTemplate::RimStimPlanFractureTemplate()
|
||||
CAF_PDM_InitField( &m_showStimPlanMesh_OBSOLETE, "ShowStimPlanMesh", true, "", "", "", "" );
|
||||
m_showStimPlanMesh_OBSOLETE.uiCapability()->setUiHidden( true );
|
||||
|
||||
m_fractureGrid = new RigFractureGrid();
|
||||
m_readError = false;
|
||||
m_readError = false;
|
||||
|
||||
setDeletable( true );
|
||||
}
|
||||
@@ -147,35 +146,24 @@ void RimStimPlanFractureTemplate::fieldChangedByUi( const caf::PdmFieldHandle* c
|
||||
if ( &m_activeTimeStepIndex == changedField )
|
||||
{
|
||||
// Changes to this parameters should change all fractures with this fracture template attached.
|
||||
RimProject* proj;
|
||||
this->firstAncestorOrThisOfType( proj );
|
||||
if ( proj )
|
||||
RimProject* proj = RimProject::current();
|
||||
for ( RimFracture* fracture : fracturesUsingThisTemplate() )
|
||||
{
|
||||
std::vector<RimFracture*> fractures;
|
||||
proj->descendantsIncludingThisOfType( fractures );
|
||||
for ( RimFracture* fracture : fractures )
|
||||
{
|
||||
if ( fracture->fractureTemplate() == this )
|
||||
{
|
||||
fracture->setStimPlanTimeIndexToPlot( m_activeTimeStepIndex );
|
||||
}
|
||||
}
|
||||
proj->scheduleCreateDisplayModelAndRedrawAllViews();
|
||||
fracture->setStimPlanTimeIndexToPlot( m_activeTimeStepIndex );
|
||||
}
|
||||
proj->scheduleCreateDisplayModelAndRedrawAllViews();
|
||||
}
|
||||
|
||||
if ( &m_wellPathDepthAtFracture == changedField || &m_borderPolygonResultName == changedField ||
|
||||
&m_activeTimeStepIndex == changedField || &m_stimPlanFileName == changedField ||
|
||||
&m_conductivityResultNameOnFile == changedField )
|
||||
if ( &m_borderPolygonResultName == changedField || &m_activeTimeStepIndex == changedField ||
|
||||
&m_stimPlanFileName == changedField || &m_conductivityResultNameOnFile == changedField )
|
||||
{
|
||||
updateFractureGrid();
|
||||
|
||||
RimProject* proj;
|
||||
this->firstAncestorOrThisOfType( proj );
|
||||
if ( proj )
|
||||
// Update fracture grid for all fractures using this template
|
||||
RimProject* proj = RimProject::current();
|
||||
for ( RimFracture* fracture : fracturesUsingThisTemplate() )
|
||||
{
|
||||
proj->scheduleCreateDisplayModelAndRedrawAllViews();
|
||||
fracture->updateFractureGrid();
|
||||
}
|
||||
proj->scheduleCreateDisplayModelAndRedrawAllViews();
|
||||
}
|
||||
|
||||
if ( changedField == &m_scaleApplyButton )
|
||||
@@ -281,9 +269,6 @@ void RimStimPlanFractureTemplate::loadDataAndUpdate()
|
||||
|
||||
m_stimPlanFractureDefinitionData = RifStimPlanXmlReader::readStimPlanXMLFile( m_stimPlanFileName().path(),
|
||||
m_conductivityScaleFactor(),
|
||||
m_halfLengthScaleFactor(),
|
||||
m_heightScaleFactor(),
|
||||
-m_wellPathDepthAtFracture(),
|
||||
RifStimPlanXmlReader::MIRROR_AUTO,
|
||||
fractureTemplateUnit(),
|
||||
&errorMessage );
|
||||
@@ -311,10 +296,9 @@ void RimStimPlanFractureTemplate::loadDataAndUpdate()
|
||||
m_readError = true;
|
||||
}
|
||||
|
||||
updateFractureGrid();
|
||||
|
||||
for ( RimFracture* fracture : fracturesUsingThisTemplate() )
|
||||
{
|
||||
fracture->updateFractureGrid();
|
||||
fracture->clearCachedNonDarcyProperties();
|
||||
}
|
||||
|
||||
@@ -482,7 +466,8 @@ WellFractureIntersectionData
|
||||
{
|
||||
WellFractureIntersectionData values;
|
||||
|
||||
if ( m_fractureGrid.notNull() )
|
||||
const RigFractureGrid* fractureGrid = fractureInstance->fractureGrid();
|
||||
if ( fractureGrid )
|
||||
{
|
||||
if ( orientationType() == ALONG_WELL_PATH )
|
||||
{
|
||||
@@ -591,9 +576,9 @@ WellFractureIntersectionData
|
||||
}
|
||||
else
|
||||
{
|
||||
std::pair<size_t, size_t> wellCellIJ = m_fractureGrid->fractureCellAtWellCenter();
|
||||
size_t wellCellIndex = m_fractureGrid->getGlobalIndexFromIJ( wellCellIJ.first, wellCellIJ.second );
|
||||
const RigFractureCell& wellCell = m_fractureGrid->cellFromIndex( wellCellIndex );
|
||||
std::pair<size_t, size_t> wellCellIJ = fractureGrid->fractureCellAtWellCenter();
|
||||
size_t wellCellIndex = fractureGrid->getGlobalIndexFromIJ( wellCellIJ.first, wellCellIJ.second );
|
||||
const RigFractureCell& wellCell = fractureGrid->cellFromIndex( wellCellIndex );
|
||||
|
||||
double conductivity = wellCell.getConductivityValue();
|
||||
values.m_conductivity = conductivity;
|
||||
@@ -842,13 +827,8 @@ void RimStimPlanFractureTemplate::onLoadDataAndUpdateGeometryHasChanged()
|
||||
{
|
||||
loadDataAndUpdate();
|
||||
|
||||
RimProject* proj;
|
||||
this->firstAncestorOrThisOfType( proj );
|
||||
if ( proj )
|
||||
{
|
||||
proj->scheduleCreateDisplayModelAndRedrawAllViews();
|
||||
RiaCompletionTypeCalculationScheduler::instance()->scheduleRecalculateCompletionTypeAndRedrawAllViews();
|
||||
}
|
||||
RimProject::current()->scheduleCreateDisplayModelAndRedrawAllViews();
|
||||
RiaCompletionTypeCalculationScheduler::instance()->scheduleRecalculateCompletionTypeAndRedrawAllViews();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -953,11 +933,12 @@ bool RimStimPlanFractureTemplate::hasConductivity() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimStimPlanFractureTemplate::resultValueAtIJ( const QString& uiResultName,
|
||||
const QString& unitName,
|
||||
size_t timeStepIndex,
|
||||
size_t i,
|
||||
size_t j )
|
||||
double RimStimPlanFractureTemplate::resultValueAtIJ( const RigFractureGrid* fractureGrid,
|
||||
const QString& uiResultName,
|
||||
const QString& unitName,
|
||||
size_t timeStepIndex,
|
||||
size_t i,
|
||||
size_t j )
|
||||
{
|
||||
auto values = resultValues( uiResultName, unitName, timeStepIndex );
|
||||
|
||||
@@ -966,7 +947,7 @@ double RimStimPlanFractureTemplate::resultValueAtIJ( const QString& uiResultName
|
||||
size_t adjustedI = i + 1;
|
||||
size_t adjustedJ = j + 1;
|
||||
|
||||
if ( adjustedI >= fractureGrid()->iCellCount() || adjustedJ >= fractureGrid()->jCellCount() )
|
||||
if ( adjustedI >= fractureGrid->iCellCount() || adjustedJ >= fractureGrid->jCellCount() )
|
||||
{
|
||||
return HUGE_VAL;
|
||||
}
|
||||
@@ -1012,39 +993,18 @@ void RimStimPlanFractureTemplate::appendDataToResultStatistics( const QString&
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RigFractureGrid* RimStimPlanFractureTemplate::fractureGrid() const
|
||||
{
|
||||
return m_fractureGrid.p();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimStimPlanFractureTemplate::updateFractureGrid()
|
||||
{
|
||||
m_fractureGrid = nullptr;
|
||||
|
||||
if ( m_stimPlanFractureDefinitionData.notNull() )
|
||||
{
|
||||
m_fractureGrid = m_stimPlanFractureDefinitionData->createFractureGrid( m_conductivityResultNameOnFile,
|
||||
m_activeTimeStepIndex,
|
||||
m_wellPathDepthAtFracture,
|
||||
m_fractureTemplateUnit() );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimStimPlanFractureTemplate::fractureTriangleGeometry( std::vector<cvf::Vec3f>* nodeCoords,
|
||||
std::vector<cvf::uint>* triangleIndices ) const
|
||||
std::vector<cvf::uint>* triangleIndices,
|
||||
double wellPathDepthAtFracture ) const
|
||||
{
|
||||
if ( m_stimPlanFractureDefinitionData.notNull() )
|
||||
{
|
||||
m_stimPlanFractureDefinitionData->createFractureTriangleGeometry( m_wellPathDepthAtFracture,
|
||||
m_stimPlanFractureDefinitionData->createFractureTriangleGeometry( m_halfLengthScaleFactor(),
|
||||
m_heightScaleFactor(),
|
||||
wellPathDepthAtFracture,
|
||||
name(),
|
||||
nodeCoords,
|
||||
triangleIndices );
|
||||
@@ -1142,3 +1102,39 @@ void RimStimPlanFractureTemplate::initAfterRead()
|
||||
m_useUserDefinedWellPathDepthAtFracture = true;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimStimPlanFractureTemplate::wellPathDepthAtFracture() const
|
||||
{
|
||||
return m_wellPathDepthAtFracture;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::pair<double, double> RimStimPlanFractureTemplate::wellPathDepthAtFractureRange() const
|
||||
{
|
||||
if ( m_stimPlanFractureDefinitionData.isNull() ) return std::make_pair( 0.0, 1.0 );
|
||||
|
||||
return std::make_pair( m_stimPlanFractureDefinitionData->minDepth(), m_stimPlanFractureDefinitionData->maxDepth() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::cref<RigFractureGrid> RimStimPlanFractureTemplate::createFractureGrid( double wellPathDepthAtFracture ) const
|
||||
{
|
||||
if ( m_stimPlanFractureDefinitionData.notNull() )
|
||||
{
|
||||
return m_stimPlanFractureDefinitionData->createFractureGrid( m_conductivityResultNameOnFile,
|
||||
m_activeTimeStepIndex,
|
||||
m_halfLengthScaleFactor(),
|
||||
m_heightScaleFactor(),
|
||||
wellPathDepthAtFracture,
|
||||
m_fractureTemplateUnit() );
|
||||
}
|
||||
|
||||
return cvf::cref<RigFractureGrid>();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user