mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-20 11:48:35 -06:00
#7558 Ensemble Fracture Statistics: Add option for aligning by depth
This commit is contained in:
parent
540b74e899
commit
09962c2140
@ -70,6 +70,14 @@ void caf::AppEnum<RimEnsembleFractureStatistics::MeshType>::setUp()
|
||||
setDefault( RimEnsembleFractureStatistics::MeshType::ADAPTIVE );
|
||||
}
|
||||
|
||||
template <>
|
||||
void caf::AppEnum<RimEnsembleFractureStatistics::MeshAlignmentType>::setUp()
|
||||
{
|
||||
addItem( RimEnsembleFractureStatistics::MeshAlignmentType::PERFORATION_DEPTH, "PERFORATION_DEPTH", "Perforation Depth" );
|
||||
addItem( RimEnsembleFractureStatistics::MeshAlignmentType::MESH_DEPTH, "MESH_DEPTH", "Mesh Depth" );
|
||||
setDefault( RimEnsembleFractureStatistics::MeshAlignmentType::PERFORATION_DEPTH );
|
||||
}
|
||||
|
||||
template <>
|
||||
void caf::AppEnum<RimEnsembleFractureStatistics::MeanType>::setUp()
|
||||
{
|
||||
@ -109,6 +117,7 @@ RimEnsembleFractureStatistics::RimEnsembleFractureStatistics()
|
||||
m_filePathsTable.uiCapability()->setUiReadOnly( true );
|
||||
m_filePathsTable.xmlCapability()->disableIO();
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_meshAlignmentType, "MeshAlignmentType", "Mesh Alignment", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_meshType, "MeshType", "Mesh Type", "", "", "" );
|
||||
|
||||
// Uniform sampling
|
||||
@ -237,6 +246,7 @@ void RimEnsembleFractureStatistics::defineUiOrdering( QString uiConfigName, caf:
|
||||
{
|
||||
uiOrdering.add( nameField() );
|
||||
uiOrdering.add( &m_filePathsTable );
|
||||
uiOrdering.add( &m_meshAlignmentType );
|
||||
uiOrdering.add( &m_meshType );
|
||||
uiOrdering.add( &m_numSamplesX );
|
||||
uiOrdering.add( &m_numSamplesY );
|
||||
@ -287,11 +297,14 @@ std::vector<QString> RimEnsembleFractureStatistics::computeStatistics()
|
||||
double timeStep = 1.0;
|
||||
|
||||
double referenceDepth = 0.0;
|
||||
for ( auto definition : stimPlanFractureDefinitions )
|
||||
if ( m_meshAlignmentType() == MeshAlignmentType::PERFORATION_DEPTH )
|
||||
{
|
||||
referenceDepth += computeDepthOfWellPathAtFracture( definition );
|
||||
for ( auto definition : stimPlanFractureDefinitions )
|
||||
{
|
||||
referenceDepth += computeDepthOfWellPathAtFracture( definition );
|
||||
}
|
||||
referenceDepth /= stimPlanFractureDefinitions.size();
|
||||
}
|
||||
referenceDepth /= stimPlanFractureDefinitions.size();
|
||||
|
||||
std::vector<double> gridXs;
|
||||
std::vector<double> gridYs;
|
||||
@ -304,7 +317,7 @@ std::vector<QString> RimEnsembleFractureStatistics::computeStatistics()
|
||||
RiaLogging::info( QString( "Creating statistics for result: %1" ).arg( result.first ) );
|
||||
|
||||
std::vector<cvf::cref<RigFractureGrid>> fractureGrids =
|
||||
createFractureGrids( stimPlanFractureDefinitions, unitSystem, result.first );
|
||||
createFractureGrids( stimPlanFractureDefinitions, unitSystem, result.first, m_meshAlignmentType() );
|
||||
|
||||
std::vector<std::vector<double>> samples( gridXs.size() * gridYs.size() );
|
||||
sampleAllGrids( fractureGrids, gridXs, gridYs, samples );
|
||||
@ -427,7 +440,8 @@ std::set<std::pair<QString, QString>> RimEnsembleFractureStatistics::findAllResu
|
||||
std::vector<cvf::cref<RigFractureGrid>> RimEnsembleFractureStatistics::createFractureGrids(
|
||||
const std::vector<cvf::ref<RigStimPlanFractureDefinition>>& stimPlanFractureDefinitions,
|
||||
RiaDefines::EclipseUnitSystem unitSystem,
|
||||
const QString& resultNameOnFile )
|
||||
const QString& resultNameOnFile,
|
||||
MeshAlignmentType meshAlignmentType )
|
||||
{
|
||||
// Defaults to avoid scaling
|
||||
double halfLengthScaleFactor = 1.0;
|
||||
@ -436,7 +450,9 @@ std::vector<cvf::cref<RigFractureGrid>> RimEnsembleFractureStatistics::createFra
|
||||
std::vector<cvf::cref<RigFractureGrid>> fractureGrids;
|
||||
for ( auto stimPlanFractureDefinitionData : stimPlanFractureDefinitions )
|
||||
{
|
||||
double wellPathDepthAtFracture = computeDepthOfWellPathAtFracture( stimPlanFractureDefinitionData );
|
||||
double wellPathDepthAtFracture = 0.0;
|
||||
if ( meshAlignmentType == MeshAlignmentType::PERFORATION_DEPTH )
|
||||
wellPathDepthAtFracture = computeDepthOfWellPathAtFracture( stimPlanFractureDefinitionData );
|
||||
|
||||
// Always use last time steps
|
||||
std::vector<double> timeSteps = stimPlanFractureDefinitionData->timeSteps();
|
||||
@ -468,7 +484,7 @@ std::tuple<double, double, double, double> RimEnsembleFractureStatistics::findSa
|
||||
std::vector<double>& gridYs ) const
|
||||
{
|
||||
// Find min and max extent of all the grids
|
||||
auto [minX, maxX, minY, maxY] = findMaxGridExtents( stimPlanFractureDefinitions );
|
||||
auto [minX, maxX, minY, maxY] = findMaxGridExtents( stimPlanFractureDefinitions, m_meshAlignmentType() );
|
||||
|
||||
if ( m_meshType() == MeshType::UNIFORM )
|
||||
{
|
||||
@ -490,7 +506,8 @@ std::tuple<double, double, double, double> RimEnsembleFractureStatistics::findSa
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::tuple<double, double, double, double> RimEnsembleFractureStatistics::findMaxGridExtents(
|
||||
const std::vector<cvf::ref<RigStimPlanFractureDefinition>>& stimPlanFractureDefinitions )
|
||||
const std::vector<cvf::ref<RigStimPlanFractureDefinition>>& stimPlanFractureDefinitions,
|
||||
MeshAlignmentType meshAlignmentType )
|
||||
{
|
||||
double minX = std::numeric_limits<double>::max();
|
||||
double maxX = -std::numeric_limits<double>::max();
|
||||
@ -502,7 +519,9 @@ std::tuple<double, double, double, double> RimEnsembleFractureStatistics::findMa
|
||||
minX = std::min( minX, def->xs().front() );
|
||||
maxX = std::max( maxX, def->xs().back() );
|
||||
|
||||
double offset = computeDepthOfWellPathAtFracture( def );
|
||||
double offset = 0.0;
|
||||
if ( meshAlignmentType == MeshAlignmentType::PERFORATION_DEPTH )
|
||||
offset = computeDepthOfWellPathAtFracture( def );
|
||||
|
||||
minY = std::min( minY, offset + def->ys().back() );
|
||||
maxY = std::max( maxY, offset + def->ys().front() );
|
||||
@ -559,7 +578,10 @@ void RimEnsembleFractureStatistics::generateNaiveMesh(
|
||||
std::vector<double> depths;
|
||||
for ( auto def : stimPlanFractureDefinitions )
|
||||
{
|
||||
double offset = computeDepthOfWellPathAtFracture( def );
|
||||
double offset = 0.0;
|
||||
if ( m_meshAlignmentType() == MeshAlignmentType::PERFORATION_DEPTH )
|
||||
offset = computeDepthOfWellPathAtFracture( def );
|
||||
|
||||
for ( double y : def->ys() )
|
||||
{
|
||||
depths.push_back( offset + y );
|
||||
@ -593,7 +615,7 @@ void RimEnsembleFractureStatistics::generateAdaptiveMesh(
|
||||
linearSampling( minX, maxX, maxNx, gridXs );
|
||||
|
||||
std::vector<Layer> layers;
|
||||
generateAllLayers( stimPlanFractureDefinitions, layers );
|
||||
generateAllLayers( stimPlanFractureDefinitions, layers, m_meshAlignmentType() );
|
||||
|
||||
const int targetNumLayers = getTargetNumberOfLayers( stimPlanFractureDefinitions );
|
||||
|
||||
@ -742,11 +764,15 @@ void RimEnsembleFractureStatistics::computeMeanThicknessPerLayer( const std::vec
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEnsembleFractureStatistics::generateAllLayers(
|
||||
const std::vector<cvf::ref<RigStimPlanFractureDefinition>>& stimPlanFractureDefinitions,
|
||||
std::vector<Layer>& layers )
|
||||
std::vector<Layer>& layers,
|
||||
MeshAlignmentType meshAlignmentType )
|
||||
{
|
||||
for ( auto def : stimPlanFractureDefinitions )
|
||||
{
|
||||
double offset = computeDepthOfWellPathAtFracture( def );
|
||||
double offset = 0.0;
|
||||
if ( meshAlignmentType == MeshAlignmentType::PERFORATION_DEPTH )
|
||||
offset = computeDepthOfWellPathAtFracture( def );
|
||||
|
||||
bool isFirst = true;
|
||||
double topDepth = 0.0;
|
||||
for ( double y : def->ys() )
|
||||
|
@ -62,6 +62,12 @@ public:
|
||||
OCCURRENCE
|
||||
};
|
||||
|
||||
enum class MeshAlignmentType
|
||||
{
|
||||
PERFORATION_DEPTH,
|
||||
MESH_DEPTH
|
||||
};
|
||||
|
||||
enum class MeshType
|
||||
{
|
||||
ADAPTIVE,
|
||||
@ -113,7 +119,8 @@ protected:
|
||||
std::vector<cvf::cref<RigFractureGrid>>
|
||||
createFractureGrids( const std::vector<cvf::ref<RigStimPlanFractureDefinition>>& stimPlanFractureDefinitions,
|
||||
RiaDefines::EclipseUnitSystem unitSystem,
|
||||
const QString& resultName );
|
||||
const QString& resultName,
|
||||
MeshAlignmentType meshAlignmentType );
|
||||
|
||||
static std::set<std::pair<QString, QString>>
|
||||
findAllResultNames( const std::vector<cvf::ref<RigStimPlanFractureDefinition>>& stimPlanFractureDefinitions );
|
||||
@ -149,7 +156,8 @@ protected:
|
||||
int getTargetNumberOfLayers( const std::vector<cvf::ref<RigStimPlanFractureDefinition>>& stimPlanFractureDefinitions ) const;
|
||||
|
||||
static std::tuple<double, double, double, double>
|
||||
findMaxGridExtents( const std::vector<cvf::ref<RigStimPlanFractureDefinition>>& stimPlanFractureDefinitions );
|
||||
findMaxGridExtents( const std::vector<cvf::ref<RigStimPlanFractureDefinition>>& stimPlanFractureDefinitions,
|
||||
MeshAlignmentType meshAlignmentType );
|
||||
|
||||
void computeMeanThicknessPerLayer( const std::vector<Layer>& layers,
|
||||
int targetNumLayers,
|
||||
@ -159,7 +167,8 @@ protected:
|
||||
std::vector<double>& baseDepth ) const;
|
||||
|
||||
static void generateAllLayers( const std::vector<cvf::ref<RigStimPlanFractureDefinition>>& stimPlanFractureDefinitions,
|
||||
std::vector<Layer>& layers );
|
||||
std::vector<Layer>& layers,
|
||||
MeshAlignmentType meshAlignmentType );
|
||||
|
||||
static void sampleAllGrids( const std::vector<cvf::cref<RigFractureGrid>>& fractureGrids,
|
||||
const std::vector<double>& samplesX,
|
||||
@ -177,12 +186,13 @@ protected:
|
||||
|
||||
static double linearSampling( double minValue, double maxValue, int numSamples, std::vector<double>& samples );
|
||||
|
||||
caf::PdmField<std::vector<caf::FilePath>> m_filePaths;
|
||||
caf::PdmField<QString> m_filePathsTable;
|
||||
caf::PdmField<bool> m_computeStatistics;
|
||||
caf::PdmField<int> m_numSamplesX;
|
||||
caf::PdmField<int> m_numSamplesY;
|
||||
caf::PdmField<caf::AppEnum<MeshType>> m_meshType;
|
||||
caf::PdmField<std::vector<caf::FilePath>> m_filePaths;
|
||||
caf::PdmField<QString> m_filePathsTable;
|
||||
caf::PdmField<bool> m_computeStatistics;
|
||||
caf::PdmField<int> m_numSamplesX;
|
||||
caf::PdmField<int> m_numSamplesY;
|
||||
caf::PdmField<caf::AppEnum<MeshType>> m_meshType;
|
||||
caf::PdmField<caf::AppEnum<MeshAlignmentType>> m_meshAlignmentType;
|
||||
|
||||
caf::PdmField<caf::AppEnum<MeanType>> m_adaptiveMeanType;
|
||||
caf::PdmField<caf::AppEnum<AdaptiveNumLayersType>> m_adaptiveNumLayersType;
|
||||
|
Loading…
Reference in New Issue
Block a user