From 510e90b8c86e24b65dd2c9c13fb389537d8d5a7b Mon Sep 17 00:00:00 2001 From: mzh Date: Mon, 4 Nov 2024 16:56:36 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=BF=AE=E6=94=B9=E7=BB=93=E6=9E=84?= =?UTF-8?q?=E6=A0=91=E4=B8=8A=E5=8F=82=E8=80=83=E9=87=8F-=E3=80=8B?= =?UTF-8?q?=E6=97=A0=E9=87=8F=E7=BA=B2=E5=8C=96=202=E3=80=81=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=8F=82=E8=80=83=E9=87=8F=E7=95=8C=E9=9D=A2=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=203=E3=80=81=E4=BF=AE=E6=94=B9=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E7=95=8C=E9=9D=A2=E9=85=8D=E7=BD=AE=EF=BC=8C=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E4=BA=86=E4=B8=80=E4=B8=AA=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...DStructDataSolverInitializationManager.cpp | 226 +++++++++++++----- ...CFDStructDataSolverInitializationManager.h | 38 ++- ...ructDataSolverReferenceQuantityManager.cpp | 19 +- ...StructDataSolverReferenceQuantityManager.h | 4 + CFDStruct/CFDStructMain/CFDTreeWidget.cpp | 2 +- 5 files changed, 211 insertions(+), 78 deletions(-) diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.cpp b/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.cpp index deb86a5..f86b869 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.cpp +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.cpp @@ -25,72 +25,172 @@ CUIConfig *CFDStructDataSolverInitializationManager::getParamUIConfig() delete m_uiConfig; m_uiConfig = nullptr; } - qDebug()<<"manage build"; - m_uiConfig = genUIConfig(); + + if(m_CoordinateSystem == 0) + return genCylindricalUIConfig(); + if(m_CoordinateSystem == 1) + return genCartesianUIConfig(); + + 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({ - {"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", "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"}, // μ速度 - {"name", tr("μ speed")}, - {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, - {"value_origin", QVA_GLOBAL(&m_MuVelocity)}, - }), - new CUIConfig({ - {"type", "LineEdit"}, // ν速度 - {"name", tr("v Speed")}, - {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, - {"value_origin", QVA_GLOBAL(&m_VVelocity)}, - }), - new CUIConfig({ - {"type", "LineEdit"}, // ω速度 - {"name", tr("ω velocity")}, - {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, - {"value_origin", QVA_GLOBAL(&m_WVelocity)}, - }), - 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)}, - }), - }), - }); - return nullptr; + {"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"}, // vx + {"name", tr("Vx")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"value_origin", QVA_GLOBAL(&m_Vx)}, + }), + new CUIConfig({ + {"type", "LineEdit"}, // vy + {"name", tr("Vy")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"value_origin", QVA_GLOBAL(&m_Vy)}, + }), + 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)}, + }), + }), + }); } diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.h b/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.h index 8ed9865..ccfbe1a 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.h +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.h @@ -18,25 +18,31 @@ public: CUIConfig *getParamUIConfig(); private: - // 生成界面配置 - CUIConfig *genUIConfig(); + // 生成界面配置 柱坐标系 + CUIConfig *genCylindricalUIConfig(); + + // 生成界面配置 笛卡尔坐标系 + CUIConfig *genCartesianUIConfig(); signals: private: // 参考值取自 int m_ReferenceValuesFrom = 0; // Reference Values From + //坐标系 + int m_CoordinateSystem = 0; + // 密度 double m_Density; // Density - // μ速度 - double m_MuVelocity; // Mu Velocity +// // μ速度 +// double m_MuVelocity; // Mu Velocity - // v速度 - double m_VVelocity; // V Velocity +// // v速度 +// double m_VVelocity; // V Velocity - // w速度 - double m_WVelocity; // W Velocity +// // w速度 +// double m_WVelocity; // W Velocity // 压强 double m_Pressure; // Pressure @@ -46,6 +52,22 @@ private: // 湍流强度 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 diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverReferenceQuantityManager.cpp b/CFDStruct/CFDStructDataManager/CFDStructDataSolverReferenceQuantityManager.cpp index 9b566f6..b864ba2 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverReferenceQuantityManager.cpp +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverReferenceQuantityManager.cpp @@ -78,12 +78,19 @@ CUIConfig *CFDStructDataSolverReferenceQuantityManager::genUIConfig() new CUIConfig({{"type", "GroupBox"}, // 力和力矩 {"name", tr("Force and torque")}}, { - new CUIConfig({ - {"type", "LineEdit"}, // 面积 - {"name", tr("the measure of area")}, - {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, - {"value_origin", QVA_GLOBAL(&m_Area)}, - }), + new CUIConfig({ + {"type", "LineEdit"}, // 面积 + {"name", tr("the measure of area")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"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; diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverReferenceQuantityManager.h b/CFDStruct/CFDStructDataManager/CFDStructDataSolverReferenceQuantityManager.h index 5d5dfb9..a156eb8 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverReferenceQuantityManager.h +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverReferenceQuantityManager.h @@ -1,5 +1,6 @@ /** * 参考量 + * 无量纲化 */ #ifndef CFDSTRUCTDATASOLVERREFERENCEQUANTITYEMANAGER_H #define CFDSTRUCTDATASOLVERREFERENCEQUANTITYEMANAGER_H @@ -37,6 +38,9 @@ private: // 面积 double m_Area; // Area + + //力矩矩心 + QString m_TorqueCenterOfMoment = 0; }; #endif // CFDSTRUCTDATASOLVERREFERENCEQUANTITYEMANAGER_H diff --git a/CFDStruct/CFDStructMain/CFDTreeWidget.cpp b/CFDStruct/CFDStructMain/CFDTreeWidget.cpp index 454a488..e68a644 100644 --- a/CFDStruct/CFDStructMain/CFDTreeWidget.cpp +++ b/CFDStruct/CFDStructMain/CFDTreeWidget.cpp @@ -140,7 +140,7 @@ namespace GUI InitializationItem->setData(2, 0, QVariant::fromValue(SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverInitialization)); ComputationalDomainItem->addChild(InitializationItem); QTreeWidgetItem *ReferenceQuantityItem = new QTreeWidgetItem(); - ReferenceQuantityItem->setText(0, tr("Reference Quantity")); + ReferenceQuantityItem->setText(0, tr("Dimensionless")); ReferenceQuantityItem->setData(1, 0, -1); ReferenceQuantityItem->setData(2, 0, QVariant::fromValue(SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverComputationalControlReferenceQuantity)); InitializationItem->addChild(ReferenceQuantityItem);