/// <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()); }
/// <summary> /// 能量关;湍流关;边界条件设置 /// 调用该方法时采用 命名参数调用 /// 例如: void func(int x, int y=2) { Console.WrinteLine(x+y);} func(y:3,x:2; /// 因为该方法的参数都要默认值,每次调用只有一个参数参与计算,因此只需给一个指定的参数传值即可 /// </summary> /// <param name="vi">速度入口参数</param> /// <param name="pi">压力入口参数</param> /// <param name="mi">质量流入口参数</param> /// <param name="po">压力出口参数</param> /// <param name="mo">质量流出口参数</param> /// <returns>TUI命令</returns> public string Set_OFFOFF(BCP_OFFOFF.VI vi = null, BCP_OFFOFF.PI pi = null, BCP_OFFOFF.MI mi = null, BCP_OFFOFF.PO po = null, BCP_OFFOFF.MO mo = null) { string TUI = null; BoundaryConditionImp BC = new BoundaryConditionImp(); IEnOFF_ViscousOFF iBCSet = BC; if (vi != null) { TUI = iBCSet.VI(vi.boundaryName, vi.velocityMethod, vi.referenceFrame, vi.velocityMagnitude, vi.gaugePressure, vi.xyzDirctionOrComponent); } else if (pi != null) { TUI = iBCSet.PI(pi.boundaryName, pi.referenceFrame, pi.directionMethond, pi.guageTotalPressure, pi.guageInitialPressure, pi.xyzDirection); } else if (mi != null) { TUI = iBCSet.MI(mi.boundaryName, mi.referenceFrame, mi.massFlowMethond, mi.dirctionMethond, mi.massFlowRateOrFlux, mi.initialGaugePress, mi.averageFlux, mi.xyzDirection); } else if (po != null) { TUI = iBCSet.PO(po.boundaryName, po.referenceFrame, po.bfDirectionM, po.bfPressure, po.gaugePressure, po.isCheck, po.xyzDirection, po.massFlowParameter); } else if (mo != null) { TUI = iBCSet.MO(mo.boundaryName, mo.massFlowMethond, mo.directionMethod, mo.massRateOrFlux, mo.averageMassFlux, mo.xyzDirection); } return(TUI); }
/// <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()); }