Ejemplo n.º 1
0
        /// <summary>
        /// 设置速度入口边界条件
        /// </summary>
        /// <param name="boundaryName">边界名</param>
        /// <param name="velocityMethod">速度方法</param>
        /// <param name="referenceFrame">参考框架</param>
        /// <param name="velocityMagnitude">速度大小</param>
        /// <param name="gaugePressure">初始表压</param>
        /// <param name="turbulenceSet">湍流设置</param>
        /// <param name="temperature">热量温度设置</param>
        /// <param name="speciesMassFractions">组分质量分数设置</param>
        /// <param name="xyzDirctionOrComponent ">[xyz方向或者xyz速度分量](根据速度方法而定,如果速度方法选择:大小和方向则该参数代表速度方向;如果速度方法选择:速度分量的矢量和则该参数代表速度分量(m/s),否则默认为null)</param>
        /// <returns>TUI命令</returns>
        string IEnON_ViscousON_RadiationOFF_SpeciesON.VI(string boundaryName, VelocityMethod velocityMethod, ReferenceFrame referenceFrame, string velocityMagnitude, string gaugePressure, TurbulenceSet turbulenceSet, string temperature, List <string> speciesMassFractions, float[] xyzDirctionOrComponent)
        {
            StringBuilder sb = new StringBuilder();

            BoundaryConditionImp BC = new BoundaryConditionImp();
            IEnOFF_ViscousOFF    iEnOFF_ViscousOFF = BC;
            //动量TUI
            string TUI = iEnOFF_ViscousOFF.VI(boundaryName, velocityMethod, referenceFrame, velocityMagnitude, gaugePressure, xyzDirctionOrComponent);

            sb.Append(TUI);

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

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

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

            return(sb.ToString());
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 设置速度入口边界条件
        /// </summary>
        /// <param name="boundaryType">边界类型</param>
        /// <param name="boundaryName">边界名</param>
        /// <param name="velocityMethod">速度方法</param>
        /// <param name="referenceFrame">参考框架</param>
        /// <param name="velocityMagnitude">速度大小</param>
        /// <param name="gaugePressure">初始表压</param>
        /// <param name="xyzDirctionOrComponent ">[xyz方向或者xyz速度分量](根据速度方法而定,如果速度方法选择:大小和方向则该参数代表速度方向;如果速度方法选择:速度分量的矢量和则该参数代表速度分量(m/s),否则默认为null)</param>
        /// <returns>TUI命令</returns>
        string IEnOFF_ViscousOFF.VI(string boundaryName, VelocityMethod velocityMethod, ReferenceFrame referenceFrame, string velocityMagnitude, string gaugePressure, float[] xyzDirctionOrComponent = null)
        {
            string boundaryType = BoundaryTypeE.velocity_inlet.ToString();

            if ((int)velocityMethod == 0 || (int)velocityMethod == 1)
            {
                if (xyzDirctionOrComponent == null)
                {
                    MessageBox.Show("当前速度方法,xyzDirctionOrComponent不可为null");
                    return(null);
                }
            }

            StringBuilder sb = new StringBuilder();

            sb.Append(m_boundaryConditionInitialTUI + boundaryType + " " + boundaryName + " ");

            if ((int)velocityMethod == 0)
            {
                sb.Append("y ");
            }
            else if ((int)velocityMethod == 1)
            {
                sb.Append("n y");
            }
            else
            {
                sb.Append("n n y ");
            }

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

            if ((int)velocityMethod == 0 || (int)velocityMethod == 2)
            {
                sb.Append("n " + velocityMagnitude + " n " + gaugePressure + " ");
            }
            else
            {
                sb.Append("n " + gaugePressure + " ");
            }

            if ((int)velocityMethod == 0 || (int)velocityMethod == 1)
            {
                sb.Append("y n " + xyzDirctionOrComponent[0].ToString() + " n " + xyzDirctionOrComponent[1].ToString() + " n " + xyzDirctionOrComponent[2].ToString() + " ");
            }
            return(sb.ToString());
        }
Ejemplo n.º 3
0
        private void DataUpdateActive()
        {
            if (this.cb_VelocityMethod.SelectedIndex == 0)
            {
                this.velocityMethod    = VelocityMethod.MagnitudeAndDirection;
                this.velocityMagnitude = this.tb_VelocityMethond1_Magnitude.Text.ToString();
            }
            else if (this.cb_VelocityMethod.SelectedIndex == 1)
            {
                this.velocityMethod = VelocityMethod.Components;
            }
            else
            {
                this.velocityMethod    = VelocityMethod.Magnitude_NormalToBoundary;
                this.velocityMagnitude = this.tb_VelocityMethond3_Magnitude.Text.ToString();
            }

            if (this.cb_ReferenceFrame.SelectedIndex == 0)
            {
                this.referenceFrame = ReferenceFrame.Absolute;
            }
            else
            {
                this.referenceFrame = ReferenceFrame.Relative;
            }

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

            this.xyzDirctionOrComponent = new float[] { Convert.ToSingle(this.tb_VelocityMethond1_X.Text.ToString()),
                                                        Convert.ToSingle(this.tb_VelocityMethond1_Y.Text.ToString()),
                                                        Convert.ToSingle(this.tb_VelocityMethond1_Z.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();
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 设置速度入口边界条件
        /// </summary>
        /// <param name="boundaryName">边界名</param>
        /// <param name="velocityMethod">速度方法</param>
        /// <param name="referenceFrame">参考框架</param>
        /// <param name="velocityMagnitude">速度大小</param>
        /// <param name="gaugePressure">初始表压</param>
        /// <param name="turbulenceSet">湍流设置</param>
        /// <param name="xyzDirctionOrComponent ">[xyz方向或者xyz速度分量](根据速度方法而定,如果速度方法选择:大小和方向则该参数代表速度方向;如果速度方法选择:速度分量的矢量和则该参数代表速度分量(m/s),否则默认为null)</param>
        /// <returns>TUI命令</returns>
        string IEnOFF_ViscousON.VI(string boundaryName, VelocityMethod velocityMethod, ReferenceFrame referenceFrame, string velocityMagnitude, string gaugePressure, TurbulenceSet turbulenceSet, float[] xyzDirctionOrComponent = null)
        {
            StringBuilder sb = new StringBuilder();

            BoundaryConditionImp BC = new BoundaryConditionImp();
            IEnOFF_ViscousOFF    iEnOFF_ViscousOFF = BC;
            //动量TUI
            string TUI = iEnOFF_ViscousOFF.VI(boundaryName, velocityMethod, referenceFrame, velocityMagnitude, gaugePressure, xyzDirctionOrComponent);

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

            return(sb.ToString());
        }
Ejemplo n.º 5
0
 private PointVelocityObservationType GetPointVelocityObservationType(VelocityMethod velocityMethod)
 {
     return(VelocityMethodMap.ContainsKey(velocityMethod)
         ? VelocityMethodMap[velocityMethod]
         : PointVelocityObservationType.Unknown);
 }