using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DPumpHydr.WinFrmUI.Volute.ViewModel
{
public class SectionBaseInfo
{
///
/// 截面形状类型
///
public eSectionShapeType ShapeType { get; set; }
///
/// 平均流速
///
public double V3 { get; set; }
///
/// 开始截面编号
///
public int StartSectionNumber { get; set; }
public List GaMa1 { get; set; }
public List GaMa2
{
get; set;
}
public List Area { get; set; }
///
/// 计算平均流速
///
///
///
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(10);
this.GaMa2 = new List(10);
this.Area = new List(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];
}
///
/// 初始化形状类型
///
///
///
///
public void IntialShapeType(HdrBaseInfo hdr_info, GeomBaseInfo geom_info, eSectionShapeType shapeType)
{
this.ShapeType = shapeType;
double m_gama81, m_gama82;
switch (shapeType)
{
case eSectionShapeType.对称:
m_gama81 = 15.0;
m_gama82 = 15.0;
break;
case eSectionShapeType.不对称:
m_gama81 = 15.0;
m_gama82 = 30.0;
break;
case eSectionShapeType.矩形:
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
}
///
/// 初始化gama
///
///
public string InitialGama(HdrBaseInfo hdr_info, GeomBaseInfo geom_info, double m_gama81, double m_gama82)
{
if (this.GaMa1 == null)
{
this.GaMa1 = new List(10);
this.GaMa2 = new List(10);
this.Area = new List(10);
for (int i = 0; i < 10; i++)
{
this.GaMa1.Add(0);
this.GaMa2.Add(0);
this.Area.Add(0);
}
}
if (ShapeType == eSectionShapeType.矩形)//断面形状:矩形
{
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;
}
}
}