1、初始化部分生成json文件

2、json文件中部分内容进行修改
feature/struct-menu-20241023
mzh 3 days ago
parent e563336453
commit 4dbce6b894

@ -29,9 +29,11 @@ CUIConfig *CFDStructDataSolverBasicModelManager::getParamUIConfig() {
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_Rgasmean, {"region", 0, "rgas_mean"});
jsonAdd(dom, m_Gmean, {"region", 0, "gamma"});
jsonAdd(dom, m_Prlmean, {"region", 0, "solver", "turbModel", "RANS", "params", "Prl"});
jsonAdd(dom, m_Prlmean, {"region", 0, "solver", "turbModel", "params", "Prl"});
jsonAdd(dom, m_Prtmean, {"region", 0, "solver", "turbModel", "RANS", "params", "Prt"});
}
@ -45,11 +47,11 @@ void CFDStructDataSolverBasicModelManager::readDataFromDom(rapidjson::Document &
if (temp != QVariant()) {
m_OverlayNetwork = temp.toInt();
}
jsonRead(dom, temp, {"region", 0, "refValue", "rgas_mean"});
jsonRead(dom, temp, {"region", 0, "rgas_mean"});
if (temp != QVariant()) {
m_Rgasmean = temp.toDouble();
}
jsonRead(dom, temp, {"region", 0, "refValue", "gamma"});
jsonRead(dom, temp, {"region", 0, "gamma"});
if (temp != QVariant()) {
m_Gmean = temp.toDouble();
}

@ -47,10 +47,10 @@ class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataSolverBasicModelManager : public
double m_Gmean = 0;
// 层流普朗特数
double m_Prlmean = 0;
double m_Prlmean = 0.72;
// 湍流普朗特数
double m_Prtmean = 0;
double m_Prtmean = 0.9;
CUIConfig *m_uiConfig = nullptr;
};

@ -73,7 +73,8 @@ class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataSolverBoundaryConditionManager :
int m_id = 0;
// 边界名称
QString m_BoundaryName = ""; // Boundary Name
// 翻译器不接受名字为空
QString m_BoundaryName = "1"; // Boundary Name
// 所属计算域
QString m_ComputationalDomain = ""; // Computational Domain

