| | |
| | | |
| | | private readonly Service.AnalysisConclusion _service_analysis_conclusion = new(); |
| | | private readonly Service.AnalysisDeviation _service_analysis_deviation = new(); |
| | | private readonly Service.AnalysisFactor _service_analysis_factor = new(); |
| | | |
| | | private int _min_open_count;//最小开泵数量 |
| | | private int _max_open_count;//最大开泵数量 |
| | |
| | | exist_limit = true; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (!exist_limit) |
| | | { |
| | | var opt_ana_combine = GetOptAnaCombine |
| | |
| | | //进口水位 |
| | | var inlet_water_level = flag_inlet_water_level_dict[flag]; |
| | | |
| | | //组合修正系数 |
| | | //组合偏差系数 |
| | | var combine_deviation_factor = combine_deviation_factor_dict[flag]; |
| | | var current_target_head = target_head - inlet_water_level + combine_deviation_factor + _sel_opt_pump_head_excess; |
| | | current_target_head = Math.Round(current_target_head, 1); |
| | |
| | | /// <returns></returns> |
| | | public Dictionary<int, List<int[]>> GetSameSectionCombineDict(List<List<int>> same_section_flag_combine_list, int pump_list_count) |
| | | { |
| | | Dictionary<int, List<int[]>> same_section_combine_dict = new(); |
| | | Dictionary<int, List<int[]>> same_section_combine_dict = new(); |
| | | for (int pump_count = 1; pump_count <= pump_list_count; pump_count++) |
| | | { |
| | | same_section_combine_dict[pump_count] = new List<int[]>(); |
| | |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | return same_section_combine_dict; |
| | | } |
| | |
| | | |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #region Expand |
| | | |
| | | /// <summary> |
| | |
| | | return opt; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 获取变频泵列表 根据工况计算 |
| | | /// </summary> |
| | | /// <param name="pumps"></param> |
| | | /// <param name="flag_rpm_dic"></param> |
| | | /// <param name="flag_inlet_water_level_dict"></param> |
| | | /// <param name="flag_head_dic"></param> |
| | | /// <param name="total_flow"></param> |
| | | /// <param name="ues_deviation_factor"></param> |
| | | /// <returns></returns> |
| | | public List<AnaFrePump> GetAnaFrePumpListByWorking( |
| | | List<Model.Pump> pumps, |
| | | Dictionary<int, double> flag_rpm_dic, |
| | | Dictionary<int, double> flag_inlet_water_level_dict, |
| | | Dictionary<int, double> flag_head_dic, |
| | | double total_flow, |
| | | bool ues_deviation_factor = false |
| | | ) |
| | | { |
| | | if (pumps == null || !pumps.Any()) |
| | | { |
| | | return default; |
| | | } |
| | | |
| | | if (flag_rpm_dic == null || !flag_rpm_dic.Any()) |
| | | { |
| | | return default; |
| | | } |
| | | |
| | | var run_flag_list = flag_rpm_dic.Where(x => x.Value > 1).Select(x => x.Key).OrderBy(x => x).ToList(); |
| | | var ana_fre_pump_list = new List<AnaFrePump>(); |
| | | foreach (var flag in run_flag_list) |
| | | { |
| | | var pump = pumps.Find(x => x.Flag == flag); |
| | | if (pump == null) |
| | | continue; |
| | | var rpm = flag_rpm_dic[flag]; |
| | | if (rpm < 1) |
| | | continue; |
| | | |
| | | var curveQH = Curve.PumpCalculateHelper.CalculateSimilarQH(pump.CurveQH, pump.Nr, rpm); |
| | | var curveQP = Curve.PumpCalculateHelper.CalculateSimilarQP(pump.CurveQP, pump.Nr, rpm); |
| | | |
| | | double flow = 0, head = 0; |
| | | if (flag_head_dic != null && flag_head_dic.ContainsKey(pump.Flag)) |
| | | { |
| | | head = flag_head_dic[pump.Flag]; |
| | | } |
| | | |
| | | if (flag_inlet_water_level_dict != null && flag_inlet_water_level_dict.ContainsKey(pump.Flag)) |
| | | { |
| | | head -= flag_inlet_water_level_dict[pump.Flag]; |
| | | } |
| | | |
| | | if (ues_deviation_factor) |
| | | { |
| | | var combine_deviation_factor_dict = GetCombineDeviationFactorDict(total_flow, run_flag_list);//修正组合曲线和模型的偏差扬程 |
| | | if (combine_deviation_factor_dict != null && combine_deviation_factor_dict.ContainsKey(flag)) |
| | | { |
| | | var combine_deviation_factor = combine_deviation_factor_dict[flag]; //组合偏差系数 |
| | | head -= combine_deviation_factor; |
| | | } |
| | | } |
| | | |
| | | flow = curveQH.GetInterPointLastX(head) ?? 0; |
| | | if (flow < 0) |
| | | continue; |
| | | |
| | | |
| | | var fre_pump = new AnaFrePump(); |
| | | fre_pump.Flag = flag; |
| | | fre_pump.Flow = flow; |
| | | fre_pump.Head = head; |
| | | fre_pump.Power = curveQP.GetFitPointY(flow); |
| | | fre_pump.Efficiency = Curve.PumpCalculateHelper.CalculateE(fre_pump.Flow, fre_pump.Head, fre_pump.Power); |
| | | fre_pump.Frequency = rpm / pump.Nr * 50; |
| | | fre_pump.Speed = rpm; |
| | | |
| | | ana_fre_pump_list.Add(fre_pump); |
| | | } |
| | | |
| | | |
| | | return ana_fre_pump_list; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取变频泵列表 根据工况计算 |
| | | /// </summary> |
| | | /// <param name="pumps"></param> |
| | | /// <param name="flag_rpm_dic"></param> |
| | | /// <param name="flag_inlet_water_level_dict"></param> |
| | | /// <param name="flag_flow_dic"></param> |
| | | /// <param name="flag_head_dic"></param> |
| | | /// <param name="flag_curve_head_dic"></param> |
| | | /// <param name="total_flow"></param> |
| | | /// <param name="ues_deviation_factor"></param> |
| | | /// <returns></returns> |
| | | public List<AnaFrePump> GetAnaFrePumpListByWorking( |
| | | List<Model.Pump> pumps, |
| | | Dictionary<int, double> flag_rpm_dic, |
| | | Dictionary<int, double> flag_inlet_water_level_dict, |
| | | Dictionary<int, double> flag_flow_dic, |
| | | Dictionary<int, double> flag_head_dic, |
| | | double total_flow, |
| | | out Dictionary<int, double> flag_curve_head_dic, |
| | | bool ues_deviation_factor = false |
| | | ) |
| | | { |
| | | flag_curve_head_dic = new Dictionary<int, double>(); |
| | | if (pumps == null || !pumps.Any()) |
| | | { |
| | | return default; |
| | | } |
| | | |
| | | if (flag_rpm_dic == null || !flag_rpm_dic.Any()) |
| | | { |
| | | return default; |
| | | } |
| | | |
| | | var run_flag_list = flag_rpm_dic.Where(x => x.Value > 1).Select(x => x.Key).OrderBy(x => x).ToList(); |
| | | var ana_fre_pump_list = new List<AnaFrePump>(); |
| | | foreach (var flag in run_flag_list) |
| | | { |
| | | var pump = pumps.Find(x => x.Flag == flag); |
| | | if (pump == null) |
| | | continue; |
| | | var rpm = flag_rpm_dic[flag]; |
| | | if (rpm < 1) |
| | | continue; |
| | | |
| | | var hz = Math.Round(rpm / pump.Nr * 50, 1); |
| | | var factor = _service_analysis_factor.GetByFlagAndHz(flag, hz); |
| | | |
| | | |
| | | var CurveQH50 = pump.CurveQH; |
| | | var CurveQP50 = pump.CurveQP; |
| | | if (ues_deviation_factor) |
| | | { |
| | | //if (pump.Flag == 22) |
| | | //{ |
| | | // var def_points = CurveQH50.DefinePoints.Select(x => new IStation.Curve.CurvePoint(x.X, x.Y + -0.0398)).ToList(); |
| | | // var update_curve = IStation.Curve.FitHelper.BuildCurveExpress(def_points, eFitType.FourM); |
| | | // CurveQH50 = update_curve; |
| | | //} |
| | | //else |
| | | //if (pump.Flag == 23) |
| | | //{ |
| | | // //4.6 |
| | | // var def_points = CurveQH50.DefinePoints.Select(x => new IStation.Curve.CurvePoint(x.X, x.Y - 2.17)).ToList(); |
| | | // //var def_points = CurveQH50.DefinePoints.Select(x => new IStation.Curve.CurvePoint(x.X, x.Y - 2.8)).ToList(); |
| | | // var update_curve = IStation.Curve.FitHelper.BuildCurveExpress(def_points, eFitType.FourM); |
| | | // CurveQH50 = update_curve; |
| | | //} |
| | | //else if (pump.Flag == 26) |
| | | //{ |
| | | // var def_points = CurveQH50.DefinePoints.Select(x => new IStation.Curve.CurvePoint(x.X, x.Y + 0.0887)).ToList(); |
| | | // var update_curve = IStation.Curve.FitHelper.BuildCurveExpress(def_points, eFitType.FourM); |
| | | // CurveQH50 = update_curve; |
| | | |
| | | //} |
| | | |
| | | var head_diff_factor = 0d; |
| | | if (factor != null) |
| | | { |
| | | head_diff_factor = factor.HeadDeviation ?? 0; |
| | | } |
| | | |
| | | var def_points = CurveQH50.DefinePoints.Select(x => new IStation.Curve.CurvePoint(x.X, x.Y + head_diff_factor)).ToList(); |
| | | var update_curve = IStation.Curve.FitHelper.BuildCurveExpress(def_points, eFitType.FourM); |
| | | CurveQH50 = update_curve; |
| | | } |
| | | |
| | | |
| | | var curveQH = Curve.PumpCalculateHelper.CalculateSimilarQH(CurveQH50, pump.Nr, rpm); |
| | | var curveQP = Curve.PumpCalculateHelper.CalculateSimilarQP(CurveQP50, pump.Nr, rpm); |
| | | |
| | | double flow = 0, head = 0; |
| | | if (flag_head_dic != null && flag_head_dic.ContainsKey(pump.Flag)) |
| | | { |
| | | head = flag_head_dic[pump.Flag]; |
| | | } |
| | | |
| | | if (flag_inlet_water_level_dict != null && flag_inlet_water_level_dict.ContainsKey(pump.Flag)) |
| | | { |
| | | head -= flag_inlet_water_level_dict[pump.Flag]; |
| | | } |
| | | |
| | | if (ues_deviation_factor) |
| | | { |
| | | //var combine_deviation_factor_dict = GetCombineDeviationFactorDict(total_flow, run_flag_list);//修正组合曲线和模型的偏差扬程 |
| | | //if (combine_deviation_factor_dict != null && combine_deviation_factor_dict.ContainsKey(flag)) |
| | | //{ |
| | | // var combine_deviation_factor = combine_deviation_factor_dict[flag]; //组合偏差系数 |
| | | // head -= combine_deviation_factor; |
| | | //} |
| | | } |
| | | |
| | | flow = curveQH.GetInterPointLastX(head) ?? 0; |
| | | if (flow < 0) |
| | | continue; |
| | | |
| | | var working_flow = flag_flow_dic[flag]; |
| | | flag_curve_head_dic[flag] = curveQH.GetFitPointY(working_flow); |
| | | |
| | | var fre_pump = new AnaFrePump(); |
| | | fre_pump.Flag = flag; |
| | | fre_pump.Flow = flow; |
| | | fre_pump.Head = head; |
| | | fre_pump.Power = curveQP.GetFitPointY(flow); |
| | | fre_pump.Efficiency = Curve.PumpCalculateHelper.CalculateE(fre_pump.Flow, fre_pump.Head, fre_pump.Power); |
| | | fre_pump.Frequency = rpm / pump.Nr * 50; |
| | | fre_pump.Speed = rpm; |
| | | |
| | | ana_fre_pump_list.Add(fre_pump); |
| | | |
| | | } |
| | | |
| | | |
| | | return ana_fre_pump_list; |
| | | } |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |
| | | |