MCPcopy Create free account
hub / github.com/CoolProp/CoolProp / is_valid_fluid_string

Function is_valid_fluid_string

src/CoolProp.cpp:921–934  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

919#endif
920
921bool is_valid_fluid_string(const std::string& fluidstring) {
922 try {
923 std::string backend, fluid;
924 std::vector<double> fractions;
925 // First try to extract backend and fractions
926 extract_backend(fluidstring, backend, fluid);
927 std::string fluid_string = extract_fractions(fluid, fractions);
928 // We are going to let the factory function load the state
929 shared_ptr<AbstractState> State(AbstractState::factory(backend, fluid_string));
930 return true;
931 } catch (...) {
932 return false;
933 }
934}
935double saturation_ancillary(const std::string& fluid_name, const std::string& output, int Q, const std::string& input, double value) {
936
937 // Generate the state instance

Callers 2

Props1SIFunction · 0.85
C_is_valid_fluid_stringFunction · 0.85

Calls 3

extract_backendFunction · 0.85
extract_fractionsFunction · 0.85
factoryFunction · 0.70

Tested by

no test coverage detected