From fb893a2569ba0c6366e2ba2124fcf5f2eb947f11 Mon Sep 17 00:00:00 2001 From: mzh Date: Sun, 3 Nov 2024 16:53:54 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=AE=8C=E6=88=90=E8=BE=B9=E7=95=8C?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ructDataSolverBoundaryConditionManager.cpp | 131 +++++++++++++++--- ...StructDataSolverBoundaryConditionManager.h | 84 +++++++++-- 2 files changed, 187 insertions(+), 28 deletions(-) diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverBoundaryConditionManager.cpp b/CFDStruct/CFDStructDataManager/CFDStructDataSolverBoundaryConditionManager.cpp index e3cd198..071d999 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverBoundaryConditionManager.cpp +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverBoundaryConditionManager.cpp @@ -10,8 +10,7 @@ CFDStructDataSolverBoundaryConditionManager::CFDStructDataSolverBoundaryConditio { m_uiConfig = nullptr; connect(m_cuiSigsCenter, &CUISigsCenter::sig_cuiPropertyChanged, this, [=](int semaphore) - { - emit CFDStructSigsCenter::getInstance()->sig_solverTimeModeDataChanged(); }); + { emit CFDStructSigsCenter::getInstance() -> sig_solverTimeModeDataChanged(); }); } CFDStructDataSolverBoundaryConditionManager::~CFDStructDataSolverBoundaryConditionManager() @@ -38,16 +37,23 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genFarFieldModeUIConfig( new CUIConfig({ {"type", "LineEdit"}, // 边界名称 {"name", tr("Boundary name")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING}, + {"value_origin", QVA_GLOBAL(&m_BoundaryName)}, }, {}), new CUIConfig({ {"type", "LineEdit"}, // 所属计算域 {"name", tr("Belonging to the computing domain")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING}, + {"value_origin", QVA_GLOBAL(&m_ComputationalDomain)}, }, {}), new CUIConfig({ {"type", "ComboBox"}, // 边界类型 {"name", tr("Boundary type")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING}, + {"value_origin", QVA_GLOBAL(&m_BoundaryType)}, + {"semaphore", (int)SolutionAnalysisModuleProperty::Boundary_Conditions}, }, { new CUIConfig({ @@ -78,31 +84,43 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genFarFieldModeUIConfig( new CUIConfig({ {"type", "LineEdit"}, // 马赫数 {"name", tr("mach number")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"value_origin", QVA_GLOBAL(&m_MachNumber)}, }, {}), 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("temperature")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"value_origin", QVA_GLOBAL(&m_Temperature)}, }, {}), new CUIConfig({ {"type", "LineEdit"}, // 来流方向 {"name", tr("Flow direction")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"value_origin", QVA_GLOBAL(&m_InflowDirection)}, }, {}), 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)}, }, {}), }); @@ -116,16 +134,23 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeUICo new CUIConfig({ {"type", "LineEdit"}, // 边界名称 {"name", tr("Boundary name")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING}, + {"value_origin", QVA_GLOBAL(&m_BoundaryName)}, }, {}), new CUIConfig({ {"type", "LineEdit"}, // 所属计算域 {"name", tr("Belonging to the computing domain")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING}, + {"value_origin", QVA_GLOBAL(&m_ComputationalDomain)}, }, {}), new CUIConfig({ {"type", "ComboBox"}, // 边界类型 {"name", tr("Boundary type")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING}, + {"value_origin", QVA_GLOBAL(&m_BoundaryType)}, + {"semaphore", (int)SolutionAnalysisModuleProperty::Boundary_Conditions}, }, { new CUIConfig({ @@ -156,31 +181,43 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeUICo new CUIConfig({ {"type", "LineEdit"}, // 总压 {"name", tr("Total pressure")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"value_origin", QVA_GLOBAL(&m_TotalPressure)}, }, {}), new CUIConfig({ {"type", "LineEdit"}, // 总温 {"name", tr("Total temperature")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"value_origin", QVA_GLOBAL(&m_TotalTemperature)}, }, {}), new CUIConfig({ {"type", "LineEdit"}, // 静压 {"name", tr("static pressure")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"value_origin", QVA_GLOBAL(&m_StaticPressure)}, }, {}), new CUIConfig({ {"type", "LineEdit"}, // 来流方向 {"name", tr("Flow direction")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"value_origin", QVA_GLOBAL(&m_InflowDirection)}, }, {}), 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)}, }, {}), // TODO 用户自定义 @@ -194,16 +231,23 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureOutletUIConfi new CUIConfig({ {"type", "LineEdit"}, // 边界名称 {"name", tr("Boundary name")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING}, + {"value_origin", QVA_GLOBAL(&m_BoundaryName)}, }, {}), new CUIConfig({ {"type", "LineEdit"}, // 所属计算域 {"name", tr("Belonging to the computing domain")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING}, + {"value_origin", QVA_GLOBAL(&m_ComputationalDomain)}, }, {}), new CUIConfig({ {"type", "ComboBox"}, // 边界类型 {"name", tr("Boundary type")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING}, + {"value_origin", QVA_GLOBAL(&m_BoundaryType)}, + {"semaphore", (int)SolutionAnalysisModuleProperty::Boundary_Conditions}, }, { new CUIConfig({ @@ -234,6 +278,8 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureOutletUIConfi new CUIConfig({ {"type", "LineEdit"}, // 静压 {"name", tr("static pressure")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"value_origin", QVA_GLOBAL(&m_StaticPressure)}, }, {}), }); @@ -246,16 +292,23 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genSymmetricUIConfig() new CUIConfig({ {"type", "LineEdit"}, // 边界名称 {"name", tr("Boundary name")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING}, + {"value_origin", QVA_GLOBAL(&m_BoundaryName)}, }, {}), new CUIConfig({ {"type", "LineEdit"}, // 所属计算域 {"name", tr("Belonging to the computing domain")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING}, + {"value_origin", QVA_GLOBAL(&m_ComputationalDomain)}, }, {}), new CUIConfig({ {"type", "ComboBox"}, // 边界类型 {"name", tr("Boundary type")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING}, + {"value_origin", QVA_GLOBAL(&m_BoundaryType)}, + {"semaphore", (int)SolutionAnalysisModuleProperty::Boundary_Conditions}, }, { new CUIConfig({ @@ -293,16 +346,23 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genCycleUIConfig() new CUIConfig({ {"type", "LineEdit"}, // 边界名称 {"name", tr("Boundary name")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING}, + {"value_origin", QVA_GLOBAL(&m_BoundaryName)}, }, {}), new CUIConfig({ {"type", "LineEdit"}, // 所属计算域 {"name", tr("Belonging to the computing domain")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING}, + {"value_origin", QVA_GLOBAL(&m_ComputationalDomain)}, }, {}), new CUIConfig({ {"type", "ComboBox"}, // 边界类型 {"name", tr("Boundary type")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING}, + {"value_origin", QVA_GLOBAL(&m_BoundaryType)}, + {"semaphore", (int)SolutionAnalysisModuleProperty::Boundary_Conditions}, }, { new CUIConfig({ @@ -333,31 +393,43 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genCycleUIConfig() new CUIConfig({ {"type", "LineEdit"}, // 配对名称 {"name", tr("Pairing Name")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING}, + {"value_origin", QVA_GLOBAL(&m_PairingName)}, }, {}), new CUIConfig({ - {"type", "LineEdit"}, // 对应面 + {"type", "ComboBox"}, // 对应面 {"name", tr("Corresponding surface")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, + {"value_origin", QVA_GLOBAL(&m_CorrespondingSurface)}, }, {}), new CUIConfig({ - {"type", "LineEdit"}, // 周期类型 + {"type", "ComboBox"}, // 周期类型 {"name", tr("Cycle type")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, + {"value_origin", QVA_GLOBAL(&m_PeriodicType)}, }, {}), new CUIConfig({ {"type", "LineEdit"}, // 旋转中心 {"name", tr("Rotation center")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING}, + {"value_origin", QVA_GLOBAL(&m_RotationCenter)}, }, {}), new CUIConfig({ {"type", "LineEdit"}, // 转轴方向 {"name", tr("Axis direction")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING}, + {"value_origin", QVA_GLOBAL(&m_RotationAxisDirection)}, }, {}), new CUIConfig({ {"type", "LineEdit"}, // 旋转角 {"name", tr("Rotation angle")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING}, + {"value_origin", QVA_GLOBAL(&m_RotationAngle)}, }, {}), }); @@ -370,16 +442,23 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genWallAdiabaticWallUICo new CUIConfig({ {"type", "LineEdit"}, // 边界名称 {"name", tr("Boundary name")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING}, + {"value_origin", QVA_GLOBAL(&m_BoundaryName)}, }, {}), new CUIConfig({ {"type", "LineEdit"}, // 所属计算域 {"name", tr("Belonging to the computing domain")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING}, + {"value_origin", QVA_GLOBAL(&m_ComputationalDomain)}, }, {}), new CUIConfig({ {"type", "ComboBox"}, // 边界类型 {"name", tr("Boundary type")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING}, + {"value_origin", QVA_GLOBAL(&m_BoundaryType)}, + {"semaphore", (int)SolutionAnalysisModuleProperty::Boundary_Conditions}, }, { new CUIConfig({ @@ -410,8 +489,10 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genWallAdiabaticWallUICo new CUIConfig({ {"type", "RadioComponent"}, // 壁面类型 {"name", tr("Wall type")}, - {"widget","GroupBox"}, - + {"widget", "GroupBox"}, + {"layout", "QHBoxLayout"}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, + {"value_origin", QVA_GLOBAL(&m_WallType)}, }, { new CUIConfig({ @@ -433,11 +514,11 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genWallAdiabaticWallUICo CUIConfig *CFDStructDataSolverBoundaryConditionManager::genWallIsothermalWallUIConfig() { - return new CUIConfig({{"type", "Widget"}}, { + return new CUIConfig({{"type", "Widget"}}, { new CUIConfig({ {"type", "LineEdit"}, // 边界名称 {"name", tr("Boundary name")}, - {"widget","GroupBox"}, + {"widget", "GroupBox"}, }, {}), new CUIConfig({ @@ -477,8 +558,12 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genWallIsothermalWallUIC }), new CUIConfig({ {"type", "RadioComponent"}, // 壁面类型 - {"name", tr(("Wall type"))}, - {"widget","GroupBox"}, + {"name", tr("Wall type")}, + {"widget", "GroupBox"}, + {"layout", "QHBoxLayout"}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, + {"value_origin", QVA_GLOBAL(&m_WallType)}, + }, { new CUIConfig({ @@ -494,8 +579,10 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genWallIsothermalWallUIC {"name", tr("Hot flow wall")}, }), new CUIConfig({ - {"type","LineEidt"},//壁面温度 - {"name",tr("Wall temperature")}, + {"type", "LineEidt"}, // 壁面温度 + {"name", tr("Wall temperature")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"value_origin", QVA_GLOBAL(&m_WallTemperature)}, }), }), }); @@ -504,20 +591,27 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genWallIsothermalWallUIC CUIConfig *CFDStructDataSolverBoundaryConditionManager::genWallHotFlowWallUIConfig() { - return new CUIConfig({{"type", "Widget"}}, { + return new CUIConfig({{"type", "Widget"}}, { new CUIConfig({ {"type", "LineEdit"}, // 边界名称 {"name", tr("Boundary name")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING}, + {"value_origin", QVA_GLOBAL(&m_BoundaryName)}, }, {}), new CUIConfig({ {"type", "LineEdit"}, // 所属计算域 {"name", tr("Belonging to the computing domain")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING}, + {"value_origin", QVA_GLOBAL(&m_ComputationalDomain)}, }, {}), new CUIConfig({ {"type", "ComboBox"}, // 边界类型 {"name", tr("Boundary type")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING}, + {"value_origin", QVA_GLOBAL(&m_BoundaryType)}, + {"semaphore", (int)SolutionAnalysisModuleProperty::Boundary_Conditions}, }, { new CUIConfig({ @@ -548,7 +642,10 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genWallHotFlowWallUIConf new CUIConfig({ {"type", "RadioComponent"}, // 壁面类型 {"name", tr("Wall type")}, - {"widget","GroupBox"}, + {"widget", "GroupBox"}, + {"layout", "QHBoxLayout"}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, + {"value_origin", QVA_GLOBAL(&m_WallType)}, }, { new CUIConfig({ @@ -564,8 +661,10 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genWallHotFlowWallUIConf {"name", tr("Hot flow wall")}, }), new CUIConfig({ - {"type","LineEidt"},//壁面热流 - {"name",tr("Wall heat flux")}, + {"type", "LineEidt"}, // 壁面热流 + {"name", tr("Wall heat flux")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"value_origin", QVA_GLOBAL(&m_WallHeatFlux)}, }), }), }); diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverBoundaryConditionManager.h b/CFDStruct/CFDStructDataManager/CFDStructDataSolverBoundaryConditionManager.h index 250b55f..baf3060 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverBoundaryConditionManager.h +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverBoundaryConditionManager.h @@ -37,18 +37,78 @@ private: signals: private: - // 时间模式:定常0,非定常1 - int m_runtype = 0; - // 时间模式:定常0,则是迭代步数;时间模式:非定常1,则是内迭代步数 - int m_mcyc = 1000; - // 步长模式 >=1 - double m_alf0 = 1.0; - // 时间步长 >0 - double m_realdt = 1.0; - // 时间步数 >=1 - int m_nstep = 10; - // 时均统计量数据采样:0 | 1 - int m_timeaverage = 0; + + // 边界名称 + QString m_BoundaryName; // Boundary Name + + // 所属计算域 + QString m_ComputationalDomain; // Computational Domain + + // 边界类型 + int m_BoundaryType; // Boundary Type + + + + // 马赫数 + double m_MachNumber; // Mach Number + + // 密度 + double m_Density; // Density + + // 温度 + double m_Temperature; // Temperature + + // 来流方向 + double m_InflowDirection; // Inflow Direction + + // 湍流粘性比 + double m_TurbulentViscosityRatio; // Turbulent Viscosity Ratio + + // 湍流强度 + double m_TurbulentIntensity; // Turbulent Intensity + + // 总压 + double m_TotalPressure; // Total Pressure + + // 总温 + double m_TotalTemperature; // Total Temperature + + // 静压 + double m_StaticPressure; // Static Pressure + + // 来流方向 + double m_InflowDirection; // Inflow Directionn + + + // 配对名称 + double m_PairingName; // Pairing Name + + // 对应面 + int m_CorrespondingSurface; // Corresponding Surface + + // 周期类型 + int m_PeriodicType; // Periodic Type + + // 平移距离 + QString m_TranslationDistance; // Translation Distance + + // 旋转中心 + QString m_RotationCenter; // Rotation Center + + // 转轴方向 + QString m_RotationAxisDirection; // Rotation Axis Direction + + // 旋转角 + QString m_RotationAngle; // Rotation Angle + + // 壁面类型 + std::string m_WallType; // Wall Type + + // 壁面温度 + double m_WallTemperature; // Wall Temperature + + // 壁面热流 + double m_WallHeatFlux; // Wall Heat Flux }; #endif // CFDSTRUCTDATASOLVERBOUNDARYCONDITIONMANAGER_H