计算公式

This commit is contained in:
2026-03-10 15:05:12 +08:00
parent 57df5647a7
commit 8e884679fc
2 changed files with 1519 additions and 235 deletions

View File

@@ -221,6 +221,26 @@ namespace CapMachine.Wpf.PPCalculation
); );
/********************************************************************************
* 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
);
/****************************************************************** /******************************************************************
* compute the transport properties of thermal conductivity and * compute the transport properties of thermal conductivity and
* viscosity as functions of temperature, density, and composition * viscosity as functions of temperature, density, and composition

File diff suppressed because it is too large Load Diff