1、ui界面上远场和压强入口,根据粘性模型展示湍流粘性和湍流强度

feature/struct-menu-20241023
mzh 3 days ago
parent 0ccbc96825
commit 8a590a618b

@ -135,3 +135,11 @@ void CFDStructDataManager::printJson() {
int CFDStructDataManager::getTimeModeRunTime() {
return m_solverTimeModeManager->getRunType();
}
int CFDStructDataManager::getModel() {
return m_solverKvislManager->getModel();
}
int CFDStructDataManager::getRNSModel() {
return m_solverKvislManager->getRNSModel();
}

@ -62,7 +62,12 @@ class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataManager {
rapidjson::Document getJson();
void printJson();
// 获取时间模型的时间模式 定常 非定常
int getTimeModeRunTime();
// 获取粘性模型
int getModel();
// 获取RANS模型
int getRNSModel();
private:
rapidjson::Document m_dom;

@ -1,4 +1,5 @@
#include "CFDStructDataSolverBoundaryConditionManager.h"
#include "CFDStructDataManager.h"
#include "CFDStructDataSolverTimeModeManager.h"
#include "CFDStructMain/CFDStructDefine.h"
#include "CFDStructSigsCenter.h"
@ -21,10 +22,10 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::getParamUIConfig() {
m_uiConfig = nullptr;
}
qDebug() << "in manager " << m_BoundaryType;
m_Model = CFDStructDataManager::getInstance()->getModel();
m_RNSModel = CFDStructDataManager::getInstance()->getRNSModel();
if (m_BoundaryType == 0) {
qDebug() << "walltype is :" << m_WallType;
if (m_WallType == 0)
return genWallAdiabaticWallUIConfig();
if (m_WallType == 1)
@ -33,53 +34,43 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::getParamUIConfig() {
return genWallHotFlowWallUIConfig();
return genWallAdiabaticWallUIConfig();
}
if (m_BoundaryType == 1)
} else if (m_BoundaryType == 1) {
return genFarFieldModeUIConfig();
if (m_BoundaryType == 2) {
} else if (m_BoundaryType == 2) {
if (m_BoundaryType_sub == 0) {
if (m_VelocityDirectionType == 0) {
return genPressureInletModeSupersonicCylindricalUIConfig();
}
if (m_VelocityDirectionType == 1) {
} else if (m_VelocityDirectionType == 1) {
return genPressureInletModeSupersonicCartesianUIConfig();
}
if (m_VelocityDirectionType == 2) {
} else if (m_VelocityDirectionType == 2) {
return genPressureInletModeSupersonicSurfaceUIConfig();
}
}
if (m_BoundaryType_sub == 1) {
} else if (m_BoundaryType_sub == 1) {
if (m_VelocityDirectionType == 0) {
return genPressureInletModeSubsonicCylindricalUIConfig();
}
if (m_VelocityDirectionType == 1) {
} else if (m_VelocityDirectionType == 1) {
return genPressureInletModeSubsonicCartesianUIConfig();
}
if (m_VelocityDirectionType == 2) {
} else if (m_VelocityDirectionType == 2) {
return genPressureInletModeSubsonicSurfaceUIConfig();
}
}
}
if (m_BoundaryType == 3)
} else if (m_BoundaryType == 3) {
return genPressureOutletUIConfig();
if (m_BoundaryType == 4)
} else if (m_BoundaryType == 4) {
return genSymmetricUIConfig();
if (m_BoundaryType == 5) {
} else if (m_BoundaryType == 5) {
return genSupersonicOutlet_ExtrapolateUIConfig();
}
if (m_BoundaryType == 6) {
} else if (m_BoundaryType == 6) {
return genMeshInterfaceUIConfig();
}
if (m_BoundaryType == 7) {
if (m_PeriodicType == 0)
} else if (m_BoundaryType == 7) {
if (m_PeriodicType == 0) {
return genCycleTranslationUIConfig();
if (m_PeriodicType == 1)
} else if (m_PeriodicType == 1) {
return genCycleRotationUIConfig();
return genCycleTranslationUIConfig();
}
if (m_BoundaryType == 8) {
} else {
return genCycleTranslationUIConfig();
}
} else if (m_BoundaryType == 8) {
return genMassFlowOutletUIConfig();
}
@ -96,6 +87,54 @@ void CFDStructDataSolverBoundaryConditionManager::readDataFromDom(rapidjson::Doc
CUIConfig *CFDStructDataSolverBoundaryConditionManager::genFarFieldModeUIConfig() {
// 湍流粘性比和湍流强度的显示
CUIConfig *groupbox;
if (m_Model == 0 || m_Model == 1) {
// 如果没有RANS模型啥也没有
groupbox = new CUIConfig({}, {});
} else {
if (m_RNSModel == 0) {
// 如果选择s-a模型
groupbox = new CUIConfig({
{"type", "GroupBox"},
},
{
new CUIConfig({
{"type", "LineEdit"}, // 湍流强度
{"name", tr("Turbulence intensity")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_TurbulentIntensity)},
},
{}),
});
} else if (m_RNSModel == 1) {
// 如果选择sst模型
groupbox = new CUIConfig({
{"type", "GroupBox"},
},
{
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)},
},
{}),
});
} else if (m_RNSModel == 2) {
// 如果选择k-e
groupbox = new CUIConfig({}, {});
}
}
return new CUIConfig({{"type", "Widget"}}, {
new CUIConfig({
{"type", "LineEdit"}, // 边界名称
@ -196,48 +235,79 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genFarFieldModeUIConfig(
{"type", "LineEdit"},
{"name", "X:"},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", m_InflowDirectionX},
{"value_origin", QVA_GLOBAL(&m_InflowDirectionX)},
}),
new CUIConfig({
{"type", "LineEdit"},
{"name", "Y:"},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", m_InflowDirectionY},
{"value_origin", QVA_GLOBAL(&m_InflowDirectionY)},
}),
new CUIConfig({
{"type", "LineEdit"},
{"name", "Z:"},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", m_InflowDirectionZ},
{"value_origin", QVA_GLOBAL(&m_InflowDirectionZ)},
}),
}),
}),
new CUIConfig({
{"type", "GroupBox"},
},
{
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)},
// },
// {}),
}),
groupbox,
});
return nullptr;
}
CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSupersonicCylindricalUIConfig() {
// 湍流粘性比和湍流强度的显示
CUIConfig *groupbox;
if (m_Model == 0 || m_Model == 1) {
// 如果没有RANS模型啥也没有
groupbox = new CUIConfig({}, {});
} else {
if (m_RNSModel == 0) {
// 如果选择s-a模型
groupbox = new CUIConfig({
{"type", "GroupBox"},
},
{
new CUIConfig({
{"type", "LineEdit"}, // 湍流强度
{"name", tr("Turbulence intensity")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_TurbulentIntensity)},
},
{}),
});
} else if (m_RNSModel == 1) {
// 如果选择sst模型
groupbox = new CUIConfig({
{"type", "GroupBox"},
},
{
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)},
},
{}),
});
} else if (m_RNSModel == 2) {
// 如果选择k-e
groupbox = new CUIConfig({}, {});
}
}
return new CUIConfig({{"type", "Widget"}}, {
new CUIConfig({
{"type", "LineEdit"}, // 边界名称
@ -373,6 +443,7 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSupe
{}),
}),
groupbox,
// TODO 用户自定义
new CUIConfig({
{"type", "CheckBox"},
@ -385,6 +456,54 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSupe
}
CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSupersonicCartesianUIConfig() {
// 湍流粘性比和湍流强度的显示
CUIConfig *groupbox;
if (m_Model == 0 || m_Model == 1) {
// 如果没有RANS模型啥也没有
groupbox = new CUIConfig({}, {});
} else {
if (m_RNSModel == 0) {
// 如果选择s-a模型
groupbox = new CUIConfig({
{"type", "GroupBox"},
},
{
new CUIConfig({
{"type", "LineEdit"}, // 湍流强度
{"name", tr("Turbulence intensity")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_TurbulentIntensity)},
},
{}),
});
} else if (m_RNSModel == 1) {
// 如果选择sst模型
groupbox = new CUIConfig({
{"type", "GroupBox"},
},
{
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)},
},
{}),
});
} else if (m_RNSModel == 2) {
// 如果选择k-e
groupbox = new CUIConfig({}, {});
}
}
return new CUIConfig({{"type", "Widget"}}, {
new CUIConfig({
{"type", "LineEdit"}, // 边界名称
@ -520,6 +639,7 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSupe
{}),
}),
groupbox,
// TODO 用户自定义
new CUIConfig({
{"type", "CheckBox"},
@ -532,6 +652,55 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSupe
}
CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSupersonicSurfaceUIConfig() {
// 湍流粘性比和湍流强度的显示
CUIConfig *groupbox;
if (m_Model == 0 || m_Model == 1) {
// 如果没有RANS模型啥也没有
groupbox = new CUIConfig({}, {});
} else {
if (m_RNSModel == 0) {
// 如果选择s-a模型
groupbox = new CUIConfig({
{"type", "GroupBox"},
},
{
new CUIConfig({
{"type", "LineEdit"}, // 湍流强度
{"name", tr("Turbulence intensity")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_TurbulentIntensity)},
},
{}),
});
} else if (m_RNSModel == 1) {
// 如果选择sst模型
groupbox = new CUIConfig({
{"type", "GroupBox"},
},
{
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)},
},
{}),
});
} else if (m_RNSModel == 2) {
// 如果选择k-e
groupbox = new CUIConfig({}, {});
}
}
return new CUIConfig({{"type", "Widget"}}, {
new CUIConfig({
{"type", "LineEdit"}, // 边界名称
@ -660,6 +829,7 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSupe
}),
}),
groupbox,
// TODO 用户自定义
new CUIConfig({
{"type", "CheckBox"},
@ -672,6 +842,55 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSupe
}
CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSubsonicCylindricalUIConfig() {
// 湍流粘性比和湍流强度的显示
CUIConfig *groupbox;
if (m_Model == 0 || m_Model == 1) {
// 如果没有RANS模型啥也没有
groupbox = new CUIConfig({}, {});
} else {
if (m_RNSModel == 0) {
// 如果选择s-a模型
groupbox = new CUIConfig({
{"type", "GroupBox"},
},
{
new CUIConfig({
{"type", "LineEdit"}, // 湍流强度
{"name", tr("Turbulence intensity")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_TurbulentIntensity)},
},
{}),
});
} else if (m_RNSModel == 1) {
// 如果选择sst模型
groupbox = new CUIConfig({
{"type", "GroupBox"},
},
{
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)},
},
{}),
});
} else if (m_RNSModel == 2) {
// 如果选择k-e
groupbox = new CUIConfig({}, {});
}
}
return new CUIConfig({{"type", "Widget"}}, {
new CUIConfig({
{"type", "LineEdit"}, // 边界名称
@ -800,6 +1019,7 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSubs
{}),
}),
groupbox,
// TODO 用户自定义
new CUIConfig({
{"type", "CheckBox"},
@ -813,6 +1033,55 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSubs
}
CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSubsonicCartesianUIConfig() {
// 湍流粘性比和湍流强度的显示
CUIConfig *groupbox;
if (m_Model == 0 || m_Model == 1) {
// 如果没有RANS模型啥也没有
groupbox = new CUIConfig({}, {});
} else {
if (m_RNSModel == 0) {
// 如果选择s-a模型
groupbox = new CUIConfig({
{"type", "GroupBox"},
},
{
new CUIConfig({
{"type", "LineEdit"}, // 湍流强度
{"name", tr("Turbulence intensity")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_TurbulentIntensity)},
},
{}),
});
} else if (m_RNSModel == 1) {
// 如果选择sst模型
groupbox = new CUIConfig({
{"type", "GroupBox"},
},
{
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)},
},
{}),
});
} else if (m_RNSModel == 2) {
// 如果选择k-e
groupbox = new CUIConfig({}, {});
}
}
return new CUIConfig({{"type", "Widget"}}, {
new CUIConfig({
{"type", "LineEdit"}, // 边界名称
@ -941,6 +1210,7 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSubs
{}),
}),
groupbox,
// TODO 用户自定义
new CUIConfig({
{"type", "CheckBox"},
@ -953,6 +1223,55 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSubs
}
CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSubsonicSurfaceUIConfig() {
// 湍流粘性比和湍流强度的显示
CUIConfig *groupbox;
if (m_Model == 0 || m_Model == 1) {
// 如果没有RANS模型啥也没有
groupbox = new CUIConfig({}, {});
} else {
if (m_RNSModel == 0) {
// 如果选择s-a模型
groupbox = new CUIConfig({
{"type", "GroupBox"},
},
{
new CUIConfig({
{"type", "LineEdit"}, // 湍流强度
{"name", tr("Turbulence intensity")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_TurbulentIntensity)},
},
{}),
});
} else if (m_RNSModel == 1) {
// 如果选择sst模型
groupbox = new CUIConfig({
{"type", "GroupBox"},
},
{
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)},
},
{}),
});
} else if (m_RNSModel == 2) {
// 如果选择k-e
groupbox = new CUIConfig({}, {});
}
}
return new CUIConfig({{"type", "Widget"}}, {
new CUIConfig({
{"type", "LineEdit"}, // 边界名称
@ -1074,6 +1393,7 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSubs
}),
}),
groupbox,
// TODO 用户自定义
new CUIConfig({
{"type", "CheckBox"},

@ -64,6 +64,11 @@ class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataSolverBoundaryConditionManager :
signals:
private:
// 粘性模型
int m_Model;
// RANS模型
int m_RNSModel;
// 边界名称
QString m_BoundaryName; // Boundary Name

@ -814,4 +814,12 @@ CUIConfig *CFDStructDataSolverKvislManager::genSteadyRANSKEUIConfig() {
}),
});
return nullptr;
}
}
int CFDStructDataSolverKvislManager::getRNSModel() {
return m_RNSModel;
}
int CFDStructDataSolverKvislManager::getModel() {
return m_Model;
}

@ -85,6 +85,10 @@ class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataSolverKvislManager : public CFDSt
int m_DESModel = 0;
CUIConfig *m_uiConfig = nullptr;
public:
int getRNSModel();
int getModel();
};
#endif // CFDSTRUCTDATASOLVERKvislLMANAGER_H

@ -66,7 +66,7 @@ void CUIComponentLineEdit::setValidator() {
case CUI_DATA_TYPE_DOUBLE: {
qDebug() << m_rangeMin.toInt() << ' ' << m_rangeMax.toInt();
m_lineEdit->setValidator(new QDoubleValidator(m_rangeMin.toDouble(),
m_rangeMax.toDouble(), 10));
m_rangeMax.toDouble(), 10));
break;
}
@ -124,7 +124,7 @@ void CUIComponentLineEdit::showRangeError() {
*
* @param text
*/
void CUIComponentLineEdit::onTextChanged(const QString& text) {
void CUIComponentLineEdit::onTextChanged(const QString &text) {
this->showRangeError();
if (this->inRange(m_lineEdit->text())) {

Loading…
Cancel
Save