CoolProp  6.6.0
An open-source fluid property and humid air property database
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
CoolProp::JSONFluidLibrary Class Reference

Detailed Description

A container for the fluid parameters for the CoolProp fluids.

This container holds copies of all of the fluid instances for the fluids that are loaded in CoolProp. New fluids can be added by passing in a rapidjson::Value instance to the add_one function, or a rapidjson array of fluids to the add_many function.

Definition at line 27 of file FluidLibrary.h.

#include <FluidLibrary.h>

Public Member Functions

 JSONFluidLibrary ()
 
bool is_empty (void)
 
void add_many (rapidjson::Value &listing)
 Add all the fluid entries in the rapidjson::Value instance passed in. More...
 
void add_one (rapidjson::Value &fluid_json)
 
std::string get_JSONstring (const std::string &key)
 
CoolPropFluid get (const std::string &key)
 Get a CoolPropFluid instance stored in this library. More...
 
CoolPropFluid get (std::size_t key)
 Get a CoolPropFluid instance stored in this library. More...
 
void set_fluid_enthalpy_entropy_offset (const std::string &fluid, double delta_a1, double delta_a2, const std::string &ref)
 
std::string get_fluid_list (void)
 Return a comma-separated list of fluid names. More...
 

Static Public Member Functions

static ResidualHelmholtzContainer parse_alphar (rapidjson::Value &jsonalphar)
 Parse the contributions to the residual Helmholtz energy. More...
 
static IdealHelmholtzContainer parse_alpha0 (rapidjson::Value &jsonalpha0)
 Parse the contributions to the ideal-gas Helmholtz energy. More...
 
static void add_many (const std::string &JSON_string)
 Add all the fluid entries in the JSON-encoded string passed in. More...
 

Protected Member Functions

void parse_environmental (rapidjson::Value &json, CoolPropFluid &fluid)
 Parse the environmental parameters (ODP, GWP, etc.) More...
 
void parse_EOS (rapidjson::Value &EOS_json, CoolPropFluid &fluid)
 Parse the Equation of state JSON entry. More...
 
void parse_EOS_listing (rapidjson::Value &EOS_array, CoolPropFluid &fluid)
 Parse the list of possible equations of state. More...
 
void parse_dilute_viscosity (rapidjson::Value &dilute, CoolPropFluid &fluid)
 Parse the transport properties. More...
 
void parse_initial_density_viscosity (rapidjson::Value &initial_density, CoolPropFluid &fluid)
 Parse the transport properties. More...
 
void parse_higher_order_viscosity (rapidjson::Value &higher, CoolPropFluid &fluid)
 Parse the transport properties. More...
 
void parse_ECS_conductivity (rapidjson::Value &conductivity, CoolPropFluid &fluid)
 
void parse_ECS_viscosity (rapidjson::Value &viscosity, CoolPropFluid &fluid)
 
void parse_Chung_viscosity (rapidjson::Value &viscosity, CoolPropFluid &fluid)
 
void parse_rhosr_viscosity (rapidjson::Value &viscosity, CoolPropFluid &fluid)
 
void parse_viscosity (rapidjson::Value &viscosity, CoolPropFluid &fluid)
 Parse the transport properties. More...
 
void parse_dilute_conductivity (rapidjson::Value &dilute, CoolPropFluid &fluid)
 Parse the transport properties. More...
 
void parse_residual_conductivity (rapidjson::Value &dilute, CoolPropFluid &fluid)
 Parse the transport properties. More...
 
void parse_critical_conductivity (rapidjson::Value &critical, CoolPropFluid &fluid)
 
void parse_thermal_conductivity (rapidjson::Value &conductivity, CoolPropFluid &fluid)
 Parse the thermal conductivity data. More...
 
void parse_transport (rapidjson::Value &transport, CoolPropFluid &fluid)
 Parse the transport properties. More...
 
void default_transport (CoolPropFluid &fluid)
 
void parse_melting_line (rapidjson::Value &melting_line, CoolPropFluid &fluid)
 
void parse_states (rapidjson::Value &states, CoolPropFluid &fluid)
 Parse the critical state for the given EOS. More...
 
void parse_ancillaries (rapidjson::Value &ancillaries, CoolPropFluid &fluid)
 Parse the critical state for the given EOS. More...
 
void parse_surface_tension (rapidjson::Value &surface_tension, CoolPropFluid &fluid)
 Parse the surface_tension. More...
 
