公式更改版本2603141639
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
|
||||
@@ -254,6 +282,23 @@ namespace CapMachine.Wpf.PPCalculation
|
||||
ref long herrLen
|
||||
);
|
||||
|
||||
/********************************************************************************
|
||||
* Solve for density given T and P using the most robust iterative routine.
|
||||
* This mirrors the LabVIEW TPRHO DLL call path to obtain phase-specific density.
|
||||
********************************************************************************/
|
||||
[DllImport(@".\PPCalculation\REFPROP\REFPRP64.DLL", CharSet = CharSet.Ansi)]
|
||||
public static extern void TPRHOdll
|
||||
(
|
||||
ref double t, // (INPUT) temperature [K]
|
||||
ref double p, // (INPUT) pressure [kPa]
|
||||
[MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] double[] x, // (INPUT) composition [array of mol frac]
|
||||
ref long kph, // (INPUT) phase flag: 1=liquid, 2=vapor
|
||||
ref long kguess, // (INPUT) initial guess: 0=let routine choose
|
||||
ref double D, // (OUTPUT) molar density [mol/L]
|
||||
ref long ierr, // (OUTPUT) error flag: 0=success
|
||||
[MarshalAs(UnmanagedType.VBByRefStr)] ref string herr, // (OUTPUT) error string
|
||||
ref long herrLen
|
||||
);
|
||||
|
||||
|
||||
/***************************************************
|
||||
|
||||
Reference in New Issue
Block a user