From 9754e85c3c389599b0797d7769f006af29a0fc3d Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 11 Oct 2018 11:55:42 +0200 Subject: [PATCH] #3412 Non-Darcy Perf intervals : Use enum when computing d-factor --- ...sTransmissibilityCalculationFeatureImp.cpp | 4 +- ...ellPathExportCompletionDataFeatureImpl.cpp | 78 +++++++++++++------ ...cWellPathExportCompletionDataFeatureImpl.h | 7 +- .../RimNonDarcyPerforationParameters.cpp | 2 +- 4 files changed, 59 insertions(+), 32 deletions(-) diff --git a/ApplicationCode/Commands/CompletionExportCommands/RicFishbonesTransmissibilityCalculationFeatureImp.cpp b/ApplicationCode/Commands/CompletionExportCommands/RicFishbonesTransmissibilityCalculationFeatureImp.cpp index 232da20846..99a2dec84a 100644 --- a/ApplicationCode/Commands/CompletionExportCommands/RicFishbonesTransmissibilityCalculationFeatureImp.cpp +++ b/ApplicationCode/Commands/CompletionExportCommands/RicFishbonesTransmissibilityCalculationFeatureImp.cpp @@ -103,7 +103,7 @@ std::vector } else { - mainBoreDirection = RicWellPathExportCompletionDataFeatureImpl::calculateDirectionInCell( + mainBoreDirection = RicWellPathExportCompletionDataFeatureImpl::calculateCellMainDirection( settings.caseToApply, globalCellIndex, wellBorePart.lengthsInCell); } } @@ -148,7 +148,7 @@ std::vector mainBoreDirection); } - CellDirection direction = RicWellPathExportCompletionDataFeatureImpl::calculateDirectionInCell( + CellDirection direction = RicWellPathExportCompletionDataFeatureImpl::calculateCellMainDirection( settings.caseToApply, globalCellIndex, wellBorePart.lengthsInCell); completion.setTransAndWPImultBackgroundDataFromFishbone( diff --git a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp index 5898641c3e..94a66dd462 100644 --- a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp +++ b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp @@ -1656,33 +1656,62 @@ std::vector RicWellPathExportCompletionDataFeatureImpl::gener cell.startMD); CellDirection direction = - calculateDirectionInCell(settings.caseToApply, cell.globCellIndex, cell.intersectionLengthsInCellCS); + calculateCellMainDirection(settings.caseToApply, cell.globCellIndex, cell.intersectionLengthsInCellCS); - const double transmissibilityForCell = calculateTransmissibility(settings.caseToApply, - wellPath, - cell.intersectionLengthsInCellCS, - interval->skinFactor(), - interval->diameter(unitSystem) / 2, - cell.globCellIndex, - settings.useLateralNTG); + const RimNonDarcyPerforationParameters* nonDarcyParameters = + wellPath->perforationIntervalCollection()->nonDarcyParameters(); - const double krFactor = 1.0; - const double effectiveTransmissibilityForCell = transmissibilityForCell * krFactor; + double effectiveTransmissibilityForCell = 0.0; + { + const double transmissibilityForCell = calculateTransmissibility(settings.caseToApply, + wellPath, + cell.intersectionLengthsInCellCS, + interval->skinFactor(), + interval->diameter(unitSystem) / 2, + cell.globCellIndex, + settings.useLateralNTG); - const double dFactor = calculateDFactor(settings.caseToApply, - cell.intersectionLengthsInCellCS, - interval->diameter(unitSystem) / 2, - cell.globCellIndex, - wellPath->perforationIntervalCollection()->nonDarcyParameters(), - transmissibilityForCell); + if (nonDarcyParameters->nonDarcyFlowType() != RimNonDarcyPerforationParameters::NON_DARCY_NONE) + { + effectiveTransmissibilityForCell = + transmissibilityForCell * nonDarcyParameters->gridPermeabilityScalingFactor(); + } + else + { + effectiveTransmissibilityForCell = transmissibilityForCell; + } + } - const double kh = effectiveTransmissibilityForCell * cell.intersectionLengthsInCellCS.length(); + double dFactor = std::numeric_limits::infinity(); + double kh = std::numeric_limits::infinity(); - completion.setTransAndWPImultBackgroundDataFromPerforation( - transmissibilityForCell, interval->skinFactor(), interval->diameter(unitSystem), dFactor, kh, direction); + if (nonDarcyParameters->nonDarcyFlowType() == RimNonDarcyPerforationParameters::NON_DARCY_USER_DEFINED) + { + dFactor = nonDarcyParameters->userDefinedDFactor(); + } + else if (nonDarcyParameters->nonDarcyFlowType() == RimNonDarcyPerforationParameters::NON_DARCY_COMPUTED) + { + dFactor = calculateDFactor(settings.caseToApply, + cell.intersectionLengthsInCellCS, + cell.globCellIndex, + wellPath->perforationIntervalCollection()->nonDarcyParameters(), + effectiveTransmissibilityForCell); + } + + if (nonDarcyParameters->nonDarcyFlowType() != RimNonDarcyPerforationParameters::NON_DARCY_NONE) + { + kh = effectiveTransmissibilityForCell * cell.intersectionLengthsInCellCS.length(); + } + + completion.setTransAndWPImultBackgroundDataFromPerforation(effectiveTransmissibilityForCell, + interval->skinFactor(), + interval->diameter(unitSystem), + dFactor, + kh, + direction); completion.addMetadata("Perforation Completion", QString("MD In: %1 - MD Out: %2").arg(cell.startMD).arg(cell.endMD) + - QString(" Transmissibility: ") + QString::number(transmissibilityForCell)); + QString(" Transmissibility: ") + QString::number(effectiveTransmissibilityForCell)); completionData.push_back(completion); } } @@ -2245,9 +2274,9 @@ void RicWellPathExportCompletionDataFeatureImpl::appendCompletionData( //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -CellDirection RicWellPathExportCompletionDataFeatureImpl::calculateDirectionInCell(RimEclipseCase* eclipseCase, - size_t globalCellIndex, - const cvf::Vec3d& lengthsInCell) +CellDirection RicWellPathExportCompletionDataFeatureImpl::calculateCellMainDirection(RimEclipseCase* eclipseCase, + size_t globalCellIndex, + const cvf::Vec3d& lengthsInCell) { RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData(); @@ -2364,7 +2393,6 @@ double RicWellPathExportCompletionDataFeatureImpl::calculateTransmissibility(Rim //-------------------------------------------------------------------------------------------------- double RicWellPathExportCompletionDataFeatureImpl::calculateDFactor(RimEclipseCase* eclipseCase, const cvf::Vec3d& internalCellLengths, - const double wellRadius, size_t globalCellIndex, const RimNonDarcyPerforationParameters* nonDarcyParameters, const double effectiveTransmissibilityForCell) @@ -2395,7 +2423,7 @@ double RicWellPathExportCompletionDataFeatureImpl::calculateDFactor(RimEclipseCa betaFactor, effectiveTransmissibilityForCell, internalCellLengths.length(), - wellRadius, + nonDarcyParameters->wellRadius(), nonDarcyParameters->relativeGasDensity(), nonDarcyParameters->gasViscosity()); } diff --git a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.h b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.h index 7a4e667e7f..18e7705ea5 100644 --- a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.h +++ b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.h @@ -78,9 +78,9 @@ public: const RimWellPath* wellPath, const std::vector& perforationIntervals); - static CellDirection calculateDirectionInCell(RimEclipseCase* eclipseCase, - size_t globalCellIndex, - const cvf::Vec3d& lengthsInCell); + static CellDirection calculateCellMainDirection(RimEclipseCase* eclipseCase, + size_t globalCellIndex, + const cvf::Vec3d& lengthsInCell); static double calculateTransmissibility(RimEclipseCase* eclipseCase, const RimWellPath* wellPath, @@ -94,7 +94,6 @@ public: static double calculateDFactor(RimEclipseCase* eclipseCase, const cvf::Vec3d& internalCellLengths, - const double wellRadius, size_t globalCellIndex, const RimNonDarcyPerforationParameters* nonDarcyParameters, const double effectiveTransmissibilityForCell); diff --git a/ApplicationCode/ProjectDataModel/Completions/RimNonDarcyPerforationParameters.cpp b/ApplicationCode/ProjectDataModel/Completions/RimNonDarcyPerforationParameters.cpp index 50ace80935..ec9ccacdd5 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimNonDarcyPerforationParameters.cpp +++ b/ApplicationCode/ProjectDataModel/Completions/RimNonDarcyPerforationParameters.cpp @@ -67,7 +67,7 @@ RimNonDarcyPerforationParameters::RimNonDarcyPerforationParameters() CAF_PDM_InitField(&m_gridPermeabilityScalingFactor, "GridPermeabilityScalingFactor", - 0.0, + 1.0, "Grid Permeability Scaling Factor (Kr) [0..1]", "", "",