|
|
|
@ -1,43 +1,54 @@
|
|
|
|
|
#include "CFDStructDataSolverBasicModelManager.h"
|
|
|
|
|
#include "CUIProperty/CUIConfig.h"
|
|
|
|
|
#include "CFDStructMain/CFDStructDefine.h"
|
|
|
|
|
#include "CFDStructSigsCenter.h"
|
|
|
|
|
#include "CUIProperty/CUIConfig.h"
|
|
|
|
|
|
|
|
|
|
CFDStructDataSolverBasicModelManager::CFDStructDataSolverBasicModelManager(QObject *parent) : CFDStructDataManagerBase(parent)
|
|
|
|
|
{
|
|
|
|
|
CFDStructDataSolverBasicModelManager::CFDStructDataSolverBasicModelManager(QObject *parent) : CFDStructDataManagerBase(parent) {
|
|
|
|
|
m_uiConfig = nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CFDStructDataSolverBasicModelManager::~CFDStructDataSolverBasicModelManager()
|
|
|
|
|
{
|
|
|
|
|
if (m_uiConfig != nullptr)
|
|
|
|
|
{
|
|
|
|
|
CFDStructDataSolverBasicModelManager::~CFDStructDataSolverBasicModelManager() {
|
|
|
|
|
if (m_uiConfig != nullptr) {
|
|
|
|
|
delete m_uiConfig;
|
|
|
|
|
m_uiConfig = nullptr;
|
|
|
|
|
}
|
|
|
|
|
connect(m_cuiSigsCenter, &CUISigsCenter::sig_cuiPropertyChanged, this, [=](int semaphore){
|
|
|
|
|
emit CFDStructSigsCenter::getInstance()->sig_solverTimeModeDataChanged();
|
|
|
|
|
connect(m_cuiSigsCenter, &CUISigsCenter::sig_cuiPropertyChanged, this, [=](int semaphore) {
|
|
|
|
|
emit CFDStructSigsCenter::getInstance() -> sig_solverTimeModeDataChanged();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CUIConfig *CFDStructDataSolverBasicModelManager::getParamUIConfig()
|
|
|
|
|
{
|
|
|
|
|
if(m_FluidProperties == 0)
|
|
|
|
|
CUIConfig *CFDStructDataSolverBasicModelManager::getParamUIConfig() {
|
|
|
|
|
if (m_FluidProperties == 0)
|
|
|
|
|
return this->genFluidPropertiesOffUIConfig();
|
|
|
|
|
if(m_FluidProperties == 1)
|
|
|
|
|
if (m_FluidProperties == 1)
|
|
|
|
|
return this->genFluidPropertiesOnUIConfig();
|
|
|
|
|
|
|
|
|
|
return this->genFluidPropertiesOnUIConfig();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CFDStructDataSolverBasicModelManager::saveDataToDom(rapidjson::Document &dom)
|
|
|
|
|
{
|
|
|
|
|
jsonAdd(dom,m_FlowModel,{"region",0, "flowType",});
|
|
|
|
|
jsonAdd(dom,m_OverlayNetwork,{"region",0, "chimeraMesh",});
|
|
|
|
|
jsonAdd(dom,m_Rgasmean,{"region",0, "refValue", "rgas_mean",});
|
|
|
|
|
jsonAdd(dom,m_Gmean,{"region",0, "refValue", "gamma",});
|
|
|
|
|
jsonAdd(dom,m_Prlmean,{"region",0, "solver", "turbModel", "RANS", "params", "Prl",});
|
|
|
|
|
jsonAdd(dom,m_Prtmean,{"region",0, "solver", "turbModel", "RANS", "params", "Prt",});
|
|
|
|
|
void CFDStructDataSolverBasicModelManager::saveDataToDom(rapidjson::Document &dom) {
|
|
|
|
|
jsonAdd(dom, m_FlowModel, {"region", 0, "flowType"});
|
|
|
|
|
jsonAdd(dom, m_OverlayNetwork, {"region", 0, "chimeraMesh"});
|
|
|
|
|
jsonAdd(dom, m_Rgasmean, {"region", 0, "refValue", "rgas_mean"});
|
|
|
|
|
jsonAdd(dom, m_Gmean, {"region", 0, "refValue", "gamma"});
|
|
|
|
|
jsonAdd(dom, m_Prlmean, {"region", 0, "solver", "turbModel", "RANS", "params", "Prl"});
|
|
|
|
|
jsonAdd(dom, m_Prtmean, {"region", 0, "solver", "turbModel", "RANS", "params", "Prt"});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CFDStructDataSolverBasicModelManager::readDataFromDom(rapidjson::Document &dom) {
|
|
|
|
|
QVariant temp;
|
|
|
|
|
jsonRead(dom, temp, {"region", 0, "flowType"});
|
|
|
|
|
m_FlowModel = temp.toInt();
|
|
|
|
|
jsonRead(dom, temp, {"region", 0, "chimeraMesh"});
|
|
|
|
|
m_OverlayNetwork = temp.toInt();
|
|
|
|
|
jsonRead(dom, temp, {"region", 0, "refValue", "rgas_mean"});
|
|
|
|
|
m_Rgasmean = temp.toDouble();
|
|
|
|
|
jsonRead(dom, temp, {"region", 0, "refValue", "gamma"});
|
|
|
|
|
m_Gmean = temp.toDouble();
|
|
|
|
|
jsonRead(dom, temp, {"region", 0, "solver", "turbModel", "RANS", "params", "Prl"});
|
|
|
|
|
m_Prlmean = temp.toDouble();
|
|
|
|
|
jsonRead(dom, temp, {"region", 0, "solver", "turbModel", "RANS", "params", "Prt"});
|
|
|
|
|
m_Prtmean = temp.toDouble();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -45,8 +56,7 @@ void CFDStructDataSolverBasicModelManager::saveDataToDom(rapidjson::Document &do
|
|
|
|
|
*
|
|
|
|
|
* @return 属性设置
|
|
|
|
|
*/
|
|
|
|
|
CUIConfig *CFDStructDataSolverBasicModelManager::genFluidPropertiesOffUIConfig()
|
|
|
|
|
{
|
|
|
|
|
CUIConfig *CFDStructDataSolverBasicModelManager::genFluidPropertiesOffUIConfig() {
|
|
|
|
|
return new CUIConfig({
|
|
|
|
|
{"type", "Widget"},
|
|
|
|
|
},
|
|
|
|
@ -58,13 +68,14 @@ CUIConfig *CFDStructDataSolverBasicModelManager::genFluidPropertiesOffUIConfig()
|
|
|
|
|
{new CUIConfig({
|
|
|
|
|
{"type", "Item"}, {"name", tr("Compressible Flow")} // 选项:可压缩流动
|
|
|
|
|
})}),
|
|
|
|
|
new CUIConfig({// 下拉框:流动模型
|
|
|
|
|
{"type", "ComboBox"},
|
|
|
|
|
{"name", tr("Flow Model")},
|
|
|
|
|
{"value_type",CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
|
|
|
|
|
{"value_origin",QVA_GLOBAL(&m_FlowModel)},
|
|
|
|
|
{"semaphore",1},
|
|
|
|
|
},
|
|
|
|
|
new CUIConfig({
|
|
|
|
|
// 下拉框:流动模型
|
|
|
|
|
{"type", "ComboBox"},
|
|
|
|
|
{"name", tr("Flow Model")},
|
|
|
|
|
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
|
|
|
|
|
{"value_origin", QVA_GLOBAL(&m_FlowModel)},
|
|
|
|
|
{"semaphore", 1},
|
|
|
|
|
},
|
|
|
|
|
{new CUIConfig({// 选项:外流
|
|
|
|
|
{"type", "Item"},
|
|
|
|
|
{"name", tr("Internal Flow")}}),
|
|
|
|
@ -74,23 +85,24 @@ CUIConfig *CFDStructDataSolverBasicModelManager::genFluidPropertiesOffUIConfig()
|
|
|
|
|
new CUIConfig({// 选项:多级叶轮机械
|
|
|
|
|
{"type", "Item"},
|
|
|
|
|
{"name", tr("Multistage Turbomachinery")}})}),
|
|
|
|
|
new CUIConfig({// 方形勾选:重叠网络
|
|
|
|
|
{"type", "CheckBox"},
|
|
|
|
|
{"name", tr("Overlay Network")},
|
|
|
|
|
{"value_type",CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
|
|
|
|
|
{"value_origin",QVA_GLOBAL(&m_OverlayNetwork)},
|
|
|
|
|
new CUIConfig({
|
|
|
|
|
// 方形勾选:重叠网络
|
|
|
|
|
{"type", "CheckBox"},
|
|
|
|
|
{"name", tr("Overlay Network")},
|
|
|
|
|
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
|
|
|
|
|
{"value_origin", QVA_GLOBAL(&m_OverlayNetwork)},
|
|
|
|
|
}),
|
|
|
|
|
new CUIConfig({// 方形选择按钮:流体属性
|
|
|
|
|
{"type", "CheckBox"},
|
|
|
|
|
{"name", tr("Fluid Properties")},
|
|
|
|
|
{"value_type",CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
|
|
|
|
|
{"value_origin",QVA_GLOBAL(&m_FluidProperties)},
|
|
|
|
|
{"semaphore",1},
|
|
|
|
|
new CUIConfig({
|
|
|
|
|
// 方形选择按钮:流体属性
|
|
|
|
|
{"type", "CheckBox"},
|
|
|
|
|
{"name", tr("Fluid Properties")},
|
|
|
|
|
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
|
|
|
|
|
{"value_origin", QVA_GLOBAL(&m_FluidProperties)},
|
|
|
|
|
{"semaphore", 1},
|
|
|
|
|
})});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CUIConfig *CFDStructDataSolverBasicModelManager::genFluidPropertiesOnUIConfig()
|
|
|
|
|
{
|
|
|
|
|
CUIConfig *CFDStructDataSolverBasicModelManager::genFluidPropertiesOnUIConfig() {
|
|
|
|
|
return new CUIConfig({
|
|
|
|
|
{"type", "Widget"},
|
|
|
|
|
},
|
|
|
|
@ -102,12 +114,13 @@ CUIConfig *CFDStructDataSolverBasicModelManager::genFluidPropertiesOnUIConfig()
|
|
|
|
|
{new CUIConfig({
|
|
|
|
|
{"type", "Item"}, {"name", tr("Compressible Flow")} // 选项:可压缩流动
|
|
|
|
|
})}),
|
|
|
|
|
new CUIConfig({// 下拉框:流动模型
|
|
|
|
|
{"type", "ComboBox"},
|
|
|
|
|
{"name", tr("Flow Model")},
|
|
|
|
|
{"value_type",CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
|
|
|
|
|
{"value_origin",QVA_GLOBAL(&m_FlowModel)},
|
|
|
|
|
},
|
|
|
|
|
new CUIConfig({
|
|
|
|
|
// 下拉框:流动模型
|
|
|
|
|
{"type", "ComboBox"},
|
|
|
|
|
{"name", tr("Flow Model")},
|
|
|
|
|
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
|
|
|
|
|
{"value_origin", QVA_GLOBAL(&m_FlowModel)},
|
|
|
|
|
},
|
|
|
|
|
{new CUIConfig({// 选项:外流
|
|
|
|
|
{"type", "Item"},
|
|
|
|
|
{"name", tr("Internal Flow")}}),
|
|
|
|
@ -117,52 +130,59 @@ CUIConfig *CFDStructDataSolverBasicModelManager::genFluidPropertiesOnUIConfig()
|
|
|
|
|
new CUIConfig({// 选项:多级叶轮机械
|
|
|
|
|
{"type", "Item"},
|
|
|
|
|
{"name", tr("Multistage Turbomachinery")}})}),
|
|
|
|
|
new CUIConfig({// 方形勾选:重叠网络
|
|
|
|
|
{"type", "CheckBox"},
|
|
|
|
|
{"name", tr("Overlay Network")},
|
|
|
|
|
{"value_type",CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
|
|
|
|
|
{"value_origin",QVA_GLOBAL(&m_OverlayNetwork)},
|
|
|
|
|
new CUIConfig({
|
|
|
|
|
// 方形勾选:重叠网络
|
|
|
|
|
{"type", "CheckBox"},
|
|
|
|
|
{"name", tr("Overlay Network")},
|
|
|
|
|
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
|
|
|
|
|
{"value_origin", QVA_GLOBAL(&m_OverlayNetwork)},
|
|
|
|
|
}),
|
|
|
|
|
new CUIConfig({// 圆形选择按钮:流体属性
|
|
|
|
|
{"type", "CheckBox"},
|
|
|
|
|
{"name", tr("Fluid Properties")},
|
|
|
|
|
{"value_type",CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
|
|
|
|
|
{"value_origin",QVA_GLOBAL(&m_FluidProperties)},
|
|
|
|
|
{"semaphore",1},
|
|
|
|
|
new CUIConfig({
|
|
|
|
|
// 圆形选择按钮:流体属性
|
|
|
|
|
{"type", "CheckBox"},
|
|
|
|
|
{"name", tr("Fluid Properties")},
|
|
|
|
|
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
|
|
|
|
|
{"value_origin", QVA_GLOBAL(&m_FluidProperties)},
|
|
|
|
|
{"semaphore", 1},
|
|
|
|
|
}),
|
|
|
|
|
new CUIConfig({// 组,流体属性下的内容
|
|
|
|
|
{"type", "GroupBox"},
|
|
|
|
|
{"name", tr("Fluid Properties")}},
|
|
|
|
|
{
|
|
|
|
|
new CUIConfig({// 气体成分
|
|
|
|
|
{"type", "LineEdit"},
|
|
|
|
|
{"name", tr("Gas Composition")},
|
|
|
|
|
{"value_type",CUI_DATA_TYPE::CUI_DATA_TYPE_STRING},
|
|
|
|
|
{"value_origin",QVA_GLOBAL(&m_GasComposition)},
|
|
|
|
|
}),
|
|
|
|
|
new CUIConfig({// 气体常数
|
|
|
|
|
{"type", "LineEdit"},
|
|
|
|
|
{"name", tr("rgasmean")},
|
|
|
|
|
{"value_type",CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
|
|
|
|
|
{"value_origin",QVA_GLOBAL(&m_Rgasmean)},
|
|
|
|
|
}),
|
|
|
|
|
new CUIConfig({// 比热比
|
|
|
|
|
{"type", "LineEdit"},
|
|
|
|
|
{"name", tr("gmean")},
|
|
|
|
|
{"value_type",CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
|
|
|
|
|
{"value_origin",QVA_GLOBAL(&m_Gmean)},
|
|
|
|
|
}),
|
|
|
|
|
new CUIConfig({// 层流普朗特数
|
|
|
|
|
{"type", "LineEdit"},
|
|
|
|
|
{"name", tr("prlmean")},
|
|
|
|
|
{"value_type",CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
|
|
|
|
|
{"value_origin",QVA_GLOBAL(&m_Prlmean)},
|
|
|
|
|
}),
|
|
|
|
|
new CUIConfig({// 湍流普朗特数
|
|
|
|
|
{"type", "LineEdit"},
|
|
|
|
|
{"name", tr("prtmean")},
|
|
|
|
|
{"value_type",CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
|
|
|
|
|
{"value_origin",QVA_GLOBAL(&m_Prtmean)},
|
|
|
|
|
}),
|
|
|
|
|
new CUIConfig({
|
|
|
|
|
// 气体成分
|
|
|
|
|
{"type", "LineEdit"},
|
|
|
|
|
{"name", tr("Gas Composition")},
|
|
|
|
|
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING},
|
|
|
|
|
{"value_origin", QVA_GLOBAL(&m_GasComposition)},
|
|
|
|
|
}),
|
|
|
|
|
new CUIConfig({
|
|
|
|
|
// 气体常数
|
|
|
|
|
{"type", "LineEdit"},
|
|
|
|
|
{"name", tr("rgasmean")},
|
|
|
|
|
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
|
|
|
|
|
{"value_origin", QVA_GLOBAL(&m_Rgasmean)},
|
|
|
|
|
}),
|
|
|
|
|
new CUIConfig({
|
|
|
|
|
// 比热比
|
|
|
|
|
{"type", "LineEdit"},
|
|
|
|
|
{"name", tr("gmean")},
|
|
|
|
|
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
|
|
|
|
|
{"value_origin", QVA_GLOBAL(&m_Gmean)},
|
|
|
|
|
}),
|
|
|
|
|
new CUIConfig({
|
|
|
|
|
// 层流普朗特数
|
|
|
|
|
{"type", "LineEdit"},
|
|
|
|
|
{"name", tr("prlmean")},
|
|
|
|
|
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
|
|
|
|
|
{"value_origin", QVA_GLOBAL(&m_Prlmean)},
|
|
|
|
|
}),
|
|
|
|
|
new CUIConfig({
|
|
|
|
|
// 湍流普朗特数
|
|
|
|
|
{"type", "LineEdit"},
|
|
|
|
|
{"name", tr("prtmean")},
|
|
|
|
|
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
|
|
|
|
|
{"value_origin", QVA_GLOBAL(&m_Prtmean)},
|
|
|
|
|
}),
|
|
|
|
|
})});
|
|
|
|
|
}
|
|
|
|
|