yangyin
2025-02-21 b22f76d1a80169a1b124d86c61c24e8032344e27
WinFrmUI/DPumpHydr.WinFrmUI.Volute/¶ÏÃæÉè¼Æ/ViewModel/SectionBundleInfo.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using System.Text;
@@ -27,6 +28,26 @@
                this.R_Right.Add(0);
            }
        }
        public SectionBundleInfo Copy()
        {
            return new SectionBundleInfo
            {
                GaMa_Left = this.GaMa_Left != null ? new List<double>(this.GaMa_Left) : null,
                GaMa_Right = this.GaMa_Right != null ? new List<double>(this.GaMa_Right) : null,
                Area = this.Area != null ? new List<double>(this.Area) : null,
                H = this.H != null ? new List<double>(this.H) : null,
                R_Left = this.R_Left != null ? new List<double>(this.R_Left) : null,
                R_Right = this.R_Right != null ? new List<double>(this.R_Right) : null,
                BaseWidth = this.BaseWidth,
                ShapeType = this.ShapeType,
                V3 = this.V3,
                K3 = this.K3,
                StartSectionNumber = this.StartSectionNumber,
                BaseCircleRadius = this.BaseCircleRadius,
                R_out = this.R_out
            };
        }
        /// <summary>
        /// æˆªé¢å½¢çŠ¶ç±»åž‹ 
        /// </summary>
@@ -37,6 +58,10 @@
        /// </summary>
        public double V3 { get; set; }
        /// <summary>
        /// é€Ÿåº¦ç³»æ•°
        /// </summary>
        public double K3 { get; set; }
        /// <summary>
        /// å¼€å§‹æˆªé¢ç¼–号
        /// </summary>
@@ -72,6 +97,7 @@
            model.R_Right = this.R_Right[index];
            model.ShapeType = this.ShapeType; 
            model.BaseWidth = this.BaseWidth;
            model.SectionArea = this.Area[index];
            model.BaseCircleRadius = this.BaseCircleRadius;
            return model;
        }
@@ -82,15 +108,38 @@
        /// <returns></returns>
        public void FromSectionShapePara(SectionShapePara model)
        {
            var index = model.Index   ;
             this.GaMa_Left[index] = model.Gama_Left ;
             this.GaMa_Right[index] = model.Gama_Right ;
            this.H[index] = model.H;
             this.R_Left[index]= model.R_Left ;
            this.R_Right[index] = model.R_Right ;
            var index = model.Index;
            this.GaMa_Left[index] = model.Gama_Left;
            this.GaMa_Right[index] = model.Gama_Right;
            this.H[index] = model.H;
            this.R_Left[index] = model.R_Left;
            this.R_Right[index] = model.R_Right;
        }
        public void InitialK3(HdrBaseInfo hdr_info, GeomBaseInfo gemo_info)
        {
            //计算并设置K3
            if (hdr_info.ns < 170)
                K3 = Math.Round((69.1549 - 0.446605 * hdr_info.ns + 0.0014497 * hdr_info.ns * hdr_info.ns) / 100, 3);
            else
                K3 = 0.35;//0.347;
            if (hdr_info.ShapeType == 2)
                K3 = Math.Round(K3 * 0.9, 3);//0.8 çޝ形
            //自己添加的,防止双吸泵截面过小
            if (hdr_info.IsSXB)
                K3 = Math.Round(K3 * 0.85, 3);// åŒå¸æ³µ
                                              //排污泵
                                              //if (DesignMode == YSSnxOpen::DesignMode::AssPawuQnshQw1)
                                              //{
                                              //    K3 = K3 * 0.75;
                                              //}
            var g = 9.81;
            this.V3 = Math.Round(K3 * Math.Sqrt(2 * g * hdr_info.H), 2); // è®¡ç®—平均流速
        }
        /// <summary>
        /// 
