Janitor : Remove double if statement with identical test

This commit is contained in:
Magne Sjaastad 2019-11-03 08:50:08 +01:00
parent 67e7bb0cf3
commit f35edc302f

View File

@ -335,13 +335,15 @@ void RicWellPathExportMswCompletionsImpl::generateWelsegsTable( RifTextDataTable
}
{
generateWelsegsSegments( formatter, exportInfo, {RigCompletionData::FISHBONES_ICD, RigCompletionData::FISHBONES} );
generateWelsegsSegments( formatter, exportInfo, {RigCompletionData::FRACTURE} );
generateWelsegsSegments( formatter,
exportInfo,
{RigCompletionData::PERFORATION_ICD,
RigCompletionData::PERFORATION_ICV,
RigCompletionData::PERFORATION_AICD} );
{ RigCompletionData::FISHBONES_ICD, RigCompletionData::FISHBONES } );
generateWelsegsSegments( formatter, exportInfo, { RigCompletionData::FRACTURE } );
generateWelsegsSegments( formatter,
exportInfo,
{ RigCompletionData::PERFORATION_ICD,
RigCompletionData::PERFORATION_ICV,
RigCompletionData::PERFORATION_AICD } );
}
formatter.tableCompleted();
@ -474,8 +476,8 @@ void RicWellPathExportMswCompletionsImpl::generateCompsegTables( RifTextDataTabl
*/
{
std::set<RigCompletionData::CompletionType> fishbonesTypes = {RigCompletionData::FISHBONES_ICD,
RigCompletionData::FISHBONES};
std::set<RigCompletionData::CompletionType> fishbonesTypes = { RigCompletionData::FISHBONES_ICD,
RigCompletionData::FISHBONES };
generateCompsegTable( formatter, exportInfo, false, fishbonesTypes );
if ( exportInfo.hasSubGridIntersections() )
{
@ -484,7 +486,7 @@ void RicWellPathExportMswCompletionsImpl::generateCompsegTables( RifTextDataTabl
}
{
std::set<RigCompletionData::CompletionType> fractureTypes = {RigCompletionData::FRACTURE};
std::set<RigCompletionData::CompletionType> fractureTypes = { RigCompletionData::FRACTURE };
generateCompsegTable( formatter, exportInfo, false, fractureTypes );
if ( exportInfo.hasSubGridIntersections() )
{
@ -493,10 +495,10 @@ void RicWellPathExportMswCompletionsImpl::generateCompsegTables( RifTextDataTabl
}
{
std::set<RigCompletionData::CompletionType> perforationTypes = {RigCompletionData::PERFORATION,
RigCompletionData::PERFORATION_ICD,
RigCompletionData::PERFORATION_ICV,
RigCompletionData::PERFORATION_AICD};
std::set<RigCompletionData::CompletionType> perforationTypes = { RigCompletionData::PERFORATION,
RigCompletionData::PERFORATION_ICD,
RigCompletionData::PERFORATION_ICV,
RigCompletionData::PERFORATION_AICD };
generateCompsegTable( formatter, exportInfo, false, perforationTypes );
if ( exportInfo.hasSubGridIntersections() )
{
@ -600,7 +602,7 @@ void RicWellPathExportMswCompletionsImpl::generateCompsegHeader( RifTextDataTabl
}
{
std::vector<RifTextDataTableColumn> header = {RifTextDataTableColumn( "Name" )};
std::vector<RifTextDataTableColumn> header = { RifTextDataTableColumn( "Name" ) };
formatter.header( header );
formatter.add( exportInfo.wellPath()->completions()->wellNameForExport() );
formatter.rowCompleted();
@ -613,15 +615,15 @@ void RicWellPathExportMswCompletionsImpl::generateCompsegHeader( RifTextDataTabl
allHeaders.push_back( RifTextDataTableColumn( "Grid" ) );
}
std::vector<RifTextDataTableColumn> commonHeaders = {RifTextDataTableColumn( "I" ),
RifTextDataTableColumn( "J" ),
RifTextDataTableColumn( "K" ),
RifTextDataTableColumn( "Branch no" ),
RifTextDataTableColumn( "Start Length" ),
RifTextDataTableColumn( "End Length" ),
RifTextDataTableColumn( "Dir Pen" ),
RifTextDataTableColumn( "End Range" ),
RifTextDataTableColumn( "Connection Depth" )};
std::vector<RifTextDataTableColumn> commonHeaders = { RifTextDataTableColumn( "I" ),
RifTextDataTableColumn( "J" ),
RifTextDataTableColumn( "K" ),
RifTextDataTableColumn( "Branch no" ),
RifTextDataTableColumn( "Start Length" ),
RifTextDataTableColumn( "End Length" ),
RifTextDataTableColumn( "Dir Pen" ),
RifTextDataTableColumn( "End Range" ),
RifTextDataTableColumn( "Connection Depth" ) };
allHeaders.insert( allHeaders.end(), commonHeaders.begin(), commonHeaders.end() );
formatter.header( allHeaders );
}
@ -709,27 +711,27 @@ void RicWellPathExportMswCompletionsImpl::generateWsegAicdTable( RifTextDataTabl
if ( !foundValve )
{
std::vector<QString> columnDescriptions =
{"Well Name",
"Segment Number",
"Segment Number",
"Strength of AICD",
"Length of AICD",
"Density of Calibration Fluid",
"Viscosity of Calibration Fluid",
"Critical water in liquid fraction for emulsions viscosity model",
"Emulsion viscosity transition region",
"Max ratio of emulsion viscosity to continuous phase viscosity",
"Flow scaling factor method",
"Maximum flowrate for AICD device",
"Volume flow rate exponent, x",
"Viscosity function exponent, y",
"Device OPEN/SHUT",
"Exponent of the oil flowing fraction in the density mixture calculation",
"Exponent of the water flowing fraction in the density mixture calculation",
"Exponent of the gas flowing fraction in the density mixture calculation",
"Exponent of the oil flowing fraction in the density viscosity calculation",
"Exponent of the water flowing fraction in the density viscosity calculation",
"Exponent of the gas flowing fraction in the density viscosity calculation"};
{ "Well Name",
"Segment Number",
"Segment Number",
"Strength of AICD",
"Length of AICD",
"Density of Calibration Fluid",
"Viscosity of Calibration Fluid",
"Critical water in liquid fraction for emulsions viscosity model",
"Emulsion viscosity transition region",
"Max ratio of emulsion viscosity to continuous phase viscosity",
"Flow scaling factor method",
"Maximum flowrate for AICD device",
"Volume flow rate exponent, x",
"Viscosity function exponent, y",
"Device OPEN/SHUT",
"Exponent of the oil flowing fraction in the density mixture calculation",
"Exponent of the water flowing fraction in the density mixture calculation",
"Exponent of the gas flowing fraction in the density mixture calculation",
"Exponent of the oil flowing fraction in the density viscosity calculation",
"Exponent of the water flowing fraction in the density viscosity calculation",
"Exponent of the gas flowing fraction in the density viscosity calculation" };
tighterFormatter.keyword( "WSEGAICD" );
tighterFormatter.comment( "Column Overview:" );
@ -1009,7 +1011,7 @@ RicMswExportInfo RicWellPathExportMswCompletionsImpl::generateFracturesMswExport
RicExportFractureCompletionsImpl::generateCompdatValues( caseToApply,
wellPath->completions()->wellNameForExport(),
wellPath->wellPathGeometry(),
{fracture},
{ fracture },
nullptr,
nullptr );
@ -1745,10 +1747,7 @@ void RicWellPathExportMswCompletionsImpl::assignBranchAndSegmentNumbers( const R
if ( completion->completionType() == RigCompletionData::FISHBONES_ICD )
{
++segmentNumber; // Skip a segment number because we need one for the ICD
if ( completion->completionType() == RigCompletionData::FISHBONES_ICD )
{
completion->setBranchNumber( ++branchNumber );
}
completion->setBranchNumber( ++branchNumber );
}
}
}