Janitor : Use enum class

This commit is contained in:
Magne Sjaastad 2021-05-18 15:29:20 +02:00
parent 827cf75207
commit b518acada6
18 changed files with 154 additions and 199 deletions

View File

@ -118,9 +118,9 @@ caf::PdmScriptResponse RicfCreateLgrForCompletions::execute()
m_timeStep,
lgrCellCounts,
m_splitType(),
{ RigCompletionData::PERFORATION,
RigCompletionData::FRACTURE,
RigCompletionData::FISHBONES },
{ RigCompletionData::CompletionType::PERFORATION,
RigCompletionData::CompletionType::FRACTURE,
RigCompletionData::CompletionType::FISHBONES },
&wellsIntersectingOtherLgrs );
feature->updateViews( eclipseCase );

View File

@ -111,9 +111,9 @@ caf::PdmScriptResponse RicfExportLgrForCompletions::execute()
m_timeStep,
lgrCellCounts,
m_splitType(),
{ RigCompletionData::PERFORATION,
RigCompletionData::FRACTURE,
RigCompletionData::FISHBONES },
{ RigCompletionData::CompletionType::PERFORATION,
RigCompletionData::CompletionType::FRACTURE,
RigCompletionData::CompletionType::FISHBONES },
&wellsIntersectingOtherLgrs );
caf::PdmScriptResponse response;

View File

@ -43,9 +43,6 @@ namespace caf
{
addItem(RicExportCompletionDataSettingsUi::TRANSMISSIBILITIES, "TRANSMISSIBILITIES", "Calculated Transmissibilities");
addItem(RicExportCompletionDataSettingsUi::WPIMULT_AND_DEFAULT_CONNECTION_FACTORS, "WPIMULT_AND_DEFAULT_CONNECTION_FACTORS", "Default Connection Factors and WPIMULT (Fractures Not Supported)");
#ifdef _DEBUG
addItem(RicExportCompletionDataSettingsUi::NO_COMPLETIONS, "NO_COMPLETIONS", "None");
#endif
setDefault(RicExportCompletionDataSettingsUi::TRANSMISSIBILITIES);
}

View File

@ -47,10 +47,6 @@ public:
{
TRANSMISSIBILITIES,
WPIMULT_AND_DEFAULT_CONNECTION_FACTORS,
#ifdef _DEBUG
NO_COMPLETIONS
#endif
};
typedef caf::AppEnum<CompdatExport> CompdatExportType;

View File

@ -111,8 +111,8 @@ std::vector<RigCompletionData>
// Find main bore and number of laterals
size_t numberOfLaterals = 0;
CellDirection mainBoreDirection = DIR_I;
size_t numberOfLaterals = 0;
auto mainBoreDirection = RigCompletionData::CellDirection::DIR_I;
for ( const auto& wellBorePart : wellBoreParts )
{
if ( !wellBorePart.isMainBore )
@ -175,7 +175,7 @@ std::vector<RigCompletionData>
kh = transmissibilityAndPermeability.kh();
}
CellDirection direction =
auto direction =
RicWellPathExportCompletionDataFeatureImpl::calculateCellMainDirection( settings.caseToApply,
globalCellIndex,
wellBorePart.lengthsInCell );

View File

