1、修改结构树上参考量-》无量纲化

2、修改参考量界面配置
3、修改初始化界面配置,添加了一个界面
feature/struct-menu-20241023
mzh 2 weeks ago
parent 1ea01f24b1
commit 510e90b8c8

@ -25,72 +25,172 @@ CUIConfig *CFDStructDataSolverInitializationManager::getParamUIConfig()
delete m_uiConfig; delete m_uiConfig;
m_uiConfig = nullptr; m_uiConfig = nullptr;
} }
qDebug()<<"manage build";
m_uiConfig = genUIConfig(); if(m_CoordinateSystem == 0)
return genCylindricalUIConfig();
if(m_CoordinateSystem == 1)
return genCartesianUIConfig();
return m_uiConfig; return m_uiConfig;
} }
CUIConfig *CFDStructDataSolverInitializationManager::genUIConfig() CUIConfig *CFDStructDataSolverInitializationManager::genCylindricalUIConfig()
{
return new CUIConfig({
{"type", "Widget"},
},
{
new CUIConfig({
{"type", "ComboBox"}, // 参考值取自
{"name", tr("The reference value is taken from")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
{"value_origin", QVA_GLOBAL(&m_ReferenceValuesFrom)},
},
{}),
new CUIConfig({
{"type","ComboBox"},//坐标系
{"name",tr("Coordinate System")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
{"value_origin", QVA_GLOBAL(&m_CoordinateSystem)},
{"semaphore", (int)SolutionAnalysisModuleProperty::Initialization},
},{
new CUIConfig({
{"type","Item"},
{"name","Cylindrical Coordinate System"},
}),
new CUIConfig({
{"type","Item"},
{"name","Cartesian Coordinate System"},
}),
}),
new CUIConfig({
{"type", "GroupBox"}, // 初始值定义
{"name", tr("Initial value definition")},
},
{
new CUIConfig({
{"type", "LineEdit"}, // 密度
{"name", tr("density")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_Density)},
}),
new CUIConfig({
{"type", "LineEdit"}, // 展向速度vr
{"name", tr("Vr")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_Vr)},
}),
new CUIConfig({
{"type", "LineEdit"}, // 周向速度Vtheta
{"name", tr("Vtheta")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_Vtheta)},
}),
new CUIConfig({
{"type", "LineEdit"}, // 轴向速度Vz
{"name", tr("Vz")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_Vz)},
}),
new CUIConfig({
{"type", "LineEdit"}, // 压强
{"name", tr("pressure")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_Pressure)},
}),
new CUIConfig({
{"type", "LineEdit"}, // 湍流粘性比
{"name", tr("Turbulent viscosity ratio")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_TurbulentViscosityRatio)},
}),
new CUIConfig({
{"type", "LineEdit"}, // 湍流强度
{"name", tr("Turbulence intensity")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_TurbulentIntensity)},
}),
}),
});
}
CUIConfig *CFDStructDataSolverInitializationManager::genCartesianUIConfig()
{ {
return new CUIConfig({ return new CUIConfig({
{"type", "Widget"}, {"type", "Widget"},
}, },
{ {
new CUIConfig({ new CUIConfig({
{"type", "ComboBox"}, // 参考值取自 {"type", "ComboBox"}, // 参考值取自
{"name", tr("The reference value is taken from")}, {"name", tr("The reference value is taken from")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
{"value_origin", QVA_GLOBAL(&m_ReferenceValuesFrom)}, {"value_origin", QVA_GLOBAL(&m_ReferenceValuesFrom)},
}, },
{}), {}),
new CUIConfig({ new CUIConfig({
{"type", "GroupBox"}, // 初始值定义 {"type","ComboBox"},//坐标系
{"name", tr("Initial value definition")}, {"name",tr("Coordinate System")},
}, {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
{ {"value_origin", QVA_GLOBAL(&m_CoordinateSystem)},
new CUIConfig({ {"semaphore", (int)SolutionAnalysisModuleProperty::Initialization},
{"type", "LineEdit"}, // 密度 },{
{"name", tr("density")}, new CUIConfig({
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, {"type","Item"},
{"value_origin", QVA_GLOBAL(&m_Density)}, {"name","Cylindrical Coordinate System"},
}), }),
new CUIConfig({ new CUIConfig({
{"type", "LineEdit"}, // μ速度 {"type","Item"},
{"name", tr("μ speed")}, {"name","Cartesian Coordinate System"},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, }),
{"value_origin", QVA_GLOBAL(&m_MuVelocity)}, }),
}), new CUIConfig({
new CUIConfig({ {"type", "GroupBox"}, // 初始值定义
{"type", "LineEdit"}, // ν速度 {"name", tr("Initial value definition")},
{"name", tr("v Speed")}, },
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, {
{"value_origin", QVA_GLOBAL(&m_VVelocity)}, new CUIConfig({
}), {"type", "LineEdit"}, // 密度
new CUIConfig({ {"name", tr("density")},
{"type", "LineEdit"}, // ω速度 {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"name", tr("ω velocity")}, {"value_origin", QVA_GLOBAL(&m_Density)},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, }),
{"value_origin", QVA_GLOBAL(&m_WVelocity)}, new CUIConfig({
}), {"type", "LineEdit"}, // vx
new CUIConfig({ {"name", tr("Vx")},
{"type", "LineEdit"}, // 压强 {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"name", tr("pressure")}, {"value_origin", QVA_GLOBAL(&m_Vx)},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, }),
{"value_origin", QVA_GLOBAL(&m_Pressure)}, new CUIConfig({
}), {"type", "LineEdit"}, // vy
new CUIConfig({ {"name", tr("Vy")},
{"type", "LineEdit"}, // 湍流粘性比 {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"name", tr("Turbulent viscosity ratio")}, {"value_origin", QVA_GLOBAL(&m_Vy)},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, }),
{"value_origin", QVA_GLOBAL(&m_TurbulentViscosityRatio)}, new CUIConfig({
}), {"type", "LineEdit"}, // vz
new CUIConfig({ {"name", tr("Vz")},
{"type", "LineEdit"}, // 湍流强度 {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"name", tr("Turbulence intensity")}, {"value_origin", QVA_GLOBAL(&m_Vz)},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, }),
{"value_origin", QVA_GLOBAL(&m_TurbulentIntensity)}, new CUIConfig({
}), {"type", "LineEdit"}, // 压强
}), {"name", tr("pressure")},
}); {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
return nullptr; {"value_origin", QVA_GLOBAL(&m_Pressure)},
}),
new CUIConfig({
{"type", "LineEdit"}, // 湍流粘性比
{"name", tr("Turbulent viscosity ratio")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_TurbulentViscosityRatio)},
}),
new CUIConfig({
{"type", "LineEdit"}, // 湍流强度
{"name", tr("Turbulence intensity")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_TurbulentIntensity)},
}),
}),
});
} }

@ -18,25 +18,31 @@ public:
CUIConfig *getParamUIConfig(); CUIConfig *getParamUIConfig();
private: private:
// 生成界面配置 // 生成界面配置 柱坐标系
CUIConfig *genUIConfig(); CUIConfig *genCylindricalUIConfig();
// 生成界面配置 笛卡尔坐标系
CUIConfig *genCartesianUIConfig();
signals: signals:
private: private:
// 参考值取自 // 参考值取自
int m_ReferenceValuesFrom = 0; // Reference Values From int m_ReferenceValuesFrom = 0; // Reference Values From
//坐标系
int m_CoordinateSystem = 0;
// 密度 // 密度
double m_Density; // Density double m_Density; // Density
// μ速度 // // μ速度
double m_MuVelocity; // Mu Velocity // double m_MuVelocity; // Mu Velocity
// v速度 // // v速度
double m_VVelocity; // V Velocity // double m_VVelocity; // V Velocity
// w速度 // // w速度
double m_WVelocity; // W Velocity // double m_WVelocity; // W Velocity
// 压强 // 压强
double m_Pressure; // Pressure double m_Pressure; // Pressure
@ -46,6 +52,22 @@ private:
// 湍流强度 // 湍流强度
double m_TurbulentIntensity; // Turbulent Intensity double m_TurbulentIntensity; // Turbulent Intensity
//展向速度vr
double m_Vr = 0;
//周向速度Vtheta
double m_Vtheta = 0;
// 轴向速度Vz
double m_Vz = 0;
//笛卡尔坐标系,三轴方向速度
double m_Vx = 0;
double m_Vy = 0;
// double m_Vz = 0;
}; };
#endif // CFDSTRUCTDATASOLVERINITIALIZATIONEMANAGER_H #endif // CFDSTRUCTDATASOLVERINITIALIZATIONEMANAGER_H

@ -78,12 +78,19 @@ CUIConfig *CFDStructDataSolverReferenceQuantityManager::genUIConfig()
new CUIConfig({{"type", "GroupBox"}, // 力和力矩 new CUIConfig({{"type", "GroupBox"}, // 力和力矩
{"name", tr("Force and torque")}}, {"name", tr("Force and torque")}},
{ {
new CUIConfig({ new CUIConfig({
{"type", "LineEdit"}, // 面积 {"type", "LineEdit"}, // 面积
{"name", tr("the measure of area")}, {"name", tr("the measure of area")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_Area)}, {"value_origin", QVA_GLOBAL(&m_Area)},
}), }),
new CUIConfig({
{"type", "LineEdit"}, // 力矩矩心
{"name", tr("Torque Center of Moment")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING},
{"value_origin", QVA_GLOBAL(&m_TorqueCenterOfMoment)},
}),
}), }),
}); });
return nullptr; return nullptr;

