#3546 Remove Pressure Depletion candidates that are definitely going away.

This commit is contained in:
Gaute Lindkvist 2018-10-29 08:40:48 +01:00
parent 6628b9d734
commit 7f7fd91f20
9 changed files with 12 additions and 399 deletions

View File

@ -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;

View File

@ -52,7 +52,6 @@ private:
caf::PdmField<int> m_transScalingTimeStep;
caf::PdmField<bool> m_transScalingSummaryWBHP;
caf::PdmField<double> m_transScalingWBHP;
caf::PdmField<RicExportCompletionDataSettingsUi::TransScalingCorrection> m_transScalingCorrection;
caf::PdmField<bool> m_useLateralNTG;
caf::PdmField<bool> m_includePerforations;

View File

@ -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);

View File

@ -57,7 +57,6 @@ public:
typedef caf::AppEnum<CombinationMode> CombinationModeType;
typedef caf::AppEnum<RicExportFractureCompletionsImpl::PressureDepletionTransScaling> TransScalingType;
typedef caf::AppEnum<RicExportFractureCompletionsImpl::PressureDepletionTransCorrection> TransScalingCorrection;
RicExportCompletionDataSettingsUi();
@ -70,7 +69,6 @@ public:
caf::PdmField<int> transScalingTimeStep;
caf::PdmField<bool> transScalingSummaryWBHP;
caf::PdmField<double> transScalingWBHP;
caf::PdmField<TransScalingCorrection> transScalingCorrection;
caf::PdmField<bool> includeMsw;
caf::PdmField<bool> useLateralNTG;

View File

@ -332,44 +332,9 @@ std::vector<RigCompletionData> 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<size_t, double> 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<size_t, double> 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<size_t, double> fictitiousFractureToWellTransmissibilities =
scaledCondenser.calculateFicticiousFractureToWellTransmissibilities();
// 2. Calculate new effective matrix to well transmissibilities
std::map<size_t, double> 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<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
// 2: Calculate new external transmissibilities
scaledCondenser.calculateCondensedTransmissibilities();
if (pdParams.transCorrection == NO_CORRECTION)
{
// Calculate effective matrix to well transmissibilities.
std::map<size_t, double> 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<size_t, double> fictitiousFractureToWellTransmissibilities =
scaledCondenser.calculateFicticiousFractureToWellTransmissibilities();
// 2. Calculate new effective matrix to well transmissibilities
std::map<size_t, double> 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<size_t, double> 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<size_t, double> 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<size_t, double> fictitiousFractureToWellTransmissibilities =
scaledCondenser.calculateFicticiousFractureToWellTransmissibilities();
// 2. Calculate new effective matrix to well transmissibilities
// b. Calculate new effective matrix to well transmissibilities
std::map<size_t, double> effectiveMatrixToWellTrans =
scaledCondenser.calculateEffectiveMatrixToWellTransmissibilities(originalLumpedMatrixToFractureTrans,
fictitiousFractureToWellTransmissibilities);
matrixToWellTrans = effectiveMatrixToWellTrans;
}
}
////////////////////////////////////////////////////////////
// clang-format on
// END PROTOTYPE CODE FOR PRESSURE DIFFERENTIAL DEPLETION //

View File

@ -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;

View File

@ -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())
{

View File

@ -188,251 +188,6 @@ std::map<size_t, double>
return originalLumpedMatrixToFractureTrans;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::map<size_t, double>
RigTransmissibilityCondenser::scaleMatrixToFracTransByMatrixFracInitialDP(const RigActiveCellInfo* actCellInfo,
double initialWellPressure,
double currentWellPressure,
const std::vector<double>& initialMatrixPressures,
const std::vector<double>& currentMatrixPressures,
bool normalizeByMax)
{
// Solve for fracture pressures, current and initial
std::map<size_t, double> initialFractureCellToPressureMap =
solveForFracturePressures(actCellInfo, initialMatrixPressures, initialWellPressure);
std::map<size_t, double> 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<size_t, double> 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<size_t, double>
RigTransmissibilityCondenser::solveForFracturePressures(const RigActiveCellInfo* actCellInfo,
const std::vector<double>& 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<size_t, double> 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<size_t, double>
RigTransmissibilityCondenser::scaleMatrixToFracTransByMatrixFracFlux(const RigActiveCellInfo* actCellInfo,
double currentWellPressure,
const std::vector<double>& 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<size_t, double> 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<double> 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<size_t, double>();
}
else if (!divideByAverageFlux && maxFlux < 1.0e-9)
{
return std::map<size_t, double>();
}
double averageFlux = meanCalculator.weightedMean();
std::map<size_t, double> 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;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -102,21 +102,6 @@ public:
const std::vector<double>& currentMatrixPressures,
bool normalizeByMax);
std::map<size_t, double> scaleMatrixToFracTransByMatrixFracInitialDP(const RigActiveCellInfo* actCellInfo,
double initialWellPressure,
double currentWellPressure,
const std::vector<double>& initialMatrixPressures,
const std::vector<double>& currentMatrixPressures,
bool normalizeByMax);
std::map<size_t, double> solveForFracturePressures(const RigActiveCellInfo* actCellInfo, const std::vector<double> &currentMatrixPressures, double currentWellPressure);
std::map<size_t, double> scaleMatrixToFracTransByMatrixFracFlux(const RigActiveCellInfo* actCellInfo,
double currentWellPressure,
const std::vector<double>& currentMatrixPressures,
bool divideByAverageFlux);
std::map<size_t, double> calculateFicticiousFractureToWellTransmissibilities();
std::map<size_t, double>
calculateEffectiveMatrixToWellTransmissibilities(const std::map<size_t, double>& originalLumpedMatrixToFractureTrans,