计算公式提交

This commit is contained in:
2026-03-12 11:16:02 +08:00
parent 8e884679fc
commit 1cebfc1811
3 changed files with 87 additions and 19 deletions

View File

@@ -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