|
|
#include "nmData_global.h"
|
|
|
#include "nmDefines.h"
|
|
|
#include "nmDataAttribute.h"
|
|
|
#include "nmDataBase.h"
|
|
|
|
|
|
// 前向声明
|
|
|
class nmDataWellBase;
|
|
|
class nmDataReservoir;
|
|
|
|
|
|
class NM_DATA_EXPORT nmDataDiagnostic : public nmDataBase
|
|
|
{
|
|
|
Q_OBJECT
|
|
|
|
|
|
public:
|
|
|
nmDataDiagnostic();
|
|
|
~nmDataDiagnostic();
|
|
|
|
|
|
// 序列化方法
|
|
|
virtual rapidjson::Value ToJsonValue(rapidjson::Document::AllocatorType& allocator) const override;
|
|
|
virtual void FromJsonValue(const rapidjson::Value& jsonValue) override;
|
|
|
|
|
|
// 主诊断方法 - 按顺序计算 C、kh、k、S
|
|
|
void resetFromDiagnostic(const QVector<QVector<double>>& rawData,
|
|
|
nmDataWellBase* pWell,
|
|
|
nmDataReservoir* pReservoir);
|
|
|
|
|
|
// 结果获取方法
|
|
|
nmDataAttribute& getDiagnosticPermeability();
|
|
|
nmDataAttribute& getDiagnosticSkin();
|
|
|
nmDataAttribute& getDiagnosticWellboreStorage();
|
|
|
nmDataAttribute& getDiagnosticTransmissibility();
|
|
|
|
|
|
private:
|
|
|
// 计算井筒储存系数
|
|
|
void calculateWellboreStorage(const QVector<QVector<double>>& rawData,
|
|
|
nmDataWellBase* pWell, nmDataReservoir* pReservoir);
|
|
|
|
|
|
//计算导流能力
|
|
|
void calculateTransmissibility(const QVector<QVector<double>>& rawData,
|
|
|
nmDataWellBase* pWell, nmDataReservoir* pReservoir);
|
|
|
|
|
|
//计算渗透率
|
|
|
void calculatePermeability(nmDataWellBase* pWell, nmDataReservoir* pReservoir);
|
|
|
|
|
|
//寻找最接近目标斜率的数据点对
|
|
|
QPair<int, int> findClosestSlopeToValue(const QVector<double>& timeData,
|
|
|
const QVector<double>& pressureDropData,
|
|
|
int pointCount, double targetSlope);
|
|
|
|
|
|
//计算两点间的双对数斜率
|
|
|
double calculateSlopeBetweenPoints(double t1, double deltaP1, double t2, double deltaP2);
|
|
|
|
|
|
//线性插值获取指定时间的压力值
|
|
|
double interpolatePressureAtTime(const QVector<double>& timeData,
|
|
|
const QVector<double>& pressureDropData,
|
|
|
double targetTime);
|
|
|
|
|
|
//寻找压力导数平台段
|
|
|
QPair<int, int> findDerivativePlatform(
|
|
|
const QVector<double>& timeData,
|
|
|
const QVector<double>& derivativeData,
|
|
|
int startPoint, int pointCount);
|
|
|
|
|
|
//计算数据段的斜率变化程度
|
|
|
double calculateSlopeVariation(
|
|
|
const QVector<double>& timeData,
|
|
|
const QVector<double>& derivativeData,
|
|
|
int start, int end);
|
|
|
|
|
|
//流动阶段分析结果结构体
|
|
|
struct FlowRegimeAnalysis {
|
|
|
QPair<int, int> pointPair;
|
|
|
double slope;
|
|
|
double slopeDifference;
|
|
|
double avgTime;
|
|
|
double avgPressure;
|
|
|
double result;
|
|
|
QString description;
|
|
|
bool isValid;
|
|
|
|
|
|
FlowRegimeAnalysis() : pointPair(-1, -1), slope(-1), slopeDifference(999),
|
|
|
avgTime(0), avgPressure(0), result(0), isValid(false) {}
|
|
|
};
|
|
|
|
|
|
//通用流动阶段分析方法
|
|
|
FlowRegimeAnalysis analyzeFlowRegime(const QVector<double>& timeData,
|
|
|
const QVector<double>& pressureDropData,
|
|
|
int pointCount, double targetSlope,
|
|
|
const QString& regimeName,
|
|
|
nmDataWellBase* pWell, nmDataReservoir* pReservoir);
|
|
|
|
|
|
//kh诊断的径向流分析
|
|
|
FlowRegimeAnalysis analyzeRadialFlowForKh(
|
|
|
const QVector<double>& timeData,
|
|
|
const QVector<double>& derivativeData,
|
|
|
int startPoint, int pointCount,
|
|
|
nmDataWellBase* pWell, nmDataReservoir* pReservoir);
|
|
|
|
|
|
//方法1:标准径向流平台分析
|
|
|
FlowRegimeAnalysis analyzeStandardRadialFlow(
|
|
|
const QVector<double>& timeData,
|
|
|
const QVector<double>& derivativeData,
|
|
|
int availablePoints,
|
|
|
nmDataWellBase* pWell, nmDataReservoir* pReservoir);
|
|
|
|
|
|
//方法2:晚期数据分析
|
|
|
FlowRegimeAnalysis analyzeSaphirStyleLateTime(
|
|
|
const QVector<double>& timeData,
|
|
|
const QVector<double>& derivativeData,
|
|
|
int availablePoints,
|
|
|
nmDataWellBase* pWell, nmDataReservoir* pReservoir);
|
|
|
|
|
|
//方法3:早中期稳定段分析
|
|
|
FlowRegimeAnalysis analyzeEarlyStableFlow(
|
|
|
const QVector<double>& timeData,
|
|
|
const QVector<double>& derivativeData,
|
|
|
int availablePoints,
|
|
|
nmDataWellBase* pWell, nmDataReservoir* pReservoir);
|
|
|
|
|
|
//寻找最小导数值段
|
|
|
QPair<int, int> findMinimumDerivativeSegment(
|
|
|
const QVector<double>& timeData,
|
|
|
const QVector<double>& derivativeData,
|
|
|
int startPoint, int endPoint);
|
|
|
|
|
|
//寻找最稳定的导数段
|
|
|
QPair<int, int> findMostStableDerivativeSegment(
|
|
|
const QVector<double>& derivativeData,
|
|
|
int startPoint, int endPoint);
|
|
|
|
|
|
//计算变异系数(稳定性评估)
|
|
|
double calculateVariationCoefficient(
|
|
|
const QVector<double>& data, int start, int end);
|
|
|
|
|
|
//智能选择最佳导流能力分析方法
|
|
|
FlowRegimeAnalysis* selectBestTransmissibilityAnalysis(
|
|
|
FlowRegimeAnalysis& standardRadial,
|
|
|
FlowRegimeAnalysis& saphirStyle,
|
|
|
FlowRegimeAnalysis& earlyStable);
|
|
|
|
|
|
private:
|
|
|
nmDataAttribute m_diagnosticSkin; // 表皮系数
|
|
|
nmDataAttribute m_diagnosticWellboreStorage; // 井筒储存系数
|
|
|
nmDataAttribute m_diagnosticPermeability; // 渗透率
|
|
|
nmDataAttribute m_diagnosticTransmissibility; // 导流能力
|
|
|
}; |