@ -61,7 +61,7 @@ RicMswFracture::RicMswFracture( const QString& label,
//--------------------------------------------------------------------------------------------------
RigCompletionData::CompletionType RicMswFracture::completionType() const
{
return RigCompletionData::FRACTURE;
return RigCompletionData::CompletionType::FRACTURE;
}
//--------------------------------------------------------------------------------------------------
@ -81,7 +81,7 @@ RicMswPerforation::RicMswPerforation( const QString& label,
//--------------------------------------------------------------------------------------------------
RigCompletionData::CompletionType RicMswPerforation::completionType() const
{
return RigCompletionData::PERFORATION;
return RigCompletionData::CompletionType::PERFORATION;
}
//--------------------------------------------------------------------------------------------------
@ -207,7 +207,7 @@ RicMswFishbonesICD::RicMswFishbonesICD( const QString& label,
//--------------------------------------------------------------------------------------------------
RigCompletionData::CompletionType RicMswFishbonesICD::completionType() const
{
return RigCompletionData::FISHBONES_ICD;
return RigCompletionData::CompletionType::FISHBONES_ICD;
}
//--------------------------------------------------------------------------------------------------
@ -227,7 +227,7 @@ RicMswPerforationICD::RicMswPerforationICD( const QString& label,
//--------------------------------------------------------------------------------------------------
RigCompletionData::CompletionType RicMswPerforationICD::completionType() const
{
return RigCompletionData::PERFORATION_ICD;
return RigCompletionData::CompletionType::PERFORATION_ICD;
}
//--------------------------------------------------------------------------------------------------
@ -252,7 +252,7 @@ RicMswPerforationICV::RicMswPerforationICV( const QString& label,
//--------------------------------------------------------------------------------------------------
RigCompletionData::CompletionType RicMswPerforationICV::completionType() const
{
return RigCompletionData::PERFORATION_ICV;
return RigCompletionData::CompletionType::PERFORATION_ICV;
}
//--------------------------------------------------------------------------------------------------
@ -276,7 +276,7 @@ RicMswPerforationAICD::RicMswPerforationAICD( const QString& label,
//--------------------------------------------------------------------------------------------------
RigCompletionData::CompletionType RicMswPerforationAICD::completionType() const
{
return RigCompletionData::PERFORATION_AICD;
return RigCompletionData::CompletionType::PERFORATION_AICD;
}
//--------------------------------------------------------------------------------------------------
@ -365,5 +365,5 @@ RicMswTieInICV::RicMswTieInICV( const QString& label,
//--------------------------------------------------------------------------------------------------
RigCompletionData::CompletionType RicMswTieInICV::completionType() const
{
return RigCompletionData::PERFORATION_ICV;
return RigCompletionData::CompletionType::PERFORATION_ICV;
}

View File

@ -66,7 +66,10 @@ public:
{
}
RigCompletionData::CompletionType completionType() const override { return RigCompletionData::FISHBONES; }
RigCompletionData::CompletionType completionType() const override
{
return RigCompletionData::CompletionType::FISHBONES;
}
};
//==================================================================================================

View File

@ -184,27 +184,27 @@ void RicMswTableFormatterTools::writeWelsegsCompletionCommentHeader( RifTextData
switch ( completionType )
{
case RigCompletionData::FISHBONES:
case RigCompletionData::CompletionType::FISHBONES:
break;
case RigCompletionData::FRACTURE:
case RigCompletionData::CompletionType::FRACTURE:
optionalCommentText = "Fracture Segments";
break;
case RigCompletionData::PERFORATION:
case RigCompletionData::CompletionType::PERFORATION:
optionalCommentText = "Perforation Segments";
break;
case RigCompletionData::FISHBONES_ICD:
case RigCompletionData::CompletionType::FISHBONES_ICD:
optionalCommentText = "Fishbones Segments - ICD";
break;
case RigCompletionData::PERFORATION_ICD:
case RigCompletionData::CompletionType::PERFORATION_ICD:
optionalCommentText = "Perforation Segments - ICD";
break;
case RigCompletionData::PERFORATION_AICD:
case RigCompletionData::CompletionType::PERFORATION_AICD:
optionalCommentText = "Perforation Segments - AICD";
break;
case RigCompletionData::PERFORATION_ICV:
case RigCompletionData::CompletionType::PERFORATION_ICV:
optionalCommentText = "Perforation Segments - ICV";
break;
case RigCompletionData::CT_UNDEFINED:
case RigCompletionData::CompletionType::CT_UNDEFINED:
optionalCommentText = "Main Stem";
break;
default:
@ -231,15 +231,15 @@ void RicMswTableFormatterTools::generateCompsegTables( RifTextDataTableFormatter
std::set<size_t> intersectedCells;
std::set<RigCompletionData::CompletionType> perforationTypes = { RigCompletionData::PERFORATION,
RigCompletionData::PERFORATION_ICD,
RigCompletionData::PERFORATION_ICV,
RigCompletionData::PERFORATION_AICD };
std::set<RigCompletionData::CompletionType> perforationTypes = { RigCompletionData::CompletionType::PERFORATION,
RigCompletionData::CompletionType::PERFORATION_ICD,
RigCompletionData::CompletionType::PERFORATION_ICV,
RigCompletionData::CompletionType::PERFORATION_AICD };
std::set<RigCompletionData::CompletionType> fishbonesTypes = { RigCompletionData::FISHBONES_ICD,
RigCompletionData::FISHBONES };
std::set<RigCompletionData::CompletionType> fishbonesTypes = { RigCompletionData::CompletionType::FISHBONES_ICD,
RigCompletionData::CompletionType::FISHBONES };
std::set<RigCompletionData::CompletionType> fractureTypes = { RigCompletionData::FRACTURE };
std::set<RigCompletionData::CompletionType> fractureTypes = { RigCompletionData::CompletionType::FRACTURE };
{
bool headerGenerated = false;
@ -296,9 +296,10 @@ void RicMswTableFormatterTools::generateCompsegTable( RifTextDataTableFormatter&
if ( completion )
{
bool isPerforationValve = completion->completionType() == RigCompletionData::PERFORATION_ICD ||
completion->completionType() == RigCompletionData::PERFORATION_AICD ||
completion->completionType() == RigCompletionData::PERFORATION_ICV;
bool isPerforationValve =
completion->completionType() == RigCompletionData::CompletionType::PERFORATION_ICD ||
completion->completionType() == RigCompletionData::CompletionType::PERFORATION_AICD ||
completion->completionType() == RigCompletionData::CompletionType::PERFORATION_ICV;
if ( isPerforationValve )
{
@ -384,11 +385,11 @@ void RicMswTableFormatterTools::generateCompsegHeader( RifTextDataTableFormatter
formatter.keyword( "COMPSEGS" );
}
if ( completionType == RigCompletionData::FISHBONES_ICD )
if ( completionType == RigCompletionData::CompletionType::FISHBONES_ICD )
{
formatter.comment( "Fishbones" );
}
else if ( completionType == RigCompletionData::FRACTURE )
else if ( completionType == RigCompletionData::CompletionType::FRACTURE )
{
formatter.comment( "Fractures" );
}
@ -459,7 +460,7 @@ void RicMswTableFormatterTools::generateWsegvalvTableRecursively( RifTextDataTab
}
auto firstSubSegment = tieInValve->segments().front();
CAF_ASSERT( tieInValve->completionType() == RigCompletionData::PERFORATION_ICV );
CAF_ASSERT( tieInValve->completionType() == RigCompletionData::CompletionType::PERFORATION_ICV );
{
formatter.addOptionalComment( tieInValve->label() );
}
@ -495,8 +496,8 @@ void RicMswTableFormatterTools::generateWsegvalvTableRecursively( RifTextDataTab
// Unclear why this line was included. Remove when MSW export has ben verified correctly
// if ( !firstSubSegment->intersections().empty() )
{
if ( wsegValve->completionType() == RigCompletionData::PERFORATION_ICD ||
wsegValve->completionType() == RigCompletionData::PERFORATION_ICV )
if ( wsegValve->completionType() == RigCompletionData::CompletionType::PERFORATION_ICD ||
wsegValve->completionType() == RigCompletionData::CompletionType::PERFORATION_ICV )
{
formatter.addOptionalComment( wsegValve->label() );
}
@ -532,7 +533,7 @@ void RicMswTableFormatterTools::generateWsegAicdTable( RifTextDataTableFormatter
{
for ( auto completion : segment->completions() )
{
if ( completion->completionType() == RigCompletionData::PERFORATION_AICD )
if ( completion->completionType() == RigCompletionData::CompletionType::PERFORATION_AICD )
{
auto aicd = static_cast<RicMswPerforationAICD*>( completion );
if ( aicd->isValid() )
@ -805,12 +806,12 @@ void RicMswTableFormatterTools::writeCompletionWelsegsSegments( gsl::not_null<co
{
writeWelsegsCompletionCommentHeader( formatter, completion->completionType() );
if ( completion->completionType() == RigCompletionData::FISHBONES )
if ( completion->completionType() == RigCompletionData::CompletionType::FISHBONES )
{
formatter.addOptionalComment(
QString( "Sub index %1 - %2" ).arg( outletSegment->subIndex() + 1 ).arg( completion->label() ) );
}
else if ( completion->completionType() == RigCompletionData::FRACTURE )
else if ( completion->completionType() == RigCompletionData::CompletionType::FRACTURE )
{
formatter.addOptionalComment(
QString( "%1 connected to segment %2" ).arg( completion->label() ).arg( outletSegment->segmentNumber() ) );
@ -837,7 +838,7 @@ void RicMswTableFormatterTools::writeCompletionWelsegsSegments( gsl::not_null<co
double subStartTVD = tvdFromMeasuredDepth( completion->wellPath(), subStartMD );
double subEndTVD = tvdFromMeasuredDepth( completion->wellPath(), subEndMD );
if ( completion->completionType() == RigCompletionData::FISHBONES )
if ( completion->completionType() == RigCompletionData::CompletionType::FISHBONES )
{
// Not possible to do interpolation based on well path geometry here
// Use linear interpolation based on start/end TVD for segment

View File

@ -107,8 +107,6 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions( const std::v
exportCarfinForTemporaryLgrs( exportSettings.caseToApply(), exportSettings.folder );
if ( exportSettings.compdatExport == RicExportCompletionDataSettingsUi::TRANSMISSIBILITIES ||
exportSettings.compdatExport == RicExportCompletionDataSettingsUi::WPIMULT_AND_DEFAULT_CONNECTION_FACTORS )
{
std::vector<RicWellPathFractureReportItem> fractureDataReportItems;
std::unique_ptr<QTextStream> fractureTransmissibilityExportInformationStream = nullptr;
@ -323,9 +321,9 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions( const std::v
else if ( exportSettings.fileSplit == RicExportCompletionDataSettingsUi::SPLIT_ON_WELL_AND_COMPLETION_TYPE )
{
std::vector<RigCompletionData::CompletionType> completionTypes;
completionTypes.push_back( RigCompletionData::FISHBONES );
completionTypes.push_back( RigCompletionData::FRACTURE );
completionTypes.push_back( RigCompletionData::PERFORATION );
completionTypes.push_back( RigCompletionData::CompletionType::FISHBONES );
completionTypes.push_back( RigCompletionData::CompletionType::FRACTURE );
completionTypes.push_back( RigCompletionData::CompletionType::PERFORATION );
for ( const auto& completionType : completionTypes )
{
@ -346,7 +344,7 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions( const std::v
if ( completionsForWell.empty() ) continue;
std::vector<RicWellPathFractureReportItem> reportItemsForWell;
if ( completionType == RigCompletionData::FRACTURE )
if ( completionType == RigCompletionData::CompletionType::FRACTURE )
{
for ( const auto& fracItem : fractureDataReportItems )
{
@ -359,9 +357,12 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions( const std::v
{
QString completionTypeText;
if ( completionType == RigCompletionData::FISHBONES ) completionTypeText = "Fishbones";
if ( completionType == RigCompletionData::FRACTURE ) completionTypeText = "Fracture";
if ( completionType == RigCompletionData::PERFORATION ) completionTypeText = "Perforation";
if ( completionType == RigCompletionData::CompletionType::FISHBONES )
completionTypeText = "Fishbones";
if ( completionType == RigCompletionData::CompletionType::FRACTURE )
completionTypeText = "Fracture";
if ( completionType == RigCompletionData::CompletionType::PERFORATION )
completionTypeText = "Perforation";
QString fileName =
QString( "%1_%2_%3" ).arg( wellPath->name() ).arg( completionTypeText ).arg( eclipseCaseName );
@ -501,8 +502,8 @@ RigCompletionData RicWellPathExportCompletionDataFeatureImpl::combineEclipseCell
resultCompletion.setSecondOrderingValue( firstCompletion.secondOrderingValue() );
resultCompletion.setSourcePdmObject( firstCompletion.sourcePdmObject() );
CellDirection cellDirection = firstCompletion.direction();
double largestTransmissibilityValue = firstCompletion.transmissibility();
RigCompletionData::CellDirection cellDirection = firstCompletion.direction();
double largestTransmissibilityValue = firstCompletion.transmissibility();
RiaWeightedMeanCalculator<double> diameterCalculator;
RiaWeightedMeanCalculator<double> skinFactorCalculator;
@ -1024,7 +1025,7 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompdatTableUsingFormatte
formatter.keyword( "COMPDATL" );
}
RigCompletionData::CompletionType currentCompletionType = RigCompletionData::CT_UNDEFINED;
RigCompletionData::CompletionType currentCompletionType = RigCompletionData::CompletionType::CT_UNDEFINED;
for ( const RigCompletionData& data : completionData )
{
@ -1033,9 +1034,9 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompdatTableUsingFormatte
// The completions are sorted by completion type, write out a heading when completion type changes
QString txt;
if ( data.completionType() == RigCompletionData::FISHBONES ) txt = "Fishbones";
if ( data.completionType() == RigCompletionData::FRACTURE ) txt = "Fracture";
if ( data.completionType() == RigCompletionData::PERFORATION ) txt = "Perforation";
if ( data.completionType() == RigCompletionData::CompletionType::FISHBONES ) txt = "Fishbones";
if ( data.completionType() == RigCompletionData::CompletionType::FRACTURE ) txt = "Fracture";
if ( data.completionType() == RigCompletionData::CompletionType::PERFORATION ) txt = "Perforation";
formatter.addOptionalComment( "---- Completions for completion type " + txt + " ----" );
@ -1064,18 +1065,8 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompdatTableUsingFormatte
.addOneBasedCellIndex( data.completionDataGridCell().localCellIndexJ() )
.addOneBasedCellIndex( data.completionDataGridCell().localCellIndexK() )
.addOneBasedCellIndex( data.completionDataGridCell().localCellIndexK() );
switch ( data.connectionState() )
{
case OPEN:
formatter.add( "OPEN" );
break;
case SHUT:
formatter.add( "SHUT" );
break;
case AUTO:
formatter.add( "AUTO" );
break;
}
formatter.add( "OPEN" );
formatter.addValueOrDefaultMarker( data.saturation(), RigCompletionData::defaultValue() );
formatter.addValueOrDefaultMarker( data.transmissibility(), RigCompletionData::defaultValue() );
@ -1089,13 +1080,13 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompdatTableUsingFormatte
switch ( data.direction() )
{
case DIR_I:
case RigCompletionData::CellDirection::DIR_I:
formatter.add( "'X'" );
break;
case DIR_J:
case RigCompletionData::CellDirection::DIR_J:
formatter.add( "'Y'" );
break;
case DIR_K:
case RigCompletionData::CellDirection::DIR_K:
default:
formatter.add( "'Z'" );
break;
@ -1213,9 +1204,8 @@ std::vector<RigCompletionData> RicWellPathExportCompletionDataFeatureImpl::gener
settings.caseToApply->mainGrid() ),
cell.startMD );
CellDirection direction = calculateCellMainDirection( settings.caseToApply,
cell.globCellIndex,
cell.intersectionLengthsInCellCS );
RigCompletionData::CellDirection direction =
calculateCellMainDirection( settings.caseToApply, cell.globCellIndex, cell.intersectionLengthsInCellCS );
const RimNonDarcyPerforationParameters* nonDarcyParameters =
wellPath->perforationIntervalCollection()->nonDarcyParameters();
@ -1299,9 +1289,10 @@ void RicWellPathExportCompletionDataFeatureImpl::appendCompletionData(
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
CellDirection RicWellPathExportCompletionDataFeatureImpl::calculateCellMainDirection( RimEclipseCase* eclipseCase,
size_t globalCellIndex,
const cvf::Vec3d& lengthsInCell )
RigCompletionData::CellDirection
RicWellPathExportCompletionDataFeatureImpl::calculateCellMainDirection( RimEclipseCase* eclipseCase,
size_t globalCellIndex,
const cvf::Vec3d& lengthsInCell )
{
RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData();
@ -1336,31 +1327,31 @@ CellDirection RicWellPathExportCompletionDataFeatureImpl::calculateCellMainDirec
if ( xLengthFraction > yLengthFraction && xLengthFraction > zLengthFraction )
{
return CellDirection::DIR_I;
return RigCompletionData::CellDirection::DIR_I;
}
else if ( yLengthFraction > xLengthFraction && yLengthFraction > zLengthFraction )
{
return CellDirection::DIR_J;
return RigCompletionData::CellDirection::DIR_J;
}
else
{
return CellDirection::DIR_K;
return RigCompletionData::CellDirection::DIR_K;
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
TransmissibilityData
RicWellPathExportCompletionDataFeatureImpl::calculateTransmissibilityData( RimEclipseCase* eclipseCase,
const RimWellPath* wellPath,
const cvf::Vec3d& internalCellLengths,
double skinFactor,
double wellRadius,
size_t globalCellIndex,
bool useLateralNTG,
size_t volumeScaleConstant,
CellDirection directionForVolumeScaling )
TransmissibilityData RicWellPathExportCompletionDataFeatureImpl::calculateTransmissibilityData(
RimEclipseCase* eclipseCase,
const RimWellPath* wellPath,
const cvf::Vec3d& internalCellLengths,
double skinFactor,
double wellRadius,
size_t globalCellIndex,
bool useLateralNTG,
size_t volumeScaleConstant,
RigCompletionData::CellDirection directionForVolumeScaling )
{
RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData();
@ -1457,9 +1448,9 @@ TransmissibilityData
if ( volumeScaleConstant != 1 )
{
if ( directionForVolumeScaling == CellDirection::DIR_I ) dx = dx / volumeScaleConstant;
if ( directionForVolumeScaling == CellDirection::DIR_J ) dy = dy / volumeScaleConstant;
if ( directionForVolumeScaling == CellDirection::DIR_K ) dz = dz / volumeScaleConstant;
if ( directionForVolumeScaling == RigCompletionData::CellDirection::DIR_I ) dx = dx / volumeScaleConstant;
if ( directionForVolumeScaling == RigCompletionData::CellDirection::DIR_J ) dy = dy / volumeScaleConstant;
if ( directionForVolumeScaling == RigCompletionData::CellDirection::DIR_K ) dz = dz / volumeScaleConstant;
}
const double transx = RigTransmissibilityEquations::wellBoreTransmissibilityComponent( internalCellLengths.x() * latNtg,
@ -1553,7 +1544,7 @@ double RicWellPathExportCompletionDataFeatureImpl::calculateTransmissibilityAsEc
double skinFactor,
double wellRadius,
size_t globalCellIndex,
CellDirection direction )
RigCompletionData::CellDirection direction )
{
RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData();
@ -1631,7 +1622,7 @@ double RicWellPathExportCompletionDataFeatureImpl::calculateTransmissibilityAsEc
double darcy = RiaEclipseUnitTools::darcysConstant( units );
double trans = cvf::UNDEFINED_DOUBLE;
if ( direction == CellDirection::DIR_I )
if ( direction == RigCompletionData::CellDirection::DIR_I )
{
trans = RigTransmissibilityEquations::wellBoreTransmissibilityComponent( dx,
permy,
@ -1642,7 +1633,7 @@ double RicWellPathExportCompletionDataFeatureImpl::calculateTransmissibilityAsEc
skinFactor,
darcy );
}
else if ( direction == CellDirection::DIR_J )
else if ( direction == RigCompletionData::CellDirection::DIR_J )
{
trans = RigTransmissibilityEquations::wellBoreTransmissibilityComponent( dy,
permx,
@ -1653,7 +1644,7 @@ double RicWellPathExportCompletionDataFeatureImpl::calculateTransmissibilityAsEc
skinFactor,
darcy );
}
else if ( direction == CellDirection::DIR_K )
else if ( direction == RigCompletionData::CellDirection::DIR_K )
{
trans = RigTransmissibilityEquations::wellBoreTransmissibilityComponent( dz * ntg,
permy,

View File

@ -98,19 +98,19 @@ private:
class RicWellPathExportCompletionDataFeatureImpl
{
public:
static CellDirection
static RigCompletionData::CellDirection
calculateCellMainDirection( RimEclipseCase* eclipseCase, size_t globalCellIndex, const cvf::Vec3d& lengthsInCell );
static TransmissibilityData
calculateTransmissibilityData( RimEclipseCase* eclipseCase,
const RimWellPath* wellPath,
const cvf::Vec3d& internalCellLengths,
double skinFactor,
double wellRadius,
size_t globalCellIndex,
bool useLateralNTG,
size_t volumeScaleConstant = 1,
CellDirection directionForVolumeScaling = CellDirection::DIR_I );
static TransmissibilityData calculateTransmissibilityData(
RimEclipseCase* eclipseCase,
const RimWellPath* wellPath,
const cvf::Vec3d& internalCellLengths,
double skinFactor,
double wellRadius,
size_t globalCellIndex,
bool useLateralNTG,
size_t volumeScaleConstant = 1,
RigCompletionData::CellDirection directionForVolumeScaling = RigCompletionData::CellDirection::DIR_I );
static double calculateDFactor( RimEclipseCase* eclipseCase,
double effectiveH,
@ -134,11 +134,11 @@ public:
const RicExportCompletionDataSettingsUi& settings );
private:
static double calculateTransmissibilityAsEclipseDoes( RimEclipseCase* eclipseCase,
double skinFactor,
double wellRadius,
size_t globalCellIndex,
CellDirection direction );
static double calculateTransmissibilityAsEclipseDoes( RimEclipseCase* eclipseCase,
double skinFactor,
double wellRadius,
size_t globalCellIndex,
RigCompletionData::CellDirection direction );
static RigCompletionData combineEclipseCellCompletions( const std::vector<RigCompletionData>& completions,
const RicExportCompletionDataSettingsUi& settings );

View File

@ -1491,7 +1491,7 @@ void RicWellPathExportMswCompletionsImpl::moveIntersectionsToICVs(
std::vector<RicMswCompletion*> perforations;
for ( auto completion : segment->completions() )
{
if ( completion->completionType() == RigCompletionData::PERFORATION )
if ( completion->completionType() == RigCompletionData::CompletionType::PERFORATION )
{
perforations.push_back( completion );
}
@ -1557,7 +1557,7 @@ void RicWellPathExportMswCompletionsImpl::moveIntersectionsToSuperICDsOrAICDs( g
}
else
{
CVF_ASSERT( completion->completionType() == RigCompletionData::PERFORATION );
CVF_ASSERT( completion->completionType() == RigCompletionData::CompletionType::PERFORATION );
perforations.push_back( completion );
}
}
@ -1600,7 +1600,7 @@ void RicWellPathExportMswCompletionsImpl::assignFishbonesLateralIntersections( c
for ( auto completion : segment->completions() )
{
if ( completion->completionType() != RigCompletionData::FISHBONES )
if ( completion->completionType() != RigCompletionData::CompletionType::FISHBONES )
{
continue;
}
@ -1817,7 +1817,7 @@ void RicWellPathExportMswCompletionsImpl::assignBranchNumbersToPerforations( con
{
for ( auto completion : segment->completions() )
{
if ( completion->completionType() == RigCompletionData::PERFORATION )
if ( completion->completionType() == RigCompletionData::CompletionType::PERFORATION )
{
completion->setBranchNumber( *branchNumber );
}
@ -1833,7 +1833,7 @@ void RicWellPathExportMswCompletionsImpl::assignBranchNumbersToOtherCompletions(
{
for ( auto completion : segment->completions() )
{
if ( completion->completionType() != RigCompletionData::PERFORATION )
if ( completion->completionType() != RigCompletionData::CompletionType::PERFORATION )
{
completion->setBranchNumber( ++( *branchNumber ) );

View File

@ -965,9 +965,9 @@ const RigGridBase* RicExportLgrFeature::hostGrid( const RigMainGrid* mainGrid, s
//--------------------------------------------------------------------------------------------------
LgrNameFactory::LgrNameFactory()
{
m_counters = { { RigCompletionData::FRACTURE, { "FRAC", 1 } },
{ RigCompletionData::FISHBONES, { "FB", 1 } },
{ RigCompletionData::PERFORATION, { "PERF", 1 } } };
m_counters = { { RigCompletionData::CompletionType::FRACTURE, { "FRAC", 1 } },
{ RigCompletionData::CompletionType::FISHBONES, { "FB", 1 } },
{ RigCompletionData::CompletionType::PERFORATION, { "PERF", 1 } } };
}
//--------------------------------------------------------------------------------------------------
@ -977,9 +977,9 @@ QString LgrNameFactory::newName( RigCompletionData::CompletionType completionTyp
{
switch ( completionType )
{
case RigCompletionData::FRACTURE:
case RigCompletionData::FISHBONES:
case RigCompletionData::PERFORATION:
case RigCompletionData::CompletionType::FRACTURE:
case RigCompletionData::CompletionType::FISHBONES:
case RigCompletionData::CompletionType::PERFORATION:
{
auto& counter = m_counters[completionType];
QString name = counter.first + "_" + QString::number( counter.second );

View File

@ -89,7 +89,7 @@ class CompletionInfo
{
public:
CompletionInfo()
: type( RigCompletionData::CT_UNDEFINED )
: type( RigCompletionData::CompletionType::CT_UNDEFINED )
, name( "" )
, wellPathName( "" )
{
@ -112,14 +112,15 @@ public:
bool isValid() const
{
return type != RigCompletionData::CT_UNDEFINED && !name.isEmpty() && !wellPathName.isEmpty();
return type != RigCompletionData::CompletionType::CT_UNDEFINED && !name.isEmpty() && !wellPathName.isEmpty();
}
int priority() const
{
return type == RigCompletionData::FRACTURE
? 1
: type == RigCompletionData::FISHBONES ? 2 : type == RigCompletionData::PERFORATION ? 3 : 4;
return type == RigCompletionData::CompletionType::FRACTURE ? 1
: type == RigCompletionData::CompletionType::FISHBONES ? 2
: type == RigCompletionData::CompletionType::PERFORATION ? 3
: 4;
}
// Sort by priority, then name, then number

View File

@ -139,9 +139,9 @@ int RicExportLgrUi::timeStep() const
std::set<RigCompletionData::CompletionType> RicExportLgrUi::completionTypes() const
{
std::set<RigCompletionData::CompletionType> cts;
if ( m_includePerforations() ) cts.insert( RigCompletionData::PERFORATION );
if ( m_includeFractures() ) cts.insert( RigCompletionData::FRACTURE );
if ( m_includeFishbones() ) cts.insert( RigCompletionData::FISHBONES );
if ( m_includePerforations() ) cts.insert( RigCompletionData::CompletionType::PERFORATION );
if ( m_includeFractures() ) cts.insert( RigCompletionData::CompletionType::FRACTURE );
if ( m_includeFishbones() ) cts.insert( RigCompletionData::CompletionType::FISHBONES );
return cts;
}

View File

@ -114,17 +114,6 @@ void RivWellConnectionFactorPartMgr::appendDynamicGeometryPartsToModel( cvf::Mod
std::vector<CompletionVizData> completionVizDataItems;
for ( const auto& completionsForCell : completionsForWellPath )
{
if ( !m_virtualPerforationResult->showConnectionFactorsOnClosedConnections() )
{
for ( const auto& completion : completionsForCell.second )
{
if ( completion.connectionState() == SHUT )
{
continue;
}
}
}
bool showConnectionFactorOnWellPath = true;
{
for ( const auto& completion : completionsForCell.second )

View File

@ -42,13 +42,13 @@ std::vector<RiaDefines::WellPathComponentType> fromCompletionData( const std::ve
{
switch ( d.completionType() )
{
case RigCompletionData::FRACTURE:
case RigCompletionData::CompletionType::FRACTURE:
appCompletionTypes.push_back( RiaDefines::WellPathComponentType::FRACTURE );
break;
case RigCompletionData::PERFORATION:
case RigCompletionData::CompletionType::PERFORATION:
appCompletionTypes.push_back( RiaDefines::WellPathComponentType::PERFORATION_INTERVAL );
break;
case RigCompletionData::FISHBONES:
case RigCompletionData::CompletionType::FISHBONES:
appCompletionTypes.push_back( RiaDefines::WellPathComponentType::FISHBONES );
break;
default:

View File

@ -38,12 +38,11 @@ RigCompletionData::RigCompletionData( const QString& wellName, const RigCompleti
, m_kh( std::numeric_limits<double>::infinity() )
, m_skinFactor( std::numeric_limits<double>::infinity() )
, m_dFactor( std::numeric_limits<double>::infinity() )
, m_direction( DIR_UNDEF )
, m_connectionState( OPEN )
, m_direction( CellDirection::DIR_UNDEF )
, m_count( 1 )
, m_wpimult( std::numeric_limits<double>::infinity() )
, m_isMainBore( false )
, m_completionType( CT_UNDEFINED )
, m_completionType( CompletionType::CT_UNDEFINED )
, m_firstOrderingValue( orderingValue )
, m_secondOrderingValue( std::numeric_limits<double>::infinity() )
{
@ -109,7 +108,8 @@ RigCompletionData& RigCompletionData::operator=( const RigCompletionData& other
//--------------------------------------------------------------------------------------------------
bool RigCompletionData::isPerforationValve( CompletionType type )
{
return type == PERFORATION_AICD || type == PERFORATION_ICD || type == PERFORATION_ICV;
return type == CompletionType::PERFORATION_AICD || type == CompletionType::PERFORATION_ICD ||
type == CompletionType::PERFORATION_ICV;
}
//--------------------------------------------------------------------------------------------------
@ -117,7 +117,7 @@ bool RigCompletionData::isPerforationValve( CompletionType type )
//--------------------------------------------------------------------------------------------------
bool RigCompletionData::isValve( CompletionType type )
{
return isPerforationValve( type ) || type == FISHBONES_ICD;
return isPerforationValve( type ) || type == CompletionType::FISHBONES_ICD;
}
//--------------------------------------------------------------------------------------------------
@ -125,7 +125,8 @@ bool RigCompletionData::isValve( CompletionType type )
//--------------------------------------------------------------------------------------------------
bool RigCompletionData::isWsegValveTypes( CompletionType type )
{
return type == FISHBONES_ICD || type == PERFORATION_ICD || type == PERFORATION_ICV;
return type == CompletionType::FISHBONES_ICD || type == CompletionType::PERFORATION_ICD ||
type == CompletionType::PERFORATION_ICV;
}
//==================================================================================================
@ -133,7 +134,7 @@ bool RigCompletionData::isWsegValveTypes( CompletionType type )
//==================================================================================================
void RigCompletionData::setFromFracture( double transmissibility, double skinFactor, double diameter )
{
m_completionType = FRACTURE;
m_completionType = CompletionType::FRACTURE;
m_transmissibility = transmissibility;
m_skinFactor = skinFactor;
m_diameter = diameter;
@ -173,7 +174,7 @@ void RigCompletionData::setTransAndWPImultBackgroundDataFromFishbone( double
CellDirection direction,
bool isMainBore )
{
m_completionType = FISHBONES;
m_completionType = CompletionType::FISHBONES;
m_transmissibility = transmissibility;
m_skinFactor = skinFactor;
m_diameter = diameter;
@ -192,7 +193,7 @@ void RigCompletionData::setTransAndWPImultBackgroundDataFromPerforation( double
double kh,
CellDirection direction )
{
m_completionType = PERFORATION;
m_completionType = CompletionType::PERFORATION;
m_transmissibility = transmissibility;
m_skinFactor = skinFactor;
m_diameter = diameter;
@ -317,14 +318,6 @@ const RigCompletionDataGridCell& RigCompletionData::completionDataGridCell() con
return m_cellIndex;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
WellConnectionState RigCompletionData::connectionState() const
{
return m_connectionState;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -376,7 +369,7 @@ double RigCompletionData::dFactor() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
CellDirection RigCompletionData::direction() const
RigCompletionData::CellDirection RigCompletionData::direction() const
{
return m_direction;
}
@ -453,7 +446,6 @@ void RigCompletionData::copy( RigCompletionData& target, const RigCompletionData
target.m_metadata = from.m_metadata;
target.m_wellName = from.m_wellName;
target.m_cellIndex = from.m_cellIndex;
target.m_connectionState = from.m_connectionState;
target.m_saturation = from.m_saturation;
target.m_transmissibility = from.m_transmissibility;
target.m_diameter = from.m_diameter;

View File

@ -27,27 +27,6 @@
#include <vector>
//==================================================================================================
///
//==================================================================================================
enum WellConnectionState
{
OPEN,
SHUT,
AUTO,
};
//==================================================================================================
///
//==================================================================================================
enum CellDirection
{
DIR_I,
DIR_J,
DIR_K,
DIR_UNDEF,
};
//==================================================================================================
///
//==================================================================================================
@ -69,7 +48,7 @@ struct RigCompletionMetaData
class RigCompletionData
{
public:
enum CompletionType
enum class CompletionType
{
FISHBONES,
FRACTURE,
@ -81,6 +60,14 @@ public:
CT_UNDEFINED
};
enum class CellDirection
{
DIR_I,
DIR_J,
DIR_K,
DIR_UNDEF,
};
RigCompletionData( const QString& wellName, const RigCompletionDataGridCell& cellIndex, double orderingValue );
~RigCompletionData();
@ -139,7 +126,6 @@ public:
const std::vector<RigCompletionMetaData>& metadata() const;
const QString& wellName() const;
const RigCompletionDataGridCell& completionDataGridCell() const;
WellConnectionState connectionState() const;
double saturation() const;
double transmissibility() const;
double diameter() const; // TODO: should be ft or m
@ -163,7 +149,6 @@ public:
private:
QString m_wellName;
RigCompletionDataGridCell m_cellIndex;
WellConnectionState m_connectionState;
double m_saturation; // TODO: remove, always use default in Eclipse?
double m_transmissibility;
double m_diameter;