2017-02-07 02:09:00 -06:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2017 - Statoil ASA
|
2018-08-10 07:47:06 -05:00
|
|
|
//
|
2017-02-07 02:09:00 -06:00
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
2018-08-10 07:47:06 -05:00
|
|
|
//
|
2017-02-07 02:09:00 -06:00
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
2018-08-10 07:47:06 -05:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2017-02-07 02:09:00 -06:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#include "RimStimPlanFractureTemplate.h"
|
|
|
|
|
2017-02-20 08:39:15 -06:00
|
|
|
#include "RiaApplication.h"
|
2018-09-11 08:03:59 -05:00
|
|
|
#include "RiaCompletionTypeCalculationScheduler.h"
|
2018-01-25 05:14:54 -06:00
|
|
|
#include "RiaFractureDefines.h"
|
2017-02-28 03:01:31 -06:00
|
|
|
#include "RiaLogging.h"
|
2018-09-24 08:10:46 -05:00
|
|
|
#include "RiaWeightedGeometricMeanCalculator.h"
|
2018-09-14 02:12:05 -05:00
|
|
|
#include "RiaWeightedMeanCalculator.h"
|
2017-02-20 08:39:15 -06:00
|
|
|
|
2017-08-03 06:21:19 -05:00
|
|
|
#include "RifStimPlanXmlReader.h"
|
|
|
|
|
2017-06-08 15:54:06 -05:00
|
|
|
#include "RigFractureGrid.h"
|
2018-08-10 07:47:06 -05:00
|
|
|
#include "RigStimPlanFractureDefinition.h"
|
2018-11-05 03:05:23 -06:00
|
|
|
#include "RigTransmissibilityEquations.h"
|
2018-08-15 02:44:27 -05:00
|
|
|
#include "RigWellPathStimplanIntersector.h"
|
2017-02-07 02:09:00 -06:00
|
|
|
|
2017-08-03 06:21:19 -05:00
|
|
|
#include "RigFractureCell.h"
|
2017-02-20 08:39:15 -06:00
|
|
|
#include "RimEclipseView.h"
|
2017-02-10 08:29:15 -06:00
|
|
|
#include "RimFracture.h"
|
2017-08-03 06:21:19 -05:00
|
|
|
#include "RimFractureContainment.h"
|
2017-02-10 08:29:15 -06:00
|
|
|
#include "RimProject.h"
|
2017-02-20 08:39:15 -06:00
|
|
|
#include "RimStimPlanColors.h"
|
2017-02-17 02:29:46 -06:00
|
|
|
#include "RimStimPlanLegendConfig.h"
|
2017-08-03 06:21:19 -05:00
|
|
|
#include "RimTools.h"
|
2017-02-10 08:29:15 -06:00
|
|
|
|
2017-03-27 07:19:21 -05:00
|
|
|
#include "RivWellFracturePartMgr.h"
|
|
|
|
|
2017-02-07 02:09:00 -06:00
|
|
|
#include "cafPdmObject.h"
|
2017-02-17 08:10:04 -06:00
|
|
|
#include "cafPdmUiDoubleSliderEditor.h"
|
2017-02-09 03:52:05 -06:00
|
|
|
#include "cafPdmUiFilePathEditor.h"
|
2017-02-07 02:09:00 -06:00
|
|
|
|
2018-08-15 02:44:27 -05:00
|
|
|
#include "cvfMath.h"
|
2017-02-07 02:09:00 -06:00
|
|
|
#include "cvfVector3.h"
|
2017-02-09 03:52:05 -06:00
|
|
|
|
2017-02-07 04:08:56 -06:00
|
|
|
#include <QFileInfo>
|
2017-02-07 02:09:00 -06:00
|
|
|
|
2017-02-17 04:03:20 -06:00
|
|
|
#include <algorithm>
|
2017-04-20 05:16:13 -05:00
|
|
|
#include <cmath>
|
2018-08-10 07:47:06 -05:00
|
|
|
#include <vector>
|
2017-02-17 04:03:20 -06:00
|
|
|
|
2018-01-30 06:48:28 -06:00
|
|
|
static std::vector<double> EMPTY_DOUBLE_VECTOR;
|
2017-02-07 02:09:00 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_SOURCE_INIT( RimStimPlanFractureTemplate, "RimStimPlanFractureTemplate" );
|
2017-02-07 02:09:00 -06:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-10 07:47:06 -05:00
|
|
|
///
|
2017-02-07 02:09:00 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-01-25 05:27:36 -06:00
|
|
|
RimStimPlanFractureTemplate::RimStimPlanFractureTemplate()
|
2017-02-07 02:09:00 -06:00
|
|
|
{
|
2018-08-10 07:47:06 -05:00
|
|
|
// clang-format off
|
|
|
|
|
2017-02-07 02:09:00 -06:00
|
|
|
CAF_PDM_InitObject("Fracture Template", ":/FractureTemplate16x16.png", "", "");
|
|
|
|
|
2019-12-11 01:30:32 -06:00
|
|
|
CAF_PDM_InitFieldNoDefault(&m_stimPlanFileName, "StimPlanFileName", "File Name", "", "", "");
|
2017-02-10 08:29:15 -06:00
|
|
|
m_stimPlanFileName.uiCapability()->setUiEditorTypeName(caf::PdmUiFilePathEditor::uiEditorTypeName());
|
|
|
|
|
2017-12-15 07:26:59 -06:00
|
|
|
CAF_PDM_InitField(&m_wellPathDepthAtFracture, "WellPathDepthAtFracture", 0.0, "Well/Fracture Intersection Depth", "", "", "");
|
2017-06-12 07:42:35 -05:00
|
|
|
m_wellPathDepthAtFracture.uiCapability()->setUiEditorTypeName(caf::PdmUiDoubleSliderEditor::uiEditorTypeName());
|
2017-02-27 07:55:12 -06:00
|
|
|
|
2017-12-15 07:26:59 -06:00
|
|
|
CAF_PDM_InitField(&m_borderPolygonResultName, "BorderPolygonResultName", QString(""), "Parameter", "", "", "");
|
2017-06-30 05:54:51 -05:00
|
|
|
m_borderPolygonResultName.uiCapability()->setUiHidden(true);
|
|
|
|
|
2018-01-25 05:14:54 -06:00
|
|
|
CAF_PDM_InitField(&m_activeTimeStepIndex, "ActiveTimeStepIndex", 0, "Active TimeStep Index", "", "", "");
|
|
|
|
CAF_PDM_InitField(&m_conductivityResultNameOnFile, "ConductivityResultName", QString(""), "Active Conductivity Result Name", "", "", "");
|
2017-02-27 07:55:12 -06:00
|
|
|
|
2018-02-02 02:06:24 -06:00
|
|
|
CAF_PDM_InitField(&m_showStimPlanMesh_OBSOLETE, "ShowStimPlanMesh", true, "", "", "", "");
|
|
|
|
m_showStimPlanMesh_OBSOLETE.uiCapability()->setUiHidden(true);
|
|
|
|
|
2017-05-30 07:57:21 -05:00
|
|
|
m_fractureGrid = new RigFractureGrid();
|
2018-01-30 06:48:28 -06:00
|
|
|
m_readError = false;
|
2018-08-09 04:01:44 -05:00
|
|
|
|
2018-08-10 07:47:06 -05:00
|
|
|
// clang-format on
|
2017-02-07 02:09:00 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-10 07:47:06 -05:00
|
|
|
///
|
2017-02-07 02:09:00 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-10 07:47:06 -05:00
|
|
|
RimStimPlanFractureTemplate::~RimStimPlanFractureTemplate() {}
|
2017-02-07 02:09:00 -06:00
|
|
|
|
2018-01-25 05:27:36 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-10 07:47:06 -05:00
|
|
|
///
|
2018-01-25 05:27:36 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
int RimStimPlanFractureTemplate::activeTimeStepIndex()
|
|
|
|
{
|
|
|
|
return m_activeTimeStepIndex;
|
|
|
|
}
|
|
|
|
|
2017-02-07 02:09:00 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-10 07:47:06 -05:00
|
|
|
///
|
2017-02-07 02:09:00 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimStimPlanFractureTemplate::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
|
|
|
const QVariant& oldValue,
|
|
|
|
const QVariant& newValue )
|
2017-02-07 02:09:00 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
RimFractureTemplate::fieldChangedByUi( changedField, oldValue, newValue );
|
2017-02-07 04:08:56 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( &m_stimPlanFileName == changedField )
|
2017-02-07 04:08:56 -06:00
|
|
|
{
|
2018-01-30 06:48:28 -06:00
|
|
|
m_readError = false;
|
2017-02-17 02:29:46 -06:00
|
|
|
loadDataAndUpdate();
|
2017-03-02 04:43:28 -06:00
|
|
|
setDefaultsBasedOnXMLfile();
|
2017-02-07 04:08:56 -06:00
|
|
|
}
|
2017-02-10 08:29:15 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( &m_activeTimeStepIndex == changedField )
|
2017-04-07 04:02:31 -05:00
|
|
|
{
|
2018-08-10 07:47:06 -05:00
|
|
|
// Changes to this parameters should change all fractures with this fracture template attached.
|
2017-04-07 04:02:31 -05:00
|
|
|
RimProject* proj;
|
2019-09-06 03:40:57 -05:00
|
|
|
this->firstAncestorOrThisOfType( proj );
|
|
|
|
if ( proj )
|
2017-04-07 04:02:31 -05:00
|
|
|
{
|
|
|
|
std::vector<RimFracture*> fractures;
|
2019-09-06 03:40:57 -05:00
|
|
|
proj->descendantsIncludingThisOfType( fractures );
|
|
|
|
for ( RimFracture* fracture : fractures )
|
2017-04-07 04:02:31 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( fracture->fractureTemplate() == this )
|
2017-04-07 04:02:31 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
fracture->setStimPlanTimeIndexToPlot( m_activeTimeStepIndex );
|
2017-04-07 04:02:31 -05:00
|
|
|
}
|
|
|
|
}
|
2018-09-11 05:41:45 -05:00
|
|
|
proj->scheduleCreateDisplayModelAndRedrawAllViews();
|
2017-04-07 04:02:31 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( &m_wellPathDepthAtFracture == changedField || &m_borderPolygonResultName == changedField ||
|
|
|
|
&m_activeTimeStepIndex == changedField || &m_stimPlanFileName == changedField ||
|
|
|
|
&m_conductivityResultNameOnFile == changedField )
|
2017-02-10 08:29:15 -06:00
|
|
|
{
|
2018-02-14 02:35:02 -06:00
|
|
|
updateFractureGrid();
|
|
|
|
|
2017-02-10 08:29:15 -06:00
|
|
|
RimProject* proj;
|
2019-09-06 03:40:57 -05:00
|
|
|
this->firstAncestorOrThisOfType( proj );
|
|
|
|
if ( proj )
|
2017-02-10 08:29:15 -06:00
|
|
|
{
|
2018-09-11 05:41:45 -05:00
|
|
|
proj->scheduleCreateDisplayModelAndRedrawAllViews();
|
2017-02-10 08:29:15 -06:00
|
|
|
}
|
|
|
|
}
|
2018-03-01 07:16:08 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( changedField == &m_scaleApplyButton )
|
2018-03-01 07:16:08 -06:00
|
|
|
{
|
2018-03-05 03:20:47 -06:00
|
|
|
m_scaleApplyButton = false;
|
2018-09-13 01:32:27 -05:00
|
|
|
onLoadDataAndUpdateGeometryHasChanged();
|
2018-03-01 07:16:08 -06:00
|
|
|
}
|
2017-02-07 02:09:00 -06:00
|
|
|
}
|
|
|
|
|
2017-02-07 04:08:56 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-10 07:47:06 -05:00
|
|
|
///
|
2017-02-07 04:08:56 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimStimPlanFractureTemplate::setFileName( const QString& fileName )
|
2017-02-07 04:08:56 -06:00
|
|
|
{
|
2017-02-10 08:29:15 -06:00
|
|
|
m_stimPlanFileName = fileName;
|
2017-02-07 04:08:56 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-10 07:47:06 -05:00
|
|
|
///
|
2017-02-07 04:08:56 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-12-11 01:30:32 -06:00
|
|
|
QString RimStimPlanFractureTemplate::fileName()
|
2017-02-07 04:08:56 -06:00
|
|
|
{
|
2019-12-11 01:30:32 -06:00
|
|
|
return m_stimPlanFileName().path();
|
2017-02-07 04:08:56 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-10 07:47:06 -05:00
|
|
|
///
|
2017-02-07 04:08:56 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimStimPlanFractureTemplate::updateFilePathsFromProjectPath( const QString& newProjectPath,
|
|
|
|
const QString& oldProjectPath )
|
2017-08-03 06:21:19 -05:00
|
|
|
{
|
2019-12-11 01:30:32 -06:00
|
|
|
// m_stimPlanFileName = RimTools::relocateFile( m_stimPlanFileName(), newProjectPath, oldProjectPath, nullptr, nullptr );
|
2017-08-03 06:21:19 -05:00
|
|
|
}
|
2017-02-09 03:52:05 -06:00
|
|
|
|
2017-03-02 04:43:28 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-10 07:47:06 -05:00
|
|
|
///
|
2017-03-02 04:43:28 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimStimPlanFractureTemplate::setDefaultsBasedOnXMLfile()
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_stimPlanFractureDefinitionData.isNull() ) return;
|
2018-01-15 01:58:15 -06:00
|
|
|
|
2018-06-28 09:11:47 -05:00
|
|
|
computeDepthOfWellPathAtFracture();
|
|
|
|
computePerforationLength();
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
RiaLogging::info( QString( "Setting well/fracture intersection depth at %1" ).arg( m_wellPathDepthAtFracture ) );
|
2018-08-10 07:47:06 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
m_activeTimeStepIndex = static_cast<int>( m_stimPlanFractureDefinitionData->totalNumberTimeSteps() - 1 );
|
2018-08-10 07:47:06 -05:00
|
|
|
|
2017-06-13 04:23:53 -05:00
|
|
|
bool polygonPropertySet = setBorderPolygonResultNameToDefault();
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( polygonPropertySet )
|
|
|
|
RiaLogging::info( QString( "Calculating polygon outline based on %1 at timestep %2" )
|
|
|
|
.arg( m_borderPolygonResultName )
|
|
|
|
.arg( m_stimPlanFractureDefinitionData->timeSteps()[m_activeTimeStepIndex] ) );
|
2018-08-10 07:47:06 -05:00
|
|
|
else
|
2019-09-06 03:40:57 -05:00
|
|
|
RiaLogging::info( QString( "Property for polygon calculation not set." ) );
|
2018-01-25 06:53:14 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !m_stimPlanFractureDefinitionData->conductivityResultNames().isEmpty() )
|
2018-01-25 06:53:14 -06:00
|
|
|
{
|
|
|
|
m_conductivityResultNameOnFile = m_stimPlanFractureDefinitionData->conductivityResultNames().front();
|
|
|
|
}
|
2017-03-02 04:43:28 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-10 07:47:06 -05:00
|
|
|
///
|
2017-03-02 04:43:28 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-06-13 04:23:53 -05:00
|
|
|
bool RimStimPlanFractureTemplate::setBorderPolygonResultNameToDefault()
|
2017-03-02 04:43:28 -06:00
|
|
|
{
|
2017-09-14 06:48:30 -05:00
|
|
|
// first option: Width
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( std::pair<QString, QString> property : uiResultNamesWithUnit() )
|
2017-03-02 04:43:28 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( property.first == "WIDTH" )
|
2017-03-02 04:43:28 -06:00
|
|
|
{
|
2017-06-13 04:23:53 -05:00
|
|
|
m_borderPolygonResultName = property.first;
|
2017-03-02 04:43:28 -06:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
2018-08-10 07:47:06 -05:00
|
|
|
|
2017-09-14 06:48:30 -05:00
|
|
|
// if width not found, use conductivity
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( hasConductivity() )
|
2017-03-02 04:43:28 -06:00
|
|
|
{
|
2018-01-25 06:30:36 -06:00
|
|
|
m_borderPolygonResultName = m_stimPlanFractureDefinitionData->conductivityResultNames().first();
|
2017-09-14 06:48:30 -05:00
|
|
|
return true;
|
2017-03-02 04:43:28 -06:00
|
|
|
}
|
2017-09-14 06:48:30 -05:00
|
|
|
|
|
|
|
// else: Set to first property
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !uiResultNamesWithUnit().empty() )
|
2017-06-30 05:54:51 -05:00
|
|
|
{
|
2018-01-25 05:14:54 -06:00
|
|
|
m_borderPolygonResultName = uiResultNamesWithUnit()[0].first;
|
2017-06-30 05:54:51 -05:00
|
|
|
return true;
|
|
|
|
}
|
2017-03-02 04:43:28 -06:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-02-15 08:49:53 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-10 07:47:06 -05:00
|
|
|
///
|
2017-02-15 08:49:53 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimStimPlanFractureTemplate::loadDataAndUpdate()
|
|
|
|
{
|
|
|
|
QString errorMessage;
|
2018-01-30 06:48:28 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_readError ) return;
|
2018-01-30 06:48:28 -06:00
|
|
|
|
2019-12-11 01:30:32 -06:00
|
|
|
m_stimPlanFractureDefinitionData = RifStimPlanXmlReader::readStimPlanXMLFile( m_stimPlanFileName().path(),
|
2019-09-06 03:40:57 -05:00
|
|
|
m_conductivityScaleFactor(),
|
|
|
|
m_halfLengthScaleFactor(),
|
|
|
|
m_heightScaleFactor(),
|
|
|
|
-m_wellPathDepthAtFracture(),
|
|
|
|
RifStimPlanXmlReader::MIRROR_AUTO,
|
|
|
|
fractureTemplateUnit(),
|
|
|
|
&errorMessage );
|
|
|
|
if ( errorMessage.size() > 0 ) RiaLogging::error( errorMessage );
|
2017-02-17 02:29:46 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_stimPlanFractureDefinitionData.notNull() )
|
2017-06-12 07:30:18 -05:00
|
|
|
{
|
2018-03-06 01:16:39 -06:00
|
|
|
setDefaultConductivityResultIfEmpty();
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( fractureTemplateUnit() == RiaEclipseUnitTools::UNITS_UNKNOWN )
|
2018-02-20 08:15:06 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
setUnitSystem( m_stimPlanFractureDefinitionData->unitSet() );
|
2018-02-20 08:15:06 -06:00
|
|
|
}
|
|
|
|
|
2018-01-30 06:48:28 -06:00
|
|
|
m_readError = false;
|
2017-06-12 07:30:18 -05:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
setUnitSystem( RiaEclipseUnitTools::UNITS_UNKNOWN );
|
2018-01-30 06:48:28 -06:00
|
|
|
m_readError = true;
|
2017-06-12 07:30:18 -05:00
|
|
|
}
|
|
|
|
|
2017-06-13 04:38:22 -05:00
|
|
|
updateFractureGrid();
|
2017-04-06 02:34:38 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( RimFracture* fracture : fracturesUsingThisTemplate() )
|
2018-08-15 02:44:27 -05:00
|
|
|
{
|
|
|
|
fracture->clearCachedNonDarcyProperties();
|
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( widthResultValues().empty() )
|
2018-10-19 08:28:06 -05:00
|
|
|
{
|
|
|
|
m_fractureWidthType = USER_DEFINED_WIDTH;
|
|
|
|
}
|
|
|
|
|
2017-06-12 07:30:18 -05:00
|
|
|
// Todo: Must update all views using this fracture template
|
2019-09-06 03:40:57 -05:00
|
|
|
RimEclipseView* activeView = dynamic_cast<RimEclipseView*>( RiaApplication::instance()->activeReservoirView() );
|
|
|
|
if ( activeView ) activeView->fractureColors()->loadDataAndUpdate();
|
2017-06-12 07:30:18 -05:00
|
|
|
|
2017-02-17 02:29:46 -06:00
|
|
|
updateConnectedEditors();
|
2017-02-15 08:49:53 -06:00
|
|
|
}
|
|
|
|
|
2017-02-27 07:55:12 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-10 07:47:06 -05:00
|
|
|
///
|
2017-02-27 07:55:12 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
QList<caf::PdmOptionItemInfo>
|
|
|
|
RimStimPlanFractureTemplate::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
|
|
|
|
bool* useOptionsOnly )
|
2017-02-27 07:55:12 -06:00
|
|
|
{
|
|
|
|
QList<caf::PdmOptionItemInfo> options;
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( fieldNeedingOptions == &m_fractureWidthType )
|
2018-10-19 08:28:06 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
options.push_back(
|
|
|
|
caf::PdmOptionItemInfo( caf::AppEnum<WidthEnum>::uiText( USER_DEFINED_WIDTH ), USER_DEFINED_WIDTH ) );
|
2018-10-19 08:28:06 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !widthResultValues().empty() )
|
2018-10-19 08:28:06 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
options.push_back(
|
|
|
|
caf::PdmOptionItemInfo( caf::AppEnum<WidthEnum>::uiText( WIDTH_FROM_FRACTURE ), WIDTH_FROM_FRACTURE ) );
|
2018-10-19 08:28:06 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( fieldNeedingOptions == &m_betaFactorType )
|
2018-10-19 08:28:06 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
options.push_back( caf::PdmOptionItemInfo( caf::AppEnum<BetaFactorEnum>::uiText( USER_DEFINED_BETA_FACTOR ),
|
|
|
|
USER_DEFINED_BETA_FACTOR ) );
|
2018-10-19 08:28:06 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( isBetaFactorAvailableOnFile() )
|
2018-10-19 08:28:06 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
options.push_back( caf::PdmOptionItemInfo( caf::AppEnum<BetaFactorEnum>::uiText( BETA_FACTOR_FROM_FRACTURE ),
|
|
|
|
BETA_FACTOR_FROM_FRACTURE ) );
|
2018-10-19 08:28:06 -05:00
|
|
|
}
|
|
|
|
}
|
2018-02-16 07:17:28 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( fieldNeedingOptions == &m_borderPolygonResultName )
|
2017-02-27 07:55:12 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( std::pair<QString, QString> nameUnit : uiResultNamesWithUnit() )
|
2017-02-27 07:55:12 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
options.push_back( caf::PdmOptionItemInfo( nameUnit.first, nameUnit.first ) );
|
2017-02-27 07:55:12 -06:00
|
|
|
}
|
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( fieldNeedingOptions == &m_activeTimeStepIndex )
|
2017-02-27 07:55:12 -06:00
|
|
|
{
|
2017-06-13 04:38:22 -05:00
|
|
|
std::vector<double> timeValues = timeSteps();
|
2018-02-21 12:53:22 -06:00
|
|
|
int index = 0;
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( double value : timeValues )
|
2017-02-27 07:55:12 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
options.push_back( caf::PdmOptionItemInfo( QString::number( value ), index ) );
|
2017-02-27 07:55:12 -06:00
|
|
|
index++;
|
|
|
|
}
|
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( fieldNeedingOptions == &m_conductivityResultNameOnFile )
|
2018-01-25 05:14:54 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_stimPlanFractureDefinitionData.notNull() )
|
2018-01-25 05:14:54 -06:00
|
|
|
{
|
|
|
|
QStringList conductivityResultNames = m_stimPlanFractureDefinitionData->conductivityResultNames();
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( const auto& resultName : conductivityResultNames )
|
2018-01-25 05:14:54 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
options.push_back( caf::PdmOptionItemInfo( resultName, resultName ) );
|
2018-01-25 05:14:54 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-02-27 07:55:12 -06:00
|
|
|
|
|
|
|
return options;
|
|
|
|
}
|
|
|
|
|
2017-02-17 08:10:04 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-10 07:47:06 -05:00
|
|
|
///
|
2017-02-17 08:10:04 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-06-28 09:11:47 -05:00
|
|
|
void RimStimPlanFractureTemplate::computeDepthOfWellPathAtFracture()
|
2017-02-17 08:10:04 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !m_stimPlanFractureDefinitionData.isNull() )
|
2017-02-17 08:10:04 -06:00
|
|
|
{
|
2018-01-31 05:25:58 -06:00
|
|
|
double firstTvd = m_stimPlanFractureDefinitionData->topPerfTvd();
|
2018-08-10 07:47:06 -05:00
|
|
|
double lastTvd = m_stimPlanFractureDefinitionData->bottomPerfTvd();
|
2018-01-31 05:25:58 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( firstTvd != HUGE_VAL && lastTvd != HUGE_VAL )
|
2018-01-31 05:25:58 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
m_wellPathDepthAtFracture = ( firstTvd + lastTvd ) / 2;
|
2018-01-31 05:25:58 -06:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-08-10 07:47:06 -05:00
|
|
|
firstTvd = m_stimPlanFractureDefinitionData->minDepth();
|
|
|
|
lastTvd = m_stimPlanFractureDefinitionData->maxDepth();
|
2019-09-06 03:40:57 -05:00
|
|
|
m_wellPathDepthAtFracture = ( firstTvd + lastTvd ) / 2;
|
2018-01-31 05:25:58 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-10 07:47:06 -05:00
|
|
|
///
|
2018-01-31 05:25:58 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-06-28 09:11:47 -05:00
|
|
|
void RimStimPlanFractureTemplate::computePerforationLength()
|
2018-01-31 05:25:58 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !m_stimPlanFractureDefinitionData.isNull() )
|
2018-01-31 05:25:58 -06:00
|
|
|
{
|
|
|
|
double firstTvd = m_stimPlanFractureDefinitionData->topPerfTvd();
|
2018-08-10 07:47:06 -05:00
|
|
|
double lastTvd = m_stimPlanFractureDefinitionData->bottomPerfTvd();
|
2018-01-31 05:25:58 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( firstTvd != HUGE_VAL && lastTvd != HUGE_VAL )
|
2018-01-31 05:25:58 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
m_perforationLength = cvf::Math::abs( firstTvd - lastTvd );
|
2018-01-31 05:25:58 -06:00
|
|
|
}
|
2018-01-31 05:43:42 -06:00
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( fractureTemplateUnit() == RiaEclipseUnitTools::UNITS_METRIC && m_perforationLength < 10 )
|
2018-01-31 05:43:42 -06:00
|
|
|
{
|
2018-02-08 04:34:18 -06:00
|
|
|
m_perforationLength = 10;
|
2018-01-31 05:43:42 -06:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( fractureTemplateUnit() == RiaEclipseUnitTools::UNITS_FIELD &&
|
|
|
|
m_perforationLength < RiaEclipseUnitTools::meterToFeet( 10 ) )
|
2018-01-31 05:43:42 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
m_perforationLength = std::round( RiaEclipseUnitTools::meterToFeet( 10 ) );
|
2017-02-17 08:10:04 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-14 06:35:35 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-10 07:47:06 -05:00
|
|
|
///
|
2018-02-14 06:35:35 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-15 02:44:27 -05:00
|
|
|
std::vector<double>
|
2019-09-06 03:40:57 -05:00
|
|
|
RimStimPlanFractureTemplate::fractureGridResultsForUnitSystem( const QString& resultName,
|
|
|
|
const QString& unitName,
|
|
|
|
size_t timeStepIndex,
|
|
|
|
RiaEclipseUnitTools::UnitSystem requiredUnitSystem ) const
|
2018-08-15 02:44:27 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
auto resultValues = m_stimPlanFractureDefinitionData->fractureGridResults( resultName,
|
|
|
|
unitName,
|
|
|
|
m_activeTimeStepIndex );
|
2018-08-15 02:44:27 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( fractureTemplateUnit() == RiaEclipseUnitTools::UNITS_METRIC )
|
2018-08-15 02:44:27 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( auto& v : resultValues )
|
2018-08-15 02:44:27 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
v = RiaEclipseUnitTools::convertToMeter( v, unitName );
|
2018-08-15 02:44:27 -05:00
|
|
|
}
|
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( fractureTemplateUnit() == RiaEclipseUnitTools::UNITS_FIELD )
|
2018-08-15 02:44:27 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( auto& v : resultValues )
|
2018-08-15 02:44:27 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
v = RiaEclipseUnitTools::convertToFeet( v, unitName );
|
2018-08-15 02:44:27 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return resultValues;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
WellFractureIntersectionData
|
|
|
|
RimStimPlanFractureTemplate::wellFractureIntersectionData( const RimFracture* fractureInstance ) const
|
2018-02-14 06:35:35 -06:00
|
|
|
{
|
2018-09-24 08:10:46 -05:00
|
|
|
WellFractureIntersectionData values;
|
2018-02-14 06:35:35 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_fractureGrid.notNull() )
|
2018-02-14 06:35:35 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( orientationType() == ALONG_WELL_PATH )
|
2018-08-15 02:44:27 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
CVF_ASSERT( fractureInstance );
|
2018-02-14 06:35:35 -06:00
|
|
|
|
2018-08-15 02:44:27 -05:00
|
|
|
RimWellPath* rimWellPath = nullptr;
|
2019-09-06 03:40:57 -05:00
|
|
|
fractureInstance->firstAncestorOrThisOfType( rimWellPath );
|
2018-02-14 06:35:35 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( rimWellPath && rimWellPath->wellPathGeometry() )
|
2018-02-14 06:35:35 -06:00
|
|
|
{
|
2018-09-24 08:10:46 -05:00
|
|
|
double totalLength = 0.0;
|
|
|
|
double weightedConductivity = 0.0;
|
|
|
|
double weightedWidth = 0.0;
|
|
|
|
double weightedBetaFactorOnFile = 0.0;
|
2018-08-15 02:44:27 -05:00
|
|
|
|
2018-02-16 07:17:28 -06:00
|
|
|
{
|
2018-08-15 08:52:00 -05:00
|
|
|
std::vector<double> widthResultValues;
|
|
|
|
{
|
|
|
|
auto nameUnit = widthParameterNameAndUnit();
|
2019-09-06 03:40:57 -05:00
|
|
|
widthResultValues = fractureGridResultsForUnitSystem( nameUnit.first,
|
|
|
|
nameUnit.second,
|
|
|
|
m_activeTimeStepIndex,
|
|
|
|
fractureTemplateUnit() );
|
2018-08-15 08:52:00 -05:00
|
|
|
}
|
2018-08-15 02:44:27 -05:00
|
|
|
|
2018-08-15 08:52:00 -05:00
|
|
|
std::vector<double> conductivityResultValues;
|
2018-08-15 02:44:27 -05:00
|
|
|
{
|
2018-08-15 08:52:00 -05:00
|
|
|
auto nameUnit = conductivityParameterNameAndUnit();
|
2019-09-06 03:40:57 -05:00
|
|
|
conductivityResultValues = fractureGridResultsForUnitSystem( nameUnit.first,
|
|
|
|
nameUnit.second,
|
|
|
|
m_activeTimeStepIndex,
|
|
|
|
fractureTemplateUnit() );
|
2018-08-15 02:44:27 -05:00
|
|
|
}
|
|
|
|
|
2018-09-24 08:10:46 -05:00
|
|
|
std::vector<double> betaFactorResultValues;
|
|
|
|
{
|
2019-11-04 08:08:09 -06:00
|
|
|
auto nameUnit = betaFactorParameterNameAndUnit();
|
|
|
|
betaFactorResultValues =
|
|
|
|
m_stimPlanFractureDefinitionData->fractureGridResults( nameUnit.first,
|
|
|
|
nameUnit.second,
|
|
|
|
m_activeTimeStepIndex );
|
2018-09-24 08:10:46 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
RiaWeightedMeanCalculator<double> widthCalc;
|
|
|
|
RiaWeightedMeanCalculator<double> conductivityCalc;
|
|
|
|
RiaWeightedGeometricMeanCalculator betaFactorCalc;
|
2018-08-15 08:52:00 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
RigWellPathStimplanIntersector intersector( rimWellPath->wellPathGeometry(), fractureInstance );
|
|
|
|
for ( const auto& v : intersector.intersections() )
|
2018-08-15 02:44:27 -05:00
|
|
|
{
|
2018-08-15 08:52:00 -05:00
|
|
|
size_t fractureGlobalCellIndex = v.first;
|
|
|
|
double intersectionLength = v.second.computeLength();
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( fractureGlobalCellIndex < widthResultValues.size() )
|
2018-08-15 08:52:00 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
widthCalc.addValueAndWeight( widthResultValues[fractureGlobalCellIndex], intersectionLength );
|
2018-08-15 08:52:00 -05:00
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( fractureGlobalCellIndex < conductivityResultValues.size() )
|
2018-08-15 08:52:00 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
conductivityCalc.addValueAndWeight( conductivityResultValues[fractureGlobalCellIndex],
|
|
|
|
intersectionLength );
|
2018-08-15 08:52:00 -05:00
|
|
|
}
|
2018-09-24 08:10:46 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( fractureGlobalCellIndex < betaFactorResultValues.size() )
|
2018-09-24 08:10:46 -05:00
|
|
|
{
|
2018-12-17 09:24:02 -06:00
|
|
|
double nativeBetaFactor = betaFactorResultValues[fractureGlobalCellIndex];
|
|
|
|
|
|
|
|
// Guard against zero beta values, as these values will set the geometric mean to zero
|
|
|
|
// Consider using the conductivity threshold instead of a local beta threshold
|
|
|
|
const double threshold = 1e-6;
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( fabs( nativeBetaFactor ) > threshold )
|
2018-12-17 09:24:02 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
betaFactorCalc.addValueAndWeight( nativeBetaFactor, intersectionLength );
|
2018-12-17 09:24:02 -06:00
|
|
|
}
|
2018-09-24 08:10:46 -05:00
|
|
|
}
|
2018-08-15 02:44:27 -05:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( conductivityCalc.validAggregatedWeight() )
|
2018-09-06 12:58:28 -05:00
|
|
|
{
|
2018-09-14 02:12:05 -05:00
|
|
|
weightedConductivity = conductivityCalc.weightedMean();
|
2018-09-06 12:58:28 -05:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( widthCalc.validAggregatedWeight() )
|
2018-09-06 12:58:28 -05:00
|
|
|
{
|
2018-09-14 02:12:05 -05:00
|
|
|
weightedWidth = widthCalc.weightedMean();
|
2018-09-06 12:58:28 -05:00
|
|
|
totalLength = widthCalc.aggregatedWeight();
|
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( betaFactorCalc.validAggregatedWeight() )
|
2018-09-24 08:10:46 -05:00
|
|
|
{
|
|
|
|
weightedBetaFactorOnFile = betaFactorCalc.weightedMean();
|
|
|
|
}
|
2018-08-15 02:44:27 -05:00
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( totalLength > 1e-7 )
|
2018-08-15 02:44:27 -05:00
|
|
|
{
|
|
|
|
values.m_width = weightedWidth;
|
|
|
|
values.m_conductivity = weightedConductivity;
|
2018-09-24 08:10:46 -05:00
|
|
|
|
2018-12-17 03:33:42 -06:00
|
|
|
double conversionFactorForBeta = conversionFactorForBetaValues();
|
|
|
|
double betaFactorForcheimer = weightedBetaFactorOnFile / conversionFactorForBeta;
|
|
|
|
|
2018-09-24 08:10:46 -05:00
|
|
|
values.m_betaFactorInForcheimerUnits = betaFactorForcheimer;
|
2018-08-15 02:44:27 -05:00
|
|
|
}
|
2018-08-09 04:01:44 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
values.m_permeability = RigTransmissibilityEquations::permeability( weightedConductivity, weightedWidth );
|
2018-02-16 07:17:28 -06:00
|
|
|
}
|
2018-08-15 02:44:27 -05:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
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 );
|
2018-02-14 06:35:35 -06:00
|
|
|
|
2018-08-15 02:44:27 -05:00
|
|
|
double conductivity = wellCell.getConductivityValue();
|
|
|
|
values.m_conductivity = conductivity;
|
|
|
|
|
2018-02-16 07:17:28 -06:00
|
|
|
{
|
2018-12-17 03:33:42 -06:00
|
|
|
auto nameUnit = widthParameterNameAndUnit();
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !nameUnit.first.isEmpty() )
|
2018-08-15 02:44:27 -05:00
|
|
|
{
|
2018-12-17 03:33:42 -06:00
|
|
|
double widthInRequiredUnit = HUGE_VAL;
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
auto resultValues = fractureGridResultsForUnitSystem( nameUnit.first,
|
|
|
|
nameUnit.second,
|
|
|
|
m_activeTimeStepIndex,
|
|
|
|
fractureTemplateUnit() );
|
2018-12-17 03:33:42 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( wellCellIndex < resultValues.size() )
|
2018-12-17 03:33:42 -06:00
|
|
|
{
|
|
|
|
widthInRequiredUnit = resultValues[wellCellIndex];
|
|
|
|
}
|
|
|
|
}
|
2018-08-15 02:44:27 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( widthInRequiredUnit != HUGE_VAL && fabs( widthInRequiredUnit ) > 1e-20 )
|
2018-08-15 02:44:27 -05:00
|
|
|
{
|
2018-12-17 03:33:42 -06:00
|
|
|
values.m_width = widthInRequiredUnit;
|
2019-09-06 03:40:57 -05:00
|
|
|
values.m_permeability = RigTransmissibilityEquations::permeability( conductivity,
|
|
|
|
widthInRequiredUnit );
|
2018-08-15 02:44:27 -05:00
|
|
|
}
|
|
|
|
}
|
2018-12-17 03:33:42 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
{
|
2019-11-04 08:08:09 -06:00
|
|
|
auto nameUnit = betaFactorParameterNameAndUnit();
|
|
|
|
std::vector<double> betaFactorResultValues =
|
|
|
|
m_stimPlanFractureDefinitionData->fractureGridResults( nameUnit.first,
|
|
|
|
nameUnit.second,
|
|
|
|
m_activeTimeStepIndex );
|
2018-08-15 02:44:27 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( wellCellIndex < betaFactorResultValues.size() )
|
2018-08-15 02:44:27 -05:00
|
|
|
{
|
2018-12-17 03:33:42 -06:00
|
|
|
double nativeBetaValue = betaFactorResultValues[wellCellIndex];
|
|
|
|
|
|
|
|
double conversionFactorForBeta = conversionFactorForBetaValues();
|
|
|
|
double betaFactorForcheimer = nativeBetaValue / conversionFactorForBeta;
|
|
|
|
|
|
|
|
values.m_betaFactorInForcheimerUnits = betaFactorForcheimer;
|
2018-08-15 02:44:27 -05:00
|
|
|
}
|
2018-02-16 07:17:28 -06:00
|
|
|
}
|
|
|
|
}
|
2018-08-09 04:01:44 -05:00
|
|
|
}
|
2018-02-16 07:17:28 -06:00
|
|
|
|
2018-08-09 04:01:44 -05:00
|
|
|
return values;
|
|
|
|
}
|
2018-02-16 07:17:28 -06:00
|
|
|
|
2018-08-09 04:01:44 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-10 07:47:06 -05:00
|
|
|
///
|
2018-08-09 04:01:44 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
std::pair<QString, QString> RimStimPlanFractureTemplate::widthParameterNameAndUnit() const
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_stimPlanFractureDefinitionData.notNull() )
|
2018-08-09 04:01:44 -05:00
|
|
|
{
|
2019-11-04 08:08:09 -06:00
|
|
|
std::vector<std::pair<QString, QString>> propertyNamesUnitsOnFile =
|
|
|
|
m_stimPlanFractureDefinitionData->getStimPlanPropertyNamesUnits();
|
2018-03-05 02:43:06 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( const auto& nameUnit : propertyNamesUnitsOnFile )
|
2018-08-09 04:01:44 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( nameUnit.first.contains( "effective width", Qt::CaseInsensitive ) )
|
2018-08-09 04:01:44 -05:00
|
|
|
{
|
|
|
|
return nameUnit;
|
|
|
|
}
|
2018-03-05 02:43:06 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( nameUnit.first.contains( "width", Qt::CaseInsensitive ) )
|
2018-08-09 04:01:44 -05:00
|
|
|
{
|
|
|
|
return nameUnit;
|
2018-02-14 06:35:35 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-08-09 04:01:44 -05:00
|
|
|
return std::pair<QString, QString>();
|
2018-02-14 06:35:35 -06:00
|
|
|
}
|
|
|
|
|
2018-08-15 02:44:27 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
std::pair<QString, QString> RimStimPlanFractureTemplate::conductivityParameterNameAndUnit() const
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_stimPlanFractureDefinitionData.notNull() )
|
2018-08-15 02:44:27 -05:00
|
|
|
{
|
2019-11-04 08:08:09 -06:00
|
|
|
std::vector<std::pair<QString, QString>> propertyNamesUnitsOnFile =
|
|
|
|
m_stimPlanFractureDefinitionData->getStimPlanPropertyNamesUnits();
|
2018-08-15 02:44:27 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( const auto& nameUnit : propertyNamesUnitsOnFile )
|
2018-08-15 02:44:27 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( nameUnit.first.contains( m_conductivityResultNameOnFile, Qt::CaseInsensitive ) )
|
2018-08-15 02:44:27 -05:00
|
|
|
{
|
|
|
|
return nameUnit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return std::pair<QString, QString>();
|
|
|
|
}
|
|
|
|
|
2018-09-24 08:10:46 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
std::pair<QString, QString> RimStimPlanFractureTemplate::betaFactorParameterNameAndUnit() const
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_stimPlanFractureDefinitionData.notNull() )
|
2018-09-24 08:10:46 -05:00
|
|
|
{
|
2019-11-04 08:08:09 -06:00
|
|
|
std::vector<std::pair<QString, QString>> propertyNamesUnitsOnFile =
|
|
|
|
m_stimPlanFractureDefinitionData->getStimPlanPropertyNamesUnits();
|
2018-09-24 08:10:46 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( const auto& nameUnit : propertyNamesUnitsOnFile )
|
2018-09-24 08:10:46 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( nameUnit.first.contains( "beta", Qt::CaseInsensitive ) )
|
2018-09-24 08:10:46 -05:00
|
|
|
{
|
|
|
|
return nameUnit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return std::pair<QString, QString>();
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
bool RimStimPlanFractureTemplate::isBetaFactorAvailableOnFile() const
|
|
|
|
{
|
|
|
|
auto nameAndUnit = betaFactorParameterNameAndUnit();
|
|
|
|
|
|
|
|
return !nameAndUnit.first.isEmpty();
|
|
|
|
}
|
|
|
|
|
2018-12-17 03:33:42 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
double RimStimPlanFractureTemplate::conversionFactorForBetaValues() const
|
|
|
|
{
|
|
|
|
auto nameUnit = betaFactorParameterNameAndUnit();
|
|
|
|
|
|
|
|
double conversionFactorForBeta = 1.0;
|
|
|
|
|
|
|
|
QString trimmedUnit = nameUnit.second.trimmed().toLower();
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( trimmedUnit == "/m" )
|
2018-12-17 03:33:42 -06:00
|
|
|
{
|
|
|
|
conversionFactorForBeta = 1.01325E+08;
|
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( trimmedUnit == "/cm" )
|
2018-12-17 03:33:42 -06:00
|
|
|
{
|
|
|
|
conversionFactorForBeta = 1.01325E+06;
|
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( trimmedUnit == "/ft" )
|
2018-12-17 03:33:42 -06:00
|
|
|
{
|
|
|
|
conversionFactorForBeta = 3.088386E+07;
|
|
|
|
}
|
|
|
|
|
|
|
|
return conversionFactorForBeta;
|
|
|
|
}
|
|
|
|
|
2018-02-01 08:37:05 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-10 07:47:06 -05:00
|
|
|
///
|
2018-02-01 08:37:05 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimStimPlanFractureTemplate::setDefaultConductivityResultIfEmpty()
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_conductivityResultNameOnFile().isEmpty() )
|
2018-02-01 08:37:05 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !m_stimPlanFractureDefinitionData->conductivityResultNames().isEmpty() )
|
2018-02-01 08:37:05 -06:00
|
|
|
{
|
|
|
|
m_conductivityResultNameOnFile = m_stimPlanFractureDefinitionData->conductivityResultNames().front();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-25 05:14:54 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-10 07:47:06 -05:00
|
|
|
///
|
2018-01-25 05:14:54 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
QString RimStimPlanFractureTemplate::mapUiResultNameToFileResultName( const QString& uiResultName ) const
|
2018-01-25 05:14:54 -06:00
|
|
|
{
|
|
|
|
QString fileResultName;
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( uiResultName == RiaDefines::conductivityResultName() )
|
2018-01-25 05:14:54 -06:00
|
|
|
{
|
|
|
|
fileResultName = m_conductivityResultNameOnFile();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
fileResultName = uiResultName;
|
|
|
|
}
|
|
|
|
|
|
|
|
return fileResultName;
|
|
|
|
}
|
|
|
|
|
2017-02-07 02:09:00 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-10 07:47:06 -05:00
|
|
|
///
|
2018-02-02 02:06:24 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
bool RimStimPlanFractureTemplate::showStimPlanMesh() const
|
|
|
|
{
|
|
|
|
return m_showStimPlanMesh_OBSOLETE();
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-10 07:47:06 -05:00
|
|
|
///
|
2018-02-20 08:15:06 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimStimPlanFractureTemplate::convertToUnitSystem( RiaEclipseUnitTools::UnitSystem neededUnit )
|
2018-02-20 08:15:06 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_fractureTemplateUnit() == neededUnit ) return;
|
2018-02-21 12:07:03 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
setUnitSystem( neededUnit );
|
|
|
|
RimFractureTemplate::convertToUnitSystem( neededUnit );
|
2018-02-20 08:15:06 -06:00
|
|
|
|
|
|
|
m_readError = false;
|
|
|
|
loadDataAndUpdate();
|
2018-02-21 02:50:50 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_stimPlanFractureDefinitionData.isNull() ) return;
|
2018-02-21 02:50:50 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( neededUnit == RiaEclipseUnitTools::UNITS_FIELD )
|
2018-02-21 02:50:50 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
m_wellPathDepthAtFracture = RiaEclipseUnitTools::meterToFeet( m_wellPathDepthAtFracture );
|
2018-02-21 02:50:50 -06:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( neededUnit == RiaEclipseUnitTools::UNITS_METRIC )
|
2018-02-21 02:50:50 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
m_wellPathDepthAtFracture = RiaEclipseUnitTools::feetToMeter( m_wellPathDepthAtFracture );
|
2018-02-21 02:50:50 -06:00
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
m_activeTimeStepIndex = static_cast<int>( m_stimPlanFractureDefinitionData->totalNumberTimeSteps() - 1 );
|
2018-02-21 02:50:50 -06:00
|
|
|
bool polygonPropertySet = setBorderPolygonResultNameToDefault();
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( polygonPropertySet )
|
|
|
|
RiaLogging::info( QString( "Calculating polygon outline based on %1 at timestep %2" )
|
|
|
|
.arg( m_borderPolygonResultName )
|
|
|
|
.arg( m_stimPlanFractureDefinitionData->timeSteps()[m_activeTimeStepIndex] ) );
|
2018-08-10 07:47:06 -05:00
|
|
|
else
|
2019-09-06 03:40:57 -05:00
|
|
|
RiaLogging::info( QString( "Property for polygon calculation not set." ) );
|
2018-02-21 02:50:50 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !m_stimPlanFractureDefinitionData->conductivityResultNames().isEmpty() )
|
2018-02-21 02:50:50 -06:00
|
|
|
{
|
|
|
|
m_conductivityResultNameOnFile = m_stimPlanFractureDefinitionData->conductivityResultNames().front();
|
|
|
|
}
|
2018-02-20 08:15:06 -06:00
|
|
|
}
|
|
|
|
|
2018-03-02 07:33:47 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-10 07:47:06 -05:00
|
|
|
///
|
2018-03-02 07:33:47 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-09-13 01:32:27 -05:00
|
|
|
void RimStimPlanFractureTemplate::onLoadDataAndUpdateGeometryHasChanged()
|
2018-03-02 07:33:47 -06:00
|
|
|
{
|
|
|
|
loadDataAndUpdate();
|
|
|
|
|
|
|
|
RimProject* proj;
|
2019-09-06 03:40:57 -05:00
|
|
|
this->firstAncestorOrThisOfType( proj );
|
|
|
|
if ( proj )
|
2018-03-02 07:33:47 -06:00
|
|
|
{
|
2018-09-11 05:41:45 -05:00
|
|
|
proj->scheduleCreateDisplayModelAndRedrawAllViews();
|
2018-09-11 08:03:59 -05:00
|
|
|
RiaCompletionTypeCalculationScheduler::instance()->scheduleRecalculateCompletionTypeAndRedrawAllViews();
|
2018-03-02 07:33:47 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-20 08:15:06 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-10 07:47:06 -05:00
|
|
|
///
|
2017-02-07 02:09:00 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-01-15 01:58:15 -06:00
|
|
|
std::vector<double> RimStimPlanFractureTemplate::timeSteps()
|
2017-02-15 05:16:01 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_stimPlanFractureDefinitionData.notNull() )
|
2018-01-15 01:58:15 -06:00
|
|
|
{
|
|
|
|
return m_stimPlanFractureDefinitionData->timeSteps();
|
|
|
|
}
|
|
|
|
|
|
|
|
return std::vector<double>();
|
2017-02-15 05:16:01 -06:00
|
|
|
}
|
|
|
|
|
2017-02-17 07:11:47 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-10 07:47:06 -05:00
|
|
|
///
|
2017-02-17 07:11:47 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-10 07:47:06 -05:00
|
|
|
std::vector<std::pair<QString, QString>> RimStimPlanFractureTemplate::uiResultNamesWithUnit() const
|
2017-02-17 07:11:47 -06:00
|
|
|
{
|
2018-08-10 07:47:06 -05:00
|
|
|
std::vector<std::pair<QString, QString>> propertyNamesAndUnits;
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_stimPlanFractureDefinitionData.notNull() )
|
2017-02-17 07:11:47 -06:00
|
|
|
{
|
2018-01-25 05:14:54 -06:00
|
|
|
QString conductivityUnit = "mD/s";
|
|
|
|
|
2018-08-10 07:47:06 -05:00
|
|
|
std::vector<std::pair<QString, QString>> tmp;
|
2018-01-25 05:14:54 -06:00
|
|
|
|
2019-11-04 08:08:09 -06:00
|
|
|
std::vector<std::pair<QString, QString>> propertyNamesUnitsOnFile =
|
|
|
|
m_stimPlanFractureDefinitionData->getStimPlanPropertyNamesUnits();
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( const auto& nameUnitPair : propertyNamesUnitsOnFile )
|
2018-01-25 05:14:54 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( nameUnitPair.first.contains( RiaDefines::conductivityResultName(), Qt::CaseInsensitive ) )
|
2018-01-25 05:14:54 -06:00
|
|
|
{
|
|
|
|
conductivityUnit = nameUnitPair.second;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
tmp.push_back( nameUnitPair );
|
2018-01-25 05:14:54 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
propertyNamesAndUnits.push_back( std::make_pair( RiaDefines::conductivityResultName(), conductivityUnit ) );
|
2018-01-25 05:14:54 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( const auto& nameUnitPair : tmp )
|
2018-01-25 05:14:54 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
propertyNamesAndUnits.push_back( nameUnitPair );
|
2018-01-25 05:14:54 -06:00
|
|
|
}
|
2017-02-17 07:11:47 -06:00
|
|
|
}
|
2018-01-25 05:14:54 -06:00
|
|
|
|
|
|
|
return propertyNamesAndUnits;
|
2017-02-17 07:11:47 -06:00
|
|
|
}
|
|
|
|
|
2017-03-27 07:19:21 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-10 07:47:06 -05:00
|
|
|
///
|
2017-03-27 07:19:21 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
std::vector<std::vector<double>> RimStimPlanFractureTemplate::resultValues( const QString& uiResultName,
|
|
|
|
const QString& unitName,
|
|
|
|
size_t timeStepIndex ) const
|
2017-06-13 04:38:22 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_stimPlanFractureDefinitionData.notNull() )
|
2018-01-15 01:58:15 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
QString fileResultName = mapUiResultNameToFileResultName( uiResultName );
|
2018-01-25 05:14:54 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
return m_stimPlanFractureDefinitionData->getDataAtTimeIndex( fileResultName, unitName, timeStepIndex );
|
2018-01-15 01:58:15 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
return std::vector<std::vector<double>>();
|
2017-06-13 04:38:22 -05:00
|
|
|
}
|
|
|
|
|
2017-06-26 03:28:23 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-10 07:47:06 -05:00
|
|
|
///
|
2017-06-26 03:28:23 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
std::vector<double> RimStimPlanFractureTemplate::fractureGridResults( const QString& uiResultName,
|
|
|
|
const QString& unitName,
|
|
|
|
size_t timeStepIndex ) const
|
2017-06-26 03:28:23 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_stimPlanFractureDefinitionData.notNull() )
|
2018-01-15 01:58:15 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
QString fileResultName = mapUiResultNameToFileResultName( uiResultName );
|
2018-01-25 05:14:54 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
return m_stimPlanFractureDefinitionData->fractureGridResults( fileResultName, unitName, timeStepIndex );
|
2018-01-15 01:58:15 -06:00
|
|
|
}
|
|
|
|
|
2018-08-10 07:47:06 -05:00
|
|
|
return std::vector<double>();
|
2017-06-26 03:28:23 -05:00
|
|
|
}
|
|
|
|
|
2017-09-14 06:48:30 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-10 07:47:06 -05:00
|
|
|
///
|
2017-09-14 06:48:30 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
bool RimStimPlanFractureTemplate::hasConductivity() const
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_stimPlanFractureDefinitionData.notNull() &&
|
|
|
|
!m_stimPlanFractureDefinitionData->conductivityResultNames().isEmpty() )
|
2017-09-14 06:48:30 -05:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2018-03-04 03:36:39 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-10 07:47:06 -05:00
|
|
|
///
|
2018-03-04 03:36:39 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-11-04 07:35:41 -06:00
|
|
|
double RimStimPlanFractureTemplate::resultValueAtIJ( const QString& uiResultName,
|
|
|
|
const QString& unitName,
|
|
|
|
size_t timeStepIndex,
|
|
|
|
size_t i,
|
|
|
|
size_t j )
|
2018-03-04 03:36:39 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
auto values = resultValues( uiResultName, unitName, timeStepIndex );
|
2018-03-04 03:36:39 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( values.empty() ) return HUGE_VAL;
|
2018-03-04 03:36:39 -06:00
|
|
|
|
|
|
|
size_t adjustedI = i + 1;
|
|
|
|
size_t adjustedJ = j + 1;
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( adjustedI >= fractureGrid()->iCellCount() || adjustedJ >= fractureGrid()->jCellCount() )
|
2018-03-04 03:36:39 -06:00
|
|
|
{
|
|
|
|
return HUGE_VAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return values[adjustedJ][adjustedI];
|
|
|
|
}
|
|
|
|
|
2018-08-09 04:01:44 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-10 07:47:06 -05:00
|
|
|
///
|
2018-08-09 04:01:44 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-09-11 06:22:57 -05:00
|
|
|
std::vector<double> RimStimPlanFractureTemplate::widthResultValues() const
|
2018-08-09 04:01:44 -05:00
|
|
|
{
|
2018-09-11 06:22:57 -05:00
|
|
|
std::vector<double> resultValues;
|
2018-08-09 04:01:44 -05:00
|
|
|
|
2018-09-11 06:22:57 -05:00
|
|
|
auto nameUnit = widthParameterNameAndUnit();
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !nameUnit.first.isEmpty() )
|
2018-09-11 06:22:57 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
resultValues = fractureGridResultsForUnitSystem( nameUnit.first,
|
|
|
|
nameUnit.second,
|
|
|
|
m_activeTimeStepIndex,
|
|
|
|
fractureTemplateUnit() );
|
2018-09-11 06:22:57 -05:00
|
|
|
}
|
2018-08-09 04:01:44 -05:00
|
|
|
|
2018-09-11 06:22:57 -05:00
|
|
|
return resultValues;
|
2018-08-09 04:01:44 -05:00
|
|
|
}
|
|
|
|
|
2017-06-13 04:38:22 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-01-19 02:10:30 -06:00
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimStimPlanFractureTemplate::appendDataToResultStatistics( const QString& uiResultName,
|
|
|
|
const QString& unit,
|
|
|
|
MinMaxAccumulator& minMaxAccumulator,
|
|
|
|
PosNegAccumulator& posNegAccumulator ) const
|
2018-01-19 02:10:30 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_stimPlanFractureDefinitionData.notNull() )
|
2018-01-19 02:10:30 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
QString fileResultName = mapUiResultNameToFileResultName( uiResultName );
|
2018-01-25 05:14:54 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
m_stimPlanFractureDefinitionData->appendDataToResultStatistics( fileResultName,
|
|
|
|
unit,
|
|
|
|
minMaxAccumulator,
|
|
|
|
posNegAccumulator );
|
2018-01-19 02:10:30 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
2017-06-13 04:38:22 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
const RigFractureGrid* RimStimPlanFractureTemplate::fractureGrid() const
|
|
|
|
{
|
|
|
|
return m_fractureGrid.p();
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-10 07:47:06 -05:00
|
|
|
///
|
2017-06-13 04:38:22 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimStimPlanFractureTemplate::updateFractureGrid()
|
2017-03-27 07:19:21 -05:00
|
|
|
{
|
2018-09-11 06:22:57 -05:00
|
|
|
m_fractureGrid = nullptr;
|
2018-01-15 01:58:15 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_stimPlanFractureDefinitionData.notNull() )
|
2018-01-15 01:58:15 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
m_fractureGrid = m_stimPlanFractureDefinitionData->createFractureGrid( m_conductivityResultNameOnFile,
|
|
|
|
m_activeTimeStepIndex,
|
|
|
|
m_wellPathDepthAtFracture,
|
|
|
|
m_fractureTemplateUnit() );
|
2018-08-09 04:01:44 -05:00
|
|
|
}
|
|
|
|
}
|
2017-06-13 07:44:04 -05:00
|
|
|
|
2017-04-06 02:34:38 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-10 07:47:06 -05:00
|
|
|
///
|
2017-04-06 02:34:38 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimStimPlanFractureTemplate::fractureTriangleGeometry( std::vector<cvf::Vec3f>* nodeCoords,
|
|
|
|
std::vector<cvf::uint>* triangleIndices ) const
|
2017-04-06 02:34:38 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_stimPlanFractureDefinitionData.notNull() )
|
2018-01-15 01:58:15 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
m_stimPlanFractureDefinitionData->createFractureTriangleGeometry( m_wellPathDepthAtFracture,
|
|
|
|
name(),
|
|
|
|
nodeCoords,
|
|
|
|
triangleIndices );
|
2018-01-15 01:58:15 -06:00
|
|
|
}
|
2017-03-27 07:19:21 -05:00
|
|
|
}
|
|
|
|
|
2017-02-07 02:09:00 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-10 07:47:06 -05:00
|
|
|
///
|
2017-02-07 02:09:00 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimStimPlanFractureTemplate::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
2017-02-07 02:09:00 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
uiOrdering.add( &m_name );
|
|
|
|
uiOrdering.add( &m_id );
|
2017-02-10 03:33:07 -06:00
|
|
|
|
2018-09-25 04:24:10 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
caf::PdmUiGroup* group = uiOrdering.addNewGroup( "Input" );
|
|
|
|
group->add( &m_stimPlanFileName );
|
|
|
|
group->add( &m_activeTimeStepIndex );
|
|
|
|
group->add( &m_wellPathDepthAtFracture );
|
2018-09-25 04:24:10 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
caf::PdmUiGroup* group = uiOrdering.addNewGroup( "Geometry" );
|
|
|
|
group->add( &m_orientationType );
|
|
|
|
group->add( &m_azimuthAngle );
|
2018-09-25 04:24:10 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
caf::PdmUiGroup* group = uiOrdering.addNewGroup( "Fracture Truncation" );
|
|
|
|
group->setCollapsedByDefault( true );
|
|
|
|
m_fractureContainment()->uiOrdering( uiConfigName, *group );
|
2018-09-25 04:24:10 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
caf::PdmUiGroup* group = uiOrdering.addNewGroup( "Properties" );
|
|
|
|
group->add( &m_conductivityResultNameOnFile );
|
|
|
|
group->add( &m_conductivityType );
|
|
|
|
group->add( &m_skinFactor );
|
|
|
|
group->add( &m_perforationLength );
|
|
|
|
group->add( &m_perforationEfficiency );
|
|
|
|
group->add( &m_wellDiameter );
|
2018-09-25 04:24:10 -05:00
|
|
|
}
|
2018-02-09 00:26:48 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( widthResultValues().empty() )
|
2018-10-19 08:28:06 -05:00
|
|
|
{
|
|
|
|
m_fractureWidthType = USER_DEFINED_WIDTH;
|
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
RimFractureTemplate::defineUiOrdering( uiConfigName, uiOrdering );
|
2017-02-07 02:09:00 -06:00
|
|
|
}
|
2017-02-07 04:08:56 -06:00
|
|
|
|
2017-02-17 08:10:04 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-10 07:47:06 -05:00
|
|
|
///
|
2017-02-17 08:10:04 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimStimPlanFractureTemplate::defineEditorAttribute( const caf::PdmFieldHandle* field,
|
|
|
|
QString uiConfigName,
|
|
|
|
caf::PdmUiEditorAttribute* attribute )
|
2017-02-17 08:10:04 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
RimFractureTemplate::defineEditorAttribute( field, uiConfigName, attribute );
|
2017-04-19 04:00:52 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( field == &m_stimPlanFileName )
|
2017-02-22 07:46:28 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
caf::PdmUiFilePathEditorAttribute* myAttr = dynamic_cast<caf::PdmUiFilePathEditorAttribute*>( attribute );
|
|
|
|
if ( myAttr )
|
2017-02-22 07:46:28 -06:00
|
|
|
{
|
|
|
|
myAttr->m_fileSelectionFilter = "StimPlan Xml Files(*.xml);;All Files (*.*)";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( field == &m_wellPathDepthAtFracture )
|
2017-02-17 08:10:04 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !m_stimPlanFractureDefinitionData.isNull() && ( m_stimPlanFractureDefinitionData->yCount() > 0 ) )
|
2017-02-17 08:10:04 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
caf::PdmUiDoubleSliderEditorAttribute* myAttr = dynamic_cast<caf::PdmUiDoubleSliderEditorAttribute*>(
|
|
|
|
attribute );
|
|
|
|
if ( myAttr )
|
2017-06-14 02:20:15 -05:00
|
|
|
{
|
|
|
|
myAttr->m_minimum = m_stimPlanFractureDefinitionData->minDepth();
|
|
|
|
myAttr->m_maximum = m_stimPlanFractureDefinitionData->maxDepth();
|
|
|
|
}
|
2017-02-17 08:10:04 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|