CoolProp  6.6.0
An open-source fluid property and humid air property database
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
CoolProp Namespace Reference

Detailed Description

Code for all the binary pairs in the mixture.

This file contains flash routines in which the state is unknown, and a solver of some kind must be used to obtain temperature and density, the two state variables upon which the equation of state is based.

This file contains derivatives needed in the mixture model. The derivatives are quite nasty, and there are a lot of them, so they are put in this file for cleanness. The MixtureDerivatives class is a friend class of the HelmholtzEOSMixtureBackend, so it can access all the private members of the HelmholtzEOSMixtureBackend class

This includes both binary pair information for the reducing functions as well as the departure functions for the given binary pair.

Namespaces

 CubicLibrary
 
 PCSAFTLibrary
 
 SaturationSolvers
 
 StabilityRoutines
 

Classes

class  BackendLibrary
 
class  IF97BackendGenerator
 
class  SRKGenerator
 
class  PRGenerator
 
class  IncompressibleBackendGenerator
 
class  VTPRGenerator
 
class  PCSAFTGenerator
 
class  AbstractCubicBackend
 
class  SRKBackend
 
class  PengRobinsonBackend
 
class  CubicResidualHelmholtz
 
class  VTPRBackend
 
class  DepartureFunction
 The abstract base class for departure functions used in the excess part of the Helmholtz energy. More...
 
class  GERG2008DepartureFunction
 The departure function used by the GERG-2008 formulation. More...
 
class  GaussianExponentialDepartureFunction
 A hybrid gaussian with temperature and density dependence along with. More...
 
class  ExponentialDepartureFunction
 A polynomial/exponential departure function. More...
 
class  ExcessTerm
 
class  solver_DP_resid
 
class  DQ_flash_residual
 
class  FlashRoutines
 
class  solver_TP_resid
 
class  PY_singlephase_flash_resid
 
class  JSONFluidLibrary
 A container for the fluid parameters for the CoolProp fluids. More...
 
class  HelmholtzEOSBackend
 
class  HEOSGenerator
 
class  SolverTPResid
 
class  OneDimObjective
 This class is the objective function for the one-dimensional solver used to find the first intersection with the L1*=0 contour. More...
 
class  L0CurveTracer
 
class  MoleFractions
 
class  HelmholtzEOSMixtureBackend
 
class  CorrespondingStatesTerm
 
class  ResidualHelmholtz
 
class  MixtureDerivatives
 
class  PredefinedMixturesLibrary
 A library of predefined mixtures. More...
 
class  MixtureBinaryPairLibrary
 A library of binary pair parameters for the mixture. More...
 
class  MixtureDepartureFunctionsLibrary
 A container for the departure functions for CoolProp mixtures. More...
 
class  MixtureParameters
 
struct  REFPROP_binary_element
 A Data structure for holding BIP coming from REFPROP. More...
 
struct  REFPROP_departure_function
 A data structure for holding departure functions coming from REFPROP. More...
 
class  PhaseEnvelopeRoutines
 
class  ReducingFunction
 Abstract base class for reducing function An abstract base class for the reducing function to allow for Lemmon-Jacobsen, GERG, or other reducing function to yield the reducing parameters \(\rho_r\) and \(T_r\). More...
 
class  GERG2008ReducingFunction
 The reducing function model of GERG-2008. More...
 
class  ConstantReducingFunction
 A constant reducing function that does not vary with composition. Think for instance the reducing function for the cubic EOS. More...
 
class  LemmonAirHFCReducingFunction
 Reducing function converter for dry air and HFC blends. More...
 
class  TransportRoutines
 
class  RachfordRiceResidual
 
class  IF97Backend
 
class  IncompressibleBackend
 
class  JSONIncompressibleLibrary
 A container for the fluid parameters for the incompressible fluids. More...
 
class  PCSAFTBackend
 
class  REFPROPBackend
 
class  REFPROPGenerator
 
class  REFPROPMixtureBackend
 
class  BicubicBackend
 
class  PackablePhaseEnvelopeData
 
class  PureFluidSaturationTableData
 This class holds the data for a two-phase table that is log spaced in p. More...
 
class  SinglePhaseGriddedTableData
 This class holds the data for a single-phase interpolation table that is regularly spaced. More...
 
class  LogPHTable
 This class holds the single-phase data for a log(p)-h gridded table. More...
 
class  LogPTTable
 This class holds the single-phase data for a log(p)-T gridded table. More...
 
class  CellCoeffs
 
class  TabularDataSet
 This class contains the data for one set of Tabular data including single-phase and two-phase data. More...
 
class  TabularDataLibrary
 
class  TabularBackend
 This class contains the general code for tabular backends (TTSE, bicubic, etc.) More...
 
class  TTSEBackend
 
struct  delim
 
struct  output_parameter
 
struct  parameter_info
 
class  ParameterInformation
 
struct  phase_info
 
class  PhaseInformation
 
struct  scheme_info
 
class  SchemeInformation
 
struct  input_pair_info
 
class  InputPairInformation
 
struct  backend_family_info
 
struct  backend_info
 
class  BackendInformation
 
class  SpinodalData
 
class  GuessesStructure
 
class  AbstractState
 The mother of all state classes. More...
 
class  AbstractStateGenerator
 
class  GeneratorInitializer
 
class  SurfaceTensionCorrelation
 
class  SaturationAncillaryFunction
 
struct  MeltingLinePiecewiseSimonSegment
 
struct  MeltingLinePiecewiseSimonData
 
class  MeltingLinePiecewisePolynomialInTrSegment
 The evaluator class for a melting curve formed of segments in the form. More...
 
struct  MeltingLinePiecewisePolynomialInTrData
 
class  MeltingLinePiecewisePolynomialInThetaSegment
 The evaluator class for a melting curve formed of segments in the form. More...
 
struct  MeltingLinePiecewisePolynomialInThetaData
 
class  MeltingLineVariables
 
class  CachedElement
 
class  ConfigurationItem
 
class  Configuration
 
struct  BibTeXKeysStruct
 
struct  EnvironmentalFactorsStruct
 
struct  CriticalRegionSplines
 
struct  EOSLimits
 A set of limits for the eos parameters. More...
 
struct  ConductivityECSVariables
 
struct  ConductivityDiluteEta0AndPolyData
 
struct  ConductivityDiluteRatioPolynomialsData
 
struct  ConductivityDiluteVariables
 
struct  ConductivityResidualPolynomialAndExponentialData
 
struct  ConductivityResidualPolynomialData
 
struct  ConductivityResidualVariables
 
struct  ConductivityCriticalSimplifiedOlchowySengersData
 
struct  ConductivityCriticalVariables
 
struct  ViscosityDiluteGasCollisionIntegralData
 Variables for the dilute gas part. More...
 
struct  ViscosityDiluteCollisionIntegralPowersOfTstarData
 
struct  ViscosityDiluteGasPowersOfT
 
struct  ViscosityDiluteGasPowersOfTr
 
struct  ViscosityDiluteVariables
 
struct  ViscosityRainWaterFriendData
 
struct  ViscosityInitialDensityEmpiricalData
 
struct  ViscosityInitialDensityVariables
 
struct  ViscosityModifiedBatschinskiHildebrandData
 
struct  ViscosityFrictionTheoryData
 
struct  ViscosityHigherOrderVariables
 
struct  ViscosityRhoSrVariables
 
struct  ViscosityECSVariables
 
struct  ViscosityChungData
 
class  TransportPropertyData
 
struct  Ancillaries
 
class  EquationOfState
 The core class for an equation of state. More...
 
class  CoolPropFluid
 A thermophysical property provider for critical and reducing values as well as derivatives of Helmholtz energy. More...
 
struct  SimpleState
 
struct  CriticalState
 
struct  SsatSimpleState
 A modified class for the state point at the maximum saturation entropy on the vapor curve. More...
 
class  CoolPropBaseError
 
class  CoolPropError
 
class  ValueErrorSpec
 
struct  HelmholtzDerivatives
 
class  BaseHelmholtzTerm
 The base class class for the Helmholtz energy terms. More...
 
struct  ResidualHelmholtzGeneralizedExponentialElement
 
class  ResidualHelmholtzGeneralizedExponential
 A generalized residual helmholtz energy container that can deal with a wide range of terms which can be converted to this general form. More...
 
struct  ResidualHelmholtzNonAnalyticElement
 
class  ResidualHelmholtzNonAnalytic
 
class  ResidualHelmholtzGeneralizedCubic
 
class  ResidualHelmholtzGaoB
 
class  ResidualHelmholtzXiangDeiters
 The generalized Lee-Kesler formulation of Xiang & Deiters: doi:10.1016/j.ces.2007.11.029. More...
 
class  ResidualHelmholtzSAFTAssociating
 
class  BaseHelmholtzContainer
 
class  ResidualHelmholtzContainer
 
class  IdealHelmholtzLead
 The leading term in the EOS used to set the desired reference state. More...
 
class  IdealHelmholtzEnthalpyEntropyOffset
 The term in the EOS used to shift the reference state of the fluid. More...
 
class  IdealHelmholtzLogTau
 
class  IdealHelmholtzPower
 
class  IdealHelmholtzPlanckEinsteinGeneralized
 
class  IdealHelmholtzCP0Constant
 
class  IdealHelmholtzCP0PolyT
 
class  IdealHelmholtzGERG2004Sinh
 
class  IdealHelmholtzGERG2004Cosh
 
class  IdealHelmholtzContainer
 
More...
 
class  CurveTracer
 
class  IdealCurveTracer
 
class  BoyleCurveTracer
 
class  JouleInversionCurveTracer
 
class  JouleThomsonCurveTracer
 
struct  IncompressibleData
 
class  IncompressibleFluid
 A property provider for incompressible solutions and pure fluids. More...
 
struct  PCSAFTValues
 
class  PCSAFTFluid
 
class  PhaseEnvelopeData
 A data structure to hold the data for a phase envelope. More...
 
class  Polynomial2D
 The base class for all Polynomials. More...
 
class  Poly2DResidual
 
class  Polynomial2DFrac
 A class for polynomials starting at an arbitrary degree. More...
 
class  Poly2DFracResidual
 
class  Poly2DFracIntResidual
 
class  FuncWrapper1D
 
class  FuncWrapper1DWithDeriv
 
class  FuncWrapper1DWithTwoDerivs
 
class  FuncWrapper1DWithThreeDerivs
 
class  FuncWrapperND
 

Typedefs

typedef std::vector< std::vector< CoolPropDbl > > STLMatrix
 
typedef shared_ptr< DepartureFunctionDepartureFunctionPointer
 
typedef std::vector< std::vector< double > > mat
 This class implements bicubic interpolation, as very clearly laid out by the page on wikipedia: http://en.wikipedia.org/wiki/Bicubic_interpolation. More...
 
typedef CoolPropError< CoolPropBaseError::eNotImplementedNotImplementedError
 
typedef CoolPropError< CoolPropBaseError::eSolutionSolutionError
 
typedef CoolPropError< CoolPropBaseError::eAttributeAttributeError
 
typedef CoolPropError< CoolPropBaseError::eOutOfRangeOutOfRangeError
 
typedef CoolPropError< CoolPropBaseError::eValueValueError
 
typedef CoolPropError< CoolPropBaseError::eKeyKeyError
 
typedef CoolPropError< CoolPropBaseError::eHandleHandleError
 
typedef CoolPropError< CoolPropBaseError::eUnableToLoadUnableToLoadError
 
typedef CoolPropError< CoolPropBaseError::eDirectorySizeDirectorySizeError
 
typedef ValueErrorSpec< CoolPropBaseError::eWrongFluidWrongFluidError
 
typedef ValueErrorSpec< CoolPropBaseError::eCompositionCompositionError
 
typedef ValueErrorSpec< CoolPropBaseError::eInputInputError
 
typedef ValueErrorSpec< CoolPropBaseError::eNotAvailableNotAvailableError
 

Enumerations

enum  x_N_dependency_flag { XN_INDEPENDENT , XN_DEPENDENT }
 
enum  parameters {
  INVALID_PARAMETER = 0 , igas_constant , imolar_mass , iacentric_factor ,
  irhomolar_reducing , irhomolar_critical , iT_reducing , iT_critical ,
  irhomass_reducing , irhomass_critical , iP_critical , iP_reducing ,
  iT_triple , iP_triple , iT_min , iT_max ,
  iP_max , iP_min , idipole_moment , iT ,
  iP , iQ , iTau , iDelta ,
  iDmolar , iHmolar , iSmolar , iCpmolar ,
  iCp0molar , iCvmolar , iUmolar , iGmolar ,
  iHelmholtzmolar , iHmolar_residual , iSmolar_residual , iGmolar_residual ,
  iDmass , iHmass , iSmass , iCpmass ,
  iCp0mass , iCvmass , iUmass , iGmass ,
  iHelmholtzmass , iviscosity , iconductivity , isurface_tension ,
  iPrandtl , ispeed_sound , iisothermal_compressibility , iisobaric_expansion_coefficient ,
  iisentropic_expansion_coefficient , ifundamental_derivative_of_gas_dynamics , ialphar , idalphar_dtau_constdelta ,
  idalphar_ddelta_consttau , ialpha0 , idalpha0_dtau_constdelta , idalpha0_ddelta_consttau ,
  id2alpha0_ddelta2_consttau , id3alpha0_ddelta3_consttau , iBvirial , iCvirial ,
  idBvirial_dT , idCvirial_dT , iZ , iPIP ,
  ifraction_min , ifraction_max , iT_freeze , iGWP20 ,
  iGWP100 , iGWP500 , iFH , iHH ,
  iPH , iODP , iPhase , iundefined_parameter
}
 