void validate (CoolPropFluid &fluid)
 Validate the fluid file that was just constructed. More...
 

Constructor & Destructor Documentation

◆ JSONFluidLibrary()

CoolProp::JSONFluidLibrary::JSONFluidLibrary ( )
inline

Definition at line 1172 of file FluidLibrary.h.

Member Function Documentation

◆ add_many() [1/2]

void CoolProp::JSONFluidLibrary::add_many ( const std::string &  JSON_string)
static

Add all the fluid entries in the JSON-encoded string passed in.

Definition at line 83 of file FluidLibrary.cpp.

◆ add_many() [2/2]

void CoolProp::JSONFluidLibrary::add_many ( rapidjson::Value &  listing)

Add all the fluid entries in the rapidjson::Value instance passed in.

Definition at line 96 of file FluidLibrary.cpp.

◆ add_one()

void CoolProp::JSONFluidLibrary::add_one ( rapidjson::Value &  fluid_json)

Definition at line 106 of file FluidLibrary.cpp.

◆ default_transport()

void CoolProp::JSONFluidLibrary::default_transport ( CoolPropFluid fluid)
inlineprotected

Definition at line 987 of file FluidLibrary.h.

◆ get() [1/2]

CoolPropFluid CoolProp::JSONFluidLibrary::get ( const std::string &  key)
inline

Get a CoolPropFluid instance stored in this library.

Parameters
keyEither a CAS number or the name (CAS number should be preferred)

Definition at line 1213 of file FluidLibrary.h.

◆ get() [2/2]

CoolPropFluid CoolProp::JSONFluidLibrary::get ( std::size_t  key)
inline

Get a CoolPropFluid instance stored in this library.

Parameters
keyThe index of the fluid in the map

Definition at line 1307 of file FluidLibrary.h.

◆ get_fluid_list()

std::string CoolProp::JSONFluidLibrary::get_fluid_list ( void  )
inline

Return a comma-separated list of fluid names.

Definition at line 1319 of file FluidLibrary.h.

◆ get_JSONstring()

std::string CoolProp::JSONFluidLibrary::get_JSONstring ( const std::string &  key)
inline

Definition at line 1187 of file FluidLibrary.h.

◆ is_empty()

bool CoolProp::JSONFluidLibrary::is_empty ( void  )
inline

Definition at line 1175 of file FluidLibrary.h.

◆ parse_alpha0()

static IdealHelmholtzContainer CoolProp::JSONFluidLibrary::parse_alpha0 ( rapidjson::Value &  jsonalpha0)
inlinestatic

Parse the contributions to the ideal-gas Helmholtz energy.

Definition at line 155 of file FluidLibrary.h.

◆ parse_alphar()

static ResidualHelmholtzContainer CoolProp::JSONFluidLibrary::parse_alphar ( rapidjson::Value &  jsonalphar)
inlinestatic

Parse the contributions to the residual Helmholtz energy.

Definition at line 39 of file FluidLibrary.h.

◆ parse_ancillaries()

void CoolProp::JSONFluidLibrary::parse_ancillaries ( rapidjson::Value &  ancillaries,
CoolPropFluid fluid 
)
inlineprotected

Parse the critical state for the given EOS.

Definition at line 1104 of file FluidLibrary.h.

◆ parse_Chung_viscosity()

void CoolProp::JSONFluidLibrary::parse_Chung_viscosity ( rapidjson::Value &  viscosity,
CoolPropFluid fluid 
)
inlineprotected

Definition at line 673 of file FluidLibrary.h.

◆ parse_critical_conductivity()

void CoolProp::JSONFluidLibrary::parse_critical_conductivity ( rapidjson::Value &  critical,
CoolPropFluid fluid 
)
inlineprotected

Definition at line 871 of file FluidLibrary.h.

◆ parse_dilute_conductivity()

void CoolProp::JSONFluidLibrary::parse_dilute_conductivity ( rapidjson::Value &  dilute,
CoolPropFluid fluid 
)
inlineprotected

Parse the transport properties.

Definition at line 777 of file FluidLibrary.h.

◆ parse_dilute_viscosity()

void CoolProp::JSONFluidLibrary::parse_dilute_viscosity ( rapidjson::Value &  dilute,
CoolPropFluid fluid 
)
inlineprotected

Parse the transport properties.

Definition at line 440 of file FluidLibrary.h.

◆ parse_ECS_conductivity()

