| 16 | double delta_h = 1e-2; // delta_h for one-phase/two-phase discrimination |
| 17 | |
| 18 | FluidPropSolver::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 | |
| 49 | FluidPropSolver::~FluidPropSolver() {} |
| 50 |
nothing calls this directly
no test coverage detected