@ -1,5 +1,6 @@
/** /**
* *
*
*/ */
#ifndef CFDSTRUCTDATASOLVERREFERENCEQUANTITYEMANAGER_H #ifndef CFDSTRUCTDATASOLVERREFERENCEQUANTITYEMANAGER_H
#define CFDSTRUCTDATASOLVERREFERENCEQUANTITYEMANAGER_H #define CFDSTRUCTDATASOLVERREFERENCEQUANTITYEMANAGER_H
@ -37,6 +38,9 @@ private:
// 面积 // 面积
double m_Area; // Area double m_Area; // Area
//力矩矩心
QString m_TorqueCenterOfMoment = 0;
}; };
#endif // CFDSTRUCTDATASOLVERREFERENCEQUANTITYEMANAGER_H #endif // CFDSTRUCTDATASOLVERREFERENCEQUANTITYEMANAGER_H

@ -140,7 +140,7 @@ namespace GUI
InitializationItem->setData(2, 0, QVariant::fromValue(SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverInitialization)); InitializationItem->setData(2, 0, QVariant::fromValue(SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverInitialization));
ComputationalDomainItem->addChild(InitializationItem); ComputationalDomainItem->addChild(InitializationItem);
QTreeWidgetItem *ReferenceQuantityItem = new QTreeWidgetItem(); QTreeWidgetItem *ReferenceQuantityItem = new QTreeWidgetItem();
ReferenceQuantityItem->setText(0, tr("Reference Quantity")); ReferenceQuantityItem->setText(0, tr("Dimensionless"));
ReferenceQuantityItem->setData(1, 0, -1); ReferenceQuantityItem->setData(1, 0, -1);
ReferenceQuantityItem->setData(2, 0, QVariant::fromValue(SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverComputationalControlReferenceQuantity)); ReferenceQuantityItem->setData(2, 0, QVariant::fromValue(SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverComputationalControlReferenceQuantity));
InitializationItem->addChild(ReferenceQuantityItem); InitializationItem->addChild(ReferenceQuantityItem);

Loading…
Cancel
Save