示例#1
0
        /// <summary>
        /// 压力出口
        /// </summary>
        /// <param name="boundaryName">边界名</param>
        /// <param name="referenceFrame">参考框架</param>
        /// <param name="bfDirectionM">回流方向方法</param>
        /// <param name="bfPressure">回流压力类型</param>
        /// <param name="gaugePressure">表压</param>
        /// <param name="isCheck">复选情况</param>
        /// <param name="xyzDirection">[xyz方向矢量],bfdm为DirectionVector时,需要在指定</param>
        /// <param name="massFlowParameter">[目标质量流率的参数],目标质量流率复选时,需要在指定</param>
        /// <returns>TUI命令</returns>
        string IEnOFF_ViscousOFF.PO(string boundaryName, ReferenceFrame referenceFrame, BackflowDirectionMethond bfDirectionM, BackflowPressure bfPressure, string gaugePressure, PO_MomentumCheck isCheck, float[] xyzDirection = null, float[] massFlowParameter = null)
        {
            string        bounaryType = BoundaryTypeE.pressure_outlet.ToString();
            StringBuilder sb          = new StringBuilder();

            if (bfDirectionM == BackflowDirectionMethond.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 " + gaugePressure + " ");

            if ((int)bfDirectionM == 0)
            {
                sb.Append("y y n " + xyzDirection[0].ToString() + " n " + xyzDirection[1].ToString() + " n " + xyzDirection[2].ToString() + " ");
            }
            else if ((int)bfDirectionM == 1)
            {
                sb.Append("n y ");
            }
            else
            {
                sb.Append("n n y ");
            }

            if (bfPressure == 0)
            {
                sb.Append("y ");
            }
            else
            {
                sb.Append("n y ");
            }


            if (isCheck.RadialEquilibriumPD)
            {
                sb.Append("y ");
            }
            else
            {
                sb.Append("n ");
            }
            if (isCheck.AverageP)
            {
                sb.Append("y ");
            }
            else
            {
                sb.Append("n ");
            }
            if (isCheck.TargetMassFlow)
            {
                sb.Append("y n " + massFlowParameter[0].ToString() + " n " + massFlowParameter[1].ToString() + " n " + massFlowParameter[2].ToString() + " ");
            }
            else
            {
                sb.Append("n ");
            }

            return(sb.ToString());
        }
示例#2
0
        /// <summary>
        /// 压力出口
        /// </summary>
        /// <param name="boundaryName">边界名</param>
        /// <param name="referenceFrame">参考框架</param>
        /// <param name="bfDirectionM">回流方向方法</param>
        /// <param name="bfPressure">回流压力类型</param>
        /// <param name="gaugePressure">表压</param>
        /// <param name="isCheck">复选情况</param>
        /// <param name="turbulenceSet">湍流设置</param>
        /// <param name="temperature">热量温度设置</param>
        /// <param name="speciesMassFractions">组分质量分数设置</param>
        /// <param name="xyzDirection">[xyz方向矢量],bfdm为DirectionVector时,需要在指定</param>
        /// <param name="massFlowParameter">[目标质量流率的参数],目标质量流率复选时,需要在指定</param>
        /// <returns>TUI命令</returns>
        string IEnON_ViscousON_RadiationOFF_SpeciesON.PO(string boundaryName, ReferenceFrame referenceFrame, BackflowDirectionMethond bfDirectionM, BackflowPressure bfPressure, string gaugePressure, PO_MomentumCheck isCheck, TurbulenceSet turbulenceSet, string temperature, List <string> speciesMassFractions, float[] xyzDirection, float[] massFlowParameter)
        {
            string        bounaryType = BoundaryTypeE.pressure_outlet.ToString();
            StringBuilder sb          = new StringBuilder();

            if (bfDirectionM == BackflowDirectionMethond.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 " + gaugePressure + " ");

            //热量TUI
            sb.Append("n " + temperature + " ");

            if ((int)bfDirectionM == 0)
            {
                sb.Append("y y n " + xyzDirection[0].ToString() + " n " + xyzDirection[1].ToString() + " n " + xyzDirection[2].ToString() + " ");
            }
            else if ((int)bfDirectionM == 1)
            {
                sb.Append("n y ");
            }
            else
            {
                sb.Append("n n y ");
            }

            //湍流TUI
            sb.Append(TurbulenceSetTUI(turbulenceSet));

            //组分TUI
            sb.Append("n ");
            foreach (string specieMassFractions in speciesMassFractions)
            {
                sb.Append("n " + specieMassFractions + " ");
            }

            if (bfPressure == 0)
            {
                sb.Append("y ");
            }
            else
            {
                sb.Append("n y ");
            }


            if (isCheck.RadialEquilibriumPD)
            {
                sb.Append("y ");
            }
            else
            {
                sb.Append("n ");
            }
            if (isCheck.AverageP)
            {
                sb.Append("y ");
            }
            else
            {
                sb.Append("n ");
            }
            if (isCheck.TargetMassFlow)
            {
                sb.Append("y n " + massFlowParameter[0].ToString() + " n " + massFlowParameter[1].ToString() + " n " + massFlowParameter[2].ToString() + " ");
            }
            else
            {
                sb.Append("n ");
            }

            return(sb.ToString());
        }
        /// <summary>
        /// 更新控件值
        /// </summary>
        private void DataUpdateAction()
        {
            if (this.cb_ReferenceFrame.SelectedIndex == 0)
            {
                this.referenceFrame = ReferenceFrame.Absolute;
            }
            else
            {
                this.referenceFrame = ReferenceFrame.Relative;
            }

            if (cb_BackflowDirection.SelectedIndex == 0)
            {
                this.bfDirectionM = BackflowDirectionMethond.DirectionVector;
                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()) };
            }
            else if (cb_BackflowDirection.SelectedIndex == 1)
            {
                this.bfDirectionM = BackflowDirectionMethond.NormalToBoundary;
            }
            else
            {
                this.bfDirectionM = BackflowDirectionMethond.FromNeighboringCell;
            }

            if (this.cb_BackflowPressure.SelectedIndex == 0)
            {
                this.bfPressure = BackflowPressure.TotalPressure;
            }
            else
            {
                this.bfPressure = BackflowPressure.StaticPressure;
            }

            this.gaugePressure = this.tb_GaugePressure.Text.ToString();

            isCheck = new PO_MomentumCheck();
            if (ckb_RadialEP.Checked)
            {
                isCheck.RadialEquilibriumPD = true;
            }
            if (ckb_AverageP.Checked)
            {
                isCheck.AverageP = true;
            }
            if (ckb_TargetMassFlow.Checked)
            {
                isCheck.TargetMassFlow = true;
                this.massFlowParameter = new float[] { Convert.ToSingle(this.tb_TargetMassFlow.Text.ToString()),
                                                       Convert.ToSingle(this.tb_UpPressure.Text.ToString()), Convert.ToSingle(this.tb_LowPressure.Text.ToString()) };
            }

            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();
        }