CoolProp  4.2.5
An open-source fluid property and humid air property database
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
IncompressibleSolution Class Reference

Base class for simplified brine/solution models. More...

#include <IncompSolution.h>

Inheritance diagram for IncompressibleSolution:
IncompressibleClass BaseSolution LiBrSolution MelinderSolution SecCoolSolution AMSolution CASolution EASolution EGSolution GLSolution KASolution KCSolution KFSolution LISolution MASolution MGSolution NASolution PGSolution IceSlurryEA IceSlurryNA IceSlurryPG PK2000 ZitrecAC

Public Member Functions

 IncompressibleSolution ()
 
std::vector< std::vector
< double > > 
getcRho () const
 
std::vector< std::vector
< double > > 
getcHeat () const
 
std::vector< std::vector
< double > > 
getcVisc () const
 
std::vector< std::vector
< double > > 
getcCond () const
 
std::vector< std::vector
< double > > 
getcPsat () const
 
std::vector< double > getcTfreeze () const
 
virtual double rho (double T_K, double p, double x)
 Density as a function of temperature, pressure and composition. More...
 
virtual double c (double T_K, double p, double x)
 Heat capacities as a function of temperature, pressure and composition. More...
 
virtual double cp (double T_K, double p, double x)
 
virtual double cv (double T_K, double p, double x)
 
virtual double s (double T_K, double p, double x)
 Entropy as a function of temperature, pressure and composition. More...
 
virtual double u (double T_K, double p, double x)
 Internal energy as a function of temperature, pressure and composition. More...
 
virtual double h (double T_K, double p, double x)
 Enthalpy as a function of temperature, pressure and composition. More...
 
virtual double visc (double T_K, double p, double x)
 Viscosity as a function of temperature, pressure and composition. More...
 
virtual double cond (double T_K, double p, double x)
 Thermal conductivity as a function of temperature, pressure and composition. More...
 
virtual double psat (double T_K, double x)
 Saturation pressure as a function of temperature and composition. More...
 
virtual double Tfreeze (double p, double x)
 Freezing temperature as a function of pressure and composition. More...
 
void testInputs (double T_K, double p, double x)
 Base class for simplified brine/solution models. More...
 
- Public Member Functions inherited from IncompressibleClass
std::string getDescription () const
 
std::string getName () const
 
std::string get_name () const
 
std::string getReference () const
 
double getTmax () const
 
double getTmin () const
 
double getTminPsat () const
 
double getTref () const
 
void setDebug (bool debug)
 
 IncompressibleClass ()
 
virtual ~IncompressibleClass ()
 
double polyval (std::vector< double > const &coefficients, double x)
 
double polyval (std::vector< std::vector< double > > const &coefficients, double x, double y)
 
double polyint (std::vector< double > const &coefficients, double T)
 
double polyint (std::vector< double > const &coefficients, double T1, double T0)
 
double polyint (std::vector< std::vector< double > > const &coefficients, double x, double T)
 
double polyint (std::vector< std::vector< double > > const &coefficients, double x, double T1, double T0)
 
double polyfracint (std::vector< double > const &coefficients, double T)
 
double polyfracint (std::vector< double > const &coefficients, double T1, double T0)
 
double polyfracint (std::vector< std::vector< double > > const &coefficients, double x, double T)
 
double polyfracint (std::vector< std::vector< double > > const &coefficients, double x, double T1, double T0)
 
double polyfracintcentral (std::vector< double > const &coefficients, double T, double Tbase)
 
double polyfracintcentral (std::vector< double > const &coefficients, double T1, double T0, double Tbase)
 
double polyfracintcentral (std::vector< std::vector< double > > const &coefficients, double x, double T, double Tbase)
 
double polyfracintcentral (std::vector< std::vector< double > > const &coefficients, double x, double T1, double T0, double Tbase)
 
double expval (std::vector< double > const &coefficients, double T, int n)
 
