1.调整求解前计算网格的逻辑,避免部分变量为空 2.获取参数时,如果有一个获取不到就都用默认参数

feature/UI-20260528
lvjunjie 4 days ago
parent 87b9cbc400
commit 6f3246690e

@ -129,9 +129,13 @@ bool nmCalculationDllPebiSolverTask::execPebiMode()
HX_NWTM_MODEL_Fun HX_NWTM_MODEL = (HX_NWTM_MODEL_Fun)GetProcAddress(dll, "HX_NWTM_MODEL"); HX_NWTM_MODEL_Fun HX_NWTM_MODEL = (HX_NWTM_MODEL_Fun)GetProcAddress(dll, "HX_NWTM_MODEL");
if(HX_NWTM_MODEL) { if(HX_NWTM_MODEL) {
if(pGridInstance->getGridOutput1().PEBI_cell.p.size() <= 0) { if(pGridInstance->getGridOutput1().PEBI_cell.p.size() <= 0
// 先生成需要的输入参数p2 || pDataInstance->getCalculationWells().isEmpty()) {
pGridInstance->generateOutputPara(); // 网格输出存在但井顺序为空时重新生成p2并同步当前DataManager的计算井顺序
if(!pGridInstance->generateOutputPara()) {
FreeLibrary(dll);
return false;
}
} }
// 参数定义,使用默认参数 // 参数定义,使用默认参数

@ -67,6 +67,7 @@
#include <QDir> #include <QDir>
#include <QFile> #include <QFile>
#include <QFileInfo> #include <QFileInfo>
#include <QMessageBox>
namespace { namespace {
// 清空指定目录下的所有旧文件和子目录,但保留目录本身 // 清空指定目录下的所有旧文件和子目录,但保留目录本身
@ -1635,94 +1636,100 @@ void nmDataAnalyzeManager::initPvtParaFromSubFit()
bool bFetchedBo = false; bool bFetchedBo = false;
bool bFetchedCo = false; bool bFetchedCo = false;
bool bFetchedMiuo = false; bool bFetchedMiuo = false;
bool bFetchedBg = false;
bool bFetchedCg = false;
bool bFetchedMiug = false;
bool bFetchedBw = false; bool bFetchedBw = false;
bool bFetchedCw = false; bool bFetchedCw = false;
bool bFetchedMiuw = false; bool bFetchedMiuw = false;
// PVT结果曲线直接按当前相态分支读取缺失相态保留PEBI默认数据 // PVT结果曲线直接按当前相态分支读取任一必要曲线缺失则保留PEBI默认数据
switch(eType) { switch(eType) {
case WFT_Oil: case WFT_Oil:
// 油体积系数 // 相需要体积系数、压缩系数和粘度全部可获取
bFetchedBo = pContextProvider->getPvtRstOf(pSubWndFitting, WellFluidType::WFT_Oil, "Bo", vecX, vecBo); bFetchedBo = pContextProvider->getPvtRstOf(pSubWndFitting, WellFluidType::WFT_Oil, "Bo", vecX, vecBo);
bFetchedCo = pContextProvider->getPvtRstOf(pSubWndFitting, WellFluidType::WFT_Oil, "Co", vecX, vecCo);
bFetchedMiuo = pContextProvider->getPvtRstOf(pSubWndFitting, WellFluidType::WFT_Oil, "Miuo", vecX, vecMiuo);
if(!(bFetchedBo && bFetchedCo && bFetchedMiuo)) {
return;
}
// 油体积系数
m_pebiPvtPara->setBo(vecBo); m_pebiPvtPara->setBo(vecBo);
setPebiPressureIfEmpty(m_pebiPvtPara, vecX);
// 油压缩系数 // 油压缩系数
bFetchedCo = pContextProvider->getPvtRstOf(pSubWndFitting, WellFluidType::WFT_Oil, "Co", vecX, vecCo);
m_pebiPvtPara->setCo(vecCo); m_pebiPvtPara->setCo(vecCo);
setPebiPressureIfEmpty(m_pebiPvtPara, vecX);
// 油粘度 // 油粘度
bFetchedMiuo = pContextProvider->getPvtRstOf(pSubWndFitting, WellFluidType::WFT_Oil, "Miuo", vecX, vecMiuo);
m_pebiPvtPara->setMiuo(vecMiuo); m_pebiPvtPara->setMiuo(vecMiuo);
setPebiPressureIfEmpty(m_pebiPvtPara, vecX); setPebiPressureIfEmpty(m_pebiPvtPara, vecX);
setSolverModelType( setSolverModelType(SMT_Oil_VariablePvt);
bFetchedBo
&& bFetchedCo
&& bFetchedMiuo
? SMT_Oil_VariablePvt
: SMT_Oil_ConstPvt);
break; break;
case WFT_Gas: case WFT_Gas:
setSolverModelType(SMT_Gas_VariablePvt); setSolverModelType(SMT_Gas_VariablePvt);
// 气相缺少任一PVT曲线时提醒用户补齐参数勾选
bFetchedBg = pContextProvider->getPvtRstOf(pSubWndFitting, WellFluidType::WFT_Gas, "Bg", vecX, vecBg);
bFetchedCg = pContextProvider->getPvtRstOf(pSubWndFitting, WellFluidType::WFT_Gas, "Cg", vecX, vecCg);
bFetchedMiug = pContextProvider->getPvtRstOf(pSubWndFitting, WellFluidType::WFT_Gas, "Miug", vecX, vecMiug);
if(!(bFetchedBg && bFetchedCg && bFetchedMiug)) {
QMessageBox::warning(nullptr, tr("Warning"), tr("Please select all gas PVT parameters."));
return;
}
// 气体积系数 // 气体积系数
pContextProvider->getPvtRstOf(pSubWndFitting, WellFluidType::WFT_Gas, "Bg", vecX, vecBg);
m_pebiPvtPara->setBg(vecBg); m_pebiPvtPara->setBg(vecBg);
setPebiPressureIfEmpty(m_pebiPvtPara, vecX);
// 气压缩系数 // 气压缩系数
pContextProvider->getPvtRstOf(pSubWndFitting, WellFluidType::WFT_Gas, "Cg", vecX, vecCg);
m_pebiPvtPara->setCg(vecCg); m_pebiPvtPara->setCg(vecCg);
setPebiPressureIfEmpty(m_pebiPvtPara, vecX);
// 气粘度 // 气粘度
pContextProvider->getPvtRstOf(pSubWndFitting, WellFluidType::WFT_Gas, "Miug", vecX, vecMiug);
m_pebiPvtPara->setMiug(vecMiug); m_pebiPvtPara->setMiug(vecMiug);
setPebiPressureIfEmpty(m_pebiPvtPara, vecX); setPebiPressureIfEmpty(m_pebiPvtPara, vecX);
break; break;
case WFT_Water: case WFT_Water:
// 水体积系数 // 相需要体积系数、压缩系数和粘度全部可获取
bFetchedBw = pContextProvider->getPvtRstOf(pSubWndFitting, WellFluidType::WFT_Water, "Bw", vecX, vecBw); bFetchedBw = pContextProvider->getPvtRstOf(pSubWndFitting, WellFluidType::WFT_Water, "Bw", vecX, vecBw);
bFetchedCw = pContextProvider->getPvtRstOf(pSubWndFitting, WellFluidType::WFT_Water, "Cw", vecX, vecCw);
bFetchedMiuw = pContextProvider->getPvtRstOf(pSubWndFitting, WellFluidType::WFT_Water, "Miuw", vecX, vecMiuw);
if(!(bFetchedBw && bFetchedCw && bFetchedMiuw)) {
setSolverModelType(SMT_Water_ConstPvt);
return;
}
// 水体积系数
m_pebiPvtPara->setBw(vecBw); m_pebiPvtPara->setBw(vecBw);
setPebiPressureIfEmpty(m_pebiPvtPara, vecX);
// 水压缩系数 // 水压缩系数
bFetchedCw = pContextProvider->getPvtRstOf(pSubWndFitting, WellFluidType::WFT_Water, "Cw", vecX, vecCw);
m_pebiPvtPara->setCw(vecCw); m_pebiPvtPara->setCw(vecCw);
setPebiPressureIfEmpty(m_pebiPvtPara, vecX);
// 水粘度 // 水粘度
bFetchedMiuw = pContextProvider->getPvtRstOf(pSubWndFitting, WellFluidType::WFT_Water, "Miuw", vecX, vecMiuw);
m_pebiPvtPara->setMiuw(vecMiuw); m_pebiPvtPara->setMiuw(vecMiuw);
setPebiPressureIfEmpty(m_pebiPvtPara, vecX); setPebiPressureIfEmpty(m_pebiPvtPara, vecX);
setSolverModelType( setSolverModelType(SMT_Water_VariablePvt);
bFetchedBw
&& bFetchedCw
&& bFetchedMiuw
? SMT_Water_VariablePvt
: SMT_Water_ConstPvt);
break; break;
case WFT_Oil_Water: { case WFT_Oil_Water: {
setSolverModelType(SMT_Oil_Water_TwoPhase); setSolverModelType(SMT_Oil_Water_TwoPhase);
// 油水两相需要油、水两相体积系数和粘度全部可获取
bFetchedBo = pContextProvider->getPvtRstOf(pSubWndFitting, WellFluidType::WFT_Oil_Water, "Bo", vecX, vecBo);
bFetchedMiuo = pContextProvider->getPvtRstOf(pSubWndFitting, WellFluidType::WFT_Oil_Water, "Miuo", vecX, vecMiuo);
bFetchedBw = pContextProvider->getPvtRstOf(pSubWndFitting, WellFluidType::WFT_Oil_Water, "Bw", vecX, vecBw);
bFetchedMiuw = pContextProvider->getPvtRstOf(pSubWndFitting, WellFluidType::WFT_Oil_Water, "Miuw", vecX, vecMiuw);
if(!(bFetchedBo && bFetchedMiuo && bFetchedBw && bFetchedMiuw)) {
return;
}
// 油体积系数 // 油体积系数
pContextProvider->getPvtRstOf(pSubWndFitting, WellFluidType::WFT_Oil_Water, "Bo", vecX, vecBo);
m_pebiPvtPara->setBo(vecBo); m_pebiPvtPara->setBo(vecBo);
setPebiPressureIfEmpty(m_pebiPvtPara, vecX);
// 油粘度 // 油粘度
pContextProvider->getPvtRstOf(pSubWndFitting, WellFluidType::WFT_Oil_Water, "Miuo", vecX, vecMiuo);
m_pebiPvtPara->setMiuo(vecMiuo); m_pebiPvtPara->setMiuo(vecMiuo);
setPebiPressureIfEmpty(m_pebiPvtPara, vecX);
// 水体积系数 // 水体积系数
pContextProvider->getPvtRstOf(pSubWndFitting, WellFluidType::WFT_Oil_Water, "Bw", vecX, vecBw);
m_pebiPvtPara->setBw(vecBw); m_pebiPvtPara->setBw(vecBw);
setPebiPressureIfEmpty(m_pebiPvtPara, vecX);
// 水粘度 // 水粘度
pContextProvider->getPvtRstOf(pSubWndFitting, WellFluidType::WFT_Oil_Water, "Miuw", vecX, vecMiuw);
m_pebiPvtPara->setMiuw(vecMiuw); m_pebiPvtPara->setMiuw(vecMiuw);
setPebiPressureIfEmpty(m_pebiPvtPara, vecX); setPebiPressureIfEmpty(m_pebiPvtPara, vecX);

Loading…
Cancel
Save