#6878 Export Completion: Add custom file name

This commit is contained in:
Magne Sjaastad 2021-04-30 13:51:15 +02:00
parent be8bca91a3
commit 3fa4986f37
7 changed files with 235 additions and 140 deletions

View File

@ -123,6 +123,9 @@ RicExportCompletionDataSettingsUi::RicExportCompletionDataSettingsUi()
"", "",
"" ); "" );
CAF_PDM_InitField( &m_useCustomFileName, "UseCustomFileName", false, "Use Custom Filename", "", "", "" );
CAF_PDM_InitField( &m_customFileName, "CustomFileName", {}, "Custom Filename", "", "", "" );
m_displayForSimWell = true; m_displayForSimWell = true;
m_fracturesEnabled = true; m_fracturesEnabled = true;
@ -226,6 +229,16 @@ bool RicExportCompletionDataSettingsUi::exportCompletionWelspecAfterMainBore() c
return m_completionWelspecAfterMainBore(); return m_completionWelspecAfterMainBore();
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RicExportCompletionDataSettingsUi::customFileName() const
{
if ( m_useCustomFileName ) return m_customFileName();
return {};
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -349,6 +362,14 @@ void RicExportCompletionDataSettingsUi::defineUiOrdering( QString uiConfigName,
group->add( &fileSplit ); group->add( &fileSplit );
group->add( &m_reportCompletionTypesSeparately ); group->add( &m_reportCompletionTypesSeparately );
group->add( &folder ); group->add( &folder );
if ( fileSplit() == UNIFIED_FILE )
{
group->add( &m_useCustomFileName );
group->add( &m_customFileName );
m_customFileName.uiCapability()->setUiReadOnly( !m_useCustomFileName );
}
} }
{ {

View File

@ -100,6 +100,8 @@ public:
bool exportWelspec() const; bool exportWelspec() const;
bool exportCompletionWelspecAfterMainBore() const; bool exportCompletionWelspecAfterMainBore() const;
QString customFileName() const;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
protected: protected:
@ -111,9 +113,12 @@ protected:
private: private:
caf::PdmField<CombinationModeType> m_reportCompletionTypesSeparately; caf::PdmField<CombinationModeType> m_reportCompletionTypesSeparately;
caf::PdmField<bool> m_exportDataSourceAsComment;
caf::PdmField<bool> m_exportWelspec; caf::PdmField<bool> m_exportDataSourceAsComment;
caf::PdmField<bool> m_completionWelspecAfterMainBore; caf::PdmField<bool> m_exportWelspec;
caf::PdmField<bool> m_completionWelspecAfterMainBore;
caf::PdmField<bool> m_useCustomFileName;
caf::PdmField<QString> m_customFileName;
bool m_displayForSimWell; bool m_displayForSimWell;
bool m_fracturesEnabled; bool m_fracturesEnabled;

View File

@ -220,7 +220,9 @@ void RicMswTableFormatterTools::writeWelsegsCompletionCommentHeader( RifTextData
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RicMswTableFormatterTools::generateCompsegTables( RifTextDataTableFormatter& formatter, RicMswExportInfo& exportInfo ) void RicMswTableFormatterTools::generateCompsegTables( RifTextDataTableFormatter& formatter,
RicMswExportInfo& exportInfo,
bool exportLgrData )
{ {
/* /*
* TODO: Creating the regular perforation COMPSEGS table should come in here, before the others * TODO: Creating the regular perforation COMPSEGS table should come in here, before the others
@ -229,94 +231,43 @@ void RicMswTableFormatterTools::generateCompsegTables( RifTextDataTableFormatter
std::set<size_t> intersectedCells; std::set<size_t> intersectedCells;
{ std::set<RigCompletionData::CompletionType> perforationTypes = { RigCompletionData::PERFORATION,
std::set<RigCompletionData::CompletionType> perforationTypes = { RigCompletionData::PERFORATION, RigCompletionData::PERFORATION_ICD,
RigCompletionData::PERFORATION_ICD, RigCompletionData::PERFORATION_ICV,
RigCompletionData::PERFORATION_ICV, RigCompletionData::PERFORATION_AICD };
RigCompletionData::PERFORATION_AICD };
{ std::set<RigCompletionData::CompletionType> fishbonesTypes = { RigCompletionData::FISHBONES_ICD,
bool headerGenerated = false; RigCompletionData::FISHBONES };
generateCompsegTable( formatter,
exportInfo,
exportInfo.mainBoreBranch(),
false,
perforationTypes,
&headerGenerated,
&intersectedCells );
if ( headerGenerated ) formatter.tableCompleted(); std::set<RigCompletionData::CompletionType> fractureTypes = { RigCompletionData::FRACTURE };
}
if ( exportInfo.hasSubGridIntersections() )
{
bool headerGenerated = false;
generateCompsegTable( formatter,
exportInfo,
exportInfo.mainBoreBranch(),
true,
perforationTypes,
&headerGenerated,
&intersectedCells );
if ( headerGenerated ) formatter.tableCompleted();
}
}
{ {
std::set<RigCompletionData::CompletionType> fishbonesTypes = { RigCompletionData::FISHBONES_ICD, bool headerGenerated = false;
RigCompletionData::FISHBONES }; generateCompsegTable( formatter,
{ exportInfo,
bool headerGenerated = false; exportInfo.mainBoreBranch(),
generateCompsegTable( formatter, exportLgrData,
exportInfo, perforationTypes,
exportInfo.mainBoreBranch(), &headerGenerated,
false, &intersectedCells );
fishbonesTypes,
&headerGenerated,
&intersectedCells );
if ( headerGenerated ) formatter.tableCompleted();
}
if ( exportInfo.hasSubGridIntersections() )
{
bool headerGenerated = false;
generateCompsegTable( formatter,
exportInfo,
exportInfo.mainBoreBranch(),
true,
fishbonesTypes,
&headerGenerated,
&intersectedCells );
if ( headerGenerated ) formatter.tableCompleted();
}
}
{ generateCompsegTable( formatter,
std::set<RigCompletionData::CompletionType> fractureTypes = { RigCompletionData::FRACTURE }; exportInfo,
exportInfo.mainBoreBranch(),
exportLgrData,
fishbonesTypes,
&headerGenerated,
&intersectedCells );
{ generateCompsegTable( formatter,
bool headerGenerated = false; exportInfo,
generateCompsegTable( formatter, exportInfo.mainBoreBranch(),
exportInfo, exportLgrData,
exportInfo.mainBoreBranch(), fractureTypes,
false, &headerGenerated,
fractureTypes, &intersectedCells );
&headerGenerated,
&intersectedCells );
if ( headerGenerated ) formatter.tableCompleted();
}
if ( exportInfo.hasSubGridIntersections() ) if ( headerGenerated ) formatter.tableCompleted();
{
bool headerGenerated = false;
generateCompsegTable( formatter,
exportInfo,
exportInfo.mainBoreBranch(),
true,
fractureTypes,
&headerGenerated,
&intersectedCells );
if ( headerGenerated ) formatter.tableCompleted();
}
} }
} }

View File

@ -97,7 +97,7 @@ void writeCompletionsForSegment( gsl::not_null<const RicMswSegment*> outletSegme
void writeWelsegsCompletionCommentHeader( RifTextDataTableFormatter& formatter, void writeWelsegsCompletionCommentHeader( RifTextDataTableFormatter& formatter,
RigCompletionData::CompletionType completionType ); RigCompletionData::CompletionType completionType );
void generateCompsegTables( RifTextDataTableFormatter& formatter, RicMswExportInfo& exportInfo ); void generateCompsegTables( RifTextDataTableFormatter& formatter, RicMswExportInfo& exportInfo, bool exportLgrData );
void generateCompsegTable( RifTextDataTableFormatter& formatter, void generateCompsegTable( RifTextDataTableFormatter& formatter,
RicMswExportInfo& exportInfo, RicMswExportInfo& exportInfo,

View File

@ -287,7 +287,9 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions( const std::v
progress.setProgressDescription( "Write Export Files" ); progress.setProgressDescription( "Write Export Files" );
if ( exportSettings.fileSplit == RicExportCompletionDataSettingsUi::UNIFIED_FILE ) if ( exportSettings.fileSplit == RicExportCompletionDataSettingsUi::UNIFIED_FILE )
{ {
QString fileName = QString( "UnifiedCompletions_%1" ).arg( eclipseCaseName ); QString fileName = exportSettings.customFileName();
if ( fileName.isEmpty() ) fileName = QString( "UnifiedCompletions_%1" ).arg( eclipseCaseName );
sortAndExportCompletionsToFile( exportSettings.caseToApply, sortAndExportCompletionsToFile( exportSettings.caseToApply,
exportSettings.folder, exportSettings.folder,
fileName, fileName,

View File

@ -66,17 +66,27 @@ void RicWellPathExportMswCompletionsImpl::exportWellSegmentsForAllCompletions(
const std::vector<RimWellPath*>& wellPaths ) const std::vector<RimWellPath*>& wellPaths )
{ {
std::shared_ptr<QFile> unifiedExportFile; std::shared_ptr<QFile> unifiedExportFile;
std::shared_ptr<QFile> unifiedLgrExportFile;
if ( exportSettings.fileSplit() == RicExportCompletionDataSettingsUi::UNIFIED_FILE ) if ( exportSettings.fileSplit() == RicExportCompletionDataSettingsUi::UNIFIED_FILE )
{ {
QString unifiedFileName = QString fileName;
QString( "UnifiedCompletions_MSW_%1" ).arg( exportSettings.caseToApply->caseUserDescription() );
unifiedExportFile = if ( !exportSettings.customFileName().isEmpty() )
RicWellPathExportCompletionsFileTools::openFileForExport( exportSettings.folder, unifiedFileName ); fileName = exportSettings.customFileName() + "_MSW";
else
fileName = QString( "UnifiedCompletions_MSW_%1" ).arg( exportSettings.caseToApply->caseUserDescription() );
unifiedExportFile = RicWellPathExportCompletionsFileTools::openFileForExport( exportSettings.folder, fileName );
QString lgrFileName = fileName + "_LGR";
unifiedLgrExportFile =
RicWellPathExportCompletionsFileTools::openFileForExport( exportSettings.folder, lgrFileName );
} }
for ( const auto& wellPath : wellPaths ) for ( const auto& wellPath : wellPaths )
{ {
std::shared_ptr<QFile> unifiedWellPathFile; std::shared_ptr<QFile> unifiedWellPathFile;
std::shared_ptr<QFile> unifiedLgrWellPathFile;
auto allCompletions = wellPath->allCompletionsRecursively(); auto allCompletions = wellPath->allCompletionsRecursively();
@ -98,17 +108,27 @@ void RicWellPathExportMswCompletionsImpl::exportWellSegmentsForAllCompletions(
.arg( wellPath->name(), exportSettings.caseToApply->caseUserDescription() ); .arg( wellPath->name(), exportSettings.caseToApply->caseUserDescription() );
unifiedWellPathFile = unifiedWellPathFile =
RicWellPathExportCompletionsFileTools::openFileForExport( exportSettings.folder, wellFileName ); RicWellPathExportCompletionsFileTools::openFileForExport( exportSettings.folder, wellFileName );
unifiedLgrWellPathFile =
RicWellPathExportCompletionsFileTools::openFileForExport( exportSettings.folder, wellFileName + "_LGR" );
} }
{ {
// Always use perforation functions to export well segments along well path. // Always use perforation functions to export well segments along well path.
// If no perforations are present, skip Perforation from file name // If no perforations are present, skip Perforation from file name
std::shared_ptr<QFile> perforationsExportFile; std::shared_ptr<QFile> exportFile;
std::shared_ptr<QFile> lgrExportFile;
if ( unifiedExportFile ) if ( unifiedExportFile )
perforationsExportFile = unifiedExportFile; {
exportFile = unifiedExportFile;
lgrExportFile = unifiedLgrExportFile;
}
else if ( unifiedWellPathFile ) else if ( unifiedWellPathFile )
perforationsExportFile = unifiedWellPathFile; {
exportFile = unifiedWellPathFile;
lgrExportFile = unifiedLgrWellPathFile;
}
else else
{ {
bool anyPerforationsPresent = bool anyPerforationsPresent =
@ -122,11 +142,13 @@ void RicWellPathExportMswCompletionsImpl::exportWellSegmentsForAllCompletions(
QString fileName = QString fileName =
QString( "%1_%2MSW_%3" ) QString( "%1_%2MSW_%3" )
.arg( wellPath->name(), perforationText, exportSettings.caseToApply->caseUserDescription() ); .arg( wellPath->name(), perforationText, exportSettings.caseToApply->caseUserDescription() );
perforationsExportFile = exportFile = RicWellPathExportCompletionsFileTools::openFileForExport( exportSettings.folder, fileName );
RicWellPathExportCompletionsFileTools::openFileForExport( exportSettings.folder, fileName ); lgrExportFile =
RicWellPathExportCompletionsFileTools::openFileForExport( exportSettings.folder, fileName + "_LGR" );
} }
exportWellSegmentsForPerforations( exportSettings.caseToApply, exportWellSegmentsForPerforations( exportSettings.caseToApply,
perforationsExportFile, exportFile,
lgrExportFile,
wellPath, wellPath,
exportSettings.timeStep, exportSettings.timeStep,
exportSettings.exportDataSourceAsComment(), exportSettings.exportDataSourceAsComment(),
@ -135,20 +157,30 @@ void RicWellPathExportMswCompletionsImpl::exportWellSegmentsForAllCompletions(
if ( exportFractures ) if ( exportFractures )
{ {
std::shared_ptr<QFile> fractureExportFile; std::shared_ptr<QFile> exportFile;
std::shared_ptr<QFile> lgrExportFile;
if ( unifiedExportFile ) if ( unifiedExportFile )
fractureExportFile = unifiedExportFile; {
exportFile = unifiedExportFile;
lgrExportFile = unifiedLgrExportFile;
}
else if ( unifiedWellPathFile ) else if ( unifiedWellPathFile )
fractureExportFile = unifiedWellPathFile; {
exportFile = unifiedWellPathFile;
lgrExportFile = unifiedLgrWellPathFile;
}
else else
{ {
QString fileName = QString fileName =
QString( "%1_Fracture_MSW_%2" ).arg( wellPath->name(), exportSettings.caseToApply->caseUserDescription() ); QString( "%1_Fracture_MSW_%2" ).arg( wellPath->name(), exportSettings.caseToApply->caseUserDescription() );
fractureExportFile = exportFile = RicWellPathExportCompletionsFileTools::openFileForExport( exportSettings.folder, fileName );
RicWellPathExportCompletionsFileTools::openFileForExport( exportSettings.folder, fileName ); lgrExportFile =
RicWellPathExportCompletionsFileTools::openFileForExport( exportSettings.folder, fileName + "_LGR" );
} }
exportWellSegmentsForFractures( exportSettings.caseToApply, exportWellSegmentsForFractures( exportSettings.caseToApply,
fractureExportFile, exportFile,
lgrExportFile,
wellPath, wellPath,
exportSettings.exportDataSourceAsComment(), exportSettings.exportDataSourceAsComment(),
exportSettings.exportCompletionWelspecAfterMainBore() ); exportSettings.exportCompletionWelspecAfterMainBore() );
@ -156,20 +188,30 @@ void RicWellPathExportMswCompletionsImpl::exportWellSegmentsForAllCompletions(
if ( exportFishbones ) if ( exportFishbones )
{ {
std::shared_ptr<QFile> fishbonesExportFile; std::shared_ptr<QFile> exportFile;
std::shared_ptr<QFile> lgrExportFile;
if ( unifiedExportFile ) if ( unifiedExportFile )
fishbonesExportFile = unifiedExportFile; {
exportFile = unifiedExportFile;
lgrExportFile = unifiedLgrExportFile;
}
else if ( unifiedWellPathFile ) else if ( unifiedWellPathFile )
fishbonesExportFile = unifiedWellPathFile; {
exportFile = unifiedWellPathFile;
lgrExportFile = unifiedLgrWellPathFile;
}
else else
{ {
QString fileName = QString fileName =
QString( "%1_Fishbones_MSW_%2" ).arg( wellPath->name(), exportSettings.caseToApply->caseUserDescription() ); QString( "%1_Fishbones_MSW_%2" ).arg( wellPath->name(), exportSettings.caseToApply->caseUserDescription() );
fishbonesExportFile = exportFile = RicWellPathExportCompletionsFileTools::openFileForExport( exportSettings.folder, fileName );
RicWellPathExportCompletionsFileTools::openFileForExport( exportSettings.folder, fileName ); lgrExportFile =
RicWellPathExportCompletionsFileTools::openFileForExport( exportSettings.folder, fileName + "_LGR" );
} }
exportWellSegmentsForFishbones( exportSettings.caseToApply, exportWellSegmentsForFishbones( exportSettings.caseToApply,
fishbonesExportFile, exportFile,
lgrExportFile,
wellPath, wellPath,
exportSettings.exportDataSourceAsComment(), exportSettings.exportDataSourceAsComment(),
exportSettings.exportCompletionWelspecAfterMainBore() ); exportSettings.exportCompletionWelspecAfterMainBore() );
@ -182,6 +224,7 @@ void RicWellPathExportMswCompletionsImpl::exportWellSegmentsForAllCompletions(
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RicWellPathExportMswCompletionsImpl::exportWellSegmentsForPerforations( RimEclipseCase* eclipseCase, void RicWellPathExportMswCompletionsImpl::exportWellSegmentsForPerforations( RimEclipseCase* eclipseCase,
std::shared_ptr<QFile> exportFile, std::shared_ptr<QFile> exportFile,
std::shared_ptr<QFile> lgrExportFile,
const RimWellPath* wellPath, const RimWellPath* wellPath,
int timeStep, int timeStep,
bool exportDataSourceAsComment, bool exportDataSourceAsComment,
@ -193,8 +236,8 @@ void RicWellPathExportMswCompletionsImpl::exportWellSegmentsForPerforations( Rim
if ( !mswParameters ) return; if ( !mswParameters ) return;
double initialMD = 0.0; // Start measured depth location to export MSW data for. Either based on first intersection double initialMD = 0.0; // Start measured depth location to export MSW data for. Either based on first
// with active grid, or user defined value. // intersection with active grid, or user defined value.
auto cellIntersections = generateCellSegments( eclipseCase, wellPath, mswParameters, &initialMD ); auto cellIntersections = generateCellSegments( eclipseCase, wellPath, mswParameters, &initialMD );
@ -216,18 +259,36 @@ void RicWellPathExportMswCompletionsImpl::exportWellSegmentsForPerforations( Rim
assignBranchNumbersToBranch( eclipseCase, &exportInfo, exportInfo.mainBoreBranch(), &branchNumber ); assignBranchNumbersToBranch( eclipseCase, &exportInfo, exportInfo.mainBoreBranch(), &branchNumber );
QTextStream stream( exportFile.get() ); {
RifTextDataTableFormatter formatter( stream ); QTextStream stream( exportFile.get() );
RifTextDataTableFormatter formatter( stream );
double maxSegmentLength = mswParameters->maxSegmentLength(); double maxSegmentLength = mswParameters->maxSegmentLength();
RicMswTableFormatterTools::generateWelsegsTable( formatter, RicMswTableFormatterTools::generateWelsegsTable( formatter,
exportInfo, exportInfo,
maxSegmentLength, maxSegmentLength,
completionSegmentsAfterMainBore ); completionSegmentsAfterMainBore );
RicMswTableFormatterTools::generateCompsegTables( formatter, exportInfo ); bool exportLgrData = false;
RicMswTableFormatterTools::generateWsegvalvTable( formatter, exportInfo ); RicMswTableFormatterTools::generateCompsegTables( formatter, exportInfo, exportLgrData );
RicMswTableFormatterTools::generateWsegAicdTable( formatter, exportInfo ); RicMswTableFormatterTools::generateWsegvalvTable( formatter, exportInfo );
RicMswTableFormatterTools::generateWsegAicdTable( formatter, exportInfo );
}
if ( exportInfo.hasSubGridIntersections() )
{
QTextStream stream( lgrExportFile.get() );
RifTextDataTableFormatter formatter( stream );
double maxSegmentLength = mswParameters->maxSegmentLength();
RicMswTableFormatterTools::generateWelsegsTable( formatter,
exportInfo,
maxSegmentLength,
completionSegmentsAfterMainBore );
bool exportLgrData = true;
RicMswTableFormatterTools::generateCompsegTables( formatter, exportInfo, exportLgrData );
}
} }
} }
@ -236,6 +297,7 @@ void RicWellPathExportMswCompletionsImpl::exportWellSegmentsForPerforations( Rim
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RicWellPathExportMswCompletionsImpl::exportWellSegmentsForFractures( RimEclipseCase* eclipseCase, void RicWellPathExportMswCompletionsImpl::exportWellSegmentsForFractures( RimEclipseCase* eclipseCase,
std::shared_ptr<QFile> exportFile, std::shared_ptr<QFile> exportFile,
std::shared_ptr<QFile> lgrExportFile,
const RimWellPath* wellPath, const RimWellPath* wellPath,
bool exportDataSourceAsComment, bool exportDataSourceAsComment,
bool completionSegmentsAfterMainBore ) bool completionSegmentsAfterMainBore )
@ -253,8 +315,8 @@ void RicWellPathExportMswCompletionsImpl::exportWellSegmentsForFractures( RimEcl
if ( !mswParameters ) return; if ( !mswParameters ) return;
double initialMD = 0.0; // Start measured depth location to export MSW data for. Either based on first intersection double initialMD = 0.0; // Start measured depth location to export MSW data for. Either based on first
// with active grid, or user defined value. // intersection with active grid, or user defined value.
auto cellIntersections = generateCellSegments( eclipseCase, wellPath, mswParameters, &initialMD ); auto cellIntersections = generateCellSegments( eclipseCase, wellPath, mswParameters, &initialMD );
@ -274,14 +336,40 @@ void RicWellPathExportMswCompletionsImpl::exportWellSegmentsForFractures( RimEcl
int branchNumber = 1; int branchNumber = 1;
assignBranchNumbersToBranch( eclipseCase, &exportInfo, exportInfo.mainBoreBranch(), &branchNumber ); assignBranchNumbersToBranch( eclipseCase, &exportInfo, exportInfo.mainBoreBranch(), &branchNumber );
QTextStream stream( exportFile.get() ); auto doExport = []( RifTextDataTableFormatter& formatter,
RifTextDataTableFormatter formatter( stream ); bool exportDataSourceAsComment,
formatter.setOptionalComment( exportDataSourceAsComment ); RicMswExportInfo& exportInfo,
const RimWellPath* wellPath,
bool completionSegmentsAfterMainBore,
bool exportLgrData ) {
formatter.setOptionalComment( exportDataSourceAsComment );
double maxSegmentLength = wellPath->mswCompletionParameters()->maxSegmentLength(); double maxSegmentLength = wellPath->mswCompletionParameters()->maxSegmentLength();
RicMswTableFormatterTools::generateWelsegsTable( formatter, exportInfo, maxSegmentLength, completionSegmentsAfterMainBore ); RicMswTableFormatterTools::generateWelsegsTable( formatter,
RicMswTableFormatterTools::generateCompsegTables( formatter, exportInfo ); exportInfo,
maxSegmentLength,
completionSegmentsAfterMainBore );
RicMswTableFormatterTools::generateCompsegTables( formatter, exportInfo, exportLgrData );
};
{
QTextStream stream( exportFile.get() );
RifTextDataTableFormatter formatter( stream );
bool exportLgrData = false;
doExport( formatter, exportDataSourceAsComment, exportInfo, wellPath, completionSegmentsAfterMainBore, exportLgrData );
}
if ( exportInfo.hasSubGridIntersections() )
{
QTextStream stream( lgrExportFile.get() );
RifTextDataTableFormatter formatter( stream );
bool exportLgrData = true;
doExport( formatter, exportDataSourceAsComment, exportInfo, wellPath, completionSegmentsAfterMainBore, exportLgrData );
}
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -289,6 +377,7 @@ void RicWellPathExportMswCompletionsImpl::exportWellSegmentsForFractures( RimEcl
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RicWellPathExportMswCompletionsImpl::exportWellSegmentsForFishbones( RimEclipseCase* eclipseCase, void RicWellPathExportMswCompletionsImpl::exportWellSegmentsForFishbones( RimEclipseCase* eclipseCase,
std::shared_ptr<QFile> exportFile, std::shared_ptr<QFile> exportFile,
std::shared_ptr<QFile> lgrExportFile,
const RimWellPath* wellPath, const RimWellPath* wellPath,
bool exportDataSourceAsComment, bool exportDataSourceAsComment,
bool completionSegmentsAfterMainBore ) bool completionSegmentsAfterMainBore )
@ -301,8 +390,8 @@ void RicWellPathExportMswCompletionsImpl::exportWellSegmentsForFishbones( RimEcl
return; return;
} }
double initialMD = 0.0; // Start measured depth location to export MSW data for. Either based on first intersection double initialMD = 0.0; // Start measured depth location to export MSW data for. Either based on first
// with active grid, or user defined value. // intersection with active grid, or user defined value.
auto mswParameters = wellPath->mswCompletionParameters(); auto mswParameters = wellPath->mswCompletionParameters();
auto cellIntersections = generateCellSegments( eclipseCase, wellPath, mswParameters, &initialMD ); auto cellIntersections = generateCellSegments( eclipseCase, wellPath, mswParameters, &initialMD );
@ -328,15 +417,39 @@ void RicWellPathExportMswCompletionsImpl::exportWellSegmentsForFishbones( RimEcl
assignBranchNumbersToBranch( eclipseCase, &exportInfo, exportInfo.mainBoreBranch(), &branchNumber ); assignBranchNumbersToBranch( eclipseCase, &exportInfo, exportInfo.mainBoreBranch(), &branchNumber );
QTextStream stream( exportFile.get() ); {
RifTextDataTableFormatter formatter( stream ); QTextStream stream( exportFile.get() );
formatter.setOptionalComment( exportDataSourceAsComment ); RifTextDataTableFormatter formatter( stream );
formatter.setOptionalComment( exportDataSourceAsComment );
double maxSegmentLength = wellPath->mswCompletionParameters()->maxSegmentLength(); double maxSegmentLength = wellPath->mswCompletionParameters()->maxSegmentLength();
RicMswTableFormatterTools::generateWelsegsTable( formatter, exportInfo, maxSegmentLength, completionSegmentsAfterMainBore ); RicMswTableFormatterTools::generateWelsegsTable( formatter,
RicMswTableFormatterTools::generateCompsegTables( formatter, exportInfo ); exportInfo,
RicMswTableFormatterTools::generateWsegvalvTable( formatter, exportInfo ); maxSegmentLength,
completionSegmentsAfterMainBore );
bool exportLgrData = false;
RicMswTableFormatterTools::generateCompsegTables( formatter, exportInfo, exportLgrData );
RicMswTableFormatterTools::generateWsegvalvTable( formatter, exportInfo );
}
if ( exportInfo.hasSubGridIntersections() )
{
QTextStream stream( lgrExportFile.get() );
RifTextDataTableFormatter formatter( stream );
formatter.setOptionalComment( exportDataSourceAsComment );
double maxSegmentLength = wellPath->mswCompletionParameters()->maxSegmentLength();
RicMswTableFormatterTools::generateWelsegsTable( formatter,
exportInfo,
maxSegmentLength,
completionSegmentsAfterMainBore );
bool exportLgr = true;
RicMswTableFormatterTools::generateCompsegTables( formatter, exportInfo, exportLgr );
}
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -546,8 +659,8 @@ void RicWellPathExportMswCompletionsImpl::generateFishbonesMswExportInfoForWell(
gsl::not_null<RicMswExportInfo*> exportInfo, gsl::not_null<RicMswExportInfo*> exportInfo,
gsl::not_null<RicMswBranch*> branch ) gsl::not_null<RicMswBranch*> branch )
{ {
double initialMD = 0.0; // Start measured depth location to export MSW data for. Either based on first intersection double initialMD = 0.0; // Start measured depth location to export MSW data for. Either based on first
// with active grid, or user defined value. // intersection with active grid, or user defined value.
auto mswParameters = wellPath->mswCompletionParameters(); auto mswParameters = wellPath->mswCompletionParameters();
auto cellIntersections = generateCellSegments( eclipseCase, wellPath, mswParameters, &initialMD ); auto cellIntersections = generateCellSegments( eclipseCase, wellPath, mswParameters, &initialMD );

View File

@ -50,18 +50,21 @@ public:
static void exportWellSegmentsForFractures( RimEclipseCase* eclipseCase, static void exportWellSegmentsForFractures( RimEclipseCase* eclipseCase,
std::shared_ptr<QFile> exportFile, std::shared_ptr<QFile> exportFile,
std::shared_ptr<QFile> lgrExportFile,
const RimWellPath* wellPath, const RimWellPath* wellPath,
bool exportDataSourceAsComment, bool exportDataSourceAsComment,
bool completionSegmentsAfterMainBore ); bool completionSegmentsAfterMainBore );
static void exportWellSegmentsForFishbones( RimEclipseCase* eclipseCase, static void exportWellSegmentsForFishbones( RimEclipseCase* eclipseCase,
std::shared_ptr<QFile> exportFile, std::shared_ptr<QFile> exportFile,
std::shared_ptr<QFile> lgrExportFile,
const RimWellPath* wellPath, const RimWellPath* wellPath,
bool exportDataSourceAsComment, bool exportDataSourceAsComment,
bool completionSegmentsAfterMainBore ); bool completionSegmentsAfterMainBore );
static void exportWellSegmentsForPerforations( RimEclipseCase* eclipseCase, static void exportWellSegmentsForPerforations( RimEclipseCase* eclipseCase,
std::shared_ptr<QFile> exportFile, std::shared_ptr<QFile> exportFile,
std::shared_ptr<QFile> lgrExportFile,
const RimWellPath* wellPath, const RimWellPath* wellPath,
int timeStep, int timeStep,
bool exportDataSourceAsComment, bool exportDataSourceAsComment,