double expval (std::vector< std::vector< double > > const &coefficients, double x, double T, int n)
 

Protected Member Functions

double h_u (double T_K, double p, double x)
 Enthalpy from x, u, p and rho. More...
 
double u_h (double T_K, double p, double x)
 Internal energy from x, h, p and rho. More...
 
bool checkT (double T_K, double p, double x)
 Check validity of temperature input. More...
 
bool checkP (double T_K, double p, double x)
 Check validity of pressure input. 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 inherited from IncompressibleClass
bool checkCoefficients (std::vector< double > const &coefficients, unsigned int n)
 Basic checks for coefficient vectors. More...
 
bool checkCoefficients (std::vector< std::vector< double > > const &coefficients, unsigned int rows, unsigned int columns)
 

Protected Attributes

double xmin
 
double xmax
 
std::vector< std::vector
< double > > 
cRho
 
std::vector< std::vector
< double > > 
cHeat
 
std::vector< std::vector
< double > > 
cVisc
 
std::vector< std::vector
< double > > 
cCond
 
std::vector< std::vector
< double > > 
cPsat
 
std::vector< double > cTfreeze
 
- Protected Attributes inherited from IncompressibleClass
std::string name
 
std::string description
 
std::string reference
 
double Tmin
 
double TminPsat
 
double Tmax
 
double Tref
 
bool DEBUG
 

Detailed Description

Base class for simplified brine/solution models.

Notes for developers:

If you want to add a fluid, add its definition to the header and then add it to the map in the constructor in SolutionsContainer in IncompSolution.cppEmploys the base functions implemented in IncompBase.h and provides properties as function of temperature, pressure and composition.

Definition at line 25 of file IncompSolution.h.

Constructor & Destructor Documentation

IncompressibleSolution::IncompressibleSolution ( )
inline

Definition at line 42 of file IncompSolution.h.

Member Function Documentation

virtual double IncompressibleSolution::c ( double  T_K,
double  p,
double  x 
)
inlinevirtual

Heat capacities as a function of temperature, pressure and composition.

Reimplemented in BaseSolution, and LiBrSolution.

Definition at line 60 of file IncompSolution.h.

bool IncompressibleSolution::checkP ( double  T_K,
double  p,
double  x 
)
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 88 of file IncompSolution.cpp.

bool IncompressibleSolution::checkT ( double  T_K,
double  p,
double  x 
)
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 66 of file IncompSolution.cpp.

bool IncompressibleSolution::checkTPX ( double  T,
double  p,
double  x 
)
protected

Check validity of temperature, pressure and composition input.

Definition at line 115 of file IncompSolution.cpp.

bool IncompressibleSolution::checkX ( double  x)
protected

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 101 of file IncompSolution.cpp.

virtual double IncompressibleSolution::cond ( double  T_K,
double  p,
double  x 
)
inlinevirtual

Thermal conductivity as a function of temperature, pressure and composition.

Reimplemented in BaseSolution, and LiBrSolution.

Definition at line 72 of file IncompSolution.h.

virtual double IncompressibleSolution::cp ( double  T_K,
double  p,
double  x 
)
inlinevirtual

Definition at line 61 of file IncompSolution.h.

virtual double IncompressibleSolution::cv ( double  T_K,
double  p,
double  x 
)
inlinevirtual

Definition at line 62 of file IncompSolution.h.

std::vector<std::vector<double> > IncompressibleSolution::getcCond ( ) const
inline

Definition at line 50 of file IncompSolution.h.

std::vector<std::vector<double> > IncompressibleSolution::getcHeat ( ) const
inline

Definition at line 48 of file IncompSolution.h.

std::vector<std::vector<double> > IncompressibleSolution::getcPsat ( ) const
inline

Definition at line 51 of file IncompSolution.h.

std::vector<std::vector<double> > IncompressibleSolution::getcRho ( ) const
inline

Definition at line 47 of file IncompSolution.h.

std::vector<double> IncompressibleSolution::getcTfreeze ( ) const
inline

