mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-10 23:46:00 -06:00
#3409 Add time dependent mat to frac dP option
This commit is contained in:
parent
df2c3c4819
commit
301e05caa0
@ -55,11 +55,12 @@ namespace caf
|
||||
void RicExportCompletionDataSettingsUi::TransScalingType::setUp()
|
||||
{
|
||||
addItem(RicExportFractureCompletionsImpl::NO_SCALING, "NO_SCALING", "No scaling");
|
||||
addItem(RicExportFractureCompletionsImpl::MATRIX_TO_FRACTURE_DP_OVER_MAX_DP, "MATFRAC_DP_OVER_MAXDP", "Matrix to Fracture dP over max dP");
|
||||
addItem(RicExportFractureCompletionsImpl::MATRIX_TO_FRACTURE_DP_OVER_AVG_DP, "MATFRAC_DP_OVER_AVGDP", "Matrix to Fracture dP over avg dP");
|
||||
addItem(RicExportFractureCompletionsImpl::MATRIX_TO_FRACTURE_FLUX_OVER_MAX_FLUX, "MATFRAC_FLUX_OVER_MAXFLUX", "Matrix to Fracture Flux over max Flux");
|
||||
addItem(RicExportFractureCompletionsImpl::MATRIX_TO_FRACTURE_FLUX_OVER_AVG_FLUX, "MATFRAC_FLUX_OVER_AVGFLUX", "Matrix to Fracture Flux over avg Flux");
|
||||
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);
|
||||
}
|
||||
|
||||
@ -211,17 +212,6 @@ void RicExportCompletionDataSettingsUi::fieldChangedByUi(const caf::PdmFieldHand
|
||||
includeFractures = true;
|
||||
}
|
||||
}
|
||||
else if (changedField == &transScalingType)
|
||||
{
|
||||
if (transScalingType == RicExportFractureCompletionsImpl::MATRIX_TO_WELL_DP_OVER_INITIAL_DP)
|
||||
{
|
||||
transScalingCorrection = RicExportFractureCompletionsImpl::HOGSTOL_CORRECTION;
|
||||
}
|
||||
else
|
||||
{
|
||||
transScalingCorrection = RicExportFractureCompletionsImpl::NO_CORRECTION;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -325,16 +325,25 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
|
||||
// Insert total transmissibility from eclipse-cell to well for this fracture into the map
|
||||
std::map<size_t, double> matrixToWellTrans = calculateMatrixToWellTransmissibilities(transCondenser);
|
||||
|
||||
if (currentPressureDropScaling == MATRIX_TO_FRACTURE_DP_OVER_MAX_DP ||
|
||||
currentPressureDropScaling == MATRIX_TO_FRACTURE_DP_OVER_AVG_DP)
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
// WARNING!!! //
|
||||
// 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.scaleMatrixToFracTransByMatrixFracDP(
|
||||
actCellInfo,
|
||||
std::map<size_t, double> originalLumpedMatrixToFractureTrans =
|
||||
scaledCondenser.scaleMatrixToFracTransByMatrixFracInitialDP(actCellInfo,
|
||||
initialWellPressure,
|
||||
currentWellPressure,
|
||||
*initialMatrixPressures,
|
||||
*currentMatrixPressures,
|
||||
currentPressureDropScaling == MATRIX_TO_FRACTURE_DP_OVER_AVG_DP);
|
||||
currentPressureDropScaling ==
|
||||
MATRIX_TO_FRACTURE_DP_OVER_MAX_INITIAL_DP);
|
||||
// 2: Calculate new external transmissibilities
|
||||
scaledCondenser.calculateCondensedTransmissibilities();
|
||||
|
||||
@ -358,47 +367,18 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
|
||||
matrixToWellTrans = effectiveMatrixToWellTrans;
|
||||
}
|
||||
}
|
||||
else if (currentPressureDropScaling == MATRIX_TO_FRACTURE_FLUX_OVER_MAX_FLUX ||
|
||||
currentPressureDropScaling == MATRIX_TO_FRACTURE_FLUX_OVER_AVG_FLUX)
|
||||
else 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
|
||||
std::map<size_t, double> originalLumpedMatrixToFractureTrans = scaledCondenser.scaleMatrixToFracTransByMatrixFracFlux(
|
||||
actCellInfo,
|
||||
currentWellPressure,
|
||||
*currentMatrixPressures,
|
||||
currentPressureDropScaling == MATRIX_TO_FRACTURE_FLUX_OVER_AVG_FLUX);
|
||||
// 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)
|
||||
{
|
||||
RigTransmissibilityCondenser scaledCondenser = transCondenser;
|
||||
// From Høgstøl "Hydraulic Fracturing SoW 2.8 outside contract fracture Transmissibility Calculations for Differential
|
||||
// Depletion":
|
||||
// 1. Scale matrix to fracture transmissibilities by matrix to well pressure
|
||||
std::map<size_t, double> originalLumpedMatrixToFractureTrans = scaledCondenser.scaleMatrixToFracTransByMatrixWellDP(
|
||||
actCellInfo, initialWellPressure, currentWellPressure, *initialMatrixPressures, *currentMatrixPressures);
|
||||
actCellInfo,
|
||||
initialWellPressure,
|
||||
currentWellPressure,
|
||||
*initialMatrixPressures,
|
||||
*currentMatrixPressures,
|
||||
currentPressureDropScaling == MATRIX_TO_FRACTURE_DP_OVER_MAX_INITIAL_DP);
|
||||
// 2: Calculate new external transmissibilities
|
||||
scaledCondenser.calculateCondensedTransmissibilities();
|
||||
|
||||
@ -422,6 +402,41 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
|
||||
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
|
||||
std::map<size_t, double> effectiveMatrixToWellTrans =
|
||||
scaledCondenser.calculateEffectiveMatrixToWellTransmissibilities(originalLumpedMatrixToFractureTrans,
|
||||
fictitiousFractureToWellTransmissibilities);
|
||||
matrixToWellTrans = effectiveMatrixToWellTrans;
|
||||
}
|
||||
}
|
||||
////////////////////////////////////////////////////////////
|
||||
// END PROTOTYPE CODE FOR PRESSURE DIFFERENTIAL DEPLETION //
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
std::vector<RigCompletionData> allCompletionsForOneFracture =
|
||||
generateCompdatValuesForFracture(matrixToWellTrans, wellPathName, caseToApply, fracture, fracTemplate);
|
||||
|
@ -47,11 +47,11 @@ public:
|
||||
enum PressureDepletionTransScaling
|
||||
{
|
||||
NO_SCALING = 0,
|
||||
MATRIX_TO_FRACTURE_DP_OVER_MAX_DP,
|
||||
MATRIX_TO_FRACTURE_DP_OVER_AVG_DP,
|
||||
MATRIX_TO_FRACTURE_FLUX_OVER_MAX_FLUX,
|
||||
MATRIX_TO_FRACTURE_FLUX_OVER_AVG_FLUX,
|
||||
MATRIX_TO_WELL_DP_OVER_INITIAL_DP
|
||||
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
|
||||
|
@ -2491,22 +2491,34 @@ QString RicWellPathExportCompletionDataFeatureImpl::createPressureDepletionFileN
|
||||
QString suffix;
|
||||
if (exportSettings.transScalingType() != RicExportFractureCompletionsImpl::NO_CORRECTION)
|
||||
{
|
||||
if (exportSettings.transScalingType() == RicExportFractureCompletionsImpl::MATRIX_TO_FRACTURE_DP_OVER_AVG_DP)
|
||||
if (exportSettings.transScalingType() == RicExportFractureCompletionsImpl::MATRIX_TO_FRACTURE_DP_OVER_INITIAL_DP)
|
||||
{
|
||||
suffix += QString("_PAVG_");
|
||||
suffix += QString("_1");
|
||||
}
|
||||
else if (exportSettings.transScalingType() == RicExportFractureCompletionsImpl::MATRIX_TO_FRACTURE_DP_OVER_MAX_DP)
|
||||
else if (exportSettings.transScalingType() == RicExportFractureCompletionsImpl::MATRIX_TO_FRACTURE_DP_OVER_MAX_INITIAL_DP)
|
||||
{
|
||||
suffix += QString("_PMAX_");
|
||||
suffix += QString("_2");
|
||||
}
|
||||
else
|
||||
else if (exportSettings.transScalingType() == RicExportFractureCompletionsImpl::MATRIX_TO_WELL_DP_OVER_INITIAL_DP)
|
||||
{
|
||||
suffix += QString("_PMWD_");
|
||||
suffix += QString("_3");
|
||||
}
|
||||
else if (exportSettings.transScalingType() == RicExportFractureCompletionsImpl::MATRIX_TO_WELL_DP_OVER_MAX_INITIAL_DP)
|
||||
{
|
||||
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("_HC_");
|
||||
suffix += QString("B_");
|
||||
}
|
||||
else
|
||||
{
|
||||
suffix += QString("A_");
|
||||
}
|
||||
|
||||
if (exportSettings.transScalingSummaryWBHP())
|
||||
|
@ -112,9 +112,9 @@ void RimEclipseStatisticsCaseEvaluator::evaluateForResults(const QList<ResSpec>&
|
||||
|
||||
if (activeCellCount > 0)
|
||||
{
|
||||
for (size_t i = 0; i < statisticalResultNames.size(); ++i)
|
||||
for (size_t j = 0; j < statisticalResultNames.size(); ++j)
|
||||
{
|
||||
addNamedResult(destCellResultsData, resultType, statisticalResultNames[i], activeCellCount);
|
||||
addNamedResult(destCellResultsData, resultType, statisticalResultNames[j], activeCellCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -122,23 +122,6 @@ double RigFractureTransmissibilityEquations::matrixToFractureTrans(double perm,
|
||||
return transmissibility;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigFractureTransmissibilityEquations::pressureScalingMatrixToFractureTransPDDHC(double originalWellPressure,
|
||||
double wellPressure,
|
||||
double originalMatrixPressure,
|
||||
double matrixPressure)
|
||||
{
|
||||
double pressureDelta = originalMatrixPressure - originalWellPressure;
|
||||
if (cvf::Math::abs(pressureDelta) > EPSILON)
|
||||
{
|
||||
return (matrixPressure - wellPressure) / pressureDelta;
|
||||
}
|
||||
CVF_ASSERT(false);
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -56,12 +56,6 @@ public:
|
||||
double fractureAreaWeightedlength,
|
||||
double cDarcy);
|
||||
|
||||
// Pressure Differential Depletion Høgstøl-correction (PDDHC) methods.
|
||||
static double pressureScalingMatrixToFractureTransPDDHC(double originalWellPressure,
|
||||
double wellPressure,
|
||||
double originalMatrixPressure,
|
||||
double matrixPressure);
|
||||
|
||||
static double effectiveInternalFractureToWellTransPDDHC(double sumScaledMatrixToFractureTrans,
|
||||
double scaledMatrixToWellTrans);
|
||||
|
||||
|
@ -123,17 +123,40 @@ double RigTransmissibilityCondenser::condensedTransmissibility(CellAddress exter
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::map<size_t, double> RigTransmissibilityCondenser::scaleMatrixToFracTransByMatrixWellDP(
|
||||
const RigActiveCellInfo* actCellInfo,
|
||||
double originalWellPressure,
|
||||
std::map<size_t, double>
|
||||
RigTransmissibilityCondenser::scaleMatrixToFracTransByMatrixWellDP(const RigActiveCellInfo* actCellInfo,
|
||||
double initialWellPressure,
|
||||
double currentWellPressure,
|
||||
const std::vector<double>& originalMatrixPressures,
|
||||
const std::vector<double>& currentMatrixPressures)
|
||||
const std::vector<double>& initialMatrixPressures,
|
||||
const std::vector<double>& currentMatrixPressures,
|
||||
bool normalizeByMax)
|
||||
{
|
||||
CVF_ASSERT(originalMatrixPressures.size() == currentMatrixPressures.size());
|
||||
CVF_ASSERT(initialMatrixPressures.size() == currentMatrixPressures.size());
|
||||
|
||||
std::map<size_t, double> originalLumpedMatrixToFractureTrans; // Sum(T_mf)
|
||||
|
||||
double maxInitialDeltaPressure = 0.0;
|
||||
if (normalizeByMax)
|
||||
{
|
||||
for (auto it = m_neighborTransmissibilities.begin(); it != m_neighborTransmissibilities.end(); ++it)
|
||||
{
|
||||
if (it->first.m_cellIndexSpace == CellAddress::STIMPLAN)
|
||||
{
|
||||
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 initialDeltaPressure = initialMatrixPressures[eclipseResultIndex] - initialWellPressure;
|
||||
maxInitialDeltaPressure = std::max(maxInitialDeltaPressure, initialDeltaPressure);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (auto it = m_neighborTransmissibilities.begin(); it != m_neighborTransmissibilities.end(); ++it)
|
||||
{
|
||||
if (it->first.m_cellIndexSpace == CellAddress::STIMPLAN)
|
||||
@ -148,11 +171,16 @@ std::map<size_t, double> RigTransmissibilityCondenser::scaleMatrixToFracTransByM
|
||||
|
||||
originalLumpedMatrixToFractureTrans[globalMatrixCellIdx] += jt->second;
|
||||
|
||||
jt->second *= RigFractureTransmissibilityEquations::pressureScalingMatrixToFractureTransPDDHC(
|
||||
originalWellPressure,
|
||||
currentWellPressure,
|
||||
originalMatrixPressures[eclipseResultIndex],
|
||||
currentMatrixPressures[eclipseResultIndex]);
|
||||
double initialDeltaPressure = initialMatrixPressures[eclipseResultIndex] - initialWellPressure;
|
||||
double currentDeltaPressure = currentMatrixPressures[eclipseResultIndex] - currentWellPressure;
|
||||
if (normalizeByMax)
|
||||
{
|
||||
jt->second *= currentDeltaPressure / maxInitialDeltaPressure;
|
||||
}
|
||||
else
|
||||
{
|
||||
jt->second *= currentDeltaPressure / initialDeltaPressure;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -160,14 +188,104 @@ std::map<size_t, double> RigTransmissibilityCondenser::scaleMatrixToFracTransByM
|
||||
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::scaleMatrixToFracTransByMatrixFracDP(const RigActiveCellInfo* actCellInfo, double currentWellPressure, const std::vector<double>& currentMatrixPressures, bool divideByAverageDP)
|
||||
std::map<size_t, double>
|
||||
RigTransmissibilityCondenser::solveForFracturePressures(const RigActiveCellInfo* actCellInfo,
|
||||
const std::vector<double>& currentMatrixPressures,
|
||||
double currentWellPressure)
|
||||
{
|
||||
// Solve for fracture pressures
|
||||
Eigen::VectorXd matrixPressures(m_Tie.cols());
|
||||
Eigen::VectorXd externalPressures(m_Tie.cols());
|
||||
{
|
||||
size_t rowIndex = 0u;
|
||||
for (const CellAddress& externalCell : m_externalCellAddrSet)
|
||||
@ -176,16 +294,16 @@ std::map<size_t, double> RigTransmissibilityCondenser::scaleMatrixToFracTransByM
|
||||
{
|
||||
size_t eclipseResultIndex = actCellInfo->cellResultIndex(externalCell.m_globalCellIdx);
|
||||
CVF_ASSERT(eclipseResultIndex < currentMatrixPressures.size());
|
||||
matrixPressures[rowIndex++] = currentMatrixPressures[eclipseResultIndex];
|
||||
externalPressures[rowIndex++] = currentMatrixPressures[eclipseResultIndex];
|
||||
}
|
||||
else
|
||||
{
|
||||
CVF_ASSERT(externalCell.m_cellIndexSpace == CellAddress::WELL);
|
||||
matrixPressures[rowIndex++] = currentWellPressure;
|
||||
externalPressures[rowIndex++] = currentWellPressure;
|
||||
}
|
||||
}
|
||||
}
|
||||
Eigen::VectorXd fracturePressures = m_TiiInv * (m_Tie * matrixPressures * -1.0);
|
||||
Eigen::VectorXd fracturePressures = m_TiiInv * (-m_Tie * externalPressures);
|
||||
|
||||
// Extract fracture pressures into a map
|
||||
std::map<size_t, double> fractureCellToPressureMap;
|
||||
@ -199,80 +317,17 @@ std::map<size_t, double> RigTransmissibilityCondenser::scaleMatrixToFracTransByM
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Calculate maximum and average pressure drop
|
||||
double maxPressureDrop = 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);
|
||||
meanCalculator.addValueAndWeight(pressureDrop, 1.0);
|
||||
maxPressureDrop = std::max(maxPressureDrop, pressureDrop);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (divideByAverageDP && !meanCalculator.validAggregatedWeight())
|
||||
{
|
||||
return std::map<size_t, double>();
|
||||
}
|
||||
else if (!divideByAverageDP && maxPressureDrop < 1.0e-9)
|
||||
{
|
||||
return std::map<size_t, double>();
|
||||
}
|
||||
double averagePressureDrop = 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);
|
||||
|
||||
// Add to Sum(T_mf)
|
||||
originalLumpedMatrixToFractureTrans[globalMatrixCellIdx] += jt->second;
|
||||
|
||||
double pressureScaling = pressureDrop / (divideByAverageDP ? averagePressureDrop : maxPressureDrop);
|
||||
jt->second *= pressureScaling;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return originalLumpedMatrixToFractureTrans;
|
||||
return fractureCellToPressureMap;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::map<size_t, double> RigTransmissibilityCondenser::scaleMatrixToFracTransByMatrixFracFlux(const RigActiveCellInfo* actCellInfo, double currentWellPressure, const std::vector<double>& currentMatrixPressures, bool divideByAverageFlux)
|
||||
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());
|
||||
@ -411,10 +466,12 @@ std::map<size_t, double> RigTransmissibilityCondenser::calculateFicticiousFractu
|
||||
// Sum(T'_mf)
|
||||
double scaledMatrixToFractureTrans = matrixToAllFracturesTrans[globalMatrixCellIdx];
|
||||
// T'mw
|
||||
double scaledMatrixToWellTrans = condensedTransmissibility(externalCell, { true, RigTransmissibilityCondenser::CellAddress::WELL, 1 });
|
||||
double scaledMatrixToWellTrans =
|
||||
condensedTransmissibility(externalCell, {true, RigTransmissibilityCondenser::CellAddress::WELL, 1});
|
||||
// T'_fjw
|
||||
fictitiousFractureToWellTrans[globalMatrixCellIdx] =
|
||||
RigFractureTransmissibilityEquations::effectiveInternalFractureToWellTransPDDHC(scaledMatrixToFractureTrans, scaledMatrixToWellTrans);
|
||||
RigFractureTransmissibilityEquations::effectiveInternalFractureToWellTransPDDHC(scaledMatrixToFractureTrans,
|
||||
scaledMatrixToWellTrans);
|
||||
}
|
||||
}
|
||||
return fictitiousFractureToWellTrans;
|
||||
|
@ -96,14 +96,22 @@ public:
|
||||
std::string condensedTransDebugOutput(const RigMainGrid* mainGrid, const RigFractureGrid* fractureGrid);
|
||||
|
||||
std::map<size_t, double> scaleMatrixToFracTransByMatrixWellDP(const RigActiveCellInfo* actCellInfo,
|
||||
double originalWellPressure,
|
||||
double currentWellPressure,
|
||||
const std::vector<double>& originalMatrixPressures,
|
||||
const std::vector<double>& currentMatrixPressures);
|
||||
std::map<size_t, double> scaleMatrixToFracTransByMatrixFracDP(const RigActiveCellInfo* actCellInfo,
|
||||
double initialWellPressure,
|
||||
double currentWellPressure,
|
||||
const std::vector<double>& initialMatrixPressures,
|
||||
const std::vector<double>& currentMatrixPressures,
|
||||
bool divideByAverageDP);
|
||||
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> ¤tMatrixPressures, double currentWellPressure);
|
||||
|
||||
|
||||
std::map<size_t, double> scaleMatrixToFracTransByMatrixFracFlux(const RigActiveCellInfo* actCellInfo,
|
||||
double currentWellPressure,
|
||||
const std::vector<double>& currentMatrixPressures,
|
||||
|
Loading…
Reference in New Issue
Block a user