mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-04-23 03:00:17 -04:00
Docs for factory function
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
This commit is contained in:
@@ -239,31 +239,38 @@ public:
|
||||
|
||||
/// A factory function to return a pointer to a new-allocated instance of one of the backends.
|
||||
/**
|
||||
Very Important!! : You should use a smart pointer to manage the pointer returned. In older versions of C++, you can use std::tr1::smart_ptr which works fine
|
||||
Very Important!! : Use a smart pointer to manage the pointer returned. In older versions of C++, you can use std::tr1::smart_ptr. In C++2011 you can use std::shared_ptr
|
||||
|
||||
The backend that is selected is based on the string passed in:
|
||||
Several backends are possible:
|
||||
|
||||
1. If it starts with "REFPROP-", or no backend specification is provided, the function will assume that the backend is the CORE backend (for backwards-compatibility reasons)
|
||||
2. If it starts with "REFPROP-", the REFPROP backend will be used. The remaining part of the string should then
|
||||
either be
|
||||
1. A pure or pseudo-pure fluid name (eg. "PROPANE" or "R410A"), yielding a REFPROPBackend instance.
|
||||
2. A string that encodes the components of the mixture with a vertical bar between them (e.g. "R32|R125"), yielding a REFPROPMixtureBackend instance.
|
||||
3. If it starts with "TTSE", the TTSE backend will be used, yielding a TTSEBackend instance
|
||||
4. If it starts with "BICUBIC", the BICUBIC backend will be used, yielding a BICUBICBackend instance
|
||||
1. "?" : The backend is unknown, we will parse the fluid string to determine the backend to be used. Probably will use HEOS backend (see below)
|
||||
2. "HEOS" : The Helmholtz Equation of State backend for use with pure and pseudo-pure fluids, and mixtures, all of which are based on multi-parameter Helmholtz Energy equations of state. The fluid part of the string should then either be
|
||||
1. A pure or pseudo-pure fluid name (eg. "PROPANE" or "R410A"), yielding a HelmholtzEOSBackend instance.
|
||||
2. A string that encodes the components of the mixture with a "&" between them (e.g. "R32&R125"), yielding a HelmholtzEOSMixtureBackend instance.
|
||||
|
||||
3. "REFPROP" : The REFPROP backend will be used. The fluid part of the string should then either be
|
||||
1. A pure or pseudo-pure fluid name (eg. "PROPANE" or "R410A"), yielding a REFPROPBackend instance.
|
||||
2. A string that encodes the components of the mixture with a "&" between them (e.g. "R32&R125"), yielding a REFPROPMixtureBackend instance.
|
||||
|
||||
4. "TTSE&XXXX": The TTSE backend will be used, and the tables will be generated using the XXXX backend where XXXX is one of the base backends("HEOS", "REFPROP", etc. )
|
||||
5. "BICUBIC&XXXX": The Bicubic backend will be used, and the tables will be generated using the XXXX backend where XXXX is one of the base backends("HEOS", "REFPROP", etc. )
|
||||
6. "INCOMP": The incompressible backend will be used
|
||||
7. "BRINE": The brine backend will be used
|
||||
*/
|
||||
static AbstractState * factory(const std::string &backend, const std::string &fluid_string);
|
||||
|
||||
bool clear();
|
||||
// The derived classes must implement this function to define whether they use mole fractions (true) or mass fractions (false)
|
||||
virtual bool using_mole_fractions(void) = 0;
|
||||
|
||||
virtual void update(long input_pair, double Value1, double Value2) = 0;
|
||||
virtual void set_mole_fractions(const std::vector<long double> &mole_fractions) = 0;
|
||||
virtual void set_mass_fractions(const std::vector<long double> &mass_fractions) = 0;
|
||||
|
||||
/// Clear all the cached values
|
||||
bool clear();
|
||||
|
||||
void set_mole_fractions(const std::vector<double> &mole_fractions){set_mole_fractions(std::vector<long double>(mole_fractions.begin(), mole_fractions.end()));};
|
||||
void set_mass_fractions(const std::vector<double> &mass_fractions){set_mass_fractions(std::vector<long double>(mass_fractions.begin(), mass_fractions.end()));};
|
||||
|
||||
// The derived classes must implement this function to define whether they use mole fractions (true) or mass fractions (false)
|
||||
virtual bool using_mole_fractions(void) = 0;
|
||||
|
||||
const CoolProp::SimpleState & get_reducing(){return _reducing;};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user