enum  phases {
  iphase_liquid , iphase_supercritical , iphase_supercritical_gas , iphase_supercritical_liquid ,
  iphase_critical_point , iphase_gas , iphase_twophase , iphase_unknown ,
  iphase_not_imposed
}
 These are constants for the phases of the fluid. More...
 
enum  schemes {
  i1 , i2a , i2b , i3a ,
  i3b , i4a , i4b , i4c
}
 Constants for the different PC-SAFT association schemes (see Huang and Radosz 1990) More...
 
enum  composition_types {
  IFRAC_MASS , IFRAC_MOLE , IFRAC_VOLUME , IFRAC_UNDEFINED ,
  IFRAC_PURE
}
 These are constants for the compositions. More...
 
enum  fluid_types {
  FLUID_TYPE_PURE , FLUID_TYPE_PSEUDOPURE , FLUID_TYPE_REFPROP , FLUID_TYPE_INCOMPRESSIBLE_LIQUID ,
  FLUID_TYPE_INCOMPRESSIBLE_SOLUTION , FLUID_TYPE_UNDEFINED
}
 These are unit types for the fluid. More...
 
enum  input_pairs {
  INPUT_PAIR_INVALID = 0 , QT_INPUTS , PQ_INPUTS , QSmolar_INPUTS ,
  QSmass_INPUTS , HmolarQ_INPUTS , HmassQ_INPUTS , DmolarQ_INPUTS ,
  DmassQ_INPUTS , PT_INPUTS , DmassT_INPUTS , DmolarT_INPUTS ,
  HmolarT_INPUTS , HmassT_INPUTS , SmolarT_INPUTS , SmassT_INPUTS ,
  TUmolar_INPUTS , TUmass_INPUTS , DmassP_INPUTS , DmolarP_INPUTS ,
  HmassP_INPUTS , HmolarP_INPUTS , PSmass_INPUTS , PSmolar_INPUTS ,
  PUmass_INPUTS , PUmolar_INPUTS , HmassSmass_INPUTS , HmolarSmolar_INPUTS ,
  SmassUmass_INPUTS , SmolarUmolar_INPUTS , DmassHmass_INPUTS , DmolarHmolar_INPUTS ,
  DmassSmass_INPUTS , DmolarSmolar_INPUTS , DmassUmass_INPUTS , DmolarUmolar_INPUTS
}
 These are input pairs that can be used for the update function (in each pair, input keys are sorted alphabetically) More...
 
enum  backend_families {
  INVALID_BACKEND_FAMILY = 0 , HEOS_BACKEND_FAMILY , REFPROP_BACKEND_FAMILY , INCOMP_BACKEND_FAMILY ,
  IF97_BACKEND_FAMILY , TREND_BACKEND_FAMILY , TTSE_BACKEND_FAMILY , BICUBIC_BACKEND_FAMILY ,
  SRK_BACKEND_FAMILY , PR_BACKEND_FAMILY , VTPR_BACKEND_FAMILY , PCSAFT_BACKEND_FAMILY
}
 The structure is taken directly from the AbstractState class. More...
 
enum  backends {
  INVALID_BACKEND = 0 , HEOS_BACKEND_PURE , HEOS_BACKEND_MIX , REFPROP_BACKEND_PURE ,
  REFPROP_BACKEND_MIX , INCOMP_BACKEND , IF97_BACKEND , TREND_BACKEND ,
  TTSE_BACKEND , BICUBIC_BACKEND , SRK_BACKEND , PR_BACKEND ,
  VTPR_BACKEND , PCSAFT_BACKEND
}
 

Functions

BackendLibraryget_backend_library ()
 
void register_backend (const backend_families &bf, shared_ptr< AbstractStateGenerator > gen)
 
void get_dT_drho (AbstractState &AS, parameters index, CoolPropDbl &dT, CoolPropDbl &drho)
 
void get_dT_drho_second_derivatives (AbstractState &AS, int index, CoolPropDbl &dT2, CoolPropDbl &drho_dT, CoolPropDbl &drho2)
 
void get_Henrys_coeffs_FP (const std::string &CAS, double &A, double &B, double &C, double &Tmin, double &Tmax)
 
void load ()
 
JSONFluidLibraryget_library (void)
 Get a reference to the library instance. More...
 
CoolPropFluid get_fluid (const std::string &fluid_string)
 Get the fluid structure. More...
 
std::string get_fluid_as_JSONstring (const std::string &indentifier)
 Get the fluid as a JSON string, suitable for modification and reloading. More...
 
std::string get_fluid_list (void)
 Get a comma-separated-list of fluids that are included. More...
 
void set_fluid_enthalpy_entropy_offset (const std::string &fluid, double delta_a1, double delta_a2, const std::string &ref)
 Set the internal enthalpy and entropy offset variables. More...
 
int get_debug_level ()
 
std::string vecstring_to_string (const std::vector< std::string > &a)
 Templates for turning vectors (1D-matrices) into strings. More...
 
void get_dT_drho (HelmholtzEOSMixtureBackend *HEOS, parameters index, CoolPropDbl &dT, CoolPropDbl &drho)
 
std::string get_csv_predefined_mixtures ()
 Get a comma-separated list of predefined mixtures in CoolProp. More...
 
bool is_predefined_mixture (const std::string &name, Dictionary &dict)
 Get the parameters for a predefined mixture - R410A, R404A, etc. if the mixture is predefined. More...
 
void set_predefined_mixtures (const std::string &string_data)
 Set predefined mixtures at runtime. More...
 
void apply_simple_mixing_rule (const std::string &identifier1, const std::string &identifier2, const std::string &rule)
 Add a simple mixing rule. More...
 
std::string get_csv_mixture_binary_pairs ()
 Get a comma-separated list of CAS code pairs. More...
 
std::string get_mixture_binary_pair_data (const std::string &CAS1, const std::string &CAS2, const std::string &param)
 Get a string for the given binary pair. More...
 
void set_mixture_binary_pair_data (const std::string &CAS1, const std::string &CAS2, const std::string &param, const double val)
 Set a parameter for the given binary pair. More...
 
std::string get_reducing_function_name (const std::string &CAS1, const std::string &CAS2)
 
void set_interaction_parameters (const std::string &string_data)
 Set the interaction parameters from a string format. More...
 
DepartureFunctionget_departure_function (const std::string &Name)
 Get the allocated Departure function for a given departure function name. More...
 
void parse_HMX_BNC (const std::string &s, std::vector< REFPROP_binary_element > &BIP, std::vector< REFPROP_departure_function > &functions)
 
void set_departure_functions (const std::string &string_data)
 Set the departure functions in the departure function library from a string format. More...
 
CoolPropDbl sign (CoolPropDbl x)
 
void load_incompressible_library ()
 
JSONIncompressibleLibraryget_incompressible_library (void)
 Get a reference to the library instance. More...
 
IncompressibleFluidget_incompressible_fluid (const std::string &fluid_string)
 Get the fluid structure returned as a reference. More...
 
std::string get_incompressible_list_pure (void)
 Return a comma-separated list of incompressible pure fluid names. More...
 
std::string get_incompressible_list_solution (void)
 Return a comma-separated list of solution names. More...
 
std::string get_mixture_binary_pair_pcsaft (const std::string &CAS1, const std::string &CAS2, const std::string &key)
 
void set_mixture_binary_pair_pcsaft (const std::string &CAS1, const std::string &CAS2, const std::string &key, const double value)
 
bool force_load_REFPROP ()
 
bool force_unload_REFPROP ()
 
void REFPROP_SETREF (char hrf[3], int ixflag, double x0[1], double &h0, double &s0, double &T0, double &p0, int &ierr, char herr[255], int l1, int l2)
 
template<typename T >
void load_table (T &table, const std::string &path_to_tables, const std::string &filename)
 
template<typename T >
void write_table (const T &table, const std::string &path_to_tables, const std::string &name)
 
void mass_to_molar (parameters &param, double &conversion_factor, double molar_mass)
 Get a conversion factor from mass to molar if needed. More...
 
std::string config_key_to_string (configuration_keys keys)
 Convert the configuration key to a string in a 1-1 representation. More...
 
std::string config_key_description (configuration_keys keys)
 Return a string description of the configuration key. More...
 
std::string config_key_description (const std::string &key)
 Return a string description of the configuration key (with the key passed as a string) More...
 
configuration_keys config_string_to_key (const std::string &s)
 Go from string to enum key. More...
 
void set_config_bool (configuration_keys key, bool val)
 Set the value of a boolean configuration value. More...
 
void set_config_int (configuration_keys key, int val)
 Set the value of an integer configuration value. More...
 
void set_config_double (configuration_keys key, double val)
 Set the value of a double configuration value. More...
 
void set_config_string (configuration_keys key, const std::string &val)
 Set the value of a string configuration value. More...
 
bool get_config_bool (configuration_keys key)
 Return the value of a boolean key from the configuration. More...
 
int get_config_int (configuration_keys key)
 Return the value of an integer key from the configuration. More...
 
double get_config_double (configuration_keys key)
 Return the value of a double configuration key. More...
 
std::string get_config_string (configuration_keys key)
 Return the value of a string configuration key. More...
 
void get_config_as_json (rapidjson::Document &doc)
 
std::string get_config_as_json_string ()
 Get all the values in the configuration as a json-formatted string. More...
 
void set_config_as_json (rapidjson::Value &val)
 
void set_config_as_json_string (const std::string &s)
 Set the entire configuration based on a json-formatted string. More...
 
void set_debug_level (int level)
 
void set_warning_string (const std::string &warning)
 
void set_error_string (const std::string &error)
 
bool has_backend_in_string (const std::string &fluid_string, std::size_t &i)
 
void extract_backend (std::string fluid_string, std::string &backend, std::string &fluid)
 Extract the backend from a string - something like "HEOS::Water" would split to "HEOS" and "Water". If no backend is specified, the backend will be set to "?". More...
 
bool has_fractions_in_string (const std::string &fluid_string)
 
bool has_solution_concentration (const std::string &fluid_string)
 
std::string extract_fractions (const std::string &fluid_string, std::vector< double > &fractions)
 Extract fractions (molar, mass, etc.) encoded in the string if any. More...
 
void _PropsSI_initialize (const std::string &backend, const std::vector< std::string > &fluid_names, const std::vector< double > &z, shared_ptr< AbstractState > &State)
 
void _PropsSI_outputs (shared_ptr< AbstractState > &State, const std::vector< output_parameter > &output_parameters, CoolProp::input_pairs input_pair, const std::vector< double > &in1, const std::vector< double > &in2, std::vector< std::vector< double >> &IO)
 
bool StripPhase (std::string &Name, shared_ptr< AbstractState > &State)
 
void _PropsSImulti (const std::vector< std::string > &Outputs, const std::string &Name1, const std::vector< double > &Prop1, const std::string &Name2, const std::vector< double > &Prop2, const std::string &backend, const std::vector< std::string > &fluids, const std::vector< double > &fractions, std::vector< std::vector< double >> &IO)
 
std::vector< std::vector< double > > PropsSImulti (const std::vector< std::string > &Outputs, const std::string &Name1, const std::vector< double > &Prop1, const std::string &Name2, const std::vector< double > &Prop2, const std::string &backend, const std::vector< std::string > &fluids, const std::vector< double > &fractions)
 Get a matrix of outputs for a given input. Can handle both vector inputs as well as a vector of output strings. More...
 
double PropsSI (const std::string &Output, const std::string &Name1, double Prop1, const std::string &Name2, double Prop2, const std::string &Ref)
 
bool add_fluids_as_JSON (const std::string &backend, const std::string &fluidstring)
 Add fluids as a JSON-formatted string. More...
 
double Props1SI (std::string FluidName, std::string Output)
 
std::vector< std::vector< double > > Props1SImulti (const std::vector< std::string > &Outputs, const std::string &backend, const std::vector< std::string > &fluids, const std::vector< double > &fractions)
 Get a matrix of outputs that do not depend on the thermodynamic state - this is a convenience function that does the call PropsSImulti(Outputs, "", {0}, "", {0}, backend, fluids, fractions) More...
 
bool is_valid_fluid_string (const std::string &fluidstring)
 Check if the fluid name is valid. More...
 
double saturation_ancillary (const std::string &fluid_name, const std::string &output, int Q, const std::string &input, double value)
 
void set_reference_stateS (const std::string &FluidName, const std::string &reference_state)
 Set the reference state based on a string representation. More...
 
void set_reference_stateD (const std::string &Ref, double T, double rhomolar, double hmolar0, double smolar0)
 
std::string get_global_param_string (const std::string &ParamName)
 
std::string get_fluid_param_string (const std::string &FluidName, const std::string &ParamName)
 Get a string for a value from a fluid (numerical values for the fluid can be obtained from Props1SI function) More...
 
std::string phase_lookup_string (phases Phase)
 
std::string PhaseSI (const std::string &Name1, double Prop1, const std::string &Name2, double Prop2, const std::string &FluidName)
 
const ParameterInformationget_parameter_information ()
 
bool is_trivial_parameter (int key)
 Returns true if the input is trivial (constants, critical parameters, etc.) More...
 
std::string get_parameter_information (int key, const std::string &info)
 
std::string get_csv_parameter_list ()
 Return a list of parameters. More...
 
bool is_valid_parameter (const std::string &name, parameters &iOutput)
 Returns true if a valid parameter, and sets value in the variable iOutput. More...
 
