CoolProp 8.0.0
An open-source fluid property and humid air property database
Public Member Functions | Protected Attributes | List of all members
AbstractCubicAlphaFunction Class Referenceabstract

Detailed Description

An abstract alpha function for the EOS, defining the interface for the alpha function.

Definition at line 25 of file GeneralizedCubic.h.

#include <GeneralizedCubic.h>

Inheritance diagram for AbstractCubicAlphaFunction:
BasicMathiasCopemanAlphaFunction MathiasCopemanAlphaFunction TwuAlphaFunction

Public Member Functions

virtual ~AbstractCubicAlphaFunction ()=default
 
virtual double term (double tau, std::size_t itau)=0
 A "term" is the value of a_ii(tau) = a0_ii * alpha(tau), or one of its tau-derivatives, for this pure component's attractive energy parameter. More...
 
virtual void calc_all_terms (double tau, std::array< double, 5 > &terms)
 Compute all 5 tau-derivatives at once. Default falls back to 5 separate term() calls. More...
 
void set_Tr_over_Tci (double Tr_over_Tci)
 
unsigned long version () const
 
 AbstractCubicAlphaFunction (double a0, double Tr_over_Tci)
 

Protected Attributes

double a0
 The constant term multiplying the alpha function. More...
 
double Tr_over_Tci
 The (constant) reducing temperature divided by the critical temperature of the pure component. More...
 
double sqrt_Tr_Tci
 The sqrt of the (constant) reducing temperature divided by the critical temperature of the pure component. More...
 
std::vector< double > c
 
unsigned long m_version = 0
 

Constructor & Destructor Documentation

◆ ~AbstractCubicAlphaFunction()

virtual AbstractCubicAlphaFunction::~AbstractCubicAlphaFunction ( )
virtualdefault

◆ AbstractCubicAlphaFunction()

AbstractCubicAlphaFunction::AbstractCubicAlphaFunction ( double  a0,
double  Tr_over_Tci 
)
inline

Definition at line 64 of file GeneralizedCubic.h.

Member Function Documentation

◆ calc_all_terms()

virtual void AbstractCubicAlphaFunction::calc_all_terms ( double  tau,
std::array< double, 5 > &  terms 
)
inlinevirtual

Compute all 5 tau-derivatives at once. Default falls back to 5 separate term() calls.

Reimplemented in BasicMathiasCopemanAlphaFunction, TwuAlphaFunction, and MathiasCopemanAlphaFunction.

Definition at line 49 of file GeneralizedCubic.h.

◆ set_Tr_over_Tci()

void AbstractCubicAlphaFunction::set_Tr_over_Tci ( double  Tr_over_Tci)
inline

Definition at line 53 of file GeneralizedCubic.h.

◆ term()

virtual double AbstractCubicAlphaFunction::term ( double  tau,
std::size_t  itau 
)
pure virtual

A "term" is the value of a_ii(tau) = a0_ii * alpha(tau), or one of its tau-derivatives, for this pure component's attractive energy parameter.

Parameters
tauThe reciprocal reduced temperature, Tr/T
itauThe order of the derivative with respect to tau to return: itau=0 returns a_ii itself, itau=1 returns da_ii/dtau, itau=2 the second derivative, and so on. Implementations support itau in the range 0-4 and throw for higher orders.

Implemented in BasicMathiasCopemanAlphaFunction, TwuAlphaFunction, and MathiasCopemanAlphaFunction.

◆ version()

unsigned long AbstractCubicAlphaFunction::version ( ) const
inline

Monotonically increasing counter bumped whenever this alpha function's parameters change; callers that cache term() values (e.g., AbstractCubic::_ensure_aii_cache) can compare this against a previously-recorded value to detect stale cache entries.

Definition at line 61 of file GeneralizedCubic.h.

Member Data Documentation

◆ a0

double AbstractCubicAlphaFunction::a0
protected

The constant term multiplying the alpha function.

Definition at line 28 of file GeneralizedCubic.h.

◆ c

std::vector<double> AbstractCubicAlphaFunction::c
protected

The vector of constants

Definition at line 31 of file GeneralizedCubic.h.

◆ m_version

unsigned long AbstractCubicAlphaFunction::m_version = 0
protected

Incremented every time a parameter that affects term() changes (e.g., set_Tr_over_Tci()); used by AbstractCubic's aii cache to detect when cached term() values are stale.

Definition at line 34 of file GeneralizedCubic.h.

◆ sqrt_Tr_Tci

double AbstractCubicAlphaFunction::sqrt_Tr_Tci
protected

The sqrt of the (constant) reducing temperature divided by the critical temperature of the pure component.

Definition at line 30 of file GeneralizedCubic.h.

◆ Tr_over_Tci

double AbstractCubicAlphaFunction::Tr_over_Tci
protected

The (constant) reducing temperature divided by the critical temperature of the pure component.

Definition at line 29 of file GeneralizedCubic.h.


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