using System.Collections.Generic;
using System.Linq;
namespace PBS.WinFrmUI.Hydro.Dispatch
{
///
///
///
public class CalculatorBase
{
///
/// 初始化机泵列表
///
protected bool BuildMachineList(List simuCalcPumps, out List machines, out string errInfo)
{
machines = null;
errInfo = null;
machines = new List();
foreach (var pump in simuCalcPumps)
{
var machineDetail = new Model.MachineDetailEx(pump);
machines.Add(machineDetail);
}
return true;
}
#region 计算能耗
///
/// 计算千吨能耗
///
/// 功率kW
/// 瞬时流量m³/h
/// kW·h/km³
public static double CalculateWP(double power, double flow)
{
if (flow < 0.1)
return 0;
return power / flow * 1000;
}
///
/// 计算单位能耗
///
/// 功率kW
/// 瞬时流量m³/h
/// 扬程m
/// kW·h/km³
public static double CalculateUWP(double p, double q, double h)
{
if (q < 0.1)
return default;
if (h < 0.1)
return default;
return p / q / h * 1000;
}
#endregion
}
}