bool is_valid_first_derivative (const std::string &name, parameters &iOf, parameters &iWrt, parameters &iConstant)
 
bool is_valid_first_saturation_derivative (const std::string &name, parameters &iOf, parameters &iWrt)
 
bool is_valid_second_derivative (const std::string &name, parameters &iOf1, parameters &iWrt1, parameters &iConstant1, parameters &iWrt2, parameters &iConstant2)
 
const PhaseInformationget_phase_information ()
 
const std::string & get_phase_short_desc (phases phase)
 
bool is_valid_phase (const std::string &phase_name, phases &iOutput)
 
phases get_phase_index (const std::string &param_name)
 Return the enum key corresponding to the phase name ("phase_liquid" for instance) More...
 
const SchemeInformationget_scheme_information ()
 
const std::string & get_scheme_short_desc (schemes scheme)
 
bool is_valid_scheme (const std::string &scheme_name, schemes &iOutput)
 
schemes get_scheme_index (const std::string &scheme_name)
 Return the enum key corresponding to the association scheme name ("2B" for instance) More...
 
parameters get_parameter_index (const std::string &param_name)
 Return the enum key corresponding to the parameter name ("Dmolar" for instance) More...
 
const InputPairInformationget_input_pair_information ()
 
input_pairs get_input_pair_index (const std::string &input_pair_name)
 Get the input pair index associated with its string representation. More...
 
const std::string & get_input_pair_short_desc (input_pairs pair)
 Return the short description of an input pair key ("DmolarT_INPUTS" for instance) More...
 
const std::string & get_input_pair_long_desc (input_pairs pair)
 Return the long description of an input pair key ("Molar density in mol/m^3, Temperature in K" for instance) More...
 
void split_input_pair (input_pairs pair, parameters &p1, parameters &p2)
 Split an input pair into parameters for the two parts that form the pair. More...
 
const BackendInformationget_backend_information ()
 
void extract_backend_families (std::string backend_string, backend_families &f1, backend_families &f2)
 Convert a string into the enum values. More...
 
void extract_backend_families_string (std::string backend_string, backend_families &f1, std::string &f2)
 
std::string get_backend_string (backends backend)
 
CoolPropDbl kahanSum (const std::vector< CoolPropDbl > &x)
 
bool wayToSort (CoolPropDbl i, CoolPropDbl j)
 
double ramp (double x)
 
double Xdd (double X, double delta, double Delta, double Delta_d, double Delta_dd)
 
const std::string ERR_NOT_A_TWO_PHASE_FLUID ("This is not a two-phase fluid. Please select another fluid or avoid two-phase functions.")
 
const std::string ERR_NOT_A_TWO_PHASE_STATE ("This is not a two-phase state, update state with a two-phase set of inputs")
 
const std::string ERR_NOT_COMPRESSIBLE ("This function is invalid for incompressible fluids.")
 
const std::string ERR_NOT_A_TWO_PHASE_FUNCTION ("This function is invalid in the two-phase region.")
 
std::vector< double > NDNewtonRaphson_Jacobian (FuncWrapperND *f, const std::vector< double > &x, double tol, int maxiter, double w)
 
double Newton (FuncWrapper1DWithDeriv *f, double x0, double ftol, int maxiter)
 
double Halley (FuncWrapper1DWithTwoDerivs *f, double x0, double ftol, int maxiter, double xtol_rel)
 
double Householder4 (FuncWrapper1DWithThreeDerivs *f, double x0, double ftol, int maxiter, double xtol_rel)
 
double Secant (FuncWrapper1D *f, double x0, double dx, double tol, int maxiter)
 
double BoundedSecant (FuncWrapper1D *f, double x0, double xmin, double xmax, double dx, double tol, int maxiter)
 
double ExtrapolatingSecant (FuncWrapper1D *f, double x0, double dx, double tol, int maxiter)
 
double Brent (FuncWrapper1D *f, double a, double b, double macheps, double t, int maxiter)
 
void compare_REFPROP_and_CoolProp (const std::string &fluid, CoolProp::input_pairs inputs, double val1, double val2, std::size_t N, double d1, double d2)
 
void set_config_json (rapidjson::Document &doc)
 Set values in the configuration based on a json file. More...
 
bool match_pair (parameters key1, parameters key2, parameters x1, parameters x2, bool &swap)
 
template<class T >
CoolProp::input_pairs generate_update_pair (parameters key1, T value1, parameters key2, T value2, T &out1, T &out2) throw ()
 Generate an update pair from key, value pairs. More...
 
template<class T >
std::size_t num_rows (std::vector< T > const &in)
 Some shortcuts and regularly needed operations. More...
 
template<class T >
std::size_t num_rows (std::vector< std::vector< T >> const &in)
 
template<class T >
std::size_t max_cols (std::vector< std::vector< T >> const &in)
 
template<class T >
bool is_squared (std::vector< std::vector< T >> const &in)
 
template<class T >
std::size_t num_cols (std::vector< T > const &in)
 
template<class T >
std::size_t num_cols (std::vector< std::vector< T >> const &in)
 
template<typename T >
std::vector< T > eigen_to_vec1D (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &coefficients, int axis=0)
 Convert vectors and matrices. More...
 
template<class T >
std::vector< std::vector< T > > eigen_to_vec (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &coefficients)
 
template<class T >
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > vec_to_eigen (const std::vector< std::vector< T >> &coefficients)
 
template<class T >
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > vec_to_eigen (const std::vector< T > &coefficients, int axis=0)
 
template<class T >
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > vec_to_eigen (const T &coefficient)
 
template<class T >
Eigen::Matrix< T, Eigen::Dynamic, 1 > makeColVector (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &matrix)
 Convert 1D matrix to vector. More...
 
template<class T >
Eigen::Matrix< T, Eigen::Dynamic, 1 > makeVector (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &matrix)
 
template<class T >
Eigen::Matrix< T, 1, Eigen::Dynamic > makeRowVector (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &matrix)
 
template<class T >
void removeRow (Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &matrix, std::size_t rowToRemove)
 Remove rows and columns from matrices. More...
 
template<class T >
void removeColumn (Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &matrix, std::size_t colToRemove)
 
template<class T >
std::string vec_to_string (const std::vector< T > &a, const char *fmt)
 Templates for turning vectors (1D-matrices) into strings. More...
 
template<class T >
std::string vec_to_string (const std::vector< T > &a)
 
std::string stringvec_to_string (const std::vector< std::string > &a)
 Templates for turning vectors (1D-matrices) into strings. More...
 
template<class T >
std::string vec_to_string (const T &a, const char *fmt)
 Templates for turning numbers (0D-matrices) into strings. More...
 
template<class T >
std::string vec_to_string (const T &a)
 
template<class T >
std::string vec_to_string (const std::vector< std::vector< T >> &A, const char *fmt)
 Templates for turning 2D-matrices into strings. More...
 
template<class T >
std::string vec_to_string (const std::vector< std::vector< T >> &A)
 
template<class T >
std::string mat_to_string (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &A, const char *fmt)
 Templates for turning Eigen matrices into strings. More...
 
template<class T >
std::string mat_to_string (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &A)
 
template<typename T >
void swap_rows (std::vector< std::vector< T >> *A, size_t row1, size_t row2)
 Template class for turning numbers (0D-matrices) into strings. More...
 
template<typename T >
void subtract_row_multiple (std::vector< std::vector< T >> *A, size_t row, T multiple, size_t pivot_row)
 
template<typename T >
void divide_row_by (std::vector< std::vector< T >> *A, size_t row, T value)
 
template<typename T >
size_t get_pivot_row (std::vector< std::vector< T >> *A, size_t col)
 
template<typename T >
std::vector< std::vector< T > > linsolve_Gauss_Jordan (std::vector< std::vector< T >> const &A, std::vector< std::vector< T >> const &B)
 
template<class T >
std::vector< std::vector< T > > linsolve (std::vector< std::vector< T >> const &A, std::vector< std::vector< T >> const &B)
 
template<class T >
std::vector< T > linsolve (std::vector< std::vector< T >> const &A, std::vector< T > const &b)
 
template<class T >
std::vector< T > get_row (std::vector< std::vector< T >> const &in, size_t row)
 
template<class T >
std::vector< T > get_col (std::vector< std::vector< T >> const &in, size_t col)
 
template<class T >
std::vector< std::vector< T > > make_squared (std::vector< std::vector< T >> const &in)
 
template<class T >
multiply (std::vector< T > const &a, std::vector< T > const &b)
 
template<class T >
std::vector< T > multiply (std::vector< std::vector< T >> const &A, std::vector< T > const &b)
 
template<class T >
std::vector< std::vector< T > > multiply (std::vector< std::vector< T >> const &A, std::vector< std::vector< T >> const &B)
 
template<class T >
dot_product (std::vector< T > const &a, std::vector< T > const &b)
 
template<class T >
std::vector< T > cross_product (std::vector< T > const &a, std::vector< T > const &b)
 
template<class T >
std::vector< std::vector< T > > transpose (std::vector< std::vector< T >> const &in)
 
template<class T >
std::vector< std::vector< T > > invert (std::vector< std::vector< T >> const &in)
 
void removeRow (Eigen::MatrixXd &matrix, unsigned int rowToRemove)
 
void removeColumn (Eigen::MatrixXd &matrix, unsigned int colToRemove)
 
template<typename Derived >
Eigen::MatrixXd minor_matrix (const Eigen::MatrixBase< Derived > &A, std::size_t i, std::size_t j)
 
double Brent (FuncWrapper1D &f, double a, double b, double macheps, double t, int maxiter)
 
double Secant (FuncWrapper1D &f, double x0, double dx, double ftol, int maxiter)
 
double ExtrapolatingSecant (FuncWrapper1D &f, double x0, double dx, double ftol, int maxiter)
 
double BoundedSecant (FuncWrapper1D &f, double x0, double xmin, double xmax, double dx, double ftol, int maxiter)
 
double Newton (FuncWrapper1DWithDeriv &f, double x0, double ftol, int maxiter)
 
double Halley (FuncWrapper1DWithTwoDerivs &f, double x0, double ftol, int maxiter, double xtol_rel=1e-12)
 
double Householder4 (FuncWrapper1DWithThreeDerivs &f, double x0, double ftol, int maxiter, double xtol_rel=1e-12)
 
void compare_REFPROP_and_CoolProp (const std::string &fluid, int inputs, double val1, double val2, std::size_t N, double d1=0, double d2=0)
 

Variables

const parameter_info parameter_info_list []
 
ParameterInformationparameter_information_p = nullptr
 
const phase_info phase_info_list []
 
PhaseInformationphase_information_p = nullptr
 
const scheme_info scheme_info_list []
 
SchemeInformationscheme_information_p = nullptr
 
const input_pair_info input_pair_list []
 
InputPairInformationinput_pair_information_p = nullptr
 
const backend_family_info backend_family_list []
 
const backend_info backend_list []
 
BackendInformationbackend_information_p = nullptr
 
constexpr double CPPOLY_EPSILON = DBL_EPSILON * 100.0
 
constexpr double CPPOLY_DELTA = CPPOLY_EPSILON * 10.0
 

Typedef Documentation

◆ AttributeError

Definition at line 53 of file Exceptions.h.

◆ CompositionError

Definition at line 70 of file Exceptions.h.

◆ DepartureFunctionPointer

Definition at line 196 of file ExcessHEFunction.h.

◆ DirectorySizeError

Definition at line 59 of file Exceptions.h.

◆ HandleError

Definition at line 57 of file Exceptions.h.

◆ InputError

Definition at line 71 of file Exceptions.h.

◆ KeyError

Definition at line 56 of file Exceptions.h.

◆ mat

typedef std::vector<std::vector<double> > CoolProp::mat

This class implements bicubic interpolation, as very clearly laid out by the page on wikipedia: http://en.wikipedia.org/wiki/Bicubic_interpolation.

Essentially you have an already-inverted matrix that you need to multiply

\[ A^{-1} = \left[ \begin{array}{*{16}c} 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ -3 & 3 & 0 & 0 & -2 & -1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 2 & -2 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & -3 & 3 & 0 & 0 & -2 & -1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 2 & -2 & 0 & 0 & 1 & 1 & 0 & 0 \\ -3 & 0 & 3 & 0 & 0 & 0 & 0 & 0 & -2 & 0 & -1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & -3 & 0 & 3 & 0 & 0 & 0 & 0 & 0 & -2 & 0 & -1 & 0 \\ 9 & -9 & -9 & 9 & 6 & 3 & -6 & -3 & 6 & -6 & 3 & -3 & 4 & 2 & 2 & 1 \\ -6 & 6 & 6 & -6 & -3 & -3 & 3 & 3 & -4 & 4 & -2 & 2 & -2 & -2 & -1 & -1 \\ 2 & 0 & -2 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 2 & 0 & -2 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 1 & 0 \\ -6 & 6 & 6 & -6 & -4 & -2 & 4 & 2 & -3 & 3 & -3 & 3 & -2 & -1 & -2 & -1 \\ 4 & -4 & -4 & 4 & 2 & 2 & -2 & -2 & 2 & -2 & 2 & -2 & 1 & 1 & 1 & 1 \end{array} \right] \]

\[ x = \frac{h-h_i}{h_{i+1}-h_i} \]

\[ \frac{\partial x}{\partial h} = \frac{1}{h_{i+1}-h_i} \]

\[ \frac{\partial h}{\partial x} = h_{i+1}-h_i \]

\[ y = \frac{p-p_j}{p_{j+1}-p_j} \]

