8 #ifndef HELMHOLTZEOSBACKEND_H_ 9 #define HELMHOLTZEOSBACKEND_H_ 12 #include "HelmholtzEOSMixtureBackend.h" 13 #include "Fluids/FluidLibrary.h" 14 #include "MixtureParameters.h" 15 #include "DataStructures.h" 21 std::stringstream out;
22 out <<
"[ " << format(
"%s", a[0].c_str());
23 for (
size_t j = 1; j < a.size(); j++) {
24 out <<
", " << format(
"%s", a[j].c_str());
43 std::vector<std::string> fluids = dict.get_string_vector(
"fluids");
44 mole_fractions = dict.get_double_vector(
"mole_fractions");
47 std::cout <<
"Got the fractions" <<
vec_to_string(mole_fractions,
"%g") << std::endl;
49 for (
unsigned int i = 0; i < fluids.size(); ++i) {
50 components.push_back(library.
get(fluids[i]));
53 components.push_back(library.
get(name));
54 mole_fractions.push_back(1.);
59 set_mole_fractions(std::vector<CoolPropDbl>(mole_fractions.begin(), mole_fractions.end()));
61 std::cout <<
"successfully set up state" << std::endl;
66 return get_backend_string(HEOS_BACKEND_PURE);
void set_mole_fractions(const std::vector< CoolPropDbl > &mf)
Set the mole fractions.
Definition: HelmholtzEOSMixtureBackend.cpp:121
std::string name()
Return the name - backend dependent.
Definition: AbstractState.h:1017
MoleFractions mole_fractions
The bulk mole fractions of the mixture.
Definition: HelmholtzEOSMixtureBackend.h:96
std::string vecstring_to_string(const std::vector< std::string > &a)
Templates for turning vectors (1D-matrices) into strings.
Definition: HelmholtzEOSBackend.h:20
JSONFluidLibrary & get_library(void)
Get a reference to the library instance.
Definition: FluidLibrary.cpp:327
int get_debug_level()
Get the debug level.
Definition: CoolProp.cpp:64
Definition: HelmholtzEOSBackend.h:30
A thermophysical property provider for critical and reducing values as well as derivatives of Helmhol...
Definition: CoolPropFluid.h:521
Definition: CoolPropTools.h:61
bool is_predefined_mixture(const std::string &name, Dictionary &dict)
Get the parameters for a predefined mixture - R410A, R404A, etc.
Definition: MixtureParameters.cpp:64
std::string backend_name(void)
Get a string representation of the backend - for instance "HelmholtzEOSMixtureBackend" for the core m...
Definition: HelmholtzEOSBackend.h:65
virtual void set_components(const std::vector< CoolPropFluid > &components, bool generate_SatL_and_SatV=true)
Set the components of the mixture.
Definition: HelmholtzEOSMixtureBackend.cpp:92
Definition: HelmholtzEOSMixtureBackend.h:58
This file contains flash routines in which the state is unknown, and a solver of some kind must be us...
Definition: AbstractState.h:19
CoolPropFluid get(const std::string &key)
Get a CoolPropFluid instance stored in this library.
Definition: FluidLibrary.h:1213
std::vector< CoolPropFluid > components
The components that are in use.
Definition: HelmholtzEOSMixtureBackend.h:92
A container for the fluid parameters for the CoolProp fluids.
Definition: FluidLibrary.h:27
std::string vec_to_string(const std::vector< T > &a, const char *fmt)
Templates for turning vectors (1D-matrices) into strings.
Definition: MatrixMath.h:319