mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-03 12:10:57 -06:00
This commit is contained in:
parent
200d5c65a3
commit
503d946bc1
@ -33,11 +33,12 @@
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RifEnsembleFractureStatisticsExporter::writeAsStimPlanXml( const std::vector<std::shared_ptr<RigSlice2D>>& statistics,
|
bool RifEnsembleFractureStatisticsExporter::writeAsStimPlanXml( const std::vector<std::shared_ptr<RigSlice2D>>& statistics,
|
||||||
const std::vector<std::pair<QString, QString>>& properties,
|
const std::vector<std::pair<QString, QString>>& properties,
|
||||||
const QString& filePath,
|
const QString& filePath,
|
||||||
const std::vector<double>& gridXs,
|
const std::vector<double>& gridXs,
|
||||||
const std::vector<double>& gridYs,
|
const std::vector<double>& gridYs,
|
||||||
double time,
|
double time,
|
||||||
RiaDefines::EclipseUnitSystem unitSystem )
|
RiaDefines::EclipseUnitSystem unitSystem,
|
||||||
|
RigStimPlanFractureDefinition::Orientation orientation )
|
||||||
{
|
{
|
||||||
QFile data( filePath );
|
QFile data( filePath );
|
||||||
if ( !data.open( QFile::WriteOnly | QFile::Truncate ) )
|
if ( !data.open( QFile::WriteOnly | QFile::Truncate ) )
|
||||||
@ -47,6 +48,7 @@ bool RifEnsembleFractureStatisticsExporter::writeAsStimPlanXml( const std::vecto
|
|||||||
|
|
||||||
QTextStream stream( &data );
|
QTextStream stream( &data );
|
||||||
appendHeaderToStream( stream );
|
appendHeaderToStream( stream );
|
||||||
|
appendOrientationToStream( stream, orientation );
|
||||||
appendGridDimensionsToStream( stream, gridXs, gridYs, unitSystem );
|
appendGridDimensionsToStream( stream, gridXs, gridYs, unitSystem );
|
||||||
appendPropertiesToStream( stream, statistics, properties, gridYs, time );
|
appendPropertiesToStream( stream, statistics, properties, gridYs, time );
|
||||||
appendFooterToStream( stream );
|
appendFooterToStream( stream );
|
||||||
@ -105,6 +107,19 @@ void RifEnsembleFractureStatisticsExporter::appendPropertiesToStream(
|
|||||||
stream << "</properties>" << endl;
|
stream << "</properties>" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RifEnsembleFractureStatisticsExporter::appendOrientationToStream( QTextStream& stream,
|
||||||
|
RigStimPlanFractureDefinition::Orientation orientation )
|
||||||
|
{
|
||||||
|
if ( orientation != RigStimPlanFractureDefinition::Orientation::UNDEFINED )
|
||||||
|
{
|
||||||
|
QString orientationString = getStringForOrientation( orientation );
|
||||||
|
stream << QString( "<orientation>%1</orientation>" ).arg( orientationString ) << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -150,3 +165,16 @@ QString RifEnsembleFractureStatisticsExporter::getStringForUnitSystem( RiaDefine
|
|||||||
else
|
else
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
QString RifEnsembleFractureStatisticsExporter::getStringForOrientation( RigStimPlanFractureDefinition::Orientation orientation )
|
||||||
|
{
|
||||||
|
if ( orientation == RigStimPlanFractureDefinition::Orientation::TRANSVERSE )
|
||||||
|
return "transverse";
|
||||||
|
else if ( orientation == RigStimPlanFractureDefinition::Orientation::LONGITUDINAL )
|
||||||
|
return "longitudinal";
|
||||||
|
else
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
|
|
||||||
#include "RiaDefines.h"
|
#include "RiaDefines.h"
|
||||||
|
|
||||||
|
#include "RigStimPlanFractureDefinition.h"
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
@ -40,10 +42,12 @@ public:
|
|||||||
const std::vector<double>& gridXs,
|
const std::vector<double>& gridXs,
|
||||||
const std::vector<double>& gridYs,
|
const std::vector<double>& gridYs,
|
||||||
double time,
|
double time,
|
||||||
RiaDefines::EclipseUnitSystem unitSystem );
|
RiaDefines::EclipseUnitSystem unitSystem,
|
||||||
|
RigStimPlanFractureDefinition::Orientation orientation );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static void appendHeaderToStream( QTextStream& stream );
|
static void appendHeaderToStream( QTextStream& stream );
|
||||||
|
static void appendOrientationToStream( QTextStream& stream, RigStimPlanFractureDefinition::Orientation orientation );
|
||||||
static void appendGridDimensionsToStream( QTextStream& stream,
|
static void appendGridDimensionsToStream( QTextStream& stream,
|
||||||
const std::vector<double>& gridXs,
|
const std::vector<double>& gridXs,
|
||||||
const std::vector<double>& gridYs,
|
const std::vector<double>& gridYs,
|
||||||
@ -56,4 +60,6 @@ private:
|
|||||||
static void appendFooterToStream( QTextStream& stream );
|
static void appendFooterToStream( QTextStream& stream );
|
||||||
|
|
||||||
static QString getStringForUnitSystem( RiaDefines::EclipseUnitSystem unitSystem );
|
static QString getStringForUnitSystem( RiaDefines::EclipseUnitSystem unitSystem );
|
||||||
|
|
||||||
|
static QString getStringForOrientation( RigStimPlanFractureDefinition::Orientation orientation );
|
||||||
};
|
};
|
||||||
|
@ -344,11 +344,17 @@ std::vector<QString> RimEnsembleFractureStatistics::computeStatistics()
|
|||||||
double timeStep = 1.0;
|
double timeStep = 1.0;
|
||||||
|
|
||||||
double referenceDepth = 0.0;
|
double referenceDepth = 0.0;
|
||||||
|
|
||||||
|
RigStimPlanFractureDefinition::Orientation orientation = RigStimPlanFractureDefinition::Orientation::UNDEFINED;
|
||||||
if ( m_meshAlignmentType() == MeshAlignmentType::PERFORATION_DEPTH )
|
if ( m_meshAlignmentType() == MeshAlignmentType::PERFORATION_DEPTH )
|
||||||
{
|
{
|
||||||
for ( auto definition : stimPlanFractureDefinitions )
|
for ( auto definition : stimPlanFractureDefinitions )
|
||||||
{
|
{
|
||||||
referenceDepth += computeDepthOfWellPathAtFracture( definition );
|
referenceDepth += computeDepthOfWellPathAtFracture( definition );
|
||||||
|
// Take the first orientation which is defined (all the fractures
|
||||||
|
// should have the same orientation).
|
||||||
|
if ( orientation == RigStimPlanFractureDefinition::Orientation::UNDEFINED )
|
||||||
|
orientation = definition->orientation();
|
||||||
}
|
}
|
||||||
referenceDepth /= stimPlanFractureDefinitions.size();
|
referenceDepth /= stimPlanFractureDefinitions.size();
|
||||||
}
|
}
|
||||||
@ -421,7 +427,8 @@ std::vector<QString> RimEnsembleFractureStatistics::computeStatistics()
|
|||||||
gridXs,
|
gridXs,
|
||||||
gridYsWithOffset,
|
gridYsWithOffset,
|
||||||
timeStep,
|
timeStep,
|
||||||
unitSystem );
|
unitSystem,
|
||||||
|
orientation );
|
||||||
|
|
||||||
xmlFilePaths.push_back( xmlFilePath );
|
xmlFilePaths.push_back( xmlFilePath );
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user