|
|
|
|
@ -2186,8 +2186,9 @@ void nmDataAnalyzeManager::initCurWellData()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void calculateLogDataFromGaugeInput(
|
|
|
|
|
static bool calculateLogDataFromGaugeInput(
|
|
|
|
|
const nmWellGaugeInputData& oGaugeInput,
|
|
|
|
|
bool bUsePseudoPressure, void* pFitting,
|
|
|
|
|
QVector<QVector<double>>& vvecHistoryData,
|
|
|
|
|
QVector<QVector<double>>& vvecLogPreData,
|
|
|
|
|
QVector<QVector<double>>& vvecSemiLogPreData)
|
|
|
|
|
@ -2234,9 +2235,24 @@ static void calculateLogDataFromGaugeInput(
|
|
|
|
|
pReferenceRates->size() != oGaugeInput.vecFlowDurations.size() ||
|
|
|
|
|
oGaugeInput.nFlowSectionIndex < 1 ||
|
|
|
|
|
oGaugeInput.nFlowSectionIndex > oGaugeInput.vecFlowDurations.size()) {
|
|
|
|
|
return;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 原始历史压力保持 MPa;只有传给双对数、半对数算法的副本转换为拟压力。
|
|
|
|
|
if(bUsePseudoPressure && !vecPressure.isEmpty()) {
|
|
|
|
|
nmDataAnalyzeContextProvider* pContext = nmDataAnalyzeContext::provider();
|
|
|
|
|
VecDouble vecPseudoPressure;
|
|
|
|
|
if(pContext == nullptr
|
|
|
|
|
|| !pContext->convertPressureToPseudoPressure(
|
|
|
|
|
pFitting, vvecHistoryData[1], vecPseudoPressure)) {
|
|
|
|
|
qWarning() << "Failed to convert gas history pressure to pseudo-pressure.";
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
for(int i = 0; i < vecPseudoPressure.size(); ++i) {
|
|
|
|
|
wellPressureData[i].y = vecPseudoPressure[i];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const int nTimeNumQ = oGaugeInput.vecFlowDurations.size();
|
|
|
|
|
std::vector<double> timeQ(nTimeNumQ);
|
|
|
|
|
std::vector<double> q(nTimeNumQ);
|
|
|
|
|
@ -2259,14 +2275,14 @@ static void calculateLogDataFromGaugeInput(
|
|
|
|
|
if(nullptr == preLogFun) {
|
|
|
|
|
FreeLibrary(hMod_solver);
|
|
|
|
|
std::cout << "preLogFun failed!\n";
|
|
|
|
|
return;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool bCalculated = preLogFun(wellPressureData, iSectionFlowIndex,
|
|
|
|
|
timeQ.data(), q.data(), nTimeNumQ, logPre);
|
|
|
|
|
if(!bCalculated || logPre.empty()) {
|
|
|
|
|
FreeLibrary(hMod_solver);
|
|
|
|
|
return;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// The solver's final point is not part of the plotted result.
|
|
|
|
|
@ -2285,7 +2301,9 @@ static void calculateLogDataFromGaugeInput(
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FreeLibrary(hMod_solver);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
nmDataWellBase* nmDataAnalyzeManager::appendWellData(ZxDataWell* pWellData)
|
|
|
|
|
@ -3039,7 +3057,8 @@ void nmDataAnalyzeManager::calculationLogData(
|
|
|
|
|
}
|
|
|
|
|
nmWellGaugeInputData oGaugeInput;
|
|
|
|
|
pWellData->buildGaugeInputData(oGaugeInput);
|
|
|
|
|
calculateLogDataFromGaugeInput(oGaugeInput, vvecHistoryData,
|
|
|
|
|
calculateLogDataFromGaugeInput(oGaugeInput,
|
|
|
|
|
getSolverModelType() == SMT_Gas_VariablePvt, m_pOwnerFitting, vvecHistoryData,
|
|
|
|
|
vvecLogPreData, vvecSemiLogPreData);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -3059,11 +3078,13 @@ bool nmDataAnalyzeManager::updateWellHistoryData(
|
|
|
|
|
QVector<QVector<double> > vecHistoryPressure;
|
|
|
|
|
QVector<QVector<double> > vecHistoryLogLog;
|
|
|
|
|
QVector<QVector<double> > vecHistorySemiLog;
|
|
|
|
|
calculateLogDataFromGaugeInput(oGaugeInput, vecHistoryPressure,
|
|
|
|
|
const bool bCalculated = calculateLogDataFromGaugeInput(oGaugeInput,
|
|
|
|
|
getSolverModelType() == SMT_Gas_VariablePvt, m_pOwnerFitting, vecHistoryPressure,
|
|
|
|
|
vecHistoryLogLog, vecHistorySemiLog);
|
|
|
|
|
// 转换或计算失败时清除旧曲线的有效标记,避免继续使用旧的压力曲线。
|
|
|
|
|
pWellData->setHistoryData(vecHistoryPressure, vecHistoryLogLog,
|
|
|
|
|
vecHistorySemiLog, sGaugeInputSha1);
|
|
|
|
|
return true;
|
|
|
|
|
vecHistorySemiLog, bCalculated ? sGaugeInputSha1 : QString());
|
|
|
|
|
return bCalculated;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool nmDataAnalyzeManager::resetFromAnalytical()
|
|
|
|
|
|