RFT Curves: Add more segment curves

- add CONGRAT
- add pressure track
- add CONFAC
- fix some plot layout issues
- Fix bug for first segment MD location
- Add default scale factor 1e-3 for gas curves
- Avoid inf values in some curves, seen in PRESSURE and CONFAC
- Use assignment in statements instead of std::get
This commit is contained in:
Magne Sjaastad
2022-10-27 11:17:41 +02:00
parent f6bde92d81
commit 4c3e1c3fe8
19 changed files with 455 additions and 188 deletions

View File

@@ -497,11 +497,11 @@ RimWellLogCurve* RicWellLogTools::addSummaryRftCurve( RimWellLogTrack* plotTrack
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellLogCurve* RicWellLogTools::addSummaryRftSegmentCurve( RimWellLogTrack* plotTrack,
const QString& resultName,
const QString& wellName,
RiaDefines::RftBranchType branchType,
RimSummaryCase* rimCase )
RimWellLogRftCurve* RicWellLogTools::addSummaryRftSegmentCurve( RimWellLogTrack* plotTrack,
const QString& resultName,
const QString& wellName,
RiaDefines::RftBranchType branchType,
RimSummaryCase* rimCase )
{
auto curve = new RimWellLogRftCurve();
@@ -519,7 +519,6 @@ RimWellLogCurve* RicWellLogTools::addSummaryRftSegmentCurve( RimWellLogTrack*
curve->enableColorFromResultName( true );
curve->assignColorFromResultName( resultName );
curve->setLineThickness( 4 );
curve->setFillStyle( Qt::SolidPattern );
curve->setInterpolation( RiuQwtPlotCurveDefines::CurveInterpolationEnum::INTERPOLATION_STEP_LEFT );

View File

@@ -77,12 +77,12 @@ public:
const QString& measurementName,
bool showPlotWindow = true );
static RimWellLogCurve* addSummaryRftCurve( RimWellLogTrack* plotTrack, RimSummaryCase* rimCase );
static RimWellLogCurve* addSummaryRftSegmentCurve( RimWellLogTrack* plotTrack,
const QString& resultName,
const QString& wellName,
RiaDefines::RftBranchType branchType,
RimSummaryCase* rimCase );
static RimWellLogCurve* addSummaryRftCurve( RimWellLogTrack* plotTrack, RimSummaryCase* rimCase );
static RimWellLogRftCurve* addSummaryRftSegmentCurve( RimWellLogTrack* plotTrack,
const QString& resultName,
const QString& wellName,
RiaDefines::RftBranchType branchType,
RimSummaryCase* rimCase );
private:
template <typename ExtractionCurveType>

View File

@@ -24,6 +24,7 @@
#include "RicWellLogTools.h"
#include "RiaApplication.h"
#include "RiaPlotWindowRedrawScheduler.h"
#include "RiaRftDefines.h"
#include "RifReaderOpmRft.h"
@@ -32,6 +33,7 @@
#include "RimRftTopologyCurve.h"
#include "RimSummaryCase.h"
#include "RimWellLogPlot.h"
#include "RimWellLogRftCurve.h"
#include "RimWellLogTrack.h"
#include "RiuPlotMainWindowTools.h"
@@ -70,6 +72,8 @@ void RicNewMultiPhaseRftSegmentPlotFeature::onActionTriggered( bool isChecked )
plot->setPlotTitleVisible( true );
plot->setLegendItemsClickable( false );
plot->enableDepthMarkerLine( true );
plot->setLegendPosition( RimPlotWindow::LegendPosition::INSIDE_UPPER_LEFT );
plot->setLegendFontSize( caf::FontTools::RelativeSize::XSmall );
QString wellName = "Unknown";
@@ -80,21 +84,36 @@ void RicNewMultiPhaseRftSegmentPlotFeature::onActionTriggered( bool isChecked )
if ( !wellNames.empty() ) wellName = *wellNames.begin();
}
std::vector<QString> resultNames = { "SEGGRAT", "SEGORAT", "SEGWRAT" };
appendTrackAndCurveForBranchType( plot,
"Connection Rates",
{ "CONGRAT", "CONORAT", "CONWRAT" },
wellName,
RiaDefines::RftBranchType::RFT_ANNULUS,
summaryCase );
std::vector<RiaDefines::RftBranchType> branchTypes{ RiaDefines::RftBranchType::RFT_ANNULUS,
RiaDefines::RftBranchType::RFT_DEVICE,
RiaDefines::RftBranchType::RFT_TUBING };
for ( auto branchType : branchTypes )
{
appendTrackAndCurveForBranchType( plot, resultNames, wellName, branchType, summaryCase );
for ( auto branchType : { RiaDefines::RftBranchType::RFT_ANNULUS,
RiaDefines::RftBranchType::RFT_DEVICE,
RiaDefines::RftBranchType::RFT_TUBING } )
{
appendTrackAndCurveForBranchType( plot,
"Segment Rates",
{ "SEGGRAT", "SEGORAT", "SEGWRAT" },
wellName,
branchType,
summaryCase );
}
}
RicNewRftSegmentWellLogPlotFeature::appendPressureTrack( plot, wellName, summaryCase );
RicNewRftSegmentWellLogPlotFeature::appendConnectionFactorTrack( plot, wellName, summaryCase );
RicNewRftSegmentWellLogPlotFeature::appendTopologyTrack( plot, wellName, summaryCase );
plot->loadDataAndUpdate();
RiaPlotWindowRedrawScheduler::instance()->performScheduledUpdatesAndReplots();
plot->updateLayout();
RiuPlotMainWindowTools::onObjectAppended( plot );
}
@@ -102,14 +121,15 @@ void RicNewMultiPhaseRftSegmentPlotFeature::onActionTriggered( bool isChecked )
///
//--------------------------------------------------------------------------------------------------
void RicNewMultiPhaseRftSegmentPlotFeature::appendTrackAndCurveForBranchType( RimWellLogPlot* plot,
const QString& trackName,
const std::vector<QString>& resultNames,
const QString& wellName,
RiaDefines::RftBranchType branchType,
RimSummaryCase* summaryCase )
{
RimWellLogTrack* plotTrack = new RimWellLogTrack();
auto plotTrack = new RimWellLogTrack();
plot->addPlot( plotTrack );
plotTrack->setDescription( QString( "Track %1" ).arg( plot->plotCount() ) );
plotTrack->setDescription( trackName );
plot->loadDataAndUpdate();
@@ -121,11 +141,16 @@ void RicNewMultiPhaseRftSegmentPlotFeature::appendTrackAndCurveForBranchType( Ri
QString templateText = RiaDefines::namingVariableResultName() + ", " + RiaDefines::namingVariableResultType();
curve->setCurveNameTemplateText( templateText );
if ( resultName == "SEGGRAT" || resultName == "CONGRAT" )
{
curve->setScaleFactor( 1e-3 );
}
curve->setFillStyle( Qt::SolidPattern );
curve->setIsStacked( true );
curve->loadDataAndUpdate( true );
curve->updateAllRequiredEditors();
RiuPlotMainWindowTools::setExpanded( curve );
}
}

