private void DataUpdateActive() { if (this.cb_ReferenceFrame.SelectedIndex == 0) { this.referenceFrame = ReferenceFrame.Absolute; } else { this.referenceFrame = ReferenceFrame.Relative; } if (this.cb_BackflowDirection.SelectedIndex == 0) { this.directionMethond = PI_DirectionMethond.DirectionVector; } else { this.directionMethond = PI_DirectionMethond.NormalToBoundary; } this.guageTotalPressure = this.tb_GaugeTotalPressure.Text.ToString(); this.guageInitialPressure = this.tb_InitialGaugePressure.Text.ToString(); this.turbulenceSet = new TurbulenceSet(); turbulenceSet.turbulenceOrder = TurbulenceOrder.SecondOrder; if (this.cb_TurbulenceMethod.SelectedIndex == 0) { turbulenceSet.secondOrder_TurbulenceMethod = SecondOrder_TurbulenceMethod.KAndEpsilon; } else if (this.cb_TurbulenceMethod.SelectedIndex == 1) { turbulenceSet.secondOrder_TurbulenceMethod = SecondOrder_TurbulenceMethod.IntensityAndLengthScale; } else if (this.cb_TurbulenceMethod.SelectedIndex == 2) { turbulenceSet.secondOrder_TurbulenceMethod = SecondOrder_TurbulenceMethod.IntensityAndViscosityRatio; } else { turbulenceSet.secondOrder_TurbulenceMethod = SecondOrder_TurbulenceMethod.IntensityAndHydraulicDiameter; } turbulenceSet.TurbulenceP1 = this.tb_TurbulenceP1.Text.ToString(); turbulenceSet.TurbulenceP2 = this.tb_TurbulenceP2.Text.ToString(); this.xyzDirection = new float[] { Convert.ToSingle(this.tb_FlowDirection_X.Text.ToString()), Convert.ToSingle(this.tb_FlowDirection_Y.Text.ToString()), Convert.ToSingle(this.tb_FlowDirection_Z.Text.ToString()) }; }
/// <summary> /// 质量流入口 /// </summary> /// <param name="boundaryName">边界名</param> /// <param name="referenceFrame">参考框架</param> /// <param name="massFlowMethond">质量流方法</param> /// <param name="dirctionMethond">指定方向方法</param> /// <param name="massFlowRateOrFlux">质量流率或质量流量</param> /// <param name="initialGaugePress">初始表压</param> /// <param name="turbulenceSet">湍流设置</param> /// <param name="temperature">热量温度设置</param> /// <param name="speciesMassFractions">组分质量分数设置</param> /// <param name="averageFlux">[平均质量流量]根据质量流方法确定该值是否为null</param> /// <param name="xyzDirection">[xyz方向矢量]根据指定方向方法确定确定该值是否为null</param> /// <returns>TUI命令</returns> string IEnON_ViscousON_RadiationOFF_SpeciesON.MI(string boundaryName, ReferenceFrame referenceFrame, MassFlowMethond massFlowMethond, PI_DirectionMethond directionMethond, string massFlowRateOrFlux, string initialGaugePress, TurbulenceSet turbulenceSet, string temperature, List <string> speciesMassFractions, string averageFlux, float[] xyzDirection) { string bounaryType = BoundaryTypeE.mass_flow_inlet.ToString(); StringBuilder sb = new StringBuilder(); if (massFlowMethond == MassFlowMethond.MassFluxWithAverageMassFlux) { if (averageFlux == null) { MessageBox.Show("当前质量流方法,averageFlux不能为null"); } } if (directionMethond == PI_DirectionMethond.DirectionVector) { if (xyzDirection == null) { MessageBox.Show("当前指定方向的方法,xyzDirction不可为null"); return(null); } } sb.Append(m_boundaryConditionInitialTUI + bounaryType + " " + boundaryName + " "); if ((int)referenceFrame == 0) { sb.Append("y "); } else { sb.Append("n y "); } if ((int)massFlowMethond == 0) { sb.Append("y " + "n " + massFlowRateOrFlux + " "); } else if ((int)massFlowMethond == 1) { sb.Append("n y " + "n " + massFlowRateOrFlux + " "); } else { sb.Append("n n y n " + massFlowRateOrFlux + " " + averageFlux + " "); } //热量TUI sb.Append("n " + temperature + " "); sb.Append("n " + initialGaugePress + " "); if (directionMethond == 0) { sb.Append("y y n " + xyzDirection[0].ToString() + " n " + xyzDirection[1].ToString() + " n " + xyzDirection[2].ToString() + " "); } else { sb.Append("n y "); } //湍流TUI string TUI = TurbulenceSetTUI(turbulenceSet); sb.Append(TUI); //组分TUI sb.Append("n "); foreach (string specieMassFractions in speciesMassFractions) { sb.Append("n " + specieMassFractions + " "); } return(sb.ToString()); }
/// <summary> /// 设置压力入口边界条件 /// </summary> /// <param name="boundaryName">边界名</param> /// <param name="referenceFrame">参考框架</param> /// <param name="directionMethond">指定方向的方法</param> /// <param name="guageTotalPressure">总表压</param> /// <param name="guageInitialPressure">初始表压</param> /// <param name="turbulenceSet">湍流设置</param> /// <param name="temperature">热量温度设置</param> /// <param name="speciesMassFractions">组分质量分数设置</param> /// <param name="xyzDirection">[xyz方向矢量] 指定方向方法为矢量时,此值不能为空</param> /// <returns>TUI命令</returns> string IEnON_ViscousON_RadiationOFF_SpeciesON.PI(string boundaryName, ReferenceFrame referenceFrame, PI_DirectionMethond directionMethond, string guageTotalPressure, string guageInitialPressure, TurbulenceSet turbulenceSet, string temperature, List <string> speciesMassFractions, float[] xyzDirection) { string bounaryType = BoundaryTypeE.pressure_inlet.ToString(); StringBuilder sb = new StringBuilder(); if (directionMethond == PI_DirectionMethond.DirectionVector) { if (xyzDirection == null) { MessageBox.Show("当前指定方向的方法,xyzDirction不可为null"); return(null); } } sb.Append(m_boundaryConditionInitialTUI + bounaryType + " " + boundaryName + " "); if ((int)referenceFrame == 0) { sb.Append("y "); } else { sb.Append("n y "); } sb.Append("n " + guageTotalPressure + " n " + guageInitialPressure + " "); //热量TUI sb.Append("n " + temperature + " "); if ((int)directionMethond == 0) { sb.Append("y y n " + xyzDirection[0].ToString() + " n " + xyzDirection[1].ToString() + " n " + xyzDirection[2].ToString() + " "); } else { sb.Append("n y "); } //湍流TUI string TUI = TurbulenceSetTUI(turbulenceSet); sb.Append(TUI); //组分TUI sb.Append("n "); foreach (string specieMassFractions in speciesMassFractions) { sb.Append("n " + specieMassFractions + " "); } return(sb.ToString()); }
/// <summary> /// 质量流入口 /// </summary> /// <param name="boundaryName">边界名</param> /// <param name="referenceFrame">参考框架</param> /// <param name="massFlowMethond">质量流方法</param> /// <param name="dirctionMethond">指定方向方法</param> /// <param name="massFlowRateOrFlux">质量流率或质量流量</param> /// <param name="initialGaugePress">初始表压</param> /// <param name="turbulenceSet">湍流设置</param> /// <param name="averageFlux">[平均质量流量]根据质量流方法确定该值是否为null</param> /// <param name="xyzDirection">[xyz方向矢量]根据指定方向方法确定确定该值是否为null</param> /// <returns>TUI命令</returns> string IEnOFF_ViscousON.MI(string boundaryName, ReferenceFrame referenceFrame, MassFlowMethond massFlowMethond, PI_DirectionMethond dirctionMethond, string massFlowRateOrFlux, string initialGaugePress, TurbulenceSet turbulenceSet, string averageFlux, float[] xyzDirection) { StringBuilder sb = new StringBuilder(); BoundaryConditionImp BC = new BoundaryConditionImp(); IEnOFF_ViscousOFF iEnOFF_ViscousOFF = BC; //动量TUI string TUI = iEnOFF_ViscousOFF.MI(boundaryName, referenceFrame, massFlowMethond, dirctionMethond, massFlowRateOrFlux, initialGaugePress, averageFlux, xyzDirection); sb.Append(TUI); //湍流TUI TUI = TurbulenceSetTUI(turbulenceSet); sb.Append(TUI); return(sb.ToString()); }
/// <summary> /// 设置压力入口边界条件 /// </summary> /// <param name="boundaryName">边界名</param> /// <param name="referenceFrame">参考框架</param> /// <param name="directionMethond">指定方向的方法</param> /// <param name="guageTotalPressure">总表压</param> /// <param name="guageInitialPressure">初始表压</param> /// <param name="turbulenceSet">湍流设置</param> /// <param name="xyzDirection">[xyz方向矢量] 指定方向方法为矢量时,此值不能为空</param> /// <returns>TUI命令</returns> string IEnOFF_ViscousON.PI(string boundaryName, ReferenceFrame referenceFrame, PI_DirectionMethond directionMethond, string guageTotalPressure, string guageInitialPressure, TurbulenceSet turbulenceSet, float[] xyzDirection) { StringBuilder sb = new StringBuilder(); BoundaryConditionImp BC = new BoundaryConditionImp(); IEnOFF_ViscousOFF iEnOFF_ViscousOFF = BC; //动量TUI string TUI = iEnOFF_ViscousOFF.PI(boundaryName, referenceFrame, directionMethond, guageTotalPressure, guageInitialPressure, xyzDirection); sb.Append(TUI); //湍流TUI TUI = TurbulenceSetTUI(turbulenceSet); sb.Append(TUI); return(sb.ToString()); }
/// <summary> /// 质量流入口 /// </summary> /// <param name="boundaryName">边界名</param> /// <param name="referenceFrame">参考框架</param> /// <param name="massFlowMethond">质量流方法</param> /// <param name="dirctionMethond">指定方向方法</param> /// <param name="massFlowRateOrFlux">质量流率或质量流量</param> /// <param name="initialGaugePress">初始表压</param> /// <param name="averageFlux">[平均质量流量]根据质量流方法确定该值是否为null</param> /// <param name="xyzDirection">[xyz方向矢量]根据指定方向方法确定确定该值是否为null</param> /// <returns></returns> string IEnOFF_ViscousOFF.MI(string boundaryName, ReferenceFrame referenceFrame, MassFlowMethond massFlowMethond, PI_DirectionMethond directionMethond, string massFlowRateOrFlux, string initialGaugePress, string averageFlux = null, float[] xyzDirection = null) { string bounaryType = BoundaryTypeE.mass_flow_inlet.ToString(); StringBuilder sb = new StringBuilder(); if (massFlowMethond == MassFlowMethond.MassFluxWithAverageMassFlux) { if (averageFlux == null) { MessageBox.Show("当前质量流方法,averageFlux不能为null"); } } if (directionMethond == PI_DirectionMethond.DirectionVector) { if (xyzDirection == null) { MessageBox.Show("当前指定方向的方法,xyzDirction不可为null"); return(null); } } sb.Append(m_boundaryConditionInitialTUI + bounaryType + " " + boundaryName + " "); if ((int)referenceFrame == 0) { sb.Append("y "); } else { sb.Append("n y "); } if ((int)massFlowMethond == 0) { sb.Append("y " + "n " + massFlowRateOrFlux + " "); } else if ((int)massFlowMethond == 1) { sb.Append("n y " + "n " + massFlowRateOrFlux + " "); } else { sb.Append("n n y n " + massFlowRateOrFlux + " " + averageFlux + " "); } sb.Append("n " + initialGaugePress + " "); if (directionMethond == 0) { sb.Append("y y n " + xyzDirection[0].ToString() + " n " + xyzDirection[1].ToString() + " n " + xyzDirection[2].ToString() + " "); } else { sb.Append("n y "); } return(sb.ToString()); }
/// <summary> /// 设置压力入口边界条件 /// </summary> /// <param name="boundaryName">边界名</param> /// <param name="referenceFrame">参考框架</param> /// <param name="directionMethond">指定方向的方法</param> /// <param name="guageTotalPressure">总表压</param> /// <param name="guageInitialPressure">初始表压</param> /// <param name="xyzDirection">[xyz方向矢量] 指定方向方法为矢量时,此值不能为空</param> /// <returns>TUI命令</returns> string IEnOFF_ViscousOFF.PI(string boundaryName, ReferenceFrame referenceFrame, PI_DirectionMethond directionMethond, string guageTotalPressure, string guageInitialPressure, float[] xyzDirection = null) { string bounaryType = BoundaryTypeE.pressure_inlet.ToString(); StringBuilder sb = new StringBuilder(); if (directionMethond == PI_DirectionMethond.DirectionVector) { if (xyzDirection == null) { MessageBox.Show("当前指定方向的方法,xyzDirction不可为null"); return(null); } } sb.Append(m_boundaryConditionInitialTUI + bounaryType + " " + boundaryName + " "); if ((int)referenceFrame == 0) { sb.Append("y "); } else { sb.Append("n y "); } sb.Append("n " + guageTotalPressure + " n " + guageInitialPressure + " "); if ((int)directionMethond == 0) { sb.Append("y y n " + xyzDirection[0].ToString() + " n " + xyzDirection[1].ToString() + " n " + xyzDirection[2].ToString() + " "); } else { sb.Append("n y "); } return(sb.ToString()); }