Definition at line 52 of file IncompSolution.h.

std::vector<std::vector<double> > IncompressibleSolution::getcVisc ( ) const
inline

Definition at line 49 of file IncompSolution.h.

virtual double IncompressibleSolution::h ( double  T_K,
double  p,
double  x 
)
inlinevirtual

Enthalpy as a function of temperature, pressure and composition.

Reimplemented in BaseSolution, and LiBrSolution.

Definition at line 68 of file IncompSolution.h.

double IncompressibleSolution::h_u ( double  T_K,
double  p,
double  x 
)
inlineprotected

Enthalpy from x, 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 91 of file IncompSolution.h.

virtual double IncompressibleSolution::psat ( double  T_K,
double  x 
)
inlinevirtual

Saturation pressure as a function of temperature and composition.

Reimplemented in LiBrSolution.

Definition at line 74 of file IncompSolution.h.

virtual double IncompressibleSolution::rho ( double  T_K,
double  p,
double  x 
)
inlinevirtual

Density as a function of temperature, pressure and composition.

Reimplemented in BaseSolution, and LiBrSolution.

Definition at line 58 of file IncompSolution.h.

virtual double IncompressibleSolution::s ( double  T_K,
double  p,
double  x 
)
inlinevirtual

Entropy as a function of temperature, pressure and composition.

Reimplemented in BaseSolution, and LiBrSolution.

Definition at line 64 of file IncompSolution.h.

void IncompressibleSolution::testInputs ( double  T_K,
double  p,
double  x 
)

Base class for simplified brine/solution models.

Employs the base functions implemented in IncompBase.h and provides properties as function of temperature, pressure and composition.

Definition at line 26 of file IncompSolution.cpp.

virtual double IncompressibleSolution::Tfreeze ( double  p,
double  x 
)
inlinevirtual

Freezing temperature as a function of pressure and composition.

Reimplemented in IceSlurryNA, IceSlurryPG, IceSlurryEA, SecCoolSolution, MelinderSolution, and LiBrSolution.

Definition at line 76 of file IncompSolution.h.

virtual double IncompressibleSolution::u ( double  T_K,
double  p,
double  x 
)
inlinevirtual

Internal energy as a function of temperature, pressure and composition.

Reimplemented in BaseSolution, and LiBrSolution.

Definition at line 66 of file IncompSolution.h.

double IncompressibleSolution::u_h ( double  T_K,
double  p,
double  x 
)
inlineprotected

Internal energy from x, 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 99 of file IncompSolution.h.

virtual double IncompressibleSolution::visc ( double  T_K,
double  p,
double  x 
)
inlinevirtual

Viscosity as a function of temperature, pressure and composition.

Reimplemented in BaseSolution, and LiBrSolution.

Definition at line 70 of file IncompSolution.h.

Member Data Documentation

std::vector< std::vector<double> > IncompressibleSolution::cCond
protected

Definition at line 36 of file IncompSolution.h.

std::vector< std::vector<double> > IncompressibleSolution::cHeat
protected

Definition at line 34 of file IncompSolution.h.

std::vector< std::vector<double> > IncompressibleSolution::cPsat
protected

Definition at line 37 of file IncompSolution.h.

std::vector< std::vector<double> > IncompressibleSolution::cRho
protected

Definition at line 33 of file IncompSolution.h.

std::vector<double> IncompressibleSolution::cTfreeze
protected

Definition at line 38 of file IncompSolution.h.

std::vector< std::vector<double> > IncompressibleSolution::cVisc
protected

Definition at line 35 of file IncompSolution.h.

double IncompressibleSolution::xmax
protected

Definition at line 32 of file IncompSolution.h.

double IncompressibleSolution::xmin
protected

A few redefinitions are needed. The base class does not support composition as input. We also have to have an additional check for maximum and minimum concentration as well as the freezing point.

Definition at line 32 of file IncompSolution.h.


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