GCC Code Coverage Report


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

src/model/AirflowNetworkSurface.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_AIRFLOWNETWORKSURFACE_HPP
7 #define MODEL_AIRFLOWNETWORKSURFACE_HPP
8
9 #include "ModelAPI.hpp"
10 #include "AirflowNetworkLinkage.hpp"
11
12 namespace openstudio {
13
14 namespace model {
15
16 // TODO: Check the following class names against object getters and setters.
17 class PlanarSurface;
18 class Surface;
19 class SubSurface;
20 class AirflowNetworkComponent;
21 class AirflowNetworkExternalNode;
22 class Schedule;
23 class AirflowNetworkOccupantVentilationControl;
24
25 namespace detail {
26
27 class Surface_Impl;
28 class SubSurface_Impl;
29 class AirflowNetworkSurface_Impl;
30
31 } // namespace detail
32
33 /** AirflowNetworkSurface is a AirflowNetworkLinkage that wraps the OpenStudio IDD object 'OS:AirflowNetwork:Surface'. */
34 class MODEL_API AirflowNetworkSurface : public AirflowNetworkLinkage
35 {
36 public:
37 /** @name Constructors and Destructors */
38 //@{
39
40 /** Construct a surface with a model surface to be linked to. */
41 ///AirflowNetworkSurface(const Model& model, const Surface &surface);
42 /** Construct a surface with a model subsurface to be linked to. */
43 //AirflowNetworkSurface(const Model& model, const SubSurface &surface);
44 /** Construct a surface with a model surface to be linked to and a leakage component. */
45 //AirflowNetworkSurface(const Model& model, const Surface &surface, const AirflowNetworkComponent &component);
46 /** Construct a surface with a model subsurface to be linked to and a leakage component. */
47 //AirflowNetworkSurface(const Model& model, const SubSurface &surface, const AirflowNetworkComponent &component);
48
49 69 virtual ~AirflowNetworkSurface() override = default;
50 // Default the copy and move operators because the virtual dtor is explicit
51 13 AirflowNetworkSurface(const AirflowNetworkSurface& other) = default;
52 23 AirflowNetworkSurface(AirflowNetworkSurface&& other) = default;
53 ✗ AirflowNetworkSurface& operator=(const AirflowNetworkSurface&) = default;
54 4 AirflowNetworkSurface& operator=(AirflowNetworkSurface&&) = default;
55
56 //@}
57
58 static IddObjectType iddObjectType();
59
60 static std::vector<std::string> ventilationControlModeValues();
61
62 /** @name Getters */
63 //@{
64
65 /** Returns the planar surface associated with this object. */
66 PlanarSurface surface() const;
67
68 /** Returns the leakage component associated with the surface, if any. */
69 boost::optional<AirflowNetworkComponent> leakageComponent() const;
70
71 /** Returns the external node associated with this surface, if any. */
72 boost::optional<AirflowNetworkExternalNode> externalNode() const;
73 /** Returns the window opening, door opening, or crack factor for this object. */
74 double windowDoorOpeningFactorOrCrackFactor() const;
75 /** Returns true if the window opening, door opening, or crack factor for this object is defaulted. */
76 bool isWindowDoorOpeningFactorOrCrackFactorDefaulted() const;
77 /** Returns the ventilation control mode for this object. */
78 std::string ventilationControlMode() const;
79 /** Returns true if the ventilation control mode for this object is defaulted. */
80 bool isVentilationControlModeDefaulted() const;
81
82 /** Returns the ventilation control schedule if this object has one. */
83 boost::optional<Schedule> ventilationControlZoneTemperatureSetpointSchedule() const;
84 /** Returns the minimum venting open factor for this object. */
85 double minimumVentingOpenFactor() const;
86 /** Returns true if the minimum venting open factor for this object is defaulted. */
87 bool isMinimumVentingOpenFactorDefaulted() const;
88 /** Returns the lower limit indoor/outdoor temperature difference. */
89 double indoorandOutdoorTemperatureDifferenceLowerLimitForMaximumVentingOpenFactor() const;
90 /** Returns true if the lower limit indoor/outdoor temperature difference is defaulted. */
91 bool isIndoorandOutdoorTemperatureDifferenceLowerLimitForMaximumVentingOpenFactorDefaulted() const;
92 /** Returns the upper limit indoor/outdoor temperature difference. */
93 double indoorandOutdoorTemperatureDifferenceUpperLimitforMinimumVentingOpenFactor() const;
94 /** Returns true if the upper limit indoor/outdoor temperature difference is defaulted. */
95 bool isIndoorandOutdoorTemperatureDifferenceUpperLimitforMinimumVentingOpenFactorDefaulted() const;
96 /** Returns the lower limit indoor/outdoor enthalpy difference. */
97 double indoorandOutdoorEnthalpyDifferenceLowerLimitForMaximumVentingOpenFactor() const;
98 /** Returns true if the lower limit indoor/outdoor enthalpy difference is defaulted. */
99 bool isIndoorandOutdoorEnthalpyDifferenceLowerLimitForMaximumVentingOpenFactorDefaulted() const;
100 /** Returns the upper limit indoor/outdoor enthalpy difference. */
101 double indoorandOutdoorEnthalpyDifferenceUpperLimitforMinimumVentingOpenFactor() const;
102 /** Returns true if the upper limit indoor/outdoor enthalpy difference is defaulted. */
103 bool isIndoorandOutdoorEnthalpyDifferenceUpperLimitforMinimumVentingOpenFactorDefaulted() const;
104
105 /** Returns the venting availability for this surface, if any. */
106 boost::optional<Schedule> ventingAvailabilitySchedule() const;
107
108 /** Returns the ventilation control object associated with this surface, if any.*/
109 boost::optional<AirflowNetworkOccupantVentilationControl> occupantVentilationControl() const;
110
111 //@}
112 /** @name Setters */
113 //@{
114
115 /** Set the component associated with this surface. */
116 bool setLeakageComponent(const AirflowNetworkComponent& surfaceAirflowLeakage);
117
118 /** Set the external node associated with this surface. */
119 bool setExternalNode(const AirflowNetworkExternalNode& externalNode);
120
121 /** Remove the external node currently associated with this surface. */
122 void resetExternalNode();
123 /** Sets the opening factor/crack factor. */
124 bool setWindowDoorOpeningFactorOrCrackFactor(double windowDoorOpeningFactorOrCrackFactor);
125 /** Resets the opening factor/crack factor. */
126 void resetWindowDoorOpeningFactorOrCrackFactor();
127 /** Sets the ventilation control mode. */
128 bool setVentilationControlMode(const std::string& ventilationControlMode);
129 /** Resets the ventilation control mode. */
130 void resetVentilationControlMode();
131
132 /** Sets the control setpoint schedule. */
133 bool setVentilationControlZoneTemperatureSetpointSchedule(Schedule& schedule);
134 /** Resets the control setpoint schedule. */
135 void resetVentilationControlZoneTemperatureSetpointSchedule();
136 /** Sets the minimum venting open schedule. */
137 bool setMinimumVentingOpenFactor(double minimumVentingOpenFactor);
138 /** Reets the minimum venting open schedule. */
139 void resetMinimumVentingOpenFactor();
140 /** Sets the lower limit indoor/outdoor temperature difference. */
141 bool setIndoorandOutdoorTemperatureDifferenceLowerLimitForMaximumVentingOpenFactor(
142 double indoorandOutdoorTemperatureDifferenceLowerLimitForMaximumVentingOpenFactor);
143 /** Resets the lower limit indoor/outdoor temperature difference. */
144 void resetIndoorandOutdoorTemperatureDifferenceLowerLimitForMaximumVentingOpenFactor();
145 /** Sets the upper limit indoor/outdoor temperature difference. */
146 bool setIndoorandOutdoorTemperatureDifferenceUpperLimitforMinimumVentingOpenFactor(
147 double indoorandOutdoorTemperatureDifferenceUpperLimitforMinimumVentingOpenFactor);
148 /** Resets the upper limit indoor/outdoor temperature difference. */
149 void resetIndoorandOutdoorTemperatureDifferenceUpperLimitforMinimumVentingOpenFactor();
150 /** Sets the lower limit indoor/outdoor enthalpy difference. */
151 bool setIndoorandOutdoorEnthalpyDifferenceLowerLimitForMaximumVentingOpenFactor(
152 double indoorandOutdoorEnthalpyDifferenceLowerLimitForMaximumVentingOpenFactor);
153 /** Resets the upper limit indoor/outdoor temperature difference. */
154 void resetIndoorandOutdoorEnthalpyDifferenceLowerLimitForMaximumVentingOpenFactor();
155 /** Sets the upper limit indoor/outdoor enthalpy difference. */
156 bool setIndoorandOutdoorEnthalpyDifferenceUpperLimitforMinimumVentingOpenFactor(
157 double indoorandOutdoorEnthalpyDifferenceUpperLimitforMinimumVentingOpenFactor);
158 /** Resets the upper limit indoor/outdoor enthalpy difference. */
159 void resetIndoorandOutdoorEnthalpyDifferenceUpperLimitforMinimumVentingOpenFactor();
160
161 /** Sets the venting availabilty schedule. */
162 bool setVentingAvailabilitySchedule(Schedule& schedule);
163
164 /** Resets the venting availabilty schedule. */
165 void resetVentingAvailabilitySchedule();
166
167 /** Set the occupant ventilation control object for this surface. */
168 bool setOccupantVentilationControl(const AirflowNetworkOccupantVentilationControl& airflowNetworkOccupantVentilationControl);
169
170 /** Reset the occupant ventilation control object. */
171 void resetOccupantVentilationControl();
172
173 //@}
174 /** @name Other */
175 //@{
176
177 //@}
178 protected:
179 /// @cond
180 using ImplType = detail::AirflowNetworkSurface_Impl;
181
182 explicit AirflowNetworkSurface(std::shared_ptr<detail::AirflowNetworkSurface_Impl> impl);
183
184 AirflowNetworkSurface(const Model& model, const Handle& compHandle, const Handle& surfHandle);
185
186 bool setSurface(const Surface& surfAndSubSurf);
187 bool setSurface(const SubSurface& surfAndSubSurf);
188 void resetSurface();
189
190 friend class detail::Surface_Impl;
191 friend class detail::SubSurface_Impl;
192 friend class detail::AirflowNetworkSurface_Impl;
193 friend class Model;
194 friend class IdfObject;
195 friend class openstudio::detail::IdfObject_Impl;
196 /// @endcond
197 private:
198 REGISTER_LOGGER("openstudio.model.AirflowNetworkSurface");
199 };
200
201 /** \relates AirflowNetworkSurface*/
202 using OptionalAirflowNetworkSurface = boost::optional<AirflowNetworkSurface>;
203
204 /** \relates AirflowNetworkSurface*/
205 using AirflowNetworkSurfaceVector = std::vector<AirflowNetworkSurface>;
206
207 } // namespace model
208 } // namespace openstudio
209
210 #endif // MODEL_AIRFLOWNETWORKSURFACE_HPP
211