计算公式提交
This commit is contained in:
@@ -104,6 +104,34 @@ namespace CapMachine.Wpf.PPCalculation
|
||||
);
|
||||
|
||||
|
||||
/***************************************************************************************
|
||||
* General Flash subroutine taking a pressure and entropy.
|
||||
* 用于在给定 P、s(摩尔熵)下求解状态点(等熵压缩出口 h2s 等)。
|
||||
**************************************************************************************/
|
||||
[DllImport(@".\PPCalculation\REFPROP\REFPRP64.DLL", CharSet = CharSet.Ansi)]
|
||||
public static extern void PSFLSHdll
|
||||
(
|
||||
ref double p, // (INPUT) pressure [kPa]
|
||||
ref double s, // (INPUT) entropy [J/mol-K]
|
||||
[MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] double[] z, // (INPUT) overall (bulk) composition [array of mol frac]
|
||||
ref double t, // (OUTPUT) temperature [K]
|
||||
ref double d, // (OUTPUT) overall (bulk) molar density [mol/L]
|
||||
ref double Dl, // (OUTPUT) molar density of liquid phase [mol/L]
|
||||
ref double Dv, // (OUTPUT) molar density of the vapor phase [mol/L]
|
||||
[MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] double[] xliq, // (OUTPUT) composition of liquid phase [array of mol frac]
|
||||
[MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] double[] xvap, // (OUTPUT) composition of vapor phase [array of mol frac]
|
||||
ref double q, // (OUTPUT) vapor quality on a MOLAR basis
|
||||
ref double ee, // (OUTPUT) internal energy [J/mol]
|
||||
ref double h, // (OUTPUT) enthalpy [J/mol]
|
||||
ref double Cv, // (OUTPUT) Cv [J/mol-K]
|
||||
ref double Cp, // (OUTPUT) Cp [J/mol-K]
|
||||
ref double w, // (OUTPUT) speed of sound [m/s]
|
||||
ref long ierr, // (OUTPUT) error flag
|
||||
[MarshalAs(UnmanagedType.VBByRefStr)] ref string herr, // (OUTPUT) error string
|
||||
ref long ln // (INPUT) length of herr
|
||||
);
|
||||
|
||||
|
||||
|
||||
/****************************************************************************************
|
||||
* Open a mixture file (e.g., R410A.mix) and read constituents and mole fractions
|
||||
|
||||
@@ -145,7 +145,7 @@ namespace CapMachine.Wpf.Services
|
||||
|
||||
|
||||
////三电 Sample
|
||||
TagManger.AddTag(new Tag<short>("转速", "转速[rpm]", "Speed", "程序", "VW14100", 100, 0, 1, "rpm", new ShortTagValue(), true) { DecimalPoint = 0,SVAddress= "VW14002" });
|
||||
TagManger.AddTag(new Tag<short>("转速", "转速[rpm]", "Speed", "程序", "VW14100", 100, 0, 1, "rpm", new ShortTagValue(), true) { DecimalPoint = 0, SVAddress = "VW14002" });
|
||||
TagManger.AddTag(new Tag<short>("排气压力", "排气压力[BarA]", "ExPress", "程序", "VW15002", 100, 0, 100, "BarA", new ShortTagValue(), true) { DecimalPoint = 2 });
|
||||
TagManger.AddTag(new Tag<short>("吸气压力", "吸气压力[BarA]", "InhPress", "程序", "VW15004", 100, 0, 100, "BarA", new ShortTagValue(), true) { DecimalPoint = 2 });
|
||||
TagManger.AddTag(new Tag<short>("吸气温度", "吸气温度[℃]", "InhTemp", "程序", "VW15006", 100, 0, 10, "℃", new ShortTagValue(), true) { DecimalPoint = 1 });
|
||||
@@ -158,7 +158,7 @@ namespace CapMachine.Wpf.Services
|
||||
TagManger.AddTag(new Tag<short>("HV[W]", "HV[W]", "HVPw", "程序", "VW15020", 100, 0, 1, "W", new ShortTagValue(), false) { DecimalPoint = 1 });
|
||||
TagManger.AddTag(new Tag<short>("LV[V]", "LV[V]", "LV", "程序", "VW15022", 100, 0, 100, "V", new ShortTagValue(), true) { DecimalPoint = 2 });
|
||||
//TagManger.AddTag(new Tag<short>("LV[A]", "LV[A]", "LVCur", "程序", "VW15024", 100, 0, 1, "A", new ShortTagValue(), false) { DecimalPoint = 1 });
|
||||
TagManger.AddTag(new Tag<short>("LV[A]", "LV[A]", "LVCur", "程序", "VW15024", 100, 0, 1000, "A", new ShortTagValue(), false) { DecimalPoint =3 });
|
||||
TagManger.AddTag(new Tag<short>("LV[A]", "LV[A]", "LVCur", "程序", "VW15024", 100, 0, 1000, "A", new ShortTagValue(), false) { DecimalPoint = 3 });
|
||||
TagManger.AddTag(new Tag<short>("环境温度", "环境温度[℃]", "EnvTemp", "程序", "VW15026", 100, 0, 10, "℃", new ShortTagValue(), true) { DecimalPoint = 1 });
|
||||
//TagManger.AddTag(new Tag<short>("环境湿度", "环境湿度[%]", "EnvRH", "程序", "VW15028", 100, 0, 10, "%", new ShortTagValue(), true) { DecimalPoint = 1 });
|
||||
TagManger.AddTag(new Tag<short>("环境湿度", "环境湿度[%]", "EnvRH", "程序", "VW15028", 100, 0, 10, "%", new ShortTagValue(), true) { DecimalPoint = 1 });
|
||||
@@ -178,7 +178,9 @@ namespace CapMachine.Wpf.Services
|
||||
TagManger.AddTag(new Tag<short>("PTC流量", "PTC流量[L/min]", "PTCFlow", "程序", "VW15054", 100, 0, 10, "L/min", new ShortTagValue(), false) { DecimalPoint = 1 });
|
||||
TagManger.AddTag(new Tag<short>("PTC入水温度", "PTC入水温度[℃]", "PTCEntTemp", "程序", "VW15056", 100, 0, 10, "℃", new ShortTagValue(), false) { DecimalPoint = 1 });
|
||||
TagManger.AddTag(new Tag<short>("PTC出水温度", "PTC出水温度[℃]", "PTCExpTemp", "程序", "VW15058", 100, 0, 10, "℃", new ShortTagValue(), false) { DecimalPoint = 1 });
|
||||
|
||||
|
||||
TagManger.AddTag(new Tag<short>("液冷媒流量", "液冷媒流量[kg/h]", "LiqRefFlow", "程序", "VW15084", 100, 0, 10, "kg/h", new ShortTagValue(), false) { DecimalPoint = 1 });
|
||||
|
||||
TagManger.AddTag(new Tag<short>("通讯Cmp母线电流", "通讯Cmp母线电流[A]", "ComCapBusCur", "程序", "VW14102", 100, 0, 100, "A", new ShortTagValue(), false) { DecimalPoint = 2 });
|
||||
TagManger.AddTag(new Tag<short>("通讯Cmp母线电压", "通讯Cmp母线电压[V]", "ComCapBusVol", "程序", "VW14104", 100, 0, 1, "V", new ShortTagValue(), false) { DecimalPoint = 0 });
|
||||
TagManger.AddTag(new Tag<short>("通讯Cmp逆变器温度", "通讯Cmp逆变器温度[℃]", "ComCapInvTemp", "程序", "VW14106", 100, 0, 1, "℃", new ShortTagValue(), false) { DecimalPoint = 0 });
|
||||
@@ -193,8 +195,18 @@ namespace CapMachine.Wpf.Services
|
||||
TagManger.AddTag(new Tag<short>("通讯PTC膜温", "通讯PTC膜温[℃]", "ComPTCFlmTemp", "程序", "VW14128", 100, 0, 1, "℃", new ShortTagValue(), false) { DecimalPoint = 0 });
|
||||
TagManger.AddTag(new Tag<short>("通讯PTC模块温度", "通讯PTC模块温度[℃]", "ComPTCMdTemp", "程序", "VW14130", 100, 0, 1, "℃", new ShortTagValue(), false) { DecimalPoint = 0 });
|
||||
|
||||
TagManger.AddTag(new Tag<short>("过热度", "过热度[K]", "Superheat", "程序", "VW14132", 100, 0, 1, "K", new ShortTagValue(), false) { DecimalPoint = 1 });
|
||||
TagManger.AddTag(new Tag<short>("过冷度", "过冷度[K]", "Subcooling", "程序", "VW14134", 100, 0, 1, "K", new ShortTagValue(), false) { DecimalPoint = 1 });
|
||||
|
||||
TagManger.AddTag(new Tag<short>("制热量Qh", "制热量Qh[KW]", "HeatingCapacity", "程序", "VW14134", 1000, 0, 1, "K", new ShortTagValue(), false) { DecimalPoint = 1 });
|
||||
TagManger.AddTag(new Tag<short>("压缩机性能系数(制热)", "压缩机性能系数(制热)[K]", "COPHeat", "程序", "VW14134", 1000, 0, 1, "K", new ShortTagValue(), false) { DecimalPoint = 1 });
|
||||
TagManger.AddTag(new Tag<short>("等熵效率ns", "等熵效率ns[%]", "IsentrpEff", "程序", "VW14134", 1000, 0, 1, "K", new ShortTagValue(), false) { DecimalPoint = 1 });
|
||||
TagManger.AddTag(new Tag<short>("制冷量Qc", "制冷量Qc[KW]", "CoolCapacity", "程序", "VW14134", 1000, 0, 1, "K", new ShortTagValue(), false) { DecimalPoint = 1 });
|
||||
TagManger.AddTag(new Tag<short>("压缩机性能系数(制冷)", "压缩机性能系数(制冷)[K]", "COPCool", "程序", "VW14134", 1000, 0, 1, "K", new ShortTagValue(), false) { DecimalPoint = 1 });
|
||||
TagManger.AddTag(new Tag<short>("容积效率nv", "容积效率nv[%]", "VoltricEff", "程序", "VW14134", 1000, 0, 1, "K", new ShortTagValue(), false) { DecimalPoint = 1 });
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
ListHandSwitchData = new List<HandSwitchData>()
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace CapMachine.Wpf.Services
|
||||
public ILogService Logger { get; }
|
||||
public MachineRtDataService MachineRtDataService { get; }
|
||||
public IDialogService DialogService { get; }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 标签中心
|
||||
@@ -58,11 +58,11 @@ namespace CapMachine.Wpf.Services
|
||||
TagManager = MachineRtDataService.TagManger;
|
||||
|
||||
SpeedTag = TagManager.DicTags.GetValueOrDefault("转速[rpm]");
|
||||
|
||||
|
||||
ExPressTag = TagManager.DicTags.GetValueOrDefault("排气压力[BarA]");
|
||||
|
||||
ExTempTag = TagManager.DicTags.GetValueOrDefault("排气温度[℃]");
|
||||
|
||||
|
||||
HVPwTag = TagManager.DicTags.GetValueOrDefault("HV[W]");
|
||||
|
||||
InhPressTag = TagManager.DicTags.GetValueOrDefault("吸气压力[BarA]");
|
||||
@@ -78,7 +78,7 @@ namespace CapMachine.Wpf.Services
|
||||
//TxvFrTempTag = TagManager.DicTags.GetValueOrDefault("膨胀阀前温度[℃]")!;
|
||||
//TxvFrPressTag = TagManager.DicTags.GetValueOrDefault("膨胀阀前压力[BarA]")!;
|
||||
|
||||
TxvFrTempTag = TagManager.DicTags.GetValueOrDefault("SUBCOOL出口温度[℃]");
|
||||
TxvFrTempTag = TagManager.DicTags.GetValueOrDefault("膨胀阀前温度[℃]");
|
||||
|
||||
TxvFrPressTag = TagManager.DicTags.GetValueOrDefault("膨胀阀前压力[BarA]");
|
||||
|
||||
@@ -89,21 +89,28 @@ namespace CapMachine.Wpf.Services
|
||||
VRVTag = TagManager.DicTags.GetValueOrDefault("冷媒流量[kg/h]");
|
||||
|
||||
//润滑油流量
|
||||
|
||||
|
||||
LubeFlowTag = TagManager.DicTags.GetValueOrDefault("润滑油流量[kg/h]");
|
||||
|
||||
|
||||
|
||||
//Cond1TempTag = TagManager.DicTags.GetValueOrDefault("冷凝器出口水温[℃]");
|
||||
//CondInTempTag = TagManager.DicTags.GetValueOrDefault("冷凝器进口温度[℃]");
|
||||
|
||||
//Superheat = TagManager.DicTags.GetValueOrDefault("过热度[K]");
|
||||
//Subcool = TagManager.DicTags.GetValueOrDefault("过冷度[K]");
|
||||
|
||||
|
||||
Superheat = TagManager.DicTags.GetValueOrDefault("过热度[K]");
|
||||
|
||||
|
||||
|
||||
Subcool = TagManager.DicTags.GetValueOrDefault("过冷度[K]");
|
||||
|
||||
HeatingCapacity = TagManager.DicTags.GetValueOrDefault("制热量Qh[KW]");
|
||||
COPHeat = TagManager.DicTags.GetValueOrDefault("压缩机性能系数(制热)[K]");
|
||||
IsentrpEff = TagManager.DicTags.GetValueOrDefault("等熵效率ns[%]");
|
||||
CoolCapacity = TagManager.DicTags.GetValueOrDefault("制冷量Qc[KW]");
|
||||
COPCool = TagManager.DicTags.GetValueOrDefault("压缩机性能系数(制冷)[K]");
|
||||
VoltricEff = TagManager.DicTags.GetValueOrDefault("容积效率nv[%]");
|
||||
|
||||
|
||||
SuperHeatCoolConfig.FluidsPath = ConfigHelper.GetValue("FluidsPath");
|
||||
SuperHeatCoolConfig.Cryogen = ConfigHelper.GetValue("Cryogen");
|
||||
@@ -216,6 +223,15 @@ namespace CapMachine.Wpf.Services
|
||||
/// </summary>
|
||||
public ITag LubeFlowTag { get; set; }
|
||||
|
||||
|
||||
public ITag HeatingCapacity { get; set; }
|
||||
public ITag COPHeat { get; set; }
|
||||
public ITag IsentrpEff { get; set; }
|
||||
public ITag CoolCapacity { get; set; }
|
||||
public ITag COPCool { get; set; }
|
||||
public ITag VoltricEff { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 风量数据-乘以系数的后的最终结果
|
||||
/// </summary>
|
||||
@@ -281,8 +297,8 @@ namespace CapMachine.Wpf.Services
|
||||
kph = 1;
|
||||
|
||||
p1 = (TxvFrPressTag.EngPvValue) * 100.0;// 保持你原有流程
|
||||
//p1 = Convert.ToDouble(textBox3.Text) * 1000.0;//textBox3 Evap.膨胀阀前压力(Mpa)
|
||||
// 统一放入同一把锁中,避免并发导致的 Fortran 读文件/状态竞态
|
||||
//p1 = Convert.ToDouble(textBox3.Text) * 1000.0;//textBox3 Evap.膨胀阀前压力(Mpa)
|
||||
// 统一放入同一把锁中,避免并发导致的 Fortran 读文件/状态竞态
|
||||
string herr = new string(' ', 255); long herrLen = 255; iErr = 0;
|
||||
lock (_refpropLock)
|
||||
{
|
||||
@@ -1082,6 +1098,15 @@ namespace CapMachine.Wpf.Services
|
||||
}
|
||||
|
||||
VolumetricEfficiencyPct = etaV_pct;
|
||||
|
||||
//赋值
|
||||
HeatingCapacity.EngPvValue = HeatingCapacityQh_kW;
|
||||
COPHeat.EngPvValue = COPHeating;
|
||||
IsentrpEff.EngPvValue = IsentropicEfficiencyPct;
|
||||
CoolCapacity.EngPvValue = CoolingCapacityQc_kW;
|
||||
COPCool.EngPvValue = COPCooling;
|
||||
VoltricEff.EngPvValue = VolumetricEfficiencyPct;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1491,12 +1516,15 @@ namespace CapMachine.Wpf.Services
|
||||
displacement_cc = double.NaN;
|
||||
error = string.Empty;
|
||||
|
||||
displacement_cc = 35;
|
||||
return true;
|
||||
|
||||
const string key = "CompressorDisplacementCc";
|
||||
if (!ConfigHelper.IsExist(key))
|
||||
{
|
||||
error = $"未配置压缩机排量,请在 App.config/appSettings 增加 {key}(单位 cc)";
|
||||
return false;
|
||||
}
|
||||
//if (!ConfigHelper.IsExist(key))
|
||||
//{
|
||||
// error = $"未配置压缩机排量,请在 App.config/appSettings 增加 {key}(单位 cc)";
|
||||
// return false;
|
||||
//}
|
||||
|
||||
string v = ConfigHelper.GetValue(key);
|
||||
if (!double.TryParse(v, out displacement_cc))
|
||||
|
||||
Reference in New Issue
Block a user