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

Method FluidPropSolver

wrappers/Modelica/src/fluidpropsolver.cpp:18–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16double delta_h = 1e-2; // delta_h for one-phase/two-phase discrimination
17
18FluidPropSolver::FluidPropSolver(const string& mediumName, const string& libraryName, const string& substanceName)
19 : BaseSolver(mediumName, libraryName, substanceName) {
20 string ErrorMsg;
21 string Comp[20];
22 double Conc[20];
23
24 // Build FluidProp object with the libraryName and substanceName info
25 Comp[0] = substanceName.c_str();
26 FluidProp.SetFluid(libraryName.substr(libraryName.find(".") + 1), 1, Comp, Conc, &ErrorMsg);
27 if (isError(ErrorMsg)) // An error occurred
28 {
29 // Build error message and pass it to the Modelica environment
30 char error[300];
31 sprintf(error, "FluidProp error: %s\n", ErrorMsg.c_str());
32 errorMessage(error);
33 }
34
35 // Set SI units
36 FluidProp.SetUnits("SI", " ", " ", " ", &ErrorMsg);
37 if (isError(ErrorMsg)) // An error occurred
38 {
39 // Build error message and pass it to the Modelica environment
40 char error[300];
41 sprintf(error, "FluidProp error: %s\n", ErrorMsg.c_str());
42 errorMessage(error);
43 }
44
45 // Set fluid constants
46 setFluidConstants();
47}
48
49FluidPropSolver::~FluidPropSolver() {}
50

Callers

nothing calls this directly

Calls 3

errorMessageFunction · 0.85
SetFluidMethod · 0.80
SetUnitsMethod · 0.80

Tested by

no test coverage detected