#3670 Implement new Pressure Depletion behaviour

* Removed choice of different scaling
* Always use current pressure delta
* Use the maximum of an epsilon value and the absolute value of the matrix to well pressure drop as the scaling factor
* Remove file name suffixes and update information table in export file.
This commit is contained in:
Gaute Lindkvist
2018-11-13 16:47:53 +01:00
parent bfee1dfa64
commit 73b79daa09
13 changed files with 167 additions and 246 deletions

View File

@@ -123,40 +123,37 @@ double RigTransmissibilityCondenser::condensedTransmissibility(CellAddress exter
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::map<size_t, double>
RigTransmissibilityCondenser::scaleMatrixToFracTransByMatrixWellDP(const RigActiveCellInfo* actCellInfo,
double initialWellPressure,
double currentWellPressure,
const std::vector<double>& initialMatrixPressures,
const std::vector<double>& currentMatrixPressures,
bool normalizeByMax)
std::map<size_t, double> RigTransmissibilityCondenser::scaleMatrixToFracTransByMatrixWellDP(
const RigActiveCellInfo* actCellInfo, double currentWellPressure, const std::vector<double>& currentMatrixPressures,
double* minPressureDrop, double* maxPressureDrop)
{
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 epsilonDeltaPressure = 1.0e-6;
double initialDeltaPressure = initialMatrixPressures[eclipseResultIndex] - initialWellPressure;
maxInitialDeltaPressure = std::max(maxInitialDeltaPressure, initialDeltaPressure);
}
double minNonZeroDeltaPressure = std::numeric_limits<double>::infinity();
double maxNonZeroDeltaPressure = -std::numeric_limits<double>::infinity();
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 unsignedDeltaPressure = std::abs(currentMatrixPressures[eclipseResultIndex] - currentWellPressure);
double nonZeroDeltaPressure = std::max(epsilonDeltaPressure, unsignedDeltaPressure);
maxNonZeroDeltaPressure = std::max(maxNonZeroDeltaPressure, nonZeroDeltaPressure);
minNonZeroDeltaPressure = std::min(minNonZeroDeltaPressure, nonZeroDeltaPressure);
}
}
}
}
for (auto it = m_neighborTransmissibilities.begin(); it != m_neighborTransmissibilities.end(); ++it)
{
if (it->first.m_cellIndexSpace == CellAddress::STIMPLAN)
@@ -171,20 +168,24 @@ std::map<size_t, double>
originalLumpedMatrixToFractureTrans[globalMatrixCellIdx] += jt->second;
double initialDeltaPressure = initialMatrixPressures[eclipseResultIndex] - initialWellPressure;
double currentDeltaPressure = currentMatrixPressures[eclipseResultIndex] - currentWellPressure;
if (normalizeByMax)
{
jt->second *= currentDeltaPressure / maxInitialDeltaPressure;
}
else
{
jt->second *= currentDeltaPressure / initialDeltaPressure;
}
double unsignedDeltaPressure = std::abs(currentMatrixPressures[eclipseResultIndex] - currentWellPressure);
double nonZeroDeltaPressure = std::max(epsilonDeltaPressure, unsignedDeltaPressure);
jt->second *= nonZeroDeltaPressure / maxNonZeroDeltaPressure;
}
}
}
}
if (minPressureDrop && minNonZeroDeltaPressure != std::numeric_limits<double>::infinity())
{
*minPressureDrop = minNonZeroDeltaPressure;
}
if (maxPressureDrop && maxNonZeroDeltaPressure != std::numeric_limits<double>::infinity())
{
*maxPressureDrop = maxNonZeroDeltaPressure;
}
return originalLumpedMatrixToFractureTrans;
}

View File

@@ -95,12 +95,7 @@ public:
std::string neighborTransDebugOutput(const RigMainGrid* mainGrid, const RigFractureGrid* fractureGrid);
std::string condensedTransDebugOutput(const RigMainGrid* mainGrid, const RigFractureGrid* fractureGrid);
std::map<size_t, double> scaleMatrixToFracTransByMatrixWellDP(const RigActiveCellInfo* actCellInfo,
double initialWellPressure,
double currentWellPressure,
const std::vector<double>& initialMatrixPressures,
const std::vector<double>& currentMatrixPressures,
bool normalizeByMax);
std::map<size_t, double> scaleMatrixToFracTransByMatrixWellDP(const RigActiveCellInfo* actCellInfo, double currentWellPressure, const std::vector<double>& currentMatrixPressures, double* minPressureDrop, double* maxPressureDrop);
std::map<size_t, double> calculateFicticiousFractureToWellTransmissibilities();
std::map<size_t, double>