diff --git a/Src/nmNum/nmCalculation/nmCalculationDllPebiSolverTask.cpp b/Src/nmNum/nmCalculation/nmCalculationDllPebiSolverTask.cpp index 265193d..a3be736 100644 --- a/Src/nmNum/nmCalculation/nmCalculationDllPebiSolverTask.cpp +++ b/Src/nmNum/nmCalculation/nmCalculationDllPebiSolverTask.cpp @@ -86,6 +86,16 @@ dVec1 expandConstPvt(double dValue, int nSize = 200) return dVec1(nSize, dValue); } +/// @brief 生成线性占位压力数组(常数PVT无曲线数据时使用) +/// @param nSize 数组大小,默认200 +/// @return [1, 2, ..., nSize] 的 dVec1 数组 +dVec1 generateDummyPressure(int nSize = 200) +{ + dVec1 vecP(nSize, 0); + for(int i = 0; i < nSize; ++i) { vecP[i] = (i + 1.0); } + return vecP; +} + /// @brief 根据求解器模型类型填充PVT输入数据 /// 常数PVT模型从 reservoir 读单值并扩展为200元素数组 /// 变化PVT模型从 pebiPvtPara 读曲线数组 @@ -98,14 +108,15 @@ void fillPvtInputByModel(HX_NWTM_MODEL_INPUT& input, nmDataPvtParaForPebi* pPvt, nmDataReservoir* pRes) { - // 压力横坐标始终从 pebiPvtPara 读取 + // 压力横坐标:变化PVT从曲线读取,常数PVT生成占位数组 if(pPvt != nullptr) { assignPvtVectorIfNotEmpty(input.PVT.p, pPvt->getPressure()); } switch(eModelType) { case SMT_Oil_ConstPvt: - // 油相常数PVT:单值扩展为200元素数组 + // 油相常数PVT:生成占位压力数组 + 单值扩展为200元素数组 + input.PVT.p = generateDummyPressure(); if(pRes != nullptr) { input.PVT.Bo = expandConstPvt(pRes->getBo().getValue().toDouble()); input.PVT.miuo = expandConstPvt(pRes->getMiuo().getValue().toDouble()); @@ -122,7 +133,8 @@ void fillPvtInputByModel(HX_NWTM_MODEL_INPUT& input, break; case SMT_Water_ConstPvt: - // 水相常数PVT:单值扩展为200元素数组 + // 水相常数PVT:生成占位压力数组 + 单值扩展为200元素数组 + input.PVT.p = generateDummyPressure(); if(pRes != nullptr) { input.PVT.Bw = expandConstPvt(pRes->getBw().getValue().toDouble()); input.PVT.miuw = expandConstPvt(pRes->getMiuw().getValue().toDouble());