Line data Source code
1 : // EnergyPlus, Copyright (c) 1996-2025, The Board of Trustees of the University of Illinois,
2 : // The Regents of the University of California, through Lawrence Berkeley National Laboratory
3 : // (subject to receipt of any required approvals from the U.S. Dept. of Energy), Oak Ridge
4 : // National Laboratory, managed by UT-Battelle, Alliance for Sustainable Energy, LLC, and other
5 : // contributors. All rights reserved.
6 : //
7 : // NOTICE: This Software was developed under funding from the U.S. Department of Energy and the
8 : // U.S. Government consequently retains certain rights. As such, the U.S. Government has been
9 : // granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable,
10 : // worldwide license in the Software to reproduce, distribute copies to the public, prepare
11 : // derivative works, and perform publicly and display publicly, and to permit others to do so.
12 : //
13 : // Redistribution and use in source and binary forms, with or without modification, are permitted
14 : // provided that the following conditions are met:
15 : //
16 : // (1) Redistributions of source code must retain the above copyright notice, this list of
17 : // conditions and the following disclaimer.
18 : //
19 : // (2) Redistributions in binary form must reproduce the above copyright notice, this list of
20 : // conditions and the following disclaimer in the documentation and/or other materials
21 : // provided with the distribution.
22 : //
23 : // (3) Neither the name of the University of California, Lawrence Berkeley National Laboratory,
24 : // the University of Illinois, U.S. Dept. of Energy nor the names of its contributors may be
25 : // used to endorse or promote products derived from this software without specific prior
26 : // written permission.
27 : //
28 : // (4) Use of EnergyPlus(TM) Name. If Licensee (i) distributes the software in stand-alone form
29 : // without changes from the version obtained under this License, or (ii) Licensee makes a
30 : // reference solely to the software portion of its product, Licensee must refer to the
31 : // software as "EnergyPlus version X" software, where "X" is the version number Licensee
32 : // obtained under this License and may not use a different name for the software. Except as
33 : // specifically required in this Section (4), Licensee shall not use in a company name, a
34 : // product name, in advertising, publicity, or other promotional activities any name, trade
35 : // name, trademark, logo, or other designation of "EnergyPlus", "E+", "e+" or confusingly
36 : // similar designation, without the U.S. Department of Energy's prior written consent.
37 : //
38 : // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
39 : // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
40 : // AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
41 : // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
42 : // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
43 : // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
44 : // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
45 : // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
46 : // POSSIBILITY OF SUCH DAMAGE.
47 :
48 : // EnergyPlus Headers
49 : #include <EnergyPlus/Data/EnergyPlusData.hh>
50 : #include <EnergyPlus/DataEnvironment.hh>
51 : #include <EnergyPlus/DataGlobalConstants.hh>
52 : #include <EnergyPlus/DataIPShortCuts.hh>
53 : #include <EnergyPlus/EMSManager.hh>
54 : #include <EnergyPlus/ExteriorEnergyUse.hh>
55 : #include <EnergyPlus/GlobalNames.hh>
56 : #include <EnergyPlus/InputProcessing/InputProcessor.hh>
57 : #include <EnergyPlus/OutputProcessor.hh>
58 : #include <EnergyPlus/OutputReportPredefined.hh>
59 : #include <EnergyPlus/ScheduleManager.hh>
60 : #include <EnergyPlus/UtilityRoutines.hh>
61 :
62 : namespace EnergyPlus {
63 :
64 : namespace ExteriorEnergyUse {
65 :
66 : // MODULE INFORMATION:
67 : // AUTHOR Linda Lawrie
68 : // DATE WRITTEN January 2001
69 : // MODIFIED na
70 : // RE-ENGINEERED na
71 :
72 : // PURPOSE OF THIS MODULE:
73 : // This module provides the reporting for exterior energy usage. This usage does not directly
74 : // affect simulation results for the energy usage in a building but may affect the "metered"
75 : // usage of a facility.
76 :
77 1997945 : void ManageExteriorEnergyUse(EnergyPlusData &state)
78 : {
79 :
80 : // SUBROUTINE INFORMATION:
81 : // AUTHOR Linda Lawrie
82 : // DATE WRITTEN January 2001
83 : // MODIFIED na
84 : // RE-ENGINEERED na
85 :
86 : // PURPOSE OF THIS SUBROUTINE:
87 : // This subroutine provides the usual call for the Simulation Manager.
88 :
89 1997945 : if (state.dataExteriorEnergyUse->GetExteriorEnergyInputFlag) {
90 800 : ExteriorEnergyUse::GetExteriorEnergyUseInput(state);
91 800 : state.dataExteriorEnergyUse->GetExteriorEnergyInputFlag = false;
92 : }
93 :
94 1997945 : ExteriorEnergyUse::ReportExteriorEnergyUse(state);
95 1997945 : }
96 :
97 800 : void GetExteriorEnergyUseInput(EnergyPlusData &state)
98 : {
99 :
100 : // SUBROUTINE INFORMATION:
101 : // AUTHOR Linda Lawrie
102 : // DATE WRITTEN January 2001
103 : // MODIFIED na
104 : // RE-ENGINEERED na
105 :
106 : // PURPOSE OF THIS SUBROUTINE:
107 : // This subroutine gets the input for the Exterior Lights and Equipment.
108 :
109 : // Using/Aliasing
110 : using namespace OutputReportPredefined;
111 : // SUBROUTINE PARAMETER DEFINITIONS:
112 800 : std::string_view constexpr routineName = "GetExteriorEnergyUseInput";
113 :
114 : // SUBROUTINE LOCAL VARIABLE DECLARATIONS:
115 : int NumAlphas; // Number of Alphas for each GetObjectItem call
116 : int NumNumbers; // Number of Numbers for each GetObjectItem call
117 : int IOStatus; // Used in GetObjectItem
118 800 : bool ErrorsFound(false); // Set to true if errors in input, fatal at end of routine
119 800 : std::string EndUseSubcategoryName;
120 :
121 800 : auto &s_ipsc = state.dataIPShortCut;
122 :
123 800 : state.dataExteriorEnergyUse->NumExteriorLights = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "Exterior:Lights");
124 800 : state.dataExteriorEnergyUse->ExteriorLights.allocate(state.dataExteriorEnergyUse->NumExteriorLights);
125 :
126 800 : int NumFuelEq = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "Exterior:FuelEquipment");
127 800 : int NumWtrEq = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "Exterior:WaterEquipment");
128 800 : state.dataExteriorEnergyUse->ExteriorEquipment.allocate(NumFuelEq + NumWtrEq);
129 800 : state.dataExteriorEnergyUse->UniqueExteriorEquipNames.reserve(NumFuelEq + NumWtrEq);
130 :
131 800 : state.dataExteriorEnergyUse->GetExteriorEnergyInputFlag = false;
132 800 : state.dataExteriorEnergyUse->NumExteriorEqs = 0;
133 :
134 : // ================================= Get Exterior Lights
135 800 : std::string_view cCurrentModuleObject = "Exterior:Lights";
136 995 : for (int Item = 1; Item <= state.dataExteriorEnergyUse->NumExteriorLights; ++Item) {
137 390 : state.dataInputProcessing->inputProcessor->getObjectItem(state,
138 : cCurrentModuleObject,
139 : Item,
140 195 : s_ipsc->cAlphaArgs,
141 : NumAlphas,
142 195 : s_ipsc->rNumericArgs,
143 : NumNumbers,
144 : IOStatus,
145 195 : s_ipsc->lNumericFieldBlanks,
146 195 : s_ipsc->lAlphaFieldBlanks,
147 195 : s_ipsc->cAlphaFieldNames,
148 195 : s_ipsc->cNumericFieldNames);
149 :
150 195 : ErrorObjectHeader eoh{routineName, cCurrentModuleObject, s_ipsc->cAlphaArgs(1)};
151 :
152 195 : state.dataExteriorEnergyUse->ExteriorLights(Item).Name = s_ipsc->cAlphaArgs(1);
153 :
154 195 : if (s_ipsc->lAlphaFieldBlanks(2)) {
155 0 : ShowSevereEmptyField(state, eoh, s_ipsc->cAlphaFieldNames(2));
156 0 : ErrorsFound = true;
157 195 : } else if ((state.dataExteriorEnergyUse->ExteriorLights(Item).sched = Sched::GetSchedule(state, s_ipsc->cAlphaArgs(2))) == nullptr) {
158 0 : ShowSevereItemNotFound(state, eoh, s_ipsc->cAlphaFieldNames(2), s_ipsc->cAlphaArgs(2));
159 0 : ErrorsFound = true;
160 195 : } else if (int SchMin = state.dataExteriorEnergyUse->ExteriorLights(Item).sched->getMinVal(state); SchMin < 0.0) {
161 0 : ShowSevereCustom(
162 : state,
163 : eoh,
164 0 : format("{} = {} minimum is [{:.1R}]. Values must be >= 0.0.", s_ipsc->cAlphaFieldNames(3), s_ipsc->cAlphaArgs(3), SchMin));
165 0 : ErrorsFound = true;
166 : }
167 :
168 195 : if (s_ipsc->lAlphaFieldBlanks(3)) {
169 9 : state.dataExteriorEnergyUse->ExteriorLights(Item).ControlMode = ExteriorEnergyUse::LightControlType::ScheduleOnly;
170 186 : } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "ScheduleNameOnly")) {
171 12 : state.dataExteriorEnergyUse->ExteriorLights(Item).ControlMode = ExteriorEnergyUse::LightControlType::ScheduleOnly;
172 174 : } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "AstronomicalClock")) {
173 174 : state.dataExteriorEnergyUse->ExteriorLights(Item).ControlMode = ExteriorEnergyUse::LightControlType::AstroClockOverride;
174 : } else {
175 0 : ShowSevereInvalidKey(state, eoh, state.dataIPShortCut->cAlphaFieldNames(3), state.dataIPShortCut->cAlphaArgs(3));
176 : }
177 :
178 195 : if (NumAlphas > 3) {
179 182 : EndUseSubcategoryName = state.dataIPShortCut->cAlphaArgs(4);
180 : } else {
181 13 : EndUseSubcategoryName = "General";
182 : }
183 :
184 195 : state.dataExteriorEnergyUse->ExteriorLights(Item).DesignLevel = state.dataIPShortCut->rNumericArgs(1);
185 195 : if (state.dataGlobal->AnyEnergyManagementSystemInModel) {
186 150 : SetupEMSActuator(state,
187 : "ExteriorLights",
188 75 : state.dataExteriorEnergyUse->ExteriorLights(Item).Name,
189 : "Electricity Rate",
190 : "W",
191 75 : state.dataExteriorEnergyUse->ExteriorLights(Item).PowerActuatorOn,
192 75 : state.dataExteriorEnergyUse->ExteriorLights(Item).PowerActuatorValue);
193 : }
194 :
195 390 : SetupOutputVariable(state,
196 : "Exterior Lights Electricity Rate",
197 : Constant::Units::W,
198 195 : state.dataExteriorEnergyUse->ExteriorLights(Item).Power,
199 : OutputProcessor::TimeStepType::Zone,
200 : OutputProcessor::StoreType::Average,
201 195 : state.dataExteriorEnergyUse->ExteriorLights(Item).Name);
202 :
203 390 : SetupOutputVariable(state,
204 : "Exterior Lights Electricity Energy",
205 : Constant::Units::J,
206 195 : state.dataExteriorEnergyUse->ExteriorLights(Item).CurrentUse,
207 : OutputProcessor::TimeStepType::Zone,
208 : OutputProcessor::StoreType::Sum,
209 195 : state.dataExteriorEnergyUse->ExteriorLights(Item).Name,
210 : Constant::eResource::Electricity,
211 : OutputProcessor::Group::Invalid,
212 : OutputProcessor::EndUseCat::ExteriorLights,
213 : EndUseSubcategoryName);
214 :
215 : // entries for predefined tables
216 390 : PreDefTableEntry(state,
217 195 : state.dataOutRptPredefined->pdchExLtPower,
218 195 : state.dataExteriorEnergyUse->ExteriorLights(Item).Name,
219 195 : state.dataExteriorEnergyUse->ExteriorLights(Item).DesignLevel);
220 195 : state.dataExteriorEnergyUse->sumDesignLevel += state.dataExteriorEnergyUse->ExteriorLights(Item).DesignLevel;
221 195 : if (state.dataExteriorEnergyUse->ExteriorLights(Item).ControlMode ==
222 : ExteriorEnergyUse::LightControlType::AstroClockOverride) { // photocell/schedule
223 348 : PreDefTableEntry(
224 174 : state, state.dataOutRptPredefined->pdchExLtClock, state.dataExteriorEnergyUse->ExteriorLights(Item).Name, "AstronomicalClock");
225 174 : PreDefTableEntry(state, state.dataOutRptPredefined->pdchExLtSchd, state.dataExteriorEnergyUse->ExteriorLights(Item).Name, "-");
226 : } else {
227 42 : PreDefTableEntry(
228 21 : state, state.dataOutRptPredefined->pdchExLtClock, state.dataExteriorEnergyUse->ExteriorLights(Item).Name, "Schedule");
229 21 : PreDefTableEntry(state,
230 21 : state.dataOutRptPredefined->pdchExLtSchd,
231 21 : state.dataExteriorEnergyUse->ExteriorLights(Item).Name,
232 21 : state.dataExteriorEnergyUse->ExteriorLights(Item).sched->Name);
233 : }
234 : }
235 800 : PreDefTableEntry(state, state.dataOutRptPredefined->pdchExLtPower, "Exterior Lighting Total", state.dataExteriorEnergyUse->sumDesignLevel);
236 :
237 : // ================================= Get Exterior Fuel Equipment
238 :
239 800 : cCurrentModuleObject = "Exterior:FuelEquipment";
240 862 : for (int Item = 1; Item <= NumFuelEq; ++Item) {
241 124 : state.dataInputProcessing->inputProcessor->getObjectItem(state,
242 : cCurrentModuleObject,
243 : Item,
244 62 : state.dataIPShortCut->cAlphaArgs,
245 : NumAlphas,
246 62 : state.dataIPShortCut->rNumericArgs,
247 : NumNumbers,
248 : IOStatus,
249 62 : state.dataIPShortCut->lNumericFieldBlanks,
250 62 : state.dataIPShortCut->lAlphaFieldBlanks,
251 62 : state.dataIPShortCut->cAlphaFieldNames,
252 62 : state.dataIPShortCut->cNumericFieldNames);
253 124 : GlobalNames::VerifyUniqueInterObjectName(state,
254 62 : state.dataExteriorEnergyUse->UniqueExteriorEquipNames,
255 62 : state.dataIPShortCut->cAlphaArgs(1),
256 : cCurrentModuleObject,
257 62 : state.dataIPShortCut->cAlphaFieldNames(1),
258 : ErrorsFound);
259 :
260 62 : ErrorObjectHeader eoh{routineName, s_ipsc->cCurrentModuleObject, s_ipsc->cAlphaArgs(1)};
261 :
262 62 : ++state.dataExteriorEnergyUse->NumExteriorEqs;
263 :
264 62 : auto &exteriorEquip = state.dataExteriorEnergyUse->ExteriorEquipment(state.dataExteriorEnergyUse->NumExteriorEqs);
265 62 : exteriorEquip.Name = state.dataIPShortCut->cAlphaArgs(1);
266 :
267 62 : if (NumAlphas > 3) {
268 47 : EndUseSubcategoryName = state.dataIPShortCut->cAlphaArgs(4);
269 : } else {
270 15 : EndUseSubcategoryName = "General";
271 : }
272 :
273 62 : if (state.dataIPShortCut->lAlphaFieldBlanks(2)) {
274 0 : ShowSevereEmptyField(state, eoh, s_ipsc->cAlphaFieldNames(2));
275 0 : ErrorsFound = true;
276 :
277 62 : } else if ((exteriorEquip.FuelType = static_cast<Constant::eFuel>(getEnumValue(Constant::eFuelNamesUC, s_ipsc->cAlphaArgs(2)))) ==
278 : Constant::eFuel::Invalid) {
279 0 : ShowSevereInvalidKey(state, eoh, s_ipsc->cAlphaFieldNames(2), s_ipsc->cAlphaArgs(2));
280 0 : ErrorsFound = true;
281 :
282 62 : } else if (exteriorEquip.FuelType != Constant::eFuel::Water) {
283 122 : SetupOutputVariable(state,
284 : "Exterior Equipment Fuel Rate",
285 : Constant::Units::W,
286 61 : exteriorEquip.Power,
287 : OutputProcessor::TimeStepType::Zone,
288 : OutputProcessor::StoreType::Average,
289 61 : exteriorEquip.Name);
290 183 : SetupOutputVariable(state,
291 122 : format("Exterior Equipment {} Energy", Constant::eFuelNames[(int)exteriorEquip.FuelType]),
292 : Constant::Units::J,
293 61 : exteriorEquip.CurrentUse,
294 : OutputProcessor::TimeStepType::Zone,
295 : OutputProcessor::StoreType::Sum,
296 61 : exteriorEquip.Name,
297 61 : Constant::eFuel2eResource[(int)exteriorEquip.FuelType],
298 : OutputProcessor::Group::Invalid,
299 : OutputProcessor::EndUseCat::ExteriorEquipment,
300 : EndUseSubcategoryName);
301 : } else {
302 2 : SetupOutputVariable(state,
303 : "Exterior Equipment Water Volume Flow Rate",
304 : Constant::Units::m3_s,
305 1 : exteriorEquip.Power,
306 : OutputProcessor::TimeStepType::Zone,
307 : OutputProcessor::StoreType::Average,
308 1 : exteriorEquip.Name);
309 3 : SetupOutputVariable(state,
310 2 : format("Exterior Equipment {} Volume", Constant::eFuelNames[(int)exteriorEquip.FuelType]),
311 : Constant::Units::m3,
312 1 : exteriorEquip.CurrentUse,
313 : OutputProcessor::TimeStepType::Zone,
314 : OutputProcessor::StoreType::Sum,
315 1 : exteriorEquip.Name,
316 1 : Constant::eFuel2eResource[(int)exteriorEquip.FuelType],
317 : OutputProcessor::Group::Invalid,
318 : OutputProcessor::EndUseCat::ExteriorEquipment,
319 : EndUseSubcategoryName);
320 : }
321 :
322 62 : if (s_ipsc->lAlphaFieldBlanks(3)) {
323 0 : ShowSevereEmptyField(state, eoh, s_ipsc->cAlphaFieldNames(3));
324 0 : ErrorsFound = true;
325 62 : } else if ((exteriorEquip.sched = Sched::GetSchedule(state, s_ipsc->cAlphaArgs(3))) == nullptr) {
326 0 : ShowSevereItemNotFound(state, eoh, s_ipsc->cAlphaFieldNames(3), s_ipsc->cAlphaArgs(3));
327 0 : ErrorsFound = true;
328 62 : } else if (int SchMin = exteriorEquip.sched->getMinVal(state); SchMin < 0.0) {
329 0 : ShowSevereCustom(
330 : state,
331 : eoh,
332 0 : format("{} = {} minimum is [{:.1R}]. Values must be >= 0.0.", s_ipsc->cAlphaFieldNames(3), s_ipsc->cAlphaArgs(3), SchMin));
333 0 : ErrorsFound = true;
334 : }
335 62 : exteriorEquip.DesignLevel = s_ipsc->rNumericArgs(1);
336 : }
337 :
338 : // ================================= Get Exterior Water Equipment
339 :
340 800 : cCurrentModuleObject = "Exterior:WaterEquipment";
341 801 : for (int Item = 1; Item <= NumWtrEq; ++Item) {
342 2 : state.dataInputProcessing->inputProcessor->getObjectItem(state,
343 : cCurrentModuleObject,
344 : Item,
345 1 : s_ipsc->cAlphaArgs,
346 : NumAlphas,
347 1 : s_ipsc->rNumericArgs,
348 : NumNumbers,
349 : IOStatus,
350 1 : s_ipsc->lNumericFieldBlanks,
351 1 : s_ipsc->lAlphaFieldBlanks,
352 1 : s_ipsc->cAlphaFieldNames,
353 1 : s_ipsc->cNumericFieldNames);
354 :
355 1 : ErrorObjectHeader eoh{routineName, cCurrentModuleObject, s_ipsc->cAlphaArgs(1)};
356 :
357 2 : GlobalNames::VerifyUniqueInterObjectName(state,
358 1 : state.dataExteriorEnergyUse->UniqueExteriorEquipNames,
359 1 : s_ipsc->cAlphaArgs(1),
360 : cCurrentModuleObject,
361 1 : s_ipsc->cAlphaFieldNames(1),
362 : ErrorsFound);
363 :
364 1 : ++state.dataExteriorEnergyUse->NumExteriorEqs;
365 :
366 1 : auto &exteriorEquip = state.dataExteriorEnergyUse->ExteriorEquipment(state.dataExteriorEnergyUse->NumExteriorEqs);
367 1 : exteriorEquip.Name = s_ipsc->cAlphaArgs(1);
368 1 : exteriorEquip.FuelType = Constant::eFuel::Water;
369 :
370 1 : if (s_ipsc->lAlphaFieldBlanks(3)) {
371 0 : ShowSevereEmptyField(state, eoh, s_ipsc->cAlphaFieldNames(3));
372 0 : ErrorsFound = true;
373 1 : } else if ((exteriorEquip.sched = Sched::GetSchedule(state, s_ipsc->cAlphaArgs(3))) == nullptr) {
374 0 : ShowSevereItemNotFound(state, eoh, s_ipsc->cAlphaFieldNames(3), s_ipsc->cAlphaArgs(3));
375 0 : ErrorsFound = true;
376 1 : } else if (int SchMin = exteriorEquip.sched->getMinVal(state); SchMin < 0.0) {
377 0 : ShowSevereCustom(
378 : state,
379 : eoh,
380 0 : format("{} = {} minimum is [{:.1R}]. Values must be >= 0.0.", s_ipsc->cAlphaFieldNames(3), s_ipsc->cAlphaArgs(3), SchMin));
381 0 : ErrorsFound = true;
382 : }
383 :
384 1 : if (NumAlphas > 3) {
385 0 : EndUseSubcategoryName = s_ipsc->cAlphaArgs(4);
386 : } else {
387 1 : EndUseSubcategoryName = "General";
388 : }
389 :
390 1 : exteriorEquip.DesignLevel = s_ipsc->rNumericArgs(1);
391 :
392 2 : SetupOutputVariable(state,
393 : "Exterior Equipment Water Volume Flow Rate",
394 : Constant::Units::m3_s,
395 1 : exteriorEquip.Power,
396 : OutputProcessor::TimeStepType::Zone,
397 : OutputProcessor::StoreType::Average,
398 1 : exteriorEquip.Name);
399 :
400 2 : SetupOutputVariable(state,
401 : "Exterior Equipment Water Volume",
402 : Constant::Units::m3,
403 1 : exteriorEquip.CurrentUse,
404 : OutputProcessor::TimeStepType::Zone,
405 : OutputProcessor::StoreType::Sum,
406 1 : exteriorEquip.Name,
407 : Constant::eResource::Water,
408 : OutputProcessor::Group::Invalid,
409 : OutputProcessor::EndUseCat::ExteriorEquipment,
410 : EndUseSubcategoryName);
411 2 : SetupOutputVariable(state,
412 : "Exterior Equipment Mains Water Volume",
413 : Constant::Units::m3,
414 1 : exteriorEquip.CurrentUse,
415 : OutputProcessor::TimeStepType::Zone,
416 : OutputProcessor::StoreType::Sum,
417 1 : exteriorEquip.Name,
418 : Constant::eResource::MainsWater,
419 : OutputProcessor::Group::Invalid,
420 : OutputProcessor::EndUseCat::ExteriorEquipment,
421 : EndUseSubcategoryName);
422 : }
423 :
424 800 : if (ErrorsFound) {
425 0 : ShowFatalError(state, format("{}Errors found in input. Program terminates.", routineName));
426 : }
427 800 : } // GetExteriorEnergyUseInput()
428 :
429 1997945 : void ReportExteriorEnergyUse(EnergyPlusData &state)
430 : {
431 :
432 : // SUBROUTINE INFORMATION:
433 : // AUTHOR Linda Lawrie
434 : // DATE WRITTEN January 2001
435 :
436 : // PURPOSE OF THIS SUBROUTINE:
437 : // This subroutine performs the calculations necessary to report
438 : // the exterior energy use types.
439 :
440 2516329 : for (int Item = 1; Item <= state.dataExteriorEnergyUse->NumExteriorLights; ++Item) {
441 518384 : switch (state.dataExteriorEnergyUse->ExteriorLights(Item).ControlMode) {
442 38401 : case ExteriorEnergyUse::LightControlType::ScheduleOnly:
443 76802 : state.dataExteriorEnergyUse->ExteriorLights(Item).Power = state.dataExteriorEnergyUse->ExteriorLights(Item).DesignLevel *
444 38401 : state.dataExteriorEnergyUse->ExteriorLights(Item).sched->getCurrentVal();
445 38401 : state.dataExteriorEnergyUse->ExteriorLights(Item).CurrentUse =
446 38401 : state.dataExteriorEnergyUse->ExteriorLights(Item).Power * state.dataGlobal->TimeStepZoneSec;
447 38401 : break;
448 479983 : case ExteriorEnergyUse::LightControlType::AstroClockOverride:
449 479983 : if (state.dataEnvrn->SunIsUp) {
450 234181 : state.dataExteriorEnergyUse->ExteriorLights(Item).Power = 0.0;
451 234181 : state.dataExteriorEnergyUse->ExteriorLights(Item).CurrentUse = 0.0;
452 : } else {
453 245802 : state.dataExteriorEnergyUse->ExteriorLights(Item).Power =
454 491604 : state.dataExteriorEnergyUse->ExteriorLights(Item).DesignLevel *
455 245802 : state.dataExteriorEnergyUse->ExteriorLights(Item).sched->getCurrentVal();
456 245802 : state.dataExteriorEnergyUse->ExteriorLights(Item).CurrentUse =
457 245802 : state.dataExteriorEnergyUse->ExteriorLights(Item).Power * state.dataGlobal->TimeStepZoneSec;
458 : }
459 479983 : break;
460 0 : default:
461 : // should not happen
462 0 : break;
463 : }
464 :
465 : // Reduce lighting power due to demand limiting
466 518604 : if (state.dataExteriorEnergyUse->ExteriorLights(Item).ManageDemand &&
467 220 : (state.dataExteriorEnergyUse->ExteriorLights(Item).Power > state.dataExteriorEnergyUse->ExteriorLights(Item).DemandLimit)) {
468 220 : state.dataExteriorEnergyUse->ExteriorLights(Item).Power = state.dataExteriorEnergyUse->ExteriorLights(Item).DemandLimit;
469 220 : state.dataExteriorEnergyUse->ExteriorLights(Item).CurrentUse =
470 220 : state.dataExteriorEnergyUse->ExteriorLights(Item).Power * state.dataGlobal->TimeStepZoneSec;
471 : }
472 : // EMS controls
473 518384 : if (state.dataExteriorEnergyUse->ExteriorLights(Item).PowerActuatorOn) {
474 0 : state.dataExteriorEnergyUse->ExteriorLights(Item).Power = state.dataExteriorEnergyUse->ExteriorLights(Item).PowerActuatorValue;
475 : }
476 :
477 518384 : state.dataExteriorEnergyUse->ExteriorLights(Item).CurrentUse =
478 518384 : state.dataExteriorEnergyUse->ExteriorLights(Item).Power * state.dataGlobal->TimeStepZoneSec;
479 :
480 : // gather for tabular reports
481 518384 : if (!state.dataGlobal->WarmupFlag) {
482 : // IF (DoOutputReporting .AND. WriteTabularFiles .and. (KindOfSim == ksRunPeriodWeather)) THEN !for weather simulations only
483 139454 : if (state.dataGlobal->DoOutputReporting &&
484 69727 : (state.dataGlobal->KindOfSim == Constant::KindOfSim::RunPeriodWeather)) { // for weather simulations only
485 : // for tabular report, accumua the total electricity used for each ExteriorLights object
486 8760 : state.dataExteriorEnergyUse->ExteriorLights(Item).SumConsumption += state.dataExteriorEnergyUse->ExteriorLights(Item).CurrentUse;
487 : // for tabular report, accumulate the time when each ExteriorLights has consumption
488 : //(using a very small threshold instead of zero)
489 8760 : if (state.dataExteriorEnergyUse->ExteriorLights(Item).CurrentUse > 0.01) {
490 8760 : state.dataExteriorEnergyUse->ExteriorLights(Item).SumTimeNotZeroCons += state.dataGlobal->TimeStepZone;
491 : }
492 : }
493 : }
494 : }
495 :
496 2120198 : for (int Item = 1; Item <= state.dataExteriorEnergyUse->NumExteriorEqs; ++Item) {
497 244506 : state.dataExteriorEnergyUse->ExteriorEquipment(Item).Power = state.dataExteriorEnergyUse->ExteriorEquipment(Item).DesignLevel *
498 122253 : state.dataExteriorEnergyUse->ExteriorEquipment(Item).sched->getCurrentVal();
499 122253 : state.dataExteriorEnergyUse->ExteriorEquipment(Item).CurrentUse =
500 122253 : state.dataExteriorEnergyUse->ExteriorEquipment(Item).Power * state.dataGlobal->TimeStepZoneSec;
501 : }
502 1997945 : }
503 :
504 : } // namespace ExteriorEnergyUse
505 :
506 : } // namespace EnergyPlus
|