GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 94.4% 322 / 0 / 341
Functions: 96.5% 109 / 0 / 113
Branches: 68.0% 164 / 0 / 241

src/model/GeneratorWindTurbine.cpp
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 #include "GeneratorWindTurbine.hpp"
7 #include "GeneratorWindTurbine_Impl.hpp"
8
9 #include "Model.hpp"
10 #include "Model_Impl.hpp"
11 #include "Schedule.hpp"
12 #include "Schedule_Impl.hpp"
13 #include "ScheduleTypeLimits.hpp"
14 #include "ScheduleTypeRegistry.hpp"
15
16 #include <utilities/idd/IddFactory.hxx>
17 #include <utilities/idd/IddEnums.hxx>
18 #include <utilities/idd/OS_Generator_WindTurbine_FieldEnums.hxx>
19
20 #include "../utilities/units/Unit.hpp"
21
22 #include "../utilities/core/Assert.hpp"
23
24 namespace openstudio {
25 namespace model {
26
27 namespace detail {
28
29 10 GeneratorWindTurbine_Impl::GeneratorWindTurbine_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle)
30 10 : Generator_Impl(idfObject, model, keepHandle) {
31
4/6
✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
✓ Branch 7 taken 10 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 10 times.
✗ Branch 13 not taken.
10 OS_ASSERT(idfObject.iddObject().type() == GeneratorWindTurbine::iddObjectType());
32 10 }
33
34 ✗ GeneratorWindTurbine_Impl::GeneratorWindTurbine_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle)
35 ✗ : Generator_Impl(other, model, keepHandle) {
36 ✗ OS_ASSERT(other.iddObject().type() == GeneratorWindTurbine::iddObjectType());
37 ✗ }
38
39 5 GeneratorWindTurbine_Impl::GeneratorWindTurbine_Impl(const GeneratorWindTurbine_Impl& other, Model_Impl* model, bool keepHandle)
40 5 : Generator_Impl(other, model, keepHandle) {}
41
42 ✗ const std::vector<std::string>& GeneratorWindTurbine_Impl::outputVariableNames() const {
43 static const std::vector<std::string> result{"Generator Produced AC Electricity Rate", "Generator Produced AC Electricity Energy",
44 "Generator Turbine Local Wind Speed", "Generator Turbine Local Air Density",
45 "Generator Turbine Power Coefficient", "Generator Turbine Tip Speed Ratio",
46 "Generator Turbine Chordal Component Velocity", "Generator Turbine Normal Component Velocity",
47 ✗ "Generator Turbine Relative Flow Velocity", "Generator Turbine Attack Angle"};
48 ✗ return result;
49 ✗ }
50
51 ✗ IddObjectType GeneratorWindTurbine_Impl::iddObjectType() const {
52 ✗ return GeneratorWindTurbine::iddObjectType();
53 }
54
55 1 std::string GeneratorWindTurbine_Impl::generatorObjectType() const {
56
1/1
✓ Branch 1 taken 1 time.
2 return "Generator:WindTurbine";
57 }
58
59 ✗ std::vector<ScheduleTypeKey> GeneratorWindTurbine_Impl::getScheduleTypeKeys(const Schedule& schedule) const {
60 ✗ std::vector<ScheduleTypeKey> result;
61 ✗ UnsignedVector fieldIndices = getSourceIndices(schedule.handle());
62 ✗ UnsignedVector::const_iterator b(fieldIndices.begin());
63 ✗ UnsignedVector::const_iterator e(fieldIndices.end());
64 ✗ if (std::find(b, e, OS_Generator_WindTurbineFields::AvailabilityScheduleName) != e) {
65 ✗ result.push_back(ScheduleTypeKey("GeneratorWindTurbine", "Availability"));
66 }
67 ✗ return result;
68 ✗ }
69
70 // translated to ElectricLoadCenter:Generators 'Generator Rated Electric Power Output'
71 1 boost::optional<double> GeneratorWindTurbine_Impl::ratedElectricPowerOutput() const {
72 1 return getDouble(OS_Generator_WindTurbineFields::RatedPower, true);
73 }
74
75 5 boost::optional<Schedule> GeneratorWindTurbine_Impl::availabilitySchedule() const {
76
2/2
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
5 return getObject<ModelObject>().getModelObjectTarget<Schedule>(OS_Generator_WindTurbineFields::AvailabilityScheduleName);
77 }
78
79 // Convenience method to go fetch the connected GeneratorWindTurbine's 'Rated Thermal to Electrical Power Ratio'
80 1 boost::optional<double> GeneratorWindTurbine_Impl::ratedThermaltoElectricalPowerRatio() const {
81 1 return boost::none;
82 }
83
84 3 std::string GeneratorWindTurbine_Impl::rotorType() const {
85
1/1
✓ Branch 1 taken 3 times.
3 boost::optional<std::string> value = getString(OS_Generator_WindTurbineFields::RotorType, true);
86
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 4 not taken.
3 OS_ASSERT(value);
87
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
6 return value.get();
88 3 }
89
90 3 std::string GeneratorWindTurbine_Impl::powerControl() const {
91
1/1
✓ Branch 1 taken 3 times.
3 boost::optional<std::string> value = getString(OS_Generator_WindTurbineFields::PowerControl, true);
92
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 4 not taken.
3 OS_ASSERT(value);
93
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
6 return value.get();
94 3 }
95
96 3 double GeneratorWindTurbine_Impl::ratedRotorSpeed() const {
97
1/1
✓ Branch 1 taken 3 times.
3 boost::optional<double> value = getDouble(OS_Generator_WindTurbineFields::RatedRotorSpeed, true);
98
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 4 not taken.
3 OS_ASSERT(value);
99
1/1
✓ Branch 1 taken 3 times.
6 return value.get();
100 }
101
102 3 double GeneratorWindTurbine_Impl::rotorDiameter() const {
103
1/1
✓ Branch 1 taken 3 times.
3 boost::optional<double> value = getDouble(OS_Generator_WindTurbineFields::RotorDiameter, true);
104
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 4 not taken.
3 OS_ASSERT(value);
105
1/1
✓ Branch 1 taken 3 times.
6 return value.get();
106 }
107
108 3 double GeneratorWindTurbine_Impl::overallHeight() const {
109
1/1
✓ Branch 1 taken 3 times.
3 boost::optional<double> value = getDouble(OS_Generator_WindTurbineFields::OverallHeight, true);
110
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 4 not taken.
3 OS_ASSERT(value);
111
1/1
✓ Branch 1 taken 3 times.
6 return value.get();
112 }
113
114 3 int GeneratorWindTurbine_Impl::numberofBlades() const {
115
1/1
✓ Branch 1 taken 3 times.
3 boost::optional<int> value = getInt(OS_Generator_WindTurbineFields::NumberofBlades, true);
116
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 4 not taken.
3 OS_ASSERT(value);
117
1/1
✓ Branch 1 taken 3 times.
6 return value.get();
118 }
119
120 3 double GeneratorWindTurbine_Impl::ratedPower() const {
121
1/1
✓ Branch 1 taken 3 times.
3 boost::optional<double> value = getDouble(OS_Generator_WindTurbineFields::RatedPower, true);
122
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 4 not taken.
3 OS_ASSERT(value);
123
1/1
✓ Branch 1 taken 3 times.
6 return value.get();
124 }
125
126 3 double GeneratorWindTurbine_Impl::ratedWindSpeed() const {
127
1/1
✓ Branch 1 taken 3 times.
3 boost::optional<double> value = getDouble(OS_Generator_WindTurbineFields::RatedWindSpeed, true);
128
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 4 not taken.
3 OS_ASSERT(value);
129
1/1
✓ Branch 1 taken 3 times.
6 return value.get();
130 }
131
132 3 double GeneratorWindTurbine_Impl::cutInWindSpeed() const {
133
1/1
✓ Branch 1 taken 3 times.
3 boost::optional<double> value = getDouble(OS_Generator_WindTurbineFields::CutInWindSpeed, true);
134
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 4 not taken.
3 OS_ASSERT(value);
135
1/1
✓ Branch 1 taken 3 times.
6 return value.get();
136 }
137
138 3 double GeneratorWindTurbine_Impl::cutOutWindSpeed() const {
139
1/1
✓ Branch 1 taken 3 times.
3 boost::optional<double> value = getDouble(OS_Generator_WindTurbineFields::CutOutWindSpeed, true);
140
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 4 not taken.
3 OS_ASSERT(value);
141
1/1
✓ Branch 1 taken 3 times.
6 return value.get();
142 }
143
144 3 double GeneratorWindTurbine_Impl::fractionSystemEfficiency() const {
145
1/1
✓ Branch 1 taken 3 times.
3 boost::optional<double> value = getDouble(OS_Generator_WindTurbineFields::FractionsystemEfficiency, true);
146
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 4 not taken.
3 OS_ASSERT(value);
147
1/1
✓ Branch 1 taken 3 times.
6 return value.get();
148 }
149
150 3 double GeneratorWindTurbine_Impl::maximumTipSpeedRatio() const {
151
1/1
✓ Branch 1 taken 3 times.
3 boost::optional<double> value = getDouble(OS_Generator_WindTurbineFields::MaximumTipSpeedRatio, true);
152
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 4 not taken.
3 OS_ASSERT(value);
153
1/1
✓ Branch 1 taken 3 times.
6 return value.get();
154 }
155
156 3 double GeneratorWindTurbine_Impl::maximumPowerCoefficient() const {
157
1/1
✓ Branch 1 taken 3 times.
3 boost::optional<double> value = getDouble(OS_Generator_WindTurbineFields::MaximumPowerCoefficient, true);
158
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 4 not taken.
3 OS_ASSERT(value);
159
1/1
✓ Branch 1 taken 3 times.
6 return value.get();
160 }
161
162 7 boost::optional<double> GeneratorWindTurbine_Impl::annualLocalAverageWindSpeed() const {
163 7 return getDouble(OS_Generator_WindTurbineFields::AnnualLocalAverageWindSpeed, true);
164 }
165
166 3 double GeneratorWindTurbine_Impl::heightforLocalAverageWindSpeed() const {
167
1/1
✓ Branch 1 taken 3 times.
3 boost::optional<double> value = getDouble(OS_Generator_WindTurbineFields::HeightforLocalAverageWindSpeed, true);
168
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 4 not taken.
3 OS_ASSERT(value);
169
1/1
✓ Branch 1 taken 3 times.
6 return value.get();
170 }
171
172 3 double GeneratorWindTurbine_Impl::bladeChordArea() const {
173
1/1
✓ Branch 1 taken 3 times.
3 boost::optional<double> value = getDouble(OS_Generator_WindTurbineFields::BladeChordArea, true);
174
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 4 not taken.
3 OS_ASSERT(value);
175
1/1
✓ Branch 1 taken 3 times.
6 return value.get();
176 }
177
178 3 double GeneratorWindTurbine_Impl::bladeDragCoefficient() const {
179
1/1
✓ Branch 1 taken 3 times.
3 boost::optional<double> value = getDouble(OS_Generator_WindTurbineFields::BladeDragCoefficient, true);
180
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 4 not taken.
3 OS_ASSERT(value);
181
1/1
✓ Branch 1 taken 3 times.
6 return value.get();
182 }
183
184 3 double GeneratorWindTurbine_Impl::bladeLiftCoefficient() const {
185
1/1
✓ Branch 1 taken 3 times.
3 boost::optional<double> value = getDouble(OS_Generator_WindTurbineFields::BladeLiftCoefficient, true);
186
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 4 not taken.
3 OS_ASSERT(value);
187
1/1
✓ Branch 1 taken 3 times.
6 return value.get();
188 }
189
190 3 double GeneratorWindTurbine_Impl::powerCoefficientC1() const {
191
1/1
✓ Branch 1 taken 3 times.
3 boost::optional<double> value = getDouble(OS_Generator_WindTurbineFields::PowerCoefficientC1, true);
192
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 4 not taken.
3 OS_ASSERT(value);
193
1/1
✓ Branch 1 taken 3 times.
6 return value.get();
194 }
195
196 3 double GeneratorWindTurbine_Impl::powerCoefficientC2() const {
197
1/1
✓ Branch 1 taken 3 times.
3 boost::optional<double> value = getDouble(OS_Generator_WindTurbineFields::PowerCoefficientC2, true);
198
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 4 not taken.
3 OS_ASSERT(value);
199
1/1
✓ Branch 1 taken 3 times.
6 return value.get();
200 }
201
202 3 double GeneratorWindTurbine_Impl::powerCoefficientC3() const {
203
1/1
✓ Branch 1 taken 3 times.
3 boost::optional<double> value = getDouble(OS_Generator_WindTurbineFields::PowerCoefficientC3, true);
204
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 4 not taken.
3 OS_ASSERT(value);
205
1/1
✓ Branch 1 taken 3 times.
6 return value.get();
206 }
207
208 3 double GeneratorWindTurbine_Impl::powerCoefficientC4() const {
209
1/1
✓ Branch 1 taken 3 times.
3 boost::optional<double> value = getDouble(OS_Generator_WindTurbineFields::PowerCoefficientC4, true);
210
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 4 not taken.
3 OS_ASSERT(value);
211
1/1
✓ Branch 1 taken 3 times.
6 return value.get();
212 }
213
214 3 double GeneratorWindTurbine_Impl::powerCoefficientC5() const {
215
1/1
✓ Branch 1 taken 3 times.
3 boost::optional<double> value = getDouble(OS_Generator_WindTurbineFields::PowerCoefficientC5, true);
216
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 4 not taken.
3 OS_ASSERT(value);
217
1/1
✓ Branch 1 taken 3 times.
6 return value.get();
218 }
219
220 3 double GeneratorWindTurbine_Impl::powerCoefficientC6() const {
221
1/1
✓ Branch 1 taken 3 times.
3 boost::optional<double> value = getDouble(OS_Generator_WindTurbineFields::PowerCoefficientC6, true);
222
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 4 not taken.
3 OS_ASSERT(value);
223
1/1
✓ Branch 1 taken 3 times.
6 return value.get();
224 }
225
226 12 bool GeneratorWindTurbine_Impl::setAvailabilitySchedule(Schedule& schedule) {
227
3/3
✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
✓ Branch 7 taken 12 times.
48 bool result = setSchedule(OS_Generator_WindTurbineFields::AvailabilityScheduleName, "GeneratorWindTurbine", "Availability", schedule);
228 12 return result;
229 }
230
231 13 bool GeneratorWindTurbine_Impl::setRotorType(const std::string& rotorType) {
232 13 bool result = setString(OS_Generator_WindTurbineFields::RotorType, rotorType);
233 13 return result;
234 }
235
236 13 bool GeneratorWindTurbine_Impl::setPowerControl(const std::string& powerControl) {
237 13 bool result = setString(OS_Generator_WindTurbineFields::PowerControl, powerControl);
238 13 return result;
239 }
240
241 11 bool GeneratorWindTurbine_Impl::setRatedRotorSpeed(double ratedRotorSpeed) {
242 11 bool result = setDouble(OS_Generator_WindTurbineFields::RatedRotorSpeed, ratedRotorSpeed);
243 11 return result;
244 }
245
246 11 bool GeneratorWindTurbine_Impl::setRotorDiameter(double rotorDiameter) {
247 11 bool result = setDouble(OS_Generator_WindTurbineFields::RotorDiameter, rotorDiameter);
248 11 return result;
249 }
250
251 11 bool GeneratorWindTurbine_Impl::setOverallHeight(double overallHeight) {
252 11 bool result = setDouble(OS_Generator_WindTurbineFields::OverallHeight, overallHeight);
253 11 return result;
254 }
255
256 11 bool GeneratorWindTurbine_Impl::setNumberofBlades(int numberofBlades) {
257 11 bool result = setInt(OS_Generator_WindTurbineFields::NumberofBlades, numberofBlades);
258 11 return result;
259 }
260
261 11 bool GeneratorWindTurbine_Impl::setRatedPower(double ratedPower) {
262 11 bool result = setDouble(OS_Generator_WindTurbineFields::RatedPower, ratedPower);
263 11 return result;
264 }
265
266 11 bool GeneratorWindTurbine_Impl::setRatedWindSpeed(double ratedWindSpeed) {
267 11 bool result = setDouble(OS_Generator_WindTurbineFields::RatedWindSpeed, ratedWindSpeed);
268 11 return result;
269 }
270
271 11 bool GeneratorWindTurbine_Impl::setCutInWindSpeed(double cutInWindSpeed) {
272 11 bool result = setDouble(OS_Generator_WindTurbineFields::CutInWindSpeed, cutInWindSpeed);
273 11 return result;
274 }
275
276 11 bool GeneratorWindTurbine_Impl::setCutOutWindSpeed(double cutOutWindSpeed) {
277 11 bool result = setDouble(OS_Generator_WindTurbineFields::CutOutWindSpeed, cutOutWindSpeed);
278 11 return result;
279 }
280
281 11 bool GeneratorWindTurbine_Impl::setFractionSystemEfficiency(double fractionSystemEfficiency) {
282 11 bool result = setDouble(OS_Generator_WindTurbineFields::FractionsystemEfficiency, fractionSystemEfficiency);
283 11 return result;
284 }
285
286 11 bool GeneratorWindTurbine_Impl::setMaximumTipSpeedRatio(double maximumTipSpeedRatio) {
287 11 bool result = setDouble(OS_Generator_WindTurbineFields::MaximumTipSpeedRatio, maximumTipSpeedRatio);
288 11 return result;
289 }
290
291 11 bool GeneratorWindTurbine_Impl::setMaximumPowerCoefficient(double maximumPowerCoefficient) {
292 11 bool result = setDouble(OS_Generator_WindTurbineFields::MaximumPowerCoefficient, maximumPowerCoefficient);
293 11 return result;
294 }
295
296 2 bool GeneratorWindTurbine_Impl::setAnnualLocalAverageWindSpeed(double annualLocalAverageWindSpeed) {
297 2 bool result = setDouble(OS_Generator_WindTurbineFields::AnnualLocalAverageWindSpeed, annualLocalAverageWindSpeed);
298 2 return result;
299 }
300
301 1 void GeneratorWindTurbine_Impl::resetAnnualLocalAverageWindSpeed() {
302
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
2 bool result = setString(OS_Generator_WindTurbineFields::AnnualLocalAverageWindSpeed, "");
303
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
1 OS_ASSERT(result);
304 1 }
305
306 11 bool GeneratorWindTurbine_Impl::setHeightforLocalAverageWindSpeed(double heightforLocalAverageWindSpeed) {
307 11 bool result = setDouble(OS_Generator_WindTurbineFields::HeightforLocalAverageWindSpeed, heightforLocalAverageWindSpeed);
308 11 return result;
309 }
310
311 11 bool GeneratorWindTurbine_Impl::setBladeChordArea(double bladeChordArea) {
312 11 bool result = setDouble(OS_Generator_WindTurbineFields::BladeChordArea, bladeChordArea);
313 11 return result;
314 }
315
316 11 bool GeneratorWindTurbine_Impl::setBladeDragCoefficient(double bladeDragCoefficient) {
317 11 bool result = setDouble(OS_Generator_WindTurbineFields::BladeDragCoefficient, bladeDragCoefficient);
318 11 return result;
319 }
320
321 11 bool GeneratorWindTurbine_Impl::setBladeLiftCoefficient(double bladeLiftCoefficient) {
322 11 bool result = setDouble(OS_Generator_WindTurbineFields::BladeLiftCoefficient, bladeLiftCoefficient);
323 11 return result;
324 }
325
326 11 bool GeneratorWindTurbine_Impl::setPowerCoefficientC1(double powerCoefficientC1) {
327 11 bool result = setDouble(OS_Generator_WindTurbineFields::PowerCoefficientC1, powerCoefficientC1);
328 11 return result;
329 }
330
331 11 bool GeneratorWindTurbine_Impl::setPowerCoefficientC2(double powerCoefficientC2) {
332 11 bool result = setDouble(OS_Generator_WindTurbineFields::PowerCoefficientC2, powerCoefficientC2);
333 11 return result;
334 }
335
336 11 bool GeneratorWindTurbine_Impl::setPowerCoefficientC3(double powerCoefficientC3) {
337 11 bool result = setDouble(OS_Generator_WindTurbineFields::PowerCoefficientC3, powerCoefficientC3);
338 11 return result;
339 }
340
341 11 bool GeneratorWindTurbine_Impl::setPowerCoefficientC4(double powerCoefficientC4) {
342 11 bool result = setDouble(OS_Generator_WindTurbineFields::PowerCoefficientC4, powerCoefficientC4);
343 11 return result;
344 }
345
346 11 bool GeneratorWindTurbine_Impl::setPowerCoefficientC5(double powerCoefficientC5) {
347 11 bool result = setDouble(OS_Generator_WindTurbineFields::PowerCoefficientC5, powerCoefficientC5);
348 11 return result;
349 }
350
351 11 bool GeneratorWindTurbine_Impl::setPowerCoefficientC6(double powerCoefficientC6) {
352 11 bool result = setDouble(OS_Generator_WindTurbineFields::PowerCoefficientC6, powerCoefficientC6);
353 11 return result;
354 }
355
356 } // namespace detail
357
358 10 GeneratorWindTurbine::GeneratorWindTurbine(const Model& model) : Generator(GeneratorWindTurbine::iddObjectType(), model) {
359
1/3
✗ Branch 2 not taken.
✓ Branch 3 taken 10 times.
✗ Branch 5 not taken.
10 OS_ASSERT(getImpl<detail::GeneratorWindTurbine_Impl>());
360
361 {
362
1/1
✓ Branch 1 taken 10 times.
10 auto schedule = model.alwaysOnDiscreteSchedule();
363
1/1
✓ Branch 1 taken 10 times.
10 setAvailabilitySchedule(schedule);
364 10 }
365
2/2
✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
20 setRotorType("HorizontalAxisWindTurbine");
366
2/2
✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
10 setPowerControl("VariableSpeedVariablePitch");
367
1/1
✓ Branch 1 taken 10 times.
10 setRatedRotorSpeed(41.0); // from docs
368
1/1
✓ Branch 1 taken 10 times.
10 setRotorDiameter(19.2); // from docs
369
1/1
✓ Branch 1 taken 10 times.
10 setOverallHeight(30.5); // from docs
370
1/1
✓ Branch 1 taken 10 times.
10 setNumberofBlades(3);
371
1/1
✓ Branch 1 taken 10 times.
10 setRatedPower(55000.0); // from docs
372
1/1
✓ Branch 1 taken 10 times.
10 setRatedWindSpeed(11.0); // from docs
373
1/1
✓ Branch 1 taken 10 times.
10 setCutInWindSpeed(3.5); // from docs
374
1/1
✓ Branch 1 taken 10 times.
10 setCutOutWindSpeed(25.0); // from docs
375
1/1
✓ Branch 1 taken 10 times.
10 setFractionSystemEfficiency(0.835);
376
1/1
✓ Branch 1 taken 10 times.
10 setMaximumTipSpeedRatio(5.0);
377
1/1
✓ Branch 1 taken 10 times.
10 setMaximumPowerCoefficient(0.25);
378
1/1
✓ Branch 1 taken 10 times.
10 setHeightforLocalAverageWindSpeed(50.0);
379
1/1
✓ Branch 1 taken 10 times.
10 setBladeChordArea(2.08); // from docs
380
1/1
✓ Branch 1 taken 10 times.
10 setBladeDragCoefficient(0.9);
381
1/1
✓ Branch 1 taken 10 times.
10 setBladeLiftCoefficient(0.05);
382
1/1
✓ Branch 1 taken 10 times.
10 setPowerCoefficientC1(0.5176);
383
1/1
✓ Branch 1 taken 10 times.
10 setPowerCoefficientC2(116.0);
384
1/1
✓ Branch 1 taken 10 times.
10 setPowerCoefficientC3(0.4);
385
1/1
✓ Branch 1 taken 10 times.
10 setPowerCoefficientC4(0.0);
386
1/1
✓ Branch 1 taken 10 times.
10 setPowerCoefficientC5(5.0);
387
1/1
✓ Branch 1 taken 10 times.
10 setPowerCoefficientC6(21.0);
388 10 }
389
390 7622 IddObjectType GeneratorWindTurbine::iddObjectType() {
391
1/1
✓ Branch 1 taken 7622 times.
7622 return {IddObjectType::OS_Generator_WindTurbine};
392 }
393
394 3 std::string GeneratorWindTurbine::rotorType() const {
395
1/1
✓ Branch 3 taken 3 times.
3 return getImpl<detail::GeneratorWindTurbine_Impl>()->rotorType();
396 }
397
398 3 std::string GeneratorWindTurbine::powerControl() const {
399
1/1
✓ Branch 3 taken 3 times.
3 return getImpl<detail::GeneratorWindTurbine_Impl>()->powerControl();
400 }
401
402 3 double GeneratorWindTurbine::ratedRotorSpeed() const {
403
1/1
✓ Branch 3 taken 3 times.
3 return getImpl<detail::GeneratorWindTurbine_Impl>()->ratedRotorSpeed();
404 }
405
406 3 double GeneratorWindTurbine::rotorDiameter() const {
407
1/1
✓ Branch 3 taken 3 times.
3 return getImpl<detail::GeneratorWindTurbine_Impl>()->rotorDiameter();
408 }
409
410 3 double GeneratorWindTurbine::overallHeight() const {
411
1/1
✓ Branch 3 taken 3 times.
3 return getImpl<detail::GeneratorWindTurbine_Impl>()->overallHeight();
412 }
413
414 3 int GeneratorWindTurbine::numberofBlades() const {
415
1/1
✓ Branch 3 taken 3 times.
3 return getImpl<detail::GeneratorWindTurbine_Impl>()->numberofBlades();
416 }
417
418 3 double GeneratorWindTurbine::ratedPower() const {
419
1/1
✓ Branch 3 taken 3 times.
3 return getImpl<detail::GeneratorWindTurbine_Impl>()->ratedPower();
420 }
421
422 3 double GeneratorWindTurbine::ratedWindSpeed() const {
423
1/1
✓ Branch 3 taken 3 times.
3 return getImpl<detail::GeneratorWindTurbine_Impl>()->ratedWindSpeed();
424 }
425
426 3 double GeneratorWindTurbine::cutInWindSpeed() const {
427
1/1
✓ Branch 3 taken 3 times.
3 return getImpl<detail::GeneratorWindTurbine_Impl>()->cutInWindSpeed();
428 }
429
430 3 double GeneratorWindTurbine::cutOutWindSpeed() const {
431
1/1
✓ Branch 3 taken 3 times.
3 return getImpl<detail::GeneratorWindTurbine_Impl>()->cutOutWindSpeed();
432 }
433
434 3 double GeneratorWindTurbine::fractionSystemEfficiency() const {
435
1/1
✓ Branch 3 taken 3 times.
3 return getImpl<detail::GeneratorWindTurbine_Impl>()->fractionSystemEfficiency();
436 }
437
438 3 double GeneratorWindTurbine::maximumTipSpeedRatio() const {
439
1/1
✓ Branch 3 taken 3 times.
3 return getImpl<detail::GeneratorWindTurbine_Impl>()->maximumTipSpeedRatio();
440 }
441
442 3 double GeneratorWindTurbine::maximumPowerCoefficient() const {
443
1/1
✓ Branch 3 taken 3 times.
3 return getImpl<detail::GeneratorWindTurbine_Impl>()->maximumPowerCoefficient();
444 }
445
446 7 boost::optional<double> GeneratorWindTurbine::annualLocalAverageWindSpeed() const {
447
1/1
✓ Branch 3 taken 7 times.
7 return getImpl<detail::GeneratorWindTurbine_Impl>()->annualLocalAverageWindSpeed();
448 }
449
450 3 double GeneratorWindTurbine::heightforLocalAverageWindSpeed() const {
451
1/1
✓ Branch 3 taken 3 times.
3 return getImpl<detail::GeneratorWindTurbine_Impl>()->heightforLocalAverageWindSpeed();
452 }
453
454 3 double GeneratorWindTurbine::bladeChordArea() const {
455
1/1
✓ Branch 3 taken 3 times.
3 return getImpl<detail::GeneratorWindTurbine_Impl>()->bladeChordArea();
456 }
457
458 3 double GeneratorWindTurbine::bladeDragCoefficient() const {
459
1/1
✓ Branch 3 taken 3 times.
3 return getImpl<detail::GeneratorWindTurbine_Impl>()->bladeDragCoefficient();
460 }
461
462 3 double GeneratorWindTurbine::bladeLiftCoefficient() const {
463
1/1
✓ Branch 3 taken 3 times.
3 return getImpl<detail::GeneratorWindTurbine_Impl>()->bladeLiftCoefficient();
464 }
465
466 3 double GeneratorWindTurbine::powerCoefficientC1() const {
467
1/1
✓ Branch 3 taken 3 times.
3 return getImpl<detail::GeneratorWindTurbine_Impl>()->powerCoefficientC1();
468 }
469
470 3 double GeneratorWindTurbine::powerCoefficientC2() const {
471
1/1
✓ Branch 3 taken 3 times.
3 return getImpl<detail::GeneratorWindTurbine_Impl>()->powerCoefficientC2();
472 }
473
474 3 double GeneratorWindTurbine::powerCoefficientC3() const {
475
1/1
✓ Branch 3 taken 3 times.
3 return getImpl<detail::GeneratorWindTurbine_Impl>()->powerCoefficientC3();
476 }
477
478 3 double GeneratorWindTurbine::powerCoefficientC4() const {
479
1/1
✓ Branch 3 taken 3 times.
3 return getImpl<detail::GeneratorWindTurbine_Impl>()->powerCoefficientC4();
480 }
481
482 3 double GeneratorWindTurbine::powerCoefficientC5() const {
483
1/1
✓ Branch 3 taken 3 times.
3 return getImpl<detail::GeneratorWindTurbine_Impl>()->powerCoefficientC5();
484 }
485
486 3 double GeneratorWindTurbine::powerCoefficientC6() const {
487
1/1
✓ Branch 3 taken 3 times.
3 return getImpl<detail::GeneratorWindTurbine_Impl>()->powerCoefficientC6();
488 }
489
490 12 bool GeneratorWindTurbine::setAvailabilitySchedule(Schedule& schedule) {
491
1/1
✓ Branch 3 taken 12 times.
12 return getImpl<detail::GeneratorWindTurbine_Impl>()->setAvailabilitySchedule(schedule);
492 }
493
494 13 bool GeneratorWindTurbine::setRotorType(const std::string& rotorType) {
495
1/1
✓ Branch 3 taken 13 times.
13 return getImpl<detail::GeneratorWindTurbine_Impl>()->setRotorType(rotorType);
496 }
497
498 13 bool GeneratorWindTurbine::setPowerControl(const std::string& powerControl) {
499
1/1
✓ Branch 3 taken 13 times.
13 return getImpl<detail::GeneratorWindTurbine_Impl>()->setPowerControl(powerControl);
500 }
501
502 11 bool GeneratorWindTurbine::setRatedRotorSpeed(double ratedRotorSpeed) {
503
1/1
✓ Branch 3 taken 11 times.
11 return getImpl<detail::GeneratorWindTurbine_Impl>()->setRatedRotorSpeed(ratedRotorSpeed);
504 }
505
506 11 bool GeneratorWindTurbine::setRotorDiameter(double rotorDiameter) {
507
1/1
✓ Branch 3 taken 11 times.
11 return getImpl<detail::GeneratorWindTurbine_Impl>()->setRotorDiameter(rotorDiameter);
508 }
509
510 11 bool GeneratorWindTurbine::setOverallHeight(double overallHeight) {
511
1/1
✓ Branch 3 taken 11 times.
11 return getImpl<detail::GeneratorWindTurbine_Impl>()->setOverallHeight(overallHeight);
512 }
513
514 11 bool GeneratorWindTurbine::setNumberofBlades(int numberofBlades) {
515
1/1
✓ Branch 3 taken 11 times.
11 return getImpl<detail::GeneratorWindTurbine_Impl>()->setNumberofBlades(numberofBlades);
516 }
517
518 11 bool GeneratorWindTurbine::setRatedPower(double ratedPower) {
519
1/1
✓ Branch 3 taken 11 times.
11 return getImpl<detail::GeneratorWindTurbine_Impl>()->setRatedPower(ratedPower);
520 }
521
522 11 bool GeneratorWindTurbine::setRatedWindSpeed(double ratedWindSpeed) {
523
1/1
✓ Branch 3 taken 11 times.
11 return getImpl<detail::GeneratorWindTurbine_Impl>()->setRatedWindSpeed(ratedWindSpeed);
524 }
525
526 11 bool GeneratorWindTurbine::setCutInWindSpeed(double cutInWindSpeed) {
527
1/1
✓ Branch 3 taken 11 times.
11 return getImpl<detail::GeneratorWindTurbine_Impl>()->setCutInWindSpeed(cutInWindSpeed);
528 }
529
530 11 bool GeneratorWindTurbine::setCutOutWindSpeed(double cutOutWindSpeed) {
531
1/1
✓ Branch 3 taken 11 times.
11 return getImpl<detail::GeneratorWindTurbine_Impl>()->setCutOutWindSpeed(cutOutWindSpeed);
532 }
533
534 11 bool GeneratorWindTurbine::setFractionSystemEfficiency(double fractionSystemEfficiency) {
535
1/1
✓ Branch 3 taken 11 times.
11 return getImpl<detail::GeneratorWindTurbine_Impl>()->setFractionSystemEfficiency(fractionSystemEfficiency);
536 }
537
538 11 bool GeneratorWindTurbine::setMaximumTipSpeedRatio(double maximumTipSpeedRatio) {
539
1/1
✓ Branch 3 taken 11 times.
11 return getImpl<detail::GeneratorWindTurbine_Impl>()->setMaximumTipSpeedRatio(maximumTipSpeedRatio);
540 }
541
542 11 bool GeneratorWindTurbine::setMaximumPowerCoefficient(double maximumPowerCoefficient) {
543
1/1
✓ Branch 3 taken 11 times.
11 return getImpl<detail::GeneratorWindTurbine_Impl>()->setMaximumPowerCoefficient(maximumPowerCoefficient);
544 }
545
546 2 bool GeneratorWindTurbine::setAnnualLocalAverageWindSpeed(double annualLocalAverageWindSpeed) {
547
1/1
✓ Branch 3 taken 2 times.
2 return getImpl<detail::GeneratorWindTurbine_Impl>()->setAnnualLocalAverageWindSpeed(annualLocalAverageWindSpeed);
548 }
549
550 1 void GeneratorWindTurbine::resetAnnualLocalAverageWindSpeed() {
551
1/1
✓ Branch 3 taken 1 time.
1 getImpl<detail::GeneratorWindTurbine_Impl>()->resetAnnualLocalAverageWindSpeed();
552 1 }
553
554 11 bool GeneratorWindTurbine::setHeightforLocalAverageWindSpeed(double heightforLocalAverageWindSpeed) {
555
1/1
✓ Branch 3 taken 11 times.
11 return getImpl<detail::GeneratorWindTurbine_Impl>()->setHeightforLocalAverageWindSpeed(heightforLocalAverageWindSpeed);
556 }
557
558 11 bool GeneratorWindTurbine::setBladeChordArea(double bladeChordArea) {
559
1/1
✓ Branch 3 taken 11 times.
11 return getImpl<detail::GeneratorWindTurbine_Impl>()->setBladeChordArea(bladeChordArea);
560 }
561
562 11 bool GeneratorWindTurbine::setBladeDragCoefficient(double bladeDragCoefficient) {
563
1/1
✓ Branch 3 taken 11 times.
11 return getImpl<detail::GeneratorWindTurbine_Impl>()->setBladeDragCoefficient(bladeDragCoefficient);
564 }
565
566 11 bool GeneratorWindTurbine::setBladeLiftCoefficient(double bladeLiftCoefficient) {
567
1/1
✓ Branch 3 taken 11 times.
11 return getImpl<detail::GeneratorWindTurbine_Impl>()->setBladeLiftCoefficient(bladeLiftCoefficient);
568 }
569
570 11 bool GeneratorWindTurbine::setPowerCoefficientC1(double powerCoefficientC1) {
571
1/1
✓ Branch 3 taken 11 times.
11 return getImpl<detail::GeneratorWindTurbine_Impl>()->setPowerCoefficientC1(powerCoefficientC1);
572 }
573
574 11 bool GeneratorWindTurbine::setPowerCoefficientC2(double powerCoefficientC2) {
575
1/1
✓ Branch 3 taken 11 times.
11 return getImpl<detail::GeneratorWindTurbine_Impl>()->setPowerCoefficientC2(powerCoefficientC2);
576 }
577
578 11 bool GeneratorWindTurbine::setPowerCoefficientC3(double powerCoefficientC3) {
579
1/1
✓ Branch 3 taken 11 times.
11 return getImpl<detail::GeneratorWindTurbine_Impl>()->setPowerCoefficientC3(powerCoefficientC3);
580 }
581
582 11 bool GeneratorWindTurbine::setPowerCoefficientC4(double powerCoefficientC4) {
583
1/1
✓ Branch 3 taken 11 times.
11 return getImpl<detail::GeneratorWindTurbine_Impl>()->setPowerCoefficientC4(powerCoefficientC4);
584 }
585
586 11 bool GeneratorWindTurbine::setPowerCoefficientC5(double powerCoefficientC5) {
587
1/1
✓ Branch 3 taken 11 times.
11 return getImpl<detail::GeneratorWindTurbine_Impl>()->setPowerCoefficientC5(powerCoefficientC5);
588 }
589
590 11 bool GeneratorWindTurbine::setPowerCoefficientC6(double powerCoefficientC6) {
591
1/1
✓ Branch 3 taken 11 times.
11 return getImpl<detail::GeneratorWindTurbine_Impl>()->setPowerCoefficientC6(powerCoefficientC6);
592 }
593
594 /// @cond
595
1/1
✓ Branch 3 taken 5 times.
5 GeneratorWindTurbine::GeneratorWindTurbine(std::shared_ptr<detail::GeneratorWindTurbine_Impl> impl) : Generator(std::move(impl)) {}
596 /// @endcond
597
598 } // namespace model
599 } // namespace openstudio
600