#7049 MLW: Improve calculations of diameter, skin factor and direction

Diameter and skin factor : Compute weighted average based on transmissibility
Use the direction of the completion with the highest transmissibility
This commit is contained in:
Magne Sjaastad 2021-05-18 09:44:01 +02:00
parent 226876dc0a
commit 827cf75207

View File

@ -488,6 +488,9 @@ RigCompletionData RicWellPathExportCompletionDataFeatureImpl::combineEclipseCell
{ {
CVF_ASSERT( !completions.empty() ); CVF_ASSERT( !completions.empty() );
// For detailed description of how the combined completion data is computed, see
// https://github.com/OPM/ResInsight/issues/7049
const RigCompletionData& firstCompletion = completions[0]; const RigCompletionData& firstCompletion = completions[0];
const QString& wellName = firstCompletion.wellName(); const QString& wellName = firstCompletion.wellName();
@ -498,37 +501,33 @@ RigCompletionData RicWellPathExportCompletionDataFeatureImpl::combineEclipseCell
resultCompletion.setSecondOrderingValue( firstCompletion.secondOrderingValue() ); resultCompletion.setSecondOrderingValue( firstCompletion.secondOrderingValue() );
resultCompletion.setSourcePdmObject( firstCompletion.sourcePdmObject() ); resultCompletion.setSourcePdmObject( firstCompletion.sourcePdmObject() );
// completion type, skin factor, well bore diameter and cell direction are taken from (first) main bore, CellDirection cellDirection = firstCompletion.direction();
// if no main bore they are taken from first completion double largestTransmissibilityValue = firstCompletion.transmissibility();
double skinfactor = firstCompletion.skinFactor();
double wellBoreDiameter = firstCompletion.diameter(); RiaWeightedMeanCalculator<double> diameterCalculator;
CellDirection cellDirection = firstCompletion.direction(); RiaWeightedMeanCalculator<double> skinFactorCalculator;
for ( const RigCompletionData& completion : completions ) for ( const RigCompletionData& completion : completions )
{ {
// Use data from the completion with largest diameter double transmissibility = completion.transmissibility();
// This is more robust than checking for main bore flag
// See also https://github.com/OPM/ResInsight/issues/2765 diameterCalculator.addValueAndWeight( completion.diameter(), transmissibility );
if ( completion.diameter() > wellBoreDiameter ) skinFactorCalculator.addValueAndWeight( completion.skinFactor(), transmissibility );
if ( transmissibility > largestTransmissibilityValue )
{ {
skinfactor = completion.skinFactor(); largestTransmissibilityValue = transmissibility;
wellBoreDiameter = completion.diameter(); cellDirection = completion.direction();
cellDirection = completion.direction();
} }
} }
double combinedDiameter = diameterCalculator.weightedMean();
double combinedSkinFactor = skinFactorCalculator.weightedMean();
double combinedTrans = 0.0; double combinedTrans = 0.0;
double combinedKh = 0.0; double combinedKh = 0.0;
double combinedDFactor = 0.0; double combinedDFactor = 0.0;
if ( completions.size() == 1 )
{
resultCompletion.m_metadata = completions[0].m_metadata;
combinedTrans = completions[0].transmissibility();
combinedKh = completions[0].kh();
combinedDFactor = completions[0].dFactor();
}
else
{ {
RiaWeightedMeanCalculator<double> dFactorCalculator; RiaWeightedMeanCalculator<double> dFactorCalculator;
@ -573,8 +572,8 @@ RigCompletionData RicWellPathExportCompletionDataFeatureImpl::combineEclipseCell
resultCompletion.setCombinedValuesExplicitTrans( combinedTrans, resultCompletion.setCombinedValuesExplicitTrans( combinedTrans,
combinedKh, combinedKh,
combinedDFactor, combinedDFactor,
skinfactor, combinedSkinFactor,
wellBoreDiameter, combinedDiameter,
cellDirection, cellDirection,
completionType ); completionType );
} }
@ -583,8 +582,8 @@ RigCompletionData RicWellPathExportCompletionDataFeatureImpl::combineEclipseCell
// calculate trans for main bore - but as Eclipse will do it! // calculate trans for main bore - but as Eclipse will do it!
double transmissibilityEclipseCalculation = double transmissibilityEclipseCalculation =
RicWellPathExportCompletionDataFeatureImpl::calculateTransmissibilityAsEclipseDoes( settings.caseToApply(), RicWellPathExportCompletionDataFeatureImpl::calculateTransmissibilityAsEclipseDoes( settings.caseToApply(),
skinfactor, combinedSkinFactor,
wellBoreDiameter / 2, combinedDiameter / 2,
cellIndexIJK.globalCellIndex(), cellIndexIJK.globalCellIndex(),
cellDirection ); cellDirection );
@ -592,8 +591,8 @@ RigCompletionData RicWellPathExportCompletionDataFeatureImpl::combineEclipseCell
resultCompletion.setCombinedValuesImplicitTransWPImult( wpimult, resultCompletion.setCombinedValuesImplicitTransWPImult( wpimult,
combinedKh, combinedKh,
combinedDFactor, combinedDFactor,
skinfactor, combinedSkinFactor,
wellBoreDiameter, combinedDiameter,
cellDirection, cellDirection,
completionType ); completionType );
} }