From 7f7fd91f20d072ffd5d45ecf0525b89ff79a7673 Mon Sep 17 00:00:00 2001 From: Gaute Lindkvist Date: Mon, 29 Oct 2018 08:40:48 +0100 Subject: [PATCH] #3546 Remove Pressure Depletion candidates that are definitely going away. --- .../RicfExportWellPathCompletions.cpp | 2 - .../RicfExportWellPathCompletions.h | 1 - .../RicExportCompletionDataSettingsUi.cpp | 15 -- .../RicExportCompletionDataSettingsUi.h | 2 - .../RicExportFractureCompletionsImpl.cpp | 90 +------ .../RicExportFractureCompletionsImpl.h | 14 +- ...ellPathExportCompletionDataFeatureImpl.cpp | 27 +- .../RigTransmissibilityCondenser.cpp | 245 ------------------ .../RigTransmissibilityCondenser.h | 15 -- 9 files changed, 12 insertions(+), 399 deletions(-) diff --git a/ApplicationCode/CommandFileInterface/RicfExportWellPathCompletions.cpp b/ApplicationCode/CommandFileInterface/RicfExportWellPathCompletions.cpp index 3783a5e668..889d7bb3c7 100644 --- a/ApplicationCode/CommandFileInterface/RicfExportWellPathCompletions.cpp +++ b/ApplicationCode/CommandFileInterface/RicfExportWellPathCompletions.cpp @@ -59,7 +59,6 @@ RicfExportWellPathCompletions::RicfExportWellPathCompletions() RICF_InitField(&m_transScalingTimeStep, "transScalingTimeStep", 0, "Transmissibility Scaling Pressure Time Step", "", "", ""); RICF_InitField(&m_transScalingSummaryWBHP, "transScalingWBHPFromSummary", true, "Transmissibility Scaling WBHP from summary", "", "", ""); RICF_InitField(&m_transScalingWBHP, "transScalingWBHP", 200.0, "Transmissibility Scaling Constant WBHP Value", "", "", ""); - RICF_InitField(&m_transScalingCorrection, "transScalingCorrection", RicExportCompletionDataSettingsUi::TransScalingCorrection(), "Transmissibility Scaling Correction", "", "", ""); } //-------------------------------------------------------------------------------------------------- @@ -83,7 +82,6 @@ void RicfExportWellPathCompletions::execute() exportSettings->compdatExport = m_compdatExport; exportSettings->transScalingType = m_transScalingType; - exportSettings->transScalingCorrection = m_transScalingCorrection; exportSettings->transScalingTimeStep = m_transScalingTimeStep; exportSettings->transScalingSummaryWBHP = m_transScalingSummaryWBHP; exportSettings->transScalingWBHP = m_transScalingWBHP; diff --git a/ApplicationCode/CommandFileInterface/RicfExportWellPathCompletions.h b/ApplicationCode/CommandFileInterface/RicfExportWellPathCompletions.h index c75d614f80..95cfb1deee 100644 --- a/ApplicationCode/CommandFileInterface/RicfExportWellPathCompletions.h +++ b/ApplicationCode/CommandFileInterface/RicfExportWellPathCompletions.h @@ -52,7 +52,6 @@ private: caf::PdmField m_transScalingTimeStep; caf::PdmField m_transScalingSummaryWBHP; caf::PdmField m_transScalingWBHP; - caf::PdmField m_transScalingCorrection; caf::PdmField m_useLateralNTG; caf::PdmField m_includePerforations; diff --git a/ApplicationCode/Commands/CompletionExportCommands/RicExportCompletionDataSettingsUi.cpp b/ApplicationCode/Commands/CompletionExportCommands/RicExportCompletionDataSettingsUi.cpp index 0fb9b83d47..a4e99b89b8 100644 --- a/ApplicationCode/Commands/CompletionExportCommands/RicExportCompletionDataSettingsUi.cpp +++ b/ApplicationCode/Commands/CompletionExportCommands/RicExportCompletionDataSettingsUi.cpp @@ -55,23 +55,11 @@ namespace caf void RicExportCompletionDataSettingsUi::TransScalingType::setUp() { addItem(RicExportFractureCompletionsImpl::NO_SCALING, "NO_SCALING", "No scaling"); - addItem(RicExportFractureCompletionsImpl::MATRIX_TO_FRACTURE_DP_OVER_INITIAL_DP, "MATFRAC_DP_OVER_INITIALDP", "Matrix to Fracture dP over initial dP"); - addItem(RicExportFractureCompletionsImpl::MATRIX_TO_FRACTURE_DP_OVER_MAX_INITIAL_DP, "MATFRAC_DP_OVER_MAX_INITIALDP", "Matrix to Fracture dP over max initial dP"); addItem(RicExportFractureCompletionsImpl::MATRIX_TO_WELL_DP_OVER_INITIAL_DP, "MATWELL_DP_OVER_INITIALDP", "Matrix to Well dP over initial dP"); addItem(RicExportFractureCompletionsImpl::MATRIX_TO_WELL_DP_OVER_MAX_INITIAL_DP, "MATWELL_DP_OVER_MAX_INITIALDP", "Matrix to Well dP over max initial dP"); - addItem(RicExportFractureCompletionsImpl::MATRIX_TO_FRACTURE_FLUX_OVER_MAX_FLUX, "MATFRAC_FLUX_OVER_MAXFLUX", "Matrix to Fracture Flux over max Flux"); setDefault(RicExportFractureCompletionsImpl::NO_SCALING); } - - template<> - void RicExportCompletionDataSettingsUi::TransScalingCorrection::setUp() - { - addItem(RicExportFractureCompletionsImpl::NO_CORRECTION, "NO_CORRECTION", "No correction"); - addItem(RicExportFractureCompletionsImpl::HOGSTOL_CORRECTION, "HOGSTOL_CORRECTION", "Høgstøl Correction"); - setDefault(RicExportFractureCompletionsImpl::NO_CORRECTION); - } - } // clang-format on @@ -99,7 +87,6 @@ RicExportCompletionDataSettingsUi::RicExportCompletionDataSettingsUi() CAF_PDM_InitField(&includeFractures, "IncludeFractures", true, "Fractures", "", "", ""); CAF_PDM_InitFieldNoDefault(&transScalingType, "TransScalingType", " Pressure Diff. Depletion Transmissibility Scaling (BETA)", "", "", ""); - CAF_PDM_InitFieldNoDefault(&transScalingCorrection, "TransScalingCorrection", " PDD Transmissibility Scaling Correction (BETA)", "", "", ""); CAF_PDM_InitField(&transScalingTimeStep, "TransScalingTimeStep", 0, " PDD Current Pressure Time Step (BETA)", "", "", ""); CAF_PDM_InitField(&transScalingWBHP, "TransScalingWBHP", 200.0, " PDD Default WBHP Value (BETA)", "", "", ""); CAF_PDM_InitField(&transScalingSummaryWBHP, "TransScalingWBHPFromCurrentTime", true, " PDD WBHP from Summary File at Current Time (BETA)", "", "", ""); @@ -267,12 +254,10 @@ void RicExportCompletionDataSettingsUi::defineUiOrdering(QString uiConfigName, c if (RiaApplication::enableDevelopmentFeatures()) { group->add(&transScalingType); - group->add(&transScalingCorrection); group->add(&transScalingTimeStep); group->add(&transScalingWBHP); group->add(&transScalingSummaryWBHP); - transScalingCorrection.uiCapability()->setUiReadOnly(transScalingType() == RicExportFractureCompletionsImpl::NO_SCALING); transScalingTimeStep.uiCapability()->setUiReadOnly(transScalingType() == RicExportFractureCompletionsImpl::NO_SCALING); transScalingWBHP.uiCapability()->setUiReadOnly(transScalingType() == RicExportFractureCompletionsImpl::NO_SCALING); transScalingSummaryWBHP.uiCapability()->setUiReadOnly(transScalingType() == RicExportFractureCompletionsImpl::NO_SCALING); diff --git a/ApplicationCode/Commands/CompletionExportCommands/RicExportCompletionDataSettingsUi.h b/ApplicationCode/Commands/CompletionExportCommands/RicExportCompletionDataSettingsUi.h index ed36bdb8ad..738cd25836 100644 --- a/ApplicationCode/Commands/CompletionExportCommands/RicExportCompletionDataSettingsUi.h +++ b/ApplicationCode/Commands/CompletionExportCommands/RicExportCompletionDataSettingsUi.h @@ -57,7 +57,6 @@ public: typedef caf::AppEnum CombinationModeType; typedef caf::AppEnum TransScalingType; - typedef caf::AppEnum TransScalingCorrection; RicExportCompletionDataSettingsUi(); @@ -70,7 +69,6 @@ public: caf::PdmField transScalingTimeStep; caf::PdmField transScalingSummaryWBHP; caf::PdmField transScalingWBHP; - caf::PdmField transScalingCorrection; caf::PdmField includeMsw; caf::PdmField useLateralNTG; diff --git a/ApplicationCode/Commands/CompletionExportCommands/RicExportFractureCompletionsImpl.cpp b/ApplicationCode/Commands/CompletionExportCommands/RicExportFractureCompletionsImpl.cpp index 96712b9b52..bb673f3118 100644 --- a/ApplicationCode/Commands/CompletionExportCommands/RicExportFractureCompletionsImpl.cpp +++ b/ApplicationCode/Commands/CompletionExportCommands/RicExportFractureCompletionsImpl.cpp @@ -332,44 +332,9 @@ std::vector RicExportFractureCompletionsImpl::generateCompdat // PROTOTYPE-CODE for Pressure Differential Depletion // // MAY CHANGE A LOT // //////////////////////////////////////////////////////// - if (currentPressureDropScaling == MATRIX_TO_FRACTURE_DP_OVER_INITIAL_DP || - currentPressureDropScaling == MATRIX_TO_FRACTURE_DP_OVER_MAX_INITIAL_DP) - { - RigTransmissibilityCondenser scaledCondenser = transCondenser; - // 1. Scale matrix to fracture transmissibilities by matrix to fracture pressure - std::map originalLumpedMatrixToFractureTrans = - scaledCondenser.scaleMatrixToFracTransByMatrixFracInitialDP(actCellInfo, - initialWellPressure, - currentWellPressure, - *initialMatrixPressures, - *currentMatrixPressures, - currentPressureDropScaling == - MATRIX_TO_FRACTURE_DP_OVER_MAX_INITIAL_DP); - // 2: Calculate new external transmissibilities - scaledCondenser.calculateCondensedTransmissibilities(); - - if (pdParams.transCorrection == NO_CORRECTION) - { - // Calculate effective matrix to well transmissibilities. - std::map effectiveMatrixToWellTransBeforeCorrection = - calculateMatrixToWellTransmissibilities(scaledCondenser); - matrixToWellTrans = effectiveMatrixToWellTransBeforeCorrection; - } - else if (pdParams.transCorrection == HOGSTOL_CORRECTION) - { - // Høgstøl correction. - // 1. Calculate new effective fracture to well transmissiblities - std::map fictitiousFractureToWellTransmissibilities = - scaledCondenser.calculateFicticiousFractureToWellTransmissibilities(); - // 2. Calculate new effective matrix to well transmissibilities - std::map effectiveMatrixToWellTrans = - scaledCondenser.calculateEffectiveMatrixToWellTransmissibilities(originalLumpedMatrixToFractureTrans, - fictitiousFractureToWellTransmissibilities); - matrixToWellTrans = effectiveMatrixToWellTrans; - } - } - else if (currentPressureDropScaling == MATRIX_TO_WELL_DP_OVER_INITIAL_DP || - currentPressureDropScaling == MATRIX_TO_WELL_DP_OVER_MAX_INITIAL_DP) + + if (currentPressureDropScaling == MATRIX_TO_WELL_DP_OVER_INITIAL_DP || + currentPressureDropScaling == MATRIX_TO_WELL_DP_OVER_MAX_INITIAL_DP) { RigTransmissibilityCondenser scaledCondenser = transCondenser; // 1. Scale matrix to fracture transmissibilities by matrix to fracture pressure @@ -383,58 +348,19 @@ std::vector RicExportFractureCompletionsImpl::generateCompdat // 2: Calculate new external transmissibilities scaledCondenser.calculateCondensedTransmissibilities(); - if (pdParams.transCorrection == NO_CORRECTION) - { - // Calculate effective matrix to well transmissibilities. - std::map effectiveMatrixToWellTransBeforeCorrection = - calculateMatrixToWellTransmissibilities(scaledCondenser); - matrixToWellTrans = effectiveMatrixToWellTransBeforeCorrection; - } - else if (pdParams.transCorrection == HOGSTOL_CORRECTION) - { - // Høgstøl correction. - // 1. Calculate new effective fracture to well transmissiblities + { // 3: Høgstøl correction. + + // a. Calculate new effective fracture to well transmissiblities std::map fictitiousFractureToWellTransmissibilities = scaledCondenser.calculateFicticiousFractureToWellTransmissibilities(); - // 2. Calculate new effective matrix to well transmissibilities - std::map effectiveMatrixToWellTrans = - scaledCondenser.calculateEffectiveMatrixToWellTransmissibilities(originalLumpedMatrixToFractureTrans, - fictitiousFractureToWellTransmissibilities); - matrixToWellTrans = effectiveMatrixToWellTrans; - } - } - else if (currentPressureDropScaling == MATRIX_TO_FRACTURE_FLUX_OVER_MAX_FLUX) - { - RigTransmissibilityCondenser scaledCondenser = transCondenser; - // 1. Scale matrix to fracture transmissibilities by matrix to fracture pressure Depletion: - std::map originalLumpedMatrixToFractureTrans = - scaledCondenser.scaleMatrixToFracTransByMatrixFracFlux(actCellInfo, - currentWellPressure, - *currentMatrixPressures, - false); - // 2: Calculate new external transmissibilities - scaledCondenser.calculateCondensedTransmissibilities(); - - if (pdParams.transCorrection == NO_CORRECTION) - { - // Calculate effective matrix to well transmissibilities. - std::map effectiveMatrixToWellTransBeforeCorrection = - calculateMatrixToWellTransmissibilities(scaledCondenser); - matrixToWellTrans = effectiveMatrixToWellTransBeforeCorrection; - } - else if (pdParams.transCorrection == HOGSTOL_CORRECTION) - { - // Høgstøl correction. - // 1. Calculate new effective fracture to well transmissiblities - std::map fictitiousFractureToWellTransmissibilities = - scaledCondenser.calculateFicticiousFractureToWellTransmissibilities(); - // 2. Calculate new effective matrix to well transmissibilities + // b. Calculate new effective matrix to well transmissibilities std::map effectiveMatrixToWellTrans = scaledCondenser.calculateEffectiveMatrixToWellTransmissibilities(originalLumpedMatrixToFractureTrans, fictitiousFractureToWellTransmissibilities); matrixToWellTrans = effectiveMatrixToWellTrans; } } + //////////////////////////////////////////////////////////// // clang-format on // END PROTOTYPE CODE FOR PRESSURE DIFFERENTIAL DEPLETION // diff --git a/ApplicationCode/Commands/CompletionExportCommands/RicExportFractureCompletionsImpl.h b/ApplicationCode/Commands/CompletionExportCommands/RicExportFractureCompletionsImpl.h index 115cba7ab6..3fc6922564 100644 --- a/ApplicationCode/Commands/CompletionExportCommands/RicExportFractureCompletionsImpl.h +++ b/ApplicationCode/Commands/CompletionExportCommands/RicExportFractureCompletionsImpl.h @@ -47,17 +47,8 @@ public: enum PressureDepletionTransScaling { NO_SCALING = 0, - MATRIX_TO_FRACTURE_DP_OVER_INITIAL_DP, - MATRIX_TO_FRACTURE_DP_OVER_MAX_INITIAL_DP, MATRIX_TO_WELL_DP_OVER_INITIAL_DP, - MATRIX_TO_WELL_DP_OVER_MAX_INITIAL_DP, - MATRIX_TO_FRACTURE_FLUX_OVER_MAX_FLUX - }; - - enum PressureDepletionTransCorrection - { - NO_CORRECTION, - HOGSTOL_CORRECTION + MATRIX_TO_WELL_DP_OVER_MAX_INITIAL_DP }; //-------------------------------------------------------------------------------------------------- @@ -66,19 +57,16 @@ public: struct PressureDepletionParameters { PressureDepletionParameters(PressureDepletionTransScaling pressureDropScaling = NO_SCALING, - PressureDepletionTransCorrection transCorrection = NO_CORRECTION, int pressureScalingTimeStep = 0, bool wbhpFromSummaryCase = false, double pressureScalingWBHP = 200.0) : pressureDropScaling(pressureDropScaling) - , transCorrection(transCorrection) , pressureScalingTimeStep(pressureScalingTimeStep) , wbhpFromSummaryCase(wbhpFromSummaryCase) , pressureScalingWBHP(pressureScalingWBHP) {} PressureDepletionTransScaling pressureDropScaling; - PressureDepletionTransCorrection transCorrection; int pressureScalingTimeStep; bool wbhpFromSummaryCase; double pressureScalingWBHP; diff --git a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp index 25d8dc2e70..7d5b1fa675 100644 --- a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp +++ b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp @@ -243,7 +243,6 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions(const std::ve reportItems, fractureTransmissibilityExportInformationStream.get(), RicExportFractureCompletionsImpl::PressureDepletionParameters(exportSettings.transScalingType(), - exportSettings.transScalingCorrection(), exportSettings.transScalingTimeStep(), exportSettings.transScalingSummaryWBHP(), exportSettings.transScalingWBHP())); @@ -290,7 +289,6 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions(const std::ve simWell, fractureTransmissibilityExportInformationStream.get(), RicExportFractureCompletionsImpl::PressureDepletionParameters(exportSettings.transScalingType(), - exportSettings.transScalingCorrection(), exportSettings.transScalingTimeStep(), exportSettings.transScalingSummaryWBHP(), exportSettings.transScalingWBHP())); @@ -2624,17 +2622,9 @@ QString RicWellPathExportCompletionDataFeatureImpl::createPressureDepletionFileN const RicExportCompletionDataSettingsUi& exportSettings) { QString suffix; - if (exportSettings.transScalingType() != RicExportFractureCompletionsImpl::NO_CORRECTION) + if (exportSettings.transScalingType() != RicExportFractureCompletionsImpl::NO_SCALING) { - if (exportSettings.transScalingType() == RicExportFractureCompletionsImpl::MATRIX_TO_FRACTURE_DP_OVER_INITIAL_DP) - { - suffix += QString("_1"); - } - else if (exportSettings.transScalingType() == RicExportFractureCompletionsImpl::MATRIX_TO_FRACTURE_DP_OVER_MAX_INITIAL_DP) - { - suffix += QString("_2"); - } - else if (exportSettings.transScalingType() == RicExportFractureCompletionsImpl::MATRIX_TO_WELL_DP_OVER_INITIAL_DP) + if (exportSettings.transScalingType() == RicExportFractureCompletionsImpl::MATRIX_TO_WELL_DP_OVER_INITIAL_DP) { suffix += QString("_3"); } @@ -2642,19 +2632,8 @@ QString RicWellPathExportCompletionDataFeatureImpl::createPressureDepletionFileN { suffix += QString("_4"); } - else if (exportSettings.transScalingType() == RicExportFractureCompletionsImpl::MATRIX_TO_FRACTURE_FLUX_OVER_MAX_FLUX) - { - suffix += QString("_5"); - } - if (exportSettings.transScalingCorrection() == RicExportFractureCompletionsImpl::HOGSTOL_CORRECTION) - { - suffix += QString("B_"); - } - else - { - suffix += QString("A_"); - } + suffix += QString("B_"); if (exportSettings.transScalingSummaryWBHP()) { diff --git a/ApplicationCode/ReservoirDataModel/Completions/RigTransmissibilityCondenser.cpp b/ApplicationCode/ReservoirDataModel/Completions/RigTransmissibilityCondenser.cpp index 8ff0d13ab8..f9964c4454 100644 --- a/ApplicationCode/ReservoirDataModel/Completions/RigTransmissibilityCondenser.cpp +++ b/ApplicationCode/ReservoirDataModel/Completions/RigTransmissibilityCondenser.cpp @@ -188,251 +188,6 @@ std::map return originalLumpedMatrixToFractureTrans; } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -std::map - RigTransmissibilityCondenser::scaleMatrixToFracTransByMatrixFracInitialDP(const RigActiveCellInfo* actCellInfo, - double initialWellPressure, - double currentWellPressure, - const std::vector& initialMatrixPressures, - const std::vector& currentMatrixPressures, - bool normalizeByMax) -{ - // Solve for fracture pressures, current and initial - std::map initialFractureCellToPressureMap = - solveForFracturePressures(actCellInfo, initialMatrixPressures, initialWellPressure); - std::map currentFractureCellToPressureMap = - solveForFracturePressures(actCellInfo, currentMatrixPressures, currentWellPressure); - - // Calculate maximum pressure drop - double maxInitialPressureDrop = 0.0; - if (normalizeByMax) - { - for (auto it = m_neighborTransmissibilities.begin(); it != m_neighborTransmissibilities.end(); ++it) - { - if (it->first.m_cellIndexSpace == CellAddress::STIMPLAN) - { - size_t globalFractureCellIdx = it->first.m_globalCellIdx; - double initialFracturePressure = initialFractureCellToPressureMap[globalFractureCellIdx]; - - for (auto jt = it->second.begin(); jt != it->second.end(); ++jt) - { - if (jt->first.m_cellIndexSpace == CellAddress::ECLIPSE) - { - size_t globalMatrixCellIdx = jt->first.m_globalCellIdx; - - size_t eclipseResultIndex = actCellInfo->cellResultIndex(globalMatrixCellIdx); - CVF_ASSERT(eclipseResultIndex < initialMatrixPressures.size()); - - double initialMatrixPressure = initialMatrixPressures[eclipseResultIndex]; - double initialPressureDrop = std::abs(initialMatrixPressure - initialFracturePressure); - maxInitialPressureDrop = std::max(maxInitialPressureDrop, initialPressureDrop); - } - } - } - } - } - - std::map originalLumpedMatrixToFractureTrans; // Sum(T_mf) - for (auto it = m_neighborTransmissibilities.begin(); it != m_neighborTransmissibilities.end(); ++it) - { - if (it->first.m_cellIndexSpace == CellAddress::STIMPLAN) - { - size_t globalFractureCellIdx = it->first.m_globalCellIdx; - double currentFracturePressure = currentFractureCellToPressureMap[globalFractureCellIdx]; - double initialFracturePressure = initialFractureCellToPressureMap[globalFractureCellIdx]; - - for (auto jt = it->second.begin(); jt != it->second.end(); ++jt) - { - if (jt->first.m_cellIndexSpace == CellAddress::ECLIPSE) - { - size_t globalMatrixCellIdx = jt->first.m_globalCellIdx; - - size_t eclipseResultIndex = actCellInfo->cellResultIndex(globalMatrixCellIdx); - CVF_ASSERT(eclipseResultIndex < currentMatrixPressures.size()); - - double currentMatrixPressure = currentMatrixPressures[eclipseResultIndex]; - double pressureDrop = std::abs(currentMatrixPressure - currentFracturePressure); - - // Add to Sum(T_mf) - originalLumpedMatrixToFractureTrans[globalMatrixCellIdx] += jt->second; - - if (normalizeByMax) - { - double pressureScaling = pressureDrop / maxInitialPressureDrop; - jt->second *= pressureScaling; - } - else - { - double initialMatrixPressure = initialMatrixPressures[eclipseResultIndex]; - double initialPressureDrop = std::abs(initialMatrixPressure - initialFracturePressure); - double pressureScaling = pressureDrop / initialPressureDrop; - jt->second *= pressureScaling; - } - } - } - } - } - return originalLumpedMatrixToFractureTrans; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -std::map - RigTransmissibilityCondenser::solveForFracturePressures(const RigActiveCellInfo* actCellInfo, - const std::vector& currentMatrixPressures, - double currentWellPressure) -{ - Eigen::VectorXd externalPressures(m_Tie.cols()); - { - size_t rowIndex = 0u; - for (const CellAddress& externalCell : m_externalCellAddrSet) - { - if (externalCell.m_cellIndexSpace == CellAddress::ECLIPSE) - { - size_t eclipseResultIndex = actCellInfo->cellResultIndex(externalCell.m_globalCellIdx); - CVF_ASSERT(eclipseResultIndex < currentMatrixPressures.size()); - externalPressures[rowIndex++] = currentMatrixPressures[eclipseResultIndex]; - } - else - { - CVF_ASSERT(externalCell.m_cellIndexSpace == CellAddress::WELL); - externalPressures[rowIndex++] = currentWellPressure; - } - } - } - Eigen::VectorXd fracturePressures = m_TiiInv * (-m_Tie * externalPressures); - - // Extract fracture pressures into a map - std::map fractureCellToPressureMap; - { - size_t rowIndex = 0u; - for (const ConnectionTransmissibility& connectionTrans : m_neighborTransmissibilities) - { - if (connectionTrans.first.m_cellIndexSpace == CellAddress::STIMPLAN) - { - fractureCellToPressureMap[connectionTrans.first.m_globalCellIdx] = fracturePressures[rowIndex++]; - } - } - } - return fractureCellToPressureMap; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -std::map - RigTransmissibilityCondenser::scaleMatrixToFracTransByMatrixFracFlux(const RigActiveCellInfo* actCellInfo, - double currentWellPressure, - const std::vector& currentMatrixPressures, - bool divideByAverageFlux) -{ - // Solve for fracture pressures - Eigen::VectorXd matrixPressures(m_Tie.cols()); - { - size_t rowIndex = 0u; - for (const CellAddress& externalCell : m_externalCellAddrSet) - { - if (externalCell.m_cellIndexSpace == CellAddress::ECLIPSE) - { - size_t eclipseResultIndex = actCellInfo->cellResultIndex(externalCell.m_globalCellIdx); - CVF_ASSERT(eclipseResultIndex < currentMatrixPressures.size()); - matrixPressures[rowIndex++] = currentMatrixPressures[eclipseResultIndex]; - } - else - { - CVF_ASSERT(externalCell.m_cellIndexSpace == CellAddress::WELL); - matrixPressures[rowIndex++] = currentWellPressure; - } - } - } - Eigen::VectorXd fracturePressures = m_TiiInv * (m_Tie * matrixPressures * -1.0); - - // Extract fracture pressures into a map - std::map fractureCellToPressureMap; - { - size_t rowIndex = 0u; - for (const ConnectionTransmissibility& connectionTrans : m_neighborTransmissibilities) - { - if (connectionTrans.first.m_cellIndexSpace == CellAddress::STIMPLAN) - { - fractureCellToPressureMap[connectionTrans.first.m_globalCellIdx] = fracturePressures[rowIndex++]; - } - } - } - - // Calculate maximum and average pressure drop - double maxFlux = 0.0; - RiaWeightedMeanCalculator meanCalculator; - for (auto it = m_neighborTransmissibilities.begin(); it != m_neighborTransmissibilities.end(); ++it) - { - if (it->first.m_cellIndexSpace == CellAddress::STIMPLAN) - { - size_t globalFractureCellIdx = it->first.m_globalCellIdx; - double fracturePressure = fractureCellToPressureMap[globalFractureCellIdx]; - - for (auto jt = it->second.begin(); jt != it->second.end(); ++jt) - { - if (jt->first.m_cellIndexSpace == CellAddress::ECLIPSE) - { - size_t globalMatrixCellIdx = jt->first.m_globalCellIdx; - - size_t eclipseResultIndex = actCellInfo->cellResultIndex(globalMatrixCellIdx); - CVF_ASSERT(eclipseResultIndex < currentMatrixPressures.size()); - - double matrixPressure = currentMatrixPressures[eclipseResultIndex]; - double pressureDrop = std::abs(matrixPressure - fracturePressure); - double flux = pressureDrop * jt->second; - meanCalculator.addValueAndWeight(flux, 1.0); - maxFlux = std::max(maxFlux, flux); - } - } - } - } - if (divideByAverageFlux && !meanCalculator.validAggregatedWeight()) - { - return std::map(); - } - else if (!divideByAverageFlux && maxFlux < 1.0e-9) - { - return std::map(); - } - double averageFlux = meanCalculator.weightedMean(); - - std::map originalLumpedMatrixToFractureTrans; // Sum(T_mf) - for (auto it = m_neighborTransmissibilities.begin(); it != m_neighborTransmissibilities.end(); ++it) - { - if (it->first.m_cellIndexSpace == CellAddress::STIMPLAN) - { - size_t globalFractureCellIdx = it->first.m_globalCellIdx; - double fracturePressure = fractureCellToPressureMap[globalFractureCellIdx]; - - for (auto jt = it->second.begin(); jt != it->second.end(); ++jt) - { - if (jt->first.m_cellIndexSpace == CellAddress::ECLIPSE) - { - size_t globalMatrixCellIdx = jt->first.m_globalCellIdx; - - size_t eclipseResultIndex = actCellInfo->cellResultIndex(globalMatrixCellIdx); - CVF_ASSERT(eclipseResultIndex < currentMatrixPressures.size()); - - double matrixPressure = currentMatrixPressures[eclipseResultIndex]; - double pressureDrop = std::abs(matrixPressure - fracturePressure); - double flux = jt->second * pressureDrop; - // Add to Sum(T_mf) - originalLumpedMatrixToFractureTrans[globalMatrixCellIdx] += jt->second; - - double pressureScaling = flux / (divideByAverageFlux ? averageFlux : maxFlux); - jt->second *= pressureScaling; - } - } - } - } - return originalLumpedMatrixToFractureTrans; -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ReservoirDataModel/Completions/RigTransmissibilityCondenser.h b/ApplicationCode/ReservoirDataModel/Completions/RigTransmissibilityCondenser.h index 21d5e6a8c9..5a98d8f2aa 100644 --- a/ApplicationCode/ReservoirDataModel/Completions/RigTransmissibilityCondenser.h +++ b/ApplicationCode/ReservoirDataModel/Completions/RigTransmissibilityCondenser.h @@ -102,21 +102,6 @@ public: const std::vector& currentMatrixPressures, bool normalizeByMax); - std::map scaleMatrixToFracTransByMatrixFracInitialDP(const RigActiveCellInfo* actCellInfo, - double initialWellPressure, - double currentWellPressure, - const std::vector& initialMatrixPressures, - const std::vector& currentMatrixPressures, - bool normalizeByMax); - - std::map solveForFracturePressures(const RigActiveCellInfo* actCellInfo, const std::vector ¤tMatrixPressures, double currentWellPressure); - - - std::map scaleMatrixToFracTransByMatrixFracFlux(const RigActiveCellInfo* actCellInfo, - double currentWellPressure, - const std::vector& currentMatrixPressures, - bool divideByAverageFlux); - std::map calculateFicticiousFractureToWellTransmissibilities(); std::map calculateEffectiveMatrixToWellTransmissibilities(const std::map& originalLumpedMatrixToFractureTrans,