mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-11 16:06:04 -06:00
#6232 Add python api for exporting fracture model plot to frk file.
This commit is contained in:
parent
22759b201d
commit
307639a7d1
@ -15,8 +15,14 @@ measured_depth = 4100.0
|
||||
elastic_properties_file_path = "/home/resinsight/stimplan/complete_dataset_2020-06-22/Elastic_Template_CSV_file-with-biot.csv"
|
||||
fracture_model = fracture_model_collection.new_fracture_model(well_path=well_path, measured_depth=measured_depth, elastic_properties_file_path=elastic_properties_file_path)
|
||||
|
||||
fracture_model.overburden_formation = "Garn"
|
||||
fracture_model.overburden_facies = "Shale"
|
||||
fracture_model.underburden_formation = "Garn"
|
||||
fracture_model.underburden_facies = "Shale"
|
||||
fracture_model.overburden_height = 68
|
||||
fracture_model.update()
|
||||
|
||||
|
||||
print("Overburden: ", fracture_model.overburden_formation)
|
||||
|
||||
|
||||
cases = resinsight.project.cases()
|
||||
@ -30,3 +36,5 @@ time_step = time_steps[len(time_steps) - 1]
|
||||
fracture_model_plot_collection = project.descendants(rips.FractureModelPlotCollection)[0]
|
||||
fracture_model_plot = fracture_model_plot_collection.new_fracture_model_plot(eclipse_case=case, fracture_model=fracture_model, time_step=time_step)
|
||||
|
||||
file_path = "/tmp/Geological.frk"
|
||||
fracture_model_plot.export_to_file(file_path=file_path)
|
||||
|
@ -87,15 +87,15 @@ RimFractureModel::RimFractureModel()
|
||||
{
|
||||
CAF_PDM_InitScriptableObject( "FractureModel", "", "", "" );
|
||||
|
||||
CAF_PDM_InitScriptableField( &m_MD, "MD", 0.0, "MD", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_MD, "MD", 0.0, "MD", "", "", "" );
|
||||
|
||||
CAF_PDM_InitScriptableField( &m_extractionType,
|
||||
"ExtractionType",
|
||||
caf::AppEnum<ExtractionType>( ExtractionType::TRUE_STRATIGRAPHIC_THICKNESS ),
|
||||
"Extraction Type",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_extractionType,
|
||||
"ExtractionType",
|
||||
caf::AppEnum<ExtractionType>( ExtractionType::TRUE_STRATIGRAPHIC_THICKNESS ),
|
||||
"Extraction Type",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
|
||||
CAF_PDM_InitScriptableFieldNoDefault( &m_anchorPosition, "AnchorPosition", "Anchor Position", "", "", "" );
|
||||
m_anchorPosition.uiCapability()->setUiReadOnly( true );
|
||||
@ -110,62 +110,78 @@ RimFractureModel::RimFractureModel()
|
||||
"",
|
||||
"" );
|
||||
|
||||
CAF_PDM_InitScriptableField( &m_boundingBoxHorizontal, "BoundingBoxHorizontal", 50.0, "Bounding Box Horizontal", "", "", "" );
|
||||
CAF_PDM_InitScriptableField( &m_boundingBoxVertical, "BoundingBoxVertical", 100.0, "Bounding Box Vertical", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_boundingBoxHorizontal,
|
||||
"BoundingBoxHorizontal",
|
||||
50.0,
|
||||
"Bounding Box Horizontal",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_boundingBoxVertical, "BoundingBoxVertical", 100.0, "Bounding Box Vertical", "", "", "" );
|
||||
|
||||
CAF_PDM_InitScriptableField( &m_defaultPorosity, "DefaultPorosity", 0.0, "Default Porosity", "", "", "" );
|
||||
CAF_PDM_InitScriptableField( &m_defaultPermeability, "DefaultPermeability", 10.0e-6, "Default Permeability", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_defaultPorosity, "DefaultPorosity", 0.0, "Default Porosity", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_defaultPermeability, "DefaultPermeability", 10.0e-6, "Default Permeability", "", "", "" );
|
||||
|
||||
// Stress unit: bar
|
||||
// Stress gradient unit: bar/m
|
||||
// Depth is meter
|
||||
CAF_PDM_InitScriptableField( &m_verticalStress, "VerticalStress", 879.0, "Vertical Stress", "", "", "" );
|
||||
CAF_PDM_InitScriptableField( &m_verticalStressGradient,
|
||||
"VerticalStressGradient",
|
||||
0.238,
|
||||
"Vertical Stress Gradient",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
CAF_PDM_InitScriptableField( &m_stressDepth, "StressDepth", 1000.0, "Stress Depth", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_verticalStress, "VerticalStress", 879.0, "Vertical Stress", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_verticalStressGradient,
|
||||
"VerticalStressGradient",
|
||||
0.238,
|
||||
"Vertical Stress Gradient",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_stressDepth, "StressDepth", 1000.0, "Stress Depth", "", "", "" );
|
||||
|
||||
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_InitScriptableFieldWithIO( &m_overburdenHeight, "OverburdenHeight", 50.0, "Overburden Height", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIONoDefault( &m_overburdenFormation,
|
||||
"OverburdenFormation",
|
||||
"Overburden Formation",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
CAF_PDM_InitScriptableFieldWithIONoDefault( &m_overburdenFacies, "OverburdenFacies", "Overburden Facies", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_overburdenPorosity, "OverburdenPorosity", 0.0, "Overburden Porosity", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_overburdenPermeability,
|
||||
"OverburdenPermeability",
|
||||
10.0e-6,
|
||||
"Overburden Permeability",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &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_InitScriptableFieldWithIO( &m_underburdenHeight, "UnderburdenHeight", 50.0, "Underburden Height", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIONoDefault( &m_underburdenFormation,
|
||||
"UnderburdenFormation",
|
||||
"Underburden Formation",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
CAF_PDM_InitScriptableFieldWithIONoDefault( &m_underburdenFacies, "UnderburdenFacies", "Underburden Facies", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_underburdenPorosity, "UnderburdenPorosity", 0.0, "Underburden Porosity", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_underburdenPermeability,
|
||||
"UnderburdenPermeability",
|
||||
10.0e-6,
|
||||
"Underburden Permeability",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
CAF_PDM_InitScriptableFieldWithIO( &m_underburdenFluidDensity,
|
||||
"UnderburdenFluidDensity",
|
||||
1.03,
|
||||
"Underburden Fluid Density [g/cm^3]",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
|
||||
CAF_PDM_InitScriptableFieldNoDefault( &m_elasticProperties, "ElasticProperties", "Elastic Properties", "", "", "" );
|
||||
m_elasticProperties.uiCapability()->setUiHidden( true );
|
||||
|
@ -6,6 +6,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimcSummaryResampleData.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimcProject.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimcFractureModelCollection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimcFractureModelPlotCollection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimcFractureModelPlot.h
|
||||
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimcDataContainerDouble.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimcDataContainerString.h
|
||||
@ -19,6 +20,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimcSummaryResampleData.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimcProject.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimcFractureModelCollection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimcFractureModelPlotCollection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimcFractureModelPlot.cpp
|
||||
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimcDataContainerDouble.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimcDataContainerString.cpp
|
||||
|
@ -0,0 +1,74 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "RimcFractureModelPlot.h"
|
||||
|
||||
#include "RifFractureModelPlotExporter.h"
|
||||
|
||||
#include "RimFractureModel.h"
|
||||
#include "RimFractureModelPlot.h"
|
||||
|
||||
#include "cafPdmFieldIOScriptability.h"
|
||||
#include "cafPdmFieldScriptability.h"
|
||||
|
||||
CAF_PDM_OBJECT_METHOD_SOURCE_INIT( RimFractureModelPlot, RimcFractureModelPlot_exportToFile, "ExportToFile" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimcFractureModelPlot_exportToFile::RimcFractureModelPlot_exportToFile( caf::PdmObjectHandle* self )
|
||||
: caf::PdmObjectMethod( self )
|
||||
{
|
||||
CAF_PDM_InitObject( "Export Fracture Model Plot", "", "", "Export Fracture Model Plot to File" );
|
||||
CAF_PDM_InitScriptableFieldWithIONoDefault( &m_filePath, "FilePath", "", "", "", "File Path" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmObjectHandle* RimcFractureModelPlot_exportToFile::execute()
|
||||
{
|
||||
RimFractureModelPlot* fractureModelPlot = self<RimFractureModelPlot>();
|
||||
|
||||
RifFractureModelPlotExporter::writeToFile( fractureModelPlot, m_filePath() );
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimcFractureModelPlot_exportToFile::resultIsPersistent() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::unique_ptr<caf::PdmObjectHandle> RimcFractureModelPlot_exportToFile::defaultResult() const
|
||||
{
|
||||
return std::unique_ptr<caf::PdmObjectHandle>( new RimFractureModelPlot );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimcFractureModelPlot_exportToFile::isNullptrValidResult() const
|
||||
{
|
||||
return true;
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "RimFractureModelPlot.h"
|
||||
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObjectHandle.h"
|
||||
#include "cafPdmObjectMethod.h"
|
||||
#include "cafPdmPtrArrayField.h"
|
||||
#include "cafPdmPtrField.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
class RimFractureModelPlot;
|
||||
class RimWellPath;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimcFractureModelPlot_exportToFile : public caf::PdmObjectMethod
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
RimcFractureModelPlot_exportToFile( caf::PdmObjectHandle* self );
|
||||
|
||||
caf::PdmObjectHandle* execute();
|
||||
bool resultIsPersistent() const override;
|
||||
std::unique_ptr<PdmObjectHandle> defaultResult() const override;
|
||||
bool isNullptrValidResult() const override;
|
||||
|
||||
private:
|
||||
caf::PdmField<QString> m_filePath;
|
||||
};
|
Loading…
Reference in New Issue
Block a user