private void DataUpdateAction() { if (this.cb_MsssFlowMethod.SelectedIndex == 0) { this.massFlowMethond = MassFlowMethond.MassFlowRate; this.massRateOrFlux = this.tb_massFlowRate.Text.ToString(); } else if (this.cb_MsssFlowMethod.SelectedIndex == 1) { this.massFlowMethond = MassFlowMethond.MassFlowFlux; this.massRateOrFlux = this.tb_massFlowFlux.Text.ToString(); } else { this.massFlowMethond = MassFlowMethond.MassFluxWithAverageMassFlux; this.averageMassFlux = this.tb_averageFlux.Text.ToString(); } if (this.cb_Direction.SelectedIndex == 0) { this.directionMethod = MO_DirectionMethod.DirectionVector; } else { this.directionMethod = MO_DirectionMethod.OutwardNormal; } 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="massFlowMethond">指定质量流方法</param> /// <param name="directionMethod">指定方向方法</param> /// <param name="massRateOrFlux">质量流率或者质量流通量(根据massFlowMethond参数值确定)</param> /// <param name="averageMassFlux">[平均质量流通量]massFlowMethond为MassFluxWithAverageMassFlux时 指定</param> /// <param name="xyzDirection">[方向分量] directionMethod为DirectionVector时指定</param> /// <returns>TUI命令</returns> string IEnON_ViscousON_RadiationOFF_SpeciesON.MO(string boundaryName, MassFlowMethond massFlowMethond, MO_DirectionMethod directionMethod, string massRateOrFlux, string averageMassFlux, float[] xyzDirection) { StringBuilder sb = new StringBuilder(); BoundaryConditionImp BC = new BoundaryConditionImp(); IEnOFF_ViscousOFF iEnOFF_ViscousOFF = BC; //动量TUI string TUI = iEnOFF_ViscousOFF.MO(boundaryName, massFlowMethond, directionMethod, massRateOrFlux, averageMassFlux, xyzDirection); sb.Append(TUI); return(sb.ToString()); }
/// <summary> /// 质量出口 /// </summary> /// <param name="boundaryName">边界名</param> /// <param name="massFlowMethond">指定质量流方法</param> /// <param name="directionMethod">指定方向方法</param> /// <param name="massRateOrFlux">质量流率或者质量流通量(根据massFlowMethond参数值确定)</param> /// <param name="averageMassFlux">[平均质量流通量]massFlowMethond为MassFluxWithAverageMassFlux时 指定</param> /// <param name="xyzDirection">[方向分量] directionMethod为DirectionVector时指定</param> /// <returns>TUI命令</returns> string IEnOFF_ViscousON.MO(string boundaryName, MassFlowMethond massFlowMethond, MO_DirectionMethod directionMethod, string massRateOrFlux, string averageMassFlux, float[] xyzDirection) { //质量出口没有湍流项,因此和湍流没有打开的代码一样,直接调用即可。 StringBuilder sb = new StringBuilder(); BoundaryConditionImp BC = new BoundaryConditionImp(); IEnOFF_ViscousOFF iEnOFF_ViscousOFF = BC; //动量TUI string TUI = iEnOFF_ViscousOFF.MO(boundaryName, massFlowMethond, directionMethod, massRateOrFlux, averageMassFlux, xyzDirection); sb.Append(TUI); return(sb.ToString()); }
/// <summary> /// 质量出口 /// </summary> /// <param name="boundaryName">边界名</param> /// <param name="massFlowMethond">指定质量流方法</param> /// <param name="directionMethod">指定方向方法</param> /// <param name="massRateOrFlux">质量流率或者质量流通量(根据massFlowMethond参数值确定)</param> /// <param name="averageMassFlux">[平均质量流通量]massFlowMethond为MassFluxWithAverageMassFlux时 指定</param> /// <param name="xyzDirection">[方向分量] directionMethod为DirectionVector时指定</param> /// <returns>TUI命令</returns> string IEnOFF_ViscousOFF.MO(string boundaryName, MassFlowMethond massFlowMethond, MO_DirectionMethod directionMethod, string massRateOrFlux, string averageMassFlux = null, float[] xyzDirection = null) { string bounaryType = BoundaryTypeE.mass_flow_outlet.ToString(); StringBuilder sb = new StringBuilder(); if (massFlowMethond == MassFlowMethond.MassFluxWithAverageMassFlux) { if (averageMassFlux == null) { MessageBox.Show("当前质量流方法,averageFlux不能为null"); } } if (directionMethod == MO_DirectionMethod.DirectionVector) { if (xyzDirection == null) { MessageBox.Show("当前指定方向的方法,xyzDirction不可为null"); return(null); } } sb.Append(m_boundaryConditionInitialTUI + bounaryType + " " + boundaryName + " "); sb.Append("y "); if ((int)massFlowMethond == 0) { sb.Append("y n " + massRateOrFlux + " "); } else if ((int)massFlowMethond == 1) { sb.Append("n y n " + massRateOrFlux + " "); } else { sb.Append("n n y n " + massRateOrFlux + " " + averageMassFlux + " "); } if ((int)directionMethod == 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()); }