From aa1c49818032d0a4173f263877d921c9abff2ee2 Mon Sep 17 00:00:00 2001 From: lh <2334563547@qq.com> Date: Fri, 12 Jun 2026 15:52:58 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20fillPvtInputByModel=E5=8E=8B?= =?UTF-8?q?=E5=8A=9B=E6=A8=AA=E5=9D=90=E6=A0=87=E8=AF=BB=E5=8F=96=E7=A7=BB?= =?UTF-8?q?=E5=85=A5=E5=90=84=E5=88=86=E6=94=AF=EF=BC=8CConstPvt=E4=B8=8D?= =?UTF-8?q?=E4=BE=9D=E8=B5=96pPvt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 移除顶部公共压力读取,各VariablePvt分支内部自行读取pPvt->getPressure() 2. ConstPvt分支完全不碰pPvt参数,职责更清晰 --- .../nmCalculationDllPebiSolverTask.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Src/nmNum/nmCalculation/nmCalculationDllPebiSolverTask.cpp b/Src/nmNum/nmCalculation/nmCalculationDllPebiSolverTask.cpp index a3be736..8ba99db 100644 --- a/Src/nmNum/nmCalculation/nmCalculationDllPebiSolverTask.cpp +++ b/Src/nmNum/nmCalculation/nmCalculationDllPebiSolverTask.cpp @@ -108,14 +108,9 @@ void fillPvtInputByModel(HX_NWTM_MODEL_INPUT& input, nmDataPvtParaForPebi* pPvt, nmDataReservoir* pRes) { - // 压力横坐标:变化PVT从曲线读取,常数PVT生成占位数组 - if(pPvt != nullptr) { - assignPvtVectorIfNotEmpty(input.PVT.p, pPvt->getPressure()); - } - switch(eModelType) { case SMT_Oil_ConstPvt: - // 油相常数PVT:生成占位压力数组 + 单值扩展为200元素数组 + // 油相常数PVT:不依赖pPvt,生成占位压力数组 + 单值扩展为200元素数组 input.PVT.p = generateDummyPressure(); if(pRes != nullptr) { input.PVT.Bo = expandConstPvt(pRes->getBo().getValue().toDouble()); @@ -126,6 +121,7 @@ void fillPvtInputByModel(HX_NWTM_MODEL_INPUT& input, case SMT_Oil_VariablePvt: // 油相变化PVT:从 pebiPvtPara 读曲线数组 if(pPvt != nullptr) { + assignPvtVectorIfNotEmpty(input.PVT.p, pPvt->getPressure()); assignPvtVectorIfNotEmpty(input.PVT.Bo, pPvt->getBo()); assignPvtVectorIfNotEmpty(input.PVT.Co, pPvt->getCo()); assignPvtVectorIfNotEmpty(input.PVT.miuo, pPvt->getMiuo()); @@ -133,7 +129,7 @@ void fillPvtInputByModel(HX_NWTM_MODEL_INPUT& input, break; case SMT_Water_ConstPvt: - // 水相常数PVT:生成占位压力数组 + 单值扩展为200元素数组 + // 水相常数PVT:不依赖pPvt,生成占位压力数组 + 单值扩展为200元素数组 input.PVT.p = generateDummyPressure(); if(pRes != nullptr) { input.PVT.Bw = expandConstPvt(pRes->getBw().getValue().toDouble()); @@ -144,6 +140,7 @@ void fillPvtInputByModel(HX_NWTM_MODEL_INPUT& input, case SMT_Water_VariablePvt: // 水相变化PVT:从 pebiPvtPara 读曲线数组 if(pPvt != nullptr) { + assignPvtVectorIfNotEmpty(input.PVT.p, pPvt->getPressure()); assignPvtVectorIfNotEmpty(input.PVT.Bw, pPvt->getBw()); assignPvtVectorIfNotEmpty(input.PVT.Cw, pPvt->getCw()); assignPvtVectorIfNotEmpty(input.PVT.miuw, pPvt->getMiuw()); @@ -154,6 +151,7 @@ void fillPvtInputByModel(HX_NWTM_MODEL_INPUT& input, case SMT_Gas_PseudoPressure: // 气相变化PVT/拟压力:从 pebiPvtPara 读曲线数组 if(pPvt != nullptr) { + assignPvtVectorIfNotEmpty(input.PVT.p, pPvt->getPressure()); assignPvtVectorIfNotEmpty(input.PVT.Bg, pPvt->getBg()); assignPvtVectorIfNotEmpty(input.PVT.Cg, pPvt->getCg()); assignPvtVectorIfNotEmpty(input.PVT.miug, pPvt->getMiug()); @@ -163,6 +161,7 @@ void fillPvtInputByModel(HX_NWTM_MODEL_INPUT& input, case SMT_Oil_Water_TwoPhase: // 油水两相:从 pebiPvtPara 读油+水曲线数组 + 相渗数据 if(pPvt != nullptr) { + assignPvtVectorIfNotEmpty(input.PVT.p, pPvt->getPressure()); assignPvtVectorIfNotEmpty(input.PVT.Bo, pPvt->getBo()); assignPvtVectorIfNotEmpty(input.PVT.miuo, pPvt->getMiuo()); assignPvtVectorIfNotEmpty(input.PVT.Bw, pPvt->getBw());