#7049 MLW: Aggregate of completion data for all laterals

Simplify the progress bar
This commit is contained in:
Magne Sjaastad committed 2021-05-18 16:22:05 +02:00
1 parent 4a4db5a3f2
commit 226876dc0a
1 file changed
+42 -75
@@ -110,30 +110,7 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions( const std::v
if ( exportSettings.compdatExport == RicExportCompletionDataSettingsUi::TRANSMISSIBILITIES || if ( exportSettings.compdatExport == RicExportCompletionDataSettingsUi::TRANSMISSIBILITIES ||
exportSettings.compdatExport == RicExportCompletionDataSettingsUi::WPIMULT_AND_DEFAULT_CONNECTION_FACTORS ) exportSettings.compdatExport == RicExportCompletionDataSettingsUi::WPIMULT_AND_DEFAULT_CONNECTION_FACTORS )
{ {
std::vector<RimWellPath*> allWellPathLaterals;
for ( RimWellPath* wellPath : topLevelWellPaths )
{
if ( wellPath->unitSystem() == exportSettings.caseToApply->eclipseCaseData()->unitsType() )
{
auto tieInWells = wellPath->wellPathLateralsRecursively();
for ( auto w : tieInWells )
{
allWellPathLaterals.push_back( w );
}
}
else
{
int caseId = exportSettings.caseToApply->caseId();
QString format =
QString( "Unit systems for well path \"%1\" must match unit system of chosen eclipse case \"%2\"" );
QString errMsg = format.arg( wellPath->name() ).arg( caseId );
RiaLogging::error( errMsg );
}
}
std::vector<RicWellPathFractureReportItem> fractureDataReportItems; std::vector<RicWellPathFractureReportItem> fractureDataReportItems;
// FractureTransmissibilityExportInformation
std::unique_ptr<QTextStream> fractureTransmissibilityExportInformationStream = nullptr; std::unique_ptr<QTextStream> fractureTransmissibilityExportInformationStream = nullptr;
QFile fractureTransmissibilityExportInformationFile; QFile fractureTransmissibilityExportInformationFile;
@@ -164,28 +141,38 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions( const std::v
} }
} }
size_t maxProgress =
allWellPathLaterals.size() * 3 + simWells.size() +
( exportSettings.fileSplit == RicExportCompletionDataSettingsUi::SPLIT_ON_WELL
? allWellPathLaterals.size()
: exportSettings.fileSplit == RicExportCompletionDataSettingsUi::SPLIT_ON_WELL_AND_COMPLETION_TYPE
? allWellPathLaterals.size() * 3
: 1 ) +
simWells.size();
caf::ProgressInfo progress( maxProgress, "Export Completions" );
progress.setProgressDescription( "Read Completion Data" );
std::vector<RigCompletionData> completions; std::vector<RigCompletionData> completions;
for ( auto wellPath : allWellPathLaterals )
{ {
caf::ProgressInfo progress( topLevelWellPaths.size(), "Extracting Completion Data For Well Paths" );
for ( RimWellPath* wellPath : topLevelWellPaths )
{
std::vector<RimWellPath*> allWellPathLaterals;
if ( wellPath->unitSystem() == exportSettings.caseToApply->eclipseCaseData()->unitsType() )
{
auto tieInWells = wellPath->wellPathLateralsRecursively();
for ( auto w : tieInWells )
{
allWellPathLaterals.push_back( w );
}
}
else
{
int caseId = exportSettings.caseToApply->caseId();
QString format = QString(
"Unit systems for well path \"%1\" must match unit system of chosen eclipse case \"%2\"" );
QString errMsg = format.arg( wellPath->name() ).arg( caseId );
RiaLogging::error( errMsg );
}
std::map<size_t, std::vector<RigCompletionData>> completionsPerEclipseCellAllCompletionTypes; std::map<size_t, std::vector<RigCompletionData>> completionsPerEclipseCellAllCompletionTypes;
std::map<size_t, std::vector<RigCompletionData>> completionsPerEclipseCellFishbones; std::map<size_t, std::vector<RigCompletionData>> completionsPerEclipseCellFishbones;
std::map<size_t, std::vector<RigCompletionData>> completionsPerEclipseCellFracture; std::map<size_t, std::vector<RigCompletionData>> completionsPerEclipseCellFracture;
std::map<size_t, std::vector<RigCompletionData>> completionsPerEclipseCellPerforations; std::map<size_t, std::vector<RigCompletionData>> completionsPerEclipseCellPerforations;
for ( auto wellPath : allWellPathLaterals )
{
// Generate completion data // Generate completion data
if ( exportSettings.includePerforations ) if ( exportSettings.includePerforations )
@@ -198,17 +185,16 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions( const std::v
appendCompletionData( &completionsPerEclipseCellAllCompletionTypes, perforationCompletionData ); appendCompletionData( &completionsPerEclipseCellAllCompletionTypes, perforationCompletionData );
appendCompletionData( &completionsPerEclipseCellPerforations, perforationCompletionData ); appendCompletionData( &completionsPerEclipseCellPerforations, perforationCompletionData );
} }
progress.incrementProgress();
if ( exportSettings.includeFishbones ) if ( exportSettings.includeFishbones )
{ {
std::vector<RigCompletionData> fishbonesCompletionData = RicFishbonesTransmissibilityCalculationFeatureImp:: std::vector<RigCompletionData> fishbonesCompletionData =
RicFishbonesTransmissibilityCalculationFeatureImp::
generateFishboneCompdatValuesUsingAdjustedCellVolume( wellPath, exportSettings ); generateFishboneCompdatValuesUsingAdjustedCellVolume( wellPath, exportSettings );
appendCompletionData( &completionsPerEclipseCellAllCompletionTypes, fishbonesCompletionData ); appendCompletionData( &completionsPerEclipseCellAllCompletionTypes, fishbonesCompletionData );
appendCompletionData( &completionsPerEclipseCellFishbones, fishbonesCompletionData ); appendCompletionData( &completionsPerEclipseCellFishbones, fishbonesCompletionData );
} }
progress.incrementProgress();
if ( exportSettings.includeFractures() ) if ( exportSettings.includeFractures() )
{ {
@@ -224,11 +210,13 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions( const std::v
PressureDepletionParameters( exportSettings.performTransScaling(), PressureDepletionParameters( exportSettings.performTransScaling(),
exportSettings.transScalingTimeStep(), exportSettings.transScalingTimeStep(),
exportSettings.transScalingWBHPSource(), exportSettings.transScalingWBHPSource(),
exportSettings.transScalingWBHP() ) ); exportSettings
.transScalingWBHP() ) );
appendCompletionData( &completionsPerEclipseCellAllCompletionTypes, fractureCompletionData ); appendCompletionData( &completionsPerEclipseCellAllCompletionTypes, fractureCompletionData );
appendCompletionData( &completionsPerEclipseCellFracture, fractureCompletionData ); appendCompletionData( &completionsPerEclipseCellFracture, fractureCompletionData );
} }
}
if ( exportSettings.reportCompletionsTypesIndividually() ) if ( exportSettings.reportCompletionsTypesIndividually() )
{ {
@@ -257,6 +245,7 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions( const std::v
progress.incrementProgress(); progress.incrementProgress();
} }
}
for ( auto simWell : simWells ) for ( auto simWell : simWells )
{ {
@@ -278,13 +267,10 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions( const std::v
{ {
completions.push_back( combineEclipseCellCompletions( data.second, exportSettings ) ); completions.push_back( combineEclipseCellCompletions( data.second, exportSettings ) );
} }
progress.incrementProgress();
} }
const QString eclipseCaseName = exportSettings.caseToApply->caseUserDescription(); const QString eclipseCaseName = exportSettings.caseToApply->caseUserDescription();
progress.setProgressDescription( "Write Export Files" );
if ( exportSettings.fileSplit == RicExportCompletionDataSettingsUi::UNIFIED_FILE ) if ( exportSettings.fileSplit == RicExportCompletionDataSettingsUi::UNIFIED_FILE )
{ {
QString fileName = exportSettings.customFileName(); QString fileName = exportSettings.customFileName();
@@ -298,7 +284,6 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions( const std::v
exportSettings.compdatExport, exportSettings.compdatExport,
exportSettings.exportDataSourceAsComment(), exportSettings.exportDataSourceAsComment(),
exportSettings.exportWelspec() ); exportSettings.exportWelspec() );
progress.incrementProgress();
} }
else if ( exportSettings.fileSplit == RicExportCompletionDataSettingsUi::SPLIT_ON_WELL ) else if ( exportSettings.fileSplit == RicExportCompletionDataSettingsUi::SPLIT_ON_WELL )
{ {
@@ -333,7 +318,6 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions( const std::v
exportSettings.compdatExport, exportSettings.compdatExport,
exportSettings.exportDataSourceAsComment(), exportSettings.exportDataSourceAsComment(),
exportSettings.exportWelspec() ); exportSettings.exportWelspec() );
progress.incrementProgress();
} }
} }
else if ( exportSettings.fileSplit == RicExportCompletionDataSettingsUi::SPLIT_ON_WELL_AND_COMPLETION_TYPE ) else if ( exportSettings.fileSplit == RicExportCompletionDataSettingsUi::SPLIT_ON_WELL_AND_COMPLETION_TYPE )
@@ -361,6 +345,18 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions( const std::v
if ( completionsForWell.empty() ) continue; if ( completionsForWell.empty() ) continue;
std::vector<RicWellPathFractureReportItem> reportItemsForWell;
if ( completionType == RigCompletionData::FRACTURE )
{
for ( const auto& fracItem : fractureDataReportItems )
{
if ( fracItem.wellPathNameForExport() == wellPath->completionSettings()->wellNameForExport() )
{
reportItemsForWell.push_back( fracItem );
}
}
}
{ {
QString completionTypeText; QString completionTypeText;
if ( completionType == RigCompletionData::FISHBONES ) completionTypeText = "Fishbones"; if ( completionType == RigCompletionData::FISHBONES ) completionTypeText = "Fishbones";
@@ -369,18 +365,6 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions( const std::v
QString fileName = QString fileName =
QString( "%1_%2_%3" ).arg( wellPath->name() ).arg( completionTypeText ).arg( eclipseCaseName ); QString( "%1_%2_%3" ).arg( wellPath->name() ).arg( completionTypeText ).arg( eclipseCaseName );
if ( completionType == RigCompletionData::FRACTURE )
{
std::vector<RicWellPathFractureReportItem> reportItemsForWell;
for ( const auto& fracItem : fractureDataReportItems )
{
if ( fracItem.wellPathNameForExport() ==
wellPath->completionSettings()->wellNameForExport() )
{
reportItemsForWell.push_back( fracItem );
}
}
sortAndExportCompletionsToFile( exportSettings.caseToApply, sortAndExportCompletionsToFile( exportSettings.caseToApply,
exportSettings.folder, exportSettings.folder,
fileName, fileName,
@@ -390,21 +374,6 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions( const std::v
exportSettings.exportDataSourceAsComment(), exportSettings.exportDataSourceAsComment(),
exportSettings.exportWelspec() ); exportSettings.exportWelspec() );
} }
else
{
std::vector<RicWellPathFractureReportItem> emptyReportItemVector;
sortAndExportCompletionsToFile( exportSettings.caseToApply,
exportSettings.folder,
fileName,
completionsForWell,
emptyReportItemVector,
exportSettings.compdatExport,
exportSettings.exportDataSourceAsComment(),
exportSettings.exportWelspec() );
}
}
progress.incrementProgress();
} }
} }
} }
@@ -435,8 +404,6 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions( const std::v
exportSettings.compdatExport, exportSettings.compdatExport,
exportSettings.exportDataSourceAsComment(), exportSettings.exportDataSourceAsComment(),
exportSettings.exportWelspec() ); exportSettings.exportWelspec() );
progress.incrementProgress();
} }
} }
} }