\[ \frac{\partial y}{\partial p} = \frac{1}{p_{j+1}-p_j} \]

\[ \frac{\partial p}{\partial y} = p_{j+1}-p_j \]

\[ \frac{\partial f}{\partial x} = \frac{\partial f}{\partial h}\cdot\frac{\partial h}{\partial x} \]

\

Definition at line 60 of file BicubicBackend.h.

◆ NotAvailableError

Definition at line 72 of file Exceptions.h.

◆ NotImplementedError

Definition at line 51 of file Exceptions.h.

◆ OutOfRangeError

Definition at line 54 of file Exceptions.h.

◆ SolutionError

Definition at line 52 of file Exceptions.h.

◆ STLMatrix

typedef std::vector< std::vector< CoolPropDbl > > CoolProp::STLMatrix

Definition at line 13 of file ExcessHEFunction.h.

◆ UnableToLoadError

Definition at line 58 of file Exceptions.h.

◆ ValueError

Definition at line 55 of file Exceptions.h.

◆ WrongFluidError

Definition at line 69 of file Exceptions.h.

Enumeration Type Documentation

◆ backend_families

The structure is taken directly from the AbstractState class.

Enumerator
INVALID_BACKEND_FAMILY 
HEOS_BACKEND_FAMILY 
REFPROP_BACKEND_FAMILY 
INCOMP_BACKEND_FAMILY 
IF97_BACKEND_FAMILY 
TREND_BACKEND_FAMILY 
TTSE_BACKEND_FAMILY 
BICUBIC_BACKEND_FAMILY 
SRK_BACKEND_FAMILY 
PR_BACKEND_FAMILY 
VTPR_BACKEND_FAMILY 
PCSAFT_BACKEND_FAMILY 

Definition at line 438 of file DataStructures.h.

◆ backends

Enumerator
INVALID_BACKEND 
HEOS_BACKEND_PURE 
HEOS_BACKEND_MIX 
REFPROP_BACKEND_PURE 
REFPROP_BACKEND_MIX 
INCOMP_BACKEND 
IF97_BACKEND 
TREND_BACKEND 
TTSE_BACKEND 
BICUBIC_BACKEND 
SRK_BACKEND 
PR_BACKEND 
VTPR_BACKEND 
PCSAFT_BACKEND 

Definition at line 453 of file DataStructures.h.

◆ composition_types

These are constants for the compositions.

Enumerator
IFRAC_MASS 
IFRAC_MOLE 
IFRAC_VOLUME 
IFRAC_UNDEFINED 
IFRAC_PURE 

Definition at line 252 of file DataStructures.h.

◆ fluid_types

These are unit types for the fluid.

Enumerator
FLUID_TYPE_PURE 
FLUID_TYPE_PSEUDOPURE 
FLUID_TYPE_REFPROP 
FLUID_TYPE_INCOMPRESSIBLE_LIQUID 
FLUID_TYPE_INCOMPRESSIBLE_SOLUTION 
FLUID_TYPE_UNDEFINED 

Definition at line 262 of file DataStructures.h.

◆ input_pairs

These are input pairs that can be used for the update function (in each pair, input keys are sorted alphabetically)

Enumerator
INPUT_PAIR_INVALID 
QT_INPUTS 

Molar quality, Temperature in K.

PQ_INPUTS 

Pressure in Pa, Molar quality.

QSmolar_INPUTS 

Molar quality, Entropy in J/mol/K.

QSmass_INPUTS 

Molar quality, Entropy in J/kg/K.

HmolarQ_INPUTS 

Enthalpy in J/mol, Molar quality.

HmassQ_INPUTS 

Enthalpy in J/kg, Molar quality.

DmolarQ_INPUTS 

Density in mol/m^3, Molar quality.

DmassQ_INPUTS 

Density in kg/m^3, Molar quality.

PT_INPUTS 

Pressure in Pa, Temperature in K.

DmassT_INPUTS 

Mass density in kg/m^3, Temperature in K.

DmolarT_INPUTS 

Molar density in mol/m^3, Temperature in K.

HmolarT_INPUTS 

Enthalpy in J/mol, Temperature in K.

HmassT_INPUTS 

Enthalpy in J/kg, Temperature in K.

SmolarT_INPUTS 

Entropy in J/mol/K, Temperature in K.

SmassT_INPUTS 

Entropy in J/kg/K, Temperature in K.

TUmolar_INPUTS 

Temperature in K, Internal energy in J/mol.

TUmass_INPUTS 

Temperature in K, Internal energy in J/kg.

DmassP_INPUTS 

Mass density in kg/m^3, Pressure in Pa.

DmolarP_INPUTS 

Molar density in mol/m^3, Pressure in Pa.

HmassP_INPUTS 

Enthalpy in J/kg, Pressure in Pa.

HmolarP_INPUTS 

Enthalpy in J/mol, Pressure in Pa.

PSmass_INPUTS 

Pressure in Pa, Entropy in J/kg/K.

PSmolar_INPUTS 

Pressure in Pa, Entropy in J/mol/K.

PUmass_INPUTS 

Pressure in Pa, Internal energy in J/kg.

PUmolar_INPUTS 

Pressure in Pa, Internal energy in J/mol.

HmassSmass_INPUTS 

Enthalpy in J/kg, Entropy in J/kg/K.

HmolarSmolar_INPUTS 

Enthalpy in J/mol, Entropy in J/mol/K.

SmassUmass_INPUTS 

Entropy in J/kg/K, Internal energy in J/kg.

SmolarUmolar_INPUTS 

Entropy in J/mol/K, Internal energy in J/mol.

DmassHmass_INPUTS 

Mass density in kg/m^3, Enthalpy in J/kg.

DmolarHmolar_INPUTS 

Molar density in mol/m^3, Enthalpy in J/mol.

DmassSmass_INPUTS 

Mass density in kg/m^3, Entropy in J/kg/K.

DmolarSmolar_INPUTS 

Molar density in mol/m^3, Entropy in J/mol/K.

DmassUmass_INPUTS 

Mass density in kg/m^3, Internal energy in J/kg.

DmolarUmolar_INPUTS 

Molar density in mol/m^3, Internal energy in J/mol.

Definition at line 274 of file DataStructures.h.

◆ parameters


Define some constants that will be used throughout

These are constants for the input and output parameters The structure is taken directly from the AbstractState class.

Enumerator
INVALID_PARAMETER 
igas_constant 

Ideal-gas constant.

imolar_mass 

Molar mass.

iacentric_factor 

Acentric factor.

irhomolar_reducing 

Molar density used for the reducing state.

irhomolar_critical 

Molar density used for the critical point.

iT_reducing 

Temperature at the reducing state.

iT_critical 

Temperature at the critical point.

irhomass_reducing 

Mass density at the reducing state.

irhomass_critical 

Mass density at the critical point.

iP_critical 

Pressure at the critical point.

iP_reducing 

Pressure at the reducing point.

iT_triple 

Triple point temperature.

iP_triple 

Triple point pressure.

iT_min 

Minimum temperature.

iT_max 

Maximum temperature.

iP_max 

Maximum pressure.

iP_min 

Minimum pressure.

idipole_moment 

Dipole moment.

iT 

Temperature.

iP 

Pressure.

iQ 

Vapor quality.

iTau 

Reciprocal reduced temperature.

iDelta 

Reduced density.

iDmolar 

Mole-based density.

iHmolar 

Mole-based enthalpy.

iSmolar 

Mole-based entropy.

iCpmolar 

Mole-based constant-pressure specific heat.

iCp0molar 

Mole-based ideal-gas constant-pressure specific heat.

iCvmolar 

Mole-based constant-volume specific heat.

iUmolar 

Mole-based internal energy.

iGmolar 

Mole-based Gibbs energy.

iHelmholtzmolar 

Mole-based Helmholtz energy.

iHmolar_residual 

The residual molar enthalpy.

iSmolar_residual 

The residual molar entropy (as a function of temperature and density)

iGmolar_residual 

The residual molar Gibbs energy.

iDmass 

Mass-based density.

iHmass 

Mass-based enthalpy.

iSmass 

Mass-based entropy.

iCpmass 

Mass-based constant-pressure specific heat.

iCp0mass 

Mass-based ideal-gas specific heat.

iCvmass 

Mass-based constant-volume specific heat.

iUmass 

Mass-based internal energy.

iGmass 

Mass-based Gibbs energy.

iHelmholtzmass 

Mass-based Helmholtz energy.

iviscosity 

Viscosity.

iconductivity 

Thermal conductivity.

isurface_tension 

Surface tension.

iPrandtl 

The Prandtl number.

ispeed_sound 

Speed of sound.

iisothermal_compressibility 

Isothermal compressibility.

iisobaric_expansion_coefficient 

Isobaric expansion coefficient.

iisentropic_expansion_coefficient 

Isentropic expansion coefficient.

ifundamental_derivative_of_gas_dynamics 

The fundamental derivative of gas dynamics.

ialphar 
idalphar_dtau_constdelta 
idalphar_ddelta_consttau 
ialpha0 
idalpha0_dtau_constdelta 
idalpha0_ddelta_consttau 
id2alpha0_ddelta2_consttau 
id3alpha0_ddelta3_consttau 
iBvirial 

Second virial coefficient.

iCvirial 

Third virial coefficient.

idBvirial_dT 

Derivative of second virial coefficient with temperature.

idCvirial_dT 

Derivative of third virial coefficient with temperature.

iZ 

The compressibility factor Z = p*v/(R*T)

iPIP 

The phase identification parameter of Venkatarathnam and Oellrich.

ifraction_min 

The minimum fraction (mole, mass, volume) for incompressibles.

ifraction_max 

The maximum fraction (mole,mass,volume) for incompressibles.

iT_freeze 

The freezing temperature for incompressibles.

iGWP20 

The 20-year global warming potential.

iGWP100 

The 100-year global warming potential.

iGWP500 

The 500-year global warming potential.

iFH 

Fire hazard index.

iHH 

Health hazard index.

iPH 

Physical hazard index.

iODP 

Ozone depletion potential (R-11 = 1.0)

iPhase 

The phase index of the given state.

iundefined_parameter 

The last parameter, so we can check that all parameters are described in DataStructures.cpp.

Definition at line 64 of file DataStructures.h.

◆ phases

These are constants for the phases of the fluid.

Enumerator
iphase_liquid 

Subcritical liquid.

iphase_supercritical 

Supercritical (p > pc, T > Tc)

iphase_supercritical_gas 

Supercritical gas (p < pc, T > Tc)

iphase_supercritical_liquid 

Supercritical liquid (p > pc, T < Tc)

iphase_critical_point 

At the critical point.

iphase_gas 

Subcritical gas.

iphase_twophase 

Twophase.

iphase_unknown 

Unknown phase.

iphase_not_imposed 

Definition at line 176 of file DataStructures.h.

◆ schemes

Constants for the different PC-SAFT association schemes (see Huang and Radosz 1990)

Enumerator
i1 
i2a 
i2b 
i3a 
i3b 
i4a 
i4b 
i4c 

Definition at line 190 of file DataStructures.h.

◆ x_N_dependency_flag

Enumerator
XN_INDEPENDENT 

x_N is an independent variable, and not calculated by \( x_N = 1-\sum_i x_i\)

XN_DEPENDENT 

x_N is an dependent variable, calculated by \( x_N = 1-\sum_i x_i\)

Definition at line 18 of file ReducingFunctions.h.

Function Documentation

◆ _PropsSI_initialize()

void CoolProp::_PropsSI_initialize ( const std::string &  backend,
const std::vector< std::string > &  fluid_names,
const std::vector< double > &  z,
shared_ptr< AbstractState > &  State 
)

Definition at line 213 of file CoolProp.cpp.

◆ _PropsSI_outputs()

void CoolProp::_PropsSI_outputs ( shared_ptr< AbstractState > &  State,
const std::vector< output_parameter > &  output_parameters,
CoolProp::input_pairs  input_pair,
const std::vector< double > &  in1,
const std::vector< double > &  in2,
std::vector< std::vector< double >> &  IO 
)

Definition at line 315 of file CoolProp.cpp.

◆ _PropsSImulti()

void CoolProp::_PropsSImulti ( const std::vector< std::string > &  Outputs,
const std::string &  Name1,
const std::vector< double > &  Prop1,
const std::string &  Name2,
const std::vector< double > &  Prop2,
const std::string &  backend,
const std::vector< std::string > &  fluids,
const std::vector< double > &  fractions,
std::vector< std::vector< double >> &  IO 
)

Definition at line 539 of file CoolProp.cpp.

◆ add_fluids_as_JSON()

bool CoolProp::add_fluids_as_JSON ( const std::string &  backend,
const std::string &  fluidstring 
)

Add fluids as a JSON-formatted string.

Parameters
backendThe backend to which these should be added; e.g. "HEOS", "SRK", "PR"
Returns
output Returns true if the fluids were able to be added

Definition at line 661 of file CoolProp.cpp.

◆ apply_simple_mixing_rule()

void CoolProp::apply_simple_mixing_rule ( const std::string &  identifier1,
const std::string &  identifier2,
const std::string &  rule 
)

Add a simple mixing rule.

Apply a simple mixing rule for a given binary pair.

Parameters
identifier1The CAS # (or name) for the first fluid
identifier2The CAS # (or name) for the second fluid
ruleThe simple mixing rule to be used ("linear", "Lorentz-Berthelot")

Definition at line 291 of file MixtureParameters.cpp.

◆ BoundedSecant() [1/2]

