|
|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
#include "nmWxAutomaticFitting.h"
|
|
|
|
|
#include "nmWxAutomaticFitting.h"
|
|
|
|
|
#include "nmCalculationAutoFitPSO.h"
|
|
|
|
|
#include "nmWxAutomaticfittingStart.h"
|
|
|
|
|
#include "nmWxParameterProperty.h"
|
|
|
|
|
@ -92,9 +92,7 @@ void nmWxAutomaticFitting::updateParameterVisibility(QTableWidget* table, NM_SOL
|
|
|
|
|
|
|
|
|
|
setParameterRowVisible(table, 6, showCt); // Ct
|
|
|
|
|
setParameterRowVisible(table, 7, showCf); // Cf
|
|
|
|
|
setParameterRowVisible(table, 8, false); // Soi
|
|
|
|
|
setParameterRowVisible(table, 9, showSwi); // Swi
|
|
|
|
|
setParameterRowVisible(table, 10, false); // Sgi
|
|
|
|
|
setParameterRowVisible(table, 8, showSwi); // Swi
|
|
|
|
|
|
|
|
|
|
renumberVisibleParameterRows(table);
|
|
|
|
|
}
|
|
|
|
|
@ -197,7 +195,7 @@ void nmWxAutomaticFitting::setupUI()
|
|
|
|
|
void nmWxAutomaticFitting::setupParameterTable()
|
|
|
|
|
{
|
|
|
|
|
// 创建表格
|
|
|
|
|
m_parameterTable = new QTableWidget(11, 6, this);
|
|
|
|
|
m_parameterTable = new QTableWidget(9, 6, this);
|
|
|
|
|
|
|
|
|
|
// 设置表头
|
|
|
|
|
QStringList headers;
|
|
|
|
|
@ -306,38 +304,18 @@ void nmWxAutomaticFitting::setupParameterTable()
|
|
|
|
|
m_parameterTable->setItem(7, 4, new QTableWidgetItem(QString::number(automaticFittingData.getCfMax().getValue().toDouble())));
|
|
|
|
|
m_parameterTable->setItem(7, 5, new QTableWidgetItem(""));
|
|
|
|
|
|
|
|
|
|
// 初始含油饱和度 (Soi)
|
|
|
|
|
m_parameterTable->setItem(8, 0, new QTableWidgetItem("9"));
|
|
|
|
|
m_soiCheckBox = new QCheckBox(tr("Soi"));
|
|
|
|
|
m_soiCheckBox->setChecked(automaticFittingData.getSoiSelected());
|
|
|
|
|
m_parameterTable->setCellWidget(8, 1, m_soiCheckBox);
|
|
|
|
|
m_parameterTable->setItem(8, 2, new QTableWidgetItem(QString::number(automaticFittingData.getSoiMin().getValue().toDouble())));
|
|
|
|
|
m_parameterTable->setItem(8, 3, new QTableWidgetItem(QString::number(reservoirData.getSoi().getValue().toDouble())));
|
|
|
|
|
m_parameterTable->setItem(8, 4, new QTableWidgetItem(QString::number(automaticFittingData.getSoiMax().getValue().toDouble())));
|
|
|
|
|
m_parameterTable->setItem(8, 5, new QTableWidgetItem(""));
|
|
|
|
|
|
|
|
|
|
// 初始含水饱和度 (Swi)
|
|
|
|
|
m_parameterTable->setItem(9, 0, new QTableWidgetItem("10"));
|
|
|
|
|
m_parameterTable->setItem(8, 0, new QTableWidgetItem("9"));
|
|
|
|
|
m_swiCheckBox = new QCheckBox(tr("Swi"));
|
|
|
|
|
m_swiCheckBox->setChecked(automaticFittingData.getSwiSelected());
|
|
|
|
|
m_parameterTable->setCellWidget(9, 1, m_swiCheckBox);
|
|
|
|
|
m_parameterTable->setItem(9, 2, new QTableWidgetItem(QString::number(automaticFittingData.getSwiMin().getValue().toDouble())));
|
|
|
|
|
m_parameterTable->setItem(9, 3, new QTableWidgetItem(QString::number(reservoirData.getSwi().getValue().toDouble())));
|
|
|
|
|
m_parameterTable->setItem(9, 4, new QTableWidgetItem(QString::number(automaticFittingData.getSwiMax().getValue().toDouble())));
|
|
|
|
|
m_parameterTable->setItem(9, 5, new QTableWidgetItem(""));
|
|
|
|
|
|
|
|
|
|
// 初始含气饱和度 (Sgi)
|
|
|
|
|
m_parameterTable->setItem(10, 0, new QTableWidgetItem("11"));
|
|
|
|
|
m_sgiCheckBox = new QCheckBox(tr("Sgi"));
|
|
|
|
|
m_sgiCheckBox->setChecked(automaticFittingData.getSgiSelected());
|
|
|
|
|
m_parameterTable->setCellWidget(10, 1, m_sgiCheckBox);
|
|
|
|
|
m_parameterTable->setItem(10, 2, new QTableWidgetItem(QString::number(automaticFittingData.getSgiMin().getValue().toDouble())));
|
|
|
|
|
m_parameterTable->setItem(10, 3, new QTableWidgetItem(QString::number(reservoirData.getSgi().getValue().toDouble())));
|
|
|
|
|
m_parameterTable->setItem(10, 4, new QTableWidgetItem(QString::number(automaticFittingData.getSgiMax().getValue().toDouble())));
|
|
|
|
|
m_parameterTable->setItem(10, 5, new QTableWidgetItem(""));
|
|
|
|
|
m_parameterTable->setCellWidget(8, 1, m_swiCheckBox);
|
|
|
|
|
m_parameterTable->setItem(8, 2, new QTableWidgetItem(QString::number(automaticFittingData.getSwiMin().getValue().toDouble())));
|
|
|
|
|
m_parameterTable->setItem(8, 3, new QTableWidgetItem(QString::number(reservoirData.getSwi().getValue().toDouble())));
|
|
|
|
|
m_parameterTable->setItem(8, 4, new QTableWidgetItem(QString::number(automaticFittingData.getSwiMax().getValue().toDouble())));
|
|
|
|
|
m_parameterTable->setItem(8, 5, new QTableWidgetItem(""));
|
|
|
|
|
|
|
|
|
|
// 设置表格行为
|
|
|
|
|
for(int i = 0; i < 11; ++i) {
|
|
|
|
|
for(int i = 0; i < m_parameterTable->rowCount(); ++i) {
|
|
|
|
|
for(int j = 0; j < 6; ++j) {
|
|
|
|
|
QTableWidgetItem* item = m_parameterTable->item(i, j);
|
|
|
|
|
|
|
|
|
|
@ -354,7 +332,7 @@ void nmWxAutomaticFitting::setupParameterTable()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 序号列居中对齐
|
|
|
|
|
for(int i = 0; i < 11; ++i) {
|
|
|
|
|
for(int i = 0; i < m_parameterTable->rowCount(); ++i) {
|
|
|
|
|
QTableWidgetItem* item = m_parameterTable->item(i, 0);
|
|
|
|
|
|
|
|
|
|
if(item) {
|
|
|
|
|
@ -535,9 +513,7 @@ void nmWxAutomaticFitting::onReverseSelection()
|
|
|
|
|
if(!m_parameterTable->isRowHidden(5)) m_hCheckBox->setChecked(!m_hCheckBox->isChecked());
|
|
|
|
|
if(!m_parameterTable->isRowHidden(6)) m_ctCheckBox->setChecked(!m_ctCheckBox->isChecked());
|
|
|
|
|
if(!m_parameterTable->isRowHidden(7)) m_cfCheckBox->setChecked(!m_cfCheckBox->isChecked());
|
|
|
|
|
if(!m_parameterTable->isRowHidden(8)) m_soiCheckBox->setChecked(!m_soiCheckBox->isChecked());
|
|
|
|
|
if(!m_parameterTable->isRowHidden(9)) m_swiCheckBox->setChecked(!m_swiCheckBox->isChecked());
|
|
|
|
|
if(!m_parameterTable->isRowHidden(10)) m_sgiCheckBox->setChecked(!m_sgiCheckBox->isChecked());
|
|
|
|
|
if(!m_parameterTable->isRowHidden(8)) m_swiCheckBox->setChecked(!m_swiCheckBox->isChecked());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void nmWxAutomaticFitting::onAlgorithmChanged(int index)
|
|
|
|
|
@ -616,8 +592,7 @@ void nmWxAutomaticFitting::onAccept()
|
|
|
|
|
m_cCheckBox->isChecked() || m_phiCheckBox->isChecked() ||
|
|
|
|
|
m_piCheckBox->isChecked() || m_hCheckBox->isChecked() ||
|
|
|
|
|
m_ctCheckBox->isChecked() || m_cfCheckBox->isChecked() ||
|
|
|
|
|
m_soiCheckBox->isChecked() || m_swiCheckBox->isChecked() ||
|
|
|
|
|
m_sgiCheckBox->isChecked();
|
|
|
|
|
m_swiCheckBox->isChecked();
|
|
|
|
|
|
|
|
|
|
if(!hasSelectedParams) {
|
|
|
|
|
QMessageBox::warning(this, tr("Warning"), tr("Please select at least one parameter for optimization!"));
|
|
|
|
|
@ -635,9 +610,7 @@ void nmWxAutomaticFitting::onAccept()
|
|
|
|
|
if(m_hCheckBox->isChecked()) selectedParameterNames << tr("Thickness");
|
|
|
|
|
if(m_ctCheckBox->isChecked()) selectedParameterNames << tr("Ct");
|
|
|
|
|
if(m_cfCheckBox->isChecked()) selectedParameterNames << tr("Cf");
|
|
|
|
|
if(m_soiCheckBox->isChecked()) selectedParameterNames << tr("Soi");
|
|
|
|
|
if(m_swiCheckBox->isChecked()) selectedParameterNames << tr("Swi");
|
|
|
|
|
if(m_sgiCheckBox->isChecked()) selectedParameterNames << tr("Sgi");
|
|
|
|
|
|
|
|
|
|
// 启动自动拟合 - 传递双对数历史数据
|
|
|
|
|
startAutoFitting(targetLogLogData, selectedParameterNames, selectedWellName);
|
|
|
|
|
@ -732,9 +705,7 @@ void nmWxAutomaticFitting::setAutomaticFittingValue()
|
|
|
|
|
automaticFittingData.setThicknessSelected(m_hCheckBox->isChecked());
|
|
|
|
|
automaticFittingData.setCtSelected(m_ctCheckBox->isChecked());
|
|
|
|
|
automaticFittingData.setCfSelected(m_cfCheckBox->isChecked());
|
|
|
|
|
automaticFittingData.setSoiSelected(m_soiCheckBox->isChecked());
|
|
|
|
|
automaticFittingData.setSwiSelected(m_swiCheckBox->isChecked());
|
|
|
|
|
automaticFittingData.setSgiSelected(m_sgiCheckBox->isChecked());
|
|
|
|
|
automaticFittingData.setSurrogateScreeningEnabled(m_surrogateCombo && m_surrogateCombo->currentIndex() == 1);
|
|
|
|
|
|
|
|
|
|
// 保存渗透率的最小值和最大值
|
|
|
|
|
@ -769,17 +740,9 @@ void nmWxAutomaticFitting::setAutomaticFittingValue()
|
|
|
|
|
automaticFittingData.getCfMin().setValue(m_parameterTable->item(7, 2)->text().toDouble());
|
|
|
|
|
automaticFittingData.getCfMax().setValue(m_parameterTable->item(7, 4)->text().toDouble());
|
|
|
|
|
|
|
|
|
|
// 保存初始含油饱和度的最小值和最大值
|
|
|
|
|
automaticFittingData.getSoiMin().setValue(m_parameterTable->item(8, 2)->text().toDouble());
|
|
|
|
|
automaticFittingData.getSoiMax().setValue(m_parameterTable->item(8, 4)->text().toDouble());
|
|
|
|
|
|
|
|
|
|
// 保存初始含水饱和度的最小值和最大值
|
|
|
|
|
automaticFittingData.getSwiMin().setValue(m_parameterTable->item(9, 2)->text().toDouble());
|
|
|
|
|
automaticFittingData.getSwiMax().setValue(m_parameterTable->item(9, 4)->text().toDouble());
|
|
|
|
|
|
|
|
|
|
// 保存初始含气饱和度的最小值和最大值
|
|
|
|
|
automaticFittingData.getSgiMin().setValue(m_parameterTable->item(10, 2)->text().toDouble());
|
|
|
|
|
automaticFittingData.getSgiMax().setValue(m_parameterTable->item(10, 4)->text().toDouble());
|
|
|
|
|
automaticFittingData.getSwiMin().setValue(m_parameterTable->item(8, 2)->text().toDouble());
|
|
|
|
|
automaticFittingData.getSwiMax().setValue(m_parameterTable->item(8, 4)->text().toDouble());
|
|
|
|
|
|
|
|
|
|
// 保存迭代参数
|
|
|
|
|
automaticFittingData.getIterationCount().setValue(m_iterationEdit->text().toInt());
|
|
|
|
|
@ -792,9 +755,7 @@ void nmWxAutomaticFitting::setAutomaticFittingValue()
|
|
|
|
|
reservoirData.getThickness().setValue(m_parameterTable->item(5, 3)->text().toDouble()); // 储层厚度
|
|
|
|
|
reservoirData.getCt().setValue(m_parameterTable->item(6, 3)->text().toDouble()); // 综合压缩系数
|
|
|
|
|
reservoirData.getCf().setValue(m_parameterTable->item(7, 3)->text().toDouble()); // 岩石压缩系数
|
|
|
|
|
reservoirData.getSoi().setValue(m_parameterTable->item(8, 3)->text().toDouble()); // 初始含油饱和度
|
|
|
|
|
reservoirData.getSwi().setValue(m_parameterTable->item(9, 3)->text().toDouble()); // 初始含水饱和度
|
|
|
|
|
reservoirData.getSgi().setValue(m_parameterTable->item(10, 3)->text().toDouble()); // 初始含气饱和度
|
|
|
|
|
reservoirData.getSwi().setValue(m_parameterTable->item(8, 3)->text().toDouble()); // 初始含水饱和度
|
|
|
|
|
|
|
|
|
|
// 更新储层数据(全局)
|
|
|
|
|
nmDataAnalyzeManager::getCurrentInstance()->updateReservoirData(reservoirData);
|
|
|
|
|
@ -1133,9 +1094,7 @@ void nmWxAutomaticFitting::updateBestParametersToTable()
|
|
|
|
|
if(m_hCheckBox->isChecked()) enabledParams.append(5); // 储层厚度
|
|
|
|
|
if(m_ctCheckBox->isChecked()) enabledParams.append(6); // 综合压缩系数
|
|
|
|
|
if(m_cfCheckBox->isChecked()) enabledParams.append(7); // 岩石压缩系数
|
|
|
|
|
if(m_soiCheckBox->isChecked()) enabledParams.append(8); // 初始含油饱和度
|
|
|
|
|
if(m_swiCheckBox->isChecked()) enabledParams.append(9); // 初始含水饱和度
|
|
|
|
|
if(m_sgiCheckBox->isChecked()) enabledParams.append(10); // 初始含气饱和度
|
|
|
|
|
if(m_swiCheckBox->isChecked()) enabledParams.append(8); // 初始含水饱和度
|
|
|
|
|
|
|
|
|
|
// 范围收缩比例
|
|
|
|
|
double shrinkFactor = 0.3;
|
|
|
|
|
@ -1209,18 +1168,10 @@ void nmWxAutomaticFitting::updateBestParametersToTable()
|
|
|
|
|
automaticFittingData.getCfMin().setValue(newMin);
|
|
|
|
|
automaticFittingData.getCfMax().setValue(newMax);
|
|
|
|
|
break;
|
|
|
|
|
case 8: // 初始含油饱和度
|
|
|
|
|
automaticFittingData.getSoiMin().setValue(newMin);
|
|
|
|
|
automaticFittingData.getSoiMax().setValue(newMax);
|
|
|
|
|
break;
|
|
|
|
|
case 9: // 初始含水饱和度
|
|
|
|
|
case 8: // 初始含水饱和度
|
|
|
|
|
automaticFittingData.getSwiMin().setValue(newMin);
|
|
|
|
|
automaticFittingData.getSwiMax().setValue(newMax);
|
|
|
|
|
break;
|
|
|
|
|
case 10: // 初始含气饱和度
|
|
|
|
|
automaticFittingData.getSgiMin().setValue(newMin);
|
|
|
|
|
automaticFittingData.getSgiMax().setValue(newMax);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|