mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#6424 Fracture Model: Export Perfs.frk file.
This commit is contained in:
parent
1b0a5d85f0
commit
85ba3a3bc9
@ -57,6 +57,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RifElasticPropertiesReader.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RifFractureModelPlotExporter.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RifFractureModelGeologicalFrkExporter.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RifFractureModelDeviationFrkExporter.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RifFractureModelPerfsFrkExporter.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RifSurfaceExporter.h
|
||||
|
||||
|
||||
@ -120,6 +121,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RifElasticPropertiesReader.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RifFractureModelPlotExporter.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RifFractureModelGeologicalFrkExporter.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RifFractureModelDeviationFrkExporter.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RifFractureModelPerfsFrkExporter.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RifSurfaceExporter.cpp
|
||||
|
||||
# HDF5 file reader is directly included in ResInsight main CmakeList.txt
|
||||
|
@ -0,0 +1,163 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "RifFractureModelPerfsFrkExporter.h"
|
||||
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include "RimFractureModel.h"
|
||||
#include "RimFractureModelPlot.h"
|
||||
#include "RimWellPath.h"
|
||||
|
||||
#include "RigWellPath.h"
|
||||
#include "RigWellPathGeometryTools.h"
|
||||
|
||||
#include <QFile>
|
||||
#include <QTextStream>
|
||||
|
||||
#include <vector>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RifFractureModelPerfsFrkExporter::writeToFile( RimFractureModelPlot* plot, const QString& filepath )
|
||||
{
|
||||
RimFractureModel* fractureModel = plot->fractureModel();
|
||||
if ( !fractureModel )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
RimWellPath* wellPath = fractureModel->wellPath();
|
||||
if ( !wellPath )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
QFile data( filepath );
|
||||
if ( !data.open( QFile::WriteOnly | QFile::Truncate ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
QTextStream stream( &data );
|
||||
appendHeaderToStream( stream );
|
||||
|
||||
bool isTransverse = fractureModel->fractureOrientation() == RimFractureModel::FractureOrientation::TRANSVERSE_WELL_PATH;
|
||||
appendFractureOrientationToStream( stream, isTransverse );
|
||||
|
||||
// Unit: meter
|
||||
double perforationLength = fractureModel->perforationLength();
|
||||
|
||||
double anchorPositionMD = computeMeasuredDepthForPosition( wellPath, fractureModel->anchorPosition() );
|
||||
double topMD = anchorPositionMD - ( perforationLength / 2.0 );
|
||||
double bottomMD = anchorPositionMD + ( perforationLength / 2.0 );
|
||||
|
||||
appendPerforationToStream( stream,
|
||||
1,
|
||||
RiaEclipseUnitTools::meterToFeet( topMD ),
|
||||
RiaEclipseUnitTools::meterToFeet( bottomMD ) );
|
||||
|
||||
appendFooterToStream( stream );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifFractureModelPerfsFrkExporter::appendHeaderToStream( QTextStream& stream )
|
||||
{
|
||||
stream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl << "<perfs>" << endl;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifFractureModelPerfsFrkExporter::appendFractureOrientationToStream( QTextStream& stream, bool isTransverse )
|
||||
{
|
||||
stream << "<transverse>" << endl << static_cast<int>( isTransverse ) << endl << "</transverse>" << endl;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifFractureModelPerfsFrkExporter::appendPerforationToStream( QTextStream& stream, int index, double topMD, double bottomMD )
|
||||
{
|
||||
stream << "<perf frac=\"" << index << "\">" << endl
|
||||
<< "<topMD>" << endl
|
||||
<< topMD << endl
|
||||
<< "</topMD>" << endl
|
||||
<< "<bottomMD>" << endl
|
||||
<< bottomMD << endl
|
||||
<< "</bottomMD>" << endl
|
||||
<< "</perf>" << endl;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifFractureModelPerfsFrkExporter::appendFooterToStream( QTextStream& stream )
|
||||
{
|
||||
stream << "</perfs>" << endl;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RifFractureModelPerfsFrkExporter::computeMeasuredDepthForPosition( const RimWellPath* wellPath,
|
||||
const cvf::Vec3d& position )
|
||||
{
|
||||
const RigWellPath* wellPathGeometry = wellPath->wellPathGeometry();
|
||||
|
||||
const std::vector<double>& mdValuesOfWellPath = wellPathGeometry->measureDepths();
|
||||
const std::vector<double>& tvdValuesOfWellPath = wellPathGeometry->trueVerticalDepths();
|
||||
const double targetTvd = -position.z();
|
||||
|
||||
std::vector<double> tvDepthValues;
|
||||
size_t index = 0;
|
||||
bool isAdded = false;
|
||||
for ( size_t i = 0; i < tvdValuesOfWellPath.size(); i++ )
|
||||
{
|
||||
double currentTvd = tvdValuesOfWellPath[i];
|
||||
double prevTvd = 0.0;
|
||||
if ( i > 0 ) prevTvd = tvdValuesOfWellPath[i - 1];
|
||||
|
||||
if ( !isAdded && targetTvd > prevTvd && targetTvd <= currentTvd )
|
||||
{
|
||||
// Insert the anchor position at correct order in well depths
|
||||
index = i;
|
||||
isAdded = true;
|
||||
tvDepthValues.push_back( targetTvd );
|
||||
}
|
||||
|
||||
tvDepthValues.push_back( currentTvd );
|
||||
}
|
||||
|
||||
// Generate MD data by interpolation
|
||||
std::vector<double> measuredDepthValues =
|
||||
RigWellPathGeometryTools::interpolateMdFromTvd( mdValuesOfWellPath, tvdValuesOfWellPath, tvDepthValues );
|
||||
|
||||
if ( index < measuredDepthValues.size() )
|
||||
return measuredDepthValues[index];
|
||||
else
|
||||
{
|
||||
RiaLogging::error( "Unable to compute measured depth from well path data." );
|
||||
return -1.0;
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "cvfVector3.h"
|
||||
|
||||
class RimFractureModelPlot;
|
||||
class RimWellPath;
|
||||
|
||||
class QString;
|
||||
class QTextStream;
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//==================================================================================================
|
||||
class RifFractureModelPerfsFrkExporter
|
||||
{
|
||||
public:
|
||||
static bool writeToFile( RimFractureModelPlot* plot, const QString& filepath );
|
||||
|
||||
private:
|
||||
static void appendHeaderToStream( QTextStream& stream );
|
||||
static void appendFractureOrientationToStream( QTextStream& stream, bool isTranseverse );
|
||||
static void appendPerforationToStream( QTextStream& stream, int index, double topMd, double bottomMd );
|
||||
static void appendFooterToStream( QTextStream& stream );
|
||||
static double computeMeasuredDepthForPosition( const RimWellPath* wellPath, const cvf::Vec3d& position );
|
||||
};
|
@ -20,6 +20,7 @@
|
||||
|
||||
#include "RifFractureModelDeviationFrkExporter.h"
|
||||
#include "RifFractureModelGeologicalFrkExporter.h"
|
||||
#include "RifFractureModelPerfsFrkExporter.h"
|
||||
|
||||
#include "RimFractureModelPlot.h"
|
||||
|
||||
@ -31,5 +32,6 @@ bool RifFractureModelPlotExporter::writeToDirectory( RimFractureModelPlot* plot,
|
||||
const QString& directoryPath )
|
||||
{
|
||||
return RifFractureModelGeologicalFrkExporter::writeToFile( plot, useDetailedFluidLoss, directoryPath + "/Geological.frk" ) &&
|
||||
RifFractureModelDeviationFrkExporter::writeToFile( plot, directoryPath + "/Deviation.frk" );
|
||||
RifFractureModelDeviationFrkExporter::writeToFile( plot, directoryPath + "/Deviation.frk" ) &&
|
||||
RifFractureModelPerfsFrkExporter::writeToFile( plot, directoryPath + "/Perfs.frk" );
|
||||
}
|
||||
|
@ -79,6 +79,17 @@ void caf::AppEnum<RimFractureModel::ExtractionType>::setUp()
|
||||
|
||||
setDefault( RimFractureModel::ExtractionType::TRUE_VERTICAL_THICKNESS );
|
||||
}
|
||||
|
||||
template <>
|
||||
void caf::AppEnum<RimFractureModel::FractureOrientation>::setUp()
|
||||
{
|
||||
addItem( RimFractureModel::FractureOrientation::ALONG_WELL_PATH, "ALONG_WELL_PATH", "Along Well Path" );
|
||||
addItem( RimFractureModel::FractureOrientation::TRANSVERSE_WELL_PATH,
|
||||
"TRANSVERSE_WELL_PATH",
|
||||
"Transverse (normal) to Well Path" );
|
||||
|
||||
setDefault( RimFractureModel::FractureOrientation::TRANSVERSE_WELL_PATH );
|
||||
}
|
||||
}; // namespace caf
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -206,6 +217,15 @@ RimFractureModel::RimFractureModel()
|
||||
"",
|
||||
"" );
|
||||
|
||||
CAF_PDM_InitScriptableField( &m_perforationLength, "PerforationLength", 10.0, "Perforation Length [m]", "", "", "" );
|
||||
CAF_PDM_InitScriptableField( &m_fractureOrientation,
|
||||
"FractureOrientation",
|
||||
caf::AppEnum<FractureOrientation>( FractureOrientation::ALONG_WELL_PATH ),
|
||||
"Fracture Orientation",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
|
||||
CAF_PDM_InitScriptableFieldNoDefault( &m_elasticProperties, "ElasticProperties", "Elastic Properties", "", "", "" );
|
||||
m_elasticProperties.uiCapability()->setUiHidden( true );
|
||||
m_elasticProperties.uiCapability()->setUiTreeHidden( true );
|
||||
@ -557,6 +577,10 @@ void RimFractureModel::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderin
|
||||
temperatureGroup->add( &m_referenceTemperature );
|
||||
temperatureGroup->add( &m_referenceTemperatureGradient );
|
||||
temperatureGroup->add( &m_referenceTemperatureDepth );
|
||||
|
||||
caf::PdmUiOrdering* perforationGroup = uiOrdering.addNewGroup( "Perforation" );
|
||||
perforationGroup->add( &m_perforationLength );
|
||||
perforationGroup->add( &m_fractureOrientation );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -1019,3 +1043,19 @@ double RimFractureModel::computeDefaultStressDepth()
|
||||
// Use top of active cells as reference stress depth
|
||||
return -eclipseCase->activeCellsBoundingBox().max().z();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimFractureModel::perforationLength() const
|
||||
{
|
||||
return m_perforationLength();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimFractureModel::FractureOrientation RimFractureModel::fractureOrientation() const
|
||||
{
|
||||
return m_fractureOrientation();
|
||||
}
|
||||
|
@ -53,6 +53,12 @@ public:
|
||||
TRUE_STRATIGRAPHIC_THICKNESS,
|
||||
};
|
||||
|
||||
enum class FractureOrientation
|
||||
{
|
||||
ALONG_WELL_PATH,
|
||||
TRANSVERSE_WELL_PATH
|
||||
};
|
||||
|
||||
RimFractureModel( void );
|
||||
~RimFractureModel( void ) override;
|
||||
|
||||
@ -92,6 +98,9 @@ public:
|
||||
|
||||
bool useDetailedFluidLoss() const;
|
||||
|
||||
double perforationLength() const;
|
||||
FractureOrientation fractureOrientation() const;
|
||||
|
||||
// RimWellPathCompletionsInterface overrides.
|
||||
RiaDefines::WellPathComponentType componentType() const override;
|
||||
QString componentLabel() const override;
|
||||
@ -172,4 +181,7 @@ protected:
|
||||
caf::PdmField<double> m_poroElasticConstantDefault;
|
||||
caf::PdmField<double> m_thermalExpansionCoeffientDefault;
|
||||
caf::PdmField<bool> m_useDetailedFluidLoss;
|
||||
|
||||
caf::PdmField<caf::AppEnum<FractureOrientation>> m_fractureOrientation;
|
||||
caf::PdmField<double> m_perforationLength;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user