double CoolProp::BoundedSecant ( FuncWrapper1D f,
double  x0,
double  xmin,
double  xmax,
double  dx,
double  ftol,
int  maxiter 
)
inline

Definition at line 92 of file Solvers.h.

◆ BoundedSecant() [2/2]

double CoolProp::BoundedSecant ( FuncWrapper1D f,
double  x0,
double  xmin,
double  xmax,
double  dx,
double  tol,
int  maxiter 
)

In the secant function, a 1-D Newton-Raphson solver is implemented. An initial guess for the solution is provided.

Parameters
fA pointer to an instance of the FuncWrapper1D class that implements the call() function
x0The initial guess for the solution
xmaxThe upper bound for the solution
xminThe lower bound for the solution
dxThe initial amount that is added to x in order to build the numerical derivative
tolThe absolute value of the tolerance accepted for the objective function
maxiterMaximum number of iterations
Returns
If no errors are found, the solution, otherwise the value _HUGE, the value for infinity

Definition at line 358 of file Solvers.cpp.

◆ Brent() [1/2]

double CoolProp::Brent ( FuncWrapper1D f,
double  a,
double  b,
double  macheps,
double  t,
int  maxiter 
)
inline

Definition at line 82 of file Solvers.h.

◆ Brent() [2/2]

double CoolProp::Brent ( FuncWrapper1D f,
double  a,
double  b,
double  macheps,
double  t,
int  maxiter 
)

This function implements a 1-D bounded solver using the algorithm from Brent, R. P., Algorithms for Minimization Without Derivatives. Englewood Cliffs, NJ: Prentice-Hall, 1973. Ch. 3-4.

a and b must bound the solution of interest and f(a) and f(b) must have opposite signs. If the function is continuous, there must be at least one solution in the interval [a,b].

Parameters
fA pointer to an instance of the FuncWrapper1D class that must implement the class() function
aThe minimum bound for the solution of f=0
bThe maximum bound for the solution of f=0
machepsThe machine precision
tTolerance (absolute)
maxiterMaximum number of steps allowed. Will throw a SolutionError if the solution cannot be found

Definition at line 492 of file Solvers.cpp.

◆ compare_REFPROP_and_CoolProp() [1/2]

void CoolProp::compare_REFPROP_and_CoolProp ( const std::string &  fluid,
CoolProp::input_pairs  inputs,
double  val1,
double  val2,
std::size_t  N,
double  d1,
double  d2 
)

Definition at line 16 of file SpeedTest.cpp.

◆ compare_REFPROP_and_CoolProp() [2/2]

void CoolProp::compare_REFPROP_and_CoolProp ( const std::string &  fluid,
int  inputs,
double  val1,
double  val2,
std::size_t  N,
double  d1 = 0,
double  d2 = 0 
)

◆ config_key_description() [1/2]

std::string CoolProp::config_key_description ( configuration_keys  keys)

Return a string description of the configuration key.

Definition at line 22 of file Configuration.cpp.

◆ config_key_description() [2/2]

std::string CoolProp::config_key_description ( const std::string &  key)

Return a string description of the configuration key (with the key passed as a string)

Definition at line 38 of file Configuration.cpp.

◆ config_key_to_string()

std::string CoolProp::config_key_to_string ( configuration_keys  keys)

Convert the configuration key to a string in a 1-1 representation.

Definition at line 6 of file Configuration.cpp.

◆ config_string_to_key()

configuration_keys CoolProp::config_string_to_key ( const std::string &  s)

Go from string to enum key.

Convert a string description to a configuration key.

Definition at line 53 of file Configuration.cpp.

◆ cross_product()

template<class T >
std::vector<T> CoolProp::cross_product ( std::vector< T > const &  a,
std::vector< T > const &  b 
)

Definition at line 842 of file MatrixMath.h.

◆ divide_row_by()

template<typename T >
void CoolProp::divide_row_by ( std::vector< std::vector< T >> *  A,
size_t  row,
value 
)

Definition at line 571 of file MatrixMath.h.

◆ dot_product()

template<class T >
T CoolProp::dot_product ( std::vector< T > const &  a,
std::vector< T > const &  b 
)

Definition at line 834 of file MatrixMath.h.

◆ eigen_to_vec()

template<class T >
std::vector<std::vector<T> > CoolProp::eigen_to_vec ( const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &  coefficients)
Parameters
coefficientsmatrix containing the ordered coefficients

Definition at line 119 of file MatrixMath.h.

◆ eigen_to_vec1D()

template<typename T >
std::vector<T> CoolProp::eigen_to_vec1D ( const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &  coefficients,
int  axis = 0 
)

Convert vectors and matrices.

Conversion functions for the different kinds of object-like parameters. This might be obsolete at a later stage, but now it is still needed.

Parameters
coefficientsmatrix containing the ordered coefficients
axisaxis along which to extract

Definition at line 97 of file MatrixMath.h.

◆ ERR_NOT_A_TWO_PHASE_FLUID()

const std::string CoolProp::ERR_NOT_A_TWO_PHASE_FLUID ( "This is not a two-phase fluid. Please select another fluid or avoid two-phase functions."  )

◆ ERR_NOT_A_TWO_PHASE_FUNCTION()

const std::string CoolProp::ERR_NOT_A_TWO_PHASE_FUNCTION ( "This function is invalid in the two-phase region."  )

◆ ERR_NOT_A_TWO_PHASE_STATE()

const std::string CoolProp::ERR_NOT_A_TWO_PHASE_STATE ( "This is not a two-phase  state,
update state with a two-phase set of inputs"   
)

◆ ERR_NOT_COMPRESSIBLE()

const std::string CoolProp::ERR_NOT_COMPRESSIBLE ( "This function is invalid for incompressible fluids."  )

◆ extract_backend()

void CoolProp::extract_backend ( std::string  fluid_string,
std::string &  backend,
std::string &  fluid 
)

Extract the backend from a string - something like "HEOS::Water" would split to "HEOS" and "Water". If no backend is specified, the backend will be set to "?".

Parameters
fluid_stringThe input string
backendThe output backend, if none found, "?"
fluidThe output fluid string (minus the backend string)

Definition at line 85 of file CoolProp.cpp.

◆ extract_backend_families()

void CoolProp::extract_backend_families ( std::string  backend_string,
backend_families f1,
backend_families f2 
)

Convert a string into the enum values.

Definition at line 829 of file DataStructures.cpp.

◆ extract_backend_families_string()

void CoolProp::extract_backend_families_string ( std::string  backend_string,
backend_families f1,
std::string &  f2 
)

Definition at line 846 of file DataStructures.cpp.

◆ extract_fractions()

std::string CoolProp::extract_fractions ( const std::string &  fluid_string,
std::vector< double > &  fractions 
)

Extract fractions (molar, mass, etc.) encoded in the string if any.

Parameters
fluid_stringThe input string
fractionsThe fractions
Returns
The fluids, as a '&' delimited string

Definition at line 126 of file CoolProp.cpp.

◆ ExtrapolatingSecant() [1/2]

double CoolProp::ExtrapolatingSecant ( FuncWrapper1D f,
double  x0,
double  dx,
double  ftol,
int  maxiter 
)
inline

Definition at line 89 of file Solvers.h.

◆ ExtrapolatingSecant() [2/2]

double CoolProp::ExtrapolatingSecant ( FuncWrapper1D f,
double  x0,
double  dx,
double  tol,
int  maxiter 
)

In the secant function, a 1-D Newton-Raphson solver is implemented. An initial guess for the solution is provided. Note that this is different than the Secant function because if something goes out of bounds, it will just make its best guess.

Parameters
fA pointer to an instance of the FuncWrapper1D class that implements the call() function
x0The initial guess for the solutionh
dxThe initial amount that is added to x in order to build the numerical derivative
tolThe absolute value of the tolerance accepted for the objective function
maxiterMaximum number of iterations
Returns
If no errors are found, the solution, otherwise the value _HUGE, the value for infinity

Definition at line 414 of file Solvers.cpp.

◆ force_load_REFPROP()

bool CoolProp::force_load_REFPROP ( )

Definition at line 2120 of file REFPROPMixtureBackend.cpp.

◆ force_unload_REFPROP()

bool CoolProp::force_unload_REFPROP ( )

Definition at line 2133 of file REFPROPMixtureBackend.cpp.

◆ generate_update_pair()

template<class T >
CoolProp::input_pairs CoolProp::generate_update_pair ( parameters  key1,
value1,
parameters  key2,
value2,
T &  out1,
T &  out2 
)
throw (
)

Generate an update pair from key, value pairs.

If the input pair is valid, v1 and v2 will correspond to the returned output pair

Parameters
key1The first input key
value1The first input value
key2The second input key
value2The second input value
out1The first output value
out2The second output value
Returns
pair, or INPUT_PAIR_INVALID if not valid

< Molar quality, Temperature in K

< Pressure in Pa, Molar quality

< Pressure in Pa, Temperature in K

< Entropy in J/kg/K, Internal energy in J/kg

< Entropy in J/mol/K, Internal energy in J/mol

Definition at line 338 of file DataStructures.h.

◆ get_backend_information()

const BackendInformation& CoolProp::get_backend_information ( )

Definition at line 820 of file DataStructures.cpp.

◆ get_backend_library()

BackendLibrary& CoolProp::get_backend_library ( )
inline

Definition at line 51 of file AbstractState.cpp.

◆ get_backend_string()

std::string CoolProp::get_backend_string ( backends  backend)

Definition at line 858 of file DataStructures.cpp.

◆ get_col()

template<class T >
std::vector<T> CoolProp::get_col ( std::vector< std::vector< T >> const &  in,
size_t  col 
)

Definition at line 742 of file MatrixMath.h.

◆ get_config_as_json()

void CoolProp::get_config_as_json ( rapidjson::Document &  doc)

Definition at line 98 of file Configuration.cpp.

◆ get_config_as_json_string()

std::string CoolProp::get_config_as_json_string ( )

Get all the values in the configuration as a json-formatted string.

Definition at line 105 of file Configuration.cpp.

◆ get_config_bool()

bool CoolProp::get_config_bool ( configuration_keys  key)

Return the value of a boolean key from the configuration.


GETTERS


Definition at line 86 of file Configuration.cpp.

◆ get_config_double()

double CoolProp::get_config_double ( configuration_keys  key)

Return the value of a double configuration key.

Definition at line 92 of file Configuration.cpp.

◆ get_config_int()

int CoolProp::get_config_int ( configuration_keys  key)

Return the value of an integer key from the configuration.

Definition at line 89 of file Configuration.cpp.

◆ get_config_string()

std::string CoolProp::get_config_string ( configuration_keys  key)

Return the value of a string configuration key.

Definition at line 95 of file Configuration.cpp.

◆ get_csv_mixture_binary_pairs()

std::string CoolProp::get_csv_mixture_binary_pairs ( )

Get a comma-separated list of CAS code pairs.

Each of the pairs will be CAS1&CAS2 ("&" delimited)

Definition at line 295 of file MixtureParameters.cpp.

◆ get_csv_parameter_list()

std::string CoolProp::get_csv_parameter_list ( )

Return a list of parameters.

Get a comma separated list of parameters.

Definition at line 200 of file DataStructures.cpp.

◆ get_csv_predefined_mixtures()

std::string CoolProp::get_csv_predefined_mixtures ( )

Get a comma-separated list of predefined mixtures in CoolProp.

Definition at line 55 of file MixtureParameters.cpp.

◆ get_debug_level()

int CoolProp::get_debug_level ( )

Get the debug level

Returns
level The level of the verbosity for the debugging output (0-10) 0: no debgging output

Definition at line 64 of file CoolProp.cpp.

◆ get_departure_function()

DepartureFunction * CoolProp::get_departure_function ( const std::string &  Name)

Get the allocated Departure function for a given departure function name.

Parameters
NameThe name of the function to be used, or its alias
Warning
The pointer points to an instance created with new, you should manage the pointer with shared_ptr or similar

Definition at line 518 of file MixtureParameters.cpp.

◆ get_dT_drho() [1/2]

void CoolProp::get_dT_drho ( AbstractState AS,
parameters  index,
CoolPropDbl dT,
CoolPropDbl drho 
)

Definition at line 745 of file AbstractState.cpp.

◆ get_dT_drho() [2/2]

void CoolProp::get_dT_drho ( HelmholtzEOSMixtureBackend HEOS,
parameters  index,
CoolPropDbl dT,
CoolPropDbl drho 
)

Definition at line 2098 of file HelmholtzEOSMixtureBackend.cpp.

◆ get_dT_drho_second_derivatives()

void CoolProp::get_dT_drho_second_derivatives ( AbstractState AS,
int  index,
CoolPropDbl dT2,
CoolPropDbl drho_dT,
CoolPropDbl drho2 
)

Definition at line 915 of file AbstractState.cpp.

◆ get_fluid()

CoolPropFluid CoolProp::get_fluid ( const std::string &  fluid_string)

Get the fluid structure.

Definition at line 334 of file FluidLibrary.cpp.

◆ get_fluid_as_JSONstring()

std::string CoolProp::get_fluid_as_JSONstring ( const std::string &  identifier)

Get the fluid as a JSON string, suitable for modification and reloading.

Definition at line 341 of file FluidLibrary.cpp.

◆ get_fluid_list()

std::string CoolProp::get_fluid_list ( void  )

Get a comma-separated-list of fluids that are included.

Definition at line 348 of file FluidLibrary.cpp.

◆ get_fluid_param_string()

std::string CoolProp::get_fluid_param_string ( const std::string &  FluidName,
const std::string &  ParamName 
)

