mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#6425 Fracture Model: Export Asymmetric.frk file.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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 );
|
||||
};
|
||||
@@ -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" );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user