CoolProp
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CoolProp::IncompressibleFluid Class Reference

Detailed Description

A property provider for incompressible solutions and pure fluids.

This fluid instance is populated using an entry from a JSON file

#include <IncompressibleFluid.h>

Collaboration diagram for CoolProp::IncompressibleFluid:
Collaboration graph
[legend]

Public Member Functions

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.
 
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.
 
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.
 
double rho (double T, double p, double x)
 Density as a function of temperature, pressure and composition.
 
double c (double T, double p, double x)
 Heat capacities as a function of temperature, pressure and composition.
 
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.
 
double u (double T, double p, double x)
 Internal energy as a function of temperature, pressure and composition.
 
double h (double T, double p, double x)
 Enthalpy as a function of temperature, pressure and composition.
 
double visc (double T, double p, double x)
 Viscosity as a function of temperature, pressure and composition.
 
double cond (double T, double p, double x)
 Thermal conductivity as a function of temperature, pressure and composition.
 
double psat (double T, double x)
 Saturation pressure as a function of temperature and composition.
 
double Tfreeze (double p, double x)
 Freezing temperature as a function of pressure and composition.
 
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.
 
double dhdTatPxdT (double T, double p, double x)
 Partial derivative of enthalpy.
 
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.
 
double T_c (double Cmass, double p, double x)
 Temperature as a function of heat capacities as a function of temperature, pressure and composition.
 
double T_s (double Smass, double p, double x)
 Temperature as a function of entropy as a function of temperature, pressure and composition.
 
double T_u (double Umass, double p, double x)
 Temperature as a function of internal energy as a function of temperature, pressure and composition.
 
double T_h (double Hmass, double p, double x)
 Temperature as a function of enthalpy, pressure and composition.
 
double T_visc (double visc, double p, double x)
 Viscosity as a function of temperature, pressure and composition.
 
double T_cond (double cond, double p, double x)
 Thermal conductivity as a function of temperature, pressure and composition.
 
double T_psat (double psat, double x)
 Saturation pressure as a function of temperature and composition.
 
double x_Tfreeze (double Tfreeze, double p)
 Composition as a function of freezing temperature and pressure.
 
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.
 

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.
 
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
 

Member Function Documentation

◆ baseExponential()

double CoolProp::IncompressibleFluid::baseExponential ( IncompressibleData  data,
double  y,
double  ybase 
)
protected

Base functions that handle the custom function types.

Base exponential function.

◆ checkP()

bool CoolProp::IncompressibleFluid::checkP ( double  T,
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.

◆ checkT()

bool CoolProp::IncompressibleFluid::checkT ( double  T,
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.

◆ checkX()

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.

◆ drhodTatPx()

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.

◆ h_u()

double CoolProp::IncompressibleFluid::h_u ( double  T,
double  p,
double  x 
)
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.

◆ inputFromMass()

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.

◆ inputFromMole()

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.

◆ inputFromVolume()

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.

◆ u_h()

double CoolProp::IncompressibleFluid::u_h ( double  T,
double  p,
double  x 
)
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.

◆ validate()

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.

Member Data Documentation

◆ conductivity

IncompressibleData CoolProp::IncompressibleFluid::conductivity
protected

Conductivity coefficients.

If 2D, the rows are temperature and the columns are concentration. If 1D, should be a column vector of temperature coefficients

◆ density

IncompressibleData CoolProp::IncompressibleFluid::density
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

◆ mass2input

IncompressibleData CoolProp::IncompressibleFluid::mass2input
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.

◆ mole2input

IncompressibleData CoolProp::IncompressibleFluid::mole2input
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.

◆ p_sat

IncompressibleData CoolProp::IncompressibleFluid::p_sat
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

◆ specific_heat

IncompressibleData CoolProp::IncompressibleFluid::specific_heat
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.

◆ T_freeze

IncompressibleData CoolProp::IncompressibleFluid::T_freeze
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

◆ viscosity

IncompressibleData CoolProp::IncompressibleFluid::viscosity
protected

Viscosity coefficients.

If 2D, the rows are temperature and the columns are concentration. If 1D, should be a column vector of temperature coefficients

◆ volume2input

IncompressibleData CoolProp::IncompressibleFluid::volume2input
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.


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