refactor(numerical): 移除建网场景临时文件导出

- 删除场景二进制文件写入和模型文件名映射
- 避免建网前不必要的目录创建与磁盘读写
- 清理不再使用的 Qt 头文件
feature/grid-solver-workflow-20260827
lh 2 weeks ago
parent cdc18b59b9
commit 1798c851a7

@ -1,8 +1,6 @@
#include "nmCalculationPebiGrid.h" #include "nmCalculationPebiGrid.h"
#include <Windows.h> #include <Windows.h>
#include <QApplication>
#include <QDebug> #include <QDebug>
#include <QDir>
#include <QMutex> #include <QMutex>
#include <QMutexLocker> #include <QMutexLocker>
#include <QThread> #include <QThread>
@ -122,26 +120,6 @@ std::vector<double> buildConstantPvtPressure()
return pressure; return pressure;
} }
QString solverModelFileTag(NM_SOLVER_MODEL_TYPE modelType)
{
switch(modelType) {
case SMT_Oil_ConstPvt:
return "T1_oil_const_pvt";
case SMT_Oil_VariablePvt:
return "T2_oil_variable_pvt";
case SMT_Water_ConstPvt:
return "T3_water_const_pvt";
case SMT_Water_VariablePvt:
return "T4_water_variable_pvt";
case SMT_Gas_VariablePvt:
return "T5_gas_variable_pvt";
case SMT_Oil_Water_TwoPhase:
return "T8_oil_water_two_phase";
default:
return QString("T%1_unsupported").arg(static_cast<int>(modelType));
}
}
void fillScenePvtByModel(nmDataBinaryTools::NM_PEBI_SCENE& scene, void fillScenePvtByModel(nmDataBinaryTools::NM_PEBI_SCENE& scene,
NM_SOLVER_MODEL_TYPE modelType, NM_SOLVER_MODEL_TYPE modelType,
nmDataPvtParaForPebi* pvt, nmDataPvtParaForPebi* pvt,
@ -1703,31 +1681,6 @@ bool nmCalculationPebiGrid::calculateSnapshot(
} }
try { try {
// 第一步:后台写出已经值化的场景,不再回查当前成果或井对象。
QDir oAppDir(QCoreApplication::applicationDirPath());
QDir oDataDir(oAppDir.filePath(
"../../ML/nmWTAI-ML/data/temp"));
if(!oDataDir.exists()) {
oDataDir.mkpath(".");
}
const NM_SOLVER_MODEL_TYPE eSolverModelType =
static_cast<NM_SOLVER_MODEL_TYPE>(
oSnapshot.m_oScene.solverType);
const QString sScenePath = oDataDir.filePath(
QString("scene_%1.bin")
.arg(solverModelFileTag(eSolverModelType)));
if(!nmDataBinaryTools::savePebiSceneBin(
sScenePath, oSnapshot.m_oScene)) {
zxLogInstance::getInstance()->writeLogF(
"savePebiSceneBin failed: " +
nmDataBinaryTools::getLastError());
FreeLibrary(hGridModule);
return false;
}
zxLogInstance::getInstance()->writeLogF(
"scene exported: " + sScenePath);
if(isCancellationRequested(pCancelRequested)) { if(isCancellationRequested(pCancelRequested)) {
FreeLibrary(hGridModule); FreeLibrary(hGridModule);
return false; return false;

Loading…
Cancel
Save