CoolProp
6.6.1dev
An open-source fluid property and humid air property database
|
A property provider for incompressible solutions and pure fluids.
This fluid instance is populated using an entry from a JSON file
Definition at line 57 of file IncompressibleFluid.h.
#include <IncompressibleFluid.h>
Public Member Functions | |
IncompressibleFluid () | |
virtual | ~IncompressibleFluid () |
std::string | getName () const |
std::string | get_name () const |
std::string | getDescription () const |
std::string | getReference () const |
double | getTmax () const |
double | getTmin () const |
double | getxmax () const |
double | getxmin () const |
composition_types | getxid () const |
double | getTminPsat () const |
double | getTbase () const |
double | getxbase () const |
void | setName (const std::string &name) |
void | setDescription (const std::string &description) |
void | setReference (const std::string &reference) |
void | setTmax (double Tmax) |
void | setTmin (double Tmin) |
void | setxmax (double xmax) |
void | setxmin (double xmin) |
void | setxid (composition_types xid) |
void | setTminPsat (double TminPsat) |
void | setTbase (double Tbase) |
void | setxbase (double xbase) |
void | setDensity (IncompressibleData density) |
Setters for the coefficients. More... | |
void | setSpecificHeat (IncompressibleData specific_heat) |
void | setViscosity (IncompressibleData viscosity) |
void | setConductivity (IncompressibleData conductivity) |
void | setPsat (IncompressibleData p_sat) |
void | setTfreeze (IncompressibleData T_freeze) |
void | setMass2input (IncompressibleData mass2input) |
Setters for the concentration conversion coefficients. More... | |
void | setVolume2input (IncompressibleData volume2input) |
void | setMole2input (IncompressibleData mole2input) |
void | validate () |
A function to check coefficients and equation types. More... | |
bool | is_pure () |
A function to test the density coefficients for 1D or 2D. More... | |
double | rho (double T, double p, double x) |
Density as a function of temperature, pressure and composition. More... | |
double | c (double T, double p, double x) |
Heat capacities as a function of temperature, pressure and composition. More... | |
double | cp (double T, double p, double x) |
double | cv (double T, double p, double x) |
double | s (double T, double p, double x) |
Entropy as a function of temperature, pressure and composition. More... | |
double | u (double T, double p, double x) |
Internal energy as a function of temperature, pressure and composition. More... | |
double | h (double T, double p, double x) |
Enthalpy as a function of temperature, pressure and composition. More... | |
double | visc (double T, double p, double x) |
Viscosity as a function of temperature, pressure and composition. More... | |
double | cond (double T, double p, double x) |
Thermal conductivity as a function of temperature, pressure and composition. More... | |
double | psat (double T, double x) |
Saturation pressure as a function of temperature and composition. More... | |
double | Tfreeze (double p, double x) |
Freezing temperature as a function of pressure and composition. More... | |
double | drhodTatPx (double T, double p, double x) |
Partial derivative of density. More... | |
double | dsdTatPxdT (double T, double p, double x) |
Partial derivative of entropy. More... | |
double | dhdTatPxdT (double T, double p, double x) |
Partial derivative of enthalpy. More... | |
double | inputFromMass (double T, double x) |
Mass fraction conversion function. More... | |
double | inputFromVolume (double T, double x) |
Volume fraction conversion function. More... | |
double | inputFromMole (double T, double x) |
Mole fraction conversion function. More... | |
double | T_rho (double Dmass, double p, double x) |
Temperature as a function of density, pressure and composition. More... | |
double | T_c (double Cmass, double p, double x) |
Temperature as a function of heat capacities as a function of temperature, pressure and composition. More... | |
double | T_s (double Smass, double p, double x) |
Temperature as a function of entropy as a function of temperature, pressure and composition. More... | |
double | T_u (double Umass, double p, double x) |
Temperature as a function of internal energy as a function of temperature, pressure and composition. More... | |
double | T_h (double Hmass, double p, double x) |
Temperature as a function of enthalpy, pressure and composition. More... | |
double | T_visc (double visc, double p, double x) |
Viscosity as a function of temperature, pressure and composition. More... | |
double | T_cond (double cond, double p, double x) |
Thermal conductivity as a function of temperature, pressure and composition. More... | |
double | T_psat (double psat, double x) |
Saturation pressure as a function of temperature and composition. More... | |
double | x_Tfreeze (double Tfreeze, double p) |
Composition as a function of freezing temperature and pressure. More... | |
bool | checkX (double x) |
Check validity of composition input. More... | |
bool | checkTPX (double T, double p, double x) |
Check validity of temperature, pressure and composition input. More... | |
Protected Member Functions | |
double | baseExponential (IncompressibleData data, double y, double ybase) |
Base functions that handle the custom function types. More... | |
double | baseLogexponential (IncompressibleData data, double y, double ybase) |
Base exponential function with logarithmic term. More... | |
double | baseExponentialOffset (IncompressibleData data, double y) |
double | basePolyOffset (IncompressibleData data, double y, double z=0.0) |
double | h_u (double T, double p, double x) |
Enthalpy from u, p and rho. More... | |
double | u_h (double T, double p, double x) |
Internal energy from h, p and rho. More... | |
bool | checkT (double T, double p, double x) |
Check validity of temperature input. More... | |
bool | checkP (double T, double p, double x) |
Check validity of pressure input. More... | |
Protected Attributes | |
bool | strict |
std::string | name |
std::string | description |
std::string | reference |
double | Tmin |
double | Tmax |
double | xmin |
double | xmax |
composition_types | xid |
double | TminPsat |
double | xbase |
double | Tbase |
IncompressibleData | density |
These are the objects that hold the coefficients. More... | |
IncompressibleData | specific_heat |
Specific heat coefficients. More... | |
IncompressibleData | viscosity |
Viscosity coefficients. More... | |
IncompressibleData | conductivity |
Conductivity coefficients. More... | |
IncompressibleData | p_sat |
Saturation pressure coefficients. More... | |
IncompressibleData | T_freeze |
Freezing temperature coefficients. More... | |
IncompressibleData | mass2input |
Mass fraction conversion coefficients. More... | |
IncompressibleData | volume2input |
Volume fraction conversion coefficients. More... | |
IncompressibleData | mole2input |
Mole fraction conversion coefficients. More... | |
Polynomial2DFrac | poly |
|
inline |
Definition at line 140 of file IncompressibleFluid.h.
|
inlinevirtual |
Definition at line 144 of file IncompressibleFluid.h.
|
protected |
Base functions that handle the custom function types.
Base exponential function.
Definition at line 37 of file IncompressibleFluid.cpp.
|
protected |
|
protected |
Base exponential function with logarithmic term.
Definition at line 63 of file IncompressibleFluid.cpp.
|
protected |
Definition at line 88 of file IncompressibleFluid.cpp.
double CoolProp::IncompressibleFluid::c | ( | double | T, |
double | p, | ||
double | x | ||
) |
Heat capacities as a function of temperature, pressure and composition.
Definition at line 131 of file IncompressibleFluid.cpp.
|
protected |
Check validity of pressure input.
Compares the given pressure p to the saturation pressure at temperature T and throws and exception if p is lower than the saturation conditions. The default value for psat is -1 yielding true if psat is not redefined in the subclass.
Definition at line 449 of file IncompressibleFluid.cpp.
|
protected |
Check validity of temperature input.
Compares the given temperature T to the result of a freezing point calculation. This is not necessarily defined for all fluids, default values do not cause errors.
Definition at line 432 of file IncompressibleFluid.cpp.
|
inline |
Check validity of temperature, pressure and composition input.
Definition at line 423 of file IncompressibleFluid.h.
bool CoolProp::IncompressibleFluid::checkX | ( | double | x | ) |
Check validity of composition input.
Compares the given composition x to a stored minimum and maximum value. Enforces the redefinition of xmin and xmax since the default values cause an error.
Definition at line 461 of file IncompressibleFluid.cpp.
double CoolProp::IncompressibleFluid::cond | ( | double | T, |
double | p, | ||
double | x | ||
) |
Thermal conductivity as a function of temperature, pressure and composition.
Definition at line 166 of file IncompressibleFluid.cpp.
|
inline |
Definition at line 269 of file IncompressibleFluid.h.
|
inline |
Definition at line 272 of file IncompressibleFluid.h.
double CoolProp::IncompressibleFluid::dhdTatPxdT | ( | double | T, |
double | p, | ||
double | x | ||
) |
Partial derivative of enthalpy.
Definition at line 262 of file IncompressibleFluid.cpp.
double CoolProp::IncompressibleFluid::drhodTatPx | ( | double | T, |
double | p, | ||
double | x | ||
) |
Partial derivative of density.
Partial derivative of density with respect to temperature at constant pressure and composition.
Definition at line 232 of file IncompressibleFluid.cpp.
double CoolProp::IncompressibleFluid::dsdTatPxdT | ( | double | T, |
double | p, | ||
double | x | ||
) |
Partial derivative of entropy.
Definition at line 247 of file IncompressibleFluid.cpp.
|
inline |
Definition at line 149 of file IncompressibleFluid.h.
|
inline |
Definition at line 152 of file IncompressibleFluid.h.
|
inline |
Definition at line 146 of file IncompressibleFluid.h.
|
inline |
Definition at line 155 of file IncompressibleFluid.h.
|
inline |
Definition at line 177 of file IncompressibleFluid.h.
|
inline |
Definition at line 159 of file IncompressibleFluid.h.
|
inline |
Definition at line 162 of file IncompressibleFluid.h.
|
inline |
Definition at line 174 of file IncompressibleFluid.h.
|
inline |
Definition at line 180 of file IncompressibleFluid.h.
|
inline |
Definition at line 171 of file IncompressibleFluid.h.
|
inline |
Definition at line 165 of file IncompressibleFluid.h.
|
inline |
Definition at line 168 of file IncompressibleFluid.h.
|
inline |
Enthalpy as a function of temperature, pressure and composition.
Definition at line 286 of file IncompressibleFluid.h.
|
inlineprotected |
Enthalpy from u, p and rho.
Calculate enthalpy as a function of temperature and pressure employing functions for internal energy and density. Provides consistent formulations.
Definition at line 382 of file IncompressibleFluid.h.
double CoolProp::IncompressibleFluid::inputFromMass | ( | double | T, |
double | x | ||
) |
Mass fraction conversion function.
If the fluid type is mass-based, it does not do anything. Otherwise, it converts the mass fraction to the required input.
Definition at line 278 of file IncompressibleFluid.cpp.
double CoolProp::IncompressibleFluid::inputFromMole | ( | double | T, |
double | x | ||
) |
Mole fraction conversion function.
If the fluid type is mole-based, it does not do anything. Otherwise, it converts the mole fraction to the required input.
Definition at line 352 of file IncompressibleFluid.cpp.
double CoolProp::IncompressibleFluid::inputFromVolume | ( | double | T, |
double | x | ||
) |
Volume fraction conversion function.
If the fluid type is volume-based, it does not do anything. Otherwise, it converts the volume fraction to the required input.
Definition at line 315 of file IncompressibleFluid.cpp.
bool CoolProp::IncompressibleFluid::is_pure | ( | ) |
A function to test the density coefficients for 1D or 2D.
Definition at line 31 of file IncompressibleFluid.cpp.
double CoolProp::IncompressibleFluid::psat | ( | double | T, |
double | x | ||
) |
Saturation pressure as a function of temperature and composition.
Definition at line 186 of file IncompressibleFluid.cpp.
double CoolProp::IncompressibleFluid::rho | ( | double | T, |
double | p, | ||
double | x | ||
) |
Density as a function of temperature, pressure and composition.
Definition at line 110 of file IncompressibleFluid.cpp.
|
inline |
Entropy as a function of temperature, pressure and composition.
Definition at line 276 of file IncompressibleFluid.h.
|
inline |
Definition at line 228 of file IncompressibleFluid.h.
|
inline |
Setters for the coefficients.
Definition at line 219 of file IncompressibleFluid.h.
|
inline |
Definition at line 187 of file IncompressibleFluid.h.
|
inline |
Setters for the concentration conversion coefficients.
Definition at line 239 of file IncompressibleFluid.h.
|
inline |
Definition at line 245 of file IncompressibleFluid.h.
|
inline |
Definition at line 184 of file IncompressibleFluid.h.
|
inline |
Definition at line 231 of file IncompressibleFluid.h.
|
inline |
Definition at line 190 of file IncompressibleFluid.h.
|
inline |
Definition at line 222 of file IncompressibleFluid.h.
|
inline |
Definition at line 211 of file IncompressibleFluid.h.
|
inline |
Definition at line 234 of file IncompressibleFluid.h.
|
inline |
Definition at line 193 of file IncompressibleFluid.h.
|
inline |
Definition at line 196 of file IncompressibleFluid.h.
|
inline |
Definition at line 208 of file IncompressibleFluid.h.
|
inline |
Definition at line 225 of file IncompressibleFluid.h.
|
inline |
Definition at line 242 of file IncompressibleFluid.h.
|
inline |
Definition at line 214 of file IncompressibleFluid.h.
|
inline |
Definition at line 205 of file IncompressibleFluid.h.
|
inline |
Definition at line 199 of file IncompressibleFluid.h.
|
inline |
Definition at line 202 of file IncompressibleFluid.h.
double CoolProp::IncompressibleFluid::T_c | ( | double | Cmass, |
double | p, | ||
double | x | ||
) |
Temperature as a function of heat capacities as a function of temperature, pressure and composition.
Definition at line 408 of file IncompressibleFluid.cpp.
|
inline |
Thermal conductivity as a function of temperature, pressure and composition.
Definition at line 361 of file IncompressibleFluid.h.
|
inline |
Temperature as a function of enthalpy, pressure and composition.
Definition at line 353 of file IncompressibleFluid.h.
|
inline |
Saturation pressure as a function of temperature and composition.
Definition at line 365 of file IncompressibleFluid.h.
double CoolProp::IncompressibleFluid::T_rho | ( | double | Dmass, |
double | p, | ||
double | x | ||
) |
Temperature as a function of density, pressure and composition.
Definition at line 394 of file IncompressibleFluid.cpp.
|
inline |
Temperature as a function of entropy as a function of temperature, pressure and composition.
Definition at line 345 of file IncompressibleFluid.h.
|
inline |
Temperature as a function of internal energy as a function of temperature, pressure and composition.
Definition at line 349 of file IncompressibleFluid.h.
|
inline |
Viscosity as a function of temperature, pressure and composition.
Definition at line 357 of file IncompressibleFluid.h.
double CoolProp::IncompressibleFluid::Tfreeze | ( | double | p, |
double | x | ||
) |
Freezing temperature as a function of pressure and composition.
Definition at line 207 of file IncompressibleFluid.cpp.
|
inline |
Internal energy as a function of temperature, pressure and composition.
Definition at line 281 of file IncompressibleFluid.h.
|
inlineprotected |
Internal energy from h, p and rho.
Calculate internal energy as a function of temperature and pressure employing functions for enthalpy and density. Provides consistent formulations.
Definition at line 390 of file IncompressibleFluid.h.
void CoolProp::IncompressibleFluid::validate | ( | ) |
A function to check coefficients and equation types.
A thermophysical property provider for all properties.
This fluid instance is populated using an entry from a JSON file and uses simplified polynomial and exponential functions to calculate thermophysical and transport properties.
Definition at line 23 of file IncompressibleFluid.cpp.
double CoolProp::IncompressibleFluid::visc | ( | double | T, |
double | p, | ||
double | x | ||
) |
Viscosity as a function of temperature, pressure and composition.
Definition at line 146 of file IncompressibleFluid.cpp.
|
inline |
Composition as a function of freezing temperature and pressure.
Definition at line 369 of file IncompressibleFluid.h.
|
protected |
Conductivity coefficients.
If 2D, the rows are temperature and the columns are concentration. If 1D, should be a column vector of temperature coefficients
Definition at line 105 of file IncompressibleFluid.h.
|
protected |
These are the objects that hold the coefficients.
Note that all polynomials require a 2-dimensional array of coefficients. This array may have only one row or column, but the structure should be 2D. This behaviour is hard-coded in the JSON file reader that resides inside the IncompressibleLibrary.cpp All other functions, also polyoffset, can only handle 1D input and throw an error if you feed them other coefficients. Density coefficients If 2D, the rows are temperature and the columns are concentration. If 1D, should be a column vector of temperature coefficients
Definition at line 88 of file IncompressibleFluid.h.
|
protected |
Definition at line 64 of file IncompressibleFluid.h.
|
protected |
Mass fraction conversion coefficients.
If the fluid type is mass-based, it does not do anything. Otherwise, it converts the mass fraction to the required input.
Definition at line 121 of file IncompressibleFluid.h.
|
protected |
Mole fraction conversion coefficients.
If the fluid type is mole-based, it does not do anything. Otherwise, it converts the mole fraction to the required input.
Definition at line 131 of file IncompressibleFluid.h.
|
protected |
Definition at line 63 of file IncompressibleFluid.h.
|
protected |
Saturation pressure coefficients.
If 2D, the rows are temperature and the columns are concentration. If 1D, should be a column vector of temperature coefficients
Definition at line 110 of file IncompressibleFluid.h.
|
protected |
Definition at line 133 of file IncompressibleFluid.h.
|
protected |
Definition at line 65 of file IncompressibleFluid.h.
|
protected |
Specific heat coefficients.
If 2D, the rows are temperature and the columns are concentration. If 1D, should be a column vector of temperature coefficients Fails for all other forms than polynomial due to the automatic integration for internal energy and entropy.
Definition at line 95 of file IncompressibleFluid.h.
|
protected |
Definition at line 61 of file IncompressibleFluid.h.
|
protected |
Freezing temperature coefficients.
If 2D, the rows are concentration and the columns are pressure. If 1D, should be a column vector of concentration coefficients
Definition at line 115 of file IncompressibleFluid.h.
|
protected |
Definition at line 72 of file IncompressibleFluid.h.
|
protected |
Definition at line 67 of file IncompressibleFluid.h.
|
protected |
Definition at line 67 of file IncompressibleFluid.h.
|
protected |
Definition at line 71 of file IncompressibleFluid.h.
|
protected |
Viscosity coefficients.
If 2D, the rows are temperature and the columns are concentration. If 1D, should be a column vector of temperature coefficients
Definition at line 100 of file IncompressibleFluid.h.
|
protected |
Volume fraction conversion coefficients.
If the fluid type is volume-based, it does not do anything. Otherwise, it converts the volume fraction to the required input.
Definition at line 126 of file IncompressibleFluid.h.
|
protected |
Definition at line 72 of file IncompressibleFluid.h.
|
protected |
Definition at line 69 of file IncompressibleFluid.h.
|
protected |
Definition at line 68 of file IncompressibleFluid.h.
|
protected |
Definition at line 68 of file IncompressibleFluid.h.