@ -31,6 +31,52 @@ CUIConfig *CFDStructDataSolverInitializationManager::getParamUIConfig() {
void CFDStructDataSolverInitializationManager::saveDataToDom(rapidjson::Document &dom) {
// TODO
// 温度
jsonAdd(dom, 0,
{"region", 0, "initialize", "global", "temp"});
jsonAdd(dom, m_Pressure,
{"region", 0, "initialize", "global", "Press"});
{ // TODO计算得出---------------------------------
// x方向速度
jsonAdd(dom, m_Vx,
{"region", 0, "initialize", "global", "UVer"});
// y方向速度
jsonAdd(dom, m_Vy,
{"region", 0, "initialize", "global", "vVer"});
// z方向速度
jsonAdd(dom, m_Vz,
{"region", 0, "initialize", "global", "wVer"});
// 界面给出
// x方向速度
jsonAdd(dom, m_Vx,
{"region", 0, "initialize", "global", "InDirect", 0});
// y方向速度
jsonAdd(dom, m_Vy,
{"region", 0, "initialize", "global", "InDirect", 1});
// z方向速度
jsonAdd(dom, m_Vz,
{"region", 0, "initialize", "global", "InDirect", 2});
}
// 函数名
jsonAdd(dom, "",
{"region", 0, "initialize", "global", "strFunName"});
// 用户自定义
jsonAdd(dom, 0,
{"region", 0, "initialize", "global", "isUser"});
// 用户文件
jsonAdd(dom, "",
{"region", 0, "initialize", "global", "strUserFile"});
// 用户lua文件函数名
jsonAdd(dom, "",
{"region", 0, "initialize", "global", "funName"});
//
jsonAdd(dom, m_ReferenceValuesFrom,
{"region", 0, "initialize", "global", "ComeId"});
// 静温度
jsonAdd(dom, 0,
{"region", 0, "initialize", "global", "StaticTemper"});
}
void CFDStructDataSolverInitializationManager::readDataFromDom(rapidjson::Document &dom) {
@ -81,13 +127,13 @@ CUIConfig *CFDStructDataSolverInitializationManager::genCylindricalUIConfig() {
{"type", "LineEdit"}, // 展向速度vr
{"name", tr("Vr")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_Vr)},
{"value_origin", QVA_GLOBAL(&m_Vx)},
}),
new CUIConfig({
{"type", "LineEdit"}, // 周向速度Vtheta
{"name", tr("Vtheta")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_Vtheta)},
{"value_origin", QVA_GLOBAL(&m_Vy)},
}),
new CUIConfig({
{"type", "LineEdit"}, // 轴向速度Vz

@ -4,8 +4,8 @@
#ifndef CFDSTRUCTDATASOLVERINITIALIZATIONEMANAGER_H
#define CFDSTRUCTDATASOLVERINITIALIZATIONEMANAGER_H
#include <CFDStructDataManagerBase.h>
#include "CFDStructDataManager_global.h"
#include <CFDStructDataManagerBase.h>
class CUIConfig;
class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataSolverInitializationManager : public CFDStructDataManagerBase {
@ -34,41 +34,27 @@ class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataSolverInitializationManager : pub
int m_CoordinateSystem = 0;
// 密度
double m_Density; // Density
// // μ速度
// double m_MuVelocity; // Mu Velocity
// // v速度
// double m_VVelocity; // V Velocity
// // w速度
// double m_WVelocity; // W Velocity
double m_Density = 0; // Density
// 压强
double m_Pressure; // Pressure
double m_Pressure = 0; // Pressure
// 湍流粘性比
double m_TurbulentViscosityRatio; // Turbulent Viscosity Ratio
double m_TurbulentViscosityRatio = 0; // Turbulent Viscosity Ratio
// 湍流强度
double m_TurbulentIntensity; // Turbulent Intensity
double m_TurbulentIntensity = 0; // Turbulent Intensity
// 笛卡尔坐标系,三轴方向速度
// 展向速度vr
double m_Vr = 0;
// x方向速度
double m_Vx = 0;
// 周向速度Vtheta
double m_Vtheta = 0;
// y方向速度
double m_Vy = 0;
// 轴向速度Vz
// z方向速度
double m_Vz = 0;
//笛卡尔坐标系,三轴方向速度
double m_Vx = 0;
double m_Vy = 0;
// double m_Vz = 0;
};
#endif // CFDSTRUCTDATASOLVERINITIALIZATIONEMANAGER_H

@ -67,8 +67,14 @@ void CFDStructDataSolverNumericalMethodManager::saveDataToDom(rapidjson::Documen
{"region", 0, "numericMethod", "numMethodParm", "fineGridNum"});
jsonAdd(dom, m_turbulentCFL,
{"region", 0, "numericMethod", "numMethodParm", "cfl"});
jsonAdd(dom, m_EntropyCorrectionType,
if (m_EntropyCorrectionType == 0) {
jsonAdd(dom, 1,
{"region", 0, "numericMethod", "numMethodParm", "EntropyFixVal"});
} else if (m_EntropyCorrectionType == 1) {
jsonAdd(dom, 3,
{"region", 0, "numericMethod", "numMethodParm", "EntropyFixVal"});
}
}
void CFDStructDataSolverNumericalMethodManager::readDataFromDom(rapidjson::Document &dom) {

@ -131,9 +131,8 @@ class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataSolverNumericalMethodManager : pu
// 熵修正类型
/**
* @brief m_EntropyCorrectionType
* 0-Harten-Hyman
* 1-Harten-Yee
*
* 1-Harten-Hyman
* 3-Harten-Yee
*/
int m_EntropyCorrectionType = 0;

Loading…
Cancel
Save