|
|
|
|
@ -1,8 +1,6 @@
|
|
|
|
|
#include "nmCalculationPebiGrid.h"
|
|
|
|
|
#include <Windows.h>
|
|
|
|
|
#include <QApplication>
|
|
|
|
|
#include <QDebug>
|
|
|
|
|
#include <QDir>
|
|
|
|
|
#include <QMutex>
|
|
|
|
|
#include <QMutexLocker>
|
|
|
|
|
#include <QThread>
|
|
|
|
|
@ -122,26 +120,6 @@ std::vector<double> buildConstantPvtPressure()
|
|
|
|
|
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,
|
|
|
|
|
NM_SOLVER_MODEL_TYPE modelType,
|
|
|
|
|
nmDataPvtParaForPebi* pvt,
|
|
|
|
|
@ -1703,31 +1681,6 @@ bool nmCalculationPebiGrid::calculateSnapshot(
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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)) {
|
|
|
|
|
FreeLibrary(hGridModule);
|
|
|
|
|
return false;
|
|
|
|
|
|