| | |
| | | private const double _valve_minorloss_default = 0.3d; //阀门默认局阻系数 |
| | | private const double _resistance_minorloss_default = 9d;//阻件默认局阻系数 |
| | | private const double _blunthead_minorloss_default = 0.1d;//闷头局部阻力系数 |
| | | private const double _cooling_coefficient_default = 100000d;//冷却塔流量系数 |
| | | |
| | | /// <summary> |
| | | /// 修复参数 |
| | | /// </summary> |
| | | public static void RepairParas(this Yw.Model.HydroModelInfo hydroInfo, HydroPropStatusHelper propStatusHelper, out string msg) |
| | | public static void RepairParas |
| | | ( |
| | | this Yw.Model.HydroModelInfo hydroInfo, |
| | | HydroPropStatusHelper propStatusHelper, |
| | | out string msg |
| | | ) |
| | | { |
| | | msg = string.Empty; |
| | | if (hydroInfo == null) |
| | |
| | | |
| | | #endregion |
| | | |
| | | #region 冷却塔 |
| | | |
| | | if (hydroInfo.Coolings != null && hydroInfo.Coolings.Count > 0) |
| | | { |
| | | foreach (var cooling in hydroInfo.Coolings) |
| | | { |
| | | if (cooling.Coefficient < 1) |
| | | { |
| | | cooling.Coefficient = _cooling_coefficient_default; |
| | | propStatusHelper.UpdatePropStatus(cooling.Code, nameof(cooling.Coefficient), ePropStatus.Abnormal, $"【流量系数】数据异常,使用默认值[{_cooling_coefficient_default}]修复"); |
| | | } |
| | | if (cooling.Caliber < 1) |
| | | { |
| | | var link = allLinks.Find(x => x.StartCode == cooling.Code || x.EndCode == cooling.Code); |
| | | if (link != null) |
| | | { |
| | | if (link is HydroPipeInfo pipe) |
| | | { |
| | | if (pipe.Diameter > 0) |
| | | { |
| | | cooling.Caliber = pipe.Diameter; |
| | | propStatusHelper.UpdatePropStatus(cooling.Code, nameof(cooling.Caliber), ePropStatus.Abnormal, $"【口径】数据异常,使用相邻管道修复"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | #region 装置计算 |
| | | |
| | | /// <summary> |
| | | /// 获取扬程 |
| | | /// 获取开始压力(m) |
| | | /// </summary> |
| | | public static double GetHead(this Yw.Model.HydroModelInfo hydroInfo) |
| | | public static double GetStartHead(this Yw.Model.HydroModelInfo hydroInfo) |
| | | { |
| | | if (hydroInfo == null) |
| | | { |
| | |
| | | } |
| | | } |
| | | } |
| | | return startHeadValue; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取结束压力(m) |
| | | /// </summary> |
| | | public static double GetEndHead(this Yw.Model.HydroModelInfo hydroInfo) |
| | | { |
| | | if (hydroInfo == null) |
| | | { |
| | | return default; |
| | | } |
| | | double endHeadValue = 0; |
| | | var allNodeList = hydroInfo.GetAllNodes(); |
| | | if (allNodeList != null && allNodeList.Count > 0) |
| | |
| | | }); |
| | | if (endSource == null) |
| | | { |
| | | endSource = allSourceList.Matching(new List<string>() |
| | | endSource = allNodeList.Matching(new List<string>() |
| | | { |
| | | Yw.Hydro.Flags.水源, |
| | | Yw.Hydro.Flags.末端 |
| | |
| | | } |
| | | } |
| | | } |
| | | return endHeadValue; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取扬程 |
| | | /// </summary> |
| | | public static double GetHead(this Yw.Model.HydroModelInfo hydroInfo) |
| | | { |
| | | if (hydroInfo == null) |
| | | { |
| | | return default; |
| | | } |
| | | var startHeadValue = GetStartHead(hydroInfo); |
| | | var endHeadValue = GetEndHead(hydroInfo); |
| | | return endHeadValue - startHeadValue; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取总管结束压力(绝对压力) |
| | | /// </summary> |
| | | public static double? GetPipeEndHead(this Yw.Model.HydroModelInfo hydroInfo, Dictionary<string, HydroCalcuVisualResult> allCalcuVisualDict) |
| | | { |
| | | if (hydroInfo == null) |
| | | { |
| | | return default; |
| | | } |
| | | if (allCalcuVisualDict == null || allCalcuVisualDict.Count < 1) |
| | | { |
| | | return default; |
| | | } |
| | | var allNodeList = hydroInfo.GetAllNodes(); |
| | | if (allNodeList == null || allNodeList.Count < 1) |
| | | { |
| | | return default; |
| | | } |
| | | var node = allNodeList.Matching(new List<string>() |
| | | { |
| | | Yw.Hydro.Flags.总管, |
| | | Yw.Hydro.Flags.出口, |
| | | Yw.Hydro.Flags.默认 |
| | | }); |
| | | if (node == null) |
| | | { |
| | | node = allNodeList.Matching(new List<string>() |
| | | { |
| | | Yw.Hydro.Flags.总管, |
| | | Yw.Hydro.Flags.出口 |
| | | }); |
| | | } |
| | | if (node == null) |
| | | { |
| | | return default; |
| | | } |
| | | |
| | | var calcuVisualResult = allCalcuVisualDict.GetValue(node.Code); |
| | | if (calcuVisualResult == null) |
| | | { |
| | | return default; |
| | | } |
| | | var calcuValue = calcuVisualResult.GetCalcuValue(Yw.Hydro.VisualCalcuProp.CalcuHead); |
| | | if (calcuValue == null) |
| | | { |
| | | return default; |
| | | } |
| | | return Math.Round(calcuValue.Value, 2); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取总管结束压力(绝对压力) |
| | | /// </summary> |
| | | public static double? GetPipeEndHead(this Yw.Model.HydroModelInfo hydroInfo, HydroCalcuResult calcuResult) |
| | | { |
| | | return GetPipeEndHead(hydroInfo, calcuResult?.GetVisualDict()); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取总管压力(绝对压力) |
| | | /// </summary> |
| | | public static double? GetPipeHead(this Yw.Model.HydroModelInfo hydroInfo, HydroCalcuResult calcuResult) |
| | |
| | | { |
| | | return default; |
| | | } |
| | | return Math.Round(calcuValue.Value, 2); |
| | | var endHeadValue = calcuValue.Value; |
| | | var startHeadValue = GetStartHead(hydroInfo); |
| | | return Math.Round(endHeadValue - startHeadValue, 2); |
| | | } |
| | | |
| | | #endregion |