GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 40.0% 2 / 0 / 5
Functions: 40.0% 2 / 0 / 5
Branches: -% 0 / 0 / 0

src/model/FanOnOff.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_FANONOFF_HPP
7 #define MODEL_FANONOFF_HPP
8
9 #include "ModelAPI.hpp"
10 #include "ModelObject.hpp"
11 #include "StraightComponent.hpp"
12
13 namespace openstudio {
14
15 namespace model {
16
17 class Schedule;
18 class Curve;
19 class AirflowNetworkFan;
20
21 namespace detail {
22
23 class FanOnOff_Impl;
24
25 } // namespace detail
26
27 /** FanOnOff is a StraightComponent that wraps the OpenStudio IDD object 'OS:Fan:OnOff'. */
28 class MODEL_API FanOnOff : public StraightComponent
29 {
30 public:
31 /** @name Constructors and Destructors */
32 //@{
33
34 explicit FanOnOff(const Model& model, Schedule& availabilitySchedule, Curve& fanPowerRatioFunctionofSpeedRatioCurve,
35 Curve& fanEfficiencyRatioFunctionofSpeedRatioCurve);
36
37 explicit FanOnOff(const Model& model, Schedule& availabilitySchedule);
38
39 explicit FanOnOff(const Model& model);
40
41 163 virtual ~FanOnOff() override = default;
42 // Default the copy and move operators because the virtual dtor is explicit
43 ✗ FanOnOff(const FanOnOff& other) = default;
44 13 FanOnOff(FanOnOff&& other) = default;
45 ✗ FanOnOff& operator=(const FanOnOff&) = default;
46 ✗ FanOnOff& operator=(FanOnOff&&) = default;
47
48 //@}
49
50 static IddObjectType iddObjectType();
51
52 /** @name Getters */
53 //@{
54
55 Schedule availabilitySchedule() const;
56
57 double fanTotalEfficiency() const;
58 bool isFanTotalEfficiencyDefaulted() const;
59
60 /** Deprecrated in favor of fanTotalEfficiency **/
61 double fanEfficiency() const;
62 bool isFanEfficiencyDefaulted() const;
63
64 double pressureRise() const;
65
66 boost::optional<double> maximumFlowRate() const;
67
68 bool isMaximumFlowRateAutosized() const;
69
70 double motorEfficiency() const;
71
72 bool isMotorEfficiencyDefaulted() const;
73
74 boost::optional<double> motorInAirstreamFraction() const;
75
76 std::string endUseSubcategory() const;
77
78 bool isEndUseSubcategoryDefaulted() const;
79
80 /** @name Setters */
81
82 bool setAvailabilitySchedule(Schedule& schedule);
83
84 bool setFanTotalEfficiency(double fanTotalEfficiency);
85 void resetFanTotalEfficiency();
86
87 bool setFanEfficiency(double fanTotalEfficiency);
88 void resetFanEfficiency();
89
90 bool setPressureRise(double pressureRise);
91
92 bool setMaximumFlowRate(double maximumFlowRate);
93
94 void resetMaximumFlowRate();
95
96 void autosizeMaximumFlowRate();
97
98 bool setMotorEfficiency(double motorEfficiency);
99
100 void resetMotorEfficiency();
101
102 bool setMotorInAirstreamFraction(double motorInAirstreamFraction);
103
104 void resetMotorInAirstreamFraction();
105
106 bool setEndUseSubcategory(const std::string& endUseSubcategory);
107
108 void resetEndUseSubcategory();
109
110 //@}
111
112 /** @name Curves */
113
114 Curve fanPowerRatioFunctionofSpeedRatioCurve() const;
115 bool setFanPowerRatioFunctionofSpeedRatioCurve(const Curve& curve);
116
117 Curve fanEfficiencyRatioFunctionofSpeedRatioCurve() const;
118 bool setFanEfficiencyRatioFunctionofSpeedRatioCurve(const Curve& curve);
119
120 //@{
121
122 AirflowNetworkFan getAirflowNetworkFan();
123 boost::optional<AirflowNetworkFan> airflowNetworkFan() const;
124
125 boost::optional<double> autosizedMaximumFlowRate() const;
126 //@}
127 protected:
128 /// @cond
129 using ImplType = detail::FanOnOff_Impl;
130
131 explicit FanOnOff(std::shared_ptr<detail::FanOnOff_Impl> impl);
132
133 friend class detail::FanOnOff_Impl;
134 friend class Model;
135 friend class IdfObject;
136 friend class openstudio::detail::IdfObject_Impl;
137 /// @endcond
138 private:
139 REGISTER_LOGGER("openstudio.model.FanOnOff");
140 };
141
142 /** \relates FanOnOff*/
143 using OptionalFanOnOff = boost::optional<FanOnOff>;
144
145 /** \relates FanOnOff*/
146 using FanOnOffVector = std::vector<FanOnOff>;
147
148 } // namespace model
149 } // namespace openstudio
150
151 #endif // MODEL_FANONOFF_HPP
152