src/model/CurveLinear.hpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /*********************************************************************************************************************** | ||
| 2 | * OpenStudio(R), Copyright (c) Alliance for Energy Innovation, LLC. | ||
| 3 | * See also https://openstudio.net/license | ||
| 4 | ***********************************************************************************************************************/ | ||
| 5 | |||
| 6 | #ifndef MODEL_CURVELINEAR_HPP | ||
| 7 | #define MODEL_CURVELINEAR_HPP | ||
| 8 | |||
| 9 | #include "ModelAPI.hpp" | ||
| 10 | #include "Curve.hpp" | ||
| 11 | |||
| 12 | namespace openstudio { | ||
| 13 | namespace model { | ||
| 14 | |||
| 15 | namespace detail { | ||
| 16 | |||
| 17 | class CurveLinear_Impl; | ||
| 18 | |||
| 19 | } // namespace detail | ||
| 20 | |||
| 21 | /** CurveLinear is a Curve that wraps the OpenStudio IDD object 'OS:Curve:Linear'. The | ||
| 22 | * functional form is \f$f(x) = c_1 + c_2 \cdot x\f$. */ | ||
| 23 | class MODEL_API CurveLinear : public Curve | ||
| 24 | { | ||
| 25 | public: | ||
| 26 | /** @name Constructors and Destructors */ | ||
| 27 | //@{ | ||
| 28 | |||
| 29 | /** Sets \f$c_1 = 0,\ c_2 = 1.0,\ x\ \text{within}\ [0.0,1.0]\f$ */ | ||
| 30 | explicit CurveLinear(const Model& model); | ||
| 31 | |||
| 32 | 282 | virtual ~CurveLinear() override = default; | |
| 33 | // Default the copy and move operators because the virtual dtor is explicit | ||
| 34 | 27 | CurveLinear(const CurveLinear& other) = default; | |
| 35 | 46 | CurveLinear(CurveLinear&& other) = default; | |
| 36 | ✗ | CurveLinear& operator=(const CurveLinear&) = default; | |
| 37 | ✗ | CurveLinear& operator=(CurveLinear&&) = default; | |
| 38 | |||
| 39 | // This is the default Part Load Fraction Correlation curve for Heat Pump coils added in E+ 23.2.0 | ||
| 40 | static CurveLinear defaultHeatPumpCoilPLFCorrelationCurve(const Model& model, double maximumCyclingRatePerHour = 2.5, | ||
| 41 | double heatPumpTimeConstantSeconds = 60.0); | ||
| 42 | |||
| 43 | //@} | ||
| 44 | |||
| 45 | static IddObjectType iddObjectType(); | ||
| 46 | |||
| 47 | static std::vector<std::string> validInputUnitTypeforXValues(); | ||
| 48 | |||
| 49 | static std::vector<std::string> validOutputUnitTypeValues(); | ||
| 50 | |||
| 51 | /** @name Getters */ | ||
| 52 | //@{ | ||
| 53 | |||
| 54 | double coefficient1Constant() const; | ||
| 55 | |||
| 56 | double coefficient2x() const; | ||
| 57 | |||
| 58 | double minimumValueofx() const; | ||
| 59 | |||
| 60 | double maximumValueofx() const; | ||
| 61 | |||
| 62 | boost::optional<double> minimumCurveOutput() const; | ||
| 63 | |||
| 64 | boost::optional<double> maximumCurveOutput() const; | ||
| 65 | |||
| 66 | std::string inputUnitTypeforX() const; | ||
| 67 | |||
| 68 | bool isInputUnitTypeforXDefaulted() const; | ||
| 69 | |||
| 70 | std::string outputUnitType() const; | ||
| 71 | |||
| 72 | bool isOutputUnitTypeDefaulted() const; | ||
| 73 | |||
| 74 | //@} | ||
| 75 | /** @name Setters */ | ||
| 76 | //@{ | ||
| 77 | |||
| 78 | bool setCoefficient1Constant(double coefficient1Constant); | ||
| 79 | |||
| 80 | bool setCoefficient2x(double coefficient2x); | ||
| 81 | |||
| 82 | bool setMinimumValueofx(double minimumValueofx); | ||
| 83 | |||
| 84 | bool setMaximumValueofx(double maximumValueofx); | ||
| 85 | |||
| 86 | bool setMinimumCurveOutput(double minimumCurveOutput); | ||
| 87 | |||
| 88 | void resetMinimumCurveOutput(); | ||
| 89 | |||
| 90 | bool setMaximumCurveOutput(double maximumCurveOutput); | ||
| 91 | |||
| 92 | void resetMaximumCurveOutput(); | ||
| 93 | |||
| 94 | bool setInputUnitTypeforX(const std::string& inputUnitTypeforX); | ||
| 95 | |||
| 96 | void resetInputUnitTypeforX(); | ||
| 97 | |||
| 98 | bool setOutputUnitType(const std::string& outputUnitType); | ||
| 99 | |||
| 100 | void resetOutputUnitType(); | ||
| 101 | |||
| 102 | //@} | ||
| 103 | /** @name Other */ | ||
| 104 | //@{ | ||
| 105 | |||
| 106 | //@} | ||
| 107 | protected: | ||
| 108 | /// @cond | ||
| 109 | using ImplType = detail::CurveLinear_Impl; | ||
| 110 | |||
| 111 | explicit CurveLinear(std::shared_ptr<detail::CurveLinear_Impl> impl); | ||
| 112 | |||
| 113 | friend class detail::CurveLinear_Impl; | ||
| 114 | friend class Model; | ||
| 115 | friend class IdfObject; | ||
| 116 | friend class openstudio::detail::IdfObject_Impl; | ||
| 117 | |||
| 118 | /// @endcond | ||
| 119 | private: | ||
| 120 | REGISTER_LOGGER("openstudio.model.CurveLinear"); | ||
| 121 | }; | ||
| 122 | |||
| 123 | /** \relates CurveLinear*/ | ||
| 124 | using OptionalCurveLinear = boost::optional<CurveLinear>; | ||
| 125 | |||
| 126 | /** \relates CurveLinear*/ | ||
| 127 | using CurveLinearVector = std::vector<CurveLinear>; | ||
| 128 | |||
| 129 | } // namespace model | ||
| 130 | } // namespace openstudio | ||
| 131 | |||
| 132 | #endif // MODEL_CURVELINEAR_HPP | ||
| 133 |