CoolProp 8.0.0
An open-source fluid property and humid air property database
Classes | Public Types | Public Member Functions | List of all members
CoolProp::SaturationAncillaryFunction Class Reference

Detailed Description

This is generalized class that can be used to manage an ancillary curve, here they are ancillary curves for saturation pressure, density, enthalpy, entropy.

The form of the ancillary equation can take one of a number of forms:

a) So-called "exponential" form (type = TYPE_EXPONENTIAL) that has a form like

\[ y = y_c\exp\left(\frac{T_c}{T}\sum(n_i \theta^{t_i})\right) \]

or

\[ y = y_c\exp\left(\sum(n_i \theta^{t_i})\right) \]

b) A non-exponential form (type = TYPE_NOT_EXPONENTIAL) that has a form of

\[ y = y_c\left(1+\sum_i(n_i\theta^t_i)\right) \]

with

\[ \theta = \left(1-\frac{T}{T_c}\right) \]

which is conveniently equal to zero at the critical point

c) Rational polynomial form (type = TYPE_RATIONAL_POLYNOMIAL) that has a form of

\[ y = \frac{\sum_iA_iT^i}{\sum_iB_iT^i}\]

where i is an integer, and the coefficients are in increasing order in both numerator and denominator

Definition at line 90 of file Ancillaries.h.

#include <Ancillaries.h>

Classes

struct  Values
 

Public Types

enum  ancillaryfunctiontypes { TYPE_NOT_SET = 0 , TYPE_NOT_EXPONENTIAL , TYPE_EXPONENTIAL , TYPE_RATIONAL_POLYNOMIAL }
 

Public Member Functions

 SaturationAncillaryFunction ()
 
 SaturationAncillaryFunction (const Values &v)
 
bool enabled ()
 Return true if the ancillary is enabled (type is not TYPE_NOT_SET) More...
 
CoolPropDbl get_max_abs_error ()
 
double evaluate (double T)
 
double invert (double value, double min_bound=-1, double max_bound=-1)
 
double get_Tmin ()
 Get the minimum temperature in K. More...
 
double get_Tmax ()
 Get the maximum temperature in K. More...
 

Member Enumeration Documentation

◆ ancillaryfunctiontypes

Enumerator
TYPE_NOT_SET 
TYPE_NOT_EXPONENTIAL 

It is a non-exponential type of equation.

TYPE_EXPONENTIAL 

It is an exponential type equation, with or without the T_c/T term.

TYPE_RATIONAL_POLYNOMIAL 

It is a rational polynomial equation.

Definition at line 93 of file Ancillaries.h.

Constructor & Destructor Documentation

◆ SaturationAncillaryFunction() [1/2]

CoolProp::SaturationAncillaryFunction::SaturationAncillaryFunction ( )
inline

Definition at line 137 of file Ancillaries.h.

◆ SaturationAncillaryFunction() [2/2]

CoolProp::SaturationAncillaryFunction::SaturationAncillaryFunction ( const Values v)
explicit

Build from a plain-typed Values bundle (defined out-of-line in Ancillaries.cpp). All JSON parsing happens in the non-installed factory.

Definition at line 26 of file Ancillaries.cpp.

Member Function Documentation

◆ enabled()

bool CoolProp::SaturationAncillaryFunction::enabled ( )
inline

Return true if the ancillary is enabled (type is not TYPE_NOT_SET)

Definition at line 147 of file Ancillaries.h.

◆ evaluate()

double CoolProp::SaturationAncillaryFunction::evaluate ( double  T)

Evaluate this ancillary function, yielding for instance the saturated liquid density

Parameters
TThe temperature in K
Returns
y the value of the ancillary function at temperature T

Definition at line 43 of file Ancillaries.cpp.

◆ get_max_abs_error()

CoolPropDbl CoolProp::SaturationAncillaryFunction::get_max_abs_error ( )
inline

Get the maximum absolute error for this fit

Returns
max_abs_error the maximum absolute error for ancillaries that are characterized by maximum absolute error

Definition at line 153 of file Ancillaries.h.

◆ get_Tmax()

double CoolProp::SaturationAncillaryFunction::get_Tmax ( )
inline

Get the maximum temperature in K.

Definition at line 175 of file Ancillaries.h.

◆ get_Tmin()

double CoolProp::SaturationAncillaryFunction::get_Tmin ( )
inline

Get the minimum temperature in K.

Definition at line 170 of file Ancillaries.h.

◆ invert()

double CoolProp::SaturationAncillaryFunction::invert ( double  value,
double  min_bound = -1,
double  max_bound = -1 
)

Invert this ancillary function, and calculate the temperature given the output the value of the function

Parameters
valueThe value of the output
min_bound(optional) The minimum value for T; ignored if < 0
max_bound(optional) The maximum value for T; ignored if < 0
Returns
T The temperature in K

Definition at line 82 of file Ancillaries.cpp.

Member Data Documentation

◆ max_abs_error

CoolPropDbl CoolProp::SaturationAncillaryFunction::max_abs_error

For TYPE_RATIONAL_POLYNOMIAL.

Definition at line 123 of file Ancillaries.h.

◆ N

std::size_t CoolProp::SaturationAncillaryFunction::N

The number of values in the arrays.

Definition at line 129 of file Ancillaries.h.

◆ reducing_value

CoolPropDbl CoolProp::SaturationAncillaryFunction::reducing_value

The value used to reduce the output variable.

Definition at line 127 of file Ancillaries.h.

◆ T_r

CoolPropDbl CoolProp::SaturationAncillaryFunction::T_r

The temperature in K used to reduce the temperature (usually the critical temperature)

Definition at line 128 of file Ancillaries.h.

◆ using_tau_r

bool CoolProp::SaturationAncillaryFunction::using_tau_r

Whether the term \( \frac{T_c}{T} \) is included in the.

Definition at line 126 of file Ancillaries.h.


The documentation for this class was generated from the following files: