#6234 Fracture Model: add template to enable data sharing.

This commit is contained in:
Kristian Bendiksen 2020-09-22 15:53:17 +02:00
parent c325dce252
commit 851e245f83
25 changed files with 1101 additions and 213 deletions

View File

@ -45,6 +45,7 @@
#include "RimAnnotationTextAppearance.h"
#include "RimCellRangeFilterCollection.h"
#include "RimCommandObject.h"
#include "RimCompletionTemplateCollection.h"
#include "RimCorrelationPlot.h"
#include "RimCorrelationPlotCollection.h"
#include "RimCorrelationReportPlot.h"
@ -549,7 +550,7 @@ bool RiaApplication::loadProject( const QString& projectFileName,
observedFmuData->createRftReaderInterface();
}
oilField->fractureDefinitionCollection()->loadAndUpdateData();
oilField->completionTemplateCollection()->loadAndUpdateData();
oilField->fractureDefinitionCollection()->createAndAssignTemplateCopyForNonMatchingUnit();
{

View File

@ -14,6 +14,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathFractureAtPosFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathFractureFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicNewFractureModelFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathFractureModelAtPosFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicNewFractureModelTemplateFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleFracturesFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleFracturesOptionItemUi.h
@ -37,6 +38,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathFractureAtPosFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathFractureFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicNewFractureModelFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathFractureModelAtPosFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicNewFractureModelTemplateFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleFracturesFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleFracturesOptionItemUi.cpp

View File

@ -0,0 +1,73 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2020- Equinor ASA
//
// 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.
//
// 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.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RicNewFractureModelTemplateFeature.h"
#include "RimCompletionTemplateCollection.h"
#include "RimFractureModelTemplate.h"
#include "RimFractureModelTemplateCollection.h"
#include "RimOilField.h"
#include "RimProject.h"
#include "Riu3DMainWindowTools.h"
#include "cafSelectionManager.h"
#include "cvfAssert.h"
#include <QAction>
CAF_CMD_SOURCE_INIT( RicNewFractureModelTemplateFeature, "RicNewFractureModelTemplateFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewFractureModelTemplateFeature::onActionTriggered( bool isChecked )
{
RimProject* project = RimProject::current();
CVF_ASSERT( project );
RimOilField* oilfield = project->activeOilField();
if ( !oilfield ) return;
RimFractureModelTemplateCollection* fracModColl =
oilfield->completionTemplateCollection->fractureModelTemplateCollection();
if ( !fracModColl ) return;
RimFractureModelTemplate* fractureModelTemplate = new RimFractureModelTemplate;
fracModColl->addFractureModelTemplate( fractureModelTemplate );
fracModColl->updateConnectedEditors();
Riu3DMainWindowTools::selectAsCurrentItem( fractureModelTemplate );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewFractureModelTemplateFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setIcon( QIcon( ":/FractureTemplate16x16.png" ) );
actionToSetup->setText( "New Fracture Model Template" );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicNewFractureModelTemplateFeature::isCommandEnabled()
{
return true;
}

View File

@ -0,0 +1,36 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2020- Equinor ASA
//
// 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.
//
// 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.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cafCmdFeature.h"
#include <vector>
//==================================================================================================
///
//==================================================================================================
class RicNewFractureModelTemplateFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
protected:
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
bool isCommandEnabled() override;
};

View File

@ -21,7 +21,7 @@
#include "RiaLogging.h"
#include "RimElasticProperties.h"
#include "RimFractureModel.h"
#include "RimFractureModelTemplate.h"
#include "RifCsvUserDataParser.h"
#include "RifElasticPropertiesReader.h"
@ -35,8 +35,8 @@
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicElasticPropertiesImportTools::importElasticPropertiesFromFile( const QString& filePath,
RimFractureModel* fractureModel )
void RicElasticPropertiesImportTools::importElasticPropertiesFromFile( const QString& filePath,
RimFractureModelTemplate* fractureModelTemplate )
{
RifCsvUserDataFileParser csvParser( filePath );
QString separator = csvParser.tryDetermineCellSeparator();
@ -110,6 +110,6 @@ void RicElasticPropertiesImportTools::importElasticPropertiesFromFile( const QSt
}
rimElasticProperties->setFilePath( filePath );
fractureModel->setElasticProperties( rimElasticProperties );
fractureModel->updateConnectedEditors();
fractureModelTemplate->setElasticProperties( rimElasticProperties );
fractureModelTemplate->updateConnectedEditors();
}

View File

@ -20,7 +20,7 @@
#include <QString>
class RimFractureModel;
class RimFractureModelTemplate;
//--------------------------------------------------------------------------------------------------
///
@ -28,7 +28,7 @@ class RimFractureModel;
class RicElasticPropertiesImportTools
{
public:
static void importElasticPropertiesFromFile( const QString& filePath, RimFractureModel* fractureModel );
static void importElasticPropertiesFromFile( const QString& filePath, RimFractureModelTemplate* fractureModelTemplate );
private:
// Hidden to avoid instantiation

View File

@ -28,7 +28,7 @@
#include "RimColorLegendCollection.h"
#include "RimColorLegendItem.h"
#include "RimFaciesProperties.h"
#include "RimFractureModel.h"
#include "RimFractureModelTemplate.h"
#include "RimProject.h"
#include "RifColorLegendData.h"
@ -39,9 +39,9 @@
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicFaciesPropertiesImportTools::importFaciesPropertiesFromFile( const QString& filePath,
RimFractureModel* fractureModel,
bool createColorLegend )
void RicFaciesPropertiesImportTools::importFaciesPropertiesFromFile( const QString& filePath,
RimFractureModelTemplate* fractureModelTemplate,
bool createColorLegend )
{
if ( filePath.isEmpty() ) return;
@ -56,7 +56,7 @@ void RicFaciesPropertiesImportTools::importFaciesPropertiesFromFile( const QStri
return;
}
RimFaciesProperties* faciesProperties = fractureModel->faciesProperties();
RimFaciesProperties* faciesProperties = fractureModelTemplate->faciesProperties();
if ( !faciesProperties )
{
faciesProperties = new RimFaciesProperties;
@ -99,7 +99,8 @@ void RicFaciesPropertiesImportTools::importFaciesPropertiesFromFile( const QStri
faciesProperties->setFilePath( filePath );
fractureModel->setFaciesProperties( faciesProperties );
fractureModelTemplate->setFaciesProperties( faciesProperties );
fractureModelTemplate->updateConnectedEditors();
}
//--------------------------------------------------------------------------------------------------

View File

@ -19,7 +19,7 @@
#pragma once
class RimColorLegend;
class RimFractureModel;
class RimFractureModelTemplate;
namespace cvf
{
@ -34,9 +34,9 @@ class QString;
class RicFaciesPropertiesImportTools
{
public:
static void importFaciesPropertiesFromFile( const QString& filePath,
RimFractureModel* fractureModel,
bool createColorLegend = false );
static void importFaciesPropertiesFromFile( const QString& filePath,
RimFractureModelTemplate* fractureModelTemplate,
bool createColorLegend = false );
private:
static int computeEditDistance( const QString& a, const QString& b );

View File

@ -22,7 +22,7 @@
#include "RicElasticPropertiesImportTools.h"
#include "RimFractureModel.h"
#include "RimFractureModelTemplate.h"
#include "Riu3DMainWindowTools.h"
#include "RiuFileDialogTools.h"
@ -47,8 +47,9 @@ bool RicImportElasticPropertiesFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicImportElasticPropertiesFeature::onActionTriggered( bool isChecked )
{
RimFractureModel* fractureModel = caf::SelectionManager::instance()->selectedItemAncestorOfType<RimFractureModel>();
if ( !fractureModel ) return;
RimFractureModelTemplate* fractureModelTemplate =
caf::SelectionManager::instance()->selectedItemAncestorOfType<RimFractureModelTemplate>();
if ( !fractureModelTemplate ) return;
// Open dialog box to select files
RiaApplication* app = RiaApplication::instance();
@ -63,7 +64,7 @@ void RicImportElasticPropertiesFeature::onActionTriggered( bool isChecked )
// Remember the path to next time
app->setLastUsedDialogDirectory( "STIMPLAN_DIR", QFileInfo( filePath ).absolutePath() );
RicElasticPropertiesImportTools::importElasticPropertiesFromFile( filePath, fractureModel );
RicElasticPropertiesImportTools::importElasticPropertiesFromFile( filePath, fractureModelTemplate );
}
//--------------------------------------------------------------------------------------------------

View File

@ -25,7 +25,7 @@
#include "RicFaciesPropertiesImportTools.h"
#include "RimFractureModel.h"
#include "RimFractureModelTemplate.h"
#include "cafSelectionManager.h"
@ -47,8 +47,9 @@ bool RicImportFaciesFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicImportFaciesFeature::onActionTriggered( bool isChecked )
{
RimFractureModel* fractureModel = caf::SelectionManager::instance()->selectedItemAncestorOfType<RimFractureModel>();
if ( !fractureModel ) return;
RimFractureModelTemplate* fractureModelTemplate =
caf::SelectionManager::instance()->selectedItemAncestorOfType<RimFractureModelTemplate>();
if ( !fractureModelTemplate ) return;
RiaApplication* app = RiaApplication::instance();
QString defaultDir = app->lastUsedDialogDirectoryWithFallbackToProjectFolder( "STIMPLAN_DIR" );
@ -66,7 +67,7 @@ void RicImportFaciesFeature::onActionTriggered( bool isChecked )
app->setLastUsedDialogDirectory( "STIMPLAN_DIR", QFileInfo( fileName ).absolutePath() );
bool createColorLegend = true;
RicFaciesPropertiesImportTools::importFaciesPropertiesFromFile( fileName, fractureModel, createColorLegend );
RicFaciesPropertiesImportTools::importFaciesPropertiesFromFile( fileName, fractureModelTemplate, createColorLegend );
}
//--------------------------------------------------------------------------------------------------

View File

@ -21,6 +21,8 @@ ${CMAKE_CURRENT_LIST_DIR}/RimCompletionTemplateCollection.h
${CMAKE_CURRENT_LIST_DIR}/RimFractureTemplateCollection.h
${CMAKE_CURRENT_LIST_DIR}/RimValveTemplateCollection.h
${CMAKE_CURRENT_LIST_DIR}/RimValveTemplate.h
${CMAKE_CURRENT_LIST_DIR}/RimFractureModelTemplateCollection.h
${CMAKE_CURRENT_LIST_DIR}/RimFractureModelTemplate.h
${CMAKE_CURRENT_LIST_DIR}/RimSimWellFracture.h
${CMAKE_CURRENT_LIST_DIR}/RimSimWellFractureCollection.h
${CMAKE_CURRENT_LIST_DIR}/RimStimPlanFractureTemplate.h
@ -59,6 +61,8 @@ ${CMAKE_CURRENT_LIST_DIR}/RimCompletionTemplateCollection.cpp
${CMAKE_CURRENT_LIST_DIR}/RimFractureTemplateCollection.cpp
${CMAKE_CURRENT_LIST_DIR}/RimValveTemplateCollection.cpp
${CMAKE_CURRENT_LIST_DIR}/RimValveTemplate.cpp
${CMAKE_CURRENT_LIST_DIR}/RimFractureModelTemplateCollection.cpp
${CMAKE_CURRENT_LIST_DIR}/RimFractureModelTemplate.cpp
${CMAKE_CURRENT_LIST_DIR}/RimSimWellFracture.cpp
${CMAKE_CURRENT_LIST_DIR}/RimSimWellFractureCollection.cpp
${CMAKE_CURRENT_LIST_DIR}/RimStimPlanFractureTemplate.cpp

View File

@ -18,6 +18,7 @@
#include "RimCompletionTemplateCollection.h"
#include "RimFractureModelTemplateCollection.h"
#include "RimFractureTemplateCollection.h"
#include "RimValveTemplateCollection.h"
@ -37,6 +38,10 @@ RimCompletionTemplateCollection::RimCompletionTemplateCollection()
CAF_PDM_InitFieldNoDefault( &m_fractureTemplates, "FractureTemplates", "", "", "", "" );
m_fractureTemplates = new RimFractureTemplateCollection;
m_fractureTemplates->addDefaultEllipseTemplate();
CAF_PDM_InitFieldNoDefault( &m_fractureModelTemplates, "FractureModelTemplates", "", "", "", "" );
m_fractureModelTemplates = new RimFractureModelTemplateCollection;
CAF_PDM_InitFieldNoDefault( &m_valveTemplates, "ValveTemplates", "", "", "", "" );
m_valveTemplates = new RimValveTemplateCollection;
}
@ -98,6 +103,22 @@ void RimCompletionTemplateCollection::setFractureTemplateCollection( RimFracture
m_fractureTemplates = fractureTemplateCollection;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimFractureModelTemplateCollection* RimCompletionTemplateCollection::fractureModelTemplateCollection()
{
return m_fractureModelTemplates;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const RimFractureModelTemplateCollection* RimCompletionTemplateCollection::fractureModelTemplateCollection() const
{
return m_fractureModelTemplates;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -105,6 +126,16 @@ void RimCompletionTemplateCollection::defineUiTreeOrdering( caf::PdmUiTreeOrderi
QString uiConfigName /*= ""*/ )
{
uiTreeOrdering.add( m_fractureTemplates );
uiTreeOrdering.add( m_fractureModelTemplates );
uiTreeOrdering.add( m_valveTemplates );
uiTreeOrdering.skipRemainingChildren( true );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimCompletionTemplateCollection::loadAndUpdateData()
{
m_fractureTemplates->loadAndUpdateData();
m_fractureModelTemplates->loadAndUpdateData();
}

View File

@ -24,6 +24,7 @@
class RimOilField;
class RimValveTemplateCollection;
class RimFractureTemplateCollection;
class RimFractureModelTemplateCollection;
class RimCompletionTemplateCollection : public caf::PdmObject
{
@ -33,18 +34,23 @@ public:
RimCompletionTemplateCollection();
~RimCompletionTemplateCollection() override;
RimFractureTemplateCollection* fractureTemplateCollection();
const RimFractureTemplateCollection* fractureTemplateCollection() const;
RimValveTemplateCollection* valveTemplateCollection();
const RimValveTemplateCollection* valveTemplateCollection() const;
void setDefaultUnitSystemBasedOnLoadedCases();
RimFractureTemplateCollection* fractureTemplateCollection();
const RimFractureTemplateCollection* fractureTemplateCollection() const;
RimFractureModelTemplateCollection* fractureModelTemplateCollection();
const RimFractureModelTemplateCollection* fractureModelTemplateCollection() const;
RimValveTemplateCollection* valveTemplateCollection();
const RimValveTemplateCollection* valveTemplateCollection() const;
void setDefaultUnitSystemBasedOnLoadedCases();
void loadAndUpdateData();
private:
friend class RimOilField;
void setFractureTemplateCollection( RimFractureTemplateCollection* fractureTemplateCollection );
caf::PdmChildField<RimFractureTemplateCollection*> m_fractureTemplates;
caf::PdmChildField<RimValveTemplateCollection*> m_valveTemplates;
caf::PdmChildField<RimFractureTemplateCollection*> m_fractureTemplates;
caf::PdmChildField<RimValveTemplateCollection*> m_valveTemplates;
caf::PdmChildField<RimFractureModelTemplateCollection*> m_fractureModelTemplates;
protected:
void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "" ) override;

View File

@ -36,12 +36,12 @@
#include "RimColorLegend.h"
#include "RimColorLegendCollection.h"
#include "RimColorLegendItem.h"
#include "RimCompletionTemplateCollection.h"
#include "RimEclipseCase.h"
#include "RimEclipseView.h"
#include "RimElasticProperties.h"
#include "RimEllipseFractureTemplate.h"
#include "RimFaciesProperties.h"
#include "RimFractureModelPlot.h"
#include "RimFractureModelTemplate.h"
#include "RimFractureModelTemplateCollection.h"
#include "RimModeledWellPath.h"
#include "RimOilField.h"
#include "RimPolylineTarget.h"
@ -53,6 +53,8 @@
#include "RimWellPathGeometryDef.h"
#include "RimWellPathTarget.h"
#include "Riu3DMainWindowTools.h"
#include "cafPdmFieldCvfVec3d.h"
#include "cafPdmFieldScriptingCapabilityCvfVec3d.h"
#include "cafPdmObjectScriptingCapability.h"
@ -65,12 +67,11 @@
#include "cvfBoundingBox.h"
#include "cvfGeometryTools.h"
#include "cvfMath.h"
#include "cvfMatrix4.h"
#include "cvfPlane.h"
#include <cmath>
CAF_PDM_SOURCE_INIT( RimFractureModel, "RimFractureModel" );
CAF_PDM_SOURCE_INIT( RimFractureModel, "RimFractureModel" );
namespace caf
{
@ -102,6 +103,11 @@ RimFractureModel::RimFractureModel()
{
CAF_PDM_InitScriptableObject( "FractureModel", "", "", "" );
CAF_PDM_InitFieldNoDefault( &m_fractureModelTemplate, "FractureModelTemplate", "Fracture Model Template", "", "", "" );
CAF_PDM_InitField( &m_editFractureModelTemplate, "EditModelTemplate", false, "Edit", "", "", "" );
m_editFractureModelTemplate.uiCapability()->setUiEditorTypeName( caf::PdmUiToolButtonEditor::uiEditorTypeName() );
m_editFractureModelTemplate.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN );
CAF_PDM_InitScriptableField( &m_MD, "MD", 0.0, "MD", "", "", "" );
CAF_PDM_InitScriptableField( &m_extractionType,
@ -150,44 +156,6 @@ RimFractureModel::RimFractureModel()
CAF_PDM_InitScriptableField( &m_stressDepth, "StressDepth", defaultStressDepth, "Stress Depth", "", "", "" );
m_stressDepth.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleValueEditor::uiEditorTypeName() );
CAF_PDM_InitScriptableField( &m_overburdenHeight, "OverburdenHeight", 50.0, "Overburden Height", "", "", "" );
CAF_PDM_InitScriptableFieldNoDefault( &m_overburdenFormation, "OverburdenFormation", "Overburden Formation", "", "", "" );
CAF_PDM_InitScriptableFieldNoDefault( &m_overburdenFacies, "OverburdenFacies", "Overburden Facies", "", "", "" );
CAF_PDM_InitScriptableField( &m_overburdenPorosity, "OverburdenPorosity", 0.0, "Overburden Porosity", "", "", "" );
CAF_PDM_InitScriptableField( &m_overburdenPermeability,
"OverburdenPermeability",
10.0e-6,
"Overburden Permeability",
"",
"",
"" );
CAF_PDM_InitScriptableField( &m_overburdenFluidDensity,
"OverburdenFluidDensity",
1.03,
"Overburden Fluid Density [g/cm^3]",
"",
"",
"" );
CAF_PDM_InitScriptableField( &m_underburdenHeight, "UnderburdenHeight", 50.0, "Underburden Height", "", "", "" );
CAF_PDM_InitScriptableFieldNoDefault( &m_underburdenFormation, "UnderburdenFormation", "Underburden Formation", "", "", "" );
CAF_PDM_InitScriptableFieldNoDefault( &m_underburdenFacies, "UnderburdenFacies", "Underburden Facies", "", "", "" );
CAF_PDM_InitScriptableField( &m_underburdenPorosity, "UnderburdenPorosity", 0.0, "Underburden Porosity", "", "", "" );
CAF_PDM_InitScriptableField( &m_underburdenPermeability,
"UnderburdenPermeability",
10.0e-6,
"Underburden Permeability",
"",
"",
"" );
CAF_PDM_InitScriptableField( &m_underburdenFluidDensity,
"UnderburdenFluidDensity",
1.03,
"Underburden Fluid Density [g/cm^3]",
"",
"",
"" );
CAF_PDM_InitScriptableField( &m_referenceTemperature, "ReferenceTemperature", 70.0, "Temperature [C]", "", "", "" );
CAF_PDM_InitScriptableField( &m_referenceTemperatureGradient,
"ReferenceTemperatureGradient",
@ -246,14 +214,7 @@ RimFractureModel::RimFractureModel()
m_barrierDip.uiCapability()->setUiReadOnly( true );
CAF_PDM_InitScriptableField( &m_wellPenetrationLayer, "WellPenetrationLayer", 0, "Well Penetration Layer", "", "", "" );
CAF_PDM_InitScriptableFieldNoDefault( &m_elasticProperties, "ElasticProperties", "Elastic Properties", "", "", "" );
m_elasticProperties.uiCapability()->setUiHidden( true );
m_elasticProperties.uiCapability()->setUiTreeHidden( true );
CAF_PDM_InitScriptableFieldNoDefault( &m_barrierAnnotation, "BarrierAnnotation", "Barrier Annotation", "", "", "" );
CAF_PDM_InitScriptableFieldNoDefault( &m_faciesProperties, "FaciesProperties", "Facies Properties", "", "", "" );
m_faciesProperties.uiCapability()->setUiHidden( true );
m_faciesProperties.uiCapability()->setUiTreeHidden( true );
setDeletable( true );
}
@ -345,6 +306,15 @@ void RimFractureModel::fieldChangedByUi( const caf::PdmFieldHandle* changedField
m_referenceTemperatureDepth.uiCapability()->setUiReadOnly( !m_useDetailedFluidLoss );
}
if ( changedField == &m_editFractureModelTemplate )
{
m_editFractureModelTemplate = false;
if ( m_fractureModelTemplate != nullptr )
{
Riu3DMainWindowTools::selectAsCurrentItem( m_fractureModelTemplate() );
}
}
{
RimEclipseCase* eclipseCase = nullptr;
this->firstAncestorOrThisOfType( eclipseCase );
@ -372,26 +342,18 @@ QList<caf::PdmOptionItemInfo> RimFractureModel::calculateValueOptions( const caf
{
QList<caf::PdmOptionItemInfo> options;
if ( fieldNeedingOptions == &m_overburdenFormation || fieldNeedingOptions == &m_underburdenFormation )
if ( fieldNeedingOptions == &m_fractureModelTemplate )
{
RigEclipseCaseData* eclipseCaseData = getEclipseCaseData();
if ( !eclipseCaseData ) return options;
RimOilField* oilField = RimProject::current()->activeOilField();
if ( oilField && oilField->completionTemplateCollection() )
{
RimFractureModelTemplateCollection* fracDefColl =
oilField->completionTemplateCollection()->fractureModelTemplateCollection();
std::vector<QString> formationNames = eclipseCaseData->formationNames();
for ( const QString& formationName : formationNames )
{
options.push_back( caf::PdmOptionItemInfo( formationName, formationName ) );
}
}
else if ( fieldNeedingOptions == &m_overburdenFacies || fieldNeedingOptions == &m_underburdenFacies )
{
RimColorLegend* faciesColors =
RimProject::current()->colorLegendCollection()->findByName( RiaDefines::faciesColorLegendName() );
if ( faciesColors )
{
for ( RimColorLegendItem* item : faciesColors->colorLegendItems() )
for ( RimFractureModelTemplate* fracDef : fracDefColl->fractureModelTemplates() )
{
options.push_back( caf::PdmOptionItemInfo( item->categoryName(), item->categoryName() ) );
QString displayText = QString( "junk" ); // fracDef->name();
options.push_back( caf::PdmOptionItemInfo( displayText, fracDef ) );
}
}
}
@ -770,7 +732,6 @@ RimAnnotationCollection* RimFractureModel::annotationCollection()
void RimFractureModel::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
{
m_thicknessDirectionWellPath.uiCapability()->setUiHidden( true );
m_elasticProperties.uiCapability()->setUiHidden( false );
m_barrierAnnotation.uiCapability()->setUiHidden( true );
uiOrdering.add( nameField() );
@ -783,31 +744,11 @@ void RimFractureModel::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderin
boundingBoxGroup->add( &m_boundingBoxHorizontal );
boundingBoxGroup->add( &m_boundingBoxVertical );
caf::PdmUiOrdering* defaultsGroup = uiOrdering.addNewGroup( "Defaults" );
defaultsGroup->add( &m_defaultPorosity );
defaultsGroup->add( &m_defaultPermeability );
caf::PdmUiOrdering* referenceStressGroup = uiOrdering.addNewGroup( "Reference Stress" );
referenceStressGroup->add( &m_verticalStress );
referenceStressGroup->add( &m_verticalStressGradient );
referenceStressGroup->add( &m_stressDepth );
caf::PdmUiOrdering* overburdenGroup = uiOrdering.addNewGroup( "Overburden" );
overburdenGroup->add( &m_overburdenHeight );
overburdenGroup->add( &m_overburdenFormation );
overburdenGroup->add( &m_overburdenFacies );
overburdenGroup->add( &m_overburdenPorosity );
overburdenGroup->add( &m_overburdenPermeability );
overburdenGroup->add( &m_overburdenFluidDensity );
caf::PdmUiOrdering* underburdenGroup = uiOrdering.addNewGroup( "Underburden" );
underburdenGroup->add( &m_underburdenHeight );
underburdenGroup->add( &m_underburdenFormation );
underburdenGroup->add( &m_underburdenFacies );
underburdenGroup->add( &m_underburdenPorosity );
underburdenGroup->add( &m_underburdenPermeability );
underburdenGroup->add( &m_underburdenFluidDensity );
caf::PdmUiOrdering* detailedFluidLossGroup = uiOrdering.addNewGroup( "Detailed Fluid Loss" );
detailedFluidLossGroup->add( &m_useDetailedFluidLoss );
detailedFluidLossGroup->add( &m_relativePermeabilityFactorDefault );
@ -946,52 +887,11 @@ double RimFractureModel::calculateFormationDip( const cvf::Vec3d& direction )
return cvf::Math::toDegrees( cvf::GeometryTools::getAngle( direction, -cvf::Vec3d::Z_AXIS ) );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimElasticProperties* RimFractureModel::elasticProperties() const
{
return m_elasticProperties;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModel::setElasticProperties( RimElasticProperties* elasticProperties )
{
m_elasticProperties = elasticProperties;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimFaciesProperties* RimFractureModel::faciesProperties() const
{
return m_faciesProperties;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModel::setFaciesProperties( RimFaciesProperties* faciesProperties )
{
m_faciesProperties = faciesProperties;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModel::loadDataAndUpdate()
{
if ( m_elasticProperties )
{
m_elasticProperties->loadDataAndUpdate();
}
if ( m_faciesProperties )
{
m_faciesProperties->loadDataAndUpdate();
}
}
//--------------------------------------------------------------------------------------------------
@ -1090,7 +990,11 @@ double RimFractureModel::getOverburdenGradient( const QString& keyword ) const
{
if ( keyword == QString( "PRESSURE" ) )
{
return m_overburdenFluidDensity * 9.81 * 1000.0 / 1.0e5;
if ( !m_fractureModelTemplate )
{
return 0.0;
}
return m_fractureModelTemplate()->overburdenFluidDensity() * 9.81 * 1000.0 / 1.0e5;
}
else
{
@ -1106,7 +1010,12 @@ double RimFractureModel::getUnderburdenGradient( const QString& keyword ) const
{
if ( keyword == QString( "PRESSURE" ) )
{
return m_underburdenFluidDensity * 9.81 * 1000.0 / 1.0e5;
if ( !m_fractureModelTemplate )
{
return 0.0;
}
return m_fractureModelTemplate()->underburdenFluidDensity() * 9.81 * 1000.0 / 1.0e5;
}
else
{
@ -1145,9 +1054,9 @@ double RimFractureModel::getDefaultValueForProperty( RiaDefines::CurveProperty c
//--------------------------------------------------------------------------------------------------
bool RimFractureModel::hasDefaultValueForProperty( RiaDefines::CurveProperty curveProperty ) const
{
auto withDefaults = { RiaDefines::CurveProperty::RELATIVE_PERMEABILITY_FACTOR,
RiaDefines::CurveProperty::PORO_ELASTIC_CONSTANT,
RiaDefines::CurveProperty::THERMAL_EXPANSION_COEFFICIENT };
auto withDefaults = {RiaDefines::CurveProperty::RELATIVE_PERMEABILITY_FACTOR,
RiaDefines::CurveProperty::PORO_ELASTIC_CONSTANT,
RiaDefines::CurveProperty::THERMAL_EXPANSION_COEFFICIENT};
return std::find( withDefaults.begin(), withDefaults.end(), curveProperty ) != withDefaults.end();
}
@ -1180,7 +1089,7 @@ double RimFractureModel::stressDepth() const
//--------------------------------------------------------------------------------------------------
double RimFractureModel::overburdenHeight() const
{
return m_overburdenHeight;
return m_fractureModelTemplate() ? m_fractureModelTemplate()->overburdenHeight() : 0.0;
}
//--------------------------------------------------------------------------------------------------
@ -1188,7 +1097,7 @@ double RimFractureModel::overburdenHeight() const
//--------------------------------------------------------------------------------------------------
double RimFractureModel::underburdenHeight() const
{
return m_underburdenHeight;
return m_fractureModelTemplate() ? m_fractureModelTemplate()->underburdenHeight() : 0.0;
}
//--------------------------------------------------------------------------------------------------
@ -1196,7 +1105,7 @@ double RimFractureModel::underburdenHeight() const
//--------------------------------------------------------------------------------------------------
double RimFractureModel::defaultOverburdenPorosity() const
{
return m_overburdenPorosity;
return m_fractureModelTemplate() ? m_fractureModelTemplate()->defaultOverburdenPorosity() : 0.0;
}
//--------------------------------------------------------------------------------------------------
@ -1204,7 +1113,7 @@ double RimFractureModel::defaultOverburdenPorosity() const
//--------------------------------------------------------------------------------------------------
double RimFractureModel::defaultUnderburdenPorosity() const
{
return m_underburdenPorosity;
return m_fractureModelTemplate() ? m_fractureModelTemplate()->defaultUnderburdenPorosity() : 0.0;
}
//--------------------------------------------------------------------------------------------------
@ -1212,7 +1121,7 @@ double RimFractureModel::defaultUnderburdenPorosity() const
//--------------------------------------------------------------------------------------------------
double RimFractureModel::defaultOverburdenPermeability() const
{
return m_overburdenPermeability;
return m_fractureModelTemplate() ? m_fractureModelTemplate()->defaultOverburdenPermeability() : 0.0;
}
//--------------------------------------------------------------------------------------------------
@ -1220,7 +1129,7 @@ double RimFractureModel::defaultOverburdenPermeability() const
//--------------------------------------------------------------------------------------------------
double RimFractureModel::defaultUnderburdenPermeability() const
{
return m_underburdenPermeability;
return m_fractureModelTemplate() ? m_fractureModelTemplate()->defaultUnderburdenPermeability() : 0.0;
}
//--------------------------------------------------------------------------------------------------
@ -1228,7 +1137,7 @@ double RimFractureModel::defaultUnderburdenPermeability() const
//--------------------------------------------------------------------------------------------------
QString RimFractureModel::overburdenFormation() const
{
return m_overburdenFormation;
return m_fractureModelTemplate() ? m_fractureModelTemplate()->overburdenFormation() : "";
}
//--------------------------------------------------------------------------------------------------
@ -1236,7 +1145,7 @@ QString RimFractureModel::overburdenFormation() const
//--------------------------------------------------------------------------------------------------
QString RimFractureModel::overburdenFacies() const
{
return m_overburdenFacies;
return m_fractureModelTemplate() ? m_fractureModelTemplate()->overburdenFacies() : "";
}
//--------------------------------------------------------------------------------------------------
@ -1244,7 +1153,7 @@ QString RimFractureModel::overburdenFacies() const
//--------------------------------------------------------------------------------------------------
QString RimFractureModel::underburdenFormation() const
{
return m_underburdenFormation;
return m_fractureModelTemplate() ? m_fractureModelTemplate()->underburdenFormation() : "";
}
//--------------------------------------------------------------------------------------------------
@ -1252,7 +1161,7 @@ QString RimFractureModel::underburdenFormation() const
//--------------------------------------------------------------------------------------------------
QString RimFractureModel::underburdenFacies() const
{
return m_underburdenFacies;
return m_fractureModelTemplate() ? m_fractureModelTemplate()->underburdenFacies() : "";
}
//--------------------------------------------------------------------------------------------------
@ -1397,3 +1306,19 @@ int RimFractureModel::wellPenetrationLayer() const
{
return m_wellPenetrationLayer;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModel::setFractureModelTemplate( RimFractureModelTemplate* fractureModelTemplate )
{
m_fractureModelTemplate = fractureModelTemplate;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimFractureModelTemplate* RimFractureModel::fractureModelTemplate() const
{
return m_fractureModelTemplate;
}

View File

@ -39,6 +39,7 @@ class RigEclipseCaseData;
class RimAnnotationCollection;
class RimUserDefinedPolylinesAnnotation;
class RimFaciesProperties;
class RimFractureModelTemplate;
//==================================================================================================
///
@ -122,10 +123,10 @@ public:
void loadDataAndUpdate();
RimModeledWellPath* thicknessDirectionWellPath() const;
void setThicknessDirectionWellPath( RimModeledWellPath* thicknessDirectionWellPath );
void setElasticProperties( RimElasticProperties* elasticProperties );
RimElasticProperties* elasticProperties() const;
RimModeledWellPath* thicknessDirectionWellPath() const;
void setThicknessDirectionWellPath( RimModeledWellPath* thicknessDirectionWellPath );
// void setElasticProperties( RimElasticProperties* elasticProperties );
// RimElasticProperties* elasticProperties() const;
double getDefaultValueForProperty( RiaDefines::CurveProperty ) const;
bool hasDefaultValueForProperty( RiaDefines::CurveProperty ) const;
@ -137,8 +138,8 @@ public:
double getOverburdenGradient( const QString& keyword ) const;
double getUnderburdenGradient( const QString& keyword ) const;
void setFaciesProperties( RimFaciesProperties* faciesProperties );
RimFaciesProperties* faciesProperties() const;
void setFractureModelTemplate( RimFractureModelTemplate* fractureModelTemplate );
RimFractureModelTemplate* fractureModelTemplate() const;
void updateReferringPlots();
@ -186,25 +187,11 @@ protected:
caf::PdmField<double> m_boundingBoxVertical;
caf::PdmField<double> m_boundingBoxHorizontal;
caf::PdmPtrField<RimModeledWellPath*> m_thicknessDirectionWellPath;
caf::PdmChildField<RimElasticProperties*> m_elasticProperties;
caf::PdmChildField<RimFaciesProperties*> m_faciesProperties;
caf::PdmField<double> m_defaultPorosity;
caf::PdmField<double> m_defaultPermeability;
caf::PdmField<double> m_verticalStress;
caf::PdmField<double> m_verticalStressGradient;
caf::PdmField<double> m_stressDepth;
caf::PdmField<double> m_overburdenHeight;
caf::PdmField<double> m_overburdenPorosity;
caf::PdmField<double> m_overburdenPermeability;
caf::PdmField<QString> m_overburdenFormation;
caf::PdmField<QString> m_overburdenFacies;
caf::PdmField<double> m_overburdenFluidDensity;
caf::PdmField<double> m_underburdenHeight;
caf::PdmField<double> m_underburdenPorosity;
caf::PdmField<double> m_underburdenPermeability;
caf::PdmField<QString> m_underburdenFormation;
caf::PdmField<QString> m_underburdenFacies;
caf::PdmField<double> m_underburdenFluidDensity;
caf::PdmField<double> m_referenceTemperature;
caf::PdmField<double> m_referenceTemperatureGradient;
caf::PdmField<double> m_referenceTemperatureDepth;
@ -213,6 +200,9 @@ protected:
caf::PdmField<double> m_thermalExpansionCoeffientDefault;
caf::PdmField<bool> m_useDetailedFluidLoss;
caf::PdmPtrField<RimFractureModelTemplate*> m_fractureModelTemplate;
caf::PdmField<bool> m_editFractureModelTemplate;
caf::PdmField<caf::AppEnum<FractureOrientation>> m_fractureOrientation;
caf::PdmField<double> m_perforationLength;

View File

@ -0,0 +1,451 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2020- Equinor ASA
//
// 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.
//
// 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.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimFractureModelTemplate.h"
#include "RiaColorTables.h"
#include "RiaCompletionTypeCalculationScheduler.h"
#include "RiaEclipseUnitTools.h"
#include "RiaFractureDefines.h"
#include "RiaFractureModelDefines.h"
#include "RiaLogging.h"
#include "Riu3DMainWindowTools.h"
#include "RigEclipseCaseData.h"
#include "RigMainGrid.h"
#include "RigWellPath.h"
#include "Rim3dView.h"
#include "RimColorLegend.h"
#include "RimColorLegendCollection.h"
#include "RimColorLegendItem.h"
#include "RimEclipseCase.h"
#include "RimEclipseCellColors.h"
#include "RimEclipseView.h"
#include "RimElasticProperties.h"
#include "RimEllipseFractureTemplate.h"
#include "RimFaciesProperties.h"
#include "RimFractureModelPlot.h"
#include "RimModeledWellPath.h"
#include "RimOilField.h"
#include "RimProject.h"
#include "RimReservoirCellResultsStorage.h"
#include "RimStimPlanColors.h"
#include "RimStimPlanFractureTemplate.h"
#include "RimTools.h"
#include "RimWellPath.h"
#include "RimWellPathCollection.h"
#include "RimWellPathGeometryDef.h"
#include "RimWellPathTarget.h"
#include "cafPdmFieldCvfVec3d.h"
#include "cafPdmFieldScriptingCapabilityCvfVec3d.h"
#include "cafPdmObjectScriptingCapability.h"
#include "cafPdmUiDoubleSliderEditor.h"
#include "cafPdmUiDoubleValueEditor.h"
#include "cafPdmUiPushButtonEditor.h"
#include "cafPdmUiToolButtonEditor.h"
#include "cafPdmUiTreeOrdering.h"
#include "cvfBoundingBox.h"
#include "cvfGeometryTools.h"
#include "cvfMath.h"
#include "cvfMatrix4.h"
#include "cvfPlane.h"
#include <cmath>
CAF_PDM_SOURCE_INIT( RimFractureModelTemplate, "RimFractureModelTemplate" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimFractureModelTemplate::RimFractureModelTemplate()
{
CAF_PDM_InitScriptableObject( "FractureModelTemplate", "", "", "" );
CAF_PDM_InitScriptableField( &m_id, "Id", -1, "Id", "", "", "" );
CAF_PDM_InitScriptableField( &m_defaultPorosity, "DefaultPorosity", 0.0, "Default Porosity", "", "", "" );
CAF_PDM_InitScriptableField( &m_defaultPermeability, "DefaultPermeability", 10.0e-6, "Default Permeability", "", "", "" );
CAF_PDM_InitScriptableField( &m_overburdenHeight, "OverburdenHeight", 50.0, "Overburden Height", "", "", "" );
CAF_PDM_InitScriptableFieldNoDefault( &m_overburdenFormation, "OverburdenFormation", "Overburden Formation", "", "", "" );
CAF_PDM_InitScriptableFieldNoDefault( &m_overburdenFacies, "OverburdenFacies", "Overburden Facies", "", "", "" );
CAF_PDM_InitScriptableField( &m_overburdenPorosity, "OverburdenPorosity", 0.0, "Overburden Porosity", "", "", "" );
CAF_PDM_InitScriptableField( &m_overburdenPermeability,
"OverburdenPermeability",
10.0e-6,
"Overburden Permeability",
"",
"",
"" );
CAF_PDM_InitScriptableField( &m_overburdenFluidDensity,
"OverburdenFluidDensity",
1.03,
"Overburden Fluid Density [g/cm^3]",
"",
"",
"" );
CAF_PDM_InitScriptableField( &m_underburdenHeight, "UnderburdenHeight", 50.0, "Underburden Height", "", "", "" );
CAF_PDM_InitScriptableFieldNoDefault( &m_underburdenFormation, "UnderburdenFormation", "Underburden Formation", "", "", "" );
CAF_PDM_InitScriptableFieldNoDefault( &m_underburdenFacies, "UnderburdenFacies", "Underburden Facies", "", "", "" );
CAF_PDM_InitScriptableField( &m_underburdenPorosity, "UnderburdenPorosity", 0.0, "Underburden Porosity", "", "", "" );
CAF_PDM_InitScriptableField( &m_underburdenPermeability,
"UnderburdenPermeability",
10.0e-6,
"Underburden Permeability",
"",
"",
"" );
CAF_PDM_InitScriptableField( &m_underburdenFluidDensity,
"UnderburdenFluidDensity",
1.03,
"Underburden Fluid Density [g/cm^3]",
"",
"",
"" );
CAF_PDM_InitScriptableFieldNoDefault( &m_elasticProperties, "ElasticProperties", "Elastic Properties", "", "", "" );
m_elasticProperties.uiCapability()->setUiHidden( true );
m_elasticProperties.uiCapability()->setUiTreeHidden( true );
CAF_PDM_InitScriptableFieldNoDefault( &m_faciesProperties, "FaciesProperties", "Facies Properties", "", "", "" );
m_faciesProperties.uiCapability()->setUiHidden( true );
m_faciesProperties.uiCapability()->setUiTreeHidden( true );
setDeletable( true );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimFractureModelTemplate::~RimFractureModelTemplate()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModelTemplate::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue )
{
// {
// RimEclipseCase* eclipseCase = nullptr;
// this->firstAncestorOrThisOfType( eclipseCase );
// if ( eclipseCase )
// {
// RiaCompletionTypeCalculationScheduler::instance()->scheduleRecalculateCompletionTypeAndRedrawAllViews(
// eclipseCase );
// }
// else
// {
// RiaCompletionTypeCalculationScheduler::instance()->scheduleRecalculateCompletionTypeAndRedrawAllViews();
// }
// RimProject::current()->scheduleCreateDisplayModelAndRedrawAllViews();
// updateReferringPlots();
// }
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QList<caf::PdmOptionItemInfo>
RimFractureModelTemplate::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly )
{
QList<caf::PdmOptionItemInfo> options;
if ( fieldNeedingOptions == &m_overburdenFormation || fieldNeedingOptions == &m_underburdenFormation )
{
RigEclipseCaseData* eclipseCaseData = getEclipseCaseData();
if ( !eclipseCaseData ) return options;
std::vector<QString> formationNames = eclipseCaseData->formationNames();
for ( const QString& formationName : formationNames )
{
options.push_back( caf::PdmOptionItemInfo( formationName, formationName ) );
}
}
else if ( fieldNeedingOptions == &m_overburdenFacies || fieldNeedingOptions == &m_underburdenFacies )
{
RimColorLegend* faciesColors =
RimProject::current()->colorLegendCollection()->findByName( RiaDefines::faciesColorLegendName() );
if ( faciesColors )
{
for ( RimColorLegendItem* item : faciesColors->colorLegendItems() )
{
options.push_back( caf::PdmOptionItemInfo( item->categoryName(), item->categoryName() ) );
}
}
}
return options;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModelTemplate::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
{
caf::PdmUiOrdering* defaultsGroup = uiOrdering.addNewGroup( "Defaults" );
defaultsGroup->add( &m_defaultPorosity );
defaultsGroup->add( &m_defaultPermeability );
caf::PdmUiOrdering* overburdenGroup = uiOrdering.addNewGroup( "Overburden" );
overburdenGroup->add( &m_overburdenHeight );
overburdenGroup->add( &m_overburdenFormation );
overburdenGroup->add( &m_overburdenFacies );
overburdenGroup->add( &m_overburdenPorosity );
overburdenGroup->add( &m_overburdenPermeability );
overburdenGroup->add( &m_overburdenFluidDensity );
caf::PdmUiOrdering* underburdenGroup = uiOrdering.addNewGroup( "Underburden" );
underburdenGroup->add( &m_underburdenHeight );
underburdenGroup->add( &m_underburdenFormation );
underburdenGroup->add( &m_underburdenFacies );
underburdenGroup->add( &m_underburdenPorosity );
underburdenGroup->add( &m_underburdenPermeability );
underburdenGroup->add( &m_underburdenFluidDensity );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModelTemplate::setId( int id )
{
m_id = id;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
int RimFractureModelTemplate::id() const
{
return m_id;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimElasticProperties* RimFractureModelTemplate::elasticProperties() const
{
return m_elasticProperties;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModelTemplate::setElasticProperties( RimElasticProperties* elasticProperties )
{
m_elasticProperties = elasticProperties;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimFaciesProperties* RimFractureModelTemplate::faciesProperties() const
{
return m_faciesProperties;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModelTemplate::setFaciesProperties( RimFaciesProperties* faciesProperties )
{
m_faciesProperties = faciesProperties;
if ( m_faciesProperties )
{
RimEclipseCase* eclipseCase = getEclipseCase();
if ( !eclipseCase ) return;
m_faciesProperties->setEclipseCase( eclipseCase );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModelTemplate::initAfterRead()
{
if ( m_faciesProperties )
{
RimEclipseCase* eclipseCase = getEclipseCase();
if ( !eclipseCase ) return;
m_faciesProperties->setEclipseCase( eclipseCase );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModelTemplate::loadDataAndUpdate()
{
if ( m_elasticProperties )
{
m_elasticProperties->loadDataAndUpdate();
}
if ( m_faciesProperties )
{
m_faciesProperties->loadDataAndUpdate();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFractureModelTemplate::defaultPorosity() const
{
return m_defaultPorosity();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFractureModelTemplate::defaultPermeability() const
{
return m_defaultPermeability();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFractureModelTemplate::overburdenFluidDensity() const
{
return m_overburdenFluidDensity;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFractureModelTemplate::underburdenFluidDensity() const
{
return m_underburdenFluidDensity;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFractureModelTemplate::overburdenHeight() const
{
return m_overburdenHeight;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFractureModelTemplate::underburdenHeight() const
{
return m_underburdenHeight;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFractureModelTemplate::defaultOverburdenPorosity() const
{
return m_overburdenPorosity;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFractureModelTemplate::defaultUnderburdenPorosity() const
{
return m_underburdenPorosity;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFractureModelTemplate::defaultOverburdenPermeability() const
{
return m_overburdenPermeability;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFractureModelTemplate::defaultUnderburdenPermeability() const
{
return m_underburdenPermeability;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimFractureModelTemplate::overburdenFormation() const
{
return m_overburdenFormation;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimFractureModelTemplate::overburdenFacies() const
{
return m_overburdenFacies;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimFractureModelTemplate::underburdenFormation() const
{
return m_underburdenFormation;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimFractureModelTemplate::underburdenFacies() const
{
return m_underburdenFacies;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimEclipseCase* RimFractureModelTemplate::getEclipseCase()
{
// Find an eclipse case
RimProject* proj = RimProject::current();
if ( proj->eclipseCases().empty() ) return nullptr;
return proj->eclipseCases()[0];
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RigEclipseCaseData* RimFractureModelTemplate::getEclipseCaseData()
{
// Find an eclipse case
RimEclipseCase* eclipseCase = getEclipseCase();
if ( !eclipseCase ) return nullptr;
return eclipseCase->eclipseCaseData();
}

View File

@ -0,0 +1,110 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2020- Equinor ASA
//
// 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.
//
// 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.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RiaEclipseUnitTools.h"
#include "RiaFractureModelDefines.h"
#include "cafPdmChildField.h"
#include "cafPdmField.h"
#include "cafPdmObject.h"
#include "cafPdmProxyValueField.h"
#include "cafPdmPtrField.h"
class RimEclipseCase;
class RimElasticProperties;
class RigEclipseCaseData;
class RimFaciesProperties;
//==================================================================================================
///
///
//==================================================================================================
class RimFractureModelTemplate : public caf::PdmObject
{
CAF_PDM_HEADER_INIT;
public:
RimFractureModelTemplate( void );
~RimFractureModelTemplate( void ) override;
void setId( int id );
int id() const;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
double defaultPorosity() const;
double defaultPermeability() const;
double overburdenHeight() const;
double underburdenHeight() const;
double defaultOverburdenPorosity() const;
double defaultUnderburdenPorosity() const;
double defaultOverburdenPermeability() const;
double defaultUnderburdenPermeability() const;
QString overburdenFormation() const;
QString overburdenFacies() const;
QString underburdenFormation() const;
QString underburdenFacies() const;
double overburdenFluidDensity() const;
double underburdenFluidDensity() const;
void loadDataAndUpdate();
void setElasticProperties( RimElasticProperties* elasticProperties );
RimElasticProperties* elasticProperties() const;
void setFaciesProperties( RimFaciesProperties* faciesProperties );
RimFaciesProperties* faciesProperties() const;
void updateReferringPlots();
protected:
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
bool* useOptionsOnly ) override;
void initAfterRead() override;
static RimEclipseCase* getEclipseCase();
static RigEclipseCaseData* getEclipseCaseData();
protected:
caf::PdmField<int> m_id;
caf::PdmField<double> m_defaultPorosity;
caf::PdmField<double> m_defaultPermeability;
caf::PdmField<double> m_overburdenHeight;
caf::PdmField<double> m_overburdenPorosity;
caf::PdmField<double> m_overburdenPermeability;
caf::PdmField<QString> m_overburdenFormation;
caf::PdmField<QString> m_overburdenFacies;
caf::PdmField<double> m_overburdenFluidDensity;
caf::PdmField<double> m_underburdenHeight;
caf::PdmField<double> m_underburdenPorosity;
caf::PdmField<double> m_underburdenPermeability;
caf::PdmField<QString> m_underburdenFormation;
caf::PdmField<QString> m_underburdenFacies;
caf::PdmField<double> m_underburdenFluidDensity;
caf::PdmChildField<RimElasticProperties*> m_elasticProperties;
caf::PdmChildField<RimFaciesProperties*> m_faciesProperties;
};

View File

@ -0,0 +1,144 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2020- Equinor ASA
//
// 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.
//
// 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.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimFractureModelTemplateCollection.h"
#include "RimCase.h"
#include "RimEclipseCase.h"
#include "RimEclipseView.h"
#include "RimFracture.h"
#include "RimFractureModelTemplate.h"
#include "RimProject.h"
#include "cafPdmObject.h"
CAF_PDM_SOURCE_INIT( RimFractureModelTemplateCollection, "FractureModelTemplateCollection" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimFractureModelTemplateCollection::RimFractureModelTemplateCollection()
{
CAF_PDM_InitObject( "Fracture Model Templates", ":/FractureTemplates16x16.png", "", "" );
CAF_PDM_InitFieldNoDefault( &m_fractureModelTemplates, "FractureDefinitions", "", "", "", "" );
m_fractureModelTemplates.uiCapability()->setUiHidden( true );
CAF_PDM_InitField( &m_nextValidId, "NextValidId", 0, "", "", "", "" );
m_nextValidId.uiCapability()->setUiHidden( true );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimFractureModelTemplateCollection::~RimFractureModelTemplateCollection()
{
m_fractureModelTemplates.deleteAllChildObjects();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimFractureModelTemplate* RimFractureModelTemplateCollection::fractureModelTemplate( int id ) const
{
for ( const auto& templ : m_fractureModelTemplates )
{
if ( templ->id() == id ) return templ;
}
return nullptr;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimFractureModelTemplate*> RimFractureModelTemplateCollection::fractureModelTemplates() const
{
std::vector<RimFractureModelTemplate*> templates;
for ( auto& templ : m_fractureModelTemplates )
{
templates.push_back( templ );
}
return templates;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModelTemplateCollection::addFractureModelTemplate( RimFractureModelTemplate* templ )
{
templ->setId( nextFractureTemplateId() );
m_fractureModelTemplates.push_back( templ );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModelTemplateCollection::loadAndUpdateData()
{
for ( RimFractureModelTemplate* f : m_fractureModelTemplates() )
{
f->loadDataAndUpdate();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModelTemplateCollection::initAfterRead()
{
// Assign template id if not already assigned
for ( auto& templ : m_fractureModelTemplates )
{
if ( templ->id() < 0 ) templ->setId( nextFractureTemplateId() );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
int RimFractureModelTemplateCollection::nextFractureTemplateId()
{
int newId = m_nextValidId;
m_nextValidId = m_nextValidId + 1;
return newId;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModelTemplateCollection::onChildDeleted( caf::PdmChildArrayFieldHandle* childArray,
std::vector<caf::PdmObjectHandle*>& referringObjects )
{
RimProject* proj = nullptr;
firstAncestorOrThisOfType( proj );
if ( proj )
{
proj->scheduleCreateDisplayModelAndRedrawAllViews();
}
std::vector<Rim3dView*> views;
proj->allVisibleViews( views );
for ( Rim3dView* visibleView : views )
{
if ( dynamic_cast<RimEclipseView*>( visibleView ) )
{
visibleView->updateConnectedEditors();
}
}
}

View File

@ -0,0 +1,56 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2020- Equinor ASA
//
// 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.
//
// 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.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cafPdmChildArrayField.h"
#include "cafPdmField.h"
#include "cafPdmObject.h"
class RimFractureModelTemplate;
//==================================================================================================
///
///
//==================================================================================================
class RimFractureModelTemplateCollection : public caf::PdmObject
{
CAF_PDM_HEADER_INIT;
public:
RimFractureModelTemplateCollection();
~RimFractureModelTemplateCollection() override;
RimFractureModelTemplate* fractureModelTemplate( int id ) const;
std::vector<RimFractureModelTemplate*> fractureModelTemplates() const;
void addFractureModelTemplate( RimFractureModelTemplate* templ );
void loadAndUpdateData();
void onChildDeleted( caf::PdmChildArrayFieldHandle* childArray,
std::vector<caf::PdmObjectHandle*>& referringObjects ) override;
protected:
void initAfterRead() override;
private:
int nextFractureTemplateId();
caf::PdmChildArrayField<RimFractureModelTemplate*> m_fractureModelTemplates;
caf::PdmField<int> m_nextValidId; // Unique fracture template ID within a project
};

View File

@ -73,6 +73,8 @@
#include "RimFractureModel.h"
#include "RimFractureModelCollection.h"
#include "RimFractureModelPlot.h"
#include "RimFractureModelTemplate.h"
#include "RimFractureModelTemplateCollection.h"
#include "RimFractureTemplate.h"
#include "RimFractureTemplateCollection.h"
#include "RimGeoMechCase.h"
@ -442,8 +444,6 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
{
menuBuilder << "RicNewFractureModelFeature";
menuBuilder << "RicNewFractureModelPlotFeature";
menuBuilder << "RicImportFaciesFeature";
menuBuilder << "RicImportElasticPropertiesFeature";
}
}
else if ( dynamic_cast<RimFractureModelCollection*>( firstUiItem ) )
@ -886,6 +886,15 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
{
menuBuilder << "RicDeleteValveTemplateFeature";
}
else if ( dynamic_cast<RimFractureModelTemplate*>( firstUiItem ) )
{
menuBuilder << "RicImportFaciesFeature";
menuBuilder << "RicImportElasticPropertiesFeature";
}
else if ( dynamic_cast<RimFractureModelTemplateCollection*>( firstUiItem ) )
{
menuBuilder << "RicNewFractureModelTemplateFeature";
}
else if ( dynamic_cast<RimFractureTemplateCollection*>( firstUiItem ) )
{
menuBuilder << "RicPasteEllipseFractureFeature";

View File

@ -18,7 +18,7 @@
#include "RimElasticProperties.h"
#include "RimFractureModel.h"
#include "RimFractureModelTemplate.h"
#include "RicElasticPropertiesImportTools.h"
@ -213,8 +213,8 @@ void RimElasticProperties::loadDataAndUpdate()
{
if ( !m_filePath().path().isEmpty() )
{
RimFractureModel* fractureModel;
firstAncestorOrThisOfType( fractureModel );
RicElasticPropertiesImportTools::importElasticPropertiesFromFile( m_filePath().path(), fractureModel );
RimFractureModelTemplate* fractureModelTemplate;
firstAncestorOrThisOfType( fractureModelTemplate );
RicElasticPropertiesImportTools::importElasticPropertiesFromFile( m_filePath().path(), fractureModelTemplate );
}
}

View File

@ -34,6 +34,7 @@
#include "RimElasticProperties.h"
#include "RimFractureModel.h"
#include "RimFractureModelPlot.h"
#include "RimFractureModelTemplate.h"
#include "RimModeledWellPath.h"
#include "RimProject.h"
#include "RimTools.h"
@ -212,7 +213,14 @@ void RimElasticPropertiesCurve::performDataExtraction( bool* isUsingPseudoLength
return;
}
RimElasticProperties* elasticProperties = m_fractureModel->elasticProperties();
RimFractureModelTemplate* fractureModelTemplate = m_fractureModel->fractureModelTemplate();
if ( !fractureModelTemplate )
{
RiaLogging::error( QString( "No fracture model template found" ) );
return;
}
RimElasticProperties* elasticProperties = fractureModelTemplate->elasticProperties();
if ( !elasticProperties )
{
RiaLogging::error( QString( "No elastic properties found" ) );

View File

@ -19,8 +19,10 @@
#include "RimFaciesProperties.h"
#include "RimColorLegend.h"
#include "RimColorLegendCollection.h"
#include "RimEclipseResultDefinition.h"
#include "RimFractureModel.h"
#include "RimFractureModelTemplate.h"
#include "RimProject.h"
#include "RimRegularLegendConfig.h"
#include "RicFaciesPropertiesImportTools.h"
@ -93,6 +95,28 @@ void RimFaciesProperties::setFaciesCodeName( int code, const QString& name )
m_propertiesTable = generatePropertiesTable();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QList<caf::PdmOptionItemInfo> RimFaciesProperties::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
bool* useOptionsOnly )
{
QList<caf::PdmOptionItemInfo> options;
if ( fieldNeedingOptions == &m_colorLegend )
{
RimProject* project = RimProject::current();
RimColorLegendCollection* colorLegendCollection = project->colorLegendCollection();
std::vector<RimColorLegend*> colorLegends = colorLegendCollection->allColorLegends();
for ( RimColorLegend* colorLegend : colorLegends )
{
options.push_back( caf::PdmOptionItemInfo( colorLegend->colorLegendName(), colorLegend ) );
}
}
return options;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -165,8 +189,16 @@ void RimFaciesProperties::loadDataAndUpdate()
{
if ( !m_filePath().path().isEmpty() )
{
RimFractureModel* fractureModel;
firstAncestorOrThisOfType( fractureModel );
RicFaciesPropertiesImportTools::importFaciesPropertiesFromFile( m_filePath().path(), fractureModel );
RimFractureModelTemplate* fractureModelTemplate;
firstAncestorOrThisOfType( fractureModelTemplate );
RicFaciesPropertiesImportTools::importFaciesPropertiesFromFile( m_filePath().path(), fractureModelTemplate );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFaciesProperties::setEclipseCase( RimEclipseCase* eclipseCase )
{
m_faciesDefinition->setEclipseCase( eclipseCase );
}

View File

@ -28,6 +28,7 @@
class RimEclipseResultDefinition;
class RimColorLegend;
class RimEclipseCase;
//==================================================================================================
///
@ -45,13 +46,17 @@ public:
void setFaciesCodeName( int code, const QString& name );
void setEclipseCase( RimEclipseCase* eclipseCase );
void loadDataAndUpdate();
protected:
void defineEditorAttribute( const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute ) override;
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
void defineEditorAttribute( const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute ) override;
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
bool* useOptionsOnly ) override;
private:
QString generatePropertiesTable();

View File

@ -69,7 +69,9 @@ caf::PdmObjectHandle* RimcFractureModelCollection_newFractureModel::execute()
{
newFractureModel->setMD( m_md() );
RicElasticPropertiesImportTools::importElasticPropertiesFromFile( m_elasticPropertiesFilePath, newFractureModel );
// TODO: fix this!!!
// RicElasticPropertiesImportTools::importElasticPropertiesFromFile( m_elasticPropertiesFilePath,
// newFractureModel );
self<RimFractureModelCollection>()->updateAllRequiredEditors();
}