#6425 Fracture Model: Export Asymmetric.frk file.

This commit is contained in:
Kristian Bendiksen 2020-09-08 11:59:51 +02:00
parent cbce19bb65
commit eb532f0872
6 changed files with 232 additions and 1 deletions

View File

@ -58,6 +58,7 @@ ${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}/RifFractureModelAsymmetricFrkExporter.h
${CMAKE_CURRENT_LIST_DIR}/RifSurfaceExporter.h
@ -122,6 +123,7 @@ ${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}/RifFractureModelAsymmetricFrkExporter.cpp
${CMAKE_CURRENT_LIST_DIR}/RifSurfaceExporter.cpp
# HDF5 file reader is directly included in ResInsight main CmakeList.txt

View File

@ -0,0 +1,106 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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 "RifFractureModelAsymmetricFrkExporter.h"
#include "RimFractureModel.h"
#include "RimFractureModelPlot.h"
#include <QFile>
#include <QTextStream>
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RifFractureModelAsymmetricFrkExporter::writeToFile( RimFractureModelPlot* plot, const QString& filepath )
{
RimFractureModel* fractureModel = plot->fractureModel();
if ( !fractureModel )
{
return false;
}
QFile data( filepath );
if ( !data.open( QFile::WriteOnly | QFile::Truncate ) )
{
return false;
}
QTextStream stream( &data );
appendHeaderToStream( stream );
double bedDipDeg = fractureModel->formationDip();
bool hasBarrier = fractureModel->hasBarrier();
double distanceToBarrier = fractureModel->distanceToBarrier();
double barrierDip = fractureModel->barrierDip();
int wellPenetrationLayer = fractureModel->wellPenetrationLayer();
appendBarrierDataToStream( stream,
bedDipDeg,
hasBarrier,
RiaEclipseUnitTools::meterToFeet( distanceToBarrier ),
barrierDip,
wellPenetrationLayer );
appendFooterToStream( stream );
return true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RifFractureModelAsymmetricFrkExporter::appendHeaderToStream( QTextStream& stream )
{
stream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl << "<asymmetric>" << endl;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RifFractureModelAsymmetricFrkExporter::appendBarrierDataToStream( QTextStream& stream,
double bedDipDeg,
bool hasBarrier,
double distanceToBarrier,
double barrierDipDeg,
int wellPenetrationLayer )
{
stream << "<BedDipDeg>" << endl
<< bedDipDeg << endl
<< "</BedDipDeg>" << endl
<< "<Barrier>" << endl
<< static_cast<int>( hasBarrier ) << endl
<< "</Barrier>" << endl
<< "<BarrierDipDeg>" << endl
<< barrierDipDeg << endl
<< "</BarrierDipDeg>" << endl
<< "<DistanceToBarrier>" << endl
<< distanceToBarrier << endl
<< "</DistanceToBarrier>" << endl
<< "<WellPenetrationLayer>" << endl
<< wellPenetrationLayer << endl
<< "</WellPenetrationLayer>" << endl;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RifFractureModelAsymmetricFrkExporter::appendFooterToStream( QTextStream& stream )
{
stream << "</asymmetric>" << endl;
}

View File

@ -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
class RimFractureModelPlot;
class QString;
class QTextStream;
//==================================================================================================
//
//==================================================================================================
class RifFractureModelAsymmetricFrkExporter
{
public:
static bool writeToFile( RimFractureModelPlot* plot, const QString& filepath );
private:
static void appendHeaderToStream( QTextStream& stream );
static void appendBarrierDataToStream( QTextStream& stream,
double bedDipDeg,
bool hasBarrier,
double distanceToBarrier,
double barrierDipDeg,
int wellPenetrationLayer );
static void appendFooterToStream( QTextStream& stream );
};

View File

@ -18,6 +18,7 @@
#include "RifFractureModelPlotExporter.h"
#include "RifFractureModelAsymmetricFrkExporter.h"
#include "RifFractureModelDeviationFrkExporter.h"
#include "RifFractureModelGeologicalFrkExporter.h"
#include "RifFractureModelPerfsFrkExporter.h"
@ -33,5 +34,6 @@ bool RifFractureModelPlotExporter::writeToDirectory( RimFractureModelPlot* plot,
{
return RifFractureModelGeologicalFrkExporter::writeToFile( plot, useDetailedFluidLoss, directoryPath + "/Geological.frk" ) &&
RifFractureModelDeviationFrkExporter::writeToFile( plot, directoryPath + "/Deviation.frk" ) &&
RifFractureModelPerfsFrkExporter::writeToFile( plot, directoryPath + "/Perfs.frk" );
RifFractureModelPerfsFrkExporter::writeToFile( plot, directoryPath + "/Perfs.frk" ) &&
RifFractureModelAsymmetricFrkExporter::writeToFile( plot, directoryPath + "/Asymmetric.frk" );
}

View File

@ -226,6 +226,14 @@ RimFractureModel::RimFractureModel()
"",
"" );
CAF_PDM_InitScriptableField( &m_formationDip, "FormationDip", 0.0, "Formation Dip", "", "", "" );
m_formationDip.uiCapability()->setUiReadOnly( true );
CAF_PDM_InitScriptableField( &m_hasBarrier, "Barrier", true, "Barrier", "", "", "" );
CAF_PDM_InitScriptableField( &m_distanceToBarrier, "DistanceToBarrier", 0.0, "Distance To Barrier [m]", "", "", "" );
CAF_PDM_InitScriptableField( &m_barrierDip, "BarrierDip", 0.0, "Barrier Dip", "", "", "" );
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 );
@ -452,6 +460,7 @@ void RimFractureModel::updateThicknessDirection()
}
m_thicknessDirection = direction;
m_formationDip = calculateFormationDip( direction );
if ( m_thicknessDirectionWellPath )
{
@ -581,6 +590,13 @@ void RimFractureModel::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderin
caf::PdmUiOrdering* perforationGroup = uiOrdering.addNewGroup( "Perforation" );
perforationGroup->add( &m_perforationLength );
perforationGroup->add( &m_fractureOrientation );
caf::PdmUiOrdering* asymmetricGroup = uiOrdering.addNewGroup( "Asymmetric" );
asymmetricGroup->add( &m_formationDip );
asymmetricGroup->add( &m_hasBarrier );
asymmetricGroup->add( &m_distanceToBarrier );
asymmetricGroup->add( &m_barrierDip );
asymmetricGroup->add( &m_wellPenetrationLayer );
}
//--------------------------------------------------------------------------------------------------
@ -669,6 +685,15 @@ void RimFractureModel::findThicknessTargetPoints( cvf::Vec3d& topPosition, cvf::
RiaLogging::info( QString( "Bottom: %1" ).arg( RimFractureModel::vecToString( bottomPosition ) ) );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFractureModel::calculateFormationDip( const cvf::Vec3d& direction )
{
// Formation dip is inclination of a plane from horizontal.
return cvf::Math::toDegrees( cvf::GeometryTools::getAngle( direction, -cvf::Vec3d::Z_AXIS ) );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -1059,3 +1084,43 @@ RimFractureModel::FractureOrientation RimFractureModel::fractureOrientation() co
{
return m_fractureOrientation();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFractureModel::formationDip() const
{
return m_formationDip;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimFractureModel::hasBarrier() const
{
return m_hasBarrier;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFractureModel::distanceToBarrier() const
{
return m_distanceToBarrier;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFractureModel::barrierDip() const
{
return m_barrierDip;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
int RimFractureModel::wellPenetrationLayer() const
{
return m_wellPenetrationLayer;
}

View File

@ -101,6 +101,12 @@ public:
double perforationLength() const;
FractureOrientation fractureOrientation() const;
double formationDip() const;
bool hasBarrier() const;
double distanceToBarrier() const;
double barrierDip() const;
int wellPenetrationLayer() const;
// RimWellPathCompletionsInterface overrides.
RiaDefines::WellPathComponentType componentType() const override;
QString componentLabel() const override;
@ -141,6 +147,7 @@ private:
void updateThicknessDirection();
cvf::Vec3d calculateTSTDirection() const;
void findThicknessTargetPoints( cvf::Vec3d& topPosition, cvf::Vec3d& bottomPosition );
static double calculateFormationDip( const cvf::Vec3d& direction );
static QString vecToString( const cvf::Vec3d& vec );
void updateThicknessDirectionWellPathName();
static double computeDefaultStressDepth();
@ -184,4 +191,10 @@ protected:
caf::PdmField<caf::AppEnum<FractureOrientation>> m_fractureOrientation;
caf::PdmField<double> m_perforationLength;
caf::PdmField<double> m_formationDip;
caf::PdmField<bool> m_hasBarrier;
caf::PdmField<double> m_distanceToBarrier;
caf::PdmField<double> m_barrierDip;
caf::PdmField<int> m_wellPenetrationLayer;
};