Get a string for a value from a fluid (numerical values for the fluid can be obtained from Props1SI function)

Parameters
FluidNameThe name of the fluid that is part of CoolProp, for instance "n-Propane"
ParamNameA string, can be in one of the terms described in the following table
ParamName Description
"aliases" A comma separated list of aliases for the fluid
"CAS", "CAS_number" The CAS number
"ASHRAE34" The ASHRAE standard 34 safety rating
"REFPROPName","REFPROP_name" The name of the fluid used in REFPROP
"Bibtex-XXX" A BibTeX key, where XXX is one of the bibtex keys used in get_BibTeXKey
"pure" "true" if the fluid is pure, "false" otherwise
"formula" The chemical formula of the fluid in LaTeX form if available, "" otherwise
Returns
The string, or an error message if not valid input

Definition at line 1040 of file CoolProp.cpp.

◆ get_global_param_string()

std::string CoolProp::get_global_param_string ( const std::string &  ParamName)

Get a globally-defined string

Parameters
ParamNameA string, one of "version", "errstring", "warnstring", "gitrevision", "FluidsList", "fluids_list", "parameter_list","predefined_mixtures"
Returns
str The string, or an error message if not valid input

Definition at line 985 of file CoolProp.cpp.

◆ get_Henrys_coeffs_FP()

void CoolProp::get_Henrys_coeffs_FP ( const std::string &  CAS,
double &  A,
double &  B,
double &  C,
double &  Tmin,
double &  Tmax 
)

Definition at line 464 of file FlashRoutines.cpp.

◆ get_incompressible_fluid()

IncompressibleFluid & CoolProp::get_incompressible_fluid ( const std::string &  fluid_string)

Get the fluid structure returned as a reference.

Definition at line 566 of file IncompressibleLibrary.cpp.

◆ get_incompressible_library()

JSONIncompressibleLibrary & CoolProp::get_incompressible_library ( void  )

Get a reference to the library instance.

Definition at line 559 of file IncompressibleLibrary.cpp.

◆ get_incompressible_list_pure()

std::string CoolProp::get_incompressible_list_pure ( void  )

Return a comma-separated list of incompressible pure fluid names.

Definition at line 573 of file IncompressibleLibrary.cpp.

◆ get_incompressible_list_solution()

std::string CoolProp::get_incompressible_list_solution ( void  )

Return a comma-separated list of solution names.

Definition at line 579 of file IncompressibleLibrary.cpp.

◆ get_input_pair_index()

input_pairs CoolProp::get_input_pair_index ( const std::string &  input_pair_name)

Get the input pair index associated with its string representation.

Definition at line 588 of file DataStructures.cpp.

◆ get_input_pair_information()

const InputPairInformation& CoolProp::get_input_pair_information ( )

Definition at line 580 of file DataStructures.cpp.

◆ get_input_pair_long_desc()

const std::string & CoolProp::get_input_pair_long_desc ( input_pairs  pair)

Return the long description of an input pair key ("Molar density in mol/m^3, Temperature in K" for instance)

Definition at line 605 of file DataStructures.cpp.

◆ get_input_pair_short_desc()

const std::string & CoolProp::get_input_pair_short_desc ( input_pairs  pair)

Return the short description of an input pair key ("DmolarT_INPUTS" for instance)

Definition at line 597 of file DataStructures.cpp.

◆ get_library()

JSONFluidLibrary & CoolProp::get_library ( void  )

Get a reference to the library instance.

Definition at line 327 of file FluidLibrary.cpp.

◆ get_mixture_binary_pair_data()

std::string CoolProp::get_mixture_binary_pair_data ( const std::string &  CAS1,
const std::string &  CAS2,
const std::string &  key 
)

Get a string for the given binary pair.

Definition at line 305 of file MixtureParameters.cpp.

◆ get_mixture_binary_pair_pcsaft()

std::string CoolProp::get_mixture_binary_pair_pcsaft ( const std::string &  CAS1,
const std::string &  CAS2,
const std::string &  key 
)

Definition at line 16 of file PCSAFTLibrary.cpp.

◆ get_parameter_index()

parameters CoolProp::get_parameter_index ( const std::string &  param_name)

Return the enum key corresponding to the parameter name ("Dmolar" for instance)

Definition at line 504 of file DataStructures.cpp.

◆ get_parameter_information() [1/2]

const ParameterInformation& CoolProp::get_parameter_information ( )

Definition at line 159 of file DataStructures.cpp.

◆ get_parameter_information() [2/2]

std::string CoolProp::get_parameter_information ( int  key,
const std::string &  info 
)

Return information about the parameter

Parameters
keyThe key, one of iT, iP, etc.
infoThe thing you want, one of "IO" ("IO" if input/output, "O" if output only), "short" (very short description), "long" (a longer description), "units"

Definition at line 176 of file DataStructures.cpp.

◆ get_phase_index()

phases CoolProp::get_phase_index ( const std::string &  param_name)

Return the enum key corresponding to the phase name ("phase_liquid" for instance)

Definition at line 420 of file DataStructures.cpp.

◆ get_phase_information()

const PhaseInformation& CoolProp::get_phase_information ( )

Definition at line 390 of file DataStructures.cpp.

◆ get_phase_short_desc()

const std::string& CoolProp::get_phase_short_desc ( phases  phase)

Definition at line 398 of file DataStructures.cpp.

◆ get_pivot_row()

template<typename T >
size_t CoolProp::get_pivot_row ( std::vector< std::vector< T >> *  A,
size_t  col 
)

Definition at line 578 of file MatrixMath.h.

◆ get_reducing_function_name()

std::string CoolProp::get_reducing_function_name ( const std::string &  CAS1,
const std::string &  CAS2 
)

Definition at line 382 of file MixtureParameters.cpp.

◆ get_row()

template<class T >
std::vector<T> CoolProp::get_row ( std::vector< std::vector< T >> const &  in,
size_t  row 
)

Definition at line 738 of file MatrixMath.h.

◆ get_scheme_index()

schemes CoolProp::get_scheme_index ( const std::string &  param_name)

Return the enum key corresponding to the association scheme name ("2B" for instance)

Definition at line 494 of file DataStructures.cpp.

◆ get_scheme_information()

const SchemeInformation& CoolProp::get_scheme_information ( )

Definition at line 463 of file DataStructures.cpp.

◆ get_scheme_short_desc()

const std::string& CoolProp::get_scheme_short_desc ( schemes  scheme)

Definition at line 471 of file DataStructures.cpp.

◆ Halley() [1/2]

double CoolProp::Halley ( FuncWrapper1DWithTwoDerivs f,
double  x0,
double  ftol,
int  maxiter,
double  xtol_rel = 1e-12 
)
inline

Definition at line 98 of file Solvers.h.

◆ Halley() [2/2]

double CoolProp::Halley ( FuncWrapper1DWithTwoDerivs f,
double  x0,
double  ftol,
int  maxiter,
double  xtol_rel 
)

In the Halley's method solver, two derivatives of the input variable are needed, it yields the following method:

\[ x_{n+1} = x_n - \frac {2 f(x_n) f'(x_n)} {2 {[f'(x_n)]}^2 - f(x_n) f''(x_n)} \]

http://en.wikipedia.org/wiki/Halley%27s_method

Parameters
fA pointer to an instance of the FuncWrapper1DWithTwoDerivs class that implements the call() and two derivatives
x0The initial guess for the solution
ftolThe absolute value of the tolerance accepted for the objective function
maxiterMaximum number of iterations
xtol_relThe minimum allowable (relative) step size
Returns
If no errors are found, the solution, otherwise the value _HUGE, the value for infinity

Definition at line 152 of file Solvers.cpp.

◆ has_backend_in_string()

bool CoolProp::has_backend_in_string ( const std::string &  fluid_string,
std::size_t &  i 
)

Definition at line 80 of file CoolProp.cpp.

◆ has_fractions_in_string()

bool CoolProp::has_fractions_in_string ( const std::string &  fluid_string)

Definition at line 108 of file CoolProp.cpp.

◆ has_solution_concentration()

bool CoolProp::has_solution_concentration ( const std::string &  fluid_string)

Definition at line 112 of file CoolProp.cpp.

◆ Householder4() [1/2]

double CoolProp::Householder4 ( FuncWrapper1DWithThreeDerivs f,
double  x0,
double  ftol,
int  maxiter,
double  xtol_rel = 1e-12 
)
inline

Definition at line 101 of file Solvers.h.

◆ Householder4() [2/2]

double CoolProp::Householder4 ( FuncWrapper1DWithThreeDerivs f,
double  x0,
double  ftol,
int  maxiter,
double  xtol_rel 
)

In the 4-th order Householder method, three derivatives of the input variable are needed, it yields the following method:

\[ x_{n+1} = x_n - f(x_n)\left( \frac {[f'(x_n)]^2 - f(x_n)f''(x_n)/2 } {[f'(x_n)]^3-f(x_n)f'(x_n)f''(x_n)+f'''(x_n)*[f(x_n)]^2/6 } \right) \]

http://numbers.computation.free.fr/Constants/Algorithms/newton.ps

Parameters
fA pointer to an instance of the FuncWrapper1DWithThreeDerivs class that implements the call() and three derivatives
x0The initial guess for the solution
ftolThe absolute value of the tolerance accepted for the objective function
maxiterMaximum number of iterations
xtol_relThe minimum allowable (relative) step size
Returns
If no errors are found, the solution, otherwise the value _HUGE, the value for infinity

Definition at line 212 of file Solvers.cpp.

◆ invert()

template<class T >
std::vector<std::vector<T> > CoolProp::invert ( std::vector< std::vector< T >> const &  in)

Definition at line 865 of file MatrixMath.h.

◆ is_predefined_mixture()

bool CoolProp::is_predefined_mixture ( const std::string &  name,
Dictionary dict 
)

Get the parameters for a predefined mixture - R410A, R404A, etc. if the mixture is predefined.

Definition at line 64 of file MixtureParameters.cpp.

◆ is_squared()

template<class T >
bool CoolProp::is_squared ( std::vector< std::vector< T >> const &  in)

Definition at line 58 of file MatrixMath.h.

◆ is_trivial_parameter()

bool CoolProp::is_trivial_parameter ( int  key)

Returns true if the input is trivial (constants, critical parameters, etc.)

Definition at line 167 of file DataStructures.cpp.

◆ is_valid_first_derivative()

bool CoolProp::is_valid_first_derivative ( const std::string &  name,
parameters iOf,
parameters iWrt,
parameters iConstant 
)

Returns true if the string corresponds to a valid first derivative

If it is a value derivative, the variables are set to the parts of the derivative

Definition at line 222 of file DataStructures.cpp.

◆ is_valid_first_saturation_derivative()

bool CoolProp::is_valid_first_saturation_derivative ( const std::string &  name,
parameters iOf,
parameters iWrt 
)

Returns true if the string corresponds to a valid first saturation derivative - e.g. "d(P)/d(T)|sigma" for instance

If it is a valid derivative, the variables are set to the parts of the derivative

Definition at line 265 of file DataStructures.cpp.

◆ is_valid_fluid_string()

bool CoolProp::is_valid_fluid_string ( const std::string &  fluidstring)

Check if the fluid name is valid.

Returns
output Returns true if the fluid string is valid
Note
"gfreilgregre" -> false; "HEOS::Water" -> true; "Water" -> true

Definition at line 867 of file CoolProp.cpp.

◆ is_valid_parameter()

bool CoolProp::is_valid_parameter ( const std::string &  param_name,
parameters iOutput 
)

Returns true if a valid parameter, and sets value in the variable iOutput.

Definition at line 208 of file DataStructures.cpp.

◆ is_valid_phase()

bool CoolProp::is_valid_phase ( const std::string &  phase_name,
phases iOutput 
)

Return true if passed phase name is valid, otherwise false

Parameters
phase_nameThe phase name string to be checked ("phase_liquid" for instance)
iOutputGets updated with the phases enum value if phase_name is found

Definition at line 406 of file DataStructures.cpp.

◆ is_valid_scheme()

bool CoolProp::is_valid_scheme ( const std::string &  scheme_name,
schemes iOutput 
)

Return true if passed PC-SAFT association scheme name is valid, otherwise false

Parameters
scheme_nameThe association scheme string to be checked ("2B" for instance)
iOutputGets updated with the schemes enum value if scheme_name is found

Definition at line 480 of file DataStructures.cpp.

◆ is_valid_second_derivative()

bool CoolProp::is_valid_second_derivative ( const std::string &  name,
parameters iOf1,
parameters iWrt1,
parameters iConstant1,
parameters iWrt2,
parameters iConstant2 
)

Returns true if the string corresponds to a valid second derivative

If it is a value derivative, the variables are set to the parts of the derivative

Definition at line 307 of file DataStructures.cpp.

◆ kahanSum()

CoolPropDbl CoolProp::kahanSum ( const std::vector< CoolPropDbl > &  x)

Definition at line 13 of file Helmholtz.cpp.

◆ linsolve() [1/2]

template<class T >
std::vector<std::vector<T> > CoolProp::linsolve ( std::vector< std::vector< T >> const &  A,
std::vector< std::vector< T >> const &  B 
)

Definition at line 719 of file MatrixMath.h.

◆ linsolve() [2/2]

template<class T >
std::vector<T> CoolProp::linsolve ( std::vector< std::vector< T >> const &  A,
std::vector< T > const &  b 
)

Definition at line 724 of file MatrixMath.h.

◆ linsolve_Gauss_Jordan()