@@ -106,25 +155,29 @@
            this.R_Left[index] = sectionShapePara.R_Left;
            this.R_Right[index] = sectionShapePara.R_Right;
        }
        /// <summary>
        /// è®¡ç®—平均流速
        /// </summary>
        /// <param name="hdr_info"></param>
        /// <param name="geom_info"></param>
        public static double CalcV3(HdrBaseInfo hdr_info, GeomBaseInfo geom_info)
        {
            //UG里面用的是 m_H应该错了
            var g = 9.81;
            return  Math.Round(geom_info.K3 * Math.Sqrt(2 * g * hdr_info.Q), 2);
        }
        /// <summary>
        /// è®¡ç®—初始化所有参数
        /// </summary>
        /// <param name="hdr_info"></param>
        /// <param name="geom_info"></param>
        /// <param name="v3"></param>
        public void ResetAllParas(HdrBaseInfo hdr_info, GeomBaseInfo geom_info, double v3)
        public void ResetAllParas(HdrBaseInfo hdr_info, GeomBaseInfo geom_info )
        {
            this.R_out = 1500.0;
            if (geom_info.D3 > 1000)
                this.R_out = 6000.0;
            else if (geom_info.D3 > 500)
                this.R_out = 3000.0;
            else if (geom_info.D3 > 300)
                this.R_out = 2000.0;
            else
                this.R_out = 1500.0;
            InitialK3(hdr_info, geom_info);
            this.BaseWidth = geom_info.B3;
            this.BaseCircleRadius = geom_info.D3 / 2;
@@ -135,21 +188,24 @@
            InitialGama(hdr_info, geom_info);
            //
            CalcParaV3(hdr_info, geom_info, v3);
            CalcParaV3(hdr_info, geom_info );
            //
            CheckChamferR();
        }
        public void RecalculateArea(HdrBaseInfo hdr_info, GeomBaseInfo geom_info)
        {
            CalcAllArea(hdr_info, geom_info);
        }
        /// <summary>
        /// V3改了, é‡æ–°è®¡ç®—面积和高度
        /// </summary>
        /// <param name="hdr_info"></param>
        /// <param name="geom_info"></param>
        /// <param name="v3"></param>
        public void CalcParaV3(HdrBaseInfo hdr_info, GeomBaseInfo geom_info, double v3)
        {
            this.V3 = v3;
        public void CalcParaV3(HdrBaseInfo hdr_info, GeomBaseInfo geom_info )
        {
            this.BaseWidth = geom_info.B3;
            this.BaseCircleRadius = geom_info.D3 / 2;
@@ -177,12 +233,12 @@
            this.Area[8] = area8;
            int i = 0;
            // 
            if (geom_info.IsQieYuJiYuan)
            {//隔舌切于基圆
                for (i = StartSectionNumber; i < 8; i++)
                    Area[i] = Math.Round(area8 * (45 * i - geom_info.FAI0) / (360 - geom_info.FAI0), 1);
            }
            else
            //if (geom_info.IsQieYuJiYuan)
            //{//隔舌切于基圆
            //    for (i = StartSectionNumber; i < 8; i++)
            //        Area[i] = Math.Round(area8 * (45 * i - geom_info.FAI0) / (360 - geom_info.FAI0), 1);
            //}
            //else
            {//采用正常切面
                for (i = StartSectionNumber; i < 8; i++)
                    Area[i] = Math.Round(area8 * 45 * i / 360, 1);
@@ -262,11 +318,11 @@
            this.GaMa_Right[1] = m_gama82 - 7;
            if (geom_info.FAI0 > 45)//没有第一端面
            {
                this.GaMa_Left[1] = 0;
                this.GaMa_Right[1] = 0;
            }
            //if (geom_info.FAI0 > 45)//没有第一端面
            //{
            //    this.GaMa_Left[1] = 0;
            //    this.GaMa_Right[1] = 0;
            //}
            return null;
        }
@@ -315,11 +371,11 @@
        {
            //赋值:R1 R2 R3 R4 
            if (this.ShapeType == eSectionShapeType.对称) //type=0:对称梯形
                this.R_Left[8] = Math.Round(geom_info.B3 * 0.55 + 0.5 - 4, 0);
                this.R_Left[8] = Math.Round(geom_info.B3 * 0.55 + 0.5 - 5, 0);
            else if (this.ShapeType == eSectionShapeType.不对称)//type=1:不对称梯形
                this.R_Left[8] = Math.Round(geom_info.B3 * 0.55 + 0.5 - 4, 0);
                this.R_Left[8] = Math.Round(geom_info.B3 * 0.55 + 0.5 - 5, 0);
            else if (this.ShapeType == eSectionShapeType.矩形)//type=2:矩形
                this.R_Left[8] = Math.Round(geom_info.B3 * 0.4 + 0.5 - 2, 0);
                this.R_Left[8] = Math.Round(geom_info.B3 * 0.4 + 0.5 - 3, 0);
            if (base_info.IsSXB)
@@ -364,7 +420,7 @@
            //}
            this.R_Right[8] = this.R_Left[8];
            this.R_out = 1000.0;
            //截面R1 å’Œ R4的减少角度 DecreaseR
            double DecreaseR = 0.5;
@@ -391,7 +447,11 @@
            for (int index = 7; index >= 1; index--)
            {
                this.R_Left[index] = this.R_Left[index + 1] - DecreaseR;
                if (this.R_Left[index] < 1)
                    this.R_Left[index] = 1;
                this.R_Right[index] = this.R_Right[index + 1] - DecreaseR;
                if (this.R_Right[index] < 1)
                    this.R_Right[index] = 1;
            }
        }
@@ -400,17 +460,38 @@
        /// </summary>
        private void CheckChamferR()
        {
            for (int index = 7; index >= 1; index--)
            for (int index = 8; index >= 1; index--)
            { 
                if (this.R_Left[index] > (this.H[index] + 1))
                    this.R_Left[index] = Math.Round(this.H[index] * 0.85 - 1, 0);
                if (this.R_Right[index] > (this.H[index] + 1))
                    this.R_Right[index] = Math.Round(this.H[index] * 0.85 - 1, 0);
                if (this.R_Left[index] < 2)
                    this.R_Left[index] = 2;
                if (this.R_Right[index] < 2)
                    this.R_Right[index] = 2;
                for (int k = 0; k < 10; k++)
                {
                    bool isChange = false;
                    if (this.R_Left[index] * (1+Math.Sin(this.GaMa_Left[index]*Math.PI/180)) > this.H[index] - 3)
                    {
                        isChange = true;
                        this.R_Left[index] = (this.H[index] - 3 )/(1 + Math.Sin(this.GaMa_Left[index] * Math.PI / 180));
                    }
                    if (this.R_Right[index] * (1 + Math.Sin(this.GaMa_Right[index] * Math.PI / 180)) > this.H[index] - 3)
                    {
                        isChange = true;
                        this.R_Right[index] = (this.H[index] - 3) / (1 + Math.Sin(this.GaMa_Right[index] * Math.PI / 180));
                    }
                    if (isChange)
                        continue;
                    else
                        break;
                }
                if (this.R_Left[index] < 1)
                    this.R_Left[index] = 1;
                if (this.R_Right[index] < 1)
                    this.R_Right[index] = 1;
            }
        }