CoolProp 6.8.1dev
An open-source fluid property and humid air property database
|
A superancillary object is formed of a number of one dimensional Chebyshev approximations, one for each phase, property pair.
Loaded from the file are density and pressure as functions of temperature, and a thermodynamic model can be used to build the
Definition at line 735 of file superancillary.h.
#include <superancillary.h>
Public Member Functions | |
SuperAncillary (const nlohmann::json &j) | |
SuperAncillary (const std::string &s) | |
const auto & | get_approx1d (char k, short Q) const |
const auto & | get_invlnp () |
Get a const reference to the inverse approximation for T(ln(p)) More... | |
const double | get_pmin () const |
Get the minimum pressure in Pa. More... | |
const double | get_pmax () const |
Get the maximum pressure in Pa. More... | |
const double | get_Tmin () const |
Get the minimum temperature in K. More... | |
const double | get_Tcrit_num () const |
Get the numerical critical temperature in K. More... | |
const double | get_rhocrit_num () const |
Get the numerical critical density in mol/m^3. More... | |
void | add_variable (char var, const std::function< double(double, double)> &caller) |
double | eval_sat (double T, char k, short Q) const |
template<typename Container > | |
void | eval_sat_many (const Container &T, char k, short Q, Container &y) const |
template<typename Container > | |
void | eval_sat_manyC (const Container T[], std::size_t N, char k, short Q, Container y[]) const |
auto | solve_for_T (double propval, char k, bool Q, unsigned int bits=64, unsigned int max_iter=100, double boundsftol=1e-13) const |
auto | get_vaporquality (double T, double propval, char k) const |
auto | get_T_from_p (double p) |
Use the inverted pressure superancillary to calculate temperature given pressure. More... | |
auto | get_yval (double T, double q, char k) const |
Return the evaluated value of the thermodynamic variable, given the temperature and vapor quality. More... | |
template<typename Container > | |
void | get_yval_many (const Container &T, char k, const Container &q, Container &y) const |
A vectorized version of get_yval for profiling in Python. More... | |
auto | get_all_intersections (const char k, const double val, unsigned int bits, std::size_t max_iter, double boundsftol) const |
std::optional< SuperAncillaryTwoPhaseSolution > | iterate_for_Tq_XY (double Tmin, double Tmax, char ch1, double val1, char ch2, double val2, unsigned int bits, std::size_t max_iter, double boundsftol) const |
Iterate to find a value of temperature and vapor quality corresponding to the two given thermodynamic variables, if such a solution exists. This is the lower-level function used by the solve_XX methods. More... | |
std::optional< SuperAncillaryTwoPhaseSolution > | solve_for_Tq_DX (const double rho, const double propval, const char k, unsigned int bits, std::size_t max_iter, double boundsftol) const |
template<typename Container > | |
void | solve_for_Tq_DX_many (const Container &rho, const Container &propval, const char k, unsigned int bits, std::size_t max_iter, double boundsftol, Container &T, Container &q, Container &count) |
A vectorize version of solve_for_Tq_DX for use in the Python interface for profiling. More... | |
|
inline |
Reading in a data structure in the JSON format of https://pubs.aip.org/aip/jpr/article/53/1/013102/3270194 which includes sets of Chebyshev expansions for rhoL, rhoV, and p
Definition at line 817 of file superancillary.h.
|
inline |
Load the superancillary with the data passed in as a string blob. This constructor delegates directly to the the one that consumes JSON
s | The string-encoded JSON data for the superancillaries |
Definition at line 831 of file superancillary.h.
|
inline |
Using the provided function that gives y(T, rho), build the ancillaries for this variable based on the ancillaries for rhoL and rhoV
var | The key for the property (H,S,U) |
caller | A function that takes temperature and molar density and returns the property of interest, molar enthalpy in the case of H, etc. |
Definition at line 882 of file superancillary.h.
|
inline |
Given the value of Q in {0,1}, evaluate one of the the ChebyshevApproximation1D
T | Temperature, in K |
k | Property key, in {D,P,H,S,U} |
Q | Vapor quality, in {0,1} |
Definition at line 928 of file superancillary.h.
|
inline |
A vectorized version of eval_sat for wrapping in Python interface and profiling
Definition at line 941 of file superancillary.h.
|
inline |
A vectorized version of eval_sat for wrapping in Python interface and profiling
Definition at line 953 of file superancillary.h.
|
inline |
Determine all the values of temperature that correspond to intersections with the superancillary function, for both the vapor and liquid phases
k | Property key, in {D,P,H,S,U} |
val | Value of the thermodynamic variable |
bits | passed to toms748 algorithm |
max_iter | Maximum allowed number of function calls |
boundsftol | A functional value stopping condition to test on the endpoints |
Definition at line 1056 of file superancillary.h.
|
inline |
Get a const reference to a ChebyshevApproximation1D
k | The key for the property (D,S,H,P,U) |
Q | The vapor quality, either 0 or 1 |
Definition at line 838 of file superancillary.h.
|
inline |
Get a const reference to the inverse approximation for T(ln(p))
Definition at line 857 of file superancillary.h.
|
inline |
Get the maximum pressure in Pa.
Definition at line 869 of file superancillary.h.
|
inline |
Get the minimum pressure in Pa.
Definition at line 867 of file superancillary.h.
|
inline |
Get the numerical critical density in mol/m^3.
Definition at line 875 of file superancillary.h.
|
inline |
Use the inverted pressure superancillary to calculate temperature given pressure.
p | The pressure (not its logarithm!), in Pa |
Definition at line 999 of file superancillary.h.
|
inline |
Get the numerical critical temperature in K.
Definition at line 873 of file superancillary.h.
|
inline |
Get the minimum temperature in K.
Definition at line 871 of file superancillary.h.
|
inline |
Get the non-iterative vapor quality q given the temperature T and the value of the thermodynamic variable
T | Temperature, in K |
propval | The value of the given thermodynamic variable |
k | Property key, in {D,P,H,S,U} |
Definition at line 980 of file superancillary.h.
|
inline |
Return the evaluated value of the thermodynamic variable, given the temperature and vapor quality.
T | Temperature, in K |
q | Vapor quality, in [0,1] |
k | Property key, in {D,P,H,S,U} |
Definition at line 1010 of file superancillary.h.
|
inline |
A vectorized version of get_yval for profiling in Python.
Definition at line 1028 of file superancillary.h.
|
inline |
Iterate to find a value of temperature and vapor quality corresponding to the two given thermodynamic variables, if such a solution exists. This is the lower-level function used by the solve_XX methods.
Tmin | Minimum temperature, in K |
Tmax | Maximum temperature, in K |
ch1 | The key for the first variable, in {T,D,P,H,S,U} |
val1 | The value for the first variable |
ch2 | The key for the second variable, in {T,D,P,H,S,U} |
val2 | The value for the second variable |
bits | passed to toms748 algorithm |
max_iter | Maximum allowed number of function calls |
boundsftol | A functional value stopping condition to test on the endpoints |
Definition at line 1084 of file superancillary.h.
|
inline |
A convenience function to pass off to the ChebyshevApproximation1D and do an inversion calculation for a value of the variable for a saturated state
propval | The value of the property |
k | Property key, in {D,P,H,S,U} |
Q | Vapor quality, in {0,1} |
bits | passed to toms748 algorithm |
max_iter | Maximum allowed number of function calls |
boundsftol | A functional value stopping condition to test on the endpoints |
Definition at line 970 of file superancillary.h.
|
inline |
Given a saturated density and another property other than T, solve for the temperature and vapor quality
rho | The molar density |
propval | The value of the other property |
k | Property key, in {D,P,H,S,U} |
bits | passed to toms748 algorithm |
max_iter | Maximum allowed number of function calls |
boundsftol | A functional value stopping condition to test on the endpoints |
Definition at line 1142 of file superancillary.h.
|
inline |
A vectorize version of solve_for_Tq_DX for use in the Python interface for profiling.
Definition at line 1168 of file superancillary.h.