mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#6495 Fracture Model: add facies properties.
This commit is contained in:
@@ -166,6 +166,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimLayerCurve.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimFractureModelStressCurve.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimAbstractPlotCollection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimFractureModelPropertyCurve.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimFaciesProperties.h
|
||||
)
|
||||
|
||||
|
||||
@@ -334,6 +335,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimElasticProperties.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimElasticPropertiesCurve.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimLayerCurve.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimFractureModelStressCurve.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimFaciesProperties.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
|
||||
@@ -39,6 +39,8 @@
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimElasticProperties.h"
|
||||
#include "RimEllipseFractureTemplate.h"
|
||||
#include "RimFaciesProperties.h"
|
||||
#include "RimFractureModelPlot.h"
|
||||
#include "RimModeledWellPath.h"
|
||||
#include "RimOilField.h"
|
||||
@@ -68,7 +70,7 @@
|
||||
|
||||
#include <cmath>
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RimFractureModel, "RimFractureModel" );
|
||||
CAF_PDM_SOURCE_INIT( RimFractureModel, "RimFractureModel" );
|
||||
|
||||
namespace caf
|
||||
{
|
||||
@@ -249,6 +251,9 @@ RimFractureModel::RimFractureModel()
|
||||
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 );
|
||||
}
|
||||
@@ -957,6 +962,22 @@ void RimFractureModel::setElasticProperties( RimElasticProperties* elasticProper
|
||||
m_elasticProperties = elasticProperties;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimFaciesProperties* RimFractureModel::faciesProperties() const
|
||||
{
|
||||
return m_faciesProperties;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFractureModel::setFaciesProperties( RimFaciesProperties* faciesProperties )
|
||||
{
|
||||
m_faciesProperties = faciesProperties;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -966,6 +987,11 @@ void RimFractureModel::loadDataAndUpdate()
|
||||
{
|
||||
m_elasticProperties->loadDataAndUpdate();
|
||||
}
|
||||
|
||||
if ( m_faciesProperties )
|
||||
{
|
||||
m_faciesProperties->loadDataAndUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1119,9 +1145,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();
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ class RimElasticProperties;
|
||||
class RigEclipseCaseData;
|
||||
class RimAnnotationCollection;
|
||||
class RimUserDefinedPolylinesAnnotation;
|
||||
class RimFaciesProperties;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
@@ -136,6 +137,9 @@ public:
|
||||
double getOverburdenGradient( const QString& keyword ) const;
|
||||
double getUnderburdenGradient( const QString& keyword ) const;
|
||||
|
||||
void setFaciesProperties( RimFaciesProperties* faciesProperties );
|
||||
RimFaciesProperties* faciesProperties() const;
|
||||
|
||||
void updateReferringPlots();
|
||||
|
||||
protected:
|
||||
@@ -183,6 +187,7 @@ protected:
|
||||
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;
|
||||
|
||||
172
ApplicationCode/ProjectDataModel/RimFaciesProperties.cpp
Normal file
172
ApplicationCode/ProjectDataModel/RimFaciesProperties.cpp
Normal file
@@ -0,0 +1,172 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "RimFaciesProperties.h"
|
||||
|
||||
#include "RimColorLegend.h"
|
||||
#include "RimEclipseResultDefinition.h"
|
||||
#include "RimFractureModel.h"
|
||||
#include "RimRegularLegendConfig.h"
|
||||
|
||||
#include "RicFaciesPropertiesImportTools.h"
|
||||
|
||||
#include "cafPdmFieldScriptingCapability.h"
|
||||
#include "cafPdmObjectScriptingCapability.h"
|
||||
#include "cafPdmUiLineEditor.h"
|
||||
#include "cafPdmUiTextEditor.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RimFaciesProperties, "FaciesProperties" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimFaciesProperties::RimFaciesProperties()
|
||||
{
|
||||
CAF_PDM_InitScriptableObject( "RimFaciesProperties", "", "", "" );
|
||||
|
||||
CAF_PDM_InitScriptableFieldNoDefault( &m_filePath, "FilePath", "File Path", "", "", "" );
|
||||
m_filePath.uiCapability()->setUiReadOnly( true );
|
||||
m_filePath.uiCapability()->setUiEditorTypeName( caf::PdmUiLineEditor::uiEditorTypeName() );
|
||||
|
||||
CAF_PDM_InitScriptableFieldNoDefault( &m_propertiesTable, "PropertiesTable", "Properties Table", "", "", "" );
|
||||
m_propertiesTable.uiCapability()->setUiEditorTypeName( caf::PdmUiTextEditor::uiEditorTypeName() );
|
||||
m_propertiesTable.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN );
|
||||
m_propertiesTable.uiCapability()->setUiReadOnly( true );
|
||||
m_propertiesTable.xmlCapability()->disableIO();
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_faciesDefinition, "FaciesDefinition", "", "", "", "" );
|
||||
m_faciesDefinition.uiCapability()->setUiHidden( true );
|
||||
m_faciesDefinition.uiCapability()->setUiTreeChildrenHidden( true );
|
||||
m_faciesDefinition = new RimEclipseResultDefinition;
|
||||
m_faciesDefinition->findField( "MResultType" )->uiCapability()->setUiName( "Facies Definiton" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_colorLegend, "ColorLegend", "Colors", "", "", "" );
|
||||
m_colorLegend = RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::ColorRangesType::NORMAL );
|
||||
|
||||
setUiName( "Facies Properties" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimFaciesProperties::~RimFaciesProperties()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimFaciesProperties::filePath() const
|
||||
{
|
||||
return m_filePath.v().path();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFaciesProperties::setFilePath( const QString& filePath )
|
||||
{
|
||||
m_filePath = filePath;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFaciesProperties::setFaciesCodeName( int code, const QString& name )
|
||||
{
|
||||
m_faciesCodeNames[code] = name;
|
||||
m_propertiesTable = generatePropertiesTable();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFaciesProperties::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
||||
{
|
||||
uiOrdering.add( &m_filePath );
|
||||
uiOrdering.add( &m_propertiesTable );
|
||||
uiOrdering.add( &m_colorLegend );
|
||||
|
||||
caf::PdmUiGroup* faciesDefinitionGroup = uiOrdering.addNewGroup( "Facies Definition" );
|
||||
m_faciesDefinition->uiOrdering( uiConfigName, *faciesDefinitionGroup );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFaciesProperties::defineEditorAttribute( const caf::PdmFieldHandle* field,
|
||||
QString uiConfigName,
|
||||
caf::PdmUiEditorAttribute* attribute )
|
||||
{
|
||||
if ( field == &m_propertiesTable )
|
||||
{
|
||||
auto myAttr = dynamic_cast<caf::PdmUiTextEditorAttribute*>( attribute );
|
||||
if ( myAttr )
|
||||
{
|
||||
myAttr->wrapMode = caf::PdmUiTextEditorAttribute::NoWrap;
|
||||
myAttr->textMode = caf::PdmUiTextEditorAttribute::HTML;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimFaciesProperties::generatePropertiesTable()
|
||||
{
|
||||
QString header( "<table border=1>"
|
||||
" <thead>"
|
||||
" <tr bgcolor=lightblue>"
|
||||
" <th>Name</th>"
|
||||
" <th>Index</th>"
|
||||
" </tr>"
|
||||
" </thead>"
|
||||
" <tbody>" );
|
||||
|
||||
QString body;
|
||||
for ( auto prop : m_faciesCodeNames )
|
||||
{
|
||||
int index = prop.first;
|
||||
const QString& name = prop.second;
|
||||
|
||||
QString format( "<tr>"
|
||||
" <td>%1</td>"
|
||||
" <td>%2</td>"
|
||||
"</tr>" );
|
||||
|
||||
QString line = format.arg( name ).arg( index );
|
||||
body.append( line );
|
||||
}
|
||||
|
||||
QString footer( "</tbody></table>" );
|
||||
|
||||
return header + body + footer;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFaciesProperties::loadDataAndUpdate()
|
||||
{
|
||||
if ( !m_filePath().path().isEmpty() )
|
||||
{
|
||||
RimFractureModel* fractureModel;
|
||||
firstAncestorOrThisOfType( fractureModel );
|
||||
RicFaciesPropertiesImportTools::importFaciesPropertiesFromFile( m_filePath().path(), fractureModel );
|
||||
}
|
||||
}
|
||||
65
ApplicationCode/ProjectDataModel/RimFaciesProperties.h
Normal file
65
ApplicationCode/ProjectDataModel/RimFaciesProperties.h
Normal file
@@ -0,0 +1,65 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "cafFilePath.h"
|
||||
#include "cafPdmChildField.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmPtrField.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
class RimEclipseResultDefinition;
|
||||
class RimColorLegend;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimFaciesProperties : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
RimFaciesProperties();
|
||||
~RimFaciesProperties() override;
|
||||
|
||||
QString filePath() const;
|
||||
void setFilePath( const QString& filePath );
|
||||
|
||||
void setFaciesCodeName( int code, const QString& name );
|
||||
|
||||
void loadDataAndUpdate();
|
||||
|
||||
protected:
|
||||
void defineEditorAttribute( const caf::PdmFieldHandle* field,
|
||||
QString uiConfigName,
|
||||
caf::PdmUiEditorAttribute* attribute ) override;
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
|
||||
|
||||
private:
|
||||
QString generatePropertiesTable();
|
||||
|
||||
caf::PdmField<caf::FilePath> m_filePath;
|
||||
caf::PdmField<QString> m_propertiesTable;
|
||||
caf::PdmChildField<RimEclipseResultDefinition*> m_faciesDefinition;
|
||||
caf::PdmPtrField<RimColorLegend*> m_colorLegend;
|
||||
|
||||
std::map<int, QString> m_faciesCodeNames;
|
||||
};
|
||||
Reference in New Issue
Block a user