View File

@@ -39,6 +39,7 @@ private:
void setupActionLook( QAction* actionToSetup ) override;
void appendTrackAndCurveForBranchType( RimWellLogPlot* plot,
const QString& trackName,
const std::vector<QString>& resultNames,
const QString& wellName,
RiaDefines::RftBranchType branchType,

View File

@@ -23,6 +23,8 @@
#include "RicWellLogTools.h"
#include "RiaApplication.h"
#include "RiaColorTools.h"
#include "RiaPlotWindowRedrawScheduler.h"
#include "RiaRftDefines.h"
#include "RifReaderOpmRft.h"
@@ -30,6 +32,7 @@
#include "RimRftCase.h"
#include "RimRftTopologyCurve.h"
#include "RimSummaryCase.h"
#include "RimWellLogRftCurve.h"
#include "RimWellLogTrack.h"
#include "RiuPlotMainWindow.h"
@@ -69,6 +72,8 @@ void RicNewRftSegmentWellLogPlotFeature::onActionTriggered( bool isChecked )
plot->setPlotTitleVisible( true );
plot->setLegendItemsClickable( false );
plot->enableDepthMarkerLine( true );
plot->setLegendPosition( RimPlotWindow::LegendPosition::INSIDE_UPPER_LEFT );
plot->setLegendFontSize( caf::FontTools::RelativeSize::XSmall );
QString wellName = "Unknown";
@@ -79,48 +84,80 @@ void RicNewRftSegmentWellLogPlotFeature::onActionTriggered( bool isChecked )
if ( !wellNames.empty() ) wellName = *wellNames.begin();
}
QString resultName = "SEGGRAT";
std::vector<RiaDefines::RftBranchType> branchTypes{ RiaDefines::RftBranchType::RFT_ANNULUS,
RiaDefines::RftBranchType::RFT_DEVICE,
RiaDefines::RftBranchType::RFT_TUBING };
for ( auto branchType : branchTypes )
{
appendTrackAndCurveForBranchType( plot, resultName, wellName, branchType, summaryCase );
RimWellLogTrack* plotTrack = new RimWellLogTrack();
plot->addPlot( plotTrack );
plotTrack->setDescription( "Connection Rates" );
auto curve =
createAndAddCurve( plotTrack, "CONGRAT", wellName, RiaDefines::RftBranchType::RFT_ANNULUS, summaryCase );
curve->setScaleFactor( 1e-3 );
curve->setFillStyle( Qt::SolidPattern );
}
for ( auto branchType : { RiaDefines::RftBranchType::RFT_ANNULUS,
RiaDefines::RftBranchType::RFT_DEVICE,
RiaDefines::RftBranchType::RFT_TUBING } )
{
QString resultName = "SEGGRAT";
QString trackName = "Segment Rates";
auto curve = appendTrackAndCurveForBranchType( plot, trackName, resultName, wellName, branchType, summaryCase );
curve->setScaleFactor( 1e-3 );
curve->setFillStyle( Qt::SolidPattern );
}
appendPressureTrack( plot, wellName, summaryCase );
appendConnectionFactorTrack( plot, wellName, summaryCase );
appendTopologyTrack( plot, wellName, summaryCase );
plot->loadDataAndUpdate();
RiaPlotWindowRedrawScheduler::instance()->performScheduledUpdatesAndReplots();
plot->updateLayout();
RiuPlotMainWindowTools::onObjectAppended( plot );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewRftSegmentWellLogPlotFeature::appendTrackAndCurveForBranchType( RimWellLogPlot* plot,
RimWellLogRftCurve* RicNewRftSegmentWellLogPlotFeature::appendTrackAndCurveForBranchType( RimWellLogPlot* plot,
const QString& trackName,
const QString& resultName,
const QString& wellName,
RiaDefines::RftBranchType branchType,
RimSummaryCase* summaryCase )
{
RimWellLogTrack* plotTrack = new RimWellLogTrack();
plot->addPlot( plotTrack );
plotTrack->setDescription( trackName );
plot->loadDataAndUpdate();
auto curve = createAndAddCurve( plotTrack, resultName, wellName, branchType, summaryCase );
curve->loadDataAndUpdate( true );
curve->updateAllRequiredEditors();
return curve;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellLogRftCurve* RicNewRftSegmentWellLogPlotFeature::createAndAddCurve( RimWellLogTrack* track,
const QString& resultName,
const QString& wellName,
RiaDefines::RftBranchType branchType,
RimSummaryCase* summaryCase )
{
RimWellLogTrack* plotTrack = new RimWellLogTrack();
plot->addPlot( plotTrack );
plotTrack->setDescription( QString( "Track %1" ).arg( plot->plotCount() ) );
plot->loadDataAndUpdate();
auto curve = RicWellLogTools::addSummaryRftSegmentCurve( plotTrack, resultName, wellName, branchType, summaryCase );
auto curve = RicWellLogTools::addSummaryRftSegmentCurve( track, resultName, wellName, branchType, summaryCase );
curve->setNamingMethod( RiaDefines::ObjectNamingMethod::TEMPLATE );
QString templateText = RiaDefines::namingVariableResultName() + ", " + RiaDefines::namingVariableResultType();
curve->setCurveNameTemplateText( templateText );
curve->loadDataAndUpdate( true );
curve->updateAllRequiredEditors();
RiuPlotMainWindowTools::setExpanded( curve );
return curve;
}
//--------------------------------------------------------------------------------------------------
@@ -205,6 +242,59 @@ void RicNewRftSegmentWellLogPlotFeature::appendTopologyTrack( RimWellLogPlot* pl
track->updateAllRequiredEditors();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewRftSegmentWellLogPlotFeature::appendPressureTrack( RimWellLogPlot* plot,
const QString& wellName,
RimSummaryCase* summaryCase )
{
auto track = new RimWellLogTrack();
track->setDescription( "Pressure" );
plot->addPlot( track );
QString resultName = "SEGPRES";
for ( auto branchType : { RiaDefines::RftBranchType::RFT_TUBING,
RiaDefines::RftBranchType::RFT_DEVICE,
RiaDefines::RftBranchType::RFT_ANNULUS } )
{
auto curve = createAndAddCurve( track, resultName, wellName, branchType, summaryCase );
auto color = RimRftTopologyCurve::colorForRftBranchType( branchType );
curve->setColor( color );
curve->setLineThickness( 3 );
}
auto curve = createAndAddCurve( track, "PRESSURE", wellName, RiaDefines::RftBranchType::RFT_ANNULUS, summaryCase );
curve->setLineThickness( 3 );
track->updateAllRequiredEditors();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewRftSegmentWellLogPlotFeature::appendConnectionFactorTrack( RimWellLogPlot* plot,
const QString& wellName,
RimSummaryCase* summaryCase )
{
QString trackName = "Connection Factors";
QString resultName = "CONFAC";
auto curve = appendTrackAndCurveForBranchType( plot,
trackName,
resultName,
wellName,
RiaDefines::RftBranchType::RFT_ANNULUS,
summaryCase );
auto curveColor = cvf::Color3f( cvf::Color3f::ColorIdent::ORANGE );
curve->setColor( curveColor );
auto fillColor = RiaColorTools::makeLighter( curveColor, 0.3f );
curve->setFillColor( fillColor );
curve->setFillStyle( Qt::SolidPattern );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -25,6 +25,8 @@
class RimWellLogPlot;
class RimSummaryCase;
class RimPlotCurve;
class RimWellLogTrack;
class RimWellLogRftCurve;
//==================================================================================================
///
@@ -35,6 +37,8 @@ class RicNewRftSegmentWellLogPlotFeature : public caf::CmdFeature
public:
static void appendTopologyTrack( RimWellLogPlot* plot, const QString& wellName, RimSummaryCase* summaryCase );
static void appendPressureTrack( RimWellLogPlot* plot, const QString& wellName, RimSummaryCase* summaryCase );
static void appendConnectionFactorTrack( RimWellLogPlot* plot, const QString& wellName, RimSummaryCase* summaryCase );
private:
bool isCommandEnabled() override;
@@ -42,11 +46,18 @@ private:
void setupActionLook( QAction* actionToSetup ) override;
void appendTrackAndCurveForBranchType( RimWellLogPlot* plot,
const QString& resultName,
const QString& wellName,
RiaDefines::RftBranchType branchType,
RimSummaryCase* summaryCase );
static RimWellLogRftCurve* appendTrackAndCurveForBranchType( RimWellLogPlot* plot,
const QString& trackName,
const QString& resultName,
const QString& wellName,
RiaDefines::RftBranchType branchType,
RimSummaryCase* summaryCase );
static RimWellLogRftCurve* createAndAddCurve( RimWellLogTrack* track,
const QString& resultName,
const QString& wellName,
RiaDefines::RftBranchType branchType,
RimSummaryCase* summaryCase );
static std::vector<RimPlotCurve*>
appendAdditionalDataSourceTrack( RimWellLogPlot* plot, const QString& wellName, RimSummaryCase* summaryCase );