CoolProp
6.7.0
An open-source fluid property and humid air property database
|
A class representing a property plot of a fluid. Used to generate isolines of a given parameter over a given pair of parameters. The code is a C++ reimplementation of the Python CoolProp.Plots.PropertyPlot class, with the actual drawing of the calculated values of the plot left to the user.
Supported plots: "p-h", "T-s", "h-s", "p-s", "p-rho", "T-rho", and "p-T".
Example usage for generating a log p-h plot for R134a with temperature isolines (for more examples, see the tests at the bottom of src/CoolPropPlot.cpp
):
Definition at line 114 of file CoolPropPlot.h.
#include <CoolPropPlot.h>
Classes | |
struct | Axis |
Public Member Functions | |
PropertyPlot (const std::string &fluid_name, CoolProp::parameters ykey, CoolProp::parameters xkey, CoolProp::Plot::TPLimits tp_limits=CoolProp::Plot::TPLimits::Def) | |
Construct a PropertyPlot object for a given fluid and a pair of parameters to plot. More... | |
Range | isoline_range (CoolProp::parameters key) const |
Retrieve a valid range of values (inclusive) for the isoline with the given key in SI units. More... | |
Isolines | calc_isolines (CoolProp::parameters key, const std::vector< double > &values, int points) const |
Calculate the isolines for the given key at given values in SI unit. More... | |
std::vector< CoolProp::parameters > | supported_isoline_keys () const |
Retrieve a list of supported isoline keys for this plot. More... | |
double | value_at (CoolProp::parameters key, double xvalue, double yvalue, CoolProp::phases phase=CoolProp::phases::iphase_not_imposed) const |
A method for calculating the value of a parameter at a given point in the plot. Useful for "value under cursor" type of queries. Returns NaN if the value is not defined at the given point. Convenience method for CoolProp::PropsSI based on the configuration of the plot object. More... | |
Public Attributes | |
struct CoolProp::Plot::PropertyPlot::Axis | xaxis |
The (non-modifiable) properties of the x axis of the plot. More... | |
struct CoolProp::Plot::PropertyPlot::Axis | yaxis |
The (non-modifiable) properties of the y axis of the plot. More... | |
CoolProp::Plot::PropertyPlot::PropertyPlot | ( | const std::string & | fluid_name, |
CoolProp::parameters | ykey, | ||
CoolProp::parameters | xkey, | ||
CoolProp::Plot::TPLimits | tp_limits = CoolProp::Plot::TPLimits::Def |
||
) |
Construct a PropertyPlot object for a given fluid and a pair of parameters to plot.
fluid_name | The name of the fluid to plot (e.g. "HEOS::R134a", or "Water") |
ykey | The parameter to plot on the y axis (e.g. for "ph" plots this would be CoolProp::iP , and for "Ts" plots this would be CoolProp::iT ) |
xkey | The parameter to plot on the x axis (e.g. for "ph" plots this would be CoolProp::iHmass , and for "Ts" plots this would be CoolProp::iSmass ) |
tp_limits | The temperature and pressure limits of the plot. |
Definition at line 263 of file CoolPropPlot.cpp.
Isolines CoolProp::Plot::PropertyPlot::calc_isolines | ( | CoolProp::parameters | key, |
const std::vector< double > & | values, | ||
int | points | ||
) | const |
Calculate the isolines for the given key
at given values
in SI unit.
key | The parameter to calculate the isolines for (usually one of the supported isoline keys, e.g. CoolProp::iP or CoolProp::iT . Full list can be obtained with PropertyPlot::supported_isoline_keys() ) |
values | The values of the isolines to calculate in SI units |
points | The number of points to calculate for each isoline. The larger the number, the smoother the isoline will look |
Definition at line 300 of file CoolPropPlot.cpp.
Range CoolProp::Plot::PropertyPlot::isoline_range | ( | CoolProp::parameters | key | ) | const |
Retrieve a valid range of values (inclusive) for the isoline with the given key
in SI units.
Definition at line 293 of file CoolPropPlot.cpp.
std::vector< CoolProp::parameters > CoolProp::Plot::PropertyPlot::supported_isoline_keys | ( | ) | const |
Retrieve a list of supported isoline keys for this plot.
Definition at line 313 of file CoolPropPlot.cpp.
double CoolProp::Plot::PropertyPlot::value_at | ( | CoolProp::parameters | key, |
double | xvalue, | ||
double | yvalue, | ||
CoolProp::phases | phase = CoolProp::phases::iphase_not_imposed |
||
) | const |
A method for calculating the value of a parameter at a given point in the plot. Useful for "value under cursor" type of queries. Returns NaN if the value is not defined at the given point. Convenience method for CoolProp::PropsSI
based on the configuration of the plot object.
key | The parameter to calculate the value for (usually one of the supported isoline keys, e.g. CoolProp::iP or CoolProp::iT . Full list can be obtained with PropertyPlot::supported_isoline_keys() ) |
xvalue | The x coordinate of the query point in SI units of the x axis of the plot |
yvalue | The y coordinate of the query point in SI units of the y axis of the plot |
phase | The phase to impose for the calculation. By default, the phase is not imposed. |
Definition at line 325 of file CoolPropPlot.cpp.
struct CoolProp::Plot::PropertyPlot::Axis CoolProp::Plot::PropertyPlot::xaxis |
The (non-modifiable) properties of the x axis of the plot.
struct CoolProp::Plot::PropertyPlot::Axis CoolProp::Plot::PropertyPlot::yaxis |
The (non-modifiable) properties of the y axis of the plot.