GCC Code Coverage Report


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

src/model/ElectricLoadCenterDistribution.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_ELECTRICLOADCENTERDISTRIBUTION_HPP
7 #define MODEL_ELECTRICLOADCENTERDISTRIBUTION_HPP
8
9 #include "ModelAPI.hpp"
10 #include "ParentObject.hpp"
11
12 namespace openstudio {
13
14 namespace model {
15
16 class Schedule;
17 class Generator;
18 class Inverter;
19 class ElectricalStorage;
20 class ElectricLoadCenterTransformer;
21 class ElectricLoadCenterStorageConverter;
22
23 namespace detail {
24
25 class ElectricLoadCenterDistribution_Impl;
26
27 } // namespace detail
28
29 /** ElectricLoadCenterDistribution is a ParentObject that wraps the OpenStudio IDD object 'OS:ElectricLoadCenter:Distribution'.
30 * There is no ElectricLoadCenter:Generators object in OpenStudio. Instead, the ElectricLoadCenterDistribution object references
31 * a model object list which references all of the associated generators. The rated electric power, availability schedule, and thermal
32 * to electric power ratio fields are contained in the generator objects themselves rather than the ElectricLoadCenter:Generators
33 * as in EnergyPlus. Electric storage and transformers will be added at a later date.
34 */
35 class MODEL_API ElectricLoadCenterDistribution : public ParentObject
36 {
37 public:
38 /** @name Constructors and Destructors */
39 //@{
40
41 explicit ElectricLoadCenterDistribution(const Model& model);
42
43 210 virtual ~ElectricLoadCenterDistribution() override = default;
44 // Default the copy and move operators because the virtual dtor is explicit
45 50 ElectricLoadCenterDistribution(const ElectricLoadCenterDistribution& other) = default;
46 57 ElectricLoadCenterDistribution(ElectricLoadCenterDistribution&& other) = default;
47 ✗ ElectricLoadCenterDistribution& operator=(const ElectricLoadCenterDistribution&) = default;
48 ✗ ElectricLoadCenterDistribution& operator=(ElectricLoadCenterDistribution&&) = default;
49
50 //@}
51
52 static IddObjectType iddObjectType();
53
54 static std::vector<std::string> generatorOperationSchemeTypeValues();
55
56 static std::vector<std::string> electricalBussTypeValues();
57
58 static std::vector<std::string> storageOperationSchemeValues();
59
60 /** @name Getters */
61 //@{
62
63 /// Returns associated generators, note there is no ElectricLoadCenter:Generators object in OpenStudio.
64 std::vector<Generator> generators() const;
65
66 std::string generatorOperationSchemeType() const;
67
68 bool isGeneratorOperationSchemeTypeDefaulted() const;
69
70 boost::optional<double> demandLimitSchemePurchasedElectricDemandLimit() const;
71
72 boost::optional<Schedule> trackScheduleSchemeSchedule() const;
73
74 boost::optional<std::string> trackMeterSchemeMeterName() const;
75
76 std::string electricalBussType() const;
77
78 bool isElectricalBussTypeDefaulted() const;
79
80 boost::optional<Inverter> inverter() const;
81
82 boost::optional<ElectricalStorage> electricalStorage() const;
83
84 boost::optional<ElectricLoadCenterTransformer> transformer() const;
85
86 // New
87
88 // Storage Operation Scheme, defaults to TrackFacilityElectricDemandStoreExcessOnSite
89 std::string storageOperationScheme() const;
90 bool isStorageOperationSchemeDefaulted() const;
91
92 // Storage Control Track Meter Name, required if operation = TrackMeterDemandStoreExcessOnSite
93 boost::optional<std::string> storageControlTrackMeterName() const;
94
95 // Storage Converter Object Name
96 boost::optional<ElectricLoadCenterStorageConverter> storageConverter() const;
97
98 // Maximum Storage State of Charge Fraction, required if storage, defaults
99 double maximumStorageStateofChargeFraction() const;
100 bool isMaximumStorageStateofChargeFractionDefaulted() const;
101
102 // Minimum Storage State of Charge Fraction, required if storage, defaults
103 double minimumStorageStateofChargeFraction() const;
104 bool isMinimumStorageStateofChargeFractionDefaulted() const;
105
106 // Design Storage Control Charge Power, required if FacilityDemandLeveling or TrackChargeDischargeSchedules
107 boost::optional<double> designStorageControlChargePower() const;
108
109 // Storage Charge Power Fraction Schedule Name, required if TrackChargeDischargeSchedules
110 // TODO: do I want to default that to daytime?
111 boost::optional<Schedule> storageChargePowerFractionSchedule() const;
112
113 // Design Storage Control Discharge Power, required if FacilityDemandLeveling or TrackChargeDischargeSchedules
114 boost::optional<double> designStorageControlDischargePower() const;
115
116 // Storage Charge Power Fraction Schedule Name, required if TrackChargeDischargeSchedules
117 // TODO: do I want to default that to daytime?
118 boost::optional<Schedule> storageDischargePowerFractionSchedule() const;
119
120 // Storage Control Utility Demand Target, required if FacilityDemandLeveling
121 boost::optional<double> storageControlUtilityDemandTarget() const;
122
123 // Storage Control Utility Demand Target Fraction Schedule Name, will be used only if FacilityDemandLeveling, defaults to 1.0
124 Schedule storageControlUtilityDemandTargetFractionSchedule() const;
125 bool isStorageControlUtilityDemandTargetFractionScheduleDefaulted() const;
126
127 //@}
128 /** @name Setters */
129 //@{
130
131 bool addGenerator(const Generator& generator);
132
133 bool removeGenerator(const Generator& generator);
134
135 void resetGenerators();
136
137 bool setGeneratorOperationSchemeType(const std::string& generatorOperationSchemeType);
138
139 void resetGeneratorOperationSchemeType();
140
141 bool setDemandLimitSchemePurchasedElectricDemandLimit(double demandLimitSchemePurchasedElectricDemandLimit);
142
143 void resetDemandLimitSchemePurchasedElectricDemandLimit();
144
145 bool setTrackScheduleSchemeSchedule(Schedule& schedule);
146
147 void resetTrackScheduleSchemeSchedule();
148
149 bool setTrackMeterSchemeMeterName(const std::string& trackMeterSchemeMeterName);
150
151 void resetTrackMeterSchemeMeterName();
152
153 bool setElectricalBussType(const std::string& electricalBussType);
154
155 void resetElectricalBussType();
156
157 bool setInverter(const Inverter& inverter);
158
159 void resetInverter();
160
161 bool setElectricalStorage(const ElectricalStorage& electricalStorage);
162
163 void resetElectricalStorage();
164
165 bool setTransformer(const ElectricLoadCenterTransformer& transformer);
166
167 void resetTransformer();
168
169 // Storage Operation Scheme
170 bool setStorageOperationScheme(const std::string& operationScheme);
171 void resetStorageOperationScheme();
172
173 // Storage Control Track Meter Name, required if operation = TrackMeterDemandStoreExcessOnSite
174 bool setStorageControlTrackMeterName(const std::string& meterName);
175 void resetStorageControlTrackMeterName();
176
177 // Storage Converter Object Name
178 bool setStorageConverter(const ElectricLoadCenterStorageConverter& converter);
179 void resetStorageConverter();
180
181 // Maximum Storage State of Charge Fraction, required if storage, defaults
182 bool setMaximumStorageStateofChargeFraction(const double maxStateofCharge);
183 void resetMaximumStorageStateofChargeFraction();
184
185 // Minimum Storage State of Charge Fraction, required if storage, defaults
186 bool setMinimumStorageStateofChargeFraction(const double minStateofCharge);
187 void resetMinimumStorageStateofChargeFraction();
188
189 // Design Storage Control Charge Power, required if FacilityDemandLeveling or TrackChargeDischargeSchedules
190 bool setDesignStorageControlChargePower(const double designStorageControlChargePower);
191 void resetDesignStorageControlChargePower();
192
193 // Storage Charge Power Fraction Schedule Name, required if TrackChargeDischargeSchedules
194 // TODO: do I want to default that to daytime?
195 bool setStorageChargePowerFractionSchedule(Schedule& schedule);
196 void resetStorageChargePowerFractionSchedule();
197
198 // Design Storage Control Discharge Power, required if FacilityDemandLeveling or TrackChargeDischargeSchedules
199 bool setDesignStorageControlDischargePower(const double designStorageControlDischargePower);
200 void resetDesignStorageControlDischargePower();
201
202 // Storage Charge Power Fraction Schedule Name, required if TrackChargeDischargeSchedules
203 // TODO: do I want to default that to daytime?
204 bool setStorageDischargePowerFractionSchedule(Schedule& schedule);
205 void resetStorageDischargePowerFractionSchedule();
206
207 // Storage Control Utility Demand Target, required if FacilityDemandLeveling
208 bool setStorageControlUtilityDemandTarget(const double storageControlUtilityDemandTarget);
209 void resetStorageControlUtilityDemandTarget();
210
211 // Storage Control Utility Demand Target Fraction Schedule Name, will be used only if FacilityDemandLeveling, defaults to 1.0
212 bool setStorageControlUtilityDemandTargetFractionSchedule(Schedule& schedule);
213 void resetStorageControlUtilityDemandTargetFractionSchedule();
214
215 //@}
216 /** @name Other */
217 //@{
218
219 bool validityCheck() const;
220
221 //@}
222 protected:
223 /// @cond
224 using ImplType = detail::ElectricLoadCenterDistribution_Impl;
225
226 explicit ElectricLoadCenterDistribution(std::shared_ptr<detail::ElectricLoadCenterDistribution_Impl> impl);
227
228 friend class detail::ElectricLoadCenterDistribution_Impl;
229 friend class Model;
230 friend class IdfObject;
231 friend class openstudio::detail::IdfObject_Impl;
232 /// @endcond
233 private:
234 REGISTER_LOGGER("openstudio.model.ElectricLoadCenterDistribution");
235 };
236
237 /** \relates ElectricLoadCenterDistribution*/
238 using OptionalElectricLoadCenterDistribution = boost::optional<ElectricLoadCenterDistribution>;
239
240 /** \relates ElectricLoadCenterDistribution*/
241 using ElectricLoadCenterDistributionVector = std::vector<ElectricLoadCenterDistribution>;
242
243 } // namespace model
244 } // namespace openstudio
245
246 #endif // MODEL_ELECTRICLOADCENTERDISTRIBUTION_HPP
247