template<typename T >
std::vector<std::vector<T> > CoolProp::linsolve_Gauss_Jordan ( std::vector< std::vector< T >> const &  A,
std::vector< std::vector< T >> const &  B 
)

Definition at line 593 of file MatrixMath.h.

◆ load()

void CoolProp::load ( )

Definition at line 10 of file FluidLibrary.cpp.

◆ load_incompressible_library()

void CoolProp::load_incompressible_library ( )

Definition at line 542 of file IncompressibleLibrary.cpp.

◆ load_table()

template<typename T >
void CoolProp::load_table ( T &  table,
const std::string &  path_to_tables,
const std::string &  filename 
)
Parameters
table
path_to_tables
filename

Definition at line 34 of file TabularBackends.cpp.

◆ make_squared()

template<class T >
std::vector<std::vector<T> > CoolProp::make_squared ( std::vector< std::vector< T >> const &  in)

Definition at line 758 of file MatrixMath.h.

◆ makeColVector()

template<class T >
Eigen::Matrix<T, Eigen::Dynamic, 1> CoolProp::makeColVector ( const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &  matrix)

Convert 1D matrix to vector.

Returns either a row- or a column-based vector. By default, Eigen prefers column major ordering, just like Fortran.

Definition at line 181 of file MatrixMath.h.

◆ makeRowVector()

template<class T >
Eigen::Matrix<T, 1, Eigen::Dynamic> CoolProp::makeRowVector ( const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &  matrix)

Definition at line 199 of file MatrixMath.h.

◆ makeVector()

template<class T >
Eigen::Matrix<T, Eigen::Dynamic, 1> CoolProp::makeVector ( const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &  matrix)

Definition at line 195 of file MatrixMath.h.

◆ mass_to_molar()

void CoolProp::mass_to_molar ( parameters param,
double &  conversion_factor,
double  molar_mass 
)
inline

Get a conversion factor from mass to molar if needed.

Definition at line 174 of file TabularBackends.h.

◆ mat_to_string() [1/2]

template<class T >
std::string CoolProp::mat_to_string ( const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &  A)

Definition at line 398 of file MatrixMath.h.

◆ mat_to_string() [2/2]

template<class T >
std::string CoolProp::mat_to_string ( const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &  A,
const char *  fmt 
)

Templates for turning Eigen matrices into strings.

Definition at line 376 of file MatrixMath.h.

◆ match_pair()

bool CoolProp::match_pair ( parameters  key1,
parameters  key2,
parameters  x1,
parameters  x2,
bool &  swap 
)
inline

Definition at line 320 of file DataStructures.h.

◆ max_cols()

template<class T >
std::size_t CoolProp::max_cols ( std::vector< std::vector< T >> const &  in)

Definition at line 46 of file MatrixMath.h.

◆ minor_matrix()

template<typename Derived >
Eigen::MatrixXd CoolProp::minor_matrix ( const Eigen::MatrixBase< Derived > &  A,
std::size_t  i,
std::size_t  j 
)
inline

Definition at line 901 of file MatrixMath.h.

◆ multiply() [1/3]

template<class T >
std::vector<std::vector<T> > CoolProp::multiply ( std::vector< std::vector< T >> const &  A,
std::vector< std::vector< T >> const &  B 
)

Definition at line 809 of file MatrixMath.h.

◆ multiply() [2/3]

template<class T >
std::vector<T> CoolProp::multiply ( std::vector< std::vector< T >> const &  A,
std::vector< T > const &  b 
)

Definition at line 795 of file MatrixMath.h.

◆ multiply() [3/3]

template<class T >
T CoolProp::multiply ( std::vector< T > const &  a,
std::vector< T > const &  b 
)

Definition at line 791 of file MatrixMath.h.

◆ NDNewtonRaphson_Jacobian()

std::vector< double > CoolProp::NDNewtonRaphson_Jacobian ( FuncWrapperND f,
const std::vector< double > &  x,
double  tol,
int  maxiter,
double  w 
)

In this formulation of the Multi-Dimensional Newton-Raphson solver the Jacobian matrix is known. Therefore, the dx vector can be obtained from

J(x)dx=-f(x)

for a given value of x. The pointer to the class FuncWrapperND that is passed in must implement the call() and Jacobian() functions, each of which take the vector x. The data is managed using std::vector<double> vectors

Parameters
fA pointer to an subclass of the FuncWrapperND class that implements the call() and Jacobian() functions
x0The initial guess value for the solution
tolThe root-sum-square of the errors from each of the components
maxiterThe maximum number of iterations
errstringA string with the returned error. If the length of errstring is zero, no errors were found
wA relaxation multiplier on the step size, multiplying the normal step size
Returns
If no errors are found, the solution. Otherwise, _HUGE, the value for infinity

Definition at line 50 of file Solvers.cpp.

◆ Newton() [1/2]

double CoolProp::Newton ( FuncWrapper1DWithDeriv f,
double  x0,
double  ftol,
int  maxiter 
)
inline

Definition at line 95 of file Solvers.h.

◆ Newton() [2/2]

double CoolProp::Newton ( FuncWrapper1DWithDeriv f,
double  x0,
double  ftol,
int  maxiter 
)

In the newton function, a 1-D Newton-Raphson solver is implemented using exact solutions. An initial guess for the solution is provided.

Parameters
fA pointer to an instance of the FuncWrapper1D class that implements the call() function
x0The initial guess for the solution
ftolThe absolute value of the tolerance accepted for the objective function
maxiterMaximum number of iterations
Returns
If no errors are found, the solution, otherwise the value _HUGE, the value for infinity

Definition at line 109 of file Solvers.cpp.

◆ num_cols() [1/2]

template<class T >
std::size_t CoolProp::num_cols ( std::vector< std::vector< T >> const &  in)

Definition at line 77 of file MatrixMath.h.

◆ num_cols() [2/2]

template<class T >
std::size_t CoolProp::num_cols ( std::vector< T > const &  in)

Definition at line 73 of file MatrixMath.h.

◆ num_rows() [1/2]

template<class T >
std::size_t CoolProp::num_rows ( std::vector< std::vector< T >> const &  in)

Definition at line 41 of file MatrixMath.h.

◆ num_rows() [2/2]

template<class T >
std::size_t CoolProp::num_rows ( std::vector< T > const &  in)

Some shortcuts and regularly needed operations.

Definition at line 37 of file MatrixMath.h.

◆ parse_HMX_BNC()

void CoolProp::parse_HMX_BNC ( const std::string &  s,
std::vector< REFPROP_binary_element > &  BIP,
std::vector< REFPROP_departure_function > &  functions 
)

Definition at line 651 of file MixtureParameters.cpp.

◆ phase_lookup_string()

std::string CoolProp::phase_lookup_string ( phases  Phase)

An internal function to extract the phase string, given the phase index; Handy for printing the actual phase string in debug, warning, and error messages.

Parameters
PhaseThe enumerated phase index to be looked up

< Liquid

< Supercritical (p > pc, T > Tc)

< Supercritical gas (p < pc, T > Tc)

< Supercritical liquid (p > pc, T < Tc)

< At the critical point

< Subcritical gas

< Twophase (between saturation curves - inclusive)

< Unknown phase

Definition at line 1074 of file CoolProp.cpp.

◆ PhaseSI()

std::string CoolProp::PhaseSI ( const std::string &  Name1,
double  Prop1,
const std::string &  Name2,
double  Prop2,
const std::string &  FluidName 
)

Return a string representation of the phase

Parameters
Name1The first state variable name, one of "T","D","H",etc.
Prop1The first state variable value
Name2The second state variable name, one of "T","D","H",etc.
Prop2The second state variable value
FluidNameThe fluid name
Note
Returns empty string if there was an error; use get_global_param_string("errstring") to retrieve the error

Definition at line 1097 of file CoolProp.cpp.

◆ Props1SI()

double CoolProp::Props1SI ( std::string  FluidName,
std::string  Output 
)

Return a value that does not depend on the thermodynamic state - this is a convenience function that does the call PropsSI(Output, "", 0, "", 0, FluidName)

Parameters
FluidNameThe fluid name
OutputThe output parameter, one of "Tcrit","D","H",etc.

Definition at line 812 of file CoolProp.cpp.

◆ Props1SImulti()

std::vector< std::vector< double > > CoolProp::Props1SImulti ( const std::vector< std::string > &  Outputs,
const std::string &  backend,
const std::vector< std::string > &  fluids,
const std::vector< double > &  fractions 
)

Get a matrix of outputs that do not depend on the thermodynamic state - this is a convenience function that does the call PropsSImulti(Outputs, "", {0}, "", {0}, backend, fluids, fractions)

Parameters
OutputsA vector of strings for the output parameters
backendThe string representation of the backend (HEOS, REFPROP, INCOMP, etc.)
fluidsThe fluid name(s)
fractionsThe fractions (molar, mass, volume, etc.) of the components

Definition at line 839 of file CoolProp.cpp.

◆ PropsSI()

double CoolProp::PropsSI ( const std::string &  Output,
const std::string &  Name1,
double  Prop1,
const std::string &  Name2,
double  Prop2,
const std::string &  FluidName 
)

Return a value that depends on the thermodynamic state

Parameters
OutputThe output parameter, one of "T","D","H",etc.
Name1The first state variable name, one of "T","D","H",etc.
Prop1The first state variable value
Name2The second state variable name, one of "T","D","H",etc.
Prop2The second state variable value
FluidNameThe fluid name

Definition at line 613 of file CoolProp.cpp.

◆ PropsSImulti()

std::vector< std::vector< double > > CoolProp::PropsSImulti ( const std::vector< std::string > &  Outputs,
const std::string &  Name1,
const std::vector< double > &  Prop1,
const std::string &  Name2,
const std::vector< double > &  Prop2,
const std::string &  backend,
const std::vector< std::string > &  fluids,
const std::vector< double > &  fractions 
)

Get a matrix of outputs for a given input. Can handle both vector inputs as well as a vector of output strings.

Parameters
OutputsA vector of strings for the output parameters
Name1The name of the first input variable
Prop1A vector of the first input values
Name2The name of the second input variable
Prop2A vector of the second input values
backendThe string representation of the backend (HEOS, REFPROP, INCOMP, etc.)
fluidsThe fluid name(s)
fractionsThe fractions (molar, mass, volume, etc.) of the components

Definition at line 584 of file CoolProp.cpp.

◆ ramp()

double CoolProp::ramp ( double  x)

Definition at line 29 of file Helmholtz.cpp.

◆ REFPROP_SETREF()

void CoolProp::REFPROP_SETREF ( char  hrf[3],
int  ixflag,
double  x0[1],
double &  h0,
double &  s0,
double &  T0,
double &  p0,
int &  ierr,
char  herr[255],
int  l1,
int  l2 
)

Definition at line 2147 of file REFPROPMixtureBackend.cpp.

◆ register_backend()

void CoolProp::register_backend ( const backend_families bf,
shared_ptr< AbstractStateGenerator gen 
)

Register a backend in the backend library (statically defined in AbstractState.cpp and not publicly accessible)

Definition at line 56 of file AbstractState.cpp.

◆ removeColumn() [1/2]

template<class T >
void CoolProp::removeColumn ( Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &  matrix,
std::size_t  colToRemove 
)

Definition at line 236 of file MatrixMath.h.

◆ removeColumn() [2/2]

void CoolProp::removeColumn ( Eigen::MatrixXd &  matrix,
unsigned int  colToRemove 
)
inline

Definition at line 889 of file MatrixMath.h.

◆ removeRow() [1/2]

template<class T >
void CoolProp::removeRow ( Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &  matrix,
std::size_t  rowToRemove 
)

Remove rows and columns from matrices.

A set of convenience functions inspired by http://stackoverflow.com/questions/13290395/how-to-remove-a-certain-row-or-column-while-using-eigen-library-c but altered to respect templates.

Definition at line 218 of file MatrixMath.h.

◆ removeRow() [2/2]

void CoolProp::removeRow ( Eigen::MatrixXd &  matrix,
unsigned int  rowToRemove 
)
inline

Definition at line 877 of file MatrixMath.h.

◆ saturation_ancillary()

double CoolProp::saturation_ancillary ( const std::string &  fluid_name,
const std::string &  output,
int  Q,
const std::string &  input,
double  value 
)

Definition at line 881 of file CoolProp.cpp.

◆ Secant() [1/2]

double CoolProp::Secant ( FuncWrapper1D f,
double  x0,
double  dx,
double  ftol,
int  maxiter 
)
inline

Definition at line 85 of file Solvers.h.

◆ Secant() [2/2]

double CoolProp::Secant ( FuncWrapper1D f,
double  x0,
double  dx,
double  tol,
int  maxiter 
)

In the secant function, a 1-D Newton-Raphson solver is implemented. An initial guess for the solution is provided.

Parameters
fA pointer to an instance of the FuncWrapper1D class that implements the call() function
x0The initial guess for the solutionh
dxThe initial amount that is added to x in order to build the numerical derivative
tolThe absolute value of the tolerance accepted for the objective function
maxiterMaximum number of iterations
Returns
If no errors are found, the solution, otherwise the value _HUGE, the value for infinity

Definition at line 273 of file Solvers.cpp.

◆ set_config_as_json()

void CoolProp::set_config_as_json ( rapidjson::Value &  val)

Definition at line 111 of file Configuration.cpp.

◆ set_config_as_json_string()

void CoolProp::set_config_as_json_string ( const std::string &  s)

Set the entire configuration based on a json-formatted string.

Definition at line 141 of file Configuration.cpp.