void CoolProp::JSONFluidLibrary::parse_ECS_conductivity ( rapidjson::Value &  conductivity,
CoolPropFluid fluid 
)
inlineprotected

Definition at line 648 of file FluidLibrary.h.

◆ parse_ECS_viscosity()

void CoolProp::JSONFluidLibrary::parse_ECS_viscosity ( rapidjson::Value &  viscosity,
CoolPropFluid fluid 
)
inlineprotected

Definition at line 662 of file FluidLibrary.h.

◆ parse_environmental()

void CoolProp::JSONFluidLibrary::parse_environmental ( rapidjson::Value &  json,
CoolPropFluid fluid 
)
inlineprotected

Parse the environmental parameters (ODP, GWP, etc.)

Definition at line 325 of file FluidLibrary.h.

◆ parse_EOS()

void CoolProp::JSONFluidLibrary::parse_EOS ( rapidjson::Value &  EOS_json,
CoolPropFluid fluid 
)
inlineprotected

Parse the Equation of state JSON entry.

Todo:
: define limits of EOS better

Definition at line 337 of file FluidLibrary.h.

◆ parse_EOS_listing()

void CoolProp::JSONFluidLibrary::parse_EOS_listing ( rapidjson::Value &  EOS_array,
CoolPropFluid fluid 
)
inlineprotected

Parse the list of possible equations of state.

Definition at line 433 of file FluidLibrary.h.

◆ parse_higher_order_viscosity()

void CoolProp::JSONFluidLibrary::parse_higher_order_viscosity ( rapidjson::Value &  higher,
CoolPropFluid fluid 
)
inlineprotected

Parse the transport properties.

Definition at line 536 of file FluidLibrary.h.

◆ parse_initial_density_viscosity()

void CoolProp::JSONFluidLibrary::parse_initial_density_viscosity ( rapidjson::Value &  initial_density,
CoolPropFluid fluid 
)
inlineprotected

Parse the transport properties.

Definition at line 505 of file FluidLibrary.h.

◆ parse_melting_line()

void CoolProp::JSONFluidLibrary::parse_melting_line ( rapidjson::Value &  melting_line,
CoolPropFluid fluid 
)
inlineprotected

Definition at line 997 of file FluidLibrary.h.

◆ parse_residual_conductivity()

void CoolProp::JSONFluidLibrary::parse_residual_conductivity ( rapidjson::Value &  dilute,
CoolPropFluid fluid 
)
inlineprotected

Parse the transport properties.

Definition at line 828 of file FluidLibrary.h.

◆ parse_rhosr_viscosity()

void CoolProp::JSONFluidLibrary::parse_rhosr_viscosity ( rapidjson::Value &  viscosity,
CoolPropFluid fluid 
)
inlineprotected

Definition at line 683 of file FluidLibrary.h.

◆ parse_states()

void CoolProp::JSONFluidLibrary::parse_states ( rapidjson::Value &  states,
CoolPropFluid fluid 
)
inlineprotected

Parse the critical state for the given EOS.

Definition at line 1053 of file FluidLibrary.h.

◆ parse_surface_tension()

void CoolProp::JSONFluidLibrary::parse_surface_tension ( rapidjson::Value &  surface_tension,
CoolPropFluid fluid 
)
inlineprotected

Parse the surface_tension.

Definition at line 1159 of file FluidLibrary.h.

◆ parse_thermal_conductivity()

void CoolProp::JSONFluidLibrary::parse_thermal_conductivity ( rapidjson::Value &  conductivity,
CoolPropFluid fluid 
)
inlineprotected

Parse the thermal conductivity data.

Definition at line 924 of file FluidLibrary.h.

◆ parse_transport()

void CoolProp::JSONFluidLibrary::parse_transport ( rapidjson::Value &  transport,
CoolPropFluid fluid 
)
inlineprotected

Parse the transport properties.

Definition at line 972 of file FluidLibrary.h.

◆ parse_viscosity()

void CoolProp::JSONFluidLibrary::parse_viscosity ( rapidjson::Value &  viscosity,
CoolPropFluid fluid 
)
inlineprotected

Parse the transport properties.

Definition at line 693 of file FluidLibrary.h.

◆ set_fluid_enthalpy_entropy_offset()

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

Definition at line 25 of file FluidLibrary.cpp.

◆ validate()

void CoolProp::JSONFluidLibrary::validate ( CoolPropFluid fluid)
inlineprotected

Validate the fluid file that was just constructed.

Definition at line 1164 of file FluidLibrary.h.


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