CoolProp¶
Pure and pseudo-pure fluids (refrigerants, water, cryogens, light hydrocarbons) from the reference equations of state and transport correlations of the CoolProp library.
DWSIM.Thermodynamics.PropertyPackages.CoolPropPropertyPackage
Assembly DWSIM.Thermodynamics.dll · Object ← PropertyPackage ← CoolPropPropertyPackage
Name in the flowsheet CoolProp · FluentAPI PropertyPackages.CoolProp
Scope¶
The package takes its properties from CoolProp, an open-source C++ library of reference equations of state and transport correlations for pure and pseudo-pure fluids. It is meant for streams of a single fluid where the accuracy of a reference equation matters: refrigeration and heat-pump cycles, organic Rankine cycles, cryogenic gases, CO2, water and steam, and the light hydrocarbons. The literature source of the equation of each fluid is listed in the CoolProp documentation (http://www.coolprop.org).
The package supports the 123 fluids of its list, among them:
| Group | Fluids |
|---|---|
| Refrigerants | R-11 to R-507A, including R-134a, R-32, R-410A, R-404A, R-1234yf, R-1234ze(E) |
| Permanent gases and cryogens | air, nitrogen, oxygen, argon, hydrogen (normal, ortho, para), helium, neon |
| Inorganics | water, heavy water, CO2, CO, ammonia, H2S, SO2, N2O, SF6 |
| Hydrocarbons | methane to n-dodecane, olefins, cyclic and aromatic hydrocarbons |
| Others | alcohols, ethers, siloxanes (MM, MDM, D4 to D6), methyl esters |
A compound is supported when its name is a CoolProp name or alias of one of these fluids, or its CAS
number matches one; any other compound present in a stream stops the calculation with an error. The
refrigerants, siloxanes and other CoolProp fluids are in the CoolProp compound database of DWSIM
(coolprop.xml), under the names CoolProp uses (R134a, R1234yf, ...).
For a pure fluid every property is the CoolProp value: saturation pressure, liquid and vapor density, enthalpy, entropy, heat capacities, viscosity, thermal conductivity and surface tension. Enthalpy and entropy are on the reference state of each CoolProp fluid (for most refrigerants the IIR convention, h = 200 kJ/kg and s = 1 kJ/(kg K) for the saturated liquid at 0 °C), so they differ from the scale of the other packages by a constant.
For a mixture, DWSIM combines the pure-fluid values with mass-fraction averages (enthalpy, entropy, heat capacities and density, and the compressibility factor that follows from it). The phase equilibrium treats both phases as ideal: Raoult's law with the CoolProp vapor pressure of each compound.
Limitations¶
- Mixtures are approximate: no interaction between unlike molecules enters the phase equilibrium or the properties. For refrigerant blends use the pseudo-pure entries (R-404A, R-407C, R-410A, R-507A); for other mixtures use an equation of state such as Peng-Robinson.
- Outside the temperature and pressure limits of a fluid the package extrapolates the CoolProp value, or falls back on the Rackett liquid density and the estimation methods of DWSIM, and writes a warning.
- For pure water with the industrial formulation, use Steam Tables (IAPWS-IF97).
Example¶
This code runs on every build of this site, and the output below is what it printed.
fs = (Flowsheet.Create("CoolPropExample")
.WithCompounds("R134a")
.WithPropertyPackage(PropertyPackages.CoolProp))
# saturated liquid and saturated vapor at 0 C: given the temperature and the vapor
# fraction, the flash finds the saturation pressure
liquid = (fs.AddMaterialStream("Saturated liquid")
.WithTemperature(Q.Celsius(0.0)).WithVaporFraction(0.0)
.SetCompoundMassFlow("R134a", 1.0))
vapor = (fs.AddMaterialStream("Saturated vapor")
.WithTemperature(Q.Celsius(0.0)).WithVaporFraction(1.0)
.SetCompoundMassFlow("R134a", 1.0))
fs.Solve()
sl, sv = liquid.Object.Phases[0].Properties, vapor.Object.Phases[0].Properties
print(f"Saturation pressure at 0 C = {sl.pressure / 1e5:.4f} bar")
print(f"Saturated liquid / vapor density = {sl.density:.1f} / {sv.density:.3f} kg/m3")
print(f"Saturated liquid / vapor h = {sl.enthalpy:.2f} / {sv.enthalpy:.2f} kJ/kg")
print(f"Latent heat at 0 C = {sv.enthalpy - sl.enthalpy:.2f} kJ/kg")
print(f"Liquid viscosity = {sl.viscosity * 1000.0:.4f} mPa s")
Output
Saturation pressure at 0 C = 2.9280 bar
Saturated liquid / vapor density = 1294.8 / 14.428 kg/m3
Saturated liquid / vapor h = 200.00 / 398.60 kJ/kg
Latent heat at 0 C = 198.60 kJ/kg
Liquid viscosity = 0.2665 mPa s
DWSIM 10.2.11.0, generated 2026-10-08.
Property methods¶
How the package calculates each property, as it reports it in PropertyMethodsInfo (the property package editor shows the same list).
| Property | Method |
|---|---|
| Vapor fugacity | Ideal |
| Liquid fugacity | Vapor Pressure |
| Vapor enthalpy, entropy, Cp/Cv | CoolProp |
| Liquid enthalpy, entropy, Cp/Cv | CoolProp |
| Vapor density | CoolProp |
| Liquid density | CoolProp (Rackett outside the limits of the fluid) |
| Vapor viscosity | CoolProp |
| Liquid viscosity | CoolProp |
| Vapor thermal conductivity | CoolProp |
| Liquid thermal conductivity | CoolProp |
| Surface tension | CoolProp (Experimental / Brock-Bird outside the limits of the fluid) |
| Solid density | Experimental Data / User-Defined |
| Solid enthalpy, entropy, Cp/Cv | Experimental Solid Cp / From Liquid Phase Enthalpy + Enthalpy of Fusion |
Default flash algorithm: Universal.
Configuration saved with the flowsheet¶
The package writes its settings to the simulation file (SaveData) and reads them back on load (LoadData). The elements below are the ones this package adds to those of every property package, as written for the example.
This package adds no elements of its own.
Settings common to every property package, as saved for the example
| Element | Value |
|---|---|
Type |
61 characters |
ComponentName |
CoolProp |
ComponentDescription |
|
Tag |
CoolProp |
UseHenryConstants |
true |
AutoEstimateMissingNRTLUNIQUACParameters |
true |
UseImmiscibleListForLiquid2InitialEstimates |
true |
SingleCompoundCheckThreshold |
0.99999 |
OverrideKvalFugCoeff |
false |
OverrideEnthalpyCalculation |
false |
OverrideEntropyCalculation |
false |
LiquidDensityCalculationMode_Subcritical |
Rackett_and_ExpData |
LiquidDensityCalculationMode_Supercritical |
Rackett_and_ExpData |
LiquidDensity_CorrectExpDataForPressure |
true |
LiquidDensity_UsePenelouxVolumeTranslation |
true |
LiquidViscosityCalculationMode_Subcritical |
ExpData |
LiquidViscosityCalculationMode_Supercritical |
Letsou_Stiel |
LiquidViscosity_CorrectExpDataForPressure |
true |
LiquidViscosity_MixingRule |
MoleAverage |
VaporPhaseFugacityCalculationMode |
Ideal |
SolidPhaseFugacityCalculationMethod |
FromLiquidFugacity |
SolidPhaseFugacity_UseIdealLiquidPhaseFugacity |
false |
SolidPhaseEnthalpy_UsesCp |
false |
EnthalpyEntropyCpCvCalculationMode |
LeeKesler |
LiquidEnthalpyEntropyCpCvCalculationMode_EOS |
EOS |
LiquidFugacity_UsePoyntingCorrectionFactor |
true |
ActivityCoefficientModels_IgnoreMissingInteractionParameters |
false |
IgnoreVaporFractionLimit |
false |
IgnoreSalinityLimit |
false |
CalculateAdditionalMaterialStreamProperties |
true |
FlashCalculationApproach |
NestedLoops |
DisplayMissingCompoundPropertiesWarning |
false |
ForcedSolids |
[] |
PropertyOverrides |
{} |
FlashSettings |
36 Setting entries |
Learn more¶
-
User guide
-
Used with
API members¶
Public members declared by this class. Inherited members are documented on the base classes.
Constructors¶
CoolPropPropertyPackage(bool)
| Parameter | Type | Description |
|---|---|---|
comode |
Boolean |
Properties¶
MobileCompatible
Methods¶
AUX_CONDTG(double, double)
| Parameter | Type | Description |
|---|---|---|
T |
Double |
|
P |
Double |
AUX_CONDTL(double, int)
| Parameter | Type | Description |
|---|---|---|
T |
Double |
|
phaseid |
Int32 |
AUX_CPi(string, double)
| Parameter | Type | Description |
|---|---|---|
sub1 |
String |
|
T |
Double |
AUX_HFUSi(string, double)
| Parameter | Type | Description |
|---|---|---|
sub1 |
String |
|
T |
Double |
AUX_LIQ_Cpi(ICompoundConstantProperties, double)
| Parameter | Type | Description |
|---|---|---|
cprop |
ICompoundConstantProperties |
|
T |
Double |
AUX_LIQDENS(double, Array, double, double, bool)
| Parameter | Type | Description |
|---|---|---|
T |
Double |
|
Vx |
Array |
|
P |
Double |
|
Pvp |
Double |
|
FORCE_EOS |
Boolean |
AUX_LIQDENS(double, double, double, int, bool)
| Parameter | Type | Description |
|---|---|---|
T |
Double |
|
P |
Double |
|
Pvp |
Double |
|
phaseid |
Int32 |
|
FORCE_EOS |
Boolean |
AUX_LIQDENSi(ICompound, double)
| Parameter | Type | Description |
|---|---|---|
subst |
ICompound |
|
T |
Double |
AUX_LIQDENSi(ICompoundConstantProperties, double)
| Parameter | Type | Description |
|---|---|---|
cprop |
ICompoundConstantProperties |
|
T |
Double |
AUX_LIQTHERMCONDi(ICompoundConstantProperties, double)
| Parameter | Type | Description |
|---|---|---|
cprop |
ICompoundConstantProperties |
|
T |
Double |
AUX_LIQVISCi(string, double, double)
| Parameter | Type | Description |
|---|---|---|
sub1 |
String |
|
T |
Double |
|
P |
Double |
AUX_PVAPi(int, double)
| Parameter | Type | Description |
|---|---|---|
index |
Int32 |
|
T |
Double |
AUX_PVAPi(string, double)
| Parameter | Type | Description |
|---|---|---|
sub1 |
String |
|
T |
Double |
AUX_SURFTi(ICompoundConstantProperties, double)
| Parameter | Type | Description |
|---|---|---|
constprop |
ICompoundConstantProperties |
|
T |
Double |
AUX_SURFTM(double)
| Parameter | Type | Description |
|---|---|---|
T |
Double |
AUX_TSATi(double, int)
| Parameter | Type | Description |
|---|---|---|
PVAP |
Double |
|
index |
Int32 |
AUX_TSATi(double, string)
| Parameter | Type | Description |
|---|---|---|
PVAP |
Double |
|
subst |
String |
AUX_VAPDENS(double, double)
| Parameter | Type | Description |
|---|---|---|
T |
Double |
|
P |
Double |
AUX_VAPTHERMCONDi(ICompoundConstantProperties, double, double)
| Parameter | Type | Description |
|---|---|---|
cprop |
ICompoundConstantProperties |
|
T |
Double |
|
P |
Double |
AUX_VAPVISCi(ICompoundConstantProperties, double, double)
| Parameter | Type | Description |
|---|---|---|
cprop |
ICompoundConstantProperties |
|
T |
Double |
|
P |
Double |
AUX_VAPVISCMIX(double, double, double)
| Parameter | Type | Description |
|---|---|---|
T |
Double |
|
P |
Double |
|
MM |
Double |
AUX_Z(double[], double, double, PhaseName)
| Parameter | Type | Description |
|---|---|---|
Vx |
Double[] |
|
T |
Double |
|
P |
Double |
|
state |
PhaseName |
DW_CalcCompPartialVolume(Phase, double, double)
| Parameter | Type | Description |
|---|---|---|
phase |
Phase |
|
T |
Double |
|
P |
Double |
DW_CalcCp_ISOL(Phase, double, double)
| Parameter | Type | Description |
|---|---|---|
Phase1 |
Phase |
|
T |
Double |
|
P |
Double |
DW_CalcCv_ISOL(Phase, double, double)
| Parameter | Type | Description |
|---|---|---|
Phase1 |
Phase |
|
T |
Double |
|
P |
Double |
DW_CalcEnergyFlowMistura_ISOL(double, double)
| Parameter | Type | Description |
|---|---|---|
T |
Double |
|
P |
Double |
DW_CalcEnthalpy(Array, double, double, State): Calculates the enthalpy of a mixture.
Calculates the enthalpy of a mixture.
| Parameter | Type | Description |
|---|---|---|
Vx |
Array |
Vector of doubles containing the molar composition of the mixture. |
T |
Double |
Temperature (K) |
P |
Double |
Pressure (Pa) |
st |
State |
State enum indicating the state of the mixture (liquid or vapor). |
DW_CalcEnthalpyDeparture(Array, double, double, State): Calculates the enthalpy departure of a mixture.
Calculates the enthalpy departure of a mixture.
| Parameter | Type | Description |
|---|---|---|
Vx |
Array |
Vector of doubles containing the molar composition of the mixture. |
T |
Double |
Temperature (K) |
P |
Double |
Pressure (Pa) |
st |
State |
State enum indicating the state of the mixture (liquid or vapor). |
DW_CalcEntropy(Array, double, double, State): Calculates the entropy of a mixture.
Calculates the entropy of a mixture.
| Parameter | Type | Description |
|---|---|---|
Vx |
Array |
Vector of doubles containing the molar composition of the mixture. |
T |
Double |
Temperature (K) |
P |
Double |
Pressure (Pa) |
st |
State |
State enum indicating the state of the mixture (liquid or vapor). |
DW_CalcEntropyDeparture(Array, double, double, State): Calculates the entropy departure of a mixture.
Calculates the entropy departure of a mixture.
| Parameter | Type | Description |
|---|---|---|
Vx |
Array |
Vector of doubles containing the molar composition of the mixture. |
T |
Double |
Temperature (K) |
P |
Double |
Pressure (Pa) |
st |
State |
State enum indicating the state of the mixture (liquid or vapor). |
DW_CalcFugCoeff(Array, double, double, State): Calculates fugacity coefficients for the specified composition at the specified conditions.
Calculates fugacity coefficients for the specified composition at the specified conditions.
| Parameter | Type | Description |
|---|---|---|
Vx |
Array |
Vector of doubles containing the molar composition of the mixture. |
T |
Double |
Temperature in K |
P |
Double |
Pressure in Pa |
st |
State |
Mixture state (Liquid or Vapor) |
DW_CalcK_ISOL(Phase, double, double)
| Parameter | Type | Description |
|---|---|---|
Phase1 |
Phase |
|
T |
Double |
|
P |
Double |
DW_CalcMassaEspecifica_ISOL(Phase, double, double, double)
| Parameter | Type | Description |
|---|---|---|
Phase1 |
Phase |
|
T |
Double |
|
P |
Double |
|
Pvp |
Double |
DW_CalcMM_ISOL(Phase, double, double)
| Parameter | Type | Description |
|---|---|---|
Phase1 |
Phase |
|
T |
Double |
|
P |
Double |
DW_CalcPhaseProps(Phase)
| Parameter | Type | Description |
|---|---|---|
Phase |
Phase |
DW_CalcProp(string, Phase): Provides a wrapper function for CAPE-OPEN CalcProp/CalcSingleProp functions.
Provides a wrapper function for CAPE-OPEN CalcProp/CalcSingleProp functions.
| Parameter | Type | Description |
|---|---|---|
property |
String |
The property to be calculated. |
phase |
Phase |
The phase where the property must be calculated for. |
DW_CalcPVAP_ISOL(double)
| Parameter | Type | Description |
|---|---|---|
T |
Double |
DW_CalcTensaoSuperficial_ISOL(Phase, double, double)
| Parameter | Type | Description |
|---|---|---|
Phase1 |
Phase |
|
T |
Double |
|
P |
Double |
DW_CalcTwoPhaseProps(Phase, Phase)
| Parameter | Type | Description |
|---|---|---|
Phase1 |
Phase |
|
Phase2 |
Phase |
DW_CalcViscosidadeDinamica_ISOL(Phase, double, double)
| Parameter | Type | Description |
|---|---|---|
Phase1 |
Phase |
|
T |
Double |
|
P |
Double |
GetCoolPropName(string)
| Parameter | Type | Description |
|---|---|---|
name |
String |
GetListOfSupportedCompounds()
IsCompoundSupported(double, string)
| Parameter | Type | Description |
|---|---|---|
x |
Double |
|
compname |
String |
SupportsComponent(ICompoundConstantProperties)
| Parameter | Type | Description |
|---|---|---|
comp |
ICompoundConstantProperties |
Fields¶
ClassId