tangxu
2024-10-22 537630aed77940b8b741361deca78cbeb6f37087
添加 SectionBaseInfoViewModel
已修改1个文件
已添加2个文件
311 ■■■■■ 文件已修改
WinFrmUI/DPumpHydr.WinFrmUI.Volute/基本参数/ViewModel/GeomBaseInfo.cs 104 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/DPumpHydr.WinFrmUI.Volute/基本参数/ViewModel/HdrBaseInfo.cs 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/DPumpHydr.WinFrmUI.Volute/断面设计/ViewModel/SectionBaseInfo.cs 183 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/DPumpHydr.WinFrmUI.Volute/»ù±¾²ÎÊý/ViewModel/GeomBaseInfo.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,104 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DPumpHydr.WinFrmUI.Volute.ViewModel
{
    public class GeomBaseInfo
    {
  //      D3min=D3max=D3=0.0;
        //b3min=b3max=b3=0.0;
        //FAI0=FAI0min=FAI0max=0.0;
        //K3=0.0;
        public double D3 { get;set;}
        public double D3_Min { get; set; }
        public double D3_Max { get; set; }
        public double B3 { get; set; }
        public double B3_Min { get; set; }
        public double B3_Max { get; set; }
        public double FAI0 { get; set; }
        public double FAI0_Min { get; set; }
        public double FAI0_Max { get; set; }
        public double K3 { get; set; }
        /// <summary>
        /// è¿žæŽ¥çš„æ‚¬æŒ‚体最大处直径
        /// </summary>
        public double XgtBodyMaxDia { get; set; }
        /// <summary>
        /// 1. éš”舌切于基圆   0 é‡‡ç”¨æ­£å¸¸åˆ‡é¢
        /// </summary>
        public bool IsQieYuJiYuan { get; set; }
        /// <summary>
        ///
        /// </summary>
        /// <param name="base_info"></param>
        public void Calc(HdrBaseInfo base_info)
        {
            //计算并设置K3
            if (base_info.ns < 170)
                K3 = (69.1549 - 0.446605 * base_info.ns + 0.0014497 * base_info.ns * base_info.ns) / 100;
            else
                K3 = 0.35;//0.347;
            if (base_info.ShapeType == 2)
                K3 = K3 * 0.9;//0.8 çޝ形
            //自己添加的,防止双吸泵截面过小
            if (base_info.IsSXB)
                K3 = K3 * 0.85;// åŒå¸æ³µ
                               //排污泵
                               //if (DesignMode == YSSnxOpen::DesignMode::AssPawuQnshQw1)
                               //{
                               //    K3 = K3 * 0.75;
                               //}
            this.D3 = Math.Round(Math.Max(1.05 * base_info.D2, XgtBodyMaxDia) + 2);
            //计算并设置b3
            if (base_info.B2 <= 7)
                this.B3 = base_info.B2 * 3;
            if (base_info.B2 <= 32 && base_info.B2 > 7)
                this.B3 = base_info.B2 * 2;
            if (base_info.B2 > 32 && base_info.B2 <= 60)
                this.B3 = base_info.B2 * 1.5;
            if (base_info.B2 > 60)
                this.B3 = base_info.B2 * 1.2;
            this.B3_Min = base_info.B2 * 1.1;
            this.B3_Max = base_info.B2 * 3.5;
            //计算并设置FAIO
            if (base_info.ns < 100)
            {
                this.FAI0 = 25 + Math.Round(base_info.ns / 20,1);
                this.FAI0_Min = 25.0;
                this.FAI0_Max = 30.0;
            }
            if (base_info.ns >= 100 && base_info.ns < 200)
            {
                this.FAI0 = 30 + Math.Round((base_info.ns - 100) / 12.5, 1);
                this.FAI0_Min = 30.0;
                this.FAI0_Max = 38.0;
            }
            if (base_info.ns >= 200 && base_info.ns < 300)
            {
                this.FAI0 = 38 + Math.Round((base_info.ns - 200) / 50, 1);
                this.FAI0_Min = 38.0;
                this.FAI0_Max = 40.0;
            }
            if (base_info.ns > 300)
            {
                this.FAI0 = 42;
                this.FAI0_Min = 40.0;
                this.FAI0_Max = 45.0;
            }
        }
    }
}
WinFrmUI/DPumpHydr.WinFrmUI.Volute/»ù±¾²ÎÊý/ViewModel/HdrBaseInfo.cs
@@ -3,15 +3,39 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static DPumpHydr.WinFrmUI.RLT.Util.RoundInt;
namespace DPumpHydr.WinFrmUI.Volute.ViewModel
{
    public class HdrBaseInfo
    {
        /// <summary>
        /// å½¢çŠ¶ç±»åž‹ 0 æ—‹è½¬åž‹   1 åŒèœ—壳型  2 çŽ¯åž‹  3准旋转型
        /// </summary>
        public int ShapeType { get; set; }
        public double Q { get; set; }
        public double H { get; set; }
        public double n { get; set; }
        public double D2 { get; set; }
        public double B2 { get; set; }
        /// <summary>
        /// æ˜¯å¦æ˜¯åŒå¸æ³µ
        /// </summary>
        public bool IsSXB { get; set; }
        /// <summary>
        /// æ¯”转速
        /// </summary>
        public double ns { get; set; }
        /// <summary>
        /// è®¡ç®—比转速
        /// </summary>
        public void CalcNs()
        {
            var calc_q = this.Q  ;
            if(IsSXB) calc_q = this.Q / 2;
            ns = Math.Round( 3.65 * n * Math.Sqrt(calc_q / 3600) / Math.Pow(this.H, 0.75),2);
        }
    }
}
WinFrmUI/DPumpHydr.WinFrmUI.Volute/¶ÏÃæÉè¼Æ/ViewModel/SectionBaseInfo.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,183 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DPumpHydr.WinFrmUI.Volute.ViewModel
{
    public class SectionBaseInfo
    {
        /// <summary>
        /// æˆªé¢å½¢çŠ¶ç±»åž‹  å¯¹ç§° ä¸å¯¹ç§° çŸ©å½¢
        /// </summary>
        public int ShapeType { get; set; }
        /// <summary>
        /// å¹³å‡æµé€Ÿ
        /// </summary>
        public double V3 { get; set; }
        /// <summary>
        /// å¼€å§‹æˆªé¢ç¼–号
        /// </summary>
        public int StartSectionNumber { get; set; }
        public List<double> GaMa1 { get; set; }
        public List<double> GaMa2
        {
            get; set;
        }
        public List<double> Area { get; set; }
        /// <summary>
        /// è®¡ç®—平均流速
        /// </summary>
        /// <param name="hdr_info"></param>
        /// <param name="geom_info"></param>
        public void CalcV3(HdrBaseInfo hdr_info, GeomBaseInfo geom_info)
        {
            //UG里面用的是 m_H应该错了
            var g = 9.81;
            this.V3 = Math.Round(geom_info.K3 * Math.Sqrt(2 * g * hdr_info.Q), 2);
        }
        public void CalcArea(HdrBaseInfo hdr_info, GeomBaseInfo geom_info, double v3)
        {
            this.V3 = v3;
            var area8 = hdr_info.Q * 1000000 / (3600 * v3);
            int i = 0;
            if (this.Area == null)
            {
                this.GaMa1 = new List<double>(10);
                this.GaMa2 = new List<double>(10);
                this.Area = new List<double>(10);
                for (i = 0; i < 10; i++)
                {
                    this.GaMa1.Add(0);
                    this.GaMa2.Add(0);
                    this.Area.Add(0);
                }
            }
            this.Area[8] = area8;
            if (geom_info.IsQieYuJiYuan)
            {//隔舌切于基圆
                for (i = StartSectionNumber; i < 8; i++)
                    Area[i] = area8 * (45 * i - geom_info.FAI0) / (360 - geom_info.FAI0);
            }
            else
            {//采用正常切面
                for (i = StartSectionNumber; i < 8; i++)
                    Area[i] = area8 * 45 * i / 360;
            }
            if (StartSectionNumber == 2)
                Area[1] = Area[2];
            Area[0] = Area[1];
        }
        /// <summary>
        /// åˆå§‹åŒ–形状类型
        /// </summary>
        /// <param name="hdr_info"></param>
        /// <param name="geom_info"></param>
        /// <param name="shapeType"></param>
        public void IntialShapeType(HdrBaseInfo hdr_info, GeomBaseInfo geom_info, int shapeType)
        {
            this.ShapeType = shapeType;
            double m_gama81, m_gama82;
            switch (shapeType)
            {
                case 0:
                    m_gama81 = 15.0;
                    m_gama82 = 15.0;
                    break;
                case 1:
                    m_gama81 = 15.0;
                    m_gama82 = 30.0;
                    break;
                case 2:
                    m_gama81 = 0.0;
                    m_gama82 = 0.0;
                    break;
                default:
                    m_gama81 = 0.0;
                    m_gama82 = 0.0;
                    break;
            }
            InitialGama(hdr_info, geom_info, m_gama81, m_gama82);//设置gama r1 /gama r2
        }
        /// <summary>
        /// åˆå§‹åŒ–gama
        /// </summary>
        /// <returns></returns>
        public string InitialGama(HdrBaseInfo hdr_info, GeomBaseInfo geom_info, double m_gama81, double m_gama82)
        {
            if (this.GaMa1 == null)
            {
                this.GaMa1 = new List<double>(10);
                this.GaMa2 = new List<double>(10);
                this.Area = new List<double>(10);
                for (int i = 0; i < 10; i++)
                {
                    this.GaMa1.Add(0);
                    this.GaMa2.Add(0);
                    this.Area.Add(0);
                }
            }
            if (ShapeType == 2)//断面形状:矩形
            {
                for (int i = 0; i < GaMa1.Count; i++)
                {
                    this.GaMa1[i] = 0;
                    this.GaMa2[i] = 0;
                }
                return null;
            }
            if ((m_gama81 < 8.0) || (m_gama82 < 8.0))
            {
                return "输入的第8断面的角度过小,请重新输入";
            }
            this.GaMa1[8] = m_gama81;
            this.GaMa1[8] = m_gama82;
            this.GaMa1[7] = m_gama81 - 1;
            this.GaMa1[7] = m_gama82 - 1;
            this.GaMa1[6] = m_gama81 - 2;
            this.GaMa1[6] = m_gama82 - 2;
            this.GaMa1[5] = m_gama81 - 3;
            this.GaMa1[5] = m_gama82 - 3;
            this.GaMa1[4] = m_gama81 - 4;
            this.GaMa1[4] = m_gama82 - 4;
            this.GaMa1[3] = m_gama81 - 5;
            this.GaMa1[3] = m_gama82 - 5;
            this.GaMa1[2] = m_gama81 - 6;
            this.GaMa1[2] = m_gama82 - 6;
            this.GaMa1[1] = m_gama81 - 7;
            this.GaMa1[1] = m_gama82 - 7;
            if (geom_info.FAI0 > 45)//没有第一端面
            {
                this.GaMa1[1] = 0;
                this.GaMa1[1] = 0;
            }
            return null;
        }
    }
}