mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#10663 WBS Plot: Import well log from CSV file.
Also compute SH_MK_MIN/EXP/MAX and FG_MK_MIN/EXP results.
This commit is contained in:
@@ -78,7 +78,7 @@ public:
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimWellPlotTools::hasPressureData( const RimWellLogLasFile* wellLogFile )
|
||||
bool RimWellPlotTools::hasPressureData( const RimWellLogFile* wellLogFile )
|
||||
{
|
||||
for ( RimWellLogFileChannel* const wellLogChannel : wellLogFile->wellLogChannels() )
|
||||
{
|
||||
@@ -92,7 +92,7 @@ bool RimWellPlotTools::hasPressureData( const RimWellLogLasFile* wellLogFile )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimWellPlotTools::hasPressureData( RimWellPath* wellPath )
|
||||
{
|
||||
for ( RimWellLogLasFile* const wellLogFile : wellPath->wellLogFiles() )
|
||||
for ( RimWellLogFile* const wellLogFile : wellPath->wellLogFiles() )
|
||||
{
|
||||
if ( hasPressureData( wellLogFile ) )
|
||||
{
|
||||
@@ -144,7 +144,7 @@ bool RimWellPlotTools::hasPressureData( RimEclipseResultCase* gridCase )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimWellPlotTools::hasFlowData( const RimWellLogLasFile* wellLogFile )
|
||||
bool RimWellPlotTools::hasFlowData( const RimWellLogFile* wellLogFile )
|
||||
{
|
||||
for ( RimWellLogFileChannel* const wellLogChannel : wellLogFile->wellLogChannels() )
|
||||
{
|
||||
@@ -158,7 +158,7 @@ bool RimWellPlotTools::hasFlowData( const RimWellLogLasFile* wellLogFile )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimWellPlotTools::hasFlowData( const RimWellPath* wellPath )
|
||||
{
|
||||
for ( RimWellLogLasFile* const wellLogFile : wellPath->wellLogFiles() )
|
||||
for ( RimWellLogFile* const wellLogFile : wellPath->wellLogFiles() )
|
||||
{
|
||||
if ( hasFlowData( wellLogFile ) )
|
||||
{
|
||||
@@ -268,20 +268,20 @@ void RimWellPlotTools::addTimeStepsToMap( std::map<QDateTime, std::set<RifDataSo
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimWellLogLasFile*> RimWellPlotTools::wellLogFilesContainingPressure( const QString& wellPathNameOrSimWellName )
|
||||
std::vector<RimWellLogFile*> RimWellPlotTools::wellLogFilesContainingPressure( const QString& wellPathNameOrSimWellName )
|
||||
{
|
||||
std::vector<RimWellLogLasFile*> wellLogFiles;
|
||||
const RimProject* const project = RimProject::current();
|
||||
std::vector<RimWellPath*> wellPaths = project->allWellPaths();
|
||||
std::vector<RimWellLogFile*> wellLogFiles;
|
||||
const RimProject* const project = RimProject::current();
|
||||
std::vector<RimWellPath*> wellPaths = project->allWellPaths();
|
||||
|
||||
for ( auto wellPath : wellPaths )
|
||||
{
|
||||
if ( !wellPathNameOrSimWellName.isEmpty() &&
|
||||
( wellPathNameOrSimWellName == wellPath->associatedSimulationWellName() || wellPathNameOrSimWellName == wellPath->name() ) )
|
||||
{
|
||||
const std::vector<RimWellLogLasFile*> files = wellPath->wellLogFiles();
|
||||
const std::vector<RimWellLogFile*> files = wellPath->wellLogFiles();
|
||||
|
||||
for ( RimWellLogLasFile* file : files )
|
||||
for ( RimWellLogFile* file : files )
|
||||
{
|
||||
if ( hasPressureData( file ) )
|
||||
{
|
||||
@@ -297,7 +297,7 @@ std::vector<RimWellLogLasFile*> RimWellPlotTools::wellLogFilesContainingPressure
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellLogFileChannel* RimWellPlotTools::getPressureChannelFromWellFile( const RimWellLogLasFile* wellLogFile )
|
||||
RimWellLogFileChannel* RimWellPlotTools::getPressureChannelFromWellFile( const RimWellLogFile* wellLogFile )
|
||||
{
|
||||
if ( wellLogFile != nullptr )
|
||||
{
|
||||
@@ -315,19 +315,19 @@ RimWellLogFileChannel* RimWellPlotTools::getPressureChannelFromWellFile( const R
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimWellLogLasFile*> RimWellPlotTools::wellLogFilesContainingFlow( const QString& wellPathName )
|
||||
std::vector<RimWellLogFile*> RimWellPlotTools::wellLogFilesContainingFlow( const QString& wellPathName )
|
||||
{
|
||||
std::vector<RimWellLogLasFile*> wellLogFiles;
|
||||
const RimProject* const project = RimProject::current();
|
||||
std::vector<RimWellPath*> wellPaths = project->allWellPaths();
|
||||
std::vector<RimWellLogFile*> wellLogFiles;
|
||||
const RimProject* const project = RimProject::current();
|
||||
std::vector<RimWellPath*> wellPaths = project->allWellPaths();
|
||||
|
||||
for ( auto wellPath : wellPaths )
|
||||
{
|
||||
if ( wellPath->name() == wellPathName )
|
||||
{
|
||||
std::vector<RimWellLogLasFile*> files = wellPath->wellLogFiles();
|
||||
std::vector<RimWellLogFile*> files = wellPath->wellLogFiles();
|
||||
|
||||
for ( RimWellLogLasFile* file : files )
|
||||
for ( RimWellLogFile* file : files )
|
||||
{
|
||||
if ( hasFlowData( file ) )
|
||||
{
|
||||
@@ -342,14 +342,14 @@ std::vector<RimWellLogLasFile*> RimWellPlotTools::wellLogFilesContainingFlow( co
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellPath* RimWellPlotTools::wellPathFromWellLogFile( const RimWellLogLasFile* wellLogFile )
|
||||
RimWellPath* RimWellPlotTools::wellPathFromWellLogFile( const RimWellLogFile* wellLogFile )
|
||||
{
|
||||
RimProject* const project = RimProject::current();
|
||||
for ( const auto& oilField : project->oilFields )
|
||||
{
|
||||
for ( const auto& wellPath : oilField->wellPathCollection()->allWellPaths() )
|
||||
{
|
||||
for ( RimWellLogLasFile* const file : wellPath->wellLogFiles() )
|
||||
for ( RimWellLogFile* const file : wellPath->wellLogFiles() )
|
||||
{
|
||||
if ( file == wellLogFile )
|
||||
{
|
||||
@@ -676,7 +676,7 @@ RiaRftPltCurveDefinition RimWellPlotTools::curveDefFromCurve( const RimWellLogCu
|
||||
}
|
||||
else if ( wellLogFileCurve != nullptr )
|
||||
{
|
||||
RimWellLogLasFile* const wellLogFile = wellLogFileCurve->wellLogFile();
|
||||
RimWellLogFile* const wellLogFile = wellLogFileCurve->wellLogFile();
|
||||
|
||||
if ( wellLogFile != nullptr )
|
||||
{
|
||||
@@ -684,7 +684,10 @@ RiaRftPltCurveDefinition RimWellPlotTools::curveDefFromCurve( const RimWellLogCu
|
||||
|
||||
if ( date.isValid() )
|
||||
{
|
||||
return RiaRftPltCurveDefinition( RifDataSourceForRftPlt( wellLogFile ), wellLogFile->wellName(), date );
|
||||
if ( auto wellLogLasFile = dynamic_cast<RimWellLogLasFile*>( wellLogFile ) )
|
||||
{
|
||||
return RiaRftPltCurveDefinition( RifDataSourceForRftPlt( wellLogLasFile ), wellLogFile->wellName(), date );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,24 +75,24 @@ public:
|
||||
static bool isTotalFlowChannel( const QString& channelName );
|
||||
static FlowPhase flowPhaseFromChannelName( const QString& channelName );
|
||||
|
||||
static std::vector<RimWellLogLasFile*> wellLogFilesContainingFlow( const QString& wellName );
|
||||
static RimWellPath* wellPathByWellPathNameOrSimWellName( const QString& wellPathNameOrSimwellName );
|
||||
static std::vector<RimWellLogFile*> wellLogFilesContainingFlow( const QString& wellName );
|
||||
static RimWellPath* wellPathByWellPathNameOrSimWellName( const QString& wellPathNameOrSimwellName );
|
||||
|
||||
// RFT Only
|
||||
private:
|
||||
static std::pair<RigEclipseResultAddress, QString> pressureResultDataInfo( const RigEclipseCaseData* eclipseCaseData );
|
||||
|
||||
public:
|
||||
static void addTimeStepsToMap( std::map<QDateTime, std::set<RifDataSourceForRftPlt>>& destMap,
|
||||
const std::map<QDateTime, std::set<RifDataSourceForRftPlt>>& timeStepsToAdd );
|
||||
static std::vector<RimWellLogLasFile*> wellLogFilesContainingPressure( const QString& wellPathNameOrSimWellName );
|
||||
static RimWellLogFileChannel* getPressureChannelFromWellFile( const RimWellLogLasFile* wellLogFile );
|
||||
static RimWellPath* wellPathFromWellLogFile( const RimWellLogLasFile* wellLogFile );
|
||||
static void addTimeStepsToMap( std::map<QDateTime, std::set<RifDataSourceForRftPlt>>& destMap,
|
||||
const std::map<QDateTime, std::set<RifDataSourceForRftPlt>>& timeStepsToAdd );
|
||||
static std::vector<RimWellLogFile*> wellLogFilesContainingPressure( const QString& wellPathNameOrSimWellName );
|
||||
static RimWellLogFileChannel* getPressureChannelFromWellFile( const RimWellLogFile* wellLogFile );
|
||||
static RimWellPath* wellPathFromWellLogFile( const RimWellLogFile* wellLogFile );
|
||||
static std::map<QDateTime, std::set<RifDataSourceForRftPlt>> timeStepsMapFromGridCase( RimEclipseCase* gridCase );
|
||||
static RiaRftPltCurveDefinition curveDefFromCurve( const RimWellLogCurve* curve );
|
||||
|
||||
// others
|
||||
static bool hasFlowData( const RimWellLogLasFile* wellLogFile );
|
||||
static bool hasFlowData( const RimWellLogFile* wellLogFile );
|
||||
static bool hasAssociatedWellPath( const QString& wellName );
|
||||
|
||||
// Both
|
||||
@@ -145,7 +145,7 @@ private:
|
||||
|
||||
static std::set<QString> FLOW_DATA_NAMES;
|
||||
|
||||
static bool hasPressureData( const RimWellLogLasFile* wellLogFile );
|
||||
static bool hasPressureData( const RimWellLogFile* wellLogFile );
|
||||
static bool isPressureChannel( RimWellLogFileChannel* channel );
|
||||
static bool hasPressureData( RimEclipseResultCase* gridCase );
|
||||
static bool hasPressureData( RimWellPath* wellPath );
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
#include "RimSummaryCurveAppearanceCalculator.h"
|
||||
#include "RimWellFlowRateCurve.h"
|
||||
#include "RimWellLogExtractionCurve.h"
|
||||
#include "RimWellLogFile.h"
|
||||
#include "RimWellLogFileChannel.h"
|
||||
#include "RimWellLogLasFile.h"
|
||||
#include "RimWellLogLasFileCurve.h"
|
||||
@@ -780,10 +781,13 @@ QList<caf::PdmOptionItemInfo> RimWellPltPlot::calculateValueOptions( const caf::
|
||||
|
||||
for ( const auto& wellLogFile : wellLogFiles )
|
||||
{
|
||||
auto addr = RifDataSourceForRftPlt( wellLogFile );
|
||||
auto item = caf::PdmOptionItemInfo( wellLogFile->name(), QVariant::fromValue( addr ) );
|
||||
item.setLevel( 1 );
|
||||
options.push_back( item );
|
||||
if ( auto wellLogLasFile = dynamic_cast<RimWellLogLasFile*>( wellLogFile ) )
|
||||
{
|
||||
auto addr = RifDataSourceForRftPlt( wellLogLasFile );
|
||||
auto item = caf::PdmOptionItemInfo( wellLogFile->name(), QVariant::fromValue( addr ) );
|
||||
item.setLevel( 1 );
|
||||
options.push_back( item );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -994,8 +998,11 @@ void RimWellPltPlot::initAfterLoad()
|
||||
{
|
||||
for ( const auto& wellLogFile : wellLogFiles )
|
||||
{
|
||||
auto addr = RifDataSourceForRftPlt( wellLogFile );
|
||||
selectedSources.push_back( addr );
|
||||
if ( auto wellLogLasFile = dynamic_cast<RimWellLogLasFile*>( wellLogFile ) )
|
||||
{
|
||||
auto addr = RifDataSourceForRftPlt( wellLogLasFile );
|
||||
selectedSources.push_back( addr );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -294,12 +294,15 @@ void RimWellRftPlot::applyInitialSelections( std::variant<RimSummaryCase*, RimSu
|
||||
if ( ensemble ) sourcesToSelect.push_back( RifDataSourceForRftPlt( ensemble ) );
|
||||
}
|
||||
|
||||
std::vector<RimWellLogLasFile*> wellLogFiles = RimWellPlotTools::wellLogFilesContainingPressure( m_wellPathNameOrSimWellName );
|
||||
std::vector<RimWellLogFile*> wellLogFiles = RimWellPlotTools::wellLogFilesContainingPressure( m_wellPathNameOrSimWellName );
|
||||
if ( !wellLogFiles.empty() )
|
||||
{
|
||||
for ( RimWellLogLasFile* const wellLogFile : wellLogFiles )
|
||||
for ( RimWellLogFile* const wellLogFile : wellLogFiles )
|
||||
{
|
||||
sourcesToSelect.push_back( RifDataSourceForRftPlt( wellLogFile ) );
|
||||
if ( auto wellLogLasFile = dynamic_cast<RimWellLogLasFile*>( wellLogFile ) )
|
||||
{
|
||||
sourcesToSelect.push_back( RifDataSourceForRftPlt( wellLogLasFile ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -721,9 +724,12 @@ std::vector<RifDataSourceForRftPlt> RimWellRftPlot::selectedSourcesExpanded() co
|
||||
{
|
||||
if ( addr.sourceType() == RifDataSourceForRftPlt::SourceType::OBSERVED_LAS_FILE )
|
||||
{
|
||||
for ( RimWellLogLasFile* const wellLogFile : RimWellPlotTools::wellLogFilesContainingPressure( m_wellPathNameOrSimWellName ) )
|
||||
for ( RimWellLogFile* const wellLogFile : RimWellPlotTools::wellLogFilesContainingPressure( m_wellPathNameOrSimWellName ) )
|
||||
{
|
||||
sources.push_back( RifDataSourceForRftPlt( wellLogFile ) );
|
||||
if ( auto wellLogLasFile = dynamic_cast<RimWellLogLasFile*>( wellLogFile ) )
|
||||
{
|
||||
sources.push_back( RifDataSourceForRftPlt( wellLogLasFile ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -931,10 +937,13 @@ QList<caf::PdmOptionItemInfo> RimWellRftPlot::calculateValueOptionsForSources()
|
||||
|
||||
for ( const auto& wellLogFile : wellLogFiles )
|
||||
{
|
||||
auto addr = RifDataSourceForRftPlt( wellLogFile );
|
||||
auto item = caf::PdmOptionItemInfo( "Observed Data", QVariant::fromValue( addr ) );
|
||||
item.setLevel( 1 );
|
||||
options.push_back( item );
|
||||
if ( auto wellLogLasFile = dynamic_cast<RimWellLogLasFile*>( wellLogFile ) )
|
||||
{
|
||||
auto addr = RifDataSourceForRftPlt( wellLogLasFile );
|
||||
auto item = caf::PdmOptionItemInfo( "Observed Data", QVariant::fromValue( addr ) );
|
||||
item.setLevel( 1 );
|
||||
options.push_back( item );
|
||||
}
|
||||
}
|
||||
}
|
||||
const std::vector<RimObservedFmuRftData*> observedFmuRftCases = RimWellPlotTools::observedFmuRftDataForWell( m_wellPathNameOrSimWellName );
|
||||
|
||||
Reference in New Issue
Block a user