From 0e49d983a22184e496a4ef9eba4f08ca06a224c1 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Mon, 5 Sep 2022 18:30:15 +0200 Subject: [PATCH] Thermal Fracture: make fracture completions export work. --- .../RicExportFractureCompletionsImpl.cpp | 2 +- .../RicWellPathFractureTextReportFeatureImpl.cpp | 12 ++++++------ .../RicWellPathFractureTextReportFeatureImpl.h | 6 +++--- .../RigEclipseToStimPlanCalculator.cpp | 15 +++++++++++---- 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/ApplicationLibCode/Commands/CompletionExportCommands/RicExportFractureCompletionsImpl.cpp b/ApplicationLibCode/Commands/CompletionExportCommands/RicExportFractureCompletionsImpl.cpp index 235c0b0d8a..a095b58410 100644 --- a/ApplicationLibCode/Commands/CompletionExportCommands/RicExportFractureCompletionsImpl.cpp +++ b/ApplicationLibCode/Commands/CompletionExportCommands/RicExportFractureCompletionsImpl.cpp @@ -516,7 +516,7 @@ void RicExportFractureCompletionsImpl::getWellPressuresAndInitialProductionTimeS bool RicExportFractureCompletionsImpl::checkForStimPlanConductivity( const RimFractureTemplate* fracTemplate, const RimFracture* fracture ) { - auto fracTemplateStimPlan = dynamic_cast( fracTemplate ); + auto fracTemplateStimPlan = dynamic_cast( fracTemplate ); if ( fracTemplateStimPlan ) { if ( !fracTemplateStimPlan->hasConductivity() ) diff --git a/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathFractureTextReportFeatureImpl.cpp b/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathFractureTextReportFeatureImpl.cpp index 46148ff1b7..1e5bdb33ae 100644 --- a/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathFractureTextReportFeatureImpl.cpp +++ b/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathFractureTextReportFeatureImpl.cpp @@ -34,9 +34,9 @@ #include "RimFractureContainment.h" #include "RimFractureTemplate.h" #include "RimFractureTemplateCollection.h" +#include "RimMeshFractureTemplate.h" #include "RimOilField.h" #include "RimProject.h" -#include "RimStimPlanFractureTemplate.h" #include "RimTools.h" #include "RimWellPath.h" #include "RimWellPathCollection.h" @@ -81,8 +81,8 @@ QString RicWellPathFractureTextReportFeatureImpl::wellPathFractureReport( textStream << lineStart << "\n"; - std::vector stimPlanTemplates; - std::vector ellipseTemplates; + std::vector stimPlanTemplates; + std::vector ellipseTemplates; { auto proj = RimProject::current(); @@ -101,7 +101,7 @@ QString RicWellPathFractureTextReportFeatureImpl::wellPathFractureReport( continue; } - auto stimPlanTemplate = dynamic_cast( fracTemplate ); + auto stimPlanTemplate = dynamic_cast( fracTemplate ); if ( stimPlanTemplate ) { stimPlanTemplates.push_back( stimPlanTemplate ); @@ -269,7 +269,7 @@ QString RicWellPathFractureTextReportFeatureImpl::createWellFileLocationText( co /// //-------------------------------------------------------------------------------------------------- QString RicWellPathFractureTextReportFeatureImpl::createStimPlanFileLocationText( - const std::vector& stimPlanTemplates ) const + const std::vector& stimPlanTemplates ) const { if ( stimPlanTemplates.empty() ) return ""; @@ -307,7 +307,7 @@ QString RicWellPathFractureTextReportFeatureImpl::createStimPlanFileLocationText /// //-------------------------------------------------------------------------------------------------- QString RicWellPathFractureTextReportFeatureImpl::createStimPlanFractureText( - const std::vector& stimPlanTemplates ) const + const std::vector& stimPlanTemplates ) const { if ( stimPlanTemplates.empty() ) return ""; diff --git a/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathFractureTextReportFeatureImpl.h b/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathFractureTextReportFeatureImpl.h index 9478cc339b..f0d8d394ec 100644 --- a/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathFractureTextReportFeatureImpl.h +++ b/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathFractureTextReportFeatureImpl.h @@ -25,7 +25,7 @@ class RimWellPathFracture; class RimEclipseCase; class RimFractureTemplate; class RimEllipseFractureTemplate; -class RimStimPlanFractureTemplate; +class RimMeshFractureTemplate; class RifTextDataTableFormatter; class RicWellPathFractureReportItem; @@ -43,8 +43,8 @@ public: private: QString createWellFileLocationText( const std::vector& wellPaths ) const; - QString createStimPlanFileLocationText( const std::vector& stimPlanTemplates ) const; - QString createStimPlanFractureText( const std::vector& stimPlanTemplates ) const; + QString createStimPlanFileLocationText( const std::vector& stimPlanTemplates ) const; + QString createStimPlanFractureText( const std::vector& stimPlanTemplates ) const; QString createEllipseFractureText( const std::vector& ellipseTemplates ) const; QString createFractureText( const std::vector& fractureTemplates ) const; QString createFractureInstancesText( const std::vector& fractureTemplates ) const; diff --git a/ApplicationLibCode/ReservoirDataModel/Completions/RigEclipseToStimPlanCalculator.cpp b/ApplicationLibCode/ReservoirDataModel/Completions/RigEclipseToStimPlanCalculator.cpp index 19adef628f..5ba3648097 100644 --- a/ApplicationLibCode/ReservoirDataModel/Completions/RigEclipseToStimPlanCalculator.cpp +++ b/ApplicationLibCode/ReservoirDataModel/Completions/RigEclipseToStimPlanCalculator.cpp @@ -37,7 +37,7 @@ #include "RimEllipseFractureTemplate.h" #include "RimFracture.h" #include "RimFractureContainmentTools.h" -#include "RimStimPlanFractureTemplate.h" +#include "RimMeshFractureTemplate.h" //-------------------------------------------------------------------------------------------------- /// @@ -187,7 +187,7 @@ double RigEclipseToStimPlanCalculator::areaWeightedWidth() const width = ellipseFractureTemplate->width(); } - auto stimPlanFractureTemplate = dynamic_cast( m_fracture->fractureTemplate() ); + auto stimPlanFractureTemplate = dynamic_cast( m_fracture->fractureTemplate() ); if ( stimPlanFractureTemplate ) { auto widthValues = stimPlanFractureTemplate->widthResultValues(); @@ -202,7 +202,10 @@ double RigEclipseToStimPlanCalculator::areaWeightedWidth() const size_t globalStimPlanCellIndex = singleCellCalc.first; double widthValue = widthValues[globalStimPlanCellIndex]; - calc.addValueAndWeight( widthValue, cellArea ); + if ( !std::isinf( widthValue ) && !std::isnan( widthValue ) ) + { + calc.addValueAndWeight( widthValue, cellArea ); + } } width = calc.weightedMean(); @@ -227,7 +230,11 @@ double RigEclipseToStimPlanCalculator::areaWeightedConductivity() const { double cellArea = singleCellCalc.second.areaOpenForFlow(); - calc.addValueAndWeight( singleCellCalc.second.fractureCell().getConductivityValue(), cellArea ); + double conductivity = singleCellCalc.second.fractureCell().getConductivityValue(); + if ( !std::isinf( conductivity ) && !std::isnan( conductivity ) ) + { + calc.addValueAndWeight( conductivity, cellArea ); + } } return calc.validAggregatedWeight() ? calc.weightedMean() : 0.0;