◆ set_config_bool()

void CoolProp::set_config_bool ( configuration_keys  key,
bool  val 
)

Set the value of a boolean configuration value.


SETTERS


Definition at line 70 of file Configuration.cpp.

◆ set_config_double()

void CoolProp::set_config_double ( configuration_keys  key,
double  val 
)

Set the value of a double configuration value.

Definition at line 76 of file Configuration.cpp.

◆ set_config_int()

void CoolProp::set_config_int ( configuration_keys  key,
int  val 
)

Set the value of an integer configuration value.

Definition at line 73 of file Configuration.cpp.

◆ set_config_json()

void CoolProp::set_config_json ( rapidjson::Document &  doc)

Set values in the configuration based on a json file.

◆ set_config_string()

void CoolProp::set_config_string ( configuration_keys  key,
const std::string &  val 
)

Set the value of a string configuration value.

Definition at line 79 of file Configuration.cpp.

◆ set_debug_level()

void CoolProp::set_debug_level ( int  level)

Set the debug level

Parameters
levelThe level of the verbosity for the debugging output (0-10) 0: no debgging output

Definition at line 61 of file CoolProp.cpp.

◆ set_departure_functions()

void CoolProp::set_departure_functions ( const std::string &  string_data)

Set the departure functions in the departure function library from a string format.

Parameters
string_dataThe departure functions to be set, either provided as a JSON-formatted string or as a string of the contents of a HMX.BNC file from REFPROP
Note
By default, if a departure function already exists in the library, this is an error, unless the configuration variable OVERWRITE_DEPARTURE_FUNCTIONS is set to true

Definition at line 797 of file MixtureParameters.cpp.

◆ set_error_string()

void CoolProp::set_error_string ( const std::string &  error)

Set the global error string

Parameters
errorThe error string to use

Definition at line 75 of file CoolProp.cpp.

◆ set_fluid_enthalpy_entropy_offset()

void CoolProp::set_fluid_enthalpy_entropy_offset ( const std::string &  fluid,
double  delta_a1,
double  delta_a2,
const std::string &  ref 
)

Set the internal enthalpy and entropy offset variables.

Definition at line 355 of file FluidLibrary.cpp.

◆ set_interaction_parameters()

void CoolProp::set_interaction_parameters ( const std::string &  string_data)

Set the interaction parameters from a string format.

Parameters
string_dataThe model parameters, as a JSON-formatted string

Definition at line 398 of file MixtureParameters.cpp.

◆ set_mixture_binary_pair_data()

void CoolProp::set_mixture_binary_pair_data ( const std::string &  CAS1,
const std::string &  CAS2,
const std::string &  param,
const double  val 
)

Set a parameter for the given binary pair.

Parameters
CAS1The CAS # for the first fluid (order matters!)
CAS2The CAS # for the second fluid (order matters!)
paramThe parameter you want to set
valThe value of the parameter
Returns
None

Definition at line 355 of file MixtureParameters.cpp.

◆ set_mixture_binary_pair_pcsaft()

void CoolProp::set_mixture_binary_pair_pcsaft ( const std::string &  CAS1,
const std::string &  CAS2,
const std::string &  key,
const double  value 
)

Definition at line 20 of file PCSAFTLibrary.cpp.

◆ set_predefined_mixtures()

void CoolProp::set_predefined_mixtures ( const std::string &  string_data)

Set predefined mixtures at runtime.

Parameters
string_dataThe predefined mixtures, as a JSON-formatted string

Definition at line 74 of file MixtureParameters.cpp.

◆ set_reference_stateD()

void CoolProp::set_reference_stateD ( const std::string &  FluidName,
double  T,
double  rhomolar,
double  hmolar0,
double  smolar0 
)

Set the reference state based on a thermodynamic state point specified by temperature and molar density

Parameters
FluidNameThe name of the fluid
TTemperature at reference state [K]
rhomolarMolar density at reference state [mol/m^3]
hmolar0Molar enthalpy at reference state [J/mol]
smolar0Molar entropy at reference state [J/mol/K]

Definition at line 971 of file CoolProp.cpp.

◆ set_reference_stateS()

void CoolProp::set_reference_stateS ( const std::string &  FluidName,
const std::string &  reference_state 
)

Set the reference state based on a string representation.

Parameters
FluidNameThe name of the fluid (Backend can be provided like "REFPROP::Water", or if no backend is provided, "HEOS" is the assumed backend)
reference_stateThe reference state to use, one of
Reference State Description
"IIR" h = 200 kJ/kg, s=1 kJ/kg/K at 0C saturated liquid
"ASHRAE" h = 0, s = 0 @ -40C saturated liquid
"NBP" h = 0, s = 0 @ 1.0 bar saturated liquid
"DEF" Reset to the default reference state for the fluid
"RESET" Remove the offset

The offset in the ideal gas Helmholtz energy can be obtained from

\[ \displaystyle\frac{\Delta s}{R_u/M}+\frac{\Delta h}{(R_u/M)T}\tau \]

where \( \Delta s = s-s_{spec} \) and \( \Delta h = h-h_{spec} \)

Definition at line 892 of file CoolProp.cpp.

◆ set_warning_string()

void CoolProp::set_warning_string ( const std::string &  warning)

An internal function to set the global warning string

Parameters
warningThe string to set as the warning string

Definition at line 72 of file CoolProp.cpp.

◆ sign()

CoolPropDbl CoolProp::sign ( CoolPropDbl  x)

Definition at line 869 of file VLERoutines.cpp.

◆ split_input_pair()

void CoolProp::split_input_pair ( input_pairs  pair,
parameters p1,
parameters p2 
)

Split an input pair into parameters for the two parts that form the pair.

Definition at line 613 of file DataStructures.cpp.

◆ stringvec_to_string()

std::string CoolProp::stringvec_to_string ( const std::vector< std::string > &  a)
inline

Templates for turning vectors (1D-matrices) into strings.

Definition at line 334 of file MatrixMath.h.

◆ StripPhase()

bool CoolProp::StripPhase ( std::string &  Name,
shared_ptr< AbstractState > &  State 
)

Definition at line 495 of file CoolProp.cpp.

◆ subtract_row_multiple()

template<typename T >
void CoolProp::subtract_row_multiple ( std::vector< std::vector< T >> *  A,
size_t  row,
multiple,
size_t  pivot_row 
)

Definition at line 565 of file MatrixMath.h.

◆ swap_rows()

template<typename T >
void CoolProp::swap_rows ( std::vector< std::vector< T >> *  A,
size_t  row1,
size_t  row2 
)

Template class for turning numbers (0D-matrices) into strings.

Definition at line 559 of file MatrixMath.h.

◆ transpose()

template<class T >
std::vector<std::vector<T> > CoolProp::transpose ( std::vector< std::vector< T >> const &  in)

Definition at line 847 of file MatrixMath.h.

◆ vec_to_eigen() [1/3]

template<class T >
Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> CoolProp::vec_to_eigen ( const std::vector< std::vector< T >> &  coefficients)
Parameters
coefficientsmatrix containing the ordered coefficients

Definition at line 136 of file MatrixMath.h.

◆ vec_to_eigen() [2/3]

template<class T >
Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> CoolProp::vec_to_eigen ( const std::vector< T > &  coefficients,
int  axis = 0 
)
Parameters
coefficientsmatrix containing the ordered coefficients
axisaxis along which to extract data

Definition at line 151 of file MatrixMath.h.

◆ vec_to_eigen() [3/3]

template<class T >
Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> CoolProp::vec_to_eigen ( const T &  coefficient)
Parameters
coefficient

Definition at line 168 of file MatrixMath.h.

◆ vec_to_string() [1/6]

template<class T >
std::string CoolProp::vec_to_string ( const std::vector< std::vector< T >> &  A)

Definition at line 370 of file MatrixMath.h.

◆ vec_to_string() [2/6]

template<class T >
std::string CoolProp::vec_to_string ( const std::vector< std::vector< T >> &  A,
const char *  fmt 
)

Templates for turning 2D-matrices into strings.

Definition at line 359 of file MatrixMath.h.

◆ vec_to_string() [3/6]

template<class T >
std::string CoolProp::vec_to_string ( const std::vector< T > &  a)

Definition at line 330 of file MatrixMath.h.

◆ vec_to_string() [4/6]

template<class T >
std::string CoolProp::vec_to_string ( const std::vector< T > &  a,
const char *  fmt 
)

Templates for turning vectors (1D-matrices) into strings.

Definition at line 319 of file MatrixMath.h.

◆ vec_to_string() [5/6]

template<class T >
std::string CoolProp::vec_to_string ( const T &  a)

Definition at line 353 of file MatrixMath.h.

◆ vec_to_string() [6/6]

template<class T >
std::string CoolProp::vec_to_string ( const T &  a,
const char *  fmt 
)

Templates for turning numbers (0D-matrices) into strings.

Definition at line 347 of file MatrixMath.h.

◆ vecstring_to_string()

std::string CoolProp::vecstring_to_string ( const std::vector< std::string > &  a)
inline

Templates for turning vectors (1D-matrices) into strings.

Definition at line 20 of file HelmholtzEOSBackend.h.

◆ wayToSort()

bool CoolProp::wayToSort ( CoolPropDbl  i,
CoolPropDbl  j 
)

Definition at line 24 of file Helmholtz.cpp.

◆ write_table()

template<typename T >
void CoolProp::write_table ( const T &  table,
const std::string &  path_to_tables,
const std::string &  name 
)

Definition at line 91 of file TabularBackends.cpp.

◆ Xdd()

double CoolProp::Xdd ( double  X,
double  delta,
double  Delta,
double  Delta_d,
double  Delta_dd 
)

Definition at line 914 of file Helmholtz.cpp.

Variable Documentation

◆ backend_family_list

const backend_family_info CoolProp::backend_family_list[]
Initial value:

Definition at line 773 of file DataStructures.cpp.

◆ backend_information_p

BackendInformation* CoolProp::backend_information_p = nullptr

Definition at line 819 of file DataStructures.cpp.

◆ backend_list

const backend_info CoolProp::backend_list[]
Initial value:
= {{HEOS_BACKEND_PURE, "HelmholtzEOSBackend", HEOS_BACKEND_FAMILY},
{HEOS_BACKEND_MIX, "HelmholtzEOSMixtureBackend", HEOS_BACKEND_FAMILY},
{REFPROP_BACKEND_MIX, "REFPROPMixtureBackend", REFPROP_BACKEND_FAMILY},
{INCOMP_BACKEND, "IncompressibleBackend", INCOMP_BACKEND_FAMILY},
{IF97_BACKEND, "IF97Backend", IF97_BACKEND_FAMILY},
{TREND_BACKEND, "TRENDBackend", TREND_BACKEND_FAMILY},
{TTSE_BACKEND, "TTSEBackend", TTSE_BACKEND_FAMILY},
{SRK_BACKEND, "SRKBackend", SRK_BACKEND_FAMILY},
{PR_BACKEND, "PengRobinsonBackend", PR_BACKEND_FAMILY},
{VTPR_BACKEND, "VTPRBackend", VTPR_BACKEND_FAMILY},

Definition at line 778 of file DataStructures.cpp.

◆ CPPOLY_DELTA

constexpr double CoolProp::CPPOLY_DELTA = CPPOLY_EPSILON * 10.0
constexpr

Definition at line 21 of file PolyMath.cpp.

◆ CPPOLY_EPSILON

constexpr double CoolProp::CPPOLY_EPSILON = DBL_EPSILON * 100.0
constexpr

Definition at line 20 of file PolyMath.cpp.

◆ input_pair_information_p

InputPairInformation* CoolProp::input_pair_information_p = nullptr

Definition at line 579 of file DataStructures.cpp.

◆ input_pair_list

const input_pair_info CoolProp::input_pair_list[]

Definition at line 519 of file DataStructures.cpp.

◆ parameter_info_list

const parameter_info CoolProp::parameter_info_list[]

Definition at line 18 of file DataStructures.cpp.

◆ parameter_information_p

ParameterInformation* CoolProp::parameter_information_p = nullptr

Definition at line 158 of file DataStructures.cpp.

◆ phase_info_list

const phase_info CoolProp::phase_info_list[]
Initial value:
= {
{iphase_liquid, "phase_liquid", ""},
{iphase_gas, "phase_gas", ""},
{iphase_twophase, "phase_twophase", ""},
{iphase_supercritical, "phase_supercritical", ""},
{iphase_supercritical_gas, "phase_supercritical_gas", "p < pc, T > Tc"},
{iphase_supercritical_liquid, "phase_supercritical_liquid", "p > pc, T < Tc"},
{iphase_critical_point, "phase_critical_point", "p = pc, T = Tc"},
{iphase_unknown, "phase_unknown", ""},
{iphase_not_imposed, "phase_not_imposed", ""},
}

Definition at line 361 of file DataStructures.cpp.

◆ phase_information_p

PhaseInformation* CoolProp::phase_information_p = nullptr

Definition at line 389 of file DataStructures.cpp.

◆ scheme_info_list

const scheme_info CoolProp::scheme_info_list[]
Initial value:
= {
{ i1, "1"},
{ i2a, "2A"},
{ i2b, "2B"},
{ i3a, "3A"},
{ i3b, "3B"},
{ i4a, "4A"},
{ i4b, "4B"},
{ i4c, "4C"},
}

Definition at line 435 of file DataStructures.cpp.

◆ scheme_information_p

SchemeInformation* CoolProp::scheme_information_p = nullptr

Definition at line 462 of file DataStructures.cpp.