物性更改2
一些已知的更改
This commit is contained in:
79
temp_hasco_superheat.cs
Normal file
79
temp_hasco_superheat.cs
Normal file
@@ -0,0 +1,79 @@
|
||||
using System;
|
||||
|
||||
namespace CapMachine.Wpf.PPCalculation
|
||||
{
|
||||
/// <summary>
|
||||
/// 杩囩儹搴?杩囧喎搴﹁绠楀櫒銆? ///
|
||||
/// 璇存槑锛氳绫讳粎璐熻矗灏佽 SATPdll 璋冪敤涓庤绠楀叕寮忥紝淇濇寔涓庡巻鍙叉祦绋嬩竴鑷淬€? /// - 鍘嬪姏鎹㈢畻淇濇寔鍘熼€昏緫锛欱arA * 100.0
|
||||
/// - 娓╁害鎹㈢畻淇濇寔鍘熼€昏緫锛歍sat[K] - 273.15
|
||||
/// - 澶辫触鏃惰繑鍥?0锛堜笌鍘熷厛鍦ㄦ湇鍔′腑鐩存帴鍐?Tag 鐨勮涓轰竴鑷达級
|
||||
/// </summary>
|
||||
public sealed class SuperheatSubcoolCalculator
|
||||
{
|
||||
private readonly object _refpropLock;
|
||||
|
||||
/// <summary>
|
||||
/// 鏋勯€犲嚱鏁般€? /// </summary>
|
||||
/// <param name="refpropLock">REFPROP 鍏ㄥ眬閿侊紙REFPROP DLL 闈炵嚎绋嬪畨鍏紝闇€涓茶鍖栬皟鐢級銆?/param>
|
||||
public SuperheatSubcoolCalculator(object refpropLock)
|
||||
{
|
||||
_refpropLock = refpropLock ?? throw new ArgumentNullException(nameof(refpropLock));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 鎸夋棦鏈夋祦绋嬭绠楄繃鐑害/杩囧喎搴︺€? /// </summary>
|
||||
/// <param name="inhPressBarA">鍚告皵鍘嬪姏锛圔arA锛夈€?/param>
|
||||
/// <param name="inhTempC">鍚告皵娓╁害锛堚剝锛夈€?/param>
|
||||
/// <param name="txvFrPressBarA">鑶ㄨ儉闃€鍓嶅帇鍔涳紙BarA锛夈€?/param>
|
||||
/// <param name="txvFrTempC">鑶ㄨ儉闃€鍓嶆俯搴︼紙鈩冿級銆?/param>
|
||||
/// <param name="superheatK">杩囩儹搴︼紙K锛夈€傚け璐ユ椂涓?0銆?/param>
|
||||
/// <param name="subcoolK">杩囧喎搴︼紙K锛夈€傚け璐ユ椂涓?0銆?/param>
|
||||
public void Calculate(
|
||||
double inhPressBarA,
|
||||
double inhTempC,
|
||||
double txvFrPressBarA,
|
||||
double txvFrTempC,
|
||||
out double superheatK,
|
||||
out double subcoolK)
|
||||
{
|
||||
superheatK = 0.0;
|
||||
subcoolK = 0.0;
|
||||
|
||||
long iErr;
|
||||
long kph = 1;
|
||||
|
||||
double te = 0.0;
|
||||
double te1 = 0.0;
|
||||
double p = 0.0;
|
||||
double p1 = 0.0;
|
||||
double Dl = 0.0;
|
||||
double Dv = 0.0;
|
||||
|
||||
double[] x = new double[20], xliq = new double[20], xvap = new double[20];
|
||||
x[0] = 1.0;
|
||||
|
||||
//p = Convert.ToDouble(textBox2.Text) * 1000.0;//textBox2 Comp.鍚告皵鍘嬪姏锛坘pa锛? p = inhPressBarA * 100.0;// 淇濇寔浣犲師鏈夋祦绋嬶細灏?BarA 褰撲綔 MPa? 鍘嗗彶浠g爜涓?*1000.0锛屼笉鏀瑰彉浣犵殑绠楁硶
|
||||
|
||||
p1 = txvFrPressBarA * 100.0;// 淇濇寔浣犲師鏈夋祦绋? //p1 = Convert.ToDouble(textBox3.Text) * 1000.0;//textBox3 Evap.鑶ㄨ儉闃€鍓嶅帇鍔涳紙Mpa锛? // 缁熶竴鏀惧叆鍚屼竴鎶婇攣涓紝閬垮厤骞跺彂瀵艰嚧鐨?Fortran 璇绘枃浠?鐘舵€佺珵鎬? string herr = new string(' ', 255); long herrLen = 255; iErr = 0;
|
||||
lock (_refpropLock)
|
||||
{
|
||||
IRefProp64.SATPdll(ref p, x, ref kph, ref te, ref Dl, ref Dv, xliq, xvap, ref iErr, ref herr, ref herrLen);
|
||||
}
|
||||
|
||||
if (iErr == 0)
|
||||
superheatK = Math.Abs(inhTempC - (te - 273.15));
|
||||
else
|
||||
superheatK = 0;
|
||||
|
||||
herr = new string(' ', 255); herrLen = 255; iErr = 0;
|
||||
lock (_refpropLock)
|
||||
{
|
||||
IRefProp64.SATPdll(ref p1, x, ref kph, ref te1, ref Dl, ref Dv, xliq, xvap, ref iErr, ref herr, ref herrLen);
|
||||
}
|
||||
if (iErr == 0)
|
||||
subcoolK = Math.Abs(txvFrTempC - (te1 - 273.15));
|
||||
else
|
||||
subcoolK = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user