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 : // C++ Headers
49 : #include <cmath>
50 : #include <map>
51 : #include <string>
52 :
53 : // ObjexxFCL Headers
54 : #include <ObjexxFCL/Array.functions.hh>
55 : #include <ObjexxFCL/Array1D.hh>
56 : #include <ObjexxFCL/Fmath.hh>
57 :
58 : // EnergyPlus Headers
59 : #include <EnergyPlus/CurveManager.hh>
60 : #include <EnergyPlus/Data/EnergyPlusData.hh>
61 : #include <EnergyPlus/DataContaminantBalance.hh>
62 : #include <EnergyPlus/DataEnvironment.hh>
63 : #include <EnergyPlus/DataGlobalConstants.hh>
64 : #include <EnergyPlus/DataHVACGlobals.hh>
65 : #include <EnergyPlus/DataHeatBalSurface.hh>
66 : #include <EnergyPlus/DataHeatBalance.hh>
67 : #include <EnergyPlus/DataIPShortCuts.hh>
68 : #include <EnergyPlus/DataLoopNode.hh>
69 : #include <EnergyPlus/DataPrecisionGlobals.hh>
70 : #include <EnergyPlus/DataRoomAirModel.hh>
71 : #include <EnergyPlus/DataViewFactorInformation.hh>
72 : #include <EnergyPlus/DataZoneEquipment.hh>
73 : #include <EnergyPlus/DaylightingDevices.hh>
74 : #include <EnergyPlus/DaylightingManager.hh>
75 : #include <EnergyPlus/EMSManager.hh>
76 : #include <EnergyPlus/ElectricPowerServiceManager.hh>
77 : #include <EnergyPlus/FuelCellElectricGenerator.hh>
78 : #include <EnergyPlus/General.hh>
79 : #include <EnergyPlus/HeatBalanceIntRadExchange.hh>
80 : #include <EnergyPlus/HeatBalanceInternalHeatGains.hh>
81 : #include <EnergyPlus/HybridModel.hh>
82 : #include <EnergyPlus/InputProcessing/InputProcessor.hh>
83 : #include <EnergyPlus/InternalHeatGains.hh>
84 : #include <EnergyPlus/MicroCHPElectricGenerator.hh>
85 : #include <EnergyPlus/NodeInputManager.hh>
86 : #include <EnergyPlus/OutputProcessor.hh>
87 : #include <EnergyPlus/OutputReportPredefined.hh>
88 : #include <EnergyPlus/OutputReportTabular.hh>
89 : #include <EnergyPlus/PipeHeatTransfer.hh>
90 : #include <EnergyPlus/Psychrometrics.hh>
91 : #include <EnergyPlus/RefrigeratedCase.hh>
92 : #include <EnergyPlus/ScheduleManager.hh>
93 : #include <EnergyPlus/SetPointManager.hh>
94 : #include <EnergyPlus/UtilityRoutines.hh>
95 : #include <EnergyPlus/WaterThermalTanks.hh>
96 : #include <EnergyPlus/WaterUse.hh>
97 : #include <EnergyPlus/ZonePlenum.hh>
98 : #include <EnergyPlus/ZoneTempPredictorCorrector.hh>
99 :
100 : namespace EnergyPlus {
101 :
102 : namespace InternalHeatGains {
103 : // Module containing the routines dealing with the internal heat gains
104 :
105 : // MODULE INFORMATION:
106 : // AUTHOR Rick Strand
107 : // DATE WRITTEN August 2000
108 : // MODIFIED Aug 2005, PGE (Added object names and report variables)
109 : // Feb 2006, PGE (Added end-use subcategories)
110 : // RE-ENGINEERED na
111 :
112 : // PURPOSE OF THIS MODULE:
113 : // Part of the heat balance modularization/re-engineering. Purpose of this
114 : // module is to contain the internal heat gain routines in a single location.
115 :
116 : // METHODOLOGY EMPLOYED:
117 : // Routines are called as subroutines to supply the data-only module structures
118 : // with the proper values.
119 :
120 : // REFERENCES:
121 : // Legacy BLAST code
122 :
123 : // OTHER NOTES: none
124 :
125 : // Using/Aliasing
126 : using namespace DataEnvironment;
127 : using namespace DataHeatBalance;
128 : using namespace DataSurfaces;
129 :
130 : static constexpr std::array<DataHeatBalance::IntGainType, 1> IntGainTypesPeople = {DataHeatBalance::IntGainType::People};
131 : static constexpr std::array<DataHeatBalance::IntGainType, 1> IntGainTypesLight = {DataHeatBalance::IntGainType::Lights};
132 : static constexpr std::array<DataHeatBalance::IntGainType, 7> IntGainTypesEquip = {DataHeatBalance::IntGainType::ElectricEquipment,
133 : DataHeatBalance::IntGainType::ElectricEquipmentITEAirCooled,
134 : DataHeatBalance::IntGainType::GasEquipment,
135 : DataHeatBalance::IntGainType::HotWaterEquipment,
136 : DataHeatBalance::IntGainType::SteamEquipment,
137 : DataHeatBalance::IntGainType::OtherEquipment,
138 : DataHeatBalance::IntGainType::IndoorGreen};
139 : static constexpr std::array<DataHeatBalance::IntGainType, 10> IntGainTypesRefrig = {
140 : DataHeatBalance::IntGainType::RefrigerationCase,
141 : DataHeatBalance::IntGainType::RefrigerationCompressorRack,
142 : DataHeatBalance::IntGainType::RefrigerationSystemAirCooledCondenser,
143 : DataHeatBalance::IntGainType::RefrigerationSystemSuctionPipe,
144 : DataHeatBalance::IntGainType::RefrigerationSecondaryReceiver,
145 : DataHeatBalance::IntGainType::RefrigerationSecondaryPipe,
146 : DataHeatBalance::IntGainType::RefrigerationWalkIn,
147 : DataHeatBalance::IntGainType::RefrigerationTransSysAirCooledGasCooler,
148 : DataHeatBalance::IntGainType::RefrigerationTransSysSuctionPipeMT,
149 : DataHeatBalance::IntGainType::RefrigerationTransSysSuctionPipeLT};
150 : static constexpr std::array<DataHeatBalance::IntGainType, 3> IntGainTypesWaterUse = {DataHeatBalance::IntGainType::WaterUseEquipment,
151 : DataHeatBalance::IntGainType::WaterHeaterMixed,
152 : DataHeatBalance::IntGainType::WaterHeaterStratified};
153 : static constexpr std::array<DataHeatBalance::IntGainType, 20> IntGainTypesHvacLoss = {
154 : DataHeatBalance::IntGainType::ZoneBaseboardOutdoorTemperatureControlled,
155 : DataHeatBalance::IntGainType::ThermalStorageChilledWaterMixed,
156 : DataHeatBalance::IntGainType::ThermalStorageChilledWaterStratified,
157 : DataHeatBalance::IntGainType::PipeIndoor,
158 : DataHeatBalance::IntGainType::Pump_VarSpeed,
159 : DataHeatBalance::IntGainType::Pump_ConSpeed,
160 : DataHeatBalance::IntGainType::Pump_Cond,
161 : DataHeatBalance::IntGainType::PumpBank_VarSpeed,
162 : DataHeatBalance::IntGainType::PumpBank_ConSpeed,
163 : DataHeatBalance::IntGainType::PlantComponentUserDefined,
164 : DataHeatBalance::IntGainType::CoilUserDefined,
165 : DataHeatBalance::IntGainType::ZoneHVACForcedAirUserDefined,
166 : DataHeatBalance::IntGainType::AirTerminalUserDefined,
167 : DataHeatBalance::IntGainType::PackagedTESCoilTank,
168 : DataHeatBalance::IntGainType::FanSystemModel,
169 : DataHeatBalance::IntGainType::SecCoolingDXCoilSingleSpeed,
170 : DataHeatBalance::IntGainType::SecHeatingDXCoilSingleSpeed,
171 : DataHeatBalance::IntGainType::SecCoolingDXCoilTwoSpeed,
172 : DataHeatBalance::IntGainType::SecCoolingDXCoilMultiSpeed,
173 : DataHeatBalance::IntGainType::SecHeatingDXCoilMultiSpeed};
174 : static constexpr std::array<DataHeatBalance::IntGainType, 10> IntGainTypesPowerGen = {
175 : DataHeatBalance::IntGainType::GeneratorFuelCell,
176 : DataHeatBalance::IntGainType::GeneratorMicroCHP,
177 : DataHeatBalance::IntGainType::ElectricLoadCenterTransformer,
178 : DataHeatBalance::IntGainType::ElectricLoadCenterInverterSimple,
179 : DataHeatBalance::IntGainType::ElectricLoadCenterInverterFunctionOfPower,
180 : DataHeatBalance::IntGainType::ElectricLoadCenterInverterLookUpTable,
181 : DataHeatBalance::IntGainType::ElectricLoadCenterStorageLiIonNmcBattery,
182 : DataHeatBalance::IntGainType::ElectricLoadCenterStorageBattery,
183 : DataHeatBalance::IntGainType::ElectricLoadCenterStorageSimple,
184 : DataHeatBalance::IntGainType::ElectricLoadCenterConverter};
185 : // Explicitly list internal gains not gathered here
186 : static constexpr std::array<DataHeatBalance::IntGainType, 3> ExcludedIntGainTypes = {
187 : DataHeatBalance::IntGainType::ZoneContaminantSourceAndSinkCarbonDioxide,
188 : DataHeatBalance::IntGainType::DaylightingDeviceTubular,
189 : DataHeatBalance::IntGainType::ZoneContaminantSourceAndSinkGenericContam};
190 :
191 250077 : void ManageInternalHeatGains(EnergyPlusData &state,
192 : ObjexxFCL::Optional_bool_const InitOnly) // when true, just calls the get input, if appropriate and returns.
193 : {
194 :
195 : // SUBROUTINE INFORMATION:
196 : // AUTHOR Rick Strand
197 : // DATE WRITTEN May 2000
198 : // MODIFIED Mar 2004, FCW: move call to DayltgElecLightingControl from InitSurfaceHeatBalance
199 : // RE-ENGINEERED na
200 :
201 : // PURPOSE OF THIS SUBROUTINE:
202 : // This is the main driver subroutine for the internal heat gains.
203 :
204 250077 : if (state.dataInternalHeatGains->GetInternalHeatGainsInputFlag) {
205 127 : GetInternalHeatGainsInput(state);
206 127 : state.dataInternalHeatGains->GetInternalHeatGainsInputFlag = false;
207 : }
208 :
209 250077 : if (present(InitOnly)) {
210 250077 : if (InitOnly) return;
211 : }
212 :
213 249956 : InitInternalHeatGains(state);
214 :
215 249956 : ReportInternalHeatGains(state);
216 :
217 249956 : CheckReturnAirHeatGain(state);
218 :
219 : // for the load component report, gather the load components for each timestep but not when doing pulse
220 249956 : if (state.dataGlobal->ZoneSizingCalc) GatherComponentLoadsIntGain(state);
221 : }
222 :
223 171 : void GetInternalHeatGainsInput(EnergyPlusData &state)
224 : {
225 :
226 : // SUBROUTINE INFORMATION:
227 : // AUTHOR Linda K. Lawrie
228 : // DATE WRITTEN September 1997
229 : // MODIFIED September 1998, FW
230 : // May 2009, BG: added calls to setup for possible EMS override
231 : // RE-ENGINEERED August 2000, RKS
232 :
233 : // PURPOSE OF THIS SUBROUTINE:
234 : // This subroutine gets the Internal Heat Gain Data for the Zones.
235 : // Sets up the various data that will be used later with the
236 : // schedulemanager to determine the actual values.
237 :
238 : // METHODOLOGY EMPLOYED:
239 : // The GetObjectItem routines are employed to retrieve the data.
240 :
241 : // REFERENCES:
242 : // IDD Objects:
243 : // People
244 : // Lights
245 : // ElectricEquipment
246 : // GasEquipment
247 : // SteamEquipment
248 : // HotWaterEquipment
249 : // OtherEquipment
250 : // ElectricEquipment:ITE:AirCooled
251 : // ZoneBaseboard:OutdoorTemperatureControlled
252 :
253 : // Using/Aliasing
254 : using namespace OutputReportPredefined;
255 : using namespace DataLoopNode;
256 : using Curve::GetCurveIndex;
257 : using NodeInputManager::GetOnlySingleNode;
258 :
259 : // SUBROUTINE PARAMETER DEFINITIONS:
260 : static constexpr std::string_view RoutineName("GetInternalHeatGains: ");
261 : static constexpr std::string_view routineName = "GetInternalHeatGains";
262 :
263 : // SUBROUTINE LOCAL VARIABLE DECLARATIONS:
264 : int IOStat;
265 :
266 : // Variables for reporting nominal internal gains
267 : Real64 LightTot; // Total Lights for calculating lights per square meter
268 : Real64 ElecTot; // Total Electric Load for calculating electric per square meter
269 : Real64 GasTot; // Total Gas load for calculating gas per square meter
270 : Real64 OthTot; // Total Other load for calculating other load per square meter
271 : Real64 HWETot; // Total Hot Water Equipment for calculating HWE per square meter
272 : Real64 StmTot; // Total Steam for calculating Steam per square meter
273 :
274 : // Formats
275 : static constexpr std::string_view Format_720(" Zone Internal Gains Nominal, {},{:.2R},{:.1R},");
276 : static constexpr std::string_view Format_722(" {} Internal Gains Nominal, {},{},{},{:.2R},{:.1R},");
277 : static constexpr std::string_view Format_723(
278 : "! <{} Internal Gains Nominal>,Name,Schedule Name,Zone Name,Zone Floor Area {{m2}},# Zone Occupants,{}");
279 : static constexpr std::string_view Format_724(" {}, {}\n");
280 :
281 809 : auto print_and_divide_if_greater_than_zero = [&](const Real64 numerator, const Real64 denominator) {
282 809 : if (denominator > 0.0) {
283 580 : print(state.files.eio, "{:.3R},", numerator / denominator);
284 : } else {
285 229 : print(state.files.eio, "N/A,");
286 : }
287 809 : };
288 :
289 171 : auto &ErrorsFound(state.dataInternalHeatGains->ErrorsFound);
290 :
291 : // TODO MJW: Punt for now, sometimes unit test need these to be allocated in AllocateZoneHeatBalArrays, but simulations need them here
292 171 : if (!state.dataHeatBal->ZoneIntGain.allocated()) {
293 158 : DataHeatBalance::AllocateIntGains(state);
294 : }
295 171 : state.dataHeatBal->ZoneRpt.allocate(state.dataGlobal->NumOfZones);
296 171 : state.dataHeatBal->spaceRpt.allocate(state.dataGlobal->numSpaces);
297 171 : state.dataHeatBal->ZoneIntEEuse.allocate(state.dataGlobal->NumOfZones);
298 171 : state.dataHeatBal->RefrigCaseCredit.allocate(state.dataGlobal->NumOfZones);
299 :
300 171 : Array1D_bool RepVarSet;
301 171 : RepVarSet.allocate(state.dataGlobal->NumOfZones);
302 381 : for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) {
303 210 : RepVarSet(zoneNum) = true;
304 : }
305 :
306 342 : const std::string peopleModuleObject = "People";
307 342 : const std::string lightsModuleObject = "Lights";
308 342 : const std::string elecEqModuleObject = "ElectricEquipment";
309 342 : const std::string gasEqModuleObject = "GasEquipment";
310 342 : const std::string hwEqModuleObject = "HotWaterEquipment";
311 342 : const std::string stmEqModuleObject = "SteamEquipment";
312 342 : const std::string othEqModuleObject = "OtherEquipment";
313 342 : const std::string itEqModuleObject = "ElectricEquipment:ITE:AirCooled";
314 342 : const std::string bbModuleObject = "ZoneBaseboard:OutdoorTemperatureControlled";
315 171 : const std::string contamSSModuleObject = "ZoneContaminantSourceAndSink:CarbonDioxide";
316 :
317 : // Because there are occasions where getObjectItem will be called a second time within the routine (#9680)
318 : // We should use local arrays instead of state.dataIPShortCut
319 171 : int IHGNumAlphas = 0;
320 171 : int IHGNumNumbers = 0;
321 171 : Array1D<Real64> IHGNumbers;
322 171 : Array1D_string IHGAlphas;
323 171 : Array1D_bool IHGNumericFieldBlanks;
324 171 : Array1D_bool IHGAlphaFieldBlanks;
325 171 : Array1D_string IHGAlphaFieldNames;
326 171 : Array1D_string IHGNumericFieldNames;
327 :
328 : {
329 171 : int MaxAlphas = 0;
330 171 : int MaxNums = 0;
331 171 : int NumParams = 0;
332 171 : for (const auto &moduleName : {peopleModuleObject,
333 : lightsModuleObject,
334 : elecEqModuleObject,
335 : gasEqModuleObject,
336 : hwEqModuleObject,
337 : stmEqModuleObject,
338 : othEqModuleObject,
339 : itEqModuleObject,
340 : bbModuleObject,
341 3762 : contamSSModuleObject}) {
342 1710 : state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, moduleName, NumParams, IHGNumAlphas, IHGNumNumbers);
343 1710 : MaxAlphas = std::max(MaxAlphas, IHGNumAlphas);
344 1710 : MaxNums = std::max(MaxNums, IHGNumNumbers);
345 1881 : }
346 171 : IHGAlphas.allocate(MaxAlphas);
347 171 : IHGAlphaFieldNames.allocate(MaxAlphas);
348 171 : IHGAlphaFieldBlanks.dimension(MaxAlphas, true);
349 :
350 171 : IHGNumbers.dimension(MaxNums, 0.0);
351 171 : IHGNumericFieldNames.allocate(MaxNums);
352 171 : IHGNumericFieldBlanks.dimension(MaxNums, true);
353 171 : IHGNumAlphas = 0;
354 171 : IHGNumNumbers = 0;
355 : }
356 :
357 : // PEOPLE: Includes both information related to the heat balance and thermal comfort
358 171 : EPVector<InternalHeatGains::GlobalInternalGainMiscObject> peopleObjects;
359 171 : int numPeopleStatements = 0;
360 171 : setupIHGZonesAndSpaces(state, peopleModuleObject, peopleObjects, numPeopleStatements, state.dataHeatBal->TotPeople, ErrorsFound);
361 :
362 171 : if (state.dataHeatBal->TotPeople > 0) {
363 43 : state.dataHeatBal->People.allocate(state.dataHeatBal->TotPeople);
364 43 : int peopleNum = 0;
365 118 : for (int peopleInputNum = 1; peopleInputNum <= numPeopleStatements; ++peopleInputNum) {
366 75 : state.dataInputProcessing->inputProcessor->getObjectItem(state,
367 : peopleModuleObject,
368 : peopleInputNum,
369 : IHGAlphas,
370 : IHGNumAlphas,
371 : IHGNumbers,
372 : IHGNumNumbers,
373 : IOStat,
374 : IHGNumericFieldBlanks,
375 : IHGAlphaFieldBlanks,
376 : IHGAlphaFieldNames,
377 : IHGNumericFieldNames);
378 :
379 75 : ErrorObjectHeader eoh{routineName, peopleModuleObject, IHGAlphas(1)};
380 : // Create one People instance for every space associated with this People input object
381 75 : auto &thisPeopleInput = peopleObjects(peopleInputNum);
382 152 : for (int Item1 = 1; Item1 <= thisPeopleInput.numOfSpaces; ++Item1) {
383 77 : ++peopleNum;
384 77 : auto &thisPeople = state.dataHeatBal->People(peopleNum);
385 77 : int const spaceNum = thisPeopleInput.spaceNums(Item1);
386 77 : int const zoneNum = state.dataHeatBal->space(spaceNum).zoneNum;
387 77 : thisPeople.Name = thisPeopleInput.names(Item1);
388 77 : thisPeople.spaceIndex = spaceNum;
389 77 : thisPeople.ZonePtr = zoneNum;
390 :
391 77 : thisPeople.sched = Sched::GetSchedule(state, IHGAlphas(3));
392 :
393 77 : if (Item1 == 1) { // only show error on first one
394 75 : if (IHGAlphaFieldBlanks(3)) {
395 0 : ShowSevereEmptyField(state, eoh, IHGAlphaFieldNames(3));
396 0 : ErrorsFound = true;
397 75 : } else if (thisPeople.sched == nullptr) {
398 0 : ShowSevereItemNotFound(state, eoh, IHGAlphaFieldNames(3), IHGAlphas(3));
399 0 : ErrorsFound = true;
400 75 : } else if (!thisPeople.sched->checkMinVal(state, Clusive::In, 0.0)) {
401 0 : Sched::ShowSevereBadMin(state, eoh, IHGAlphaFieldNames(3), IHGAlphas(3), Clusive::In, 0.0);
402 0 : ErrorsFound = true;
403 : }
404 : }
405 :
406 : // Number of people calculation method.
407 : { // Why open a new scope here
408 77 : std::string const &peopleMethod = IHGAlphas(4);
409 77 : if (peopleMethod == "PEOPLE") {
410 : // Set space load fraction
411 72 : Real64 spaceFrac = 1.0;
412 72 : if (thisPeopleInput.numOfSpaces > 1) {
413 4 : Real64 const zoneArea = state.dataHeatBal->Zone(zoneNum).FloorArea;
414 4 : if (zoneArea > 0.0) {
415 4 : spaceFrac = state.dataHeatBal->space(spaceNum).FloorArea / zoneArea;
416 : } else {
417 0 : ShowSevereError(state, format("{}Zone floor area is zero when allocating People loads to Spaces.", RoutineName));
418 0 : ShowContinueError(state,
419 0 : format("Occurs for People object ={} in Zone={}",
420 0 : thisPeopleInput.Name,
421 0 : state.dataHeatBal->Zone(zoneNum).Name));
422 0 : ErrorsFound = true;
423 : }
424 : }
425 72 : thisPeople.NumberOfPeople = IHGNumbers(1) * spaceFrac;
426 72 : if (IHGNumericFieldBlanks(1)) {
427 0 : ShowWarningError(state,
428 0 : format("{}{}=\"{}\", specifies {}, but that field is blank. 0 People will result.",
429 : RoutineName,
430 : peopleModuleObject,
431 0 : thisPeople.Name,
432 : IHGNumericFieldNames(1)));
433 : }
434 :
435 5 : } else if (peopleMethod == "PEOPLE/AREA") {
436 2 : if (spaceNum != 0) {
437 2 : if (IHGNumbers(2) >= 0.0) {
438 2 : thisPeople.NumberOfPeople = IHGNumbers(2) * state.dataHeatBal->space(spaceNum).FloorArea;
439 2 : if ((state.dataHeatBal->space(spaceNum).FloorArea <= 0.0) &&
440 0 : !state.dataHeatBal->space(spaceNum).isRemainderSpace) {
441 0 : ShowWarningError(state,
442 0 : format("{}{}=\"{}\", specifies {}, but Space Floor Area = 0. 0 People will result.",
443 : RoutineName,
444 : peopleModuleObject,
445 0 : thisPeople.Name,
446 : IHGNumericFieldNames(2)));
447 : }
448 : } else {
449 0 : ShowSevereError(state,
450 0 : format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}",
451 : RoutineName,
452 : peopleModuleObject,
453 0 : thisPeople.Name,
454 : IHGNumericFieldNames(2),
455 : IHGNumbers(2)));
456 0 : ErrorsFound = true;
457 : }
458 : }
459 2 : if (IHGNumericFieldBlanks(2)) {
460 0 : ShowWarningError(state,
461 0 : format("{}{}=\"{}\", specifies {}, but that field is blank. 0 People will result.",
462 : RoutineName,
463 : peopleModuleObject,
464 0 : thisPeople.Name,
465 : IHGNumericFieldNames(2)));
466 : }
467 :
468 3 : } else if (peopleMethod == "AREA/PERSON") {
469 3 : if (spaceNum != 0) {
470 3 : if (IHGNumbers(3) > 0.0) {
471 3 : thisPeople.NumberOfPeople = state.dataHeatBal->space(spaceNum).FloorArea / IHGNumbers(3);
472 3 : if ((state.dataHeatBal->space(spaceNum).FloorArea <= 0.0) &&
473 0 : !state.dataHeatBal->space(spaceNum).isRemainderSpace) {
474 0 : ShowWarningError(state,
475 0 : format("{}{}=\"{}\", specifies {}, but Space Floor Area = 0. 0 People will result.",
476 : RoutineName,
477 : peopleModuleObject,
478 0 : thisPeople.Name,
479 : IHGNumericFieldNames(3)));
480 : }
481 : } else {
482 0 : ShowSevereError(state,
483 0 : format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}",
484 : RoutineName,
485 : peopleModuleObject,
486 0 : thisPeople.Name,
487 : IHGNumericFieldNames(3),
488 : IHGNumbers(3)));
489 0 : ErrorsFound = true;
490 : }
491 : }
492 3 : if (IHGNumericFieldBlanks(3)) {
493 0 : ShowWarningError(state,
494 0 : format("{}{}=\"{}\", specifies {}, but that field is blank. 0 People will result.",
495 : RoutineName,
496 : peopleModuleObject,
497 0 : thisPeople.Name,
498 : IHGNumericFieldNames(3)));
499 : }
500 :
501 : } else {
502 0 : if (Item1 == 1) {
503 0 : ShowSevereError(state,
504 0 : format("{}{}=\"{}\", invalid {}, value ={}",
505 : RoutineName,
506 : peopleModuleObject,
507 : IHGAlphas(1),
508 : IHGAlphaFieldNames(4),
509 : IHGAlphas(4)));
510 0 : ShowContinueError(state, "...Valid values are \"People\", \"People/Area\", \"Area/Person\".");
511 0 : ErrorsFound = true;
512 : }
513 : }
514 : }
515 :
516 : // Calculate nominal min/max people
517 77 : thisPeople.NomMinNumberPeople = thisPeople.NumberOfPeople * thisPeople.sched->getMinVal(state);
518 77 : thisPeople.NomMaxNumberPeople = thisPeople.NumberOfPeople * thisPeople.sched->getMaxVal(state);
519 :
520 77 : if (zoneNum > 0) {
521 77 : state.dataHeatBal->Zone(zoneNum).TotOccupants += thisPeople.NumberOfPeople;
522 : // Note that min/max occupants are non-coincident
523 77 : state.dataHeatBal->Zone(zoneNum).minOccupants += thisPeople.NomMinNumberPeople;
524 77 : state.dataHeatBal->Zone(zoneNum).maxOccupants += thisPeople.NomMaxNumberPeople;
525 : }
526 :
527 77 : if (spaceNum > 0) {
528 77 : state.dataHeatBal->space(spaceNum).TotOccupants += thisPeople.NumberOfPeople;
529 : // Note that min/max occupants are non-coincident
530 77 : state.dataHeatBal->space(spaceNum).minOccupants += thisPeople.NomMinNumberPeople;
531 77 : state.dataHeatBal->space(spaceNum).maxOccupants += thisPeople.NomMaxNumberPeople;
532 : }
533 77 : thisPeople.FractionRadiant = IHGNumbers(4);
534 77 : thisPeople.FractionConvected = 1.0 - thisPeople.FractionRadiant;
535 77 : if (Item1 == 1) {
536 75 : if (thisPeople.FractionConvected < 0.0) {
537 0 : ShowSevereError(state,
538 0 : format("{}{}=\"{}\", {} < 0.0, value ={:.2R}",
539 : RoutineName,
540 : peopleModuleObject,
541 : IHGAlphas(1),
542 : IHGNumericFieldNames(4),
543 : IHGNumbers(4)));
544 0 : ErrorsFound = true;
545 : }
546 : }
547 :
548 77 : if (IHGNumNumbers >= 5 && !IHGNumericFieldBlanks(5)) {
549 43 : thisPeople.UserSpecSensFrac = IHGNumbers(5);
550 : } else {
551 34 : thisPeople.UserSpecSensFrac = Constant::AutoCalculate;
552 : }
553 :
554 77 : if (IHGNumNumbers >= 6 && !IHGNumericFieldBlanks(6)) {
555 14 : thisPeople.CO2RateFactor = IHGNumbers(6);
556 : } else {
557 63 : thisPeople.CO2RateFactor = 3.82e-8; // m3/s-W
558 : }
559 :
560 77 : if (IHGNumNumbers >= 7 && !IHGNumericFieldBlanks(7)) {
561 3 : thisPeople.ColdStressTempThresh = IHGNumbers(7);
562 : } else {
563 74 : thisPeople.ColdStressTempThresh = 15.56; // degree C
564 : }
565 :
566 77 : if (IHGNumNumbers == 8 && !IHGNumericFieldBlanks(8)) {
567 3 : thisPeople.HeatStressTempThresh = IHGNumbers(8);
568 : } else {
569 74 : thisPeople.HeatStressTempThresh = 30.0; // degree C
570 : }
571 :
572 77 : if (thisPeople.CO2RateFactor < 0.0) {
573 0 : ShowSevereError(state,
574 0 : format("{}{}=\"{}\", {} < 0.0, value ={:.2R}",
575 : RoutineName,
576 : peopleModuleObject,
577 : IHGAlphas(1),
578 : IHGNumericFieldNames(6),
579 : IHGNumbers(6)));
580 0 : ErrorsFound = true;
581 : }
582 :
583 77 : thisPeople.activityLevelSched = Sched::GetSchedule(state, IHGAlphas(5));
584 :
585 77 : if (Item1 == 1) {
586 75 : if (IHGAlphaFieldBlanks(5)) {
587 0 : ShowSevereEmptyField(state, eoh, IHGAlphaFieldNames(5));
588 0 : ErrorsFound = true;
589 75 : } else if (thisPeople.activityLevelSched == nullptr) {
590 0 : ShowSevereItemNotFound(state, eoh, IHGAlphaFieldNames(5), IHGAlphas(5));
591 0 : ErrorsFound = true;
592 75 : } else if (!thisPeople.activityLevelSched->checkMinVal(state, Clusive::In, 0.0)) {
593 0 : Sched::ShowSevereBadMin(state, eoh, IHGAlphaFieldNames(5), IHGAlphas(5), Clusive::In, 0.0);
594 0 : ErrorsFound = true;
595 75 : } else if (!thisPeople.activityLevelSched->checkMinMaxVals(state, Clusive::In, 70.0, Clusive::In, 1000.0)) {
596 8 : Sched::ShowWarningBadMinMax(state,
597 : eoh,
598 4 : IHGAlphaFieldNames(5),
599 4 : IHGAlphas(5),
600 : Clusive::In,
601 : 70.0,
602 : Clusive::In,
603 : 1000.0,
604 : "Values fall outside of typical w/person range for thermal comfort reporting.");
605 : }
606 : }
607 :
608 : // Following is an optional parameter (ASHRAE 55 warnings
609 77 : if (IHGNumAlphas >= 6) {
610 20 : if (BooleanSwitch bs = getYesNoValue(IHGAlphas(6)); bs != BooleanSwitch::Invalid) {
611 20 : thisPeople.Show55Warning = static_cast<bool>(bs);
612 0 : } else if (Item1 == 1) {
613 0 : ShowSevereInvalidKey(state, eoh, IHGAlphaFieldNames(6), IHGAlphas(6));
614 0 : ErrorsFound = true;
615 : }
616 : }
617 :
618 77 : if (IHGNumAlphas > 6) { // Optional parameters present--thermal comfort data follows...
619 20 : int lastOption = 0;
620 20 : bool usingThermalComfort = false;
621 20 : if (IHGNumAlphas > 20) {
622 3 : lastOption = 20;
623 : } else {
624 17 : lastOption = IHGNumAlphas;
625 : }
626 :
627 : // check to see if the user has specified schedules for air velocity, clothing insulation, and/or work efficiency
628 : // but have NOT made a selection for a thermal comfort model. If so, then the schedules are reported as unused
629 : // which could cause confusion. The solution is for the user to either remove those schedules or pick a thermal
630 : // comfort model.
631 20 : int constexpr NumFirstTCModel = 14;
632 20 : if (IHGNumAlphas < NumFirstTCModel) {
633 1 : bool NoTCModelSelectedWithSchedules = false;
634 : NoTCModelSelectedWithSchedules =
635 1 : CheckThermalComfortSchedules(IHGAlphaFieldBlanks(9), IHGAlphaFieldBlanks(12), IHGAlphaFieldBlanks(13));
636 1 : if (NoTCModelSelectedWithSchedules) {
637 0 : ShowWarningError(state,
638 0 : format("{}{}=\"{}\" has comfort related schedules but no thermal comfort model selected.",
639 : RoutineName,
640 : peopleModuleObject,
641 : IHGAlphas(1)));
642 0 : ShowContinueError(state,
643 : "If schedules are specified for air velocity, clothing insulation, and/or work efficiency but no "
644 : "thermal comfort");
645 0 : ShowContinueError(
646 : state, "thermal comfort model is selected, the schedules will be listed as unused schedules in the .err file.");
647 0 : ShowContinueError(
648 : state,
649 : "To avoid these errors, select a valid thermal comfort model or eliminate these schedules in the PEOPLE input.");
650 : }
651 : }
652 :
653 57 : for (int OptionNum = NumFirstTCModel; OptionNum <= lastOption; ++OptionNum) {
654 :
655 : { // Why are we starting a nested scope immediately after opening up a scope?
656 37 : std::string const &thermalComfortType = IHGAlphas(OptionNum);
657 :
658 37 : if (thermalComfortType == "FANGER") {
659 15 : thisPeople.Fanger = true;
660 15 : usingThermalComfort = true;
661 :
662 22 : } else if (thermalComfortType == "PIERCE") {
663 0 : thisPeople.Pierce = true;
664 0 : state.dataHeatBal->AnyThermalComfortPierceModel = true;
665 0 : usingThermalComfort = true;
666 :
667 22 : } else if (thermalComfortType == "KSU") {
668 0 : thisPeople.KSU = true;
669 0 : state.dataHeatBal->AnyThermalComfortKSUModel = true;
670 0 : usingThermalComfort = true;
671 :
672 22 : } else if (thermalComfortType == "ADAPTIVEASH55") {
673 1 : thisPeople.AdaptiveASH55 = true;
674 1 : state.dataHeatBal->AdaptiveComfortRequested_ASH55 = true;
675 1 : usingThermalComfort = true;
676 :
677 21 : } else if (thermalComfortType == "ADAPTIVECEN15251") {
678 0 : thisPeople.AdaptiveCEN15251 = true;
679 0 : state.dataHeatBal->AdaptiveComfortRequested_CEN15251 = true;
680 0 : usingThermalComfort = true;
681 :
682 21 : } else if (thermalComfortType == "COOLINGEFFECTASH55") {
683 0 : thisPeople.CoolingEffectASH55 = true;
684 0 : state.dataHeatBal->AnyThermalComfortCoolingEffectModel = true;
685 0 : usingThermalComfort = true;
686 :
687 21 : } else if (thermalComfortType == "ANKLEDRAFTASH55") {
688 0 : thisPeople.AnkleDraftASH55 = true;
689 0 : state.dataHeatBal->AnyThermalComfortAnkleDraftModel = true;
690 0 : usingThermalComfort = true;
691 :
692 21 : } else if (thermalComfortType == "") { // Blank input field--just ignore this
693 :
694 : } else { // An invalid keyword was entered--warn but ignore
695 0 : if (Item1 == 1) {
696 0 : ShowWarningInvalidKey(state, eoh, IHGAlphaFieldNames(OptionNum), IHGAlphas(OptionNum), "");
697 0 : ShowContinueError(state,
698 : "Valid Values are \"Fanger\", \"Pierce\", \"KSU\", \"AdaptiveASH55\", "
699 : "\"AdaptiveCEN15251\", \"CoolingEffectASH55\", \"AnkleDraftASH55\"");
700 : }
701 : }
702 : }
703 : }
704 :
705 20 : if (usingThermalComfort) {
706 :
707 : // Set the default value of MRTCalcType as 'EnclosureAveraged'
708 16 : thisPeople.MRTCalcType = DataHeatBalance::CalcMRT::EnclosureAveraged;
709 :
710 1 : bool ModelWithAdditionalInputs = thisPeople.Fanger || thisPeople.Pierce || thisPeople.KSU ||
711 17 : thisPeople.CoolingEffectASH55 || thisPeople.AnkleDraftASH55;
712 :
713 : // MRT Calculation Type and Surface Name
714 16 : thisPeople.MRTCalcType = static_cast<CalcMRT>(getEnumValue(CalcMRTTypeNamesUC, IHGAlphas(7)));
715 :
716 16 : switch (thisPeople.MRTCalcType) {
717 16 : case DataHeatBalance::CalcMRT::EnclosureAveraged: {
718 : // nothing to do here
719 16 : } break;
720 0 : case DataHeatBalance::CalcMRT::SurfaceWeighted: {
721 0 : thisPeople.SurfacePtr = Util::FindItemInList(IHGAlphas(8), state.dataSurface->Surface);
722 0 : if (thisPeople.SurfacePtr == 0 && ModelWithAdditionalInputs) {
723 0 : if (Item1 == 1) {
724 0 : ShowSevereError(state,
725 0 : format("{}{}=\"{}\", {}={} invalid Surface Name={}",
726 : RoutineName,
727 : peopleModuleObject,
728 : IHGAlphas(1),
729 : IHGAlphaFieldNames(7),
730 : IHGAlphas(7),
731 : IHGAlphas(8)));
732 0 : ErrorsFound = true;
733 : }
734 : } else {
735 0 : int const surfRadEnclNum = state.dataSurface->Surface(thisPeople.SurfacePtr).RadEnclIndex;
736 0 : int const thisPeopleRadEnclNum = state.dataHeatBal->space(thisPeople.spaceIndex).radiantEnclosureNum;
737 0 : if (surfRadEnclNum != thisPeopleRadEnclNum && ModelWithAdditionalInputs) {
738 0 : ShowSevereError(state,
739 0 : format("{}{}=\"{}\", Surface referenced in {}={} in different enclosure.",
740 : RoutineName,
741 : peopleModuleObject,
742 : IHGAlphas(1),
743 : IHGAlphaFieldNames(7),
744 : IHGAlphas(7)));
745 0 : ShowContinueError(state,
746 0 : format("Surface is in Enclosure={} and {} is in Enclosure={}",
747 0 : state.dataViewFactor->EnclRadInfo(surfRadEnclNum).Name,
748 : peopleModuleObject,
749 0 : state.dataViewFactor->EnclRadInfo(thisPeopleRadEnclNum).Name));
750 0 : ErrorsFound = true;
751 : }
752 : }
753 :
754 0 : } break;
755 0 : case DataHeatBalance::CalcMRT::AngleFactor: {
756 0 : thisPeople.AngleFactorListName = IHGAlphas(8);
757 :
758 0 : } break;
759 0 : default: { // An invalid keyword was entered--warn but ignore
760 0 : if (Item1 == 1 && ModelWithAdditionalInputs) {
761 0 : ShowWarningError(state,
762 0 : format("{}{}=\"{}\", invalid {}={}",
763 : RoutineName,
764 : peopleModuleObject,
765 : IHGAlphas(1),
766 : IHGAlphaFieldNames(7),
767 : IHGAlphas(7)));
768 0 : ShowContinueError(state, "...Valid values are \"EnclosureAveraged\", \"SurfaceWeighted\", \"AngleFactor\".");
769 : }
770 0 : } break;
771 : } // switch (thisPeople.MRTCalcType)
772 :
773 16 : if (!IHGAlphaFieldBlanks(9)) {
774 15 : thisPeople.workEffSched = Sched::GetSchedule(state, IHGAlphas(9));
775 : }
776 :
777 16 : if (Item1 == 1) {
778 16 : if (IHGAlphaFieldBlanks(9)) {
779 1 : if (ModelWithAdditionalInputs) {
780 0 : ShowSevereEmptyField(state, eoh, IHGAlphaFieldNames(9));
781 0 : ShowContinueError(state,
782 : "It is required when Thermal Comfort Model Type is one of "
783 : "\"Fanger\", \"Pierce\", \"KSU\", \"CoolingEffectASH55\" or \"AnkleDraftASH55\"");
784 0 : ErrorsFound = true;
785 : }
786 15 : } else if (thisPeople.workEffSched == nullptr) {
787 0 : ShowSevereItemNotFound(state, eoh, IHGAlphaFieldNames(9), IHGAlphas(9));
788 0 : ErrorsFound = true;
789 15 : } else if (!thisPeople.workEffSched->checkMinMaxVals(state, Clusive::In, 0.0, Clusive::In, 1.0)) {
790 0 : Sched::ShowSevereBadMinMax(state, eoh, IHGAlphaFieldNames(9), IHGAlphas(9), Clusive::In, 0.0, Clusive::In, 1.0);
791 0 : ErrorsFound = true;
792 : }
793 : }
794 :
795 16 : if (IHGAlphas(10).empty()) { // Using IHGAlphaFieldBlanks(10) doesn't work because this value is defaulted
796 16 : } else if ((thisPeople.clothingType = static_cast<ClothingType>(getEnumValue(clothingTypeNamesUC, IHGAlphas(10)))) ==
797 : ClothingType::Invalid) {
798 0 : ShowSevereInvalidKey(state, eoh, IHGAlphaFieldNames(10), IHGAlphas(10));
799 0 : ErrorsFound = true;
800 :
801 : } else {
802 :
803 16 : switch (thisPeople.clothingType) {
804 :
805 16 : case ClothingType::InsulationSchedule: {
806 :
807 16 : thisPeople.clothingSched = Sched::GetSchedule(state, IHGAlphas(12));
808 16 : if (Item1 == 1) {
809 16 : if (IHGAlphaFieldBlanks(12)) {
810 1 : if (ModelWithAdditionalInputs) {
811 0 : ShowSevereEmptyField(state, eoh, IHGAlphaFieldNames(12), IHGAlphaFieldNames(10), IHGAlphas(10));
812 0 : ErrorsFound = true;
813 : }
814 15 : } else if (thisPeople.clothingSched == nullptr) {
815 0 : if (ModelWithAdditionalInputs) {
816 0 : ShowSevereItemNotFound(state, eoh, IHGAlphaFieldNames(12), IHGAlphas(12));
817 0 : ErrorsFound = true;
818 : }
819 15 : } else if (!thisPeople.clothingSched->checkMinVal(state, Clusive::In, 0.0)) {
820 0 : Sched::ShowSevereBadMin(state, eoh, IHGAlphaFieldNames(12), IHGAlphas(12), Clusive::In, 0.0);
821 0 : ErrorsFound = true;
822 15 : } else if (!thisPeople.clothingSched->checkMaxVal(state, Clusive::In, 2.0)) {
823 0 : Sched::ShowWarningBadMax(state, eoh, IHGAlphaFieldNames(12), IHGAlphas(12), Clusive::In, 2.0, "");
824 : }
825 : }
826 16 : } break;
827 :
828 0 : case ClothingType::DynamicAshrae55: {
829 0 : } break; // nothing extra to do, at least for now
830 :
831 0 : case ClothingType::CalculationSchedule: {
832 0 : thisPeople.clothingMethodSched = Sched::GetSchedule(state, IHGAlphas(11));
833 :
834 0 : if (Item1 == 1) {
835 0 : if (thisPeople.clothingMethodSched == nullptr) {
836 0 : ShowSevereItemNotFound(state, eoh, IHGAlphaFieldNames(11), IHGAlphas(11));
837 0 : ErrorsFound = true;
838 : }
839 : }
840 :
841 0 : if (thisPeople.clothingMethodSched->hasVal(state, 1)) {
842 0 : if ((thisPeople.clothingSched = Sched::GetSchedule(state, IHGAlphas(12))) == nullptr) {
843 0 : if (Item1 == 1) {
844 0 : ShowSevereItemNotFound(state, eoh, IHGAlphaFieldNames(12), IHGAlphas(12));
845 0 : ErrorsFound = true;
846 : }
847 : }
848 : }
849 0 : } break;
850 :
851 0 : default: {
852 0 : } break; // nothing to do for the other cases
853 : } // switch (thisPeople.clothingType)
854 : }
855 :
856 16 : if (IHGAlphaFieldBlanks(13)) {
857 : } else {
858 15 : thisPeople.airVelocitySched = Sched::GetSchedule(state, IHGAlphas(13));
859 : }
860 :
861 16 : if (Item1 == 1) {
862 16 : if (IHGAlphaFieldBlanks(13)) {
863 1 : if (ModelWithAdditionalInputs) {
864 0 : ShowSevereEmptyField(state, eoh, IHGAlphaFieldNames(13));
865 0 : ShowContinueError(state,
866 : "Required when Thermal Comfort Model Type is one of "
867 : "\"Fanger\", \"Pierce\", \"KSU\", \"CoolingEffectASH55\" or \"AnkleDraftASH55\"");
868 0 : ErrorsFound = true;
869 : }
870 15 : } else if (thisPeople.airVelocitySched == nullptr) {
871 0 : ShowSevereItemNotFound(state, eoh, IHGAlphaFieldNames(13), IHGAlphas(13));
872 0 : ErrorsFound = true;
873 15 : } else if (!thisPeople.airVelocitySched->checkMinVal(state, Clusive::In, 0.0)) {
874 0 : Sched::ShowSevereBadMin(state, eoh, IHGAlphaFieldNames(13), IHGAlphas(13), Clusive::In, 0.0);
875 0 : ErrorsFound = true;
876 : }
877 : }
878 :
879 16 : if (IHGAlphas(21).empty()) { // Using IHGAlphaFieldBlanks(21) doesn't work because this field has a default
880 : } else {
881 0 : thisPeople.ankleAirVelocitySched = Sched::GetSchedule(state, IHGAlphas(21));
882 : }
883 :
884 16 : if (Item1 == 1) {
885 16 : if (IHGAlphaFieldBlanks(21)) {
886 16 : if (thisPeople.AnkleDraftASH55) {
887 0 : ShowSevereEmptyField(state, eoh, IHGAlphaFieldNames(21), IHGAlphas(21));
888 0 : ShowContinueError(state,
889 : "Required when Thermal Comfort Model Type is one of "
890 : "\"Fanger\", \"Pierce\", \"KSU\", \"CoolingEffectASH55\" or \"AnkleDraftASH55\"");
891 0 : ErrorsFound = true;
892 : }
893 0 : } else if (thisPeople.ankleAirVelocitySched == nullptr) {
894 0 : ShowSevereItemNotFound(state, eoh, IHGAlphaFieldNames(21), IHGAlphas(21));
895 0 : ErrorsFound = true;
896 : }
897 : }
898 : } // usingthermalcomfort block
899 :
900 : } // ...end of thermal comfort data IF-THEN block (IHGNumAlphass > 6)
901 :
902 77 : if (thisPeople.ZonePtr <= 0) continue; // Error, will be caught and terminated later
903 : }
904 : }
905 :
906 120 : for (int peopleNum2 = 1; peopleNum2 <= state.dataHeatBal->TotPeople; ++peopleNum2) {
907 77 : if (state.dataGlobal->AnyEnergyManagementSystemInModel) {
908 6 : SetupEMSActuator(state,
909 : "People",
910 3 : state.dataHeatBal->People(peopleNum2).Name,
911 : "Number of People",
912 : "[each]",
913 3 : state.dataHeatBal->People(peopleNum2).EMSPeopleOn,
914 3 : state.dataHeatBal->People(peopleNum2).EMSNumberOfPeople);
915 3 : SetupEMSInternalVariable(state,
916 : "People Count Design Level",
917 3 : state.dataHeatBal->People(peopleNum2).Name,
918 : "[each]",
919 3 : state.dataHeatBal->People(peopleNum2).NumberOfPeople);
920 : }
921 :
922 : // setup internal gains
923 77 : if (!ErrorsFound) {
924 462 : SetupSpaceInternalGain(state,
925 77 : state.dataHeatBal->People(peopleNum2).spaceIndex,
926 : 1.0,
927 77 : state.dataHeatBal->People(peopleNum2).Name,
928 : DataHeatBalance::IntGainType::People,
929 77 : &state.dataHeatBal->People(peopleNum2).ConGainRate,
930 : nullptr,
931 77 : &state.dataHeatBal->People(peopleNum2).RadGainRate,
932 77 : &state.dataHeatBal->People(peopleNum2).LatGainRate,
933 : nullptr,
934 77 : &state.dataHeatBal->People(peopleNum2).CO2GainRate);
935 : }
936 : }
937 :
938 : // transfer the nominal number of people in a zone to the tabular reporting
939 130 : for (int Loop = 1; Loop <= state.dataGlobal->NumOfZones; ++Loop) {
940 87 : if (state.dataHeatBal->Zone(Loop).TotOccupants > 0.0) {
941 142 : if (state.dataHeatBal->Zone(Loop).FloorArea > 0.0 &&
942 68 : state.dataHeatBal->Zone(Loop).FloorArea / state.dataHeatBal->Zone(Loop).TotOccupants < 0.1) {
943 0 : ShowWarningError(
944 0 : state, format("{}Zone=\"{}\" occupant density is extremely high.", RoutineName, state.dataHeatBal->Zone(Loop).Name));
945 0 : if (state.dataHeatBal->Zone(Loop).FloorArea > 0.0) {
946 0 : ShowContinueError(state,
947 0 : format("Occupant Density=[{:.0R}] person/m2.",
948 0 : state.dataHeatBal->Zone(Loop).TotOccupants / state.dataHeatBal->Zone(Loop).FloorArea));
949 : }
950 0 : ShowContinueError(state,
951 0 : format("Occupant Density=[{:.3R}] m2/person. Problems in Temperature Out of Bounds may result.",
952 0 : state.dataHeatBal->Zone(Loop).FloorArea / state.dataHeatBal->Zone(Loop).TotOccupants));
953 : }
954 74 : Real64 maxOccupLoad = 0.0;
955 74 : int OptionNum = 0;
956 260 : for (int Loop1 = 1; Loop1 <= state.dataHeatBal->TotPeople; ++Loop1) {
957 186 : auto const &people = state.dataHeatBal->People(Loop1);
958 186 : if (people.ZonePtr != Loop) continue;
959 77 : if (maxOccupLoad < people.sched->getCurrentVal() * people.NumberOfPeople) {
960 35 : maxOccupLoad = people.sched->getCurrentVal() * people.NumberOfPeople;
961 35 : OptionNum = Loop1;
962 : }
963 : }
964 74 : if (maxOccupLoad > state.dataHeatBal->Zone(Loop).TotOccupants) {
965 0 : if (state.dataHeatBal->Zone(Loop).FloorArea > 0.0 && state.dataHeatBal->Zone(Loop).FloorArea / maxOccupLoad < 0.1) {
966 0 : ShowWarningError(state,
967 0 : format("{}Zone=\"{}\" occupant density at a maximum schedule value is extremely high.",
968 : RoutineName,
969 0 : state.dataHeatBal->Zone(Loop).Name));
970 0 : if (state.dataHeatBal->Zone(Loop).FloorArea > 0.0) {
971 0 : ShowContinueError(
972 0 : state, format("Occupant Density=[{:.0R}] person/m2.", maxOccupLoad / state.dataHeatBal->Zone(Loop).FloorArea));
973 : }
974 0 : ShowContinueError(state,
975 0 : format("Occupant Density=[{:.3R}] m2/person. Problems in Temperature Out of Bounds may result.",
976 0 : state.dataHeatBal->Zone(Loop).FloorArea / maxOccupLoad));
977 0 : ShowContinueError(state,
978 0 : format("Check values in People={}, Number of People Schedule={}",
979 0 : state.dataHeatBal->People(OptionNum).Name,
980 0 : state.dataHeatBal->People(OptionNum).sched->getCurrentVal()));
981 : }
982 : }
983 : }
984 :
985 87 : if (state.dataHeatBal->Zone(Loop).isNominalControlled) { // conditioned zones only
986 60 : if (state.dataHeatBal->Zone(Loop).TotOccupants > 0.0) {
987 60 : state.dataHeatBal->Zone(Loop).isNominalOccupied = true;
988 120 : PreDefTableEntry(state,
989 60 : state.dataOutRptPredefined->pdchOaoNomNumOcc1,
990 60 : state.dataHeatBal->Zone(Loop).Name,
991 60 : state.dataHeatBal->Zone(Loop).TotOccupants);
992 120 : PreDefTableEntry(state,
993 60 : state.dataOutRptPredefined->pdchOaoNomNumOcc2,
994 60 : state.dataHeatBal->Zone(Loop).Name,
995 60 : state.dataHeatBal->Zone(Loop).TotOccupants);
996 : }
997 : }
998 : }
999 : } // TotPeople > 0
1000 :
1001 : // Lights
1002 : // Declared in state because the lights inputs are needed for demand manager
1003 171 : int numLightsStatements = 0;
1004 171 : Real64 sumArea = 0.0; // sum of floor area for all lights objects
1005 171 : Real64 sumPower = 0.0; // sum of power for all lights objects
1006 171 : setupIHGZonesAndSpaces(
1007 171 : state, lightsModuleObject, state.dataInternalHeatGains->lightsObjects, numLightsStatements, state.dataHeatBal->TotLights, ErrorsFound);
1008 :
1009 171 : if (state.dataHeatBal->TotLights > 0) {
1010 41 : state.dataHeatBal->Lights.allocate(state.dataHeatBal->TotLights);
1011 41 : bool CheckSharedExhaustFlag = false;
1012 41 : int lightsNum = 0;
1013 114 : for (int lightsInputNum = 1; lightsInputNum <= numLightsStatements; ++lightsInputNum) {
1014 :
1015 73 : state.dataInputProcessing->inputProcessor->getObjectItem(state,
1016 : lightsModuleObject,
1017 : lightsInputNum,
1018 : IHGAlphas,
1019 : IHGNumAlphas,
1020 : IHGNumbers,
1021 : IHGNumNumbers,
1022 : IOStat,
1023 : IHGNumericFieldBlanks,
1024 : IHGAlphaFieldBlanks,
1025 : IHGAlphaFieldNames,
1026 : IHGNumericFieldNames);
1027 :
1028 73 : ErrorObjectHeader eoh{routineName, lightsModuleObject, IHGAlphas(1)};
1029 :
1030 73 : auto &thisLightsInput = state.dataInternalHeatGains->lightsObjects(lightsInputNum);
1031 : // Create one Lights instance for every space associated with this Lights input object
1032 : // Why? Why can't multple spaces share a single lights instance?
1033 148 : for (int Item1 = 1; Item1 <= thisLightsInput.numOfSpaces; ++Item1) {
1034 75 : ++lightsNum;
1035 75 : auto &thisLights = state.dataHeatBal->Lights(lightsNum);
1036 75 : int const spaceNum = thisLightsInput.spaceNums(Item1);
1037 75 : int const zoneNum = state.dataHeatBal->space(spaceNum).zoneNum;
1038 75 : thisLights.Name = thisLightsInput.names(Item1);
1039 75 : thisLights.spaceIndex = spaceNum;
1040 75 : thisLights.ZonePtr = zoneNum;
1041 :
1042 75 : if (!IHGAlphaFieldBlanks(3)) {
1043 75 : thisLights.sched = Sched::GetSchedule(state, IHGAlphas(3));
1044 : }
1045 :
1046 75 : if (Item1 == 1) {
1047 73 : if (IHGAlphaFieldBlanks(3)) {
1048 0 : ShowSevereEmptyField(state, eoh, IHGAlphaFieldNames(3));
1049 0 : ErrorsFound = true;
1050 73 : } else if (thisLights.sched == nullptr) {
1051 0 : ShowSevereItemNotFound(state, eoh, IHGAlphaFieldNames(3), IHGAlphas(3));
1052 0 : ErrorsFound = true;
1053 73 : } else if (!thisLights.sched->checkMinVal(state, Clusive::In, 0.0)) {
1054 0 : Sched::ShowSevereBadMin(state, eoh, IHGAlphaFieldNames(3), IHGAlphas(3), Clusive::In, 0.0);
1055 0 : ErrorsFound = true;
1056 : }
1057 : }
1058 :
1059 : // Lights Design Level calculation method.
1060 : {
1061 : // Set space load fraction
1062 75 : std::string const &lightingLevel = IHGAlphas(4);
1063 75 : if (lightingLevel == "LIGHTINGLEVEL") {
1064 47 : Real64 spaceFrac = 1.0;
1065 47 : if (thisLightsInput.numOfSpaces > 1) {
1066 2 : Real64 const zoneArea = state.dataHeatBal->Zone(zoneNum).FloorArea;
1067 2 : if (zoneArea > 0.0) {
1068 2 : spaceFrac = state.dataHeatBal->space(spaceNum).FloorArea / zoneArea;
1069 : } else {
1070 0 : ShowSevereError(state, format("{}Zone floor area is zero when allocating Lights loads to Spaces.", RoutineName));
1071 0 : ShowContinueError(
1072 : state,
1073 0 : format("Occurs for Lights object ={} in Zone={}", IHGAlphas(1), state.dataHeatBal->Zone(zoneNum).Name));
1074 0 : ErrorsFound = true;
1075 : }
1076 : }
1077 :
1078 47 : thisLights.DesignLevel = IHGNumbers(1) * spaceFrac;
1079 47 : if (IHGNumericFieldBlanks(1)) {
1080 0 : ShowWarningError(state,
1081 0 : format("{}{}=\"{}\", specifies {}, but that field is blank. 0 Lights will result.",
1082 : RoutineName,
1083 : lightsModuleObject,
1084 : IHGAlphas(1),
1085 : IHGNumericFieldNames(1)));
1086 : }
1087 28 : } else if (lightingLevel == "WATTS/AREA") {
1088 28 : if (spaceNum != 0) {
1089 28 : if (IHGNumbers(2) >= 0.0) {
1090 28 : thisLights.DesignLevel = IHGNumbers(2) * state.dataHeatBal->space(spaceNum).FloorArea;
1091 28 : if ((state.dataHeatBal->space(spaceNum).FloorArea <= 0.0) &&
1092 0 : !state.dataHeatBal->space(spaceNum).isRemainderSpace) {
1093 0 : ShowWarningError(state,
1094 0 : format("{}{}=\"{}\", specifies {}, but Space Floor Area = 0. 0 Lights will result.",
1095 : RoutineName,
1096 : lightsModuleObject,
1097 0 : thisLights.Name,
1098 : IHGNumericFieldNames(2)));
1099 : }
1100 : } else {
1101 0 : ShowSevereError(state,
1102 0 : format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}",
1103 : RoutineName,
1104 : lightsModuleObject,
1105 0 : thisLights.Name,
1106 : IHGNumericFieldNames(2),
1107 : IHGNumbers(2)));
1108 0 : ErrorsFound = true;
1109 : }
1110 : }
1111 28 : if (IHGNumericFieldBlanks(2)) {
1112 0 : ShowWarningError(state,
1113 0 : format("{}{}=\"{}\", specifies {}, but that field is blank. 0 Lights will result.",
1114 : RoutineName,
1115 : lightsModuleObject,
1116 : IHGAlphas(1),
1117 : IHGNumericFieldNames(2)));
1118 : }
1119 0 : } else if (lightingLevel == "WATTS/PERSON") {
1120 0 : if (spaceNum != 0) {
1121 0 : if (IHGNumbers(3) >= 0.0) {
1122 0 : thisLights.DesignLevel = IHGNumbers(3) * state.dataHeatBal->space(spaceNum).TotOccupants;
1123 0 : if (state.dataHeatBal->space(spaceNum).TotOccupants <= 0.0) {
1124 0 : ShowWarningError(state,
1125 0 : format("{}{}=\"{}\", specifies {}, but Total Occupants = 0. 0 Lights will result.",
1126 : RoutineName,
1127 : lightsModuleObject,
1128 0 : thisLights.Name,
1129 : IHGNumericFieldNames(2)));
1130 : }
1131 : } else {
1132 0 : ShowSevereError(state,
1133 0 : format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}",
1134 : RoutineName,
1135 : lightsModuleObject,
1136 0 : thisLights.Name,
1137 : IHGNumericFieldNames(3),
1138 : IHGNumbers(3)));
1139 0 : ErrorsFound = true;
1140 : }
1141 : }
1142 0 : if (IHGNumericFieldBlanks(3)) {
1143 0 : ShowWarningError(state,
1144 0 : format("{}{}=\"{}\", specifies {}, but that field is blank. 0 Lights will result.",
1145 : RoutineName,
1146 : lightsModuleObject,
1147 : IHGAlphas(1),
1148 : IHGNumericFieldNames(3)));
1149 : }
1150 : } else {
1151 0 : if (Item1 == 1) {
1152 0 : ShowSevereError(state,
1153 0 : format("{}{}=\"{}\", invalid {}, value ={}",
1154 : RoutineName,
1155 : lightsModuleObject,
1156 : IHGAlphas(1),
1157 : IHGAlphaFieldNames(4),
1158 : IHGAlphas(4)));
1159 0 : ShowContinueError(state, R"(...Valid values are "LightingLevel", "Watts/Area", "Watts/Person".)");
1160 0 : ErrorsFound = true;
1161 : }
1162 : }
1163 : }
1164 :
1165 : // Calculate nominal min/max lighting level
1166 75 : thisLights.NomMinDesignLevel = thisLights.DesignLevel * thisLights.sched->getMinVal(state);
1167 75 : thisLights.NomMaxDesignLevel = thisLights.DesignLevel * thisLights.sched->getMaxVal(state);
1168 :
1169 75 : thisLights.FractionReturnAir = IHGNumbers(4);
1170 75 : thisLights.FractionRadiant = IHGNumbers(5);
1171 75 : thisLights.FractionShortWave = IHGNumbers(6);
1172 75 : thisLights.FractionReplaceable = IHGNumbers(7);
1173 75 : thisLights.FractionReturnAirPlenTempCoeff1 = IHGNumbers(8);
1174 75 : thisLights.FractionReturnAirPlenTempCoeff2 = IHGNumbers(9);
1175 :
1176 75 : thisLights.FractionConvected = 1.0 - (thisLights.FractionReturnAir + thisLights.FractionRadiant + thisLights.FractionShortWave);
1177 75 : if (std::abs(thisLights.FractionConvected) <= 0.001) thisLights.FractionConvected = 0.0;
1178 75 : if (thisLights.FractionConvected < 0.0) {
1179 0 : if (Item1 == 1) {
1180 0 : ShowSevereError(state, format("{}{}=\"{}\", Sum of Fractions > 1.0", RoutineName, lightsModuleObject, thisLights.Name));
1181 0 : ErrorsFound = true;
1182 : }
1183 : }
1184 :
1185 : // Note: if FractionReturnAirIsCalculated = Yes and there is a return-air plenum:
1186 : // (1) The input values of FractionReturnAir, FractionRadiant and FractionShortWave, and the
1187 : // value of FractionConvected calculated from these are used in the zone sizing calculations;
1188 : // (2) in the regular calculation, FractionReturnAir is calculated each time step in
1189 : // Subr. InitInternalHeatGains as a function of the zone's return plenum air temperature
1190 : // using FractionReturnAirPlenTempCoeff1 and FractionReturnAirPlenTempCoeff2; then
1191 : // FractionRadiant and FractionConvected are adjusted from their input values such that
1192 : // FractionReturnAir + FractionRadiant + FractionShortWave + FractionConvected = 1.0, assuming
1193 : // FractionShortWave is constant and equal to its input value.
1194 :
1195 75 : if (IHGNumAlphas > 4) {
1196 71 : thisLights.EndUseSubcategory = IHGAlphas(5);
1197 : } else {
1198 4 : thisLights.EndUseSubcategory = "General";
1199 : }
1200 :
1201 75 : if (IHGAlphaFieldBlanks(6)) {
1202 70 : thisLights.FractionReturnAirIsCalculated = false;
1203 5 : } else if (IHGAlphas(6) != "YES" && IHGAlphas(6) != "NO") {
1204 0 : if (Item1 == 1) {
1205 0 : ShowWarningError(state,
1206 0 : format("{}{}=\"{}\", invalid {}, value ={}",
1207 : RoutineName,
1208 : lightsModuleObject,
1209 0 : thisLightsInput.Name,
1210 : IHGAlphaFieldNames(6),
1211 : IHGAlphas(6)));
1212 0 : ShowContinueError(state, ".. Return Air Fraction from Plenum will NOT be calculated.");
1213 : }
1214 0 : thisLights.FractionReturnAirIsCalculated = false;
1215 : } else {
1216 5 : thisLights.FractionReturnAirIsCalculated = (IHGAlphas(6) == "YES");
1217 : }
1218 :
1219 : // Set return air node number
1220 75 : thisLights.ZoneReturnNum = 0;
1221 75 : thisLights.RetNodeName = "";
1222 75 : if (!IHGAlphaFieldBlanks(7)) {
1223 2 : if (thisLightsInput.ZoneListActive) {
1224 0 : ShowSevereError(state,
1225 0 : format("{}{}=\"{}\": {} must be blank when using a ZoneList.",
1226 : RoutineName,
1227 : lightsModuleObject,
1228 0 : thisLightsInput.Name,
1229 : IHGAlphaFieldNames(7)));
1230 0 : ErrorsFound = true;
1231 : } else {
1232 2 : thisLights.RetNodeName = IHGAlphas(7);
1233 : }
1234 : }
1235 75 : if (thisLights.ZonePtr > 0) {
1236 75 : thisLights.ZoneReturnNum = DataZoneEquipment::GetReturnNumForZone(state, thisLights.ZonePtr, thisLights.RetNodeName);
1237 : }
1238 :
1239 75 : if ((thisLights.ZoneReturnNum == 0) && (thisLights.FractionReturnAir > 0.0) && (!IHGAlphaFieldBlanks(7))) {
1240 0 : ShowSevereError(
1241 : state,
1242 0 : format(
1243 : "{}{}=\"{}\", invalid {} ={}", RoutineName, lightsModuleObject, IHGAlphas(1), IHGAlphaFieldNames(7), IHGAlphas(7)));
1244 0 : ShowContinueError(state, "No matching Zone Return Air Node found.");
1245 0 : ErrorsFound = true;
1246 : }
1247 : // Set exhaust air node number
1248 75 : thisLights.ZoneExhaustNodeNum = 0;
1249 75 : if (!IHGAlphaFieldBlanks(8)) {
1250 2 : if (thisLightsInput.ZoneListActive) {
1251 0 : ShowSevereError(state,
1252 0 : format("{}{}=\"{}\": {} must be blank when using a ZoneList.",
1253 : RoutineName,
1254 : lightsModuleObject,
1255 0 : thisLightsInput.Name,
1256 : IHGAlphaFieldNames(8)));
1257 0 : ErrorsFound = true;
1258 : } else {
1259 2 : bool exhaustNodeError = false;
1260 2 : thisLights.ZoneExhaustNodeNum = GetOnlySingleNode(state,
1261 2 : IHGAlphas(8),
1262 : exhaustNodeError,
1263 : DataLoopNode::ConnectionObjectType::Lights,
1264 2 : thisLights.Name,
1265 : DataLoopNode::NodeFluidType::Air,
1266 : DataLoopNode::ConnectionType::ZoneExhaust,
1267 : NodeInputManager::CompFluidStream::Primary,
1268 : ObjectIsNotParent);
1269 2 : if (!exhaustNodeError) { // GetOnlySingleNode will throw error messages if this is a NodeList Name and for other issues
1270 2 : exhaustNodeError =
1271 2 : DataZoneEquipment::VerifyLightsExhaustNodeForZone(state, thisLights.ZonePtr, thisLights.ZoneExhaustNodeNum);
1272 : }
1273 2 : if (exhaustNodeError) {
1274 0 : ShowSevereError(state,
1275 0 : format("{}{}=\"{}\", invalid {} = {}",
1276 : RoutineName,
1277 : lightsModuleObject,
1278 : IHGAlphas(1),
1279 : IHGAlphaFieldNames(8),
1280 : IHGAlphas(8)));
1281 0 : ShowContinueError(state, "No matching Zone Exhaust Air Node found.");
1282 0 : ErrorsFound = true;
1283 : } else {
1284 2 : if (thisLights.ZoneReturnNum > 0) {
1285 2 : state.dataZoneEquip->ZoneEquipConfig(thisLights.ZonePtr).ReturnNodeExhaustNodeNum(thisLights.ZoneReturnNum) =
1286 2 : thisLights.ZoneExhaustNodeNum;
1287 2 : CheckSharedExhaustFlag = true;
1288 : } else {
1289 0 : ShowSevereError(state,
1290 0 : format("{}{}=\"{}\", {} ={} is not used",
1291 : RoutineName,
1292 : lightsModuleObject,
1293 : IHGAlphas(1),
1294 : IHGAlphaFieldNames(8),
1295 : IHGAlphas(8)));
1296 0 : ShowContinueError(
1297 : state, "No matching Zone Return Air Node found. The Exhaust Node requires Return Node to work together");
1298 0 : ErrorsFound = true;
1299 : }
1300 : }
1301 : }
1302 :
1303 2 : if (thisLights.ZonePtr <= 0) continue; // Error, will be caught and terminated later
1304 : }
1305 : }
1306 : }
1307 41 : if (state.dataGlobal->AnyEnergyManagementSystemInModel) {
1308 3 : for (int lightsNum2 = 1; lightsNum2 <= state.dataHeatBal->TotLights; ++lightsNum2) {
1309 4 : SetupEMSActuator(state,
1310 : "Lights",
1311 2 : state.dataHeatBal->Lights(lightsNum2).Name,
1312 : "Electricity Rate",
1313 : "[W]",
1314 2 : state.dataHeatBal->Lights(lightsNum2).EMSLightsOn,
1315 2 : state.dataHeatBal->Lights(lightsNum2).EMSLightingPower);
1316 2 : SetupEMSInternalVariable(state,
1317 : "Lighting Power Design Level",
1318 2 : state.dataHeatBal->Lights(lightsNum2).Name,
1319 : "[W]",
1320 2 : state.dataHeatBal->Lights(lightsNum2).DesignLevel);
1321 : } // EMS
1322 : }
1323 116 : for (int lightsNum2 = 1; lightsNum2 <= state.dataHeatBal->TotLights; ++lightsNum2) {
1324 75 : int spaceNum = state.dataHeatBal->Lights(lightsNum2).spaceIndex;
1325 75 : int zoneNum = state.dataHeatBal->Lights(lightsNum2).ZonePtr;
1326 : // setup internal gains
1327 75 : int returnNodeNum = 0;
1328 136 : if ((state.dataHeatBal->Lights(lightsNum2).ZoneReturnNum > 0) &&
1329 61 : (state.dataHeatBal->Lights(lightsNum2).ZoneReturnNum <= state.dataZoneEquip->ZoneEquipConfig(zoneNum).NumReturnNodes)) {
1330 61 : returnNodeNum = state.dataZoneEquip->ZoneEquipConfig(zoneNum).ReturnNode(state.dataHeatBal->Lights(lightsNum2).ZoneReturnNum);
1331 : }
1332 75 : if (!ErrorsFound) {
1333 375 : SetupSpaceInternalGain(state,
1334 75 : state.dataHeatBal->Lights(lightsNum2).spaceIndex,
1335 : 1.0,
1336 75 : state.dataHeatBal->Lights(lightsNum2).Name,
1337 : DataHeatBalance::IntGainType::Lights,
1338 75 : &state.dataHeatBal->Lights(lightsNum2).ConGainRate,
1339 75 : &state.dataHeatBal->Lights(lightsNum2).RetAirGainRate,
1340 75 : &state.dataHeatBal->Lights(lightsNum2).RadGainRate,
1341 : nullptr,
1342 : nullptr,
1343 : nullptr,
1344 : nullptr,
1345 : returnNodeNum);
1346 : }
1347 :
1348 75 : if (state.dataHeatBal->Lights(lightsNum2).FractionReturnAir > 0)
1349 29 : state.dataHeatBal->Zone(state.dataHeatBal->Lights(lightsNum2).ZonePtr).HasLtsRetAirGain = true;
1350 : // send values to predefined lighting summary report
1351 75 : std::string liteName = state.dataHeatBal->Lights(lightsNum2).Name;
1352 75 : Real64 mult = state.dataHeatBal->Zone(zoneNum).Multiplier * state.dataHeatBal->Zone(zoneNum).ListMultiplier;
1353 75 : Real64 spaceArea = state.dataHeatBal->space(spaceNum).FloorArea;
1354 75 : sumArea += spaceArea * mult;
1355 75 : sumPower += state.dataHeatBal->Lights(lightsNum2).DesignLevel * mult;
1356 75 : PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtZone, liteName, state.dataHeatBal->Zone(zoneNum).Name);
1357 75 : PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtSpace, liteName, state.dataHeatBal->space(spaceNum).Name);
1358 75 : PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtSpaceType, liteName, state.dataHeatBal->space(spaceNum).spaceType);
1359 75 : if (spaceArea > 0.0) {
1360 74 : PreDefTableEntry(
1361 148 : state, state.dataOutRptPredefined->pdchInLtDens, liteName, state.dataHeatBal->Lights(lightsNum2).DesignLevel / spaceArea, 4);
1362 : } else {
1363 1 : PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtDens, liteName, DataPrecisionGlobals::constant_zero, 4);
1364 : }
1365 75 : PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtArea, liteName, spaceArea * mult);
1366 150 : PreDefTableEntry(
1367 75 : state, state.dataOutRptPredefined->pdchInLtPower, liteName, state.dataHeatBal->Lights(lightsNum2).DesignLevel * mult);
1368 150 : PreDefTableEntry(
1369 150 : state, state.dataOutRptPredefined->pdchInLtEndUse, liteName, state.dataHeatBal->Lights(lightsNum2).EndUseSubcategory);
1370 75 : PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtSchd, liteName, state.dataHeatBal->Lights(lightsNum2).sched->Name);
1371 75 : PreDefTableEntry(
1372 75 : state, state.dataOutRptPredefined->pdchInLtRetAir, liteName, state.dataHeatBal->Lights(lightsNum2).FractionReturnAir, 4);
1373 75 : } // Item1 - Number of Lights instances
1374 41 : if (CheckSharedExhaustFlag) {
1375 2 : DataZoneEquipment::CheckSharedExhaust(state);
1376 2 : Array1D_bool ReturnNodeShared; // zone supply air inlet nodes
1377 2 : ReturnNodeShared.allocate(state.dataHeatBal->TotLights);
1378 2 : ReturnNodeShared = false;
1379 12 : for (int Loop = 1; Loop <= state.dataHeatBal->TotLights; ++Loop) {
1380 10 : int ZoneNum = state.dataHeatBal->Lights(Loop).ZonePtr;
1381 10 : int ReturnNum = state.dataHeatBal->Lights(Loop).ZoneReturnNum;
1382 10 : int ExhaustNodeNum = state.dataHeatBal->Lights(Loop).ZoneExhaustNodeNum;
1383 10 : if (ReturnNum == 0 || ExhaustNodeNum == 0) continue;
1384 10 : for (int Loop1 = Loop + 1; Loop1 <= state.dataHeatBal->TotLights; ++Loop1) {
1385 8 : if (ZoneNum != state.dataHeatBal->Lights(Loop1).ZonePtr) continue;
1386 0 : if (ReturnNodeShared(Loop1)) continue;
1387 0 : if (ReturnNum == state.dataHeatBal->Lights(Loop1).ZoneReturnNum &&
1388 0 : ExhaustNodeNum != state.dataHeatBal->Lights(Loop1).ZoneExhaustNodeNum) {
1389 0 : ShowSevereError(state,
1390 0 : format("{}{}: Duplicated Return Air Node = {} is found, ",
1391 : RoutineName,
1392 : lightsModuleObject,
1393 0 : state.dataHeatBal->Lights(Loop1).RetNodeName));
1394 0 : ShowContinueError(state,
1395 0 : format(" in both Lights objects = {} and {}.",
1396 0 : state.dataHeatBal->Lights(Loop).Name,
1397 0 : state.dataHeatBal->Lights(Loop1).Name));
1398 0 : ErrorsFound = true;
1399 0 : ReturnNodeShared(Loop1) = true;
1400 : }
1401 : }
1402 : }
1403 2 : ReturnNodeShared.deallocate();
1404 2 : }
1405 : } // TotLights > 0 check
1406 : // add total line to lighting summary table
1407 171 : if (sumArea > 0.0) {
1408 40 : PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtDens, "Interior Lighting Total", sumPower / sumArea,
1409 80 : 4); // line 792
1410 : } else {
1411 131 : PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtDens, "Interior Lighting Total", DataPrecisionGlobals::constant_zero, 4);
1412 : }
1413 171 : PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtArea, "Interior Lighting Total", sumArea);
1414 171 : PreDefTableEntry(state, state.dataOutRptPredefined->pdchInLtPower, "Interior Lighting Total", sumPower);
1415 :
1416 : // ElectricEquipment
1417 : // Declared in state because the lights inputs are needed for demand manager
1418 171 : int numZoneElectricStatements = 0;
1419 171 : setupIHGZonesAndSpaces(state,
1420 : elecEqModuleObject,
1421 171 : state.dataInternalHeatGains->zoneElectricObjects,
1422 : numZoneElectricStatements,
1423 171 : state.dataHeatBal->TotElecEquip,
1424 : ErrorsFound);
1425 :
1426 171 : if (state.dataHeatBal->TotElecEquip > 0) {
1427 43 : state.dataHeatBal->ZoneElectric.allocate(state.dataHeatBal->TotElecEquip);
1428 43 : int elecEqNum = 0;
1429 139 : for (int elecEqInputNum = 1; elecEqInputNum <= numZoneElectricStatements; ++elecEqInputNum) {
1430 :
1431 96 : state.dataInputProcessing->inputProcessor->getObjectItem(state,
1432 : elecEqModuleObject,
1433 : elecEqInputNum,
1434 : IHGAlphas,
1435 : IHGNumAlphas,
1436 : IHGNumbers,
1437 : IHGNumNumbers,
1438 : IOStat,
1439 : IHGNumericFieldBlanks,
1440 : IHGAlphaFieldBlanks,
1441 : IHGAlphaFieldNames,
1442 : IHGNumericFieldNames);
1443 :
1444 96 : ErrorObjectHeader eoh{routineName, elecEqModuleObject, IHGAlphas(1)};
1445 :
1446 96 : auto &thisElecEqInput = state.dataInternalHeatGains->zoneElectricObjects(elecEqInputNum);
1447 194 : for (int Item1 = 1; Item1 <= thisElecEqInput.numOfSpaces; ++Item1) {
1448 98 : ++elecEqNum;
1449 98 : auto &thisZoneElectric = state.dataHeatBal->ZoneElectric(elecEqNum);
1450 98 : int const spaceNum = thisElecEqInput.spaceNums(Item1);
1451 98 : int const zoneNum = state.dataHeatBal->space(spaceNum).zoneNum;
1452 98 : thisZoneElectric.Name = thisElecEqInput.names(Item1);
1453 98 : thisZoneElectric.spaceIndex = spaceNum;
1454 98 : thisZoneElectric.ZonePtr = zoneNum;
1455 :
1456 : // Why are error messages not guarded by (Item1 == 1) checks for equipment?
1457 :
1458 98 : if (IHGAlphaFieldBlanks(3)) {
1459 0 : ShowSevereEmptyField(state, eoh, IHGAlphaFieldNames(3));
1460 0 : ErrorsFound = true;
1461 98 : } else if ((thisZoneElectric.sched = Sched::GetSchedule(state, IHGAlphas(3))) == nullptr) {
1462 0 : ShowSevereItemNotFound(state, eoh, IHGAlphaFieldNames(3), IHGAlphas(3));
1463 0 : ErrorsFound = true;
1464 98 : } else if (!thisZoneElectric.sched->checkMinVal(state, Clusive::In, 0.0)) {
1465 0 : Sched::ShowSevereBadMin(state, eoh, IHGAlphaFieldNames(3), IHGAlphas(3), Clusive::In, 0.0);
1466 0 : ErrorsFound = true;
1467 : }
1468 :
1469 : // Electric equipment design level calculation method.
1470 : {
1471 98 : std::string const &equipmentLevel = IHGAlphas(4);
1472 98 : if (equipmentLevel == "EQUIPMENTLEVEL") {
1473 70 : Real64 spaceFrac = 1.0;
1474 70 : if (thisElecEqInput.numOfSpaces > 1) {
1475 2 : Real64 const zoneArea = state.dataHeatBal->Zone(zoneNum).FloorArea;
1476 2 : if (zoneArea > 0.0) {
1477 2 : spaceFrac = state.dataHeatBal->space(spaceNum).FloorArea / zoneArea;
1478 : } else {
1479 0 : ShowSevereError(
1480 0 : state, format("{}Zone floor area is zero when allocating ElectricEquipment loads to Spaces.", RoutineName));
1481 0 : ShowContinueError(state,
1482 0 : format("Occurs for ElectricEquipment object ={} in Zone={}",
1483 0 : thisElecEqInput.Name,
1484 0 : state.dataHeatBal->Zone(thisZoneElectric.ZonePtr).Name));
1485 0 : ErrorsFound = true;
1486 : }
1487 : }
1488 70 : thisZoneElectric.DesignLevel = IHGNumbers(1) * spaceFrac;
1489 70 : if (IHGNumericFieldBlanks(1)) {
1490 0 : ShowWarningError(state,
1491 0 : format("{}{}=\"{}\", specifies {}, but that field is blank. 0 Electric Equipment will result.",
1492 : RoutineName,
1493 : elecEqModuleObject,
1494 0 : thisElecEqInput.Name,
1495 : IHGNumericFieldNames(1)));
1496 : }
1497 28 : } else if (equipmentLevel == "WATTS/AREA") {
1498 28 : if (spaceNum != 0) {
1499 28 : if (IHGNumbers(2) >= 0.0) {
1500 28 : thisZoneElectric.DesignLevel = IHGNumbers(2) * state.dataHeatBal->space(spaceNum).FloorArea;
1501 28 : if ((state.dataHeatBal->space(spaceNum).FloorArea <= 0.0) &&
1502 0 : !state.dataHeatBal->space(spaceNum).isRemainderSpace) {
1503 0 : ShowWarningError(
1504 : state,
1505 0 : format("{}{}=\"{}\", specifies {}, but Space Floor Area = 0. 0 Electric Equipment will result.",
1506 : RoutineName,
1507 : elecEqModuleObject,
1508 0 : thisZoneElectric.Name,
1509 : IHGNumericFieldNames(2)));
1510 : }
1511 : } else {
1512 0 : ShowSevereError(state,
1513 0 : format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}",
1514 : RoutineName,
1515 : elecEqModuleObject,
1516 0 : thisZoneElectric.Name,
1517 : IHGNumericFieldNames(2),
1518 : IHGNumbers(2)));
1519 0 : ErrorsFound = true;
1520 : }
1521 : }
1522 28 : if (IHGNumericFieldBlanks(2)) {
1523 0 : ShowWarningError(state,
1524 0 : format("{}{}=\"{}\", specifies {}, but that field is blank. 0 Electric Equipment will result.",
1525 : RoutineName,
1526 : elecEqModuleObject,
1527 0 : thisElecEqInput.Name,
1528 : IHGNumericFieldNames(2)));
1529 : }
1530 :
1531 0 : } else if (equipmentLevel == "WATTS/PERSON") {
1532 0 : if (spaceNum != 0) {
1533 0 : if (IHGNumbers(3) >= 0.0) {
1534 0 : thisZoneElectric.DesignLevel = IHGNumbers(3) * state.dataHeatBal->space(spaceNum).TotOccupants;
1535 0 : if (state.dataHeatBal->space(spaceNum).TotOccupants <= 0.0) {
1536 0 : ShowWarningError(
1537 : state,
1538 0 : format("{}{}=\"{}\", specifies {}, but Total Occupants = 0. 0 Electric Equipment will result.",
1539 : RoutineName,
1540 : elecEqModuleObject,
1541 0 : thisZoneElectric.Name,
1542 : IHGNumericFieldNames(2)));
1543 : }
1544 : } else {
1545 0 : ShowSevereError(state,
1546 0 : format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}",
1547 : RoutineName,
1548 : elecEqModuleObject,
1549 0 : thisZoneElectric.Name,
1550 : IHGNumericFieldNames(3),
1551 : IHGNumbers(3)));
1552 0 : ErrorsFound = true;
1553 : }
1554 : }
1555 0 : if (IHGNumericFieldBlanks(3)) {
1556 0 : ShowWarningError(state,
1557 0 : format("{}{}=\"{}\", specifies {}, but that field is blank. 0 Electric Equipment will result.",
1558 : RoutineName,
1559 : elecEqModuleObject,
1560 0 : thisElecEqInput.Name,
1561 : IHGNumericFieldNames(3)));
1562 : }
1563 :
1564 : } else {
1565 0 : if (Item1 == 1) {
1566 0 : ShowSevereError(state,
1567 0 : format("{}{}=\"{}\", invalid {}, value ={}",
1568 : RoutineName,
1569 : elecEqModuleObject,
1570 0 : thisElecEqInput.Name,
1571 : IHGAlphaFieldNames(4),
1572 : IHGAlphas(4)));
1573 0 : ShowContinueError(state, "...Valid values are \"EquipmentLevel\", \"Watts/Area\", \"Watts/Person\".");
1574 0 : ErrorsFound = true;
1575 : }
1576 : }
1577 : }
1578 :
1579 : // Calculate nominal min/max equipment level
1580 98 : thisZoneElectric.NomMinDesignLevel = thisZoneElectric.DesignLevel * thisZoneElectric.sched->getMinVal(state);
1581 98 : thisZoneElectric.NomMaxDesignLevel = thisZoneElectric.DesignLevel * thisZoneElectric.sched->getMaxVal(state);
1582 :
1583 98 : thisZoneElectric.FractionLatent = IHGNumbers(4);
1584 98 : thisZoneElectric.FractionRadiant = IHGNumbers(5);
1585 98 : thisZoneElectric.FractionLost = IHGNumbers(6);
1586 : // FractionConvected is a calculated field
1587 98 : thisZoneElectric.FractionConvected =
1588 98 : 1.0 - (thisZoneElectric.FractionLatent + thisZoneElectric.FractionRadiant + thisZoneElectric.FractionLost);
1589 98 : if (std::abs(thisZoneElectric.FractionConvected) <= 0.001) thisZoneElectric.FractionConvected = 0.0;
1590 98 : if (thisZoneElectric.FractionConvected < 0.0) {
1591 0 : ShowSevereError(state, format("{}{}=\"{}\", Sum of Fractions > 1.0", RoutineName, elecEqModuleObject, thisElecEqInput.Name));
1592 0 : ErrorsFound = true;
1593 : }
1594 :
1595 98 : if (IHGNumAlphas > 4) {
1596 5 : thisZoneElectric.EndUseSubcategory = IHGAlphas(5);
1597 : } else {
1598 93 : thisZoneElectric.EndUseSubcategory = "General";
1599 : }
1600 98 : if (state.dataGlobal->AnyEnergyManagementSystemInModel) {
1601 3 : SetupEMSActuator(state,
1602 : "ElectricEquipment",
1603 : thisZoneElectric.Name,
1604 : "Electricity Rate",
1605 : "[W]",
1606 3 : thisZoneElectric.EMSZoneEquipOverrideOn,
1607 3 : thisZoneElectric.EMSEquipPower);
1608 3 : SetupEMSInternalVariable(
1609 3 : state, "Plug and Process Power Design Level", thisZoneElectric.Name, "[W]", thisZoneElectric.DesignLevel);
1610 : } // EMS
1611 98 : if (!ErrorsFound) {
1612 98 : SetupSpaceInternalGain(state,
1613 : thisZoneElectric.spaceIndex,
1614 : 1.0,
1615 : thisZoneElectric.Name,
1616 : DataHeatBalance::IntGainType::ElectricEquipment,
1617 : &thisZoneElectric.ConGainRate,
1618 : nullptr,
1619 : &thisZoneElectric.RadGainRate,
1620 : &thisZoneElectric.LatGainRate);
1621 : }
1622 : } // for elecEqInputNum.NumOfSpaces
1623 : } // for elecEqInputNum
1624 : } // TotElecEquip > 0
1625 :
1626 : // GasEquipment
1627 342 : EPVector<InternalHeatGains::GlobalInternalGainMiscObject> zoneGasObjects;
1628 171 : int numZoneGasStatements = 0;
1629 171 : setupIHGZonesAndSpaces(state, gasEqModuleObject, zoneGasObjects, numZoneGasStatements, state.dataHeatBal->TotGasEquip, ErrorsFound);
1630 :
1631 171 : if (state.dataHeatBal->TotGasEquip > 0) {
1632 1 : state.dataHeatBal->ZoneGas.allocate(state.dataHeatBal->TotGasEquip);
1633 1 : int gasEqNum = 0;
1634 2 : for (int gasEqInputNum = 1; gasEqInputNum <= numZoneGasStatements; ++gasEqInputNum) {
1635 :
1636 1 : state.dataInputProcessing->inputProcessor->getObjectItem(state,
1637 : gasEqModuleObject,
1638 : gasEqInputNum,
1639 : IHGAlphas,
1640 : IHGNumAlphas,
1641 : IHGNumbers,
1642 : IHGNumNumbers,
1643 : IOStat,
1644 : IHGNumericFieldBlanks,
1645 : IHGAlphaFieldBlanks,
1646 : IHGAlphaFieldNames,
1647 : IHGNumericFieldNames);
1648 :
1649 1 : ErrorObjectHeader eoh{routineName, gasEqModuleObject, IHGAlphas(1)};
1650 :
1651 1 : auto &thisGasEqInput = zoneGasObjects(gasEqInputNum);
1652 3 : for (int Item1 = 1; Item1 <= thisGasEqInput.numOfSpaces; ++Item1) {
1653 2 : ++gasEqNum;
1654 2 : auto &thisZoneGas = state.dataHeatBal->ZoneGas(gasEqNum);
1655 2 : int const spaceNum = thisGasEqInput.spaceNums(Item1);
1656 2 : int const zoneNum = state.dataHeatBal->space(spaceNum).zoneNum;
1657 2 : thisZoneGas.Name = thisGasEqInput.names(Item1);
1658 2 : thisZoneGas.spaceIndex = spaceNum;
1659 2 : thisZoneGas.ZonePtr = zoneNum;
1660 :
1661 2 : if (!IHGAlphaFieldBlanks(3)) {
1662 2 : thisZoneGas.sched = Sched::GetSchedule(state, IHGAlphas(3));
1663 : }
1664 :
1665 : // And here for gas, we are guarding with (Item1 == 1) again
1666 2 : if (Item1 == 1) {
1667 1 : if (IHGAlphaFieldBlanks(3)) {
1668 0 : ShowSevereEmptyField(state, eoh, IHGAlphaFieldNames(3));
1669 0 : ErrorsFound = true;
1670 1 : } else if (thisZoneGas.sched == nullptr) {
1671 0 : ShowSevereItemNotFound(state, eoh, IHGAlphaFieldNames(3), IHGAlphas(3));
1672 0 : ErrorsFound = true;
1673 1 : } else if (!thisZoneGas.sched->checkMinVal(state, Clusive::In, 0.0)) {
1674 0 : Sched::ShowSevereBadMin(state, eoh, IHGAlphaFieldNames(3), IHGAlphas(3), Clusive::In, 0.0);
1675 0 : ErrorsFound = true;
1676 : }
1677 : }
1678 :
1679 : // Gas equipment design level calculation method.
1680 : {
1681 2 : std::string const &equipmentLevel = IHGAlphas(4);
1682 2 : if (equipmentLevel == "EQUIPMENTLEVEL") {
1683 2 : Real64 spaceFrac = 1.0;
1684 2 : if (thisGasEqInput.numOfSpaces > 1) {
1685 2 : Real64 const zoneArea = state.dataHeatBal->Zone(zoneNum).FloorArea;
1686 2 : if (zoneArea > 0.0) {
1687 2 : spaceFrac = state.dataHeatBal->space(spaceNum).FloorArea / zoneArea;
1688 : } else {
1689 0 : ShowSevereError(state,
1690 0 : format("{}Zone floor area is zero when allocating GasEquipment loads to Spaces.", RoutineName));
1691 0 : ShowContinueError(state,
1692 0 : format("Occurs for GasEquipment object ={} in Zone={}",
1693 0 : thisGasEqInput.Name,
1694 0 : state.dataHeatBal->Zone(thisZoneGas.ZonePtr).Name));
1695 0 : ErrorsFound = true;
1696 : }
1697 : }
1698 2 : thisZoneGas.DesignLevel = IHGNumbers(1) * spaceFrac;
1699 2 : if (IHGNumericFieldBlanks(1)) {
1700 0 : ShowWarningError(state,
1701 0 : format("{}{}=\"{}\", specifies {}, but that field is blank. 0 Gas Equipment will result.",
1702 : RoutineName,
1703 : gasEqModuleObject,
1704 0 : thisGasEqInput.Name,
1705 : IHGNumericFieldNames(1)));
1706 : }
1707 0 : } else if (equipmentLevel == "WATTS/AREA" || equipmentLevel == "POWER/AREA") {
1708 0 : if (spaceNum != 0) {
1709 0 : if (IHGNumbers(2) >= 0.0) {
1710 0 : thisZoneGas.DesignLevel = IHGNumbers(2) * state.dataHeatBal->space(spaceNum).FloorArea;
1711 0 : if ((state.dataHeatBal->space(spaceNum).FloorArea <= 0.0) &&
1712 0 : !state.dataHeatBal->space(spaceNum).isRemainderSpace) {
1713 0 : ShowWarningError(state,
1714 0 : format("{}{}=\"{}\", specifies {}, but Space Floor Area = 0. 0 Gas Equipment will result.",
1715 : RoutineName,
1716 : gasEqModuleObject,
1717 0 : thisZoneGas.Name,
1718 : IHGNumericFieldNames(2)));
1719 : }
1720 : } else {
1721 0 : ShowSevereError(state,
1722 0 : format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}",
1723 : RoutineName,
1724 : gasEqModuleObject,
1725 0 : thisGasEqInput.Name,
1726 : IHGNumericFieldNames(2),
1727 : IHGNumbers(2)));
1728 0 : ErrorsFound = true;
1729 : }
1730 : }
1731 0 : if (IHGNumericFieldBlanks(2)) {
1732 0 : ShowWarningError(state,
1733 0 : format("{}{}=\"{}\", specifies {}, but that field is blank. 0 Gas Equipment will result.",
1734 : RoutineName,
1735 : gasEqModuleObject,
1736 0 : thisGasEqInput.Name,
1737 : IHGNumericFieldNames(2)));
1738 : }
1739 :
1740 0 : } else if (equipmentLevel == "WATTS/PERSON" || equipmentLevel == "POWER/PERSON") {
1741 0 : if (spaceNum != 0) {
1742 0 : if (IHGNumbers(3) >= 0.0) {
1743 0 : thisZoneGas.DesignLevel = IHGNumbers(3) * state.dataHeatBal->space(spaceNum).TotOccupants;
1744 0 : if (state.dataHeatBal->space(spaceNum).TotOccupants <= 0.0) {
1745 0 : ShowWarningError(state,
1746 0 : format("{}{}=\"{}\", specifies {}, but Total Occupants = 0. 0 Gas Equipment will result.",
1747 : RoutineName,
1748 : gasEqModuleObject,
1749 0 : thisZoneGas.Name,
1750 : IHGNumericFieldNames(2)));
1751 : }
1752 : } else {
1753 0 : ShowSevereError(state,
1754 0 : format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}",
1755 : RoutineName,
1756 : gasEqModuleObject,
1757 0 : thisGasEqInput.Name,
1758 : IHGNumericFieldNames(3),
1759 : IHGNumbers(3)));
1760 0 : ErrorsFound = true;
1761 : }
1762 : }
1763 0 : if (IHGNumericFieldBlanks(3)) {
1764 0 : ShowWarningError(state,
1765 0 : format("{}{}=\"{}\", specifies {}, but that field is blank. 0 Gas Equipment will result.",
1766 : RoutineName,
1767 : gasEqModuleObject,
1768 0 : thisGasEqInput.Name,
1769 : IHGNumericFieldNames(3)));
1770 : }
1771 :
1772 : } else {
1773 0 : if (Item1 == 1) {
1774 0 : ShowSevereInvalidKey(state, eoh, IHGAlphaFieldNames(4), IHGAlphas(4));
1775 0 : ErrorsFound = true;
1776 : }
1777 : }
1778 : }
1779 :
1780 : // Calculate nominal min/max equipment level
1781 2 : thisZoneGas.NomMinDesignLevel = thisZoneGas.DesignLevel * thisZoneGas.sched->getMinVal(state);
1782 2 : thisZoneGas.NomMaxDesignLevel = thisZoneGas.DesignLevel * thisZoneGas.sched->getMaxVal(state);
1783 :
1784 2 : thisZoneGas.FractionLatent = IHGNumbers(4);
1785 2 : thisZoneGas.FractionRadiant = IHGNumbers(5);
1786 2 : thisZoneGas.FractionLost = IHGNumbers(6);
1787 :
1788 2 : if ((IHGNumNumbers == 7) || (!IHGNumericFieldBlanks(7))) {
1789 2 : thisZoneGas.CO2RateFactor = IHGNumbers(7);
1790 : }
1791 2 : if (thisZoneGas.CO2RateFactor < 0.0) {
1792 0 : ShowSevereError(state,
1793 0 : format("{}{}=\"{}\", {} < 0.0, value ={:.2R}",
1794 : RoutineName,
1795 : gasEqModuleObject,
1796 0 : thisGasEqInput.Name,
1797 : IHGNumericFieldNames(7),
1798 : IHGNumbers(7)));
1799 0 : ErrorsFound = true;
1800 : }
1801 2 : if (thisZoneGas.CO2RateFactor > 4.0e-7) {
1802 0 : ShowSevereError(state,
1803 0 : format("{}{}=\"{}\", {} > 4.0E-7, value ={:.2R}",
1804 : RoutineName,
1805 : gasEqModuleObject,
1806 0 : thisGasEqInput.Name,
1807 : IHGNumericFieldNames(7),
1808 : IHGNumbers(7)));
1809 0 : ErrorsFound = true;
1810 : }
1811 : // FractionConvected is a calculated field
1812 2 : thisZoneGas.FractionConvected = 1.0 - (thisZoneGas.FractionLatent + thisZoneGas.FractionRadiant + thisZoneGas.FractionLost);
1813 2 : if (std::abs(thisZoneGas.FractionConvected) <= 0.001) thisZoneGas.FractionConvected = 0.0;
1814 2 : if (thisZoneGas.FractionConvected < 0.0) {
1815 0 : if (Item1 == 1) {
1816 0 : ShowSevereError(state,
1817 0 : format("{}{}=\"{}\", Sum of Fractions > 1.0", RoutineName, gasEqModuleObject, thisGasEqInput.Name));
1818 0 : ErrorsFound = true;
1819 : }
1820 : }
1821 :
1822 2 : if (IHGNumAlphas > 4) {
1823 0 : thisZoneGas.EndUseSubcategory = IHGAlphas(5);
1824 : } else {
1825 2 : thisZoneGas.EndUseSubcategory = "General";
1826 : }
1827 :
1828 2 : if (state.dataGlobal->AnyEnergyManagementSystemInModel) {
1829 0 : SetupEMSActuator(state,
1830 : "GasEquipment",
1831 : thisZoneGas.Name,
1832 : "NaturalGas Rate",
1833 : "[W]",
1834 0 : thisZoneGas.EMSZoneEquipOverrideOn,
1835 0 : thisZoneGas.EMSEquipPower);
1836 0 : SetupEMSInternalVariable(state, "Gas Process Power Design Level", thisZoneGas.Name, "[W]", thisZoneGas.DesignLevel);
1837 : } // EMS
1838 :
1839 2 : if (!ErrorsFound)
1840 2 : SetupSpaceInternalGain(state,
1841 : thisZoneGas.spaceIndex,
1842 : 1.0,
1843 : thisZoneGas.Name,
1844 : DataHeatBalance::IntGainType::GasEquipment,
1845 : &thisZoneGas.ConGainRate,
1846 : nullptr,
1847 : &thisZoneGas.RadGainRate,
1848 : &thisZoneGas.LatGainRate,
1849 : nullptr,
1850 : &thisZoneGas.CO2GainRate);
1851 :
1852 : } // for gasEqInputNum.NumOfSpaces
1853 : } // for gasEqInputNum
1854 : } // TotGasEquip > 0
1855 :
1856 : // HotWaterEquipment
1857 342 : EPVector<InternalHeatGains::GlobalInternalGainMiscObject> hotWaterEqObjects;
1858 171 : int numHotWaterEqStatements = 0;
1859 171 : setupIHGZonesAndSpaces(state, hwEqModuleObject, hotWaterEqObjects, numHotWaterEqStatements, state.dataHeatBal->TotHWEquip, ErrorsFound);
1860 :
1861 171 : if (state.dataHeatBal->TotHWEquip > 0) {
1862 1 : state.dataHeatBal->ZoneHWEq.allocate(state.dataHeatBal->TotHWEquip);
1863 1 : int hwEqNum = 0;
1864 2 : for (int hwEqInputNum = 1; hwEqInputNum <= numHotWaterEqStatements; ++hwEqInputNum) {
1865 :
1866 1 : state.dataInputProcessing->inputProcessor->getObjectItem(state,
1867 : hwEqModuleObject,
1868 : hwEqInputNum,
1869 : IHGAlphas,
1870 : IHGNumAlphas,
1871 : IHGNumbers,
1872 : IHGNumNumbers,
1873 : IOStat,
1874 : IHGNumericFieldBlanks,
1875 : IHGAlphaFieldBlanks,
1876 : IHGAlphaFieldNames,
1877 : IHGNumericFieldNames);
1878 :
1879 1 : ErrorObjectHeader eoh{routineName, hwEqModuleObject, IHGAlphas(1)};
1880 :
1881 1 : auto &thisHWEqInput = hotWaterEqObjects(hwEqInputNum);
1882 3 : for (int Item1 = 1; Item1 <= thisHWEqInput.numOfSpaces; ++Item1) {
1883 2 : ++hwEqNum;
1884 2 : auto &thisZoneHWEq = state.dataHeatBal->ZoneHWEq(hwEqNum);
1885 2 : int const spaceNum = thisHWEqInput.spaceNums(Item1);
1886 2 : int const zoneNum = state.dataHeatBal->space(spaceNum).zoneNum;
1887 2 : thisZoneHWEq.Name = thisHWEqInput.names(Item1);
1888 2 : thisZoneHWEq.spaceIndex = spaceNum;
1889 2 : thisZoneHWEq.ZonePtr = zoneNum;
1890 :
1891 2 : if (IHGAlphaFieldBlanks(3)) {
1892 0 : ShowSevereEmptyField(state, eoh, IHGAlphaFieldNames(3));
1893 0 : ErrorsFound = true;
1894 2 : } else if ((thisZoneHWEq.sched = Sched::GetSchedule(state, IHGAlphas(3))) == nullptr) {
1895 0 : ShowSevereItemNotFound(state, eoh, IHGAlphaFieldNames(3), IHGAlphas(3));
1896 0 : ErrorsFound = true;
1897 2 : } else if (!thisZoneHWEq.sched->checkMinVal(state, Clusive::In, 0.0)) {
1898 0 : Sched::ShowSevereBadMin(state, eoh, IHGAlphaFieldNames(3), IHGAlphas(3), Clusive::In, 0.0);
1899 0 : ErrorsFound = true;
1900 : }
1901 :
1902 : // Hot Water equipment design level calculation method.
1903 : {
1904 2 : std::string const &equipmentLevel = IHGAlphas(4);
1905 2 : if (equipmentLevel == "EQUIPMENTLEVEL") {
1906 2 : Real64 spaceFrac = 1.0;
1907 2 : if (thisHWEqInput.numOfSpaces > 1) {
1908 2 : Real64 const zoneArea = state.dataHeatBal->Zone(zoneNum).FloorArea;
1909 2 : if (zoneArea > 0.0) {
1910 2 : spaceFrac = state.dataHeatBal->space(spaceNum).FloorArea / zoneArea;
1911 : } else {
1912 0 : ShowSevereError(
1913 0 : state, format("{}Zone floor area is zero when allocating HotWaterEquipment loads to Spaces.", RoutineName));
1914 0 : ShowContinueError(state,
1915 0 : format("Occurs for HotWaterEquipment object ={} in Zone={}",
1916 0 : thisHWEqInput.Name,
1917 0 : state.dataHeatBal->Zone(zoneNum).Name));
1918 0 : ErrorsFound = true;
1919 : }
1920 : }
1921 2 : thisZoneHWEq.DesignLevel = IHGNumbers(1) * spaceFrac;
1922 2 : if (IHGNumericFieldBlanks(1)) {
1923 0 : ShowWarningError(state,
1924 0 : format("{}{}=\"{}\", specifies {}, but that field is blank. 0 Hot Water Equipment will result.",
1925 : RoutineName,
1926 : hwEqModuleObject,
1927 0 : thisHWEqInput.Name,
1928 : IHGNumericFieldNames(1)));
1929 : }
1930 0 : } else if (equipmentLevel == "WATTS/AREA" || equipmentLevel == "POWER/AREA") {
1931 0 : if (spaceNum != 0) {
1932 0 : if (IHGNumbers(2) >= 0.0) {
1933 0 : thisZoneHWEq.DesignLevel = IHGNumbers(2) * state.dataHeatBal->space(spaceNum).FloorArea;
1934 0 : if ((state.dataHeatBal->space(spaceNum).FloorArea <= 0.0) &&
1935 0 : !state.dataHeatBal->space(spaceNum).isRemainderSpace) {
1936 0 : ShowWarningError(
1937 : state,
1938 0 : format("{}{}=\"{}\", specifies {}, but Space Floor Area = 0. 0 Hot Water Equipment will result.",
1939 : RoutineName,
1940 : hwEqModuleObject,
1941 0 : thisZoneHWEq.Name,
1942 : IHGNumericFieldNames(2)));
1943 : }
1944 : } else {
1945 0 : ShowSevereError(state,
1946 0 : format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}",
1947 : RoutineName,
1948 : hwEqModuleObject,
1949 0 : thisHWEqInput.Name,
1950 : IHGNumericFieldNames(2),
1951 : IHGNumbers(2)));
1952 0 : ErrorsFound = true;
1953 : }
1954 : }
1955 0 : if (IHGNumericFieldBlanks(2)) {
1956 0 : ShowWarningError(state,
1957 0 : format("{}{}=\"{}\", specifies {}, but that field is blank. 0 Hot Water Equipment will result.",
1958 : RoutineName,
1959 : hwEqModuleObject,
1960 0 : thisHWEqInput.Name,
1961 : IHGNumericFieldNames(2)));
1962 : }
1963 :
1964 0 : } else if (equipmentLevel == "WATTS/PERSON" || equipmentLevel == "POWER/PERSON") {
1965 0 : if (spaceNum != 0) {
1966 0 : if (IHGNumbers(3) >= 0.0) {
1967 0 : thisZoneHWEq.DesignLevel = IHGNumbers(3) * state.dataHeatBal->space(spaceNum).TotOccupants;
1968 0 : if (state.dataHeatBal->space(spaceNum).TotOccupants <= 0.0) {
1969 0 : ShowWarningError(
1970 : state,
1971 0 : format("{}{}=\"{}\", specifies {}, but Total Occupants = 0. 0 Hot Water Equipment will result.",
1972 : RoutineName,
1973 : hwEqModuleObject,
1974 0 : thisZoneHWEq.Name,
1975 : IHGNumericFieldNames(2)));
1976 : }
1977 : } else {
1978 0 : ShowSevereError(state,
1979 0 : format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}",
1980 : RoutineName,
1981 : hwEqModuleObject,
1982 0 : thisHWEqInput.Name,
1983 : IHGNumericFieldNames(3),
1984 : IHGNumbers(3)));
1985 0 : ErrorsFound = true;
1986 : }
1987 : }
1988 0 : if (IHGNumericFieldBlanks(3)) {
1989 0 : ShowWarningError(state,
1990 0 : format("{}{}=\"{}\", specifies {}, but that field is blank. 0 Hot Water Equipment will result.",
1991 : RoutineName,
1992 : hwEqModuleObject,
1993 0 : thisHWEqInput.Name,
1994 : IHGNumericFieldNames(3)));
1995 : }
1996 :
1997 : } else {
1998 0 : if (Item1 == 1) {
1999 0 : ShowSevereError(state,
2000 0 : format("{}{}=\"{}\", invalid {}, value ={}",
2001 : RoutineName,
2002 : hwEqModuleObject,
2003 0 : thisHWEqInput.Name,
2004 : IHGAlphaFieldNames(4),
2005 : IHGAlphas(4)));
2006 0 : ShowContinueError(state, "...Valid values are \"EquipmentLevel\", \"Watts/Area\", \"Watts/Person\".");
2007 0 : ErrorsFound = true;
2008 : }
2009 : }
2010 : }
2011 :
2012 : // Calculate nominal min/max equipment level
2013 2 : thisZoneHWEq.NomMinDesignLevel = thisZoneHWEq.DesignLevel * thisZoneHWEq.sched->getMinVal(state);
2014 2 : thisZoneHWEq.NomMaxDesignLevel = thisZoneHWEq.DesignLevel * thisZoneHWEq.sched->getMaxVal(state);
2015 :
2016 2 : thisZoneHWEq.FractionLatent = IHGNumbers(4);
2017 2 : thisZoneHWEq.FractionRadiant = IHGNumbers(5);
2018 2 : thisZoneHWEq.FractionLost = IHGNumbers(6);
2019 : // FractionConvected is a calculated field
2020 2 : thisZoneHWEq.FractionConvected = 1.0 - (thisZoneHWEq.FractionLatent + thisZoneHWEq.FractionRadiant + thisZoneHWEq.FractionLost);
2021 2 : if (std::abs(thisZoneHWEq.FractionConvected) <= 0.001) thisZoneHWEq.FractionConvected = 0.0;
2022 2 : if (thisZoneHWEq.FractionConvected < 0.0) {
2023 0 : ShowSevereError(state, format("{}{}=\"{}\", Sum of Fractions > 1.0", RoutineName, hwEqModuleObject, thisHWEqInput.Name));
2024 0 : ErrorsFound = true;
2025 : }
2026 :
2027 2 : if (IHGNumAlphas > 4) {
2028 0 : thisZoneHWEq.EndUseSubcategory = IHGAlphas(5);
2029 : } else {
2030 2 : thisZoneHWEq.EndUseSubcategory = "General";
2031 : }
2032 :
2033 2 : if (state.dataGlobal->AnyEnergyManagementSystemInModel) {
2034 0 : SetupEMSActuator(state,
2035 : "HotWaterEquipment",
2036 : thisZoneHWEq.Name,
2037 : "District Heating Power Level",
2038 : "[W]",
2039 0 : thisZoneHWEq.EMSZoneEquipOverrideOn,
2040 0 : thisZoneHWEq.EMSEquipPower);
2041 0 : SetupEMSInternalVariable(state, "Process District Heat Design Level", thisZoneHWEq.Name, "[W]", thisZoneHWEq.DesignLevel);
2042 : } // EMS
2043 :
2044 2 : if (!ErrorsFound)
2045 2 : SetupSpaceInternalGain(state,
2046 : thisZoneHWEq.spaceIndex,
2047 : 1.0,
2048 : thisZoneHWEq.Name,
2049 : DataHeatBalance::IntGainType::HotWaterEquipment,
2050 : &thisZoneHWEq.ConGainRate,
2051 : nullptr,
2052 : &thisZoneHWEq.RadGainRate,
2053 : &thisZoneHWEq.LatGainRate);
2054 :
2055 : } // for hwEqInputNum.NumOfSpaces
2056 : } // for hwEqInputNum
2057 : } // TotHWEquip > 0
2058 :
2059 : // SteamEquipment
2060 342 : EPVector<InternalHeatGains::GlobalInternalGainMiscObject> steamEqObjects;
2061 171 : int numSteamEqStatements = 0;
2062 171 : setupIHGZonesAndSpaces(state, stmEqModuleObject, steamEqObjects, numSteamEqStatements, state.dataHeatBal->TotStmEquip, ErrorsFound);
2063 :
2064 171 : if (state.dataHeatBal->TotStmEquip > 0) {
2065 1 : state.dataHeatBal->ZoneSteamEq.allocate(state.dataHeatBal->TotStmEquip);
2066 1 : int stmEqNum = 0;
2067 2 : for (int stmEqInputNum = 1; stmEqInputNum <= numSteamEqStatements; ++stmEqInputNum) {
2068 1 : state.dataInputProcessing->inputProcessor->getObjectItem(state,
2069 : stmEqModuleObject,
2070 : stmEqInputNum,
2071 : IHGAlphas,
2072 : IHGNumAlphas,
2073 : IHGNumbers,
2074 : IHGNumNumbers,
2075 : IOStat,
2076 : IHGNumericFieldBlanks,
2077 : IHGAlphaFieldBlanks,
2078 : IHGAlphaFieldNames,
2079 : IHGNumericFieldNames);
2080 :
2081 1 : ErrorObjectHeader eoh{routineName, stmEqModuleObject, IHGAlphas(1)};
2082 :
2083 1 : auto &thisStmEqInput = steamEqObjects(stmEqInputNum);
2084 3 : for (int Item1 = 1; Item1 <= thisStmEqInput.numOfSpaces; ++Item1) {
2085 2 : ++stmEqNum;
2086 2 : auto &thisZoneStmEq = state.dataHeatBal->ZoneSteamEq(stmEqNum);
2087 2 : int const spaceNum = thisStmEqInput.spaceNums(Item1);
2088 2 : int const zoneNum = state.dataHeatBal->space(spaceNum).zoneNum;
2089 2 : thisZoneStmEq.Name = thisStmEqInput.names(Item1);
2090 2 : thisZoneStmEq.spaceIndex = spaceNum;
2091 2 : thisZoneStmEq.ZonePtr = zoneNum;
2092 :
2093 2 : if (IHGAlphaFieldBlanks(3)) {
2094 0 : ShowSevereEmptyField(state, eoh, IHGAlphaFieldNames(3));
2095 0 : ErrorsFound = true;
2096 2 : } else if ((thisZoneStmEq.sched = Sched::GetSchedule(state, IHGAlphas(3))) == nullptr) {
2097 0 : ShowSevereItemNotFound(state, eoh, IHGAlphaFieldNames(3), IHGAlphas(3));
2098 0 : ErrorsFound = true;
2099 2 : } else if (!thisZoneStmEq.sched->checkMinVal(state, Clusive::In, 0.0)) {
2100 0 : Sched::ShowSevereBadMin(state, eoh, IHGAlphaFieldNames(3), IHGAlphas(3), Clusive::In, 0.0);
2101 0 : ErrorsFound = true;
2102 : }
2103 :
2104 : // Steam equipment design level calculation method.
2105 : {
2106 2 : std::string const &equipmentLevel = IHGAlphas(4);
2107 2 : if (equipmentLevel == "EQUIPMENTLEVEL") {
2108 2 : Real64 spaceFrac = 1.0;
2109 2 : if (thisStmEqInput.numOfSpaces > 1) {
2110 2 : Real64 const zoneArea = state.dataHeatBal->Zone(zoneNum).FloorArea;
2111 2 : if (zoneArea > 0.0) {
2112 2 : spaceFrac = state.dataHeatBal->space(spaceNum).FloorArea / zoneArea;
2113 : } else {
2114 0 : ShowSevereError(state,
2115 0 : format("{}Zone floor area is zero when allocating SteamEquipment loads to Spaces.", RoutineName));
2116 0 : ShowContinueError(state,
2117 0 : format("Occurs for SteamEquipment object ={} in Zone={}",
2118 0 : thisStmEqInput.Name,
2119 0 : state.dataHeatBal->Zone(zoneNum).Name));
2120 0 : ErrorsFound = true;
2121 : }
2122 : }
2123 2 : thisZoneStmEq.DesignLevel = IHGNumbers(1) * spaceFrac;
2124 2 : if (IHGNumericFieldBlanks(1)) {
2125 0 : ShowWarningError(state,
2126 0 : format("{}{}=\"{}\", specifies {}, but that field is blank. 0 Steam Equipment will result.",
2127 : RoutineName,
2128 : hwEqModuleObject,
2129 0 : thisStmEqInput.Name,
2130 : IHGNumericFieldNames(1)));
2131 : }
2132 0 : } else if (equipmentLevel == "WATTS/AREA" || equipmentLevel == "POWER/AREA") {
2133 0 : if (spaceNum > 0) {
2134 0 : if (IHGNumbers(2) >= 0.0) {
2135 0 : thisZoneStmEq.DesignLevel = IHGNumbers(2) * state.dataHeatBal->space(spaceNum).FloorArea;
2136 0 : if ((state.dataHeatBal->space(spaceNum).FloorArea <= 0.0) &&
2137 0 : !state.dataHeatBal->space(spaceNum).isRemainderSpace) {
2138 0 : ShowWarningError(
2139 : state,
2140 0 : format("{}{}=\"{}\", specifies {}, but Space Floor Area = 0. 0 Steam Equipment will result.",
2141 : RoutineName,
2142 : stmEqModuleObject,
2143 0 : thisZoneStmEq.Name,
2144 : IHGNumericFieldNames(2)));
2145 : }
2146 : } else {
2147 0 : ShowSevereError(state,
2148 0 : format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}",
2149 : RoutineName,
2150 : stmEqModuleObject,
2151 : IHGAlphas(1),
2152 : IHGNumericFieldNames(2),
2153 : IHGNumbers(2)));
2154 0 : ErrorsFound = true;
2155 : }
2156 : }
2157 0 : if (IHGNumericFieldBlanks(2)) {
2158 0 : ShowWarningError(state,
2159 0 : format("{}{}=\"{}\", specifies {}, but that field is blank. 0 Steam Equipment will result.",
2160 : RoutineName,
2161 : stmEqModuleObject,
2162 0 : thisStmEqInput.Name,
2163 : IHGNumericFieldNames(2)));
2164 : }
2165 :
2166 0 : } else if (equipmentLevel == "WATTS/PERSON" || equipmentLevel == "POWER/PERSON") {
2167 0 : if (spaceNum != 0) {
2168 0 : if (IHGNumbers(3) >= 0.0) {
2169 0 : thisZoneStmEq.DesignLevel = IHGNumbers(3) * state.dataHeatBal->space(spaceNum).TotOccupants;
2170 0 : if (state.dataHeatBal->space(spaceNum).TotOccupants <= 0.0) {
2171 0 : ShowWarningError(state,
2172 0 : format("{}{}=\"{}\", specifies {}, but Total Occupants = 0. 0 Steam Equipment will result.",
2173 : RoutineName,
2174 : stmEqModuleObject,
2175 0 : thisZoneStmEq.Name,
2176 : IHGNumericFieldNames(2)));
2177 : }
2178 : } else {
2179 0 : ShowSevereError(state,
2180 0 : format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}",
2181 : RoutineName,
2182 : stmEqModuleObject,
2183 : IHGAlphas(1),
2184 : IHGNumericFieldNames(3),
2185 : IHGNumbers(3)));
2186 0 : ErrorsFound = true;
2187 : }
2188 : }
2189 0 : if (IHGNumericFieldBlanks(3)) {
2190 0 : ShowWarningError(state,
2191 0 : format("{}{}=\"{}\", specifies {}, but that field is blank. 0 Steam Equipment will result.",
2192 : RoutineName,
2193 : stmEqModuleObject,
2194 : IHGAlphas(1),
2195 : IHGNumericFieldNames(3)));
2196 : }
2197 :
2198 : } else {
2199 0 : if (Item1 == 1) {
2200 0 : ShowSevereError(state,
2201 0 : format("{}{}=\"{}\", invalid {}, value ={}",
2202 : RoutineName,
2203 : stmEqModuleObject,
2204 : IHGAlphas(1),
2205 : IHGAlphaFieldNames(4),
2206 : IHGAlphas(4)));
2207 0 : ShowContinueError(state, "...Valid values are \"EquipmentLevel\", \"Watts/Area\", \"Watts/Person\".");
2208 0 : ErrorsFound = true;
2209 : }
2210 : }
2211 : }
2212 :
2213 : // Calculate nominal min/max equipment level
2214 2 : thisZoneStmEq.NomMinDesignLevel = thisZoneStmEq.DesignLevel * thisZoneStmEq.sched->getMinVal(state);
2215 2 : thisZoneStmEq.NomMaxDesignLevel = thisZoneStmEq.DesignLevel * thisZoneStmEq.sched->getMaxVal(state);
2216 :
2217 2 : thisZoneStmEq.FractionLatent = IHGNumbers(4);
2218 2 : thisZoneStmEq.FractionRadiant = IHGNumbers(5);
2219 2 : thisZoneStmEq.FractionLost = IHGNumbers(6);
2220 : // FractionConvected is a calculated field
2221 2 : thisZoneStmEq.FractionConvected =
2222 2 : 1.0 - (thisZoneStmEq.FractionLatent + thisZoneStmEq.FractionRadiant + thisZoneStmEq.FractionLost);
2223 2 : if (std::abs(thisZoneStmEq.FractionConvected) <= 0.001) thisZoneStmEq.FractionConvected = 0.0;
2224 2 : if (thisZoneStmEq.FractionConvected < 0.0) {
2225 0 : ShowSevereError(state, format("{}{}=\"{}\", Sum of Fractions > 1.0", RoutineName, stmEqModuleObject, IHGAlphas(1)));
2226 0 : ErrorsFound = true;
2227 : }
2228 :
2229 2 : if (IHGNumAlphas > 4) {
2230 0 : thisZoneStmEq.EndUseSubcategory = IHGAlphas(5);
2231 : } else {
2232 2 : thisZoneStmEq.EndUseSubcategory = "General";
2233 : }
2234 :
2235 2 : if (thisZoneStmEq.ZonePtr <= 0) continue; // Error, will be caught and terminated later
2236 :
2237 2 : if (state.dataGlobal->AnyEnergyManagementSystemInModel) {
2238 0 : SetupEMSActuator(state,
2239 : "SteamEquipment",
2240 : thisZoneStmEq.Name,
2241 : "District Heating Power Level",
2242 : "[W]",
2243 0 : thisZoneStmEq.EMSZoneEquipOverrideOn,
2244 0 : thisZoneStmEq.EMSEquipPower);
2245 0 : SetupEMSInternalVariable(
2246 0 : state, "Process Steam District Heat Design Level", thisZoneStmEq.Name, "[W]", thisZoneStmEq.DesignLevel);
2247 : } // EMS
2248 :
2249 2 : if (!ErrorsFound)
2250 2 : SetupSpaceInternalGain(state,
2251 : thisZoneStmEq.spaceIndex,
2252 : 1.0,
2253 : thisZoneStmEq.Name,
2254 : DataHeatBalance::IntGainType::SteamEquipment,
2255 : &thisZoneStmEq.ConGainRate,
2256 : nullptr,
2257 : &thisZoneStmEq.RadGainRate,
2258 : &thisZoneStmEq.LatGainRate);
2259 :
2260 : } // for stmEqInputNum.NumOfSpaces
2261 : } // for stmEqInputNum
2262 : } // TotStmEquip > 0
2263 :
2264 : // OtherEquipment
2265 342 : EPVector<InternalHeatGains::GlobalInternalGainMiscObject> otherEqObjects;
2266 171 : int numOtherEqStatements = 0;
2267 171 : setupIHGZonesAndSpaces(state, othEqModuleObject, otherEqObjects, numOtherEqStatements, state.dataHeatBal->TotOthEquip, ErrorsFound);
2268 :
2269 171 : if (state.dataHeatBal->TotOthEquip > 0) {
2270 27 : state.dataHeatBal->ZoneOtherEq.allocate(state.dataHeatBal->TotOthEquip);
2271 27 : int othEqNum = 0;
2272 79 : for (int othEqInputNum = 1; othEqInputNum <= numOtherEqStatements; ++othEqInputNum) {
2273 :
2274 52 : state.dataInputProcessing->inputProcessor->getObjectItem(state,
2275 : othEqModuleObject,
2276 : othEqInputNum,
2277 : IHGAlphas,
2278 : IHGNumAlphas,
2279 : IHGNumbers,
2280 : IHGNumNumbers,
2281 : IOStat,
2282 : IHGNumericFieldBlanks,
2283 : IHGAlphaFieldBlanks,
2284 : IHGAlphaFieldNames,
2285 : IHGNumericFieldNames);
2286 :
2287 52 : ErrorObjectHeader eoh{routineName, othEqModuleObject, IHGAlphas(1)};
2288 :
2289 52 : auto &thisOthEqInput = otherEqObjects(othEqInputNum);
2290 106 : for (int Item1 = 1; Item1 <= thisOthEqInput.numOfSpaces; ++Item1) {
2291 54 : ++othEqNum;
2292 54 : auto &thisZoneOthEq = state.dataHeatBal->ZoneOtherEq(othEqNum);
2293 54 : int const spaceNum = thisOthEqInput.spaceNums(Item1);
2294 54 : int const zoneNum = state.dataHeatBal->space(spaceNum).zoneNum;
2295 54 : thisZoneOthEq.Name = thisOthEqInput.names(Item1);
2296 54 : thisZoneOthEq.spaceIndex = spaceNum;
2297 54 : thisZoneOthEq.ZonePtr = zoneNum;
2298 :
2299 54 : if (IHGAlphas(2) == "NONE") {
2300 47 : thisZoneOthEq.OtherEquipFuelType = Constant::eFuel::None;
2301 : } else {
2302 7 : thisZoneOthEq.OtherEquipFuelType = static_cast<Constant::eFuel>(getEnumValue(Constant::eFuelNamesUC, IHGAlphas(2)));
2303 7 : if (thisZoneOthEq.OtherEquipFuelType == Constant::eFuel::Invalid ||
2304 7 : thisZoneOthEq.OtherEquipFuelType == Constant::eFuel::Water) {
2305 2 : ShowSevereError(state,
2306 2 : format("{}{}: invalid {} entered={} for {}={}",
2307 : RoutineName,
2308 : othEqModuleObject,
2309 : IHGAlphaFieldNames(2),
2310 : IHGAlphas(2),
2311 : IHGAlphaFieldNames(1),
2312 1 : thisOthEqInput.Name));
2313 1 : ErrorsFound = true;
2314 : }
2315 :
2316 : // Build list of fuel types used in each zone and space (excluding Water)
2317 :
2318 7 : bool found = false;
2319 9 : for (Constant::eFuel fuelType : state.dataHeatBal->Zone(zoneNum).otherEquipFuelTypeNums) {
2320 4 : if (thisZoneOthEq.OtherEquipFuelType == fuelType) {
2321 2 : found = true;
2322 2 : break;
2323 : }
2324 : }
2325 7 : if (!found) {
2326 5 : state.dataHeatBal->Zone(zoneNum).otherEquipFuelTypeNums.emplace_back(thisZoneOthEq.OtherEquipFuelType);
2327 : // state.dataHeatBal->Zone(zoneNum).otherEquipFuelTypeNames.emplace_back(FuelTypeString);
2328 : }
2329 7 : found = false;
2330 9 : for (Constant::eFuel fuelType : state.dataHeatBal->space(spaceNum).otherEquipFuelTypeNums) {
2331 2 : if (thisZoneOthEq.OtherEquipFuelType == fuelType) {
2332 0 : found = true;
2333 0 : break;
2334 : }
2335 : }
2336 7 : if (!found) {
2337 7 : state.dataHeatBal->space(spaceNum).otherEquipFuelTypeNums.emplace_back(thisZoneOthEq.OtherEquipFuelType);
2338 : // state.dataHeatBal->space(spaceNum).otherEquipFuelTypeNames.emplace_back(FuelTypeString);
2339 : }
2340 : }
2341 :
2342 54 : if (IHGAlphaFieldBlanks(4)) {
2343 0 : ShowSevereEmptyField(state, eoh, IHGAlphaFieldNames(4));
2344 0 : ErrorsFound = true;
2345 54 : } else if ((thisZoneOthEq.sched = Sched::GetSchedule(state, IHGAlphas(4))) == nullptr) {
2346 0 : ShowSevereItemNotFound(state, eoh, IHGAlphaFieldNames(4), IHGAlphas(4));
2347 0 : ErrorsFound = true;
2348 54 : } else if (!thisZoneOthEq.sched->checkMinVal(state, Clusive::In, 0.0)) {
2349 0 : Sched::ShowSevereBadMin(state, eoh, IHGAlphaFieldNames(4), IHGAlphas(4), Clusive::In, 0.0);
2350 0 : ErrorsFound = true;
2351 : }
2352 :
2353 : // equipment design level calculation method.
2354 : unsigned int DesignLevelFieldNumber;
2355 : {
2356 54 : std::string const &equipmentLevel = IHGAlphas(5);
2357 54 : if (equipmentLevel == "EQUIPMENTLEVEL") {
2358 54 : DesignLevelFieldNumber = 1;
2359 54 : Real64 spaceFrac = 1.0;
2360 54 : if (thisOthEqInput.numOfSpaces > 1) {
2361 4 : Real64 const zoneArea = state.dataHeatBal->Zone(zoneNum).FloorArea;
2362 4 : if (zoneArea > 0.0) {
2363 4 : spaceFrac = state.dataHeatBal->space(spaceNum).FloorArea / zoneArea;
2364 : } else {
2365 0 : ShowSevereError(state,
2366 0 : format("{}Zone floor area is zero when allocating OtherEquipment loads to Spaces.", RoutineName));
2367 0 : ShowContinueError(state,
2368 0 : format("Occurs for OtherEquipment object ={} in Zone={}",
2369 0 : thisOthEqInput.Name,
2370 0 : state.dataHeatBal->Zone(zoneNum).Name));
2371 0 : ErrorsFound = true;
2372 : }
2373 : }
2374 54 : thisZoneOthEq.DesignLevel = IHGNumbers(1) * spaceFrac;
2375 54 : if (IHGNumericFieldBlanks(DesignLevelFieldNumber)) {
2376 0 : ShowWarningError(state,
2377 0 : format("{}{}=\"{}\", specifies {}, but that field is blank. 0 Other Equipment will result.",
2378 : RoutineName,
2379 : othEqModuleObject,
2380 0 : thisOthEqInput.Name,
2381 : IHGNumericFieldNames(DesignLevelFieldNumber)));
2382 : }
2383 :
2384 0 : } else if (equipmentLevel == "WATTS/AREA" || equipmentLevel == "POWER/AREA") {
2385 0 : DesignLevelFieldNumber = 2;
2386 0 : if (spaceNum > 0) {
2387 0 : thisZoneOthEq.DesignLevel = IHGNumbers(DesignLevelFieldNumber) * state.dataHeatBal->space(spaceNum).FloorArea;
2388 0 : if ((state.dataHeatBal->space(spaceNum).FloorArea <= 0.0) && !state.dataHeatBal->space(spaceNum).isRemainderSpace) {
2389 0 : ShowWarningError(state,
2390 0 : format("{}{}=\"{}\", specifies {}, but Space Floor Area = 0. 0 Other Equipment will result.",
2391 : RoutineName,
2392 : othEqModuleObject,
2393 0 : thisZoneOthEq.Name,
2394 : IHGNumericFieldNames(DesignLevelFieldNumber)));
2395 : }
2396 : }
2397 0 : if (IHGNumericFieldBlanks(DesignLevelFieldNumber)) {
2398 0 : ShowWarningError(state,
2399 0 : format("{}{}=\"{}\", specifies {}, but that field is blank. 0 Other Equipment will result.",
2400 : RoutineName,
2401 : othEqModuleObject,
2402 : IHGAlphas(1),
2403 : IHGNumericFieldNames(DesignLevelFieldNumber)));
2404 : }
2405 :
2406 0 : } else if (equipmentLevel == "WATTS/PERSON" || equipmentLevel == "POWER/PERSON") {
2407 0 : DesignLevelFieldNumber = 3;
2408 0 : if (thisZoneOthEq.ZonePtr != 0) {
2409 0 : thisZoneOthEq.DesignLevel = IHGNumbers(3) * state.dataHeatBal->Zone(thisZoneOthEq.ZonePtr).TotOccupants;
2410 0 : if (state.dataHeatBal->Zone(thisZoneOthEq.ZonePtr).TotOccupants <= 0.0) {
2411 0 : ShowWarningError(state,
2412 0 : format("{}{}=\"{}\", specifies {}, but Total Occupants = 0. 0 Other Equipment will result.",
2413 : RoutineName,
2414 : othEqModuleObject,
2415 0 : thisZoneOthEq.Name,
2416 : IHGNumericFieldNames(DesignLevelFieldNumber)));
2417 : }
2418 : }
2419 0 : if (IHGNumericFieldBlanks(DesignLevelFieldNumber)) {
2420 0 : ShowWarningError(state,
2421 0 : format("{}{}=\"{}\", specifies {}, but that field is blank. 0 Other Equipment will result.",
2422 : RoutineName,
2423 : othEqModuleObject,
2424 0 : thisOthEqInput.Name,
2425 : IHGNumericFieldNames(DesignLevelFieldNumber)));
2426 : }
2427 :
2428 : } else {
2429 0 : if (Item1 == 1) {
2430 0 : ShowSevereError(state,
2431 0 : format("{}{}=\"{}\", invalid {}, value ={}",
2432 : RoutineName,
2433 : othEqModuleObject,
2434 0 : thisOthEqInput.Name,
2435 : IHGAlphaFieldNames(5),
2436 : IHGAlphas(5)));
2437 0 : ShowContinueError(state, "...Valid values are \"EquipmentLevel\", \"Watts/Area\", \"Watts/Person\".");
2438 0 : ErrorsFound = true;
2439 : }
2440 : }
2441 : }
2442 :
2443 : // Throw an error if the design level is negative and we have a fuel type
2444 54 : if (thisZoneOthEq.DesignLevel < 0.0 && thisZoneOthEq.OtherEquipFuelType != Constant::eFuel::Invalid &&
2445 24 : thisZoneOthEq.OtherEquipFuelType != Constant::eFuel::None) {
2446 2 : ShowSevereError(state,
2447 3 : format("{}{}=\"{}\", {} is not allowed to be negative",
2448 : RoutineName,
2449 : othEqModuleObject,
2450 1 : thisOthEqInput.Name,
2451 : IHGNumericFieldNames(DesignLevelFieldNumber)));
2452 2 : ShowContinueError(
2453 2 : state, format("... when a fuel type of {} is specified.", Constant::eFuelNames[(int)thisZoneOthEq.OtherEquipFuelType]));
2454 1 : ErrorsFound = true;
2455 : }
2456 :
2457 : // Calculate nominal min/max equipment level
2458 54 : thisZoneOthEq.NomMinDesignLevel = thisZoneOthEq.DesignLevel * thisZoneOthEq.sched->getMinVal(state);
2459 54 : thisZoneOthEq.NomMaxDesignLevel = thisZoneOthEq.DesignLevel * thisZoneOthEq.sched->getMaxVal(state);
2460 :
2461 54 : thisZoneOthEq.FractionLatent = IHGNumbers(4);
2462 54 : thisZoneOthEq.FractionRadiant = IHGNumbers(5);
2463 54 : thisZoneOthEq.FractionLost = IHGNumbers(6);
2464 :
2465 54 : if ((IHGNumNumbers == 7) || (!IHGNumericFieldBlanks(7))) {
2466 4 : thisZoneOthEq.CO2RateFactor = IHGNumbers(7);
2467 : }
2468 54 : if (thisZoneOthEq.CO2RateFactor < 0.0) {
2469 0 : ShowSevereError(state,
2470 0 : format("{}{}=\"{}\", {} < 0.0, value ={:.2R}",
2471 : RoutineName,
2472 : othEqModuleObject,
2473 0 : thisOthEqInput.Name,
2474 : IHGNumericFieldNames(7),
2475 : IHGNumbers(7)));
2476 0 : ErrorsFound = true;
2477 : }
2478 54 : if (thisZoneOthEq.CO2RateFactor > 4.0e-7) {
2479 0 : ShowSevereError(state,
2480 0 : format("{}{}=\"{}\", {} > 4.0E-7, value ={:.2R}",
2481 : RoutineName,
2482 : othEqModuleObject,
2483 0 : thisOthEqInput.Name,
2484 : IHGNumericFieldNames(7),
2485 : IHGNumbers(7)));
2486 0 : ErrorsFound = true;
2487 : }
2488 :
2489 : // FractionConvected is a calculated field
2490 54 : thisZoneOthEq.FractionConvected =
2491 54 : 1.0 - (thisZoneOthEq.FractionLatent + thisZoneOthEq.FractionRadiant + thisZoneOthEq.FractionLost);
2492 54 : if (std::abs(thisZoneOthEq.FractionConvected) <= 0.001) thisZoneOthEq.FractionConvected = 0.0;
2493 54 : if (thisZoneOthEq.FractionConvected < 0.0) {
2494 0 : ShowSevereError(state, format("{}{}=\"{}\", Sum of Fractions > 1.0", RoutineName, othEqModuleObject, thisOthEqInput.Name));
2495 0 : ErrorsFound = true;
2496 : }
2497 :
2498 54 : if (IHGNumAlphas > 5) {
2499 0 : thisZoneOthEq.EndUseSubcategory = IHGAlphas(6);
2500 : } else {
2501 54 : thisZoneOthEq.EndUseSubcategory = "General";
2502 : }
2503 :
2504 54 : if (state.dataGlobal->AnyEnergyManagementSystemInModel) {
2505 40 : SetupEMSActuator(state,
2506 : "OtherEquipment",
2507 : thisZoneOthEq.Name,
2508 : "Power Level",
2509 : "[W]",
2510 40 : thisZoneOthEq.EMSZoneEquipOverrideOn,
2511 40 : thisZoneOthEq.EMSEquipPower);
2512 40 : SetupEMSInternalVariable(state, "Other Equipment Design Level", thisZoneOthEq.Name, "[W]", thisZoneOthEq.DesignLevel);
2513 : } // EMS
2514 :
2515 54 : if (!ErrorsFound)
2516 52 : SetupSpaceInternalGain(state,
2517 : thisZoneOthEq.spaceIndex,
2518 : 1.0,
2519 : thisZoneOthEq.Name,
2520 : DataHeatBalance::IntGainType::OtherEquipment,
2521 : &thisZoneOthEq.ConGainRate,
2522 : nullptr,
2523 : &thisZoneOthEq.RadGainRate,
2524 : &thisZoneOthEq.LatGainRate);
2525 :
2526 : } // for othEqInputNum.NumOfSpaces
2527 : } // for othEqInputNum
2528 : } // TotOtherEquip > 0
2529 :
2530 : // ElectricEquipment:ITE:AirCooled
2531 342 : EPVector<InternalHeatGains::GlobalInternalGainMiscObject> iTEqObjects;
2532 171 : int numZoneITEqStatements = 0;
2533 : // Note that this object type does not support ZoneList due to node names in input fields
2534 171 : bool zoneListNotAllowed = true;
2535 342 : setupIHGZonesAndSpaces(
2536 171 : state, itEqModuleObject, iTEqObjects, numZoneITEqStatements, state.dataHeatBal->TotITEquip, ErrorsFound, zoneListNotAllowed);
2537 :
2538 171 : if (state.dataHeatBal->TotITEquip > 0) {
2539 14 : state.dataHeatBal->ZoneITEq.allocate(state.dataHeatBal->TotITEquip);
2540 14 : int itEqNum = 0;
2541 28 : for (int itEqInputNum = 1; itEqInputNum <= numZoneITEqStatements; ++itEqInputNum) {
2542 :
2543 14 : state.dataInputProcessing->inputProcessor->getObjectItem(state,
2544 : itEqModuleObject,
2545 : itEqInputNum,
2546 : IHGAlphas,
2547 : IHGNumAlphas,
2548 : IHGNumbers,
2549 : IHGNumNumbers,
2550 : IOStat,
2551 : IHGNumericFieldBlanks,
2552 : IHGAlphaFieldBlanks,
2553 : IHGAlphaFieldNames,
2554 : IHGNumericFieldNames);
2555 :
2556 14 : ErrorObjectHeader eoh{routineName, itEqModuleObject, IHGAlphas(1)};
2557 :
2558 14 : auto &thisITEqInput = iTEqObjects(itEqInputNum);
2559 28 : for (int Item1 = 1; Item1 <= thisITEqInput.numOfSpaces; ++Item1) {
2560 14 : ++itEqNum;
2561 14 : auto &thisZoneITEq = state.dataHeatBal->ZoneITEq(itEqNum);
2562 14 : int const spaceNum = thisITEqInput.spaceNums(Item1);
2563 14 : int const zoneNum = state.dataHeatBal->space(spaceNum).zoneNum;
2564 14 : thisZoneITEq.Name = thisITEqInput.names(Item1);
2565 14 : thisZoneITEq.spaceIndex = spaceNum;
2566 14 : thisZoneITEq.ZonePtr = zoneNum;
2567 :
2568 : // IT equipment design level calculation method.
2569 14 : if (IHGAlphaFieldBlanks(3)) {
2570 3 : thisZoneITEq.FlowControlWithApproachTemps = false;
2571 : } else {
2572 11 : if (Util::SameString(IHGAlphas(3), "FlowFromSystem")) {
2573 8 : thisZoneITEq.FlowControlWithApproachTemps = false;
2574 3 : } else if (Util::SameString(IHGAlphas(3), "FlowControlWithApproachTemperatures")) {
2575 3 : thisZoneITEq.FlowControlWithApproachTemps = true;
2576 3 : state.dataHeatBal->Zone(thisZoneITEq.ZonePtr).HasAdjustedReturnTempByITE = true;
2577 3 : state.dataHeatBal->Zone(thisZoneITEq.ZonePtr).NoHeatToReturnAir = false;
2578 : } else {
2579 0 : ShowSevereError(
2580 : state,
2581 0 : format("{}{}=\"{}\": invalid calculation method: {}", RoutineName, itEqModuleObject, IHGAlphas(1), IHGAlphas(3)));
2582 0 : ErrorsFound = true;
2583 : }
2584 : }
2585 :
2586 : {
2587 14 : std::string const &equipmentLevel = IHGAlphas(4);
2588 14 : if (equipmentLevel == "WATTS/UNIT") {
2589 14 : Real64 spaceFrac = 1.0;
2590 14 : if (thisITEqInput.numOfSpaces > 1) {
2591 0 : Real64 const zoneArea = state.dataHeatBal->Zone(zoneNum).FloorArea;
2592 0 : if (zoneArea > 0.0) {
2593 0 : spaceFrac = state.dataHeatBal->space(spaceNum).FloorArea / zoneArea;
2594 : } else {
2595 0 : ShowSevereError(
2596 : state,
2597 0 : format("{}Zone floor area is zero when allocating ElectricEquipment:ITE:AirCooled loads to Spaces.",
2598 : RoutineName));
2599 0 : ShowContinueError(state,
2600 0 : format("Occurs for ElectricEquipment:ITE:AirCooled object ={} in Zone={}",
2601 0 : thisITEqInput.Name,
2602 0 : state.dataHeatBal->Zone(zoneNum).Name));
2603 0 : ErrorsFound = true;
2604 : }
2605 : }
2606 14 : thisZoneITEq.DesignTotalPower = IHGNumbers(1) * IHGNumbers(2) * spaceFrac;
2607 14 : if (IHGNumericFieldBlanks(1)) {
2608 0 : ShowWarningError(state,
2609 0 : format("{}{}=\"{}\", specifies {}, but that field is blank. 0 IT Equipment will result.",
2610 : RoutineName,
2611 : itEqModuleObject,
2612 : IHGAlphas(1),
2613 : IHGNumericFieldNames(1)));
2614 : }
2615 14 : if (IHGNumericFieldBlanks(2)) {
2616 0 : ShowWarningError(state,
2617 0 : format("{}{}=\"{}\", specifies {}, but that field is blank. 0 IT Equipment will result.",
2618 : RoutineName,
2619 : itEqModuleObject,
2620 : IHGAlphas(1),
2621 : IHGNumericFieldNames(2)));
2622 : }
2623 :
2624 0 : } else if (equipmentLevel == "WATTS/AREA") {
2625 0 : if (thisZoneITEq.ZonePtr != 0) {
2626 0 : if (IHGNumbers(3) >= 0.0) {
2627 0 : if (spaceNum > 0) {
2628 0 : thisZoneITEq.DesignTotalPower = IHGNumbers(3) * state.dataHeatBal->space(spaceNum).FloorArea;
2629 0 : if ((state.dataHeatBal->space(spaceNum).FloorArea <= 0.0) &&
2630 0 : !state.dataHeatBal->space(spaceNum).isRemainderSpace) {
2631 0 : ShowWarningError(
2632 : state,
2633 0 : format("{}{}=\"{}\", specifies {}, but Space Floor Area = 0. 0 IT Equipment will result.",
2634 : RoutineName,
2635 : itEqModuleObject,
2636 : IHGAlphas(1),
2637 : IHGNumericFieldNames(3)));
2638 : }
2639 : } else {
2640 0 : ShowSevereError(state,
2641 0 : format("{}{}=\"{}\", invalid {}, value [<0.0]={:.3R}",
2642 : RoutineName,
2643 : itEqModuleObject,
2644 : IHGAlphas(1),
2645 : IHGNumericFieldNames(3),
2646 : IHGNumbers(3)));
2647 0 : ErrorsFound = true;
2648 : }
2649 : }
2650 0 : if (IHGNumericFieldBlanks(3)) {
2651 0 : ShowWarningError(state,
2652 0 : format("{}{}=\"{}\", specifies {}, but that field is blank. 0 IT Equipment will result.",
2653 : RoutineName,
2654 : itEqModuleObject,
2655 : IHGAlphas(1),
2656 : IHGNumericFieldNames(3)));
2657 : }
2658 :
2659 : } else {
2660 0 : ShowSevereError(state,
2661 0 : format("{}{}=\"{}\", invalid {}, value ={}",
2662 : RoutineName,
2663 : itEqModuleObject,
2664 : IHGAlphas(1),
2665 : IHGAlphaFieldNames(4),
2666 : IHGAlphas(4)));
2667 0 : ShowContinueError(state, "...Valid values are \"Watts/Unit\" or \"Watts/Area\".");
2668 0 : ErrorsFound = true;
2669 : }
2670 : }
2671 :
2672 14 : if (IHGAlphaFieldBlanks(5)) {
2673 9 : thisZoneITEq.operSched = Sched::GetScheduleAlwaysOn(state); // Not an availability schedule, but default is constant-1.0
2674 5 : } else if ((thisZoneITEq.operSched = Sched::GetSchedule(state, IHGAlphas(5))) == nullptr) {
2675 0 : ShowSevereItemNotFound(state, eoh, IHGAlphaFieldNames(5), IHGAlphas(5));
2676 0 : ErrorsFound = true;
2677 5 : } else if (!thisZoneITEq.operSched->checkMinVal(state, Clusive::In, 0.0)) {
2678 0 : Sched::ShowSevereBadMin(state, eoh, IHGAlphaFieldNames(5), IHGAlphas(5), Clusive::In, 0.0);
2679 0 : ErrorsFound = true;
2680 : }
2681 :
2682 14 : if (IHGAlphaFieldBlanks(6)) {
2683 9 : thisZoneITEq.cpuLoadSched =
2684 9 : Sched::GetScheduleAlwaysOn(state); // not an availability schedule, but default is constant-1.0
2685 5 : } else if ((thisZoneITEq.cpuLoadSched = Sched::GetSchedule(state, IHGAlphas(6))) == nullptr) {
2686 0 : ShowSevereItemNotFound(state, eoh, IHGAlphaFieldNames(6), IHGAlphas(6));
2687 0 : ErrorsFound = true;
2688 5 : } else if (!thisZoneITEq.cpuLoadSched->checkMinVal(state, Clusive::In, 0.0)) {
2689 0 : Sched::ShowSevereBadMin(state, eoh, IHGAlphaFieldNames(6), IHGAlphas(6), Clusive::In, 0.0);
2690 0 : ErrorsFound = true;
2691 : }
2692 :
2693 : // Calculate nominal min/max equipment level
2694 14 : thisZoneITEq.NomMinDesignLevel = thisZoneITEq.DesignTotalPower * thisZoneITEq.cpuLoadSched->getMinVal(state);
2695 14 : thisZoneITEq.NomMaxDesignLevel = thisZoneITEq.DesignTotalPower * thisZoneITEq.cpuLoadSched->getMaxVal(state);
2696 :
2697 14 : thisZoneITEq.DesignFanPowerFrac = IHGNumbers(4);
2698 14 : thisZoneITEq.DesignFanPower = thisZoneITEq.DesignFanPowerFrac * thisZoneITEq.DesignTotalPower;
2699 14 : thisZoneITEq.DesignCPUPower = (1.0 - thisZoneITEq.DesignFanPowerFrac) * thisZoneITEq.DesignTotalPower;
2700 14 : thisZoneITEq.DesignAirVolFlowRate = IHGNumbers(5) * thisZoneITEq.DesignTotalPower;
2701 14 : thisZoneITEq.DesignTAirIn = IHGNumbers(6);
2702 14 : thisZoneITEq.DesignRecircFrac = IHGNumbers(7);
2703 14 : thisZoneITEq.DesignUPSEfficiency = IHGNumbers(8);
2704 14 : thisZoneITEq.UPSLossToZoneFrac = IHGNumbers(9);
2705 14 : thisZoneITEq.SupplyApproachTemp = IHGNumbers(10);
2706 14 : thisZoneITEq.ReturnApproachTemp = IHGNumbers(11);
2707 :
2708 14 : bool hasSupplyApproachTemp = !IHGNumericFieldBlanks(10);
2709 14 : bool hasReturnApproachTemp = !IHGNumericFieldBlanks(11);
2710 :
2711 : // Performance curves
2712 14 : thisZoneITEq.CPUPowerFLTCurve = GetCurveIndex(state, IHGAlphas(7));
2713 14 : if (thisZoneITEq.CPUPowerFLTCurve == 0) {
2714 0 : ShowSevereError(state, format("{}{} \"{}\"", RoutineName, itEqModuleObject, IHGAlphas(1)));
2715 0 : ShowContinueError(state, format("Invalid {}={}", IHGAlphaFieldNames(7), IHGAlphas(7)));
2716 0 : ErrorsFound = true;
2717 : }
2718 :
2719 14 : thisZoneITEq.AirFlowFLTCurve = GetCurveIndex(state, IHGAlphas(8));
2720 14 : if (thisZoneITEq.AirFlowFLTCurve == 0) {
2721 0 : ShowSevereError(state, format("{}{} \"{}\"", RoutineName, itEqModuleObject, IHGAlphas(1)));
2722 0 : ShowContinueError(state, format("Invalid {}={}", IHGAlphaFieldNames(8), IHGAlphas(8)));
2723 0 : ErrorsFound = true;
2724 : }
2725 :
2726 14 : thisZoneITEq.FanPowerFFCurve = GetCurveIndex(state, IHGAlphas(9));
2727 14 : if (thisZoneITEq.FanPowerFFCurve == 0) {
2728 0 : ShowSevereError(state, format("{}{} \"{}\"", RoutineName, itEqModuleObject, IHGAlphas(1)));
2729 0 : ShowContinueError(state, format("Invalid {}={}", IHGAlphaFieldNames(9), IHGAlphas(9)));
2730 0 : ErrorsFound = true;
2731 : }
2732 :
2733 14 : if (!IHGAlphaFieldBlanks(15)) {
2734 : // If this field isn't blank, it must point to a valid curve
2735 8 : thisZoneITEq.RecircFLTCurve = GetCurveIndex(state, IHGAlphas(15));
2736 8 : if (thisZoneITEq.RecircFLTCurve == 0) {
2737 0 : ShowSevereError(state, format("{}{} \"{}\"", RoutineName, itEqModuleObject, IHGAlphas(1)));
2738 0 : ShowContinueError(state, format("Invalid {}={}", IHGAlphaFieldNames(15), IHGAlphas(15)));
2739 0 : ErrorsFound = true;
2740 : }
2741 : } else {
2742 : // If this curve is left blank, then the curve is assumed to always equal 1.0.
2743 6 : thisZoneITEq.RecircFLTCurve = 0;
2744 : }
2745 :
2746 14 : if (!IHGAlphaFieldBlanks(16)) {
2747 : // If this field isn't blank, it must point to a valid curve
2748 8 : thisZoneITEq.UPSEfficFPLRCurve = GetCurveIndex(state, IHGAlphas(16));
2749 8 : if (thisZoneITEq.UPSEfficFPLRCurve == 0) {
2750 0 : ShowSevereError(state, format("{}{} \"{}\"", RoutineName, itEqModuleObject, IHGAlphas(1)));
2751 0 : ShowContinueError(state, format("Invalid {}={}", IHGAlphaFieldNames(16), IHGAlphas(16)));
2752 0 : ErrorsFound = true;
2753 : }
2754 : } else {
2755 : // If this curve is left blank, then the curve is assumed to always equal 1.0.
2756 6 : thisZoneITEq.UPSEfficFPLRCurve = 0;
2757 : }
2758 :
2759 : // Environmental class
2760 14 : thisZoneITEq.Class = static_cast<ITEClass>(getEnumValue(ITEClassNamesUC, Util::makeUPPER(IHGAlphas(10))));
2761 14 : ErrorsFound = ErrorsFound || (thisZoneITEq.Class == ITEClass::Invalid);
2762 :
2763 : // Air and supply inlet connections
2764 14 : thisZoneITEq.AirConnectionType =
2765 14 : static_cast<ITEInletConnection>(getEnumValue(ITEInletConnectionNamesUC, Util::makeUPPER(IHGAlphas(11))));
2766 14 : if (thisZoneITEq.AirConnectionType == ITEInletConnection::RoomAirModel) {
2767 : // ZoneITEq(Loop).AirConnectionType = ITEInletConnection::RoomAirModel;
2768 4 : ShowWarningError(state,
2769 4 : format("{}{}=\"{}Air Inlet Connection Type = RoomAirModel is not implemented yet, using ZoneAirNode",
2770 : RoutineName,
2771 : itEqModuleObject,
2772 : IHGAlphas(1)));
2773 2 : thisZoneITEq.AirConnectionType = ITEInletConnection::ZoneAirNode;
2774 : }
2775 14 : ErrorsFound = ErrorsFound || (thisZoneITEq.AirConnectionType == ITEInletConnection::Invalid);
2776 :
2777 14 : if (IHGAlphaFieldBlanks(14)) {
2778 5 : if (thisZoneITEq.AirConnectionType == ITEInletConnection::AdjustedSupply) {
2779 0 : ShowSevereError(state, format("{}{}: {}", RoutineName, itEqModuleObject, IHGAlphas(1)));
2780 0 : ShowContinueError(state,
2781 0 : format("For {}= AdjustedSupply, {} is required, but this field is blank.",
2782 : IHGAlphaFieldNames(11),
2783 : IHGAlphaFieldNames(14)));
2784 0 : ErrorsFound = true;
2785 5 : } else if (thisZoneITEq.FlowControlWithApproachTemps) {
2786 0 : ShowSevereError(state, format("{}{}: {}", RoutineName, itEqModuleObject, IHGAlphas(1)));
2787 0 : ShowContinueError(state,
2788 0 : format("For {}= FlowControlWithApproachTemperatures, {} is required, but this field is blank.",
2789 : IHGAlphaFieldNames(3),
2790 : IHGAlphaFieldNames(14)));
2791 0 : ErrorsFound = true;
2792 : }
2793 : } else {
2794 18 : thisZoneITEq.SupplyAirNodeNum = GetOnlySingleNode(state,
2795 9 : IHGAlphas(14),
2796 : ErrorsFound,
2797 : DataLoopNode::ConnectionObjectType::ElectricEquipmentITEAirCooled,
2798 9 : IHGAlphas(1),
2799 : DataLoopNode::NodeFluidType::Air,
2800 : DataLoopNode::ConnectionType::Sensor,
2801 : NodeInputManager::CompFluidStream::Primary,
2802 : ObjectIsNotParent);
2803 : }
2804 :
2805 : // check supply air node for matches with zone equipment supply air node
2806 14 : int zoneEqIndex = DataZoneEquipment::GetControlledZoneIndex(state, state.dataHeatBal->Zone(thisZoneITEq.ZonePtr).Name);
2807 14 : if (zoneEqIndex > 0) { // zoneEqIndex could be zero in the case of an uncontrolled zone
2808 2 : auto itStart = state.dataZoneEquip->ZoneEquipConfig(zoneEqIndex).InletNode.begin();
2809 2 : auto itEnd = state.dataZoneEquip->ZoneEquipConfig(zoneEqIndex).InletNode.end();
2810 2 : int key = thisZoneITEq.SupplyAirNodeNum;
2811 2 : thisZoneITEq.inControlledZone = true;
2812 2 : bool supplyNodeFound = false;
2813 2 : if (std::find(itStart, itEnd, key) != itEnd) {
2814 0 : supplyNodeFound = true;
2815 : }
2816 :
2817 2 : if (thisZoneITEq.AirConnectionType == ITEInletConnection::AdjustedSupply && !supplyNodeFound) {
2818 : // supply air node must match zone equipment supply air node for these conditions
2819 1 : ShowSevereError(state, format("{}: ElectricEquipment:ITE:AirCooled {}", RoutineName, thisZoneITEq.Name));
2820 2 : ShowContinueError(state, "Air Inlet Connection Type = AdjustedSupply but no Supply Air Node is specified.");
2821 1 : ErrorsFound = true;
2822 1 : } else if (thisZoneITEq.FlowControlWithApproachTemps && !supplyNodeFound) {
2823 : // supply air node must match zone equipment supply air node for these conditions
2824 1 : ShowSevereError(state, format("{}: ElectricEquipment:ITE:AirCooled {}", RoutineName, thisZoneITEq.Name));
2825 2 : ShowContinueError(state, "Air Inlet Connection Type = AdjustedSupply but no Supply Air Node is specified.");
2826 1 : ErrorsFound = true;
2827 0 : } else if (thisZoneITEq.SupplyAirNodeNum != 0 && !supplyNodeFound) {
2828 : // the given supply air node does not match any zone equipment supply air nodes
2829 0 : ShowWarningError(
2830 : state,
2831 0 : format("{}name: '{}. Supply Air Node Name '{}' does not match any ZoneHVAC:EquipmentConnections objects.",
2832 : itEqModuleObject,
2833 : IHGAlphas(1),
2834 : IHGAlphas(14)));
2835 : }
2836 : } // end of if block for zoneEqIndex > 0
2837 :
2838 : // End-Use subcategories
2839 14 : if (IHGNumAlphas > 16) {
2840 14 : thisZoneITEq.EndUseSubcategoryCPU = IHGAlphas(17);
2841 : } else {
2842 0 : thisZoneITEq.EndUseSubcategoryCPU = "ITE-CPU";
2843 : }
2844 :
2845 14 : if (IHGNumAlphas > 17) {
2846 14 : thisZoneITEq.EndUseSubcategoryFan = IHGAlphas(18);
2847 : } else {
2848 0 : thisZoneITEq.EndUseSubcategoryFan = "ITE-Fans";
2849 : }
2850 14 : if (thisZoneITEq.ZonePtr <= 0) continue; // Error, will be caught and terminated later
2851 :
2852 14 : if (IHGNumAlphas > 18) {
2853 14 : thisZoneITEq.EndUseSubcategoryUPS = IHGAlphas(19);
2854 : } else {
2855 0 : thisZoneITEq.EndUseSubcategoryUPS = "ITE-UPS";
2856 : }
2857 14 : if (thisZoneITEq.FlowControlWithApproachTemps) {
2858 3 : if (IHGAlphaFieldBlanks(20)) {
2859 3 : if (!hasSupplyApproachTemp) {
2860 0 : ShowSevereCustom(
2861 : state,
2862 : eoh,
2863 0 : format("For {}= FlowControlWithApproachTemperatures, either {} or {} is required, but both are left blank.",
2864 : IHGAlphaFieldNames(3),
2865 : IHGNumericFieldNames(10),
2866 : IHGAlphaFieldNames(20)));
2867 0 : ErrorsFound = true;
2868 : }
2869 0 : } else if ((thisZoneITEq.supplyApproachTempSched = Sched::GetSchedule(state, IHGAlphas(20))) == nullptr) {
2870 0 : ShowSevereItemNotFound(state, eoh, IHGAlphaFieldNames(20), IHGAlphas(20));
2871 0 : ErrorsFound = true;
2872 : }
2873 :
2874 3 : if (IHGAlphaFieldBlanks(21)) {
2875 3 : if (!hasReturnApproachTemp) {
2876 0 : ShowSevereCustom(
2877 : state,
2878 : eoh,
2879 0 : format("For {}= FlowControlWithApproachTemperatures, either {} or {} is required, but both are left blank.",
2880 : IHGAlphaFieldNames(3),
2881 : IHGNumericFieldNames(11),
2882 : IHGAlphaFieldNames(21)));
2883 0 : ErrorsFound = true;
2884 : }
2885 0 : } else if ((thisZoneITEq.returnApproachTempSched = Sched::GetSchedule(state, IHGAlphas(21))) == nullptr) {
2886 0 : ShowSevereItemNotFound(state, eoh, IHGAlphaFieldNames(20), IHGAlphas(20));
2887 0 : ErrorsFound = true;
2888 : }
2889 : }
2890 :
2891 14 : if (thisZoneITEq.FlowControlWithApproachTemps) {
2892 3 : Real64 TAirInSizing = 0.0;
2893 : // Set the TAirInSizing to the maximum setpoint value to do sizing based on the maximum fan and cpu power of the ite
2894 : // object
2895 3 : SetPointManager::GetSetPointManagerInputs(state);
2896 3 : for (auto *spm : state.dataSetPointManager->spms) {
2897 0 : if (spm->type != SetPointManager::SPMType::SZCooling) continue;
2898 0 : auto const *spmSZC = dynamic_cast<SetPointManager::SPMSingleZoneTemp *>(spm);
2899 0 : assert(spmSZC != nullptr);
2900 0 : if (spmSZC->ctrlZoneNum == zoneNum) {
2901 0 : TAirInSizing = spmSZC->maxSetTemp;
2902 : }
2903 : }
2904 :
2905 3 : thisZoneITEq.SizingTAirIn = max(TAirInSizing, thisZoneITEq.DesignTAirIn);
2906 : }
2907 :
2908 : // MJW - EMS Not in place yet
2909 : // if ( AnyEnergyManagementSystemInModel ) {
2910 : // SetupEMSActuator( "ElectricEquipment", ZoneITEq( Loop ).Name, "Electric Power Level", "[W]", ZoneITEq( Loop
2911 : // ).EMSZoneEquipOverrideOn, ZoneITEq( Loop ).EMSEquipPower ); SetupEMSInternalVariable( "Plug and Process Power Design
2912 : // Level", ZoneITEq( Loop ).Name, "[W]", ZoneITEq( Loop ).DesignTotalPower ); } // EMS
2913 :
2914 14 : if (!ErrorsFound)
2915 12 : SetupSpaceInternalGain(state,
2916 : thisZoneITEq.spaceIndex,
2917 : 1.0,
2918 : thisZoneITEq.Name,
2919 : DataHeatBalance::IntGainType::ElectricEquipmentITEAirCooled,
2920 12 : &thisZoneITEq.PowerRpt[(int)PERptVars::ConGainToZone]);
2921 : }
2922 : } // for itEqInputNum.NumOfSpaces
2923 : } // for itEqInputNum
2924 28 : for (int Loop = 1; Loop <= state.dataHeatBal->TotITEquip; ++Loop) {
2925 17 : if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).HasAdjustedReturnTempByITE &&
2926 3 : (!state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps)) {
2927 0 : ShowSevereError(state,
2928 0 : format("{}{}=\"{}\": invalid calculation method {} for Zone: {}",
2929 : RoutineName,
2930 : itEqModuleObject,
2931 : IHGAlphas(1),
2932 : IHGAlphas(3),
2933 : IHGAlphas(2)));
2934 0 : ShowContinueError(state, "...Multiple flow control methods apply to one zone. ");
2935 0 : ErrorsFound = true;
2936 : }
2937 : }
2938 : } // TotITEquip > 0
2939 :
2940 : // ZoneBaseboard:OutdoorTemperatureControlled
2941 342 : EPVector<InternalHeatGains::GlobalInternalGainMiscObject> zoneBBHeatObjects;
2942 171 : int numZoneBBHeatStatements = 0;
2943 171 : setupIHGZonesAndSpaces(state, bbModuleObject, zoneBBHeatObjects, numZoneBBHeatStatements, state.dataHeatBal->TotBBHeat, ErrorsFound);
2944 :
2945 171 : if (state.dataHeatBal->TotBBHeat > 0) {
2946 1 : state.dataHeatBal->ZoneBBHeat.allocate(state.dataHeatBal->TotBBHeat);
2947 1 : int bbHeatNum = 0;
2948 2 : for (int bbHeatInputNum = 1; bbHeatInputNum <= numZoneBBHeatStatements; ++bbHeatInputNum) {
2949 1 : state.dataInputProcessing->inputProcessor->getObjectItem(state,
2950 : bbModuleObject,
2951 : bbHeatInputNum,
2952 : IHGAlphas,
2953 : IHGNumAlphas,
2954 : IHGNumbers,
2955 : IHGNumNumbers,
2956 : IOStat,
2957 : IHGNumericFieldBlanks,
2958 : IHGAlphaFieldBlanks,
2959 : IHGAlphaFieldNames,
2960 : IHGNumericFieldNames);
2961 :
2962 1 : ErrorObjectHeader eoh{routineName, bbModuleObject, IHGAlphas(1)};
2963 :
2964 1 : auto &thisBBHeatInput = zoneBBHeatObjects(bbHeatInputNum);
2965 3 : for (int Item1 = 1; Item1 <= thisBBHeatInput.numOfSpaces; ++Item1) {
2966 2 : ++bbHeatNum;
2967 2 : auto &thisZoneBBHeat = state.dataHeatBal->ZoneBBHeat(bbHeatNum);
2968 2 : int const spaceNum = thisBBHeatInput.spaceNums(Item1);
2969 2 : int const zoneNum = state.dataHeatBal->space(spaceNum).zoneNum;
2970 2 : thisZoneBBHeat.Name = thisBBHeatInput.names(Item1);
2971 2 : thisZoneBBHeat.spaceIndex = spaceNum;
2972 2 : thisZoneBBHeat.ZonePtr = zoneNum;
2973 :
2974 2 : if (IHGAlphaFieldBlanks(3)) {
2975 0 : ShowSevereEmptyField(state, eoh, IHGAlphaFieldNames(3));
2976 0 : ErrorsFound = true;
2977 2 : } else if ((thisZoneBBHeat.sched = Sched::GetSchedule(state, IHGAlphas(3))) == nullptr) {
2978 0 : ShowSevereItemNotFound(state, eoh, IHGAlphaFieldNames(3), IHGAlphas(3));
2979 0 : ErrorsFound = true;
2980 2 : } else if (!thisZoneBBHeat.sched->checkMinVal(state, Clusive::In, 0.0)) {
2981 0 : Sched::ShowSevereBadMin(state, eoh, IHGAlphaFieldNames(3), IHGAlphas(3), Clusive::In, 0.0);
2982 0 : ErrorsFound = true;
2983 : }
2984 :
2985 2 : if (IHGNumAlphas > 3) {
2986 2 : thisZoneBBHeat.EndUseSubcategory = IHGAlphas(4);
2987 : } else {
2988 0 : thisZoneBBHeat.EndUseSubcategory = "General";
2989 : }
2990 :
2991 2 : Real64 spaceFrac = 1.0;
2992 2 : if (thisBBHeatInput.numOfSpaces > 1) {
2993 2 : Real64 const zoneArea = state.dataHeatBal->Zone(zoneNum).FloorArea;
2994 2 : if (zoneArea > 0.0) {
2995 2 : spaceFrac = state.dataHeatBal->space(spaceNum).FloorArea / zoneArea;
2996 : } else {
2997 0 : ShowSevereError(
2998 : state,
2999 0 : format("{}Zone floor area is zero when allocating ZoneBaseboard:OutdoorTemperatureControlled loads to Spaces.",
3000 : RoutineName));
3001 0 : ShowContinueError(state,
3002 0 : format("Occurs for ZoneBaseboard:OutdoorTemperatureControlled object ={} in Zone={}",
3003 0 : thisBBHeatInput.Name,
3004 0 : state.dataHeatBal->Zone(zoneNum).Name));
3005 0 : ErrorsFound = true;
3006 : }
3007 : }
3008 2 : thisZoneBBHeat.CapatLowTemperature = IHGNumbers(1) * spaceFrac;
3009 2 : thisZoneBBHeat.LowTemperature = IHGNumbers(2);
3010 2 : thisZoneBBHeat.CapatHighTemperature = IHGNumbers(3) * spaceFrac;
3011 2 : thisZoneBBHeat.HighTemperature = IHGNumbers(4);
3012 2 : thisZoneBBHeat.FractionRadiant = IHGNumbers(5);
3013 2 : thisZoneBBHeat.FractionConvected = 1.0 - thisZoneBBHeat.FractionRadiant;
3014 2 : if (thisZoneBBHeat.FractionConvected < 0.0) {
3015 0 : ShowSevereError(state, format("{}{}=\"{}\", Sum of Fractions > 1.0", RoutineName, bbModuleObject, thisBBHeatInput.Name));
3016 0 : ErrorsFound = true;
3017 : }
3018 :
3019 2 : if (thisZoneBBHeat.ZonePtr <= 0) continue; // Error, will be caught and terminated later
3020 :
3021 2 : if (state.dataGlobal->AnyEnergyManagementSystemInModel) {
3022 0 : SetupEMSActuator(state,
3023 : "ZoneBaseboard:OutdoorTemperatureControlled",
3024 : thisZoneBBHeat.Name,
3025 : "Power Level",
3026 : "[W]",
3027 0 : thisZoneBBHeat.EMSZoneBaseboardOverrideOn,
3028 0 : thisZoneBBHeat.EMSZoneBaseboardPower);
3029 0 : SetupEMSInternalVariable(state,
3030 : "Simple Zone Baseboard Capacity At Low Temperature",
3031 : thisZoneBBHeat.Name,
3032 : "[W]",
3033 0 : thisZoneBBHeat.CapatLowTemperature);
3034 0 : SetupEMSInternalVariable(state,
3035 : "Simple Zone Baseboard Capacity At High Temperature",
3036 : thisZoneBBHeat.Name,
3037 : "[W]",
3038 0 : thisZoneBBHeat.CapatHighTemperature);
3039 : } // EMS
3040 :
3041 2 : SetupSpaceInternalGain(state,
3042 : thisZoneBBHeat.spaceIndex,
3043 : 1.0,
3044 : thisZoneBBHeat.Name,
3045 : DataHeatBalance::IntGainType::ZoneBaseboardOutdoorTemperatureControlled,
3046 : &thisZoneBBHeat.ConGainRate,
3047 : nullptr,
3048 : &thisZoneBBHeat.RadGainRate);
3049 : } // for bbHeatInputNum.NumOfSpaces
3050 : } // for bbHeatInputNum
3051 : } // TotBBHeat > 0
3052 :
3053 171 : state.dataHeatBal->TotCO2Gen = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, contamSSModuleObject);
3054 171 : state.dataHeatBal->ZoneCO2Gen.allocate(state.dataHeatBal->TotCO2Gen);
3055 :
3056 172 : for (int Loop = 1; Loop <= state.dataHeatBal->TotCO2Gen; ++Loop) {
3057 1 : IHGAlphas = "";
3058 1 : IHGNumbers = 0.0;
3059 1 : state.dataInputProcessing->inputProcessor->getObjectItem(state,
3060 : contamSSModuleObject,
3061 : Loop,
3062 : IHGAlphas,
3063 : IHGNumAlphas,
3064 : IHGNumbers,
3065 : IHGNumNumbers,
3066 : IOStat,
3067 : IHGNumericFieldBlanks,
3068 : IHGAlphaFieldBlanks,
3069 : IHGAlphaFieldNames,
3070 : IHGNumericFieldNames);
3071 :
3072 1 : ErrorObjectHeader eoh{routineName, contamSSModuleObject, IHGAlphas(1)};
3073 1 : Util::IsNameEmpty(state, IHGAlphas(1), contamSSModuleObject, ErrorsFound);
3074 :
3075 1 : state.dataHeatBal->ZoneCO2Gen(Loop).Name = IHGAlphas(1);
3076 :
3077 1 : state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr = Util::FindItemInList(IHGAlphas(2), state.dataHeatBal->Zone);
3078 1 : if (state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr == 0) {
3079 0 : ShowSevereError(
3080 : state,
3081 0 : format(
3082 : "{}{}=\"{}\", invalid {} entered={}", RoutineName, contamSSModuleObject, IHGAlphas(1), IHGAlphaFieldNames(2), IHGAlphas(2)));
3083 0 : ErrorsFound = true;
3084 : }
3085 :
3086 1 : if (IHGAlphaFieldBlanks(3)) {
3087 0 : ShowSevereEmptyField(state, eoh, IHGAlphaFieldNames(3));
3088 0 : ErrorsFound = true;
3089 1 : } else if ((state.dataHeatBal->ZoneCO2Gen(Loop).sched = Sched::GetSchedule(state, IHGAlphas(3))) == nullptr) {
3090 0 : ShowSevereItemNotFound(state, eoh, IHGAlphaFieldNames(3), IHGAlphas(3));
3091 0 : ErrorsFound = true;
3092 1 : } else if (!state.dataHeatBal->ZoneCO2Gen(Loop).sched->checkMinVal(state, Clusive::In, 0.0)) {
3093 0 : Sched::ShowSevereBadMin(state, eoh, IHGAlphaFieldNames(3), IHGAlphas(3), Clusive::In, 0.0);
3094 0 : ErrorsFound = true;
3095 : }
3096 :
3097 1 : state.dataHeatBal->ZoneCO2Gen(Loop).CO2DesignRate = IHGNumbers(1);
3098 :
3099 1 : if (state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr <= 0) continue; // Error, will be caught and terminated later
3100 :
3101 : // Object report variables
3102 2 : SetupOutputVariable(state,
3103 : "Contaminant Source or Sink CO2 Gain Volume Flow Rate",
3104 : Constant::Units::m3_s,
3105 1 : state.dataHeatBal->ZoneCO2Gen(Loop).CO2GainRate,
3106 : OutputProcessor::TimeStepType::Zone,
3107 : OutputProcessor::StoreType::Average,
3108 1 : state.dataHeatBal->ZoneCO2Gen(Loop).Name);
3109 :
3110 : // Zone total report variables
3111 1 : if (RepVarSet(state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr)) {
3112 1 : RepVarSet(state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr) = false;
3113 :
3114 2 : SetupOutputVariable(state,
3115 : "Zone Contaminant Source or Sink CO2 Gain Volume Flow Rate",
3116 : Constant::Units::m3_s,
3117 1 : state.dataHeatBal->ZoneRpt(state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr).CO2Rate,
3118 : OutputProcessor::TimeStepType::Zone,
3119 : OutputProcessor::StoreType::Average,
3120 1 : state.dataHeatBal->Zone(state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr).Name);
3121 : }
3122 :
3123 3 : SetupZoneInternalGain(state,
3124 1 : state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr,
3125 1 : state.dataHeatBal->ZoneCO2Gen(Loop).Name,
3126 : DataHeatBalance::IntGainType::ZoneContaminantSourceAndSinkCarbonDioxide,
3127 : nullptr,
3128 : nullptr,
3129 : nullptr,
3130 : nullptr,
3131 : nullptr,
3132 1 : &state.dataHeatBal->ZoneCO2Gen(Loop).CO2GainRate);
3133 : }
3134 :
3135 171 : RepVarSet.deallocate();
3136 :
3137 171 : if (ErrorsFound) {
3138 8 : ShowFatalError(state, format("{}Errors found in Getting Internal Gains Input, Program Stopped", RoutineName));
3139 : }
3140 167 : setupIHGOutputs(state);
3141 :
3142 : static constexpr std::string_view Format_721(
3143 : "! <Zone Internal Gains Nominal>,Zone Name, Floor Area {{m2}},# Occupants,Area per Occupant "
3144 : "{{m2/person}},Occupant per Area {{person/m2}},Interior Lighting {{W/m2}},Electric Load {{W/m2}},Gas Load {{W/m2}},Other "
3145 : "Load {{W/m2}},Hot Water Eq {{W/m2}},Steam Equipment {{W/m2}},Sum Loads per Area {{W/m2}},Outdoor Controlled Baseboard "
3146 : "Heat\n");
3147 :
3148 167 : print(state.files.eio, Format_721);
3149 :
3150 373 : for (int Loop = 1; Loop <= state.dataGlobal->NumOfZones; ++Loop) {
3151 206 : auto &zone = state.dataHeatBal->Zone(Loop);
3152 :
3153 206 : Real64 LightTot = 0.0;
3154 206 : Real64 ElecTot = 0.0;
3155 206 : Real64 GasTot = 0.0;
3156 206 : Real64 OthTot = 0.0;
3157 206 : Real64 HWETot = 0.0;
3158 206 : Real64 StmTot = 0.0;
3159 206 : std::string BBHeatInd = "No"; // Yes if BBHeat in zone, no if not.
3160 :
3161 427 : for (auto const &lights : state.dataHeatBal->Lights) {
3162 221 : if (lights.ZonePtr == Loop) LightTot += lights.DesignLevel;
3163 : }
3164 454 : for (auto const &elecEq : state.dataHeatBal->ZoneElectric) {
3165 248 : if (elecEq.ZonePtr == Loop) ElecTot += elecEq.DesignLevel;
3166 : }
3167 218 : for (auto const &itEq : state.dataHeatBal->ZoneITEq) {
3168 12 : if (itEq.ZonePtr == Loop) ElecTot += itEq.DesignTotalPower; // Should this not be itTot?
3169 : }
3170 208 : for (auto const &gasEq : state.dataHeatBal->ZoneGas) {
3171 2 : if (gasEq.ZonePtr == Loop) GasTot += gasEq.DesignLevel;
3172 : }
3173 258 : for (auto const &otherEq : state.dataHeatBal->ZoneOtherEq) {
3174 52 : if (otherEq.ZonePtr == Loop) OthTot += otherEq.DesignLevel;
3175 : }
3176 208 : for (auto const &steamEq : state.dataHeatBal->ZoneSteamEq) {
3177 2 : if (steamEq.ZonePtr == Loop) StmTot += steamEq.DesignLevel;
3178 : }
3179 208 : for (auto const &hotWaterEq : state.dataHeatBal->ZoneHWEq) {
3180 2 : if (hotWaterEq.ZonePtr == Loop) HWETot += hotWaterEq.DesignLevel;
3181 : }
3182 208 : for (auto const &bbHeat : state.dataHeatBal->ZoneBBHeat) {
3183 2 : if (bbHeat.ZonePtr == Loop) BBHeatInd = "Yes";
3184 : }
3185 :
3186 206 : zone.InternalHeatGains = LightTot + ElecTot + GasTot + OthTot + HWETot + StmTot;
3187 206 : if (zone.FloorArea > 0.0) {
3188 169 : print(state.files.eio, Format_720, zone.Name, zone.FloorArea, zone.TotOccupants);
3189 169 : print_and_divide_if_greater_than_zero(zone.FloorArea, zone.TotOccupants);
3190 169 : print(state.files.eio, "{:.3R},", zone.TotOccupants / zone.FloorArea);
3191 169 : print(state.files.eio, "{:.3R},", LightTot / zone.FloorArea);
3192 169 : print(state.files.eio, "{:.3R},", ElecTot / zone.FloorArea);
3193 169 : print(state.files.eio, "{:.3R},", GasTot / zone.FloorArea);
3194 169 : print(state.files.eio, "{:.3R},", OthTot / zone.FloorArea);
3195 169 : print(state.files.eio, "{:.3R},", HWETot / zone.FloorArea);
3196 169 : print(state.files.eio, "{:.3R},", StmTot / zone.FloorArea);
3197 169 : print(state.files.eio, "{:.3R},{}\n", zone.InternalHeatGains / zone.FloorArea, BBHeatInd);
3198 : } else {
3199 37 : print(state.files.eio, Format_720, zone.Name, zone.FloorArea, zone.TotOccupants);
3200 37 : print(state.files.eio, "0.0,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,{}\n", BBHeatInd);
3201 : }
3202 206 : }
3203 :
3204 244 : for (int Loop = 1; Loop <= state.dataHeatBal->TotPeople; ++Loop) {
3205 77 : auto &people = state.dataHeatBal->People(Loop);
3206 :
3207 77 : if (Loop == 1) {
3208 43 : print(state.files.eio,
3209 : Format_723,
3210 : "People",
3211 : "Number of People {},People/Floor Area {person/m2},Floor Area per person {m2/person},Fraction Radiant,Fraction "
3212 : "Convected,Sensible Fraction Calculation,Activity level,ASHRAE 55 Warnings,Carbon Dioxide Generation Rate,"
3213 : "Minimum Number of People for All Day Types,Maximum Number of People for All Day Types,"
3214 : "Minimum Number of People for Weekdays, Maximum Number of People for Weekdays, "
3215 : "Minimum Number of People for Weekends/Holidays, Maximum Number of People for Weekends /Holidays,"
3216 : "Minimum Number of People for Summer Design Days, Maximum Number of People for Summer Design Days,"
3217 : "Minimum Number of People for Winter Design Days, Maximum Number of People for Winter Design Days");
3218 43 : if (people.Fanger || people.Pierce || people.KSU || people.CoolingEffectASH55 || people.AnkleDraftASH55) {
3219 13 : print(state.files.eio,
3220 : ",MRT Calculation Type,Work Efficiency, Clothing Insulation Calculation Method,Clothing "
3221 : "Insulation Calculation Method Schedule,Clothing,Air Velocity,Fanger Calculation,Pierce "
3222 : "Calculation,KSU Calculation,Cooling Effect Calculation,Ankle Draft Calculation\n");
3223 : } else {
3224 30 : print(state.files.eio, "\n");
3225 : }
3226 : }
3227 :
3228 77 : if (people.ZonePtr == 0) {
3229 0 : print(state.files.eio, Format_724, "People-Illegal Zone specified", people.Name);
3230 0 : continue;
3231 : }
3232 :
3233 77 : auto const &zone = state.dataHeatBal->Zone(people.ZonePtr);
3234 :
3235 77 : print(state.files.eio, Format_722, "People", people.Name, people.sched->Name, zone.Name, zone.FloorArea, zone.TotOccupants);
3236 77 : print(state.files.eio, "{:.1R},", people.NumberOfPeople);
3237 :
3238 77 : print_and_divide_if_greater_than_zero(people.NumberOfPeople, zone.FloorArea);
3239 :
3240 77 : if (people.NumberOfPeople > 0.0) {
3241 77 : print_and_divide_if_greater_than_zero(zone.FloorArea, people.NumberOfPeople);
3242 : } else {
3243 0 : print(state.files.eio, "N/A,");
3244 : }
3245 :
3246 77 : print(state.files.eio, "{:.3R},", people.FractionRadiant);
3247 77 : print(state.files.eio, "{:.3R},", people.FractionConvected);
3248 77 : if (people.UserSpecSensFrac == Constant::AutoCalculate) {
3249 72 : print(state.files.eio, "AutoCalculate,");
3250 : } else {
3251 5 : print(state.files.eio, "{:.3R},", people.UserSpecSensFrac);
3252 : }
3253 77 : print(state.files.eio, "{},", people.activityLevelSched->Name);
3254 :
3255 77 : print(state.files.eio, "{},", yesNoNames[(int)people.Show55Warning]);
3256 77 : print(state.files.eio, "{:.4R},", people.CO2RateFactor);
3257 77 : print(state.files.eio, "{:.1R},", people.NomMinNumberPeople);
3258 77 : print(state.files.eio, "{:.1R},", people.NomMaxNumberPeople);
3259 :
3260 : Real64 SchMin, SchMax;
3261 :
3262 : // weekdays
3263 77 : std::tie(SchMin, SchMax) = people.sched->getMinMaxValsByDayType(state, Sched::DayTypeGroup::Weekday);
3264 77 : print(state.files.eio, "{:.1R},", people.NumberOfPeople * SchMin);
3265 77 : print(state.files.eio, "{:.1R},", people.NumberOfPeople * SchMax);
3266 :
3267 : // weekends/holidays
3268 77 : std::tie(SchMin, SchMax) = people.sched->getMinMaxValsByDayType(state, Sched::DayTypeGroup::WeekEndHoliday);
3269 77 : print(state.files.eio, "{:.1R},", people.NumberOfPeople * SchMin);
3270 77 : print(state.files.eio, "{:.1R},", people.NumberOfPeople * SchMax);
3271 :
3272 : // summer design days
3273 77 : std::tie(SchMin, SchMax) = people.sched->getMinMaxValsByDayType(state, Sched::DayTypeGroup::SummerDesignDay);
3274 77 : print(state.files.eio, "{:.1R},", people.NumberOfPeople * SchMin);
3275 77 : print(state.files.eio, "{:.1R},", people.NumberOfPeople * SchMax);
3276 :
3277 : // winter design days
3278 77 : std::tie(SchMin, SchMax) = people.sched->getMinMaxValsByDayType(state, Sched::DayTypeGroup::WinterDesignDay);
3279 77 : print(state.files.eio, "{:.1R},", people.NumberOfPeople * SchMin);
3280 77 : print(state.files.eio, "{:.1R},", people.NumberOfPeople * SchMax);
3281 :
3282 77 : if (people.Fanger || people.Pierce || people.KSU || people.CoolingEffectASH55 || people.AnkleDraftASH55) {
3283 :
3284 15 : if (people.MRTCalcType == DataHeatBalance::CalcMRT::EnclosureAveraged) {
3285 15 : print(state.files.eio, "Zone Averaged,");
3286 0 : } else if (people.MRTCalcType == DataHeatBalance::CalcMRT::SurfaceWeighted) {
3287 0 : print(state.files.eio, "Surface Weighted,");
3288 0 : } else if (people.MRTCalcType == DataHeatBalance::CalcMRT::AngleFactor) {
3289 0 : print(state.files.eio, "Angle Factor,");
3290 : } else {
3291 0 : print(state.files.eio, "N/A,");
3292 : }
3293 15 : print(state.files.eio, "{},", people.workEffSched ? people.workEffSched->Name : "");
3294 :
3295 15 : print(state.files.eio, clothingTypeEIOStrings[(int)people.clothingType]);
3296 :
3297 15 : if (people.clothingType == ClothingType::CalculationSchedule) {
3298 0 : print(state.files.eio, "{},", people.clothingMethodSched->Name);
3299 : } else {
3300 15 : print(state.files.eio, "N/A,");
3301 : }
3302 :
3303 15 : print(state.files.eio, "{},", people.clothingSched ? people.clothingSched->Name : "");
3304 15 : print(state.files.eio, "{},", people.airVelocitySched ? people.airVelocitySched->Name : "");
3305 :
3306 15 : print(state.files.eio, "{},", yesNoNames[(int)people.Fanger]);
3307 15 : print(state.files.eio, "{},", yesNoNames[(int)people.Pierce]);
3308 15 : print(state.files.eio, "{},", yesNoNames[(int)people.KSU]);
3309 15 : print(state.files.eio, "{},", yesNoNames[(int)people.CoolingEffectASH55]);
3310 15 : print(state.files.eio, "{}", yesNoNames[(int)people.AnkleDraftASH55]);
3311 : }
3312 77 : print(state.files.eio, "\n");
3313 : }
3314 :
3315 242 : for (int Loop = 1; Loop <= state.dataHeatBal->TotLights; ++Loop) {
3316 75 : auto &lights = state.dataHeatBal->Lights(Loop);
3317 :
3318 75 : if (Loop == 1) {
3319 41 : print(state.files.eio,
3320 : Format_723,
3321 : "Lights",
3322 : "Lighting Level {W},Lights/Floor Area {W/m2},Lights per person {W/person},Fraction Return "
3323 : "Air,Fraction Radiant,Fraction Short Wave,Fraction Convected,Fraction Replaceable,End-Use, "
3324 : "Minimum Lighting Level for All Day Types {W},Maximum Lighting Level for All Day Types {W},"
3325 : "Minimum Lighting Level for Weekdays {W}, Maximum Lighting Level for Weekdays {W},"
3326 : "Minimum Lighting Level for Weekends/Holidays {W}, Maximum Lighting Level for Weekends /Holidays {W},"
3327 : "Minimum Lighting Level for Summer Design Days {W}, Maximum Lighting Level for Summer Design Days {W},"
3328 : "Minimum Lighting Level for Winter Design Days {W}, Maximum Lighting Level for Winter Design Days {W}\n");
3329 : }
3330 :
3331 75 : if (lights.ZonePtr == 0) {
3332 0 : print(state.files.eio, "Lights-Illegal Zone specified", lights.Name);
3333 0 : continue;
3334 : }
3335 :
3336 75 : auto const &zone = state.dataHeatBal->Zone(lights.ZonePtr);
3337 :
3338 75 : print(state.files.eio, Format_722, "Lights", lights.Name, lights.sched->Name, zone.Name, zone.FloorArea, zone.TotOccupants);
3339 :
3340 75 : print(state.files.eio, "{:.3R},", lights.DesignLevel);
3341 :
3342 75 : print_and_divide_if_greater_than_zero(lights.DesignLevel, zone.FloorArea);
3343 75 : print_and_divide_if_greater_than_zero(lights.DesignLevel, zone.TotOccupants);
3344 :
3345 75 : print(state.files.eio, "{:.3R},", lights.FractionReturnAir);
3346 75 : print(state.files.eio, "{:.3R},", lights.FractionRadiant);
3347 75 : print(state.files.eio, "{:.3R},", lights.FractionShortWave);
3348 75 : print(state.files.eio, "{:.3R},", lights.FractionConvected);
3349 75 : print(state.files.eio, "{:.3R},", lights.FractionReplaceable);
3350 75 : print(state.files.eio, "{},", lights.EndUseSubcategory);
3351 75 : print(state.files.eio, "{:.3R},", lights.NomMinDesignLevel);
3352 75 : print(state.files.eio, "{:.3R},", lights.NomMaxDesignLevel);
3353 :
3354 75 : auto &light = state.dataHeatBal->Lights(Loop);
3355 :
3356 : Real64 SchMin, SchMax;
3357 : // weekdays
3358 75 : std::tie(SchMin, SchMax) = light.sched->getMinMaxValsByDayType(state, Sched::DayTypeGroup::Weekday);
3359 75 : print(state.files.eio, "{:.3R},", light.DesignLevel * SchMin);
3360 75 : print(state.files.eio, "{:.1R},", light.DesignLevel * SchMax);
3361 :
3362 : // weekends/holidays
3363 75 : std::tie(SchMin, SchMax) = light.sched->getMinMaxValsByDayType(state, Sched::DayTypeGroup::WeekEndHoliday);
3364 75 : print(state.files.eio, "{:.3R},", light.DesignLevel * SchMin);
3365 75 : print(state.files.eio, "{:.3R},", light.DesignLevel * SchMax);
3366 :
3367 : // summer design days
3368 75 : std::tie(SchMin, SchMax) = light.sched->getMinMaxValsByDayType(state, Sched::DayTypeGroup::SummerDesignDay);
3369 75 : print(state.files.eio, "{:.3R},", light.DesignLevel * SchMin);
3370 75 : print(state.files.eio, "{:.3R},", light.DesignLevel * SchMax);
3371 :
3372 : // winter design days
3373 75 : std::tie(SchMin, SchMax) = light.sched->getMinMaxValsByDayType(state, Sched::DayTypeGroup::WinterDesignDay);
3374 75 : print(state.files.eio, "{:.3R},", light.DesignLevel * SchMin);
3375 75 : print(state.files.eio, "{:.3R}\n", light.DesignLevel * SchMax);
3376 : }
3377 :
3378 265 : for (int Loop = 1; Loop <= state.dataHeatBal->TotElecEquip; ++Loop) {
3379 98 : auto &elecEq = state.dataHeatBal->ZoneElectric(Loop);
3380 :
3381 98 : if (Loop == 1) {
3382 43 : print(state.files.eio,
3383 : Format_723,
3384 : "ElectricEquipment",
3385 : "Equipment Level {W},Equipment/Floor Area {W/m2},Equipment per person {W/person},Fraction Latent,Fraction Radiant,Fraction "
3386 : "Lost,Fraction Convected,End-Use SubCategory,"
3387 : "Minimum Equipment Level for All Day Types {W},Maximum Equipment Level for All Day Types {W},"
3388 : "Minimum Equipment Level for Weekdays {W}, Maximum Equipment Level for Weekdays {W},"
3389 : "Minimum Equipment Level for Weekends/Holidays {W}, Maximum Equipment Level for Weekends /Holidays {W},"
3390 : "Minimum Equipment Level for Summer Design Days {W}, Maximum Equipment Level for Summer Design Days {W},"
3391 : "Minimum Equipment Level for Winter Design Days {W}, Maximum Equipment Level for Winter Design Days {W}\n");
3392 : }
3393 :
3394 98 : if (elecEq.ZonePtr == 0) {
3395 0 : print(state.files.eio, Format_724, "Electric Equipment-Illegal Zone specified", elecEq.Name);
3396 0 : continue;
3397 : }
3398 :
3399 98 : auto &zone = state.dataHeatBal->Zone(elecEq.ZonePtr);
3400 :
3401 98 : print(state.files.eio, Format_722, "ElectricEquipment", elecEq.Name, elecEq.sched->Name, zone.Name, zone.FloorArea, zone.TotOccupants);
3402 98 : print(state.files.eio, "{:.3R},", elecEq.DesignLevel);
3403 :
3404 98 : print_and_divide_if_greater_than_zero(elecEq.DesignLevel, zone.FloorArea);
3405 98 : print_and_divide_if_greater_than_zero(elecEq.DesignLevel, zone.TotOccupants);
3406 :
3407 98 : print(state.files.eio, "{:.3R},", elecEq.FractionLatent);
3408 98 : print(state.files.eio, "{:.3R},", elecEq.FractionRadiant);
3409 98 : print(state.files.eio, "{:.3R},", elecEq.FractionLost);
3410 98 : print(state.files.eio, "{:.3R},", elecEq.FractionConvected);
3411 98 : print(state.files.eio, "{},", elecEq.EndUseSubcategory);
3412 98 : print(state.files.eio, "{:.3R},", elecEq.NomMinDesignLevel);
3413 98 : print(state.files.eio, "{:.3R},", elecEq.NomMaxDesignLevel);
3414 :
3415 : Real64 SchMin, SchMax;
3416 :
3417 : // weekdays
3418 98 : std::tie(SchMin, SchMax) = elecEq.sched->getMinMaxValsByDayType(state, Sched::DayTypeGroup::Weekday);
3419 98 : print(state.files.eio, "{:.3R},", elecEq.DesignLevel * SchMin);
3420 98 : print(state.files.eio, "{:.3R},", elecEq.DesignLevel * SchMax);
3421 :
3422 : // weekends/holidays
3423 98 : std::tie(SchMin, SchMax) = elecEq.sched->getMinMaxValsByDayType(state, Sched::DayTypeGroup::WeekEndHoliday);
3424 98 : print(state.files.eio, "{:.3R},", elecEq.DesignLevel * SchMin);
3425 98 : print(state.files.eio, "{:.3R},", elecEq.DesignLevel * SchMax);
3426 :
3427 : // summer design days
3428 98 : std::tie(SchMin, SchMax) = elecEq.sched->getMinMaxValsByDayType(state, Sched::DayTypeGroup::SummerDesignDay);
3429 98 : print(state.files.eio, "{:.3R},", elecEq.DesignLevel * SchMin);
3430 98 : print(state.files.eio, "{:.3R},", elecEq.DesignLevel * SchMax);
3431 :
3432 : // winter design days
3433 98 : std::tie(SchMin, SchMax) = elecEq.sched->getMinMaxValsByDayType(state, Sched::DayTypeGroup::WinterDesignDay);
3434 98 : print(state.files.eio, "{:.3R},", elecEq.DesignLevel * SchMin);
3435 98 : print(state.files.eio, "{:.3R}\n", elecEq.DesignLevel * SchMax);
3436 : }
3437 :
3438 169 : for (int Loop = 1; Loop <= state.dataHeatBal->TotGasEquip; ++Loop) {
3439 2 : auto &gasEq = state.dataHeatBal->ZoneGas(Loop);
3440 :
3441 2 : if (Loop == 1) {
3442 1 : print(state.files.eio,
3443 : Format_723,
3444 : "GasEquipment",
3445 : "Equipment Level {W},Equipment/Floor Area {W/m2},Equipment per person {W/person},Fraction Latent,Fraction Radiant,Fraction "
3446 : "Lost,Fraction Convected,End-Use SubCategory,"
3447 : "Minimum Equipment Level for All Day Types {W},Maximum Equipment Level for All Day Types {W},"
3448 : "Minimum Equipment Level for Weekdays {W}, Maximum Equipment Level for Weekdays {W},"
3449 : "Minimum Equipment Level for Weekends/Holidays {W}, Maximum Equipment Level for Weekends /Holidays {W},"
3450 : "Minimum Equipment Level for Summer Design Days {W}, Maximum Equipment Level for Summer Design Days {W},"
3451 : "Minimum Equipment Level for Winter Design Days {W}, Maximum Equipment Level for Winter Design Days {W}\n");
3452 : }
3453 :
3454 2 : if (gasEq.ZonePtr == 0) {
3455 0 : print(state.files.eio, Format_724, "Gas Equipment-Illegal Zone specified", gasEq.Name);
3456 0 : continue;
3457 : }
3458 :
3459 2 : auto &zone = state.dataHeatBal->Zone(gasEq.ZonePtr);
3460 :
3461 2 : print(state.files.eio, Format_722, "GasEquipment", gasEq.Name, gasEq.sched->Name, zone.Name, zone.FloorArea, zone.TotOccupants);
3462 2 : print(state.files.eio, "{:.3R},", gasEq.DesignLevel);
3463 :
3464 2 : print_and_divide_if_greater_than_zero(gasEq.DesignLevel, zone.FloorArea);
3465 2 : print_and_divide_if_greater_than_zero(gasEq.DesignLevel, zone.TotOccupants);
3466 :
3467 2 : print(state.files.eio, "{:.3R},", gasEq.FractionLatent);
3468 2 : print(state.files.eio, "{:.3R},", gasEq.FractionRadiant);
3469 2 : print(state.files.eio, "{:.3R},", gasEq.FractionLost);
3470 2 : print(state.files.eio, "{:.3R},", gasEq.FractionConvected);
3471 2 : print(state.files.eio, "{},", gasEq.EndUseSubcategory);
3472 2 : print(state.files.eio, "{:.3R},", gasEq.NomMinDesignLevel);
3473 2 : print(state.files.eio, "{:.3R},", gasEq.NomMaxDesignLevel);
3474 :
3475 : Real64 SchMin, SchMax;
3476 : // weekdays
3477 2 : std::tie(SchMin, SchMax) = gasEq.sched->getMinMaxValsByDayType(state, Sched::DayTypeGroup::Weekday);
3478 2 : print(state.files.eio, "{:.3R},", gasEq.DesignLevel * SchMin);
3479 2 : print(state.files.eio, "{:.3R},", gasEq.DesignLevel * SchMax);
3480 :
3481 : // weekends/holidays
3482 2 : std::tie(SchMin, SchMax) = gasEq.sched->getMinMaxValsByDayType(state, Sched::DayTypeGroup::WeekEndHoliday);
3483 2 : print(state.files.eio, "{:.3R},", gasEq.DesignLevel * SchMin);
3484 2 : print(state.files.eio, "{:.3R},", gasEq.DesignLevel * SchMax);
3485 :
3486 : // summer design days
3487 2 : std::tie(SchMin, SchMax) = gasEq.sched->getMinMaxValsByDayType(state, Sched::DayTypeGroup::SummerDesignDay);
3488 2 : print(state.files.eio, "{:.3R},", gasEq.DesignLevel * SchMin);
3489 2 : print(state.files.eio, "{:.3R},", gasEq.DesignLevel * SchMax);
3490 :
3491 : // winter design days
3492 2 : std::tie(SchMin, SchMax) = gasEq.sched->getMinMaxValsByDayType(state, Sched::DayTypeGroup::WinterDesignDay);
3493 2 : print(state.files.eio, "{:.3R},", gasEq.DesignLevel * SchMin);
3494 2 : print(state.files.eio, "{:.3R}\n", gasEq.DesignLevel * SchMax);
3495 : }
3496 :
3497 169 : for (int Loop = 1; Loop <= state.dataHeatBal->TotHWEquip; ++Loop) {
3498 2 : auto &hotWaterEq = state.dataHeatBal->ZoneHWEq(Loop);
3499 :
3500 2 : if (Loop == 1) {
3501 1 : print(state.files.eio,
3502 : Format_723,
3503 : "HotWaterEquipment",
3504 : "Equipment Level {W},Equipment/Floor Area {W/m2},Equipment per person {W/person},Fraction Latent,Fraction Radiant,Fraction "
3505 : "Lost,Fraction Convected,End-Use SubCategory,"
3506 : "Minimum Equipment Level for All Day Types {W},Maximum Equipment Level for All Day Types {W},"
3507 : "Minimum Equipment Level for Weekdays {W}, Maximum Equipment Level for Weekdays {W},"
3508 : "Minimum Equipment Level for Weekends/Holidays {W}, Maximum Equipment Level for Weekends /Holidays {W},"
3509 : "Minimum Equipment Level for Summer Design Days {W}, Maximum Equipment Level for Summer Design Days {W},"
3510 : "Minimum Equipment Level for Winter Design Days {W}, Maximum Equipment Level for Winter Design Days {W}\n");
3511 : }
3512 :
3513 2 : if (hotWaterEq.ZonePtr == 0) {
3514 0 : print(state.files.eio, Format_724, "Hot Water Equipment-Illegal Zone specified", hotWaterEq.Name);
3515 0 : continue;
3516 : }
3517 :
3518 2 : auto const &zone = state.dataHeatBal->Zone(hotWaterEq.ZonePtr);
3519 :
3520 2 : print(state.files.eio,
3521 : Format_722,
3522 : "HotWaterEquipment",
3523 2 : hotWaterEq.Name,
3524 2 : hotWaterEq.sched->Name,
3525 2 : zone.Name,
3526 2 : zone.FloorArea,
3527 2 : zone.TotOccupants);
3528 :
3529 2 : print(state.files.eio, "{:.3R},", hotWaterEq.DesignLevel);
3530 :
3531 2 : print_and_divide_if_greater_than_zero(hotWaterEq.DesignLevel, zone.FloorArea);
3532 2 : print_and_divide_if_greater_than_zero(hotWaterEq.DesignLevel, zone.TotOccupants);
3533 :
3534 2 : print(state.files.eio, "{:.3R},", hotWaterEq.FractionLatent);
3535 2 : print(state.files.eio, "{:.3R},", hotWaterEq.FractionRadiant);
3536 2 : print(state.files.eio, "{:.3R},", hotWaterEq.FractionLost);
3537 2 : print(state.files.eio, "{:.3R},", hotWaterEq.FractionConvected);
3538 2 : print(state.files.eio, "{},", hotWaterEq.EndUseSubcategory);
3539 2 : print(state.files.eio, "{:.3R},", hotWaterEq.NomMinDesignLevel);
3540 2 : print(state.files.eio, "{:.3R},", hotWaterEq.NomMaxDesignLevel);
3541 :
3542 : Real64 SchMin, SchMax;
3543 : // weekdays
3544 2 : std::tie(SchMin, SchMax) = hotWaterEq.sched->getMinMaxValsByDayType(state, Sched::DayTypeGroup::Weekday);
3545 2 : print(state.files.eio, "{:.3R},", hotWaterEq.DesignLevel * SchMin);
3546 2 : print(state.files.eio, "{:.3R},", hotWaterEq.DesignLevel * SchMax);
3547 :
3548 : // weekends/holidays
3549 2 : std::tie(SchMin, SchMax) = hotWaterEq.sched->getMinMaxValsByDayType(state, Sched::DayTypeGroup::WeekEndHoliday);
3550 2 : print(state.files.eio, "{:.3R},", hotWaterEq.DesignLevel * SchMin);
3551 2 : print(state.files.eio, "{:.3R},", hotWaterEq.DesignLevel * SchMax);
3552 :
3553 : // summer design days
3554 2 : std::tie(SchMin, SchMax) = hotWaterEq.sched->getMinMaxValsByDayType(state, Sched::DayTypeGroup::SummerDesignDay);
3555 2 : print(state.files.eio, "{:.3R},", hotWaterEq.DesignLevel * SchMin);
3556 2 : print(state.files.eio, "{:.3R},", hotWaterEq.DesignLevel * SchMax);
3557 :
3558 : // winter design days
3559 2 : std::tie(SchMin, SchMax) = hotWaterEq.sched->getMinMaxValsByDayType(state, Sched::DayTypeGroup::WinterDesignDay);
3560 2 : print(state.files.eio, "{:.3R},", hotWaterEq.DesignLevel * SchMin);
3561 2 : print(state.files.eio, "{:.3R}\n", hotWaterEq.DesignLevel * SchMax);
3562 : }
3563 :
3564 169 : for (int Loop = 1; Loop <= state.dataHeatBal->TotStmEquip; ++Loop) {
3565 2 : auto &steamEq = state.dataHeatBal->ZoneSteamEq(Loop);
3566 :
3567 2 : if (Loop == 1) {
3568 1 : print(state.files.eio,
3569 : Format_723,
3570 : "SteamEquipment",
3571 : "Equipment Level {W},Equipment/Floor Area {W/m2},Equipment per person {W/person},Fraction Latent,Fraction Radiant,Fraction "
3572 : "Lost,Fraction Convected,End-Use SubCategory,"
3573 : "Minimum Equipment Level for All Day Types {W},Maximum Equipment Level for All Day Types {W},"
3574 : "Minimum Equipment Level for Weekdays {W}, Maximum Equipment Level for Weekdays {W},"
3575 : "Minimum Equipment Level for Weekends/Holidays {W}, Maximum Equipment Level for Weekends /Holidays {W},"
3576 : "Minimum Equipment Level for Summer Design Days {W}, Maximum Equipment Level for Summer Design Days {W},"
3577 : "Minimum Equipment Level for Winter Design Days {W}, Maximum Equipment Level for Winter Design Days {W}\n");
3578 : }
3579 :
3580 2 : if (steamEq.ZonePtr == 0) {
3581 0 : print(state.files.eio, Format_724, "Steam Equipment-Illegal Zone specified", steamEq.Name);
3582 0 : continue;
3583 : }
3584 :
3585 2 : auto &zone = state.dataHeatBal->Zone(steamEq.ZonePtr);
3586 :
3587 2 : print(state.files.eio, Format_722, "SteamEquipment", steamEq.Name, steamEq.sched->Name, zone.Name, zone.FloorArea, zone.TotOccupants);
3588 2 : print(state.files.eio, "{:.3R},", steamEq.DesignLevel);
3589 :
3590 2 : print_and_divide_if_greater_than_zero(steamEq.DesignLevel, zone.FloorArea);
3591 2 : print_and_divide_if_greater_than_zero(steamEq.DesignLevel, zone.TotOccupants);
3592 :
3593 2 : print(state.files.eio, "{:.3R},", steamEq.FractionLatent);
3594 2 : print(state.files.eio, "{:.3R},", steamEq.FractionRadiant);
3595 2 : print(state.files.eio, "{:.3R},", steamEq.FractionLost);
3596 2 : print(state.files.eio, "{:.3R},", steamEq.FractionConvected);
3597 2 : print(state.files.eio, "{},", steamEq.EndUseSubcategory);
3598 2 : print(state.files.eio, "{:.3R},", steamEq.NomMinDesignLevel);
3599 2 : print(state.files.eio, "{:.3R},", steamEq.NomMaxDesignLevel);
3600 :
3601 : Real64 SchMin, SchMax;
3602 : // weekdays
3603 2 : std::tie(SchMin, SchMax) = steamEq.sched->getMinMaxValsByDayType(state, Sched::DayTypeGroup::Weekday);
3604 2 : print(state.files.eio, "{:.3R},", steamEq.DesignLevel * SchMin);
3605 2 : print(state.files.eio, "{:.3R},", steamEq.DesignLevel * SchMax);
3606 :
3607 : // weekends/holidays
3608 2 : std::tie(SchMin, SchMax) = steamEq.sched->getMinMaxValsByDayType(state, Sched::DayTypeGroup::WeekEndHoliday);
3609 2 : print(state.files.eio, "{:.3R},", steamEq.DesignLevel * SchMin);
3610 2 : print(state.files.eio, "{:.3R},", steamEq.DesignLevel * SchMax);
3611 :
3612 : // summer design days
3613 2 : std::tie(SchMin, SchMax) = steamEq.sched->getMinMaxValsByDayType(state, Sched::DayTypeGroup::SummerDesignDay);
3614 2 : print(state.files.eio, "{:.3R},", steamEq.DesignLevel * SchMin);
3615 2 : print(state.files.eio, "{:.3R},", steamEq.DesignLevel * SchMax);
3616 :
3617 : // winter design days
3618 2 : std::tie(SchMin, SchMax) = steamEq.sched->getMinMaxValsByDayType(state, Sched::DayTypeGroup::WinterDesignDay);
3619 2 : print(state.files.eio, "{:.3R},", steamEq.DesignLevel * SchMin);
3620 2 : print(state.files.eio, "{:.3R}\n", steamEq.DesignLevel * SchMax);
3621 : }
3622 :
3623 219 : for (int Loop = 1; Loop <= state.dataHeatBal->TotOthEquip; ++Loop) {
3624 52 : if (Loop == 1) {
3625 25 : print(state.files.eio,
3626 : Format_723,
3627 : "OtherEquipment",
3628 : "Equipment Level {W},Equipment/Floor Area {W/m2},Equipment per person {W/person},Fraction Latent,Fraction Radiant,Fraction "
3629 : "Lost,Fraction Convected,"
3630 : "Minimum Equipment Level for All Day Types {W},Maximum Equipment Level for All Day Types {W},"
3631 : "Minimum Equipment Level for Weekdays {W}, Maximum Equipment Level for Weekdays {W},"
3632 : "Minimum Equipment Level for Weekends/Holidays {W}, Maximum Equipment Level for Weekends /Holidays {W},"
3633 : "Minimum Equipment Level for Summer Design Days {W}, Maximum Equipment Level for Summer Design Days {W},"
3634 : "Minimum Equipment Level for Winter Design Days {W}, Maximum Equipment Level for Winter Design Days {W}\n");
3635 : }
3636 :
3637 52 : auto &otherEq = state.dataHeatBal->ZoneOtherEq(Loop);
3638 :
3639 52 : if (otherEq.ZonePtr == 0) {
3640 0 : print(state.files.eio, Format_724, "Other Equipment-Illegal Zone specified", otherEq.Name);
3641 0 : continue;
3642 : }
3643 :
3644 52 : auto const &zone = state.dataHeatBal->Zone(otherEq.ZonePtr);
3645 :
3646 52 : print(state.files.eio, Format_722, "OtherEquipment", otherEq.Name, otherEq.sched->Name, zone.Name, zone.FloorArea, zone.TotOccupants);
3647 52 : print(state.files.eio, "{:.3R},", otherEq.DesignLevel);
3648 :
3649 52 : print_and_divide_if_greater_than_zero(otherEq.DesignLevel, zone.FloorArea);
3650 52 : print_and_divide_if_greater_than_zero(otherEq.DesignLevel, zone.TotOccupants);
3651 :
3652 52 : print(state.files.eio, "{:.3R},", otherEq.FractionLatent);
3653 52 : print(state.files.eio, "{:.3R},", otherEq.FractionRadiant);
3654 52 : print(state.files.eio, "{:.3R},", otherEq.FractionLost);
3655 52 : print(state.files.eio, "{:.3R},", otherEq.FractionConvected);
3656 52 : print(state.files.eio, "{:.3R},", otherEq.NomMinDesignLevel);
3657 52 : print(state.files.eio, "{:.3R},", otherEq.NomMaxDesignLevel);
3658 :
3659 : Real64 SchMin, SchMax;
3660 :
3661 : // weekdays
3662 52 : std::tie(SchMin, SchMax) = otherEq.sched->getMinMaxValsByDayType(state, Sched::DayTypeGroup::Weekday);
3663 52 : print(state.files.eio, "{:.3R},", otherEq.DesignLevel * SchMin);
3664 52 : print(state.files.eio, "{:.3R},", otherEq.DesignLevel * SchMax);
3665 :
3666 : // weekends/holidays
3667 52 : std::tie(SchMin, SchMax) = otherEq.sched->getMinMaxValsByDayType(state, Sched::DayTypeGroup::WeekEndHoliday);
3668 52 : print(state.files.eio, "{:.3R},", otherEq.DesignLevel * SchMin);
3669 52 : print(state.files.eio, "{:.3R},", otherEq.DesignLevel * SchMax);
3670 :
3671 : // summer design days
3672 52 : std::tie(SchMin, SchMax) = otherEq.sched->getMinMaxValsByDayType(state, Sched::DayTypeGroup::SummerDesignDay);
3673 52 : print(state.files.eio, "{:.3R},", otherEq.DesignLevel * SchMin);
3674 52 : print(state.files.eio, "{:.3R},", otherEq.DesignLevel * SchMax);
3675 :
3676 : // winter design days
3677 52 : std::tie(SchMin, SchMax) = otherEq.sched->getMinMaxValsByDayType(state, Sched::DayTypeGroup::WinterDesignDay);
3678 52 : print(state.files.eio, "{:.3R},", otherEq.DesignLevel * SchMin);
3679 52 : print(state.files.eio, "{:.3R}\n", otherEq.DesignLevel * SchMax);
3680 : }
3681 :
3682 179 : for (int Loop = 1; Loop <= state.dataHeatBal->TotITEquip; ++Loop) {
3683 12 : auto &itEq = state.dataHeatBal->ZoneITEq(Loop);
3684 :
3685 12 : if (Loop == 1) {
3686 12 : print(state.files.eio,
3687 : Format_723,
3688 : "ElectricEquipment:ITE:AirCooled",
3689 : "Equipment Level {W},"
3690 : "Equipment/Floor Area {W/m2},Equipment per person {W/person},"
3691 : "Fraction Convected,CPU End-Use SubCategory,Fan End-Use SubCategory,UPS End-Use SubCategory,"
3692 : "Minimum Equipment Level for All Day Types {W},Maximum Equipment Level for All Day Types {W},"
3693 : "Minimum Equipment Level for Weekdays {W}, Maximum Equipment Level for Weekdays {W},"
3694 : "Minimum Equipment Level for Weekends/Holidays {W}, Maximum Equipment Level for Weekends /Holidays {W},"
3695 : "Minimum Equipment Level for Summer Design Days {W}, Maximum Equipment Level for Summer Design Days {W},"
3696 : "Minimum Equipment Level for Winter Design Days {W}, Maximum Equipment Level for Winter Design Days {W},"
3697 : "Design Air Volume Flow Rate {m3/s}\n");
3698 : }
3699 :
3700 12 : if (itEq.ZonePtr == 0) {
3701 0 : print(state.files.eio, Format_724, "ElectricEquipment:ITE:AirCooled-Illegal Zone specified", itEq.Name);
3702 0 : continue;
3703 : }
3704 :
3705 12 : auto const &zone = state.dataHeatBal->Zone(itEq.ZonePtr);
3706 12 : print(state.files.eio,
3707 : Format_722,
3708 : "ElectricEquipment:ITE:AirCooled",
3709 12 : itEq.Name,
3710 12 : itEq.operSched->Name,
3711 12 : zone.Name,
3712 12 : zone.FloorArea,
3713 12 : zone.TotOccupants);
3714 :
3715 12 : print(state.files.eio, "{:.3R},", itEq.DesignTotalPower);
3716 :
3717 12 : print_and_divide_if_greater_than_zero(itEq.DesignTotalPower, zone.FloorArea);
3718 12 : print_and_divide_if_greater_than_zero(itEq.DesignTotalPower, zone.TotOccupants);
3719 :
3720 : // ElectricEquipment:ITE:AirCooled is 100% convective
3721 12 : print(state.files.eio, "1.0,");
3722 :
3723 12 : print(state.files.eio, "{},", itEq.EndUseSubcategoryCPU);
3724 12 : print(state.files.eio, "{},", itEq.EndUseSubcategoryFan);
3725 12 : print(state.files.eio, "{},", itEq.EndUseSubcategoryUPS);
3726 12 : print(state.files.eio, "{:.3R},", itEq.NomMinDesignLevel);
3727 12 : print(state.files.eio, "{:.3R},", itEq.NomMaxDesignLevel);
3728 :
3729 : Real64 SchMin, SchMax;
3730 : // weekdays
3731 12 : std::tie(SchMin, SchMax) = itEq.operSched->getMinMaxValsByDayType(state, Sched::DayTypeGroup::Weekday);
3732 12 : print(state.files.eio, "{:.3R},", itEq.DesignTotalPower * SchMin);
3733 12 : print(state.files.eio, "{:.3R},", itEq.DesignTotalPower * SchMax);
3734 :
3735 : // weekends/holidays
3736 12 : std::tie(SchMin, SchMax) = itEq.operSched->getMinMaxValsByDayType(state, Sched::DayTypeGroup::WeekEndHoliday);
3737 12 : print(state.files.eio, "{:.3R},", itEq.DesignTotalPower * SchMin);
3738 12 : print(state.files.eio, "{:.3R},", itEq.DesignTotalPower * SchMax);
3739 :
3740 : // summer design days
3741 12 : std::tie(SchMin, SchMax) = itEq.operSched->getMinMaxValsByDayType(state, Sched::DayTypeGroup::SummerDesignDay);
3742 12 : print(state.files.eio, "{:.3R},", itEq.DesignTotalPower * SchMin);
3743 12 : print(state.files.eio, "{:.3R},", itEq.DesignTotalPower * SchMax);
3744 :
3745 : // winter design days
3746 12 : std::tie(SchMin, SchMax) = itEq.operSched->getMinMaxValsByDayType(state, Sched::DayTypeGroup::WinterDesignDay);
3747 12 : print(state.files.eio, "{:.3R},", itEq.DesignTotalPower * SchMin);
3748 12 : print(state.files.eio, "{:.3R},", itEq.DesignTotalPower * SchMax);
3749 :
3750 12 : print(state.files.eio, "{:.10R}\n", itEq.DesignAirVolFlowRate);
3751 : }
3752 :
3753 169 : for (int Loop = 1; Loop <= state.dataHeatBal->TotBBHeat; ++Loop) {
3754 2 : auto &bbHeat = state.dataHeatBal->ZoneBBHeat(Loop);
3755 2 : if (Loop == 1) {
3756 1 : print(state.files.eio,
3757 : Format_723,
3758 : "Outdoor Controlled Baseboard Heat",
3759 : "Capacity at Low Temperature {W},Low Temperature {C},Capacity at High Temperature "
3760 : "{W},High Temperature {C},Fraction Radiant,Fraction Convected,End-Use Subcategory\n");
3761 : }
3762 :
3763 2 : if (bbHeat.ZonePtr == 0) {
3764 0 : print(state.files.eio, Format_724, "Outdoor Controlled Baseboard Heat-Illegal Zone specified", bbHeat.Name);
3765 0 : continue;
3766 : }
3767 :
3768 2 : auto const &zone = state.dataHeatBal->Zone(bbHeat.ZonePtr);
3769 :
3770 2 : print(state.files.eio,
3771 : Format_722,
3772 : "Outdoor Controlled Baseboard Heat",
3773 2 : bbHeat.Name,
3774 2 : bbHeat.sched->Name,
3775 2 : zone.Name,
3776 2 : zone.FloorArea,
3777 2 : zone.TotOccupants);
3778 :
3779 2 : print(state.files.eio, "{:.3R},", bbHeat.CapatLowTemperature);
3780 2 : print(state.files.eio, "{:.3R},", bbHeat.LowTemperature);
3781 2 : print(state.files.eio, "{:.3R},", bbHeat.CapatHighTemperature);
3782 2 : print(state.files.eio, "{:.3R},", bbHeat.HighTemperature);
3783 2 : print(state.files.eio, "{:.3R},", bbHeat.FractionRadiant);
3784 2 : print(state.files.eio, "{:.3R},", bbHeat.FractionConvected);
3785 2 : print(state.files.eio, "{}\n", bbHeat.EndUseSubcategory);
3786 : }
3787 239 : }
3788 :
3789 2379 : void setupIHGZonesAndSpaces(EnergyPlusData &state,
3790 : const std::string &objectType,
3791 : EPVector<InternalHeatGains::GlobalInternalGainMiscObject> &inputObjects,
3792 : int &numInputObjects,
3793 : int &numGainInstances,
3794 : bool &errors,
3795 : const bool zoneListNotAllowed)
3796 : {
3797 : // This function pre-processes the input objects for objectType and determines the ultimate number
3798 : // of simulation instances for each input object after expansion for SpaceList, Zone, or ZoneList.
3799 : // inputObjects is allocated here and filled with data for further input processing.
3800 :
3801 2379 : constexpr std::string_view routineName = "setupIHGZonesAndSpaces: ";
3802 :
3803 2379 : auto &ip = state.dataInputProcessing->inputProcessor;
3804 2379 : auto const instances = ip->epJSON.find(objectType);
3805 2379 : if (instances != ip->epJSON.end()) {
3806 2379 : bool localErrFlag = false;
3807 2379 : auto const &objectSchemaProps = ip->getObjectSchemaProps(state, objectType);
3808 2379 : auto &instancesValue = instances.value();
3809 2379 : numInputObjects = int(instancesValue.size());
3810 2379 : inputObjects.allocate(numInputObjects);
3811 :
3812 2379 : numGainInstances = 0;
3813 2379 : int counter = 0;
3814 2767 : for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) {
3815 388 : auto const &objectFields = instance.value();
3816 388 : std::string const &thisObjectName = Util::makeUPPER(instance.key());
3817 388 : ip->markObjectAsUsed(objectType, instance.key());
3818 :
3819 : // For incoming idf, maintain object order
3820 388 : ++counter;
3821 388 : int objNum = ip->getIDFObjNum(state, objectType, counter);
3822 388 : inputObjects(objNum).Name = thisObjectName;
3823 388 : std::string areaFieldName;
3824 388 : if (zoneListNotAllowed) {
3825 38 : areaFieldName = "zone_or_space_name";
3826 : } else {
3827 350 : areaFieldName = "zone_or_zonelist_or_space_or_spacelist_name";
3828 : }
3829 388 : std::string areaName = ip->getAlphaFieldValue(objectFields, objectSchemaProps, areaFieldName);
3830 :
3831 388 : int zoneNum = Util::FindItemInList(areaName, state.dataHeatBal->Zone);
3832 388 : if (zoneNum > 0) {
3833 344 : inputObjects(objNum).spaceStartPtr = numGainInstances + 1;
3834 344 : int numSpaces = state.dataHeatBal->Zone(zoneNum).numSpaces;
3835 344 : numGainInstances += numSpaces;
3836 344 : inputObjects(objNum).numOfSpaces = numSpaces;
3837 344 : inputObjects(objNum).ZoneListActive = false;
3838 344 : if (numSpaces == 1) {
3839 328 : inputObjects(objNum).spaceNums.emplace_back(state.dataHeatBal->Zone(zoneNum).spaceIndexes(1));
3840 328 : inputObjects(objNum).names.emplace_back(inputObjects(objNum).Name);
3841 : } else {
3842 48 : for (int const spaceNum : state.dataHeatBal->Zone(zoneNum).spaceIndexes) {
3843 32 : inputObjects(objNum).spaceNums.emplace_back(spaceNum);
3844 32 : inputObjects(objNum).names.emplace_back(state.dataHeatBal->space(spaceNum).Name + ' ' + inputObjects(objNum).Name);
3845 : }
3846 : }
3847 344 : continue;
3848 344 : }
3849 44 : int spaceNum = Util::FindItemInList(areaName, state.dataHeatBal->space);
3850 44 : if (spaceNum > 0) {
3851 36 : inputObjects(objNum).spaceStartPtr = numGainInstances + 1;
3852 36 : ++numGainInstances;
3853 36 : inputObjects(objNum).numOfSpaces = 1;
3854 36 : inputObjects(objNum).spaceListActive = false;
3855 36 : inputObjects(objNum).spaceOrSpaceListPtr = spaceNum;
3856 36 : inputObjects(objNum).spaceNums.emplace_back(spaceNum);
3857 36 : inputObjects(objNum).names.emplace_back(inputObjects(objNum).Name);
3858 36 : continue;
3859 : }
3860 8 : int zoneListNum = Util::FindItemInList(areaName, state.dataHeatBal->ZoneList);
3861 8 : if (zoneListNum > 0) {
3862 6 : if (zoneListNotAllowed) {
3863 0 : ShowSevereError(
3864 0 : state, format("{}=\"{}\" ZoneList Name=\"{}\" not allowed for {}.", objectType, thisObjectName, areaName, objectType));
3865 0 : errors = true;
3866 0 : localErrFlag = true;
3867 : } else {
3868 :
3869 6 : inputObjects(objNum).spaceStartPtr = numGainInstances + 1;
3870 6 : int numSpaces = 0;
3871 15 : for (int const listZoneIdx : state.dataHeatBal->ZoneList(zoneListNum).Zone) {
3872 9 : numSpaces += state.dataHeatBal->Zone(listZoneIdx).numSpaces;
3873 20 : for (int const spaceNum2 : state.dataHeatBal->Zone(listZoneIdx).spaceIndexes) {
3874 11 : inputObjects(objNum).spaceNums.emplace_back(spaceNum2);
3875 11 : inputObjects(objNum).names.emplace_back(state.dataHeatBal->space(spaceNum2).Name + ' ' + inputObjects(objNum).Name);
3876 : }
3877 : }
3878 6 : numGainInstances += numSpaces;
3879 6 : inputObjects(objNum).numOfSpaces = numSpaces;
3880 6 : inputObjects(objNum).ZoneListActive = true;
3881 : }
3882 6 : continue;
3883 6 : }
3884 2 : int spaceListNum = Util::FindItemInList(areaName, state.dataHeatBal->spaceList);
3885 2 : if (spaceListNum > 0) {
3886 2 : if (zoneListNotAllowed) {
3887 0 : ShowSevereError(
3888 0 : state, format("{}=\"{}\" SpaceList Name=\"{}\" not allowed for {}.", objectType, thisObjectName, areaName, objectType));
3889 0 : errors = true;
3890 0 : localErrFlag = true;
3891 : } else {
3892 2 : inputObjects(objNum).spaceStartPtr = numGainInstances + 1;
3893 2 : int numSpaces = state.dataHeatBal->spaceList(spaceListNum).numListSpaces;
3894 2 : numGainInstances += numSpaces;
3895 2 : inputObjects(objNum).numOfSpaces = numSpaces;
3896 2 : inputObjects(objNum).spaceListActive = true;
3897 2 : inputObjects(objNum).spaceOrSpaceListPtr = spaceListNum;
3898 6 : for (int const spaceNum2 : state.dataHeatBal->spaceList(spaceListNum).spaces) {
3899 4 : inputObjects(objNum).spaceNums.emplace_back(spaceNum2);
3900 4 : inputObjects(objNum).names.emplace_back(state.dataHeatBal->space(spaceNum2).Name + ' ' + inputObjects(objNum).Name);
3901 : }
3902 : }
3903 2 : continue;
3904 2 : }
3905 0 : ShowSevereError(state, format("{}=\"{}\" invalid {}=\"{}\" not found.", objectType, thisObjectName, areaFieldName, areaName));
3906 0 : errors = true;
3907 0 : localErrFlag = true;
3908 1164 : }
3909 2379 : if (localErrFlag) {
3910 0 : ShowSevereError(state, format("{}Errors with invalid names in {} objects.", routineName, objectType));
3911 0 : ShowContinueError(state, "...These will not be read in. Other errors may occur.");
3912 0 : numGainInstances = 0;
3913 : }
3914 : }
3915 2379 : }
3916 :
3917 167 : void setupIHGOutputs(EnergyPlusData &state)
3918 : {
3919 373 : for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) {
3920 : // Overall Zone Variables
3921 412 : SetupOutputVariable(state,
3922 : "Zone Total Internal Radiant Heating Energy",
3923 : Constant::Units::J,
3924 206 : state.dataHeatBal->ZoneRpt(zoneNum).TotRadiantGain,
3925 : OutputProcessor::TimeStepType::Zone,
3926 : OutputProcessor::StoreType::Sum,
3927 206 : state.dataHeatBal->Zone(zoneNum).Name);
3928 412 : SetupOutputVariable(state,
3929 : "Zone Total Internal Radiant Heating Rate",
3930 : Constant::Units::W,
3931 206 : state.dataHeatBal->ZoneRpt(zoneNum).TotRadiantGainRate,
3932 : OutputProcessor::TimeStepType::Zone,
3933 : OutputProcessor::StoreType::Average,
3934 206 : state.dataHeatBal->Zone(zoneNum).Name);
3935 412 : SetupOutputVariable(state,
3936 : "Zone Total Internal Visible Radiation Heating Energy",
3937 : Constant::Units::J,
3938 206 : state.dataHeatBal->ZoneRpt(zoneNum).TotVisHeatGain,
3939 : OutputProcessor::TimeStepType::Zone,
3940 : OutputProcessor::StoreType::Sum,
3941 206 : state.dataHeatBal->Zone(zoneNum).Name);
3942 412 : SetupOutputVariable(state,
3943 : "Zone Total Internal Visible Radiation Heating Rate",
3944 : Constant::Units::W,
3945 206 : state.dataHeatBal->ZoneRpt(zoneNum).TotVisHeatGainRate,
3946 : OutputProcessor::TimeStepType::Zone,
3947 : OutputProcessor::StoreType::Average,
3948 206 : state.dataHeatBal->Zone(zoneNum).Name);
3949 412 : SetupOutputVariable(state,
3950 : "Zone Total Internal Convective Heating Energy",
3951 : Constant::Units::J,
3952 206 : state.dataHeatBal->ZoneRpt(zoneNum).TotConvectiveGain,
3953 : OutputProcessor::TimeStepType::Zone,
3954 : OutputProcessor::StoreType::Sum,
3955 206 : state.dataHeatBal->Zone(zoneNum).Name);
3956 412 : SetupOutputVariable(state,
3957 : "Zone Total Internal Convective Heating Rate",
3958 : Constant::Units::W,
3959 206 : state.dataHeatBal->ZoneRpt(zoneNum).TotConvectiveGainRate,
3960 : OutputProcessor::TimeStepType::Zone,
3961 : OutputProcessor::StoreType::Average,
3962 206 : state.dataHeatBal->Zone(zoneNum).Name);
3963 412 : SetupOutputVariable(state,
3964 : "Zone Total Internal Latent Gain Energy",
3965 : Constant::Units::J,
3966 206 : state.dataHeatBal->ZoneRpt(zoneNum).TotLatentGain,
3967 : OutputProcessor::TimeStepType::Zone,
3968 : OutputProcessor::StoreType::Sum,
3969 206 : state.dataHeatBal->Zone(zoneNum).Name);
3970 412 : SetupOutputVariable(state,
3971 : "Zone Total Internal Latent Gain Rate",
3972 : Constant::Units::W,
3973 206 : state.dataHeatBal->ZoneRpt(zoneNum).TotLatentGainRate,
3974 : OutputProcessor::TimeStepType::Zone,
3975 : OutputProcessor::StoreType::Average,
3976 206 : state.dataHeatBal->Zone(zoneNum).Name);
3977 412 : SetupOutputVariable(state,
3978 : "Zone Total Internal Total Heating Energy",
3979 : Constant::Units::J,
3980 206 : state.dataHeatBal->ZoneRpt(zoneNum).TotTotalHeatGain,
3981 : OutputProcessor::TimeStepType::Zone,
3982 : OutputProcessor::StoreType::Sum,
3983 206 : state.dataHeatBal->Zone(zoneNum).Name);
3984 412 : SetupOutputVariable(state,
3985 : "Zone Total Internal Total Heating Rate",
3986 : Constant::Units::W,
3987 206 : state.dataHeatBal->ZoneRpt(zoneNum).TotTotalHeatGainRate,
3988 : OutputProcessor::TimeStepType::Zone,
3989 : OutputProcessor::StoreType::Average,
3990 206 : state.dataHeatBal->Zone(zoneNum).Name);
3991 : }
3992 :
3993 392 : for (int spaceNum = 1; spaceNum <= state.dataGlobal->numSpaces; ++spaceNum) {
3994 : // Overall Space Variables
3995 450 : SetupOutputVariable(state,
3996 : "Space Total Internal Radiant Heating Energy",
3997 : Constant::Units::J,
3998 225 : state.dataHeatBal->spaceRpt(spaceNum).TotRadiantGain,
3999 : OutputProcessor::TimeStepType::Zone,
4000 : OutputProcessor::StoreType::Sum,
4001 225 : state.dataHeatBal->space(spaceNum).Name);
4002 450 : SetupOutputVariable(state,
4003 : "Space Total Internal Radiant Heating Rate",
4004 : Constant::Units::W,
4005 225 : state.dataHeatBal->spaceRpt(spaceNum).TotRadiantGainRate,
4006 : OutputProcessor::TimeStepType::Zone,
4007 : OutputProcessor::StoreType::Average,
4008 225 : state.dataHeatBal->space(spaceNum).Name);
4009 450 : SetupOutputVariable(state,
4010 : "Space Total Internal Visible Radiation Heating Energy",
4011 : Constant::Units::J,
4012 225 : state.dataHeatBal->spaceRpt(spaceNum).TotVisHeatGain,
4013 : OutputProcessor::TimeStepType::Zone,
4014 : OutputProcessor::StoreType::Sum,
4015 225 : state.dataHeatBal->space(spaceNum).Name);
4016 450 : SetupOutputVariable(state,
4017 : "Space Total Internal Visible Radiation Heating Rate",
4018 : Constant::Units::W,
4019 225 : state.dataHeatBal->spaceRpt(spaceNum).TotVisHeatGainRate,
4020 : OutputProcessor::TimeStepType::Zone,
4021 : OutputProcessor::StoreType::Average,
4022 225 : state.dataHeatBal->space(spaceNum).Name);
4023 450 : SetupOutputVariable(state,
4024 : "Space Total Internal Convective Heating Energy",
4025 : Constant::Units::J,
4026 225 : state.dataHeatBal->spaceRpt(spaceNum).TotConvectiveGain,
4027 : OutputProcessor::TimeStepType::Zone,
4028 : OutputProcessor::StoreType::Sum,
4029 225 : state.dataHeatBal->space(spaceNum).Name);
4030 450 : SetupOutputVariable(state,
4031 : "Space Total Internal Convective Heating Rate",
4032 : Constant::Units::W,
4033 225 : state.dataHeatBal->spaceRpt(spaceNum).TotConvectiveGainRate,
4034 : OutputProcessor::TimeStepType::Zone,
4035 : OutputProcessor::StoreType::Average,
4036 225 : state.dataHeatBal->space(spaceNum).Name);
4037 450 : SetupOutputVariable(state,
4038 : "Space Total Internal Latent Gain Energy",
4039 : Constant::Units::J,
4040 225 : state.dataHeatBal->spaceRpt(spaceNum).TotLatentGain,
4041 : OutputProcessor::TimeStepType::Zone,
4042 : OutputProcessor::StoreType::Sum,
4043 225 : state.dataHeatBal->space(spaceNum).Name);
4044 450 : SetupOutputVariable(state,
4045 : "Space Total Internal Latent Gain Rate",
4046 : Constant::Units::W,
4047 225 : state.dataHeatBal->spaceRpt(spaceNum).TotLatentGainRate,
4048 : OutputProcessor::TimeStepType::Zone,
4049 : OutputProcessor::StoreType::Average,
4050 225 : state.dataHeatBal->space(spaceNum).Name);
4051 450 : SetupOutputVariable(state,
4052 : "Space Total Internal Total Heating Energy",
4053 : Constant::Units::J,
4054 225 : state.dataHeatBal->spaceRpt(spaceNum).TotTotalHeatGain,
4055 : OutputProcessor::TimeStepType::Zone,
4056 : OutputProcessor::StoreType::Sum,
4057 225 : state.dataHeatBal->space(spaceNum).Name);
4058 450 : SetupOutputVariable(state,
4059 : "Space Total Internal Total Heating Rate",
4060 : Constant::Units::W,
4061 225 : state.dataHeatBal->spaceRpt(spaceNum).TotTotalHeatGainRate,
4062 : OutputProcessor::TimeStepType::Zone,
4063 : OutputProcessor::StoreType::Average,
4064 225 : state.dataHeatBal->space(spaceNum).Name);
4065 : }
4066 :
4067 : // Add zone and space outputs only where the particular type of equipment is actually present
4068 167 : Array1D_bool addZoneOutputs;
4069 167 : addZoneOutputs.dimension(state.dataGlobal->NumOfZones, false);
4070 167 : Array1D_bool addSpaceOutputs;
4071 167 : addSpaceOutputs.dimension(state.dataGlobal->numSpaces, false);
4072 :
4073 244 : for (int peopleNum = 1; peopleNum <= state.dataHeatBal->TotPeople; ++peopleNum) {
4074 : // Set flags for zone and space total report variables
4075 77 : addZoneOutputs(state.dataHeatBal->People(peopleNum).ZonePtr) = true;
4076 77 : addSpaceOutputs(state.dataHeatBal->People(peopleNum).spaceIndex) = true;
4077 : // Object report variables
4078 154 : SetupOutputVariable(state,
4079 : "People Occupant Count",
4080 : Constant::Units::None,
4081 77 : state.dataHeatBal->People(peopleNum).NumOcc,
4082 : OutputProcessor::TimeStepType::Zone,
4083 : OutputProcessor::StoreType::Average,
4084 77 : state.dataHeatBal->People(peopleNum).Name);
4085 154 : SetupOutputVariable(state,
4086 : "People Radiant Heating Energy",
4087 : Constant::Units::J,
4088 77 : state.dataHeatBal->People(peopleNum).RadGainEnergy,
4089 : OutputProcessor::TimeStepType::Zone,
4090 : OutputProcessor::StoreType::Sum,
4091 77 : state.dataHeatBal->People(peopleNum).Name);
4092 154 : SetupOutputVariable(state,
4093 : "People Radiant Heating Rate",
4094 : Constant::Units::W,
4095 77 : state.dataHeatBal->People(peopleNum).RadGainRate,
4096 : OutputProcessor::TimeStepType::Zone,
4097 : OutputProcessor::StoreType::Average,
4098 77 : state.dataHeatBal->People(peopleNum).Name);
4099 154 : SetupOutputVariable(state,
4100 : "People Convective Heating Energy",
4101 : Constant::Units::J,
4102 77 : state.dataHeatBal->People(peopleNum).ConGainEnergy,
4103 : OutputProcessor::TimeStepType::Zone,
4104 : OutputProcessor::StoreType::Sum,
4105 77 : state.dataHeatBal->People(peopleNum).Name);
4106 154 : SetupOutputVariable(state,
4107 : "People Convective Heating Rate",
4108 : Constant::Units::W,
4109 77 : state.dataHeatBal->People(peopleNum).ConGainRate,
4110 : OutputProcessor::TimeStepType::Zone,
4111 : OutputProcessor::StoreType::Average,
4112 77 : state.dataHeatBal->People(peopleNum).Name);
4113 154 : SetupOutputVariable(state,
4114 : "People Sensible Heating Energy",
4115 : Constant::Units::J,
4116 77 : state.dataHeatBal->People(peopleNum).SenGainEnergy,
4117 : OutputProcessor::TimeStepType::Zone,
4118 : OutputProcessor::StoreType::Sum,
4119 77 : state.dataHeatBal->People(peopleNum).Name);
4120 154 : SetupOutputVariable(state,
4121 : "People Sensible Heating Rate",
4122 : Constant::Units::W,
4123 77 : state.dataHeatBal->People(peopleNum).SenGainRate,
4124 : OutputProcessor::TimeStepType::Zone,
4125 : OutputProcessor::StoreType::Average,
4126 77 : state.dataHeatBal->People(peopleNum).Name);
4127 154 : SetupOutputVariable(state,
4128 : "People Latent Gain Energy",
4129 : Constant::Units::J,
4130 77 : state.dataHeatBal->People(peopleNum).LatGainEnergy,
4131 : OutputProcessor::TimeStepType::Zone,
4132 : OutputProcessor::StoreType::Sum,
4133 77 : state.dataHeatBal->People(peopleNum).Name);
4134 154 : SetupOutputVariable(state,
4135 : "People Latent Gain Rate",
4136 : Constant::Units::W,
4137 77 : state.dataHeatBal->People(peopleNum).LatGainRate,
4138 : OutputProcessor::TimeStepType::Zone,
4139 : OutputProcessor::StoreType::Average,
4140 77 : state.dataHeatBal->People(peopleNum).Name);
4141 154 : SetupOutputVariable(state,
4142 : "People Total Heating Energy",
4143 : Constant::Units::J,
4144 77 : state.dataHeatBal->People(peopleNum).TotGainEnergy,
4145 : OutputProcessor::TimeStepType::Zone,
4146 : OutputProcessor::StoreType::Sum,
4147 77 : state.dataHeatBal->People(peopleNum).Name);
4148 154 : SetupOutputVariable(state,
4149 : "People Total Heating Rate",
4150 : Constant::Units::W,
4151 77 : state.dataHeatBal->People(peopleNum).TotGainRate,
4152 : OutputProcessor::TimeStepType::Zone,
4153 : OutputProcessor::StoreType::Average,
4154 77 : state.dataHeatBal->People(peopleNum).Name);
4155 154 : SetupOutputVariable(state,
4156 : "People Air Temperature",
4157 : Constant::Units::C,
4158 77 : state.dataHeatBal->People(peopleNum).TemperatureInZone,
4159 : OutputProcessor::TimeStepType::Zone,
4160 : OutputProcessor::StoreType::Average,
4161 77 : state.dataHeatBal->People(peopleNum).Name);
4162 154 : SetupOutputVariable(state,
4163 : "People Air Relative Humidity",
4164 : Constant::Units::Perc,
4165 77 : state.dataHeatBal->People(peopleNum).RelativeHumidityInZone,
4166 : OutputProcessor::TimeStepType::Zone,
4167 : OutputProcessor::StoreType::Average,
4168 77 : state.dataHeatBal->People(peopleNum).Name);
4169 : }
4170 :
4171 373 : for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) {
4172 206 : if (addZoneOutputs(zoneNum)) {
4173 : // Zone total report variables
4174 148 : SetupOutputVariable(state,
4175 : "Zone People Occupant Count",
4176 : Constant::Units::None,
4177 74 : state.dataHeatBal->ZoneRpt(zoneNum).PeopleNumOcc,
4178 : OutputProcessor::TimeStepType::Zone,
4179 : OutputProcessor::StoreType::Average,
4180 74 : state.dataHeatBal->Zone(zoneNum).Name);
4181 148 : SetupOutputVariable(state,
4182 : "Zone People Radiant Heating Energy",
4183 : Constant::Units::J,
4184 74 : state.dataHeatBal->ZoneRpt(zoneNum).PeopleRadGain,
4185 : OutputProcessor::TimeStepType::Zone,
4186 : OutputProcessor::StoreType::Sum,
4187 74 : state.dataHeatBal->Zone(zoneNum).Name);
4188 148 : SetupOutputVariable(state,
4189 : "Zone People Radiant Heating Rate",
4190 : Constant::Units::W,
4191 74 : state.dataHeatBal->ZoneRpt(zoneNum).PeopleRadGainRate,
4192 : OutputProcessor::TimeStepType::Zone,
4193 : OutputProcessor::StoreType::Average,
4194 74 : state.dataHeatBal->Zone(zoneNum).Name);
4195 148 : SetupOutputVariable(state,
4196 : "Zone People Convective Heating Energy",
4197 : Constant::Units::J,
4198 74 : state.dataHeatBal->ZoneRpt(zoneNum).PeopleConGain,
4199 : OutputProcessor::TimeStepType::Zone,
4200 : OutputProcessor::StoreType::Sum,
4201 74 : state.dataHeatBal->Zone(zoneNum).Name);
4202 148 : SetupOutputVariable(state,
4203 : "Zone People Convective Heating Rate",
4204 : Constant::Units::W,
4205 74 : state.dataHeatBal->ZoneRpt(zoneNum).PeopleConGainRate,
4206 : OutputProcessor::TimeStepType::Zone,
4207 : OutputProcessor::StoreType::Average,
4208 74 : state.dataHeatBal->Zone(zoneNum).Name);
4209 148 : SetupOutputVariable(state,
4210 : "Zone People Sensible Heating Energy",
4211 : Constant::Units::J,
4212 74 : state.dataHeatBal->ZoneRpt(zoneNum).PeopleSenGain,
4213 : OutputProcessor::TimeStepType::Zone,
4214 : OutputProcessor::StoreType::Sum,
4215 74 : state.dataHeatBal->Zone(zoneNum).Name);
4216 148 : SetupOutputVariable(state,
4217 : "Zone People Sensible Heating Rate",
4218 : Constant::Units::W,
4219 74 : state.dataHeatBal->ZoneRpt(zoneNum).PeopleSenGainRate,
4220 : OutputProcessor::TimeStepType::Zone,
4221 : OutputProcessor::StoreType::Average,
4222 74 : state.dataHeatBal->Zone(zoneNum).Name);
4223 148 : SetupOutputVariable(state,
4224 : "Zone People Latent Gain Energy",
4225 : Constant::Units::J,
4226 74 : state.dataHeatBal->ZoneRpt(zoneNum).PeopleLatGain,
4227 : OutputProcessor::TimeStepType::Zone,
4228 : OutputProcessor::StoreType::Sum,
4229 74 : state.dataHeatBal->Zone(zoneNum).Name);
4230 148 : SetupOutputVariable(state,
4231 : "Zone People Latent Gain Rate",
4232 : Constant::Units::W,
4233 74 : state.dataHeatBal->ZoneRpt(zoneNum).PeopleLatGainRate,
4234 : OutputProcessor::TimeStepType::Zone,
4235 : OutputProcessor::StoreType::Average,
4236 74 : state.dataHeatBal->Zone(zoneNum).Name);
4237 148 : SetupOutputVariable(state,
4238 : "Zone People Total Heating Energy",
4239 : Constant::Units::J,
4240 74 : state.dataHeatBal->ZoneRpt(zoneNum).PeopleTotGain,
4241 : OutputProcessor::TimeStepType::Zone,
4242 : OutputProcessor::StoreType::Sum,
4243 74 : state.dataHeatBal->Zone(zoneNum).Name);
4244 148 : SetupOutputVariable(state,
4245 : "Zone People Total Heating Rate",
4246 : Constant::Units::W,
4247 74 : state.dataHeatBal->ZoneRpt(zoneNum).PeopleTotGainRate,
4248 : OutputProcessor::TimeStepType::Zone,
4249 : OutputProcessor::StoreType::Average,
4250 74 : state.dataHeatBal->Zone(zoneNum).Name);
4251 : }
4252 : // Reset zone output flag
4253 206 : addZoneOutputs(zoneNum) = false;
4254 : }
4255 :
4256 : // Space total report variables
4257 392 : for (int spaceNum = 1; spaceNum <= state.dataGlobal->numSpaces; ++spaceNum) {
4258 225 : if (addSpaceOutputs(spaceNum)) {
4259 152 : SetupOutputVariable(state,
4260 : "Space People Occupant Count",
4261 : Constant::Units::None,
4262 76 : state.dataHeatBal->spaceRpt(spaceNum).PeopleNumOcc,
4263 : OutputProcessor::TimeStepType::Zone,
4264 : OutputProcessor::StoreType::Average,
4265 76 : state.dataHeatBal->space(spaceNum).Name);
4266 152 : SetupOutputVariable(state,
4267 : "Space People Radiant Heating Energy",
4268 : Constant::Units::J,
4269 76 : state.dataHeatBal->spaceRpt(spaceNum).PeopleRadGain,
4270 : OutputProcessor::TimeStepType::Zone,
4271 : OutputProcessor::StoreType::Sum,
4272 76 : state.dataHeatBal->space(spaceNum).Name);
4273 152 : SetupOutputVariable(state,
4274 : "Space People Radiant Heating Rate",
4275 : Constant::Units::W,
4276 76 : state.dataHeatBal->spaceRpt(spaceNum).PeopleRadGainRate,
4277 : OutputProcessor::TimeStepType::Zone,
4278 : OutputProcessor::StoreType::Average,
4279 76 : state.dataHeatBal->space(spaceNum).Name);
4280 152 : SetupOutputVariable(state,
4281 : "Space People Convective Heating Energy",
4282 : Constant::Units::J,
4283 76 : state.dataHeatBal->spaceRpt(spaceNum).PeopleConGain,
4284 : OutputProcessor::TimeStepType::Zone,
4285 : OutputProcessor::StoreType::Sum,
4286 76 : state.dataHeatBal->space(spaceNum).Name);
4287 152 : SetupOutputVariable(state,
4288 : "Space People Convective Heating Rate",
4289 : Constant::Units::W,
4290 76 : state.dataHeatBal->spaceRpt(spaceNum).PeopleConGainRate,
4291 : OutputProcessor::TimeStepType::Zone,
4292 : OutputProcessor::StoreType::Average,
4293 76 : state.dataHeatBal->space(spaceNum).Name);
4294 152 : SetupOutputVariable(state,
4295 : "Space People Sensible Heating Energy",
4296 : Constant::Units::J,
4297 76 : state.dataHeatBal->spaceRpt(spaceNum).PeopleSenGain,
4298 : OutputProcessor::TimeStepType::Zone,
4299 : OutputProcessor::StoreType::Sum,
4300 76 : state.dataHeatBal->space(spaceNum).Name);
4301 152 : SetupOutputVariable(state,
4302 : "Space People Sensible Heating Rate",
4303 : Constant::Units::W,
4304 76 : state.dataHeatBal->spaceRpt(spaceNum).PeopleSenGainRate,
4305 : OutputProcessor::TimeStepType::Zone,
4306 : OutputProcessor::StoreType::Average,
4307 76 : state.dataHeatBal->space(spaceNum).Name);
4308 152 : SetupOutputVariable(state,
4309 : "Space People Latent Gain Energy",
4310 : Constant::Units::J,
4311 76 : state.dataHeatBal->spaceRpt(spaceNum).PeopleLatGain,
4312 : OutputProcessor::TimeStepType::Zone,
4313 : OutputProcessor::StoreType::Sum,
4314 76 : state.dataHeatBal->space(spaceNum).Name);
4315 152 : SetupOutputVariable(state,
4316 : "Space People Latent Gain Rate",
4317 : Constant::Units::W,
4318 76 : state.dataHeatBal->spaceRpt(spaceNum).PeopleLatGainRate,
4319 : OutputProcessor::TimeStepType::Zone,
4320 : OutputProcessor::StoreType::Average,
4321 76 : state.dataHeatBal->space(spaceNum).Name);
4322 152 : SetupOutputVariable(state,
4323 : "Space People Total Heating Energy",
4324 : Constant::Units::J,
4325 76 : state.dataHeatBal->spaceRpt(spaceNum).PeopleTotGain,
4326 : OutputProcessor::TimeStepType::Zone,
4327 : OutputProcessor::StoreType::Sum,
4328 76 : state.dataHeatBal->space(spaceNum).Name);
4329 152 : SetupOutputVariable(state,
4330 : "Space People Total Heating Rate",
4331 : Constant::Units::W,
4332 76 : state.dataHeatBal->spaceRpt(spaceNum).PeopleTotGainRate,
4333 : OutputProcessor::TimeStepType::Zone,
4334 : OutputProcessor::StoreType::Average,
4335 76 : state.dataHeatBal->space(spaceNum).Name);
4336 : }
4337 : // Reset space output flag
4338 225 : addSpaceOutputs(spaceNum) = false;
4339 : }
4340 :
4341 242 : for (int lightsNum = 1; lightsNum <= state.dataHeatBal->TotLights; ++lightsNum) {
4342 : // Set flags for zone and space total report variables
4343 75 : addZoneOutputs(state.dataHeatBal->Lights(lightsNum).ZonePtr) = true;
4344 75 : addSpaceOutputs(state.dataHeatBal->Lights(lightsNum).spaceIndex) = true;
4345 : // Object report variables
4346 150 : SetupOutputVariable(state,
4347 : "Lights Electricity Rate",
4348 : Constant::Units::W,
4349 75 : state.dataHeatBal->Lights(lightsNum).Power,
4350 : OutputProcessor::TimeStepType::Zone,
4351 : OutputProcessor::StoreType::Average,
4352 75 : state.dataHeatBal->Lights(lightsNum).Name);
4353 :
4354 150 : SetupOutputVariable(state,
4355 : "Lights Radiant Heating Energy",
4356 : Constant::Units::J,
4357 75 : state.dataHeatBal->Lights(lightsNum).RadGainEnergy,
4358 : OutputProcessor::TimeStepType::Zone,
4359 : OutputProcessor::StoreType::Sum,
4360 75 : state.dataHeatBal->Lights(lightsNum).Name);
4361 150 : SetupOutputVariable(state,
4362 : "Lights Radiant Heating Rate",
4363 : Constant::Units::W,
4364 75 : state.dataHeatBal->Lights(lightsNum).RadGainRate,
4365 : OutputProcessor::TimeStepType::Zone,
4366 : OutputProcessor::StoreType::Average,
4367 75 : state.dataHeatBal->Lights(lightsNum).Name);
4368 150 : SetupOutputVariable(state,
4369 : "Lights Visible Radiation Heating Energy",
4370 : Constant::Units::J,
4371 75 : state.dataHeatBal->Lights(lightsNum).VisGainEnergy,
4372 : OutputProcessor::TimeStepType::Zone,
4373 : OutputProcessor::StoreType::Sum,
4374 75 : state.dataHeatBal->Lights(lightsNum).Name);
4375 :
4376 150 : SetupOutputVariable(state,
4377 : "Lights Visible Radiation Heating Rate",
4378 : Constant::Units::W,
4379 75 : state.dataHeatBal->Lights(lightsNum).VisGainRate,
4380 : OutputProcessor::TimeStepType::Zone,
4381 : OutputProcessor::StoreType::Average,
4382 75 : state.dataHeatBal->Lights(lightsNum).Name);
4383 150 : SetupOutputVariable(state,
4384 : "Lights Convective Heating Energy",
4385 : Constant::Units::J,
4386 75 : state.dataHeatBal->Lights(lightsNum).ConGainEnergy,
4387 : OutputProcessor::TimeStepType::Zone,
4388 : OutputProcessor::StoreType::Sum,
4389 75 : state.dataHeatBal->Lights(lightsNum).Name);
4390 150 : SetupOutputVariable(state,
4391 : "Lights Convective Heating Rate",
4392 : Constant::Units::W,
4393 75 : state.dataHeatBal->Lights(lightsNum).ConGainRate,
4394 : OutputProcessor::TimeStepType::Zone,
4395 : OutputProcessor::StoreType::Average,
4396 75 : state.dataHeatBal->Lights(lightsNum).Name);
4397 150 : SetupOutputVariable(state,
4398 : "Lights Return Air Heating Energy",
4399 : Constant::Units::J,
4400 75 : state.dataHeatBal->Lights(lightsNum).RetAirGainEnergy,
4401 : OutputProcessor::TimeStepType::Zone,
4402 : OutputProcessor::StoreType::Sum,
4403 75 : state.dataHeatBal->Lights(lightsNum).Name);
4404 150 : SetupOutputVariable(state,
4405 : "Lights Return Air Heating Rate",
4406 : Constant::Units::W,
4407 75 : state.dataHeatBal->Lights(lightsNum).RetAirGainRate,
4408 : OutputProcessor::TimeStepType::Zone,
4409 : OutputProcessor::StoreType::Average,
4410 75 : state.dataHeatBal->Lights(lightsNum).Name);
4411 150 : SetupOutputVariable(state,
4412 : "Lights Total Heating Energy",
4413 : Constant::Units::J,
4414 75 : state.dataHeatBal->Lights(lightsNum).TotGainEnergy,
4415 : OutputProcessor::TimeStepType::Zone,
4416 : OutputProcessor::StoreType::Sum,
4417 75 : state.dataHeatBal->Lights(lightsNum).Name);
4418 150 : SetupOutputVariable(state,
4419 : "Lights Total Heating Rate",
4420 : Constant::Units::W,
4421 75 : state.dataHeatBal->Lights(lightsNum).TotGainRate,
4422 : OutputProcessor::TimeStepType::Zone,
4423 : OutputProcessor::StoreType::Average,
4424 75 : state.dataHeatBal->Lights(lightsNum).Name);
4425 150 : SetupOutputVariable(state,
4426 : "Lights Electricity Energy",
4427 : Constant::Units::J,
4428 75 : state.dataHeatBal->Lights(lightsNum).Consumption,
4429 : OutputProcessor::TimeStepType::Zone,
4430 : OutputProcessor::StoreType::Sum,
4431 75 : state.dataHeatBal->Lights(lightsNum).Name,
4432 : Constant::eResource::Electricity,
4433 : OutputProcessor::Group::Building,
4434 : OutputProcessor::EndUseCat::InteriorLights,
4435 75 : state.dataHeatBal->Lights(lightsNum).EndUseSubcategory,
4436 75 : state.dataHeatBal->Zone(state.dataHeatBal->Lights(lightsNum).ZonePtr).Name,
4437 75 : state.dataHeatBal->Zone(state.dataHeatBal->Lights(lightsNum).ZonePtr).Multiplier,
4438 75 : state.dataHeatBal->Zone(state.dataHeatBal->Lights(lightsNum).ZonePtr).ListMultiplier,
4439 75 : state.dataHeatBal->space(state.dataHeatBal->Lights(lightsNum).spaceIndex).spaceType);
4440 : }
4441 :
4442 : // Zone total report variables
4443 373 : for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) {
4444 206 : if (addZoneOutputs(zoneNum)) {
4445 146 : SetupOutputVariable(state,
4446 : "Zone Lights Electricity Rate",
4447 : Constant::Units::W,
4448 73 : state.dataHeatBal->ZoneRpt(zoneNum).LtsPower,
4449 : OutputProcessor::TimeStepType::Zone,
4450 : OutputProcessor::StoreType::Average,
4451 73 : state.dataHeatBal->Zone(zoneNum).Name);
4452 146 : SetupOutputVariable(state,
4453 : "Zone Lights Electricity Energy",
4454 : Constant::Units::J,
4455 73 : state.dataHeatBal->ZoneRpt(zoneNum).LtsElecConsump,
4456 : OutputProcessor::TimeStepType::Zone,
4457 : OutputProcessor::StoreType::Sum,
4458 73 : state.dataHeatBal->Zone(zoneNum).Name);
4459 146 : SetupOutputVariable(state,
4460 : "Zone Lights Radiant Heating Energy",
4461 : Constant::Units::J,
4462 73 : state.dataHeatBal->ZoneRpt(zoneNum).LtsRadGain,
4463 : OutputProcessor::TimeStepType::Zone,
4464 : OutputProcessor::StoreType::Sum,
4465 73 : state.dataHeatBal->Zone(zoneNum).Name);
4466 146 : SetupOutputVariable(state,
4467 : "Zone Lights Radiant Heating Rate",
4468 : Constant::Units::W,
4469 73 : state.dataHeatBal->ZoneRpt(zoneNum).LtsRadGainRate,
4470 : OutputProcessor::TimeStepType::Zone,
4471 : OutputProcessor::StoreType::Average,
4472 73 : state.dataHeatBal->Zone(zoneNum).Name);
4473 146 : SetupOutputVariable(state,
4474 : "Zone Lights Visible Radiation Heating Energy",
4475 : Constant::Units::J,
4476 73 : state.dataHeatBal->ZoneRpt(zoneNum).LtsVisGain,
4477 : OutputProcessor::TimeStepType::Zone,
4478 : OutputProcessor::StoreType::Sum,
4479 73 : state.dataHeatBal->Zone(zoneNum).Name);
4480 146 : SetupOutputVariable(state,
4481 : "Zone Lights Visible Radiation Heating Rate",
4482 : Constant::Units::W,
4483 73 : state.dataHeatBal->ZoneRpt(zoneNum).LtsVisGainRate,
4484 : OutputProcessor::TimeStepType::Zone,
4485 : OutputProcessor::StoreType::Average,
4486 73 : state.dataHeatBal->Zone(zoneNum).Name);
4487 146 : SetupOutputVariable(state,
4488 : "Zone Lights Convective Heating Energy",
4489 : Constant::Units::J,
4490 73 : state.dataHeatBal->ZoneRpt(zoneNum).LtsConGain,
4491 : OutputProcessor::TimeStepType::Zone,
4492 : OutputProcessor::StoreType::Sum,
4493 73 : state.dataHeatBal->Zone(zoneNum).Name);
4494 146 : SetupOutputVariable(state,
4495 : "Zone Lights Convective Heating Rate",
4496 : Constant::Units::W,
4497 73 : state.dataHeatBal->ZoneRpt(zoneNum).LtsConGainRate,
4498 : OutputProcessor::TimeStepType::Zone,
4499 : OutputProcessor::StoreType::Average,
4500 73 : state.dataHeatBal->Zone(zoneNum).Name);
4501 146 : SetupOutputVariable(state,
4502 : "Zone Lights Return Air Heating Energy",
4503 : Constant::Units::J,
4504 73 : state.dataHeatBal->ZoneRpt(zoneNum).LtsRetAirGain,
4505 : OutputProcessor::TimeStepType::Zone,
4506 : OutputProcessor::StoreType::Sum,
4507 73 : state.dataHeatBal->Zone(zoneNum).Name);
4508 146 : SetupOutputVariable(state,
4509 : "Zone Lights Return Air Heating Rate",
4510 : Constant::Units::W,
4511 73 : state.dataHeatBal->ZoneRpt(zoneNum).LtsRetAirGainRate,
4512 : OutputProcessor::TimeStepType::Zone,
4513 : OutputProcessor::StoreType::Average,
4514 73 : state.dataHeatBal->Zone(zoneNum).Name);
4515 146 : SetupOutputVariable(state,
4516 : "Zone Lights Total Heating Energy",
4517 : Constant::Units::J,
4518 73 : state.dataHeatBal->ZoneRpt(zoneNum).LtsTotGain,
4519 : OutputProcessor::TimeStepType::Zone,
4520 : OutputProcessor::StoreType::Sum,
4521 73 : state.dataHeatBal->Zone(zoneNum).Name);
4522 146 : SetupOutputVariable(state,
4523 : "Zone Lights Total Heating Rate",
4524 : Constant::Units::W,
4525 73 : state.dataHeatBal->ZoneRpt(zoneNum).LtsTotGainRate,
4526 : OutputProcessor::TimeStepType::Zone,
4527 : OutputProcessor::StoreType::Average,
4528 73 : state.dataHeatBal->Zone(zoneNum).Name);
4529 : }
4530 : // Reset zone output flag
4531 206 : addZoneOutputs(zoneNum) = false;
4532 : }
4533 :
4534 : // Space total report variables
4535 392 : for (int spaceNum = 1; spaceNum <= state.dataGlobal->numSpaces; ++spaceNum) {
4536 225 : if (addSpaceOutputs(spaceNum)) {
4537 150 : SetupOutputVariable(state,
4538 : "Space Lights Electricity Rate",
4539 : Constant::Units::W,
4540 75 : state.dataHeatBal->spaceRpt(spaceNum).LtsPower,
4541 : OutputProcessor::TimeStepType::Zone,
4542 : OutputProcessor::StoreType::Average,
4543 75 : state.dataHeatBal->space(spaceNum).Name);
4544 150 : SetupOutputVariable(state,
4545 : "Space Lights Electricity Energy",
4546 : Constant::Units::J,
4547 75 : state.dataHeatBal->spaceRpt(spaceNum).LtsElecConsump,
4548 : OutputProcessor::TimeStepType::Zone,
4549 : OutputProcessor::StoreType::Sum,
4550 75 : state.dataHeatBal->space(spaceNum).Name);
4551 150 : SetupOutputVariable(state,
4552 : "Space Lights Radiant Heating Energy",
4553 : Constant::Units::J,
4554 75 : state.dataHeatBal->spaceRpt(spaceNum).LtsRadGain,
4555 : OutputProcessor::TimeStepType::Zone,
4556 : OutputProcessor::StoreType::Sum,
4557 75 : state.dataHeatBal->space(spaceNum).Name);
4558 150 : SetupOutputVariable(state,
4559 : "Space Lights Radiant Heating Rate",
4560 : Constant::Units::W,
4561 75 : state.dataHeatBal->spaceRpt(spaceNum).LtsRadGainRate,
4562 : OutputProcessor::TimeStepType::Zone,
4563 : OutputProcessor::StoreType::Average,
4564 75 : state.dataHeatBal->space(spaceNum).Name);
4565 150 : SetupOutputVariable(state,
4566 : "Space Lights Visible Radiation Heating Energy",
4567 : Constant::Units::J,
4568 75 : state.dataHeatBal->spaceRpt(spaceNum).LtsVisGain,
4569 : OutputProcessor::TimeStepType::Zone,
4570 : OutputProcessor::StoreType::Sum,
4571 75 : state.dataHeatBal->space(spaceNum).Name);
4572 150 : SetupOutputVariable(state,
4573 : "Space Lights Visible Radiation Heating Rate",
4574 : Constant::Units::W,
4575 75 : state.dataHeatBal->spaceRpt(spaceNum).LtsVisGainRate,
4576 : OutputProcessor::TimeStepType::Zone,
4577 : OutputProcessor::StoreType::Average,
4578 75 : state.dataHeatBal->space(spaceNum).Name);
4579 150 : SetupOutputVariable(state,
4580 : "Space Lights Convective Heating Energy",
4581 : Constant::Units::J,
4582 75 : state.dataHeatBal->spaceRpt(spaceNum).LtsConGain,
4583 : OutputProcessor::TimeStepType::Zone,
4584 : OutputProcessor::StoreType::Sum,
4585 75 : state.dataHeatBal->space(spaceNum).Name);
4586 150 : SetupOutputVariable(state,
4587 : "Space Lights Convective Heating Rate",
4588 : Constant::Units::W,
4589 75 : state.dataHeatBal->spaceRpt(spaceNum).LtsConGainRate,
4590 : OutputProcessor::TimeStepType::Zone,
4591 : OutputProcessor::StoreType::Average,
4592 75 : state.dataHeatBal->space(spaceNum).Name);
4593 150 : SetupOutputVariable(state,
4594 : "Space Lights Return Air Heating Energy",
4595 : Constant::Units::J,
4596 75 : state.dataHeatBal->spaceRpt(spaceNum).LtsRetAirGain,
4597 : OutputProcessor::TimeStepType::Zone,
4598 : OutputProcessor::StoreType::Sum,
4599 75 : state.dataHeatBal->space(spaceNum).Name);
4600 150 : SetupOutputVariable(state,
4601 : "Space Lights Return Air Heating Rate",
4602 : Constant::Units::W,
4603 75 : state.dataHeatBal->spaceRpt(spaceNum).LtsRetAirGainRate,
4604 : OutputProcessor::TimeStepType::Zone,
4605 : OutputProcessor::StoreType::Average,
4606 75 : state.dataHeatBal->space(spaceNum).Name);
4607 150 : SetupOutputVariable(state,
4608 : "Space Lights Total Heating Energy",
4609 : Constant::Units::J,
4610 75 : state.dataHeatBal->spaceRpt(spaceNum).LtsTotGain,
4611 : OutputProcessor::TimeStepType::Zone,
4612 : OutputProcessor::StoreType::Sum,
4613 75 : state.dataHeatBal->space(spaceNum).Name);
4614 150 : SetupOutputVariable(state,
4615 : "Space Lights Total Heating Rate",
4616 : Constant::Units::W,
4617 75 : state.dataHeatBal->spaceRpt(spaceNum).LtsTotGainRate,
4618 : OutputProcessor::TimeStepType::Zone,
4619 : OutputProcessor::StoreType::Average,
4620 75 : state.dataHeatBal->space(spaceNum).Name);
4621 : }
4622 : // Reset space output flag
4623 225 : addSpaceOutputs(spaceNum) = false;
4624 : }
4625 265 : for (int elecEqNum = 1; elecEqNum <= state.dataHeatBal->TotElecEquip; ++elecEqNum) {
4626 : // Set flags for zone and space total report variables
4627 98 : addZoneOutputs(state.dataHeatBal->ZoneElectric(elecEqNum).ZonePtr) = true;
4628 98 : addSpaceOutputs(state.dataHeatBal->ZoneElectric(elecEqNum).spaceIndex) = true;
4629 : // Object report variables
4630 196 : SetupOutputVariable(state,
4631 : "Electric Equipment Electricity Rate",
4632 : Constant::Units::W,
4633 98 : state.dataHeatBal->ZoneElectric(elecEqNum).Power,
4634 : OutputProcessor::TimeStepType::Zone,
4635 : OutputProcessor::StoreType::Average,
4636 98 : state.dataHeatBal->ZoneElectric(elecEqNum).Name);
4637 196 : SetupOutputVariable(state,
4638 : "Electric Equipment Electricity Energy",
4639 : Constant::Units::J,
4640 98 : state.dataHeatBal->ZoneElectric(elecEqNum).Consumption,
4641 : OutputProcessor::TimeStepType::Zone,
4642 : OutputProcessor::StoreType::Sum,
4643 98 : state.dataHeatBal->ZoneElectric(elecEqNum).Name,
4644 : Constant::eResource::Electricity,
4645 : OutputProcessor::Group::Building,
4646 : OutputProcessor::EndUseCat::InteriorEquipment,
4647 98 : state.dataHeatBal->ZoneElectric(elecEqNum).EndUseSubcategory,
4648 98 : state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(elecEqNum).ZonePtr).Name,
4649 98 : state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(elecEqNum).ZonePtr).Multiplier,
4650 98 : state.dataHeatBal->Zone(state.dataHeatBal->ZoneElectric(elecEqNum).ZonePtr).ListMultiplier,
4651 98 : state.dataHeatBal->space(state.dataHeatBal->ZoneElectric(elecEqNum).spaceIndex).spaceType);
4652 :
4653 196 : SetupOutputVariable(state,
4654 : "Electric Equipment Radiant Heating Energy",
4655 : Constant::Units::J,
4656 98 : state.dataHeatBal->ZoneElectric(elecEqNum).RadGainEnergy,
4657 : OutputProcessor::TimeStepType::Zone,
4658 : OutputProcessor::StoreType::Sum,
4659 98 : state.dataHeatBal->ZoneElectric(elecEqNum).Name);
4660 196 : SetupOutputVariable(state,
4661 : "Electric Equipment Radiant Heating Rate",
4662 : Constant::Units::W,
4663 98 : state.dataHeatBal->ZoneElectric(elecEqNum).RadGainRate,
4664 : OutputProcessor::TimeStepType::Zone,
4665 : OutputProcessor::StoreType::Average,
4666 98 : state.dataHeatBal->ZoneElectric(elecEqNum).Name);
4667 196 : SetupOutputVariable(state,
4668 : "Electric Equipment Convective Heating Energy",
4669 : Constant::Units::J,
4670 98 : state.dataHeatBal->ZoneElectric(elecEqNum).ConGainEnergy,
4671 : OutputProcessor::TimeStepType::Zone,
4672 : OutputProcessor::StoreType::Sum,
4673 98 : state.dataHeatBal->ZoneElectric(elecEqNum).Name);
4674 196 : SetupOutputVariable(state,
4675 : "Electric Equipment Convective Heating Rate",
4676 : Constant::Units::W,
4677 98 : state.dataHeatBal->ZoneElectric(elecEqNum).ConGainRate,
4678 : OutputProcessor::TimeStepType::Zone,
4679 : OutputProcessor::StoreType::Average,
4680 98 : state.dataHeatBal->ZoneElectric(elecEqNum).Name);
4681 196 : SetupOutputVariable(state,
4682 : "Electric Equipment Latent Gain Energy",
4683 : Constant::Units::J,
4684 98 : state.dataHeatBal->ZoneElectric(elecEqNum).LatGainEnergy,
4685 : OutputProcessor::TimeStepType::Zone,
4686 : OutputProcessor::StoreType::Sum,
4687 98 : state.dataHeatBal->ZoneElectric(elecEqNum).Name);
4688 196 : SetupOutputVariable(state,
4689 : "Electric Equipment Latent Gain Rate",
4690 : Constant::Units::W,
4691 98 : state.dataHeatBal->ZoneElectric(elecEqNum).LatGainRate,
4692 : OutputProcessor::TimeStepType::Zone,
4693 : OutputProcessor::StoreType::Average,
4694 98 : state.dataHeatBal->ZoneElectric(elecEqNum).Name);
4695 196 : SetupOutputVariable(state,
4696 : "Electric Equipment Lost Heat Energy",
4697 : Constant::Units::J,
4698 98 : state.dataHeatBal->ZoneElectric(elecEqNum).LostEnergy,
4699 : OutputProcessor::TimeStepType::Zone,
4700 : OutputProcessor::StoreType::Sum,
4701 98 : state.dataHeatBal->ZoneElectric(elecEqNum).Name);
4702 196 : SetupOutputVariable(state,
4703 : "Electric Equipment Lost Heat Rate",
4704 : Constant::Units::W,
4705 98 : state.dataHeatBal->ZoneElectric(elecEqNum).LostRate,
4706 : OutputProcessor::TimeStepType::Zone,
4707 : OutputProcessor::StoreType::Average,
4708 98 : state.dataHeatBal->ZoneElectric(elecEqNum).Name);
4709 196 : SetupOutputVariable(state,
4710 : "Electric Equipment Total Heating Energy",
4711 : Constant::Units::J,
4712 98 : state.dataHeatBal->ZoneElectric(elecEqNum).TotGainEnergy,
4713 : OutputProcessor::TimeStepType::Zone,
4714 : OutputProcessor::StoreType::Sum,
4715 98 : state.dataHeatBal->ZoneElectric(elecEqNum).Name);
4716 196 : SetupOutputVariable(state,
4717 : "Electric Equipment Total Heating Rate",
4718 : Constant::Units::W,
4719 98 : state.dataHeatBal->ZoneElectric(elecEqNum).TotGainRate,
4720 : OutputProcessor::TimeStepType::Zone,
4721 : OutputProcessor::StoreType::Average,
4722 98 : state.dataHeatBal->ZoneElectric(elecEqNum).Name);
4723 : }
4724 :
4725 : // Zone total report variables
4726 373 : for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) {
4727 206 : if (addZoneOutputs(zoneNum)) {
4728 152 : SetupOutputVariable(state,
4729 : "Zone Electric Equipment Electricity Rate",
4730 : Constant::Units::W,
4731 76 : state.dataHeatBal->ZoneRpt(zoneNum).ElecPower,
4732 : OutputProcessor::TimeStepType::Zone,
4733 : OutputProcessor::StoreType::Average,
4734 76 : state.dataHeatBal->Zone(zoneNum).Name);
4735 152 : SetupOutputVariable(state,
4736 : "Zone Electric Equipment Electricity Energy",
4737 : Constant::Units::J,
4738 76 : state.dataHeatBal->ZoneRpt(zoneNum).ElecConsump,
4739 : OutputProcessor::TimeStepType::Zone,
4740 : OutputProcessor::StoreType::Sum,
4741 76 : state.dataHeatBal->Zone(zoneNum).Name);
4742 :
4743 152 : SetupOutputVariable(state,
4744 : "Zone Electric Equipment Radiant Heating Energy",
4745 : Constant::Units::J,
4746 76 : state.dataHeatBal->ZoneRpt(zoneNum).ElecRadGain,
4747 : OutputProcessor::TimeStepType::Zone,
4748 : OutputProcessor::StoreType::Sum,
4749 76 : state.dataHeatBal->Zone(zoneNum).Name);
4750 152 : SetupOutputVariable(state,
4751 : "Zone Electric Equipment Radiant Heating Rate",
4752 : Constant::Units::W,
4753 76 : state.dataHeatBal->ZoneRpt(zoneNum).ElecRadGainRate,
4754 : OutputProcessor::TimeStepType::Zone,
4755 : OutputProcessor::StoreType::Average,
4756 76 : state.dataHeatBal->Zone(zoneNum).Name);
4757 152 : SetupOutputVariable(state,
4758 : "Zone Electric Equipment Convective Heating Energy",
4759 : Constant::Units::J,
4760 76 : state.dataHeatBal->ZoneRpt(zoneNum).ElecConGain,
4761 : OutputProcessor::TimeStepType::Zone,
4762 : OutputProcessor::StoreType::Sum,
4763 76 : state.dataHeatBal->Zone(zoneNum).Name);
4764 152 : SetupOutputVariable(state,
4765 : "Zone Electric Equipment Convective Heating Rate",
4766 : Constant::Units::W,
4767 76 : state.dataHeatBal->ZoneRpt(zoneNum).ElecConGainRate,
4768 : OutputProcessor::TimeStepType::Zone,
4769 : OutputProcessor::StoreType::Average,
4770 76 : state.dataHeatBal->Zone(zoneNum).Name);
4771 152 : SetupOutputVariable(state,
4772 : "Zone Electric Equipment Latent Gain Energy",
4773 : Constant::Units::J,
4774 76 : state.dataHeatBal->ZoneRpt(zoneNum).ElecLatGain,
4775 : OutputProcessor::TimeStepType::Zone,
4776 : OutputProcessor::StoreType::Sum,
4777 76 : state.dataHeatBal->Zone(zoneNum).Name);
4778 152 : SetupOutputVariable(state,
4779 : "Zone Electric Equipment Latent Gain Rate",
4780 : Constant::Units::W,
4781 76 : state.dataHeatBal->ZoneRpt(zoneNum).ElecLatGainRate,
4782 : OutputProcessor::TimeStepType::Zone,
4783 : OutputProcessor::StoreType::Average,
4784 76 : state.dataHeatBal->Zone(zoneNum).Name);
4785 152 : SetupOutputVariable(state,
4786 : "Zone Electric Equipment Lost Heat Energy",
4787 : Constant::Units::J,
4788 76 : state.dataHeatBal->ZoneRpt(zoneNum).ElecLost,
4789 : OutputProcessor::TimeStepType::Zone,
4790 : OutputProcessor::StoreType::Sum,
4791 76 : state.dataHeatBal->Zone(zoneNum).Name);
4792 152 : SetupOutputVariable(state,
4793 : "Zone Electric Equipment Lost Heat Rate",
4794 : Constant::Units::W,
4795 76 : state.dataHeatBal->ZoneRpt(zoneNum).ElecLostRate,
4796 : OutputProcessor::TimeStepType::Zone,
4797 : OutputProcessor::StoreType::Average,
4798 76 : state.dataHeatBal->Zone(zoneNum).Name);
4799 152 : SetupOutputVariable(state,
4800 : "Zone Electric Equipment Total Heating Energy",
4801 : Constant::Units::J,
4802 76 : state.dataHeatBal->ZoneRpt(zoneNum).ElecTotGain,
4803 : OutputProcessor::TimeStepType::Zone,
4804 : OutputProcessor::StoreType::Sum,
4805 76 : state.dataHeatBal->Zone(zoneNum).Name);
4806 152 : SetupOutputVariable(state,
4807 : "Zone Electric Equipment Total Heating Rate",
4808 : Constant::Units::W,
4809 76 : state.dataHeatBal->ZoneRpt(zoneNum).ElecTotGainRate,
4810 : OutputProcessor::TimeStepType::Zone,
4811 : OutputProcessor::StoreType::Average,
4812 76 : state.dataHeatBal->Zone(zoneNum).Name);
4813 : }
4814 : // Reset zone output flag
4815 206 : addZoneOutputs(zoneNum) = false;
4816 : }
4817 :
4818 : // space total report variables
4819 392 : for (int spaceNum = 1; spaceNum <= state.dataGlobal->numSpaces; ++spaceNum) {
4820 225 : if (addSpaceOutputs(spaceNum)) {
4821 188 : SetupOutputVariable(state,
4822 : "Space Electric Equipment Electricity Rate",
4823 : Constant::Units::W,
4824 94 : state.dataHeatBal->spaceRpt(spaceNum).ElecPower,
4825 : OutputProcessor::TimeStepType::Zone,
4826 : OutputProcessor::StoreType::Average,
4827 94 : state.dataHeatBal->space(spaceNum).Name);
4828 188 : SetupOutputVariable(state,
4829 : "Space Electric Equipment Electricity Energy",
4830 : Constant::Units::J,
4831 94 : state.dataHeatBal->spaceRpt(spaceNum).ElecConsump,
4832 : OutputProcessor::TimeStepType::Zone,
4833 : OutputProcessor::StoreType::Sum,
4834 94 : state.dataHeatBal->space(spaceNum).Name);
4835 :
4836 188 : SetupOutputVariable(state,
4837 : "Space Electric Equipment Radiant Heating Energy",
4838 : Constant::Units::J,
4839 94 : state.dataHeatBal->spaceRpt(spaceNum).ElecRadGain,
4840 : OutputProcessor::TimeStepType::Zone,
4841 : OutputProcessor::StoreType::Sum,
4842 94 : state.dataHeatBal->space(spaceNum).Name);
4843 188 : SetupOutputVariable(state,
4844 : "Space Electric Equipment Radiant Heating Rate",
4845 : Constant::Units::W,
4846 94 : state.dataHeatBal->spaceRpt(spaceNum).ElecRadGainRate,
4847 : OutputProcessor::TimeStepType::Zone,
4848 : OutputProcessor::StoreType::Average,
4849 94 : state.dataHeatBal->space(spaceNum).Name);
4850 188 : SetupOutputVariable(state,
4851 : "Space Electric Equipment Convective Heating Energy",
4852 : Constant::Units::J,
4853 94 : state.dataHeatBal->spaceRpt(spaceNum).ElecConGain,
4854 : OutputProcessor::TimeStepType::Zone,
4855 : OutputProcessor::StoreType::Sum,
4856 94 : state.dataHeatBal->space(spaceNum).Name);
4857 188 : SetupOutputVariable(state,
4858 : "Space Electric Equipment Convective Heating Rate",
4859 : Constant::Units::W,
4860 94 : state.dataHeatBal->spaceRpt(spaceNum).ElecConGainRate,
4861 : OutputProcessor::TimeStepType::Zone,
4862 : OutputProcessor::StoreType::Average,
4863 94 : state.dataHeatBal->space(spaceNum).Name);
4864 188 : SetupOutputVariable(state,
4865 : "Space Electric Equipment Latent Gain Energy",
4866 : Constant::Units::J,
4867 94 : state.dataHeatBal->spaceRpt(spaceNum).ElecLatGain,
4868 : OutputProcessor::TimeStepType::Zone,
4869 : OutputProcessor::StoreType::Sum,
4870 94 : state.dataHeatBal->space(spaceNum).Name);
4871 188 : SetupOutputVariable(state,
4872 : "Space Electric Equipment Latent Gain Rate",
4873 : Constant::Units::W,
4874 94 : state.dataHeatBal->spaceRpt(spaceNum).ElecLatGainRate,
4875 : OutputProcessor::TimeStepType::Zone,
4876 : OutputProcessor::StoreType::Average,
4877 94 : state.dataHeatBal->space(spaceNum).Name);
4878 188 : SetupOutputVariable(state,
4879 : "Space Electric Equipment Lost Heat Energy",
4880 : Constant::Units::J,
4881 94 : state.dataHeatBal->spaceRpt(spaceNum).ElecLost,
4882 : OutputProcessor::TimeStepType::Zone,
4883 : OutputProcessor::StoreType::Sum,
4884 94 : state.dataHeatBal->space(spaceNum).Name);
4885 188 : SetupOutputVariable(state,
4886 : "Space Electric Equipment Lost Heat Rate",
4887 : Constant::Units::W,
4888 94 : state.dataHeatBal->spaceRpt(spaceNum).ElecLostRate,
4889 : OutputProcessor::TimeStepType::Zone,
4890 : OutputProcessor::StoreType::Average,
4891 94 : state.dataHeatBal->space(spaceNum).Name);
4892 188 : SetupOutputVariable(state,
4893 : "Space Electric Equipment Total Heating Energy",
4894 : Constant::Units::J,
4895 94 : state.dataHeatBal->spaceRpt(spaceNum).ElecTotGain,
4896 : OutputProcessor::TimeStepType::Zone,
4897 : OutputProcessor::StoreType::Sum,
4898 94 : state.dataHeatBal->space(spaceNum).Name);
4899 188 : SetupOutputVariable(state,
4900 : "Space Electric Equipment Total Heating Rate",
4901 : Constant::Units::W,
4902 94 : state.dataHeatBal->spaceRpt(spaceNum).ElecTotGainRate,
4903 : OutputProcessor::TimeStepType::Zone,
4904 : OutputProcessor::StoreType::Average,
4905 94 : state.dataHeatBal->space(spaceNum).Name);
4906 : }
4907 : // Reset space output flag
4908 225 : addSpaceOutputs(spaceNum) = false;
4909 : }
4910 : // Object report variables
4911 169 : for (int gasEqNum = 1; gasEqNum <= state.dataHeatBal->TotGasEquip; ++gasEqNum) {
4912 : // Set flags for zone and space total report variables
4913 2 : addZoneOutputs(state.dataHeatBal->ZoneGas(gasEqNum).ZonePtr) = true;
4914 2 : addSpaceOutputs(state.dataHeatBal->ZoneGas(gasEqNum).spaceIndex) = true;
4915 4 : SetupOutputVariable(state,
4916 : "Gas Equipment NaturalGas Rate",
4917 : Constant::Units::W,
4918 2 : state.dataHeatBal->ZoneGas(gasEqNum).Power,
4919 : OutputProcessor::TimeStepType::Zone,
4920 : OutputProcessor::StoreType::Average,
4921 2 : state.dataHeatBal->ZoneGas(gasEqNum).Name);
4922 4 : SetupOutputVariable(state,
4923 : "Gas Equipment NaturalGas Energy",
4924 : Constant::Units::J,
4925 2 : state.dataHeatBal->ZoneGas(gasEqNum).Consumption,
4926 : OutputProcessor::TimeStepType::Zone,
4927 : OutputProcessor::StoreType::Sum,
4928 2 : state.dataHeatBal->ZoneGas(gasEqNum).Name,
4929 : Constant::eResource::NaturalGas,
4930 : OutputProcessor::Group::Building,
4931 : OutputProcessor::EndUseCat::InteriorEquipment,
4932 2 : state.dataHeatBal->ZoneGas(gasEqNum).EndUseSubcategory,
4933 2 : state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(gasEqNum).ZonePtr).Name,
4934 2 : state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(gasEqNum).ZonePtr).Multiplier,
4935 2 : state.dataHeatBal->Zone(state.dataHeatBal->ZoneGas(gasEqNum).ZonePtr).ListMultiplier,
4936 2 : state.dataHeatBal->space(state.dataHeatBal->ZoneGas(gasEqNum).spaceIndex).spaceType);
4937 :
4938 4 : SetupOutputVariable(state,
4939 : "Gas Equipment Radiant Heating Energy",
4940 : Constant::Units::J,
4941 2 : state.dataHeatBal->ZoneGas(gasEqNum).RadGainEnergy,
4942 : OutputProcessor::TimeStepType::Zone,
4943 : OutputProcessor::StoreType::Sum,
4944 2 : state.dataHeatBal->ZoneGas(gasEqNum).Name);
4945 4 : SetupOutputVariable(state,
4946 : "Gas Equipment Convective Heating Energy",
4947 : Constant::Units::J,
4948 2 : state.dataHeatBal->ZoneGas(gasEqNum).ConGainEnergy,
4949 : OutputProcessor::TimeStepType::Zone,
4950 : OutputProcessor::StoreType::Sum,
4951 2 : state.dataHeatBal->ZoneGas(gasEqNum).Name);
4952 4 : SetupOutputVariable(state,
4953 : "Gas Equipment Latent Gain Energy",
4954 : Constant::Units::J,
4955 2 : state.dataHeatBal->ZoneGas(gasEqNum).LatGainEnergy,
4956 : OutputProcessor::TimeStepType::Zone,
4957 : OutputProcessor::StoreType::Sum,
4958 2 : state.dataHeatBal->ZoneGas(gasEqNum).Name);
4959 4 : SetupOutputVariable(state,
4960 : "Gas Equipment Lost Heat Energy",
4961 : Constant::Units::J,
4962 2 : state.dataHeatBal->ZoneGas(gasEqNum).LostEnergy,
4963 : OutputProcessor::TimeStepType::Zone,
4964 : OutputProcessor::StoreType::Sum,
4965 2 : state.dataHeatBal->ZoneGas(gasEqNum).Name);
4966 4 : SetupOutputVariable(state,
4967 : "Gas Equipment Total Heating Energy",
4968 : Constant::Units::J,
4969 2 : state.dataHeatBal->ZoneGas(gasEqNum).TotGainEnergy,
4970 : OutputProcessor::TimeStepType::Zone,
4971 : OutputProcessor::StoreType::Sum,
4972 2 : state.dataHeatBal->ZoneGas(gasEqNum).Name);
4973 4 : SetupOutputVariable(state,
4974 : "Gas Equipment Radiant Heating Rate",
4975 : Constant::Units::W,
4976 2 : state.dataHeatBal->ZoneGas(gasEqNum).RadGainRate,
4977 : OutputProcessor::TimeStepType::Zone,
4978 : OutputProcessor::StoreType::Average,
4979 2 : state.dataHeatBal->ZoneGas(gasEqNum).Name);
4980 4 : SetupOutputVariable(state,
4981 : "Gas Equipment Convective Heating Rate",
4982 : Constant::Units::W,
4983 2 : state.dataHeatBal->ZoneGas(gasEqNum).ConGainRate,
4984 : OutputProcessor::TimeStepType::Zone,
4985 : OutputProcessor::StoreType::Average,
4986 2 : state.dataHeatBal->ZoneGas(gasEqNum).Name);
4987 4 : SetupOutputVariable(state,
4988 : "Gas Equipment Latent Gain Rate",
4989 : Constant::Units::W,
4990 2 : state.dataHeatBal->ZoneGas(gasEqNum).LatGainRate,
4991 : OutputProcessor::TimeStepType::Zone,
4992 : OutputProcessor::StoreType::Average,
4993 2 : state.dataHeatBal->ZoneGas(gasEqNum).Name);
4994 4 : SetupOutputVariable(state,
4995 : "Gas Equipment Lost Heat Rate",
4996 : Constant::Units::W,
4997 2 : state.dataHeatBal->ZoneGas(gasEqNum).LostRate,
4998 : OutputProcessor::TimeStepType::Zone,
4999 : OutputProcessor::StoreType::Average,
5000 2 : state.dataHeatBal->ZoneGas(gasEqNum).Name);
5001 4 : SetupOutputVariable(state,
5002 : "Gas Equipment Total Heating Rate",
5003 : Constant::Units::W,
5004 2 : state.dataHeatBal->ZoneGas(gasEqNum).TotGainRate,
5005 : OutputProcessor::TimeStepType::Zone,
5006 : OutputProcessor::StoreType::Average,
5007 2 : state.dataHeatBal->ZoneGas(gasEqNum).Name);
5008 : }
5009 :
5010 : // Zone total report variables
5011 373 : for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) {
5012 206 : if (addZoneOutputs(zoneNum)) {
5013 :
5014 2 : SetupOutputVariable(state,
5015 : "Zone Gas Equipment NaturalGas Rate",
5016 : Constant::Units::W,
5017 1 : state.dataHeatBal->ZoneRpt(zoneNum).GasPower,
5018 : OutputProcessor::TimeStepType::Zone,
5019 : OutputProcessor::StoreType::Average,
5020 1 : state.dataHeatBal->Zone(zoneNum).Name);
5021 2 : SetupOutputVariable(state,
5022 : "Zone Gas Equipment NaturalGas Energy",
5023 : Constant::Units::J,
5024 1 : state.dataHeatBal->ZoneRpt(zoneNum).GasConsump,
5025 : OutputProcessor::TimeStepType::Zone,
5026 : OutputProcessor::StoreType::Sum,
5027 1 : state.dataHeatBal->Zone(zoneNum).Name);
5028 :
5029 2 : SetupOutputVariable(state,
5030 : "Zone Gas Equipment Radiant Heating Energy",
5031 : Constant::Units::J,
5032 1 : state.dataHeatBal->ZoneRpt(zoneNum).GasRadGain,
5033 : OutputProcessor::TimeStepType::Zone,
5034 : OutputProcessor::StoreType::Sum,
5035 1 : state.dataHeatBal->Zone(zoneNum).Name);
5036 2 : SetupOutputVariable(state,
5037 : "Zone Gas Equipment Radiant Heating Rate",
5038 : Constant::Units::W,
5039 1 : state.dataHeatBal->ZoneRpt(zoneNum).GasRadGainRate,
5040 : OutputProcessor::TimeStepType::Zone,
5041 : OutputProcessor::StoreType::Average,
5042 1 : state.dataHeatBal->Zone(zoneNum).Name);
5043 2 : SetupOutputVariable(state,
5044 : "Zone Gas Equipment Convective Heating Energy",
5045 : Constant::Units::J,
5046 1 : state.dataHeatBal->ZoneRpt(zoneNum).GasConGain,
5047 : OutputProcessor::TimeStepType::Zone,
5048 : OutputProcessor::StoreType::Sum,
5049 1 : state.dataHeatBal->Zone(zoneNum).Name);
5050 2 : SetupOutputVariable(state,
5051 : "Zone Gas Equipment Convective Heating Rate",
5052 : Constant::Units::W,
5053 1 : state.dataHeatBal->ZoneRpt(zoneNum).GasConGainRate,
5054 : OutputProcessor::TimeStepType::Zone,
5055 : OutputProcessor::StoreType::Average,
5056 1 : state.dataHeatBal->Zone(zoneNum).Name);
5057 2 : SetupOutputVariable(state,
5058 : "Zone Gas Equipment Latent Gain Energy",
5059 : Constant::Units::J,
5060 1 : state.dataHeatBal->ZoneRpt(zoneNum).GasLatGain,
5061 : OutputProcessor::TimeStepType::Zone,
5062 : OutputProcessor::StoreType::Sum,
5063 1 : state.dataHeatBal->Zone(zoneNum).Name);
5064 2 : SetupOutputVariable(state,
5065 : "Zone Gas Equipment Latent Gain Rate",
5066 : Constant::Units::W,
5067 1 : state.dataHeatBal->ZoneRpt(zoneNum).GasLatGainRate,
5068 : OutputProcessor::TimeStepType::Zone,
5069 : OutputProcessor::StoreType::Average,
5070 1 : state.dataHeatBal->Zone(zoneNum).Name);
5071 2 : SetupOutputVariable(state,
5072 : "Zone Gas Equipment Lost Heat Energy",
5073 : Constant::Units::J,
5074 1 : state.dataHeatBal->ZoneRpt(zoneNum).GasLost,
5075 : OutputProcessor::TimeStepType::Zone,
5076 : OutputProcessor::StoreType::Sum,
5077 1 : state.dataHeatBal->Zone(zoneNum).Name);
5078 2 : SetupOutputVariable(state,
5079 : "Zone Gas Equipment Lost Heat Rate",
5080 : Constant::Units::W,
5081 1 : state.dataHeatBal->ZoneRpt(zoneNum).GasLostRate,
5082 : OutputProcessor::TimeStepType::Zone,
5083 : OutputProcessor::StoreType::Average,
5084 1 : state.dataHeatBal->Zone(zoneNum).Name);
5085 2 : SetupOutputVariable(state,
5086 : "Zone Gas Equipment Total Heating Energy",
5087 : Constant::Units::J,
5088 1 : state.dataHeatBal->ZoneRpt(zoneNum).GasTotGain,
5089 : OutputProcessor::TimeStepType::Zone,
5090 : OutputProcessor::StoreType::Sum,
5091 1 : state.dataHeatBal->Zone(zoneNum).Name);
5092 2 : SetupOutputVariable(state,
5093 : "Zone Gas Equipment Total Heating Rate",
5094 : Constant::Units::W,
5095 1 : state.dataHeatBal->ZoneRpt(zoneNum).GasTotGainRate,
5096 : OutputProcessor::TimeStepType::Zone,
5097 : OutputProcessor::StoreType::Average,
5098 1 : state.dataHeatBal->Zone(zoneNum).Name);
5099 : }
5100 : // Reset zone output flag
5101 206 : addZoneOutputs(zoneNum) = false;
5102 : }
5103 :
5104 : // Space total report variables
5105 392 : for (int spaceNum = 1; spaceNum <= state.dataGlobal->numSpaces; ++spaceNum) {
5106 225 : if (addSpaceOutputs(spaceNum)) {
5107 :
5108 4 : SetupOutputVariable(state,
5109 : "Space Gas Equipment NaturalGas Rate",
5110 : Constant::Units::W,
5111 2 : state.dataHeatBal->spaceRpt(spaceNum).GasPower,
5112 : OutputProcessor::TimeStepType::Zone,
5113 : OutputProcessor::StoreType::Average,
5114 2 : state.dataHeatBal->space(spaceNum).Name);
5115 4 : SetupOutputVariable(state,
5116 : "Space Gas Equipment NaturalGas Energy",
5117 : Constant::Units::J,
5118 2 : state.dataHeatBal->spaceRpt(spaceNum).GasConsump,
5119 : OutputProcessor::TimeStepType::Zone,
5120 : OutputProcessor::StoreType::Sum,
5121 2 : state.dataHeatBal->space(spaceNum).Name);
5122 :
5123 4 : SetupOutputVariable(state,
5124 : "Space Gas Equipment Radiant Heating Energy",
5125 : Constant::Units::J,
5126 2 : state.dataHeatBal->spaceRpt(spaceNum).GasRadGain,
5127 : OutputProcessor::TimeStepType::Zone,
5128 : OutputProcessor::StoreType::Sum,
5129 2 : state.dataHeatBal->space(spaceNum).Name);
5130 4 : SetupOutputVariable(state,
5131 : "Space Gas Equipment Radiant Heating Rate",
5132 : Constant::Units::W,
5133 2 : state.dataHeatBal->spaceRpt(spaceNum).GasRadGainRate,
5134 : OutputProcessor::TimeStepType::Zone,
5135 : OutputProcessor::StoreType::Average,
5136 2 : state.dataHeatBal->space(spaceNum).Name);
5137 4 : SetupOutputVariable(state,
5138 : "Space Gas Equipment Convective Heating Energy",
5139 : Constant::Units::J,
5140 2 : state.dataHeatBal->spaceRpt(spaceNum).GasConGain,
5141 : OutputProcessor::TimeStepType::Zone,
5142 : OutputProcessor::StoreType::Sum,
5143 2 : state.dataHeatBal->space(spaceNum).Name);
5144 4 : SetupOutputVariable(state,
5145 : "Space Gas Equipment Convective Heating Rate",
5146 : Constant::Units::W,
5147 2 : state.dataHeatBal->spaceRpt(spaceNum).GasConGainRate,
5148 : OutputProcessor::TimeStepType::Zone,
5149 : OutputProcessor::StoreType::Average,
5150 2 : state.dataHeatBal->space(spaceNum).Name);
5151 4 : SetupOutputVariable(state,
5152 : "Space Gas Equipment Latent Gain Energy",
5153 : Constant::Units::J,
5154 2 : state.dataHeatBal->spaceRpt(spaceNum).GasLatGain,
5155 : OutputProcessor::TimeStepType::Zone,
5156 : OutputProcessor::StoreType::Sum,
5157 2 : state.dataHeatBal->space(spaceNum).Name);
5158 4 : SetupOutputVariable(state,
5159 : "Space Gas Equipment Latent Gain Rate",
5160 : Constant::Units::W,
5161 2 : state.dataHeatBal->spaceRpt(spaceNum).GasLatGainRate,
5162 : OutputProcessor::TimeStepType::Zone,
5163 : OutputProcessor::StoreType::Average,
5164 2 : state.dataHeatBal->space(spaceNum).Name);
5165 4 : SetupOutputVariable(state,
5166 : "Space Gas Equipment Lost Heat Energy",
5167 : Constant::Units::J,
5168 2 : state.dataHeatBal->spaceRpt(spaceNum).GasLost,
5169 : OutputProcessor::TimeStepType::Zone,
5170 : OutputProcessor::StoreType::Sum,
5171 2 : state.dataHeatBal->space(spaceNum).Name);
5172 4 : SetupOutputVariable(state,
5173 : "Space Gas Equipment Lost Heat Rate",
5174 : Constant::Units::W,
5175 2 : state.dataHeatBal->spaceRpt(spaceNum).GasLostRate,
5176 : OutputProcessor::TimeStepType::Zone,
5177 : OutputProcessor::StoreType::Average,
5178 2 : state.dataHeatBal->space(spaceNum).Name);
5179 4 : SetupOutputVariable(state,
5180 : "Space Gas Equipment Total Heating Energy",
5181 : Constant::Units::J,
5182 2 : state.dataHeatBal->spaceRpt(spaceNum).GasTotGain,
5183 : OutputProcessor::TimeStepType::Zone,
5184 : OutputProcessor::StoreType::Sum,
5185 2 : state.dataHeatBal->space(spaceNum).Name);
5186 4 : SetupOutputVariable(state,
5187 : "Space Gas Equipment Total Heating Rate",
5188 : Constant::Units::W,
5189 2 : state.dataHeatBal->spaceRpt(spaceNum).GasTotGainRate,
5190 : OutputProcessor::TimeStepType::Zone,
5191 : OutputProcessor::StoreType::Average,
5192 2 : state.dataHeatBal->space(spaceNum).Name);
5193 : }
5194 : // Reset space output flag
5195 225 : addSpaceOutputs(spaceNum) = false;
5196 : }
5197 :
5198 : // Object report variables
5199 169 : for (int hwEqNum = 1; hwEqNum <= state.dataHeatBal->TotHWEquip; ++hwEqNum) {
5200 : // Set flags for zone and space total report variables
5201 2 : addZoneOutputs(state.dataHeatBal->ZoneHWEq(hwEqNum).ZonePtr) = true;
5202 2 : addSpaceOutputs(state.dataHeatBal->ZoneHWEq(hwEqNum).spaceIndex) = true;
5203 4 : SetupOutputVariable(state,
5204 : "Hot Water Equipment District Heating Rate",
5205 : Constant::Units::W,
5206 2 : state.dataHeatBal->ZoneHWEq(hwEqNum).Power,
5207 : OutputProcessor::TimeStepType::Zone,
5208 : OutputProcessor::StoreType::Average,
5209 2 : state.dataHeatBal->ZoneHWEq(hwEqNum).Name);
5210 4 : SetupOutputVariable(state,
5211 : "Hot Water Equipment District Heating Energy",
5212 : Constant::Units::J,
5213 2 : state.dataHeatBal->ZoneHWEq(hwEqNum).Consumption,
5214 : OutputProcessor::TimeStepType::Zone,
5215 : OutputProcessor::StoreType::Sum,
5216 2 : state.dataHeatBal->ZoneHWEq(hwEqNum).Name,
5217 : Constant::eResource::DistrictHeatingWater,
5218 : OutputProcessor::Group::Building,
5219 : OutputProcessor::EndUseCat::InteriorEquipment,
5220 2 : state.dataHeatBal->ZoneHWEq(hwEqNum).EndUseSubcategory,
5221 2 : state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(hwEqNum).ZonePtr).Name,
5222 2 : state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(hwEqNum).ZonePtr).Multiplier,
5223 2 : state.dataHeatBal->Zone(state.dataHeatBal->ZoneHWEq(hwEqNum).ZonePtr).ListMultiplier,
5224 2 : state.dataHeatBal->space(state.dataHeatBal->ZoneHWEq(hwEqNum).spaceIndex).spaceType);
5225 :
5226 4 : SetupOutputVariable(state,
5227 : "Hot Water Equipment Radiant Heating Energy",
5228 : Constant::Units::J,
5229 2 : state.dataHeatBal->ZoneHWEq(hwEqNum).RadGainEnergy,
5230 : OutputProcessor::TimeStepType::Zone,
5231 : OutputProcessor::StoreType::Sum,
5232 2 : state.dataHeatBal->ZoneHWEq(hwEqNum).Name);
5233 4 : SetupOutputVariable(state,
5234 : "Hot Water Equipment Radiant Heating Rate",
5235 : Constant::Units::W,
5236 2 : state.dataHeatBal->ZoneHWEq(hwEqNum).RadGainRate,
5237 : OutputProcessor::TimeStepType::Zone,
5238 : OutputProcessor::StoreType::Average,
5239 2 : state.dataHeatBal->ZoneHWEq(hwEqNum).Name);
5240 4 : SetupOutputVariable(state,
5241 : "Hot Water Equipment Convective Heating Energy",
5242 : Constant::Units::J,
5243 2 : state.dataHeatBal->ZoneHWEq(hwEqNum).ConGainEnergy,
5244 : OutputProcessor::TimeStepType::Zone,
5245 : OutputProcessor::StoreType::Sum,
5246 2 : state.dataHeatBal->ZoneHWEq(hwEqNum).Name);
5247 4 : SetupOutputVariable(state,
5248 : "Hot Water Equipment Convective Heating Rate",
5249 : Constant::Units::W,
5250 2 : state.dataHeatBal->ZoneHWEq(hwEqNum).ConGainRate,
5251 : OutputProcessor::TimeStepType::Zone,
5252 : OutputProcessor::StoreType::Average,
5253 2 : state.dataHeatBal->ZoneHWEq(hwEqNum).Name);
5254 4 : SetupOutputVariable(state,
5255 : "Hot Water Equipment Latent Gain Energy",
5256 : Constant::Units::J,
5257 2 : state.dataHeatBal->ZoneHWEq(hwEqNum).LatGainEnergy,
5258 : OutputProcessor::TimeStepType::Zone,
5259 : OutputProcessor::StoreType::Sum,
5260 2 : state.dataHeatBal->ZoneHWEq(hwEqNum).Name);
5261 4 : SetupOutputVariable(state,
5262 : "Hot Water Equipment Latent Gain Rate",
5263 : Constant::Units::W,
5264 2 : state.dataHeatBal->ZoneHWEq(hwEqNum).LatGainRate,
5265 : OutputProcessor::TimeStepType::Zone,
5266 : OutputProcessor::StoreType::Average,
5267 2 : state.dataHeatBal->ZoneHWEq(hwEqNum).Name);
5268 4 : SetupOutputVariable(state,
5269 : "Hot Water Equipment Lost Heat Energy",
5270 : Constant::Units::J,
5271 2 : state.dataHeatBal->ZoneHWEq(hwEqNum).LostEnergy,
5272 : OutputProcessor::TimeStepType::Zone,
5273 : OutputProcessor::StoreType::Sum,
5274 2 : state.dataHeatBal->ZoneHWEq(hwEqNum).Name);
5275 4 : SetupOutputVariable(state,
5276 : "Hot Water Equipment Lost Heat Rate",
5277 : Constant::Units::W,
5278 2 : state.dataHeatBal->ZoneHWEq(hwEqNum).LostRate,
5279 : OutputProcessor::TimeStepType::Zone,
5280 : OutputProcessor::StoreType::Average,
5281 2 : state.dataHeatBal->ZoneHWEq(hwEqNum).Name);
5282 4 : SetupOutputVariable(state,
5283 : "Hot Water Equipment Total Heating Energy",
5284 : Constant::Units::J,
5285 2 : state.dataHeatBal->ZoneHWEq(hwEqNum).TotGainEnergy,
5286 : OutputProcessor::TimeStepType::Zone,
5287 : OutputProcessor::StoreType::Sum,
5288 2 : state.dataHeatBal->ZoneHWEq(hwEqNum).Name);
5289 4 : SetupOutputVariable(state,
5290 : "Hot Water Equipment Total Heating Rate",
5291 : Constant::Units::W,
5292 2 : state.dataHeatBal->ZoneHWEq(hwEqNum).TotGainRate,
5293 : OutputProcessor::TimeStepType::Zone,
5294 : OutputProcessor::StoreType::Average,
5295 2 : state.dataHeatBal->ZoneHWEq(hwEqNum).Name);
5296 : }
5297 :
5298 : // Zone total report variables
5299 373 : for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) {
5300 206 : if (addZoneOutputs(zoneNum)) {
5301 2 : SetupOutputVariable(state,
5302 : "Zone Hot Water Equipment District Heating Rate",
5303 : Constant::Units::W,
5304 1 : state.dataHeatBal->ZoneRpt(zoneNum).HWPower,
5305 : OutputProcessor::TimeStepType::Zone,
5306 : OutputProcessor::StoreType::Average,
5307 1 : state.dataHeatBal->Zone(zoneNum).Name);
5308 2 : SetupOutputVariable(state,
5309 : "Zone Hot Water Equipment District Heating Energy",
5310 : Constant::Units::J,
5311 1 : state.dataHeatBal->ZoneRpt(zoneNum).HWConsump,
5312 : OutputProcessor::TimeStepType::Zone,
5313 : OutputProcessor::StoreType::Sum,
5314 1 : state.dataHeatBal->Zone(zoneNum).Name);
5315 :
5316 2 : SetupOutputVariable(state,
5317 : "Zone Hot Water Equipment Radiant Heating Energy",
5318 : Constant::Units::J,
5319 1 : state.dataHeatBal->ZoneRpt(zoneNum).HWRadGain,
5320 : OutputProcessor::TimeStepType::Zone,
5321 : OutputProcessor::StoreType::Sum,
5322 1 : state.dataHeatBal->Zone(zoneNum).Name);
5323 2 : SetupOutputVariable(state,
5324 : "Zone Hot Water Equipment Radiant Heating Rate",
5325 : Constant::Units::W,
5326 1 : state.dataHeatBal->ZoneRpt(zoneNum).HWRadGainRate,
5327 : OutputProcessor::TimeStepType::Zone,
5328 : OutputProcessor::StoreType::Average,
5329 1 : state.dataHeatBal->Zone(zoneNum).Name);
5330 2 : SetupOutputVariable(state,
5331 : "Zone Hot Water Equipment Convective Heating Energy",
5332 : Constant::Units::J,
5333 1 : state.dataHeatBal->ZoneRpt(zoneNum).HWConGain,
5334 : OutputProcessor::TimeStepType::Zone,
5335 : OutputProcessor::StoreType::Sum,
5336 1 : state.dataHeatBal->Zone(zoneNum).Name);
5337 2 : SetupOutputVariable(state,
5338 : "Zone Hot Water Equipment Convective Heating Rate",
5339 : Constant::Units::W,
5340 1 : state.dataHeatBal->ZoneRpt(zoneNum).HWConGainRate,
5341 : OutputProcessor::TimeStepType::Zone,
5342 : OutputProcessor::StoreType::Average,
5343 1 : state.dataHeatBal->Zone(zoneNum).Name);
5344 2 : SetupOutputVariable(state,
5345 : "Zone Hot Water Equipment Latent Gain Energy",
5346 : Constant::Units::J,
5347 1 : state.dataHeatBal->ZoneRpt(zoneNum).HWLatGain,
5348 : OutputProcessor::TimeStepType::Zone,
5349 : OutputProcessor::StoreType::Sum,
5350 1 : state.dataHeatBal->Zone(zoneNum).Name);
5351 2 : SetupOutputVariable(state,
5352 : "Zone Hot Water Equipment Latent Gain Rate",
5353 : Constant::Units::W,
5354 1 : state.dataHeatBal->ZoneRpt(zoneNum).HWLatGainRate,
5355 : OutputProcessor::TimeStepType::Zone,
5356 : OutputProcessor::StoreType::Average,
5357 1 : state.dataHeatBal->Zone(zoneNum).Name);
5358 2 : SetupOutputVariable(state,
5359 : "Zone Hot Water Equipment Lost Heat Energy",
5360 : Constant::Units::J,
5361 1 : state.dataHeatBal->ZoneRpt(zoneNum).HWLost,
5362 : OutputProcessor::TimeStepType::Zone,
5363 : OutputProcessor::StoreType::Sum,
5364 1 : state.dataHeatBal->Zone(zoneNum).Name);
5365 2 : SetupOutputVariable(state,
5366 : "Zone Hot Water Equipment Lost Heat Rate",
5367 : Constant::Units::W,
5368 1 : state.dataHeatBal->ZoneRpt(zoneNum).HWLostRate,
5369 : OutputProcessor::TimeStepType::Zone,
5370 : OutputProcessor::StoreType::Average,
5371 1 : state.dataHeatBal->Zone(zoneNum).Name);
5372 2 : SetupOutputVariable(state,
5373 : "Zone Hot Water Equipment Total Heating Energy",
5374 : Constant::Units::J,
5375 1 : state.dataHeatBal->ZoneRpt(zoneNum).HWTotGain,
5376 : OutputProcessor::TimeStepType::Zone,
5377 : OutputProcessor::StoreType::Sum,
5378 1 : state.dataHeatBal->Zone(zoneNum).Name);
5379 2 : SetupOutputVariable(state,
5380 : "Zone Hot Water Equipment Total Heating Rate",
5381 : Constant::Units::W,
5382 1 : state.dataHeatBal->ZoneRpt(zoneNum).HWTotGainRate,
5383 : OutputProcessor::TimeStepType::Zone,
5384 : OutputProcessor::StoreType::Average,
5385 1 : state.dataHeatBal->Zone(zoneNum).Name);
5386 : }
5387 : // Reset zone output flag
5388 206 : addZoneOutputs(zoneNum) = false;
5389 : }
5390 :
5391 : // Space total report variables
5392 392 : for (int spaceNum = 1; spaceNum <= state.dataGlobal->numSpaces; ++spaceNum) {
5393 225 : if (addSpaceOutputs(spaceNum)) {
5394 4 : SetupOutputVariable(state,
5395 : "Space Hot Water Equipment District Heating Rate",
5396 : Constant::Units::W,
5397 2 : state.dataHeatBal->spaceRpt(spaceNum).HWPower,
5398 : OutputProcessor::TimeStepType::Zone,
5399 : OutputProcessor::StoreType::Average,
5400 2 : state.dataHeatBal->space(spaceNum).Name);
5401 4 : SetupOutputVariable(state,
5402 : "Space Hot Water Equipment District Heating Energy",
5403 : Constant::Units::J,
5404 2 : state.dataHeatBal->spaceRpt(spaceNum).HWConsump,
5405 : OutputProcessor::TimeStepType::Zone,
5406 : OutputProcessor::StoreType::Sum,
5407 2 : state.dataHeatBal->space(spaceNum).Name);
5408 :
5409 4 : SetupOutputVariable(state,
5410 : "Space Hot Water Equipment Radiant Heating Energy",
5411 : Constant::Units::J,
5412 2 : state.dataHeatBal->spaceRpt(spaceNum).HWRadGain,
5413 : OutputProcessor::TimeStepType::Zone,
5414 : OutputProcessor::StoreType::Sum,
5415 2 : state.dataHeatBal->space(spaceNum).Name);
5416 4 : SetupOutputVariable(state,
5417 : "Space Hot Water Equipment Radiant Heating Rate",
5418 : Constant::Units::W,
5419 2 : state.dataHeatBal->spaceRpt(spaceNum).HWRadGainRate,
5420 : OutputProcessor::TimeStepType::Zone,
5421 : OutputProcessor::StoreType::Average,
5422 2 : state.dataHeatBal->space(spaceNum).Name);
5423 4 : SetupOutputVariable(state,
5424 : "Space Hot Water Equipment Convective Heating Energy",
5425 : Constant::Units::J,
5426 2 : state.dataHeatBal->spaceRpt(spaceNum).HWConGain,
5427 : OutputProcessor::TimeStepType::Zone,
5428 : OutputProcessor::StoreType::Sum,
5429 2 : state.dataHeatBal->space(spaceNum).Name);
5430 4 : SetupOutputVariable(state,
5431 : "Space Hot Water Equipment Convective Heating Rate",
5432 : Constant::Units::W,
5433 2 : state.dataHeatBal->spaceRpt(spaceNum).HWConGainRate,
5434 : OutputProcessor::TimeStepType::Zone,
5435 : OutputProcessor::StoreType::Average,
5436 2 : state.dataHeatBal->space(spaceNum).Name);
5437 4 : SetupOutputVariable(state,
5438 : "Space Hot Water Equipment Latent Gain Energy",
5439 : Constant::Units::J,
5440 2 : state.dataHeatBal->spaceRpt(spaceNum).HWLatGain,
5441 : OutputProcessor::TimeStepType::Zone,
5442 : OutputProcessor::StoreType::Sum,
5443 2 : state.dataHeatBal->space(spaceNum).Name);
5444 4 : SetupOutputVariable(state,
5445 : "Space Hot Water Equipment Latent Gain Rate",
5446 : Constant::Units::W,
5447 2 : state.dataHeatBal->spaceRpt(spaceNum).HWLatGainRate,
5448 : OutputProcessor::TimeStepType::Zone,
5449 : OutputProcessor::StoreType::Average,
5450 2 : state.dataHeatBal->space(spaceNum).Name);
5451 4 : SetupOutputVariable(state,
5452 : "Space Hot Water Equipment Lost Heat Energy",
5453 : Constant::Units::J,
5454 2 : state.dataHeatBal->spaceRpt(spaceNum).HWLost,
5455 : OutputProcessor::TimeStepType::Zone,
5456 : OutputProcessor::StoreType::Sum,
5457 2 : state.dataHeatBal->space(spaceNum).Name);
5458 4 : SetupOutputVariable(state,
5459 : "Space Hot Water Equipment Lost Heat Rate",
5460 : Constant::Units::W,
5461 2 : state.dataHeatBal->spaceRpt(spaceNum).HWLostRate,
5462 : OutputProcessor::TimeStepType::Zone,
5463 : OutputProcessor::StoreType::Average,
5464 2 : state.dataHeatBal->space(spaceNum).Name);
5465 4 : SetupOutputVariable(state,
5466 : "Space Hot Water Equipment Total Heating Energy",
5467 : Constant::Units::J,
5468 2 : state.dataHeatBal->spaceRpt(spaceNum).HWTotGain,
5469 : OutputProcessor::TimeStepType::Zone,
5470 : OutputProcessor::StoreType::Sum,
5471 2 : state.dataHeatBal->space(spaceNum).Name);
5472 4 : SetupOutputVariable(state,
5473 : "Space Hot Water Equipment Total Heating Rate",
5474 : Constant::Units::W,
5475 2 : state.dataHeatBal->spaceRpt(spaceNum).HWTotGainRate,
5476 : OutputProcessor::TimeStepType::Zone,
5477 : OutputProcessor::StoreType::Average,
5478 2 : state.dataHeatBal->space(spaceNum).Name);
5479 : }
5480 : // Reset space output flag
5481 225 : addSpaceOutputs(spaceNum) = false;
5482 : }
5483 :
5484 : // Object report variables
5485 169 : for (int stmEqNum = 1; stmEqNum <= state.dataHeatBal->TotStmEquip; ++stmEqNum) {
5486 : // Set flags for zone and space total report variables
5487 2 : addZoneOutputs(state.dataHeatBal->ZoneSteamEq(stmEqNum).ZonePtr) = true;
5488 2 : addSpaceOutputs(state.dataHeatBal->ZoneSteamEq(stmEqNum).spaceIndex) = true;
5489 4 : SetupOutputVariable(state,
5490 : "Steam Equipment District Heating Rate",
5491 : Constant::Units::W,
5492 2 : state.dataHeatBal->ZoneSteamEq(stmEqNum).Power,
5493 : OutputProcessor::TimeStepType::Zone,
5494 : OutputProcessor::StoreType::Average,
5495 2 : state.dataHeatBal->ZoneSteamEq(stmEqNum).Name);
5496 4 : SetupOutputVariable(state,
5497 : "Steam Equipment District Heating Energy",
5498 : Constant::Units::J,
5499 2 : state.dataHeatBal->ZoneSteamEq(stmEqNum).Consumption,
5500 : OutputProcessor::TimeStepType::Zone,
5501 : OutputProcessor::StoreType::Sum,
5502 2 : state.dataHeatBal->ZoneSteamEq(stmEqNum).Name,
5503 : Constant::eResource::DistrictHeatingSteam,
5504 : OutputProcessor::Group::Building,
5505 : OutputProcessor::EndUseCat::InteriorEquipment,
5506 2 : state.dataHeatBal->ZoneSteamEq(stmEqNum).EndUseSubcategory,
5507 2 : state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(stmEqNum).ZonePtr).Name,
5508 2 : state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(stmEqNum).ZonePtr).Multiplier,
5509 2 : state.dataHeatBal->Zone(state.dataHeatBal->ZoneSteamEq(stmEqNum).ZonePtr).ListMultiplier,
5510 2 : state.dataHeatBal->space(state.dataHeatBal->ZoneSteamEq(stmEqNum).spaceIndex).spaceType);
5511 :
5512 4 : SetupOutputVariable(state,
5513 : "Steam Equipment Radiant Heating Energy",
5514 : Constant::Units::J,
5515 2 : state.dataHeatBal->ZoneSteamEq(stmEqNum).RadGainEnergy,
5516 : OutputProcessor::TimeStepType::Zone,
5517 : OutputProcessor::StoreType::Sum,
5518 2 : state.dataHeatBal->ZoneSteamEq(stmEqNum).Name);
5519 4 : SetupOutputVariable(state,
5520 : "Steam Equipment Radiant Heating Rate",
5521 : Constant::Units::W,
5522 2 : state.dataHeatBal->ZoneSteamEq(stmEqNum).RadGainRate,
5523 : OutputProcessor::TimeStepType::Zone,
5524 : OutputProcessor::StoreType::Average,
5525 2 : state.dataHeatBal->ZoneSteamEq(stmEqNum).Name);
5526 4 : SetupOutputVariable(state,
5527 : "Steam Equipment Convective Heating Energy",
5528 : Constant::Units::J,
5529 2 : state.dataHeatBal->ZoneSteamEq(stmEqNum).ConGainEnergy,
5530 : OutputProcessor::TimeStepType::Zone,
5531 : OutputProcessor::StoreType::Sum,
5532 2 : state.dataHeatBal->ZoneSteamEq(stmEqNum).Name);
5533 4 : SetupOutputVariable(state,
5534 : "Steam Equipment Convective Heating Rate",
5535 : Constant::Units::W,
5536 2 : state.dataHeatBal->ZoneSteamEq(stmEqNum).ConGainRate,
5537 : OutputProcessor::TimeStepType::Zone,
5538 : OutputProcessor::StoreType::Average,
5539 2 : state.dataHeatBal->ZoneSteamEq(stmEqNum).Name);
5540 4 : SetupOutputVariable(state,
5541 : "Steam Equipment Latent Gain Energy",
5542 : Constant::Units::J,
5543 2 : state.dataHeatBal->ZoneSteamEq(stmEqNum).LatGainEnergy,
5544 : OutputProcessor::TimeStepType::Zone,
5545 : OutputProcessor::StoreType::Sum,
5546 2 : state.dataHeatBal->ZoneSteamEq(stmEqNum).Name);
5547 4 : SetupOutputVariable(state,
5548 : "Steam Equipment Latent Gain Rate",
5549 : Constant::Units::W,
5550 2 : state.dataHeatBal->ZoneSteamEq(stmEqNum).LatGainRate,
5551 : OutputProcessor::TimeStepType::Zone,
5552 : OutputProcessor::StoreType::Average,
5553 2 : state.dataHeatBal->ZoneSteamEq(stmEqNum).Name);
5554 4 : SetupOutputVariable(state,
5555 : "Steam Equipment Lost Heat Energy",
5556 : Constant::Units::J,
5557 2 : state.dataHeatBal->ZoneSteamEq(stmEqNum).LostEnergy,
5558 : OutputProcessor::TimeStepType::Zone,
5559 : OutputProcessor::StoreType::Sum,
5560 2 : state.dataHeatBal->ZoneSteamEq(stmEqNum).Name);
5561 4 : SetupOutputVariable(state,
5562 : "Steam Equipment Lost Heat Rate",
5563 : Constant::Units::W,
5564 2 : state.dataHeatBal->ZoneSteamEq(stmEqNum).LostRate,
5565 : OutputProcessor::TimeStepType::Zone,
5566 : OutputProcessor::StoreType::Average,
5567 2 : state.dataHeatBal->ZoneSteamEq(stmEqNum).Name);
5568 4 : SetupOutputVariable(state,
5569 : "Steam Equipment Total Heating Energy",
5570 : Constant::Units::J,
5571 2 : state.dataHeatBal->ZoneSteamEq(stmEqNum).TotGainEnergy,
5572 : OutputProcessor::TimeStepType::Zone,
5573 : OutputProcessor::StoreType::Sum,
5574 2 : state.dataHeatBal->ZoneSteamEq(stmEqNum).Name);
5575 4 : SetupOutputVariable(state,
5576 : "Steam Equipment Total Heating Rate",
5577 : Constant::Units::W,
5578 2 : state.dataHeatBal->ZoneSteamEq(stmEqNum).TotGainRate,
5579 : OutputProcessor::TimeStepType::Zone,
5580 : OutputProcessor::StoreType::Average,
5581 2 : state.dataHeatBal->ZoneSteamEq(stmEqNum).Name);
5582 : }
5583 :
5584 : // Zone total report variables
5585 373 : for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) {
5586 206 : if (addZoneOutputs(zoneNum)) {
5587 2 : SetupOutputVariable(state,
5588 : "Zone Steam Equipment District Heating Rate",
5589 : Constant::Units::W,
5590 1 : state.dataHeatBal->ZoneRpt(zoneNum).SteamPower,
5591 : OutputProcessor::TimeStepType::Zone,
5592 : OutputProcessor::StoreType::Average,
5593 1 : state.dataHeatBal->Zone(zoneNum).Name);
5594 2 : SetupOutputVariable(state,
5595 : "Zone Steam Equipment District Heating Energy",
5596 : Constant::Units::J,
5597 1 : state.dataHeatBal->ZoneRpt(zoneNum).SteamConsump,
5598 : OutputProcessor::TimeStepType::Zone,
5599 : OutputProcessor::StoreType::Sum,
5600 1 : state.dataHeatBal->Zone(zoneNum).Name);
5601 :
5602 2 : SetupOutputVariable(state,
5603 : "Zone Steam Equipment Radiant Heating Energy",
5604 : Constant::Units::J,
5605 1 : state.dataHeatBal->ZoneRpt(zoneNum).SteamRadGain,
5606 : OutputProcessor::TimeStepType::Zone,
5607 : OutputProcessor::StoreType::Sum,
5608 1 : state.dataHeatBal->Zone(zoneNum).Name);
5609 2 : SetupOutputVariable(state,
5610 : "Zone Steam Equipment Radiant Heating Rate",
5611 : Constant::Units::W,
5612 1 : state.dataHeatBal->ZoneRpt(zoneNum).SteamRadGainRate,
5613 : OutputProcessor::TimeStepType::Zone,
5614 : OutputProcessor::StoreType::Average,
5615 1 : state.dataHeatBal->Zone(zoneNum).Name);
5616 2 : SetupOutputVariable(state,
5617 : "Zone Steam Equipment Convective Heating Energy",
5618 : Constant::Units::J,
5619 1 : state.dataHeatBal->ZoneRpt(zoneNum).SteamConGain,
5620 : OutputProcessor::TimeStepType::Zone,
5621 : OutputProcessor::StoreType::Sum,
5622 1 : state.dataHeatBal->Zone(zoneNum).Name);
5623 2 : SetupOutputVariable(state,
5624 : "Zone Steam Equipment Convective Heating Rate",
5625 : Constant::Units::W,
5626 1 : state.dataHeatBal->ZoneRpt(zoneNum).SteamConGainRate,
5627 : OutputProcessor::TimeStepType::Zone,
5628 : OutputProcessor::StoreType::Average,
5629 1 : state.dataHeatBal->Zone(zoneNum).Name);
5630 2 : SetupOutputVariable(state,
5631 : "Zone Steam Equipment Latent Gain Energy",
5632 : Constant::Units::J,
5633 1 : state.dataHeatBal->ZoneRpt(zoneNum).SteamLatGain,
5634 : OutputProcessor::TimeStepType::Zone,
5635 : OutputProcessor::StoreType::Sum,
5636 1 : state.dataHeatBal->Zone(zoneNum).Name);
5637 2 : SetupOutputVariable(state,
5638 : "Zone Steam Equipment Latent Gain Rate",
5639 : Constant::Units::W,
5640 1 : state.dataHeatBal->ZoneRpt(zoneNum).SteamLatGainRate,
5641 : OutputProcessor::TimeStepType::Zone,
5642 : OutputProcessor::StoreType::Average,
5643 1 : state.dataHeatBal->Zone(zoneNum).Name);
5644 2 : SetupOutputVariable(state,
5645 : "Zone Steam Equipment Lost Heat Energy",
5646 : Constant::Units::J,
5647 1 : state.dataHeatBal->ZoneRpt(zoneNum).SteamLost,
5648 : OutputProcessor::TimeStepType::Zone,
5649 : OutputProcessor::StoreType::Sum,
5650 1 : state.dataHeatBal->Zone(zoneNum).Name);
5651 2 : SetupOutputVariable(state,
5652 : "Zone Steam Equipment Lost Heat Rate",
5653 : Constant::Units::W,
5654 1 : state.dataHeatBal->ZoneRpt(zoneNum).SteamLostRate,
5655 : OutputProcessor::TimeStepType::Zone,
5656 : OutputProcessor::StoreType::Average,
5657 1 : state.dataHeatBal->Zone(zoneNum).Name);
5658 2 : SetupOutputVariable(state,
5659 : "Zone Steam Equipment Total Heating Energy",
5660 : Constant::Units::J,
5661 1 : state.dataHeatBal->ZoneRpt(zoneNum).SteamTotGain,
5662 : OutputProcessor::TimeStepType::Zone,
5663 : OutputProcessor::StoreType::Sum,
5664 1 : state.dataHeatBal->Zone(zoneNum).Name);
5665 2 : SetupOutputVariable(state,
5666 : "Zone Steam Equipment Total Heating Rate",
5667 : Constant::Units::W,
5668 1 : state.dataHeatBal->ZoneRpt(zoneNum).SteamTotGainRate,
5669 : OutputProcessor::TimeStepType::Zone,
5670 : OutputProcessor::StoreType::Average,
5671 1 : state.dataHeatBal->Zone(zoneNum).Name);
5672 : }
5673 : // Reset zone output flag
5674 206 : addZoneOutputs(zoneNum) = false;
5675 : }
5676 :
5677 : // Space total report variables
5678 392 : for (int spaceNum = 1; spaceNum <= state.dataGlobal->numSpaces; ++spaceNum) {
5679 225 : if (addSpaceOutputs(spaceNum)) {
5680 4 : SetupOutputVariable(state,
5681 : "Space Steam Equipment District Heating Rate",
5682 : Constant::Units::W,
5683 2 : state.dataHeatBal->spaceRpt(spaceNum).SteamPower,
5684 : OutputProcessor::TimeStepType::Zone,
5685 : OutputProcessor::StoreType::Average,
5686 2 : state.dataHeatBal->space(spaceNum).Name);
5687 4 : SetupOutputVariable(state,
5688 : "Space Steam Equipment District Heating Energy",
5689 : Constant::Units::J,
5690 2 : state.dataHeatBal->spaceRpt(spaceNum).SteamConsump,
5691 : OutputProcessor::TimeStepType::Zone,
5692 : OutputProcessor::StoreType::Sum,
5693 2 : state.dataHeatBal->space(spaceNum).Name);
5694 :
5695 4 : SetupOutputVariable(state,
5696 : "Space Steam Equipment Radiant Heating Energy",
5697 : Constant::Units::J,
5698 2 : state.dataHeatBal->spaceRpt(spaceNum).SteamRadGain,
5699 : OutputProcessor::TimeStepType::Zone,
5700 : OutputProcessor::StoreType::Sum,
5701 2 : state.dataHeatBal->space(spaceNum).Name);
5702 4 : SetupOutputVariable(state,
5703 : "Space Steam Equipment Radiant Heating Rate",
5704 : Constant::Units::W,
5705 2 : state.dataHeatBal->spaceRpt(spaceNum).SteamRadGainRate,
5706 : OutputProcessor::TimeStepType::Zone,
5707 : OutputProcessor::StoreType::Average,
5708 2 : state.dataHeatBal->space(spaceNum).Name);
5709 4 : SetupOutputVariable(state,
5710 : "Space Steam Equipment Convective Heating Energy",
5711 : Constant::Units::J,
5712 2 : state.dataHeatBal->spaceRpt(spaceNum).SteamConGain,
5713 : OutputProcessor::TimeStepType::Zone,
5714 : OutputProcessor::StoreType::Sum,
5715 2 : state.dataHeatBal->space(spaceNum).Name);
5716 4 : SetupOutputVariable(state,
5717 : "Space Steam Equipment Convective Heating Rate",
5718 : Constant::Units::W,
5719 2 : state.dataHeatBal->spaceRpt(spaceNum).SteamConGainRate,
5720 : OutputProcessor::TimeStepType::Zone,
5721 : OutputProcessor::StoreType::Average,
5722 2 : state.dataHeatBal->space(spaceNum).Name);
5723 4 : SetupOutputVariable(state,
5724 : "Space Steam Equipment Latent Gain Energy",
5725 : Constant::Units::J,
5726 2 : state.dataHeatBal->spaceRpt(spaceNum).SteamLatGain,
5727 : OutputProcessor::TimeStepType::Zone,
5728 : OutputProcessor::StoreType::Sum,
5729 2 : state.dataHeatBal->space(spaceNum).Name);
5730 4 : SetupOutputVariable(state,
5731 : "Space Steam Equipment Latent Gain Rate",
5732 : Constant::Units::W,
5733 2 : state.dataHeatBal->spaceRpt(spaceNum).SteamLatGainRate,
5734 : OutputProcessor::TimeStepType::Zone,
5735 : OutputProcessor::StoreType::Average,
5736 2 : state.dataHeatBal->space(spaceNum).Name);
5737 4 : SetupOutputVariable(state,
5738 : "Space Steam Equipment Lost Heat Energy",
5739 : Constant::Units::J,
5740 2 : state.dataHeatBal->spaceRpt(spaceNum).SteamLost,
5741 : OutputProcessor::TimeStepType::Zone,
5742 : OutputProcessor::StoreType::Sum,
5743 2 : state.dataHeatBal->space(spaceNum).Name);
5744 4 : SetupOutputVariable(state,
5745 : "Space Steam Equipment Lost Heat Rate",
5746 : Constant::Units::W,
5747 2 : state.dataHeatBal->spaceRpt(spaceNum).SteamLostRate,
5748 : OutputProcessor::TimeStepType::Zone,
5749 : OutputProcessor::StoreType::Average,
5750 2 : state.dataHeatBal->space(spaceNum).Name);
5751 4 : SetupOutputVariable(state,
5752 : "Space Steam Equipment Total Heating Energy",
5753 : Constant::Units::J,
5754 2 : state.dataHeatBal->spaceRpt(spaceNum).SteamTotGain,
5755 : OutputProcessor::TimeStepType::Zone,
5756 : OutputProcessor::StoreType::Sum,
5757 2 : state.dataHeatBal->space(spaceNum).Name);
5758 4 : SetupOutputVariable(state,
5759 : "Space Steam Equipment Total Heating Rate",
5760 : Constant::Units::W,
5761 2 : state.dataHeatBal->spaceRpt(spaceNum).SteamTotGainRate,
5762 : OutputProcessor::TimeStepType::Zone,
5763 : OutputProcessor::StoreType::Average,
5764 2 : state.dataHeatBal->space(spaceNum).Name);
5765 : }
5766 : // Reset space output flag
5767 225 : addSpaceOutputs(spaceNum) = false;
5768 : }
5769 :
5770 : // Object report variables
5771 219 : for (int othEqNum = 1; othEqNum <= state.dataHeatBal->TotOthEquip; ++othEqNum) {
5772 : // Set flags for zone and space total report variables
5773 52 : auto &zoneOtherEq = state.dataHeatBal->ZoneOtherEq(othEqNum);
5774 :
5775 52 : addZoneOutputs(zoneOtherEq.ZonePtr) = true;
5776 52 : addSpaceOutputs(zoneOtherEq.spaceIndex) = true;
5777 52 : if (zoneOtherEq.OtherEquipFuelType != Constant::eFuel::Invalid && zoneOtherEq.OtherEquipFuelType != Constant::eFuel::None) {
5778 15 : SetupOutputVariable(state,
5779 10 : format("Other Equipment {} Rate", Constant::eFuelNames[(int)zoneOtherEq.OtherEquipFuelType]),
5780 : Constant::Units::W,
5781 5 : zoneOtherEq.Power,
5782 : OutputProcessor::TimeStepType::Zone,
5783 : OutputProcessor::StoreType::Average,
5784 5 : zoneOtherEq.Name);
5785 10 : SetupOutputVariable(state,
5786 10 : format("Other Equipment {} Energy", Constant::eFuelNames[(int)zoneOtherEq.OtherEquipFuelType]),
5787 : Constant::Units::J,
5788 5 : zoneOtherEq.Consumption,
5789 : OutputProcessor::TimeStepType::Zone,
5790 : OutputProcessor::StoreType::Sum,
5791 5 : zoneOtherEq.Name,
5792 5 : Constant::eFuel2eResource[(int)zoneOtherEq.OtherEquipFuelType],
5793 : OutputProcessor::Group::Building,
5794 : OutputProcessor::EndUseCat::InteriorEquipment,
5795 : zoneOtherEq.EndUseSubcategory,
5796 5 : state.dataHeatBal->Zone(zoneOtherEq.ZonePtr).Name,
5797 5 : state.dataHeatBal->Zone(zoneOtherEq.ZonePtr).Multiplier,
5798 5 : state.dataHeatBal->Zone(zoneOtherEq.ZonePtr).ListMultiplier,
5799 5 : state.dataHeatBal->space(zoneOtherEq.spaceIndex).spaceType);
5800 : }
5801 :
5802 104 : SetupOutputVariable(state,
5803 : "Other Equipment Radiant Heating Energy",
5804 : Constant::Units::J,
5805 52 : zoneOtherEq.RadGainEnergy,
5806 : OutputProcessor::TimeStepType::Zone,
5807 : OutputProcessor::StoreType::Sum,
5808 52 : zoneOtherEq.Name);
5809 104 : SetupOutputVariable(state,
5810 : "Other Equipment Radiant Heating Rate",
5811 : Constant::Units::W,
5812 52 : zoneOtherEq.RadGainRate,
5813 : OutputProcessor::TimeStepType::Zone,
5814 : OutputProcessor::StoreType::Average,
5815 52 : zoneOtherEq.Name);
5816 104 : SetupOutputVariable(state,
5817 : "Other Equipment Convective Heating Energy",
5818 : Constant::Units::J,
5819 52 : zoneOtherEq.ConGainEnergy,
5820 : OutputProcessor::TimeStepType::Zone,
5821 : OutputProcessor::StoreType::Sum,
5822 52 : zoneOtherEq.Name);
5823 104 : SetupOutputVariable(state,
5824 : "Other Equipment Convective Heating Rate",
5825 : Constant::Units::W,
5826 52 : zoneOtherEq.ConGainRate,
5827 : OutputProcessor::TimeStepType::Zone,
5828 : OutputProcessor::StoreType::Average,
5829 52 : zoneOtherEq.Name);
5830 104 : SetupOutputVariable(state,
5831 : "Other Equipment Latent Gain Energy",
5832 : Constant::Units::J,
5833 52 : zoneOtherEq.LatGainEnergy,
5834 : OutputProcessor::TimeStepType::Zone,
5835 : OutputProcessor::StoreType::Sum,
5836 52 : zoneOtherEq.Name);
5837 104 : SetupOutputVariable(state,
5838 : "Other Equipment Latent Gain Rate",
5839 : Constant::Units::W,
5840 52 : zoneOtherEq.LatGainRate,
5841 : OutputProcessor::TimeStepType::Zone,
5842 : OutputProcessor::StoreType::Average,
5843 52 : zoneOtherEq.Name);
5844 104 : SetupOutputVariable(state,
5845 : "Other Equipment Lost Heat Energy",
5846 : Constant::Units::J,
5847 52 : zoneOtherEq.LostEnergy,
5848 : OutputProcessor::TimeStepType::Zone,
5849 : OutputProcessor::StoreType::Sum,
5850 52 : zoneOtherEq.Name);
5851 104 : SetupOutputVariable(state,
5852 : "Other Equipment Lost Heat Rate",
5853 : Constant::Units::W,
5854 52 : zoneOtherEq.LostRate,
5855 : OutputProcessor::TimeStepType::Zone,
5856 : OutputProcessor::StoreType::Average,
5857 52 : zoneOtherEq.Name);
5858 104 : SetupOutputVariable(state,
5859 : "Other Equipment Total Heating Energy",
5860 : Constant::Units::J,
5861 52 : zoneOtherEq.TotGainEnergy,
5862 : OutputProcessor::TimeStepType::Zone,
5863 : OutputProcessor::StoreType::Sum,
5864 52 : zoneOtherEq.Name);
5865 104 : SetupOutputVariable(state,
5866 : "Other Equipment Total Heating Rate",
5867 : Constant::Units::W,
5868 52 : zoneOtherEq.TotGainRate,
5869 : OutputProcessor::TimeStepType::Zone,
5870 : OutputProcessor::StoreType::Average,
5871 52 : zoneOtherEq.Name);
5872 : }
5873 :
5874 : // Zone total report variables
5875 373 : for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) {
5876 206 : if (addZoneOutputs(zoneNum)) {
5877 28 : for (size_t i = 0; i < state.dataHeatBal->Zone(zoneNum).otherEquipFuelTypeNums.size(); ++i) {
5878 3 : Constant::eFuel fuelType = state.dataHeatBal->Zone(zoneNum).otherEquipFuelTypeNums[i];
5879 3 : if (fuelType == Constant::eFuel::Invalid || fuelType == Constant::eFuel::None) continue;
5880 :
5881 3 : std::string_view fuelName = Constant::eFuelNames[(int)state.dataHeatBal->Zone(zoneNum).otherEquipFuelTypeNums[i]];
5882 :
5883 9 : SetupOutputVariable(state,
5884 6 : format("Zone Other Equipment {} Rate", fuelName),
5885 : Constant::Units::W,
5886 3 : state.dataHeatBal->ZoneRpt(zoneNum).OtherPower[(int)fuelType],
5887 : OutputProcessor::TimeStepType::Zone,
5888 : OutputProcessor::StoreType::Average,
5889 3 : state.dataHeatBal->Zone(zoneNum).Name);
5890 9 : SetupOutputVariable(state,
5891 6 : format("Zone Other Equipment {} Energy", fuelName),
5892 : Constant::Units::J,
5893 3 : state.dataHeatBal->ZoneRpt(zoneNum).OtherConsump[(int)fuelType],
5894 : OutputProcessor::TimeStepType::Zone,
5895 : OutputProcessor::StoreType::Sum,
5896 3 : state.dataHeatBal->Zone(zoneNum).Name);
5897 : }
5898 :
5899 50 : SetupOutputVariable(state,
5900 : "Zone Other Equipment Radiant Heating Energy",
5901 : Constant::Units::J,
5902 25 : state.dataHeatBal->ZoneRpt(zoneNum).OtherRadGain,
5903 : OutputProcessor::TimeStepType::Zone,
5904 : OutputProcessor::StoreType::Sum,
5905 25 : state.dataHeatBal->Zone(zoneNum).Name);
5906 50 : SetupOutputVariable(state,
5907 : "Zone Other Equipment Radiant Heating Rate",
5908 : Constant::Units::W,
5909 25 : state.dataHeatBal->ZoneRpt(zoneNum).OtherRadGainRate,
5910 : OutputProcessor::TimeStepType::Zone,
5911 : OutputProcessor::StoreType::Average,
5912 25 : state.dataHeatBal->Zone(zoneNum).Name);
5913 50 : SetupOutputVariable(state,
5914 : "Zone Other Equipment Convective Heating Energy",
5915 : Constant::Units::J,
5916 25 : state.dataHeatBal->ZoneRpt(zoneNum).OtherConGain,
5917 : OutputProcessor::TimeStepType::Zone,
5918 : OutputProcessor::StoreType::Sum,
5919 25 : state.dataHeatBal->Zone(zoneNum).Name);
5920 50 : SetupOutputVariable(state,
5921 : "Zone Other Equipment Convective Heating Rate",
5922 : Constant::Units::W,
5923 25 : state.dataHeatBal->ZoneRpt(zoneNum).OtherConGainRate,
5924 : OutputProcessor::TimeStepType::Zone,
5925 : OutputProcessor::StoreType::Average,
5926 25 : state.dataHeatBal->Zone(zoneNum).Name);
5927 50 : SetupOutputVariable(state,
5928 : "Zone Other Equipment Latent Gain Energy",
5929 : Constant::Units::J,
5930 25 : state.dataHeatBal->ZoneRpt(zoneNum).OtherLatGain,
5931 : OutputProcessor::TimeStepType::Zone,
5932 : OutputProcessor::StoreType::Sum,
5933 25 : state.dataHeatBal->Zone(zoneNum).Name);
5934 50 : SetupOutputVariable(state,
5935 : "Zone Other Equipment Latent Gain Rate",
5936 : Constant::Units::W,
5937 25 : state.dataHeatBal->ZoneRpt(zoneNum).OtherLatGainRate,
5938 : OutputProcessor::TimeStepType::Zone,
5939 : OutputProcessor::StoreType::Average,
5940 25 : state.dataHeatBal->Zone(zoneNum).Name);
5941 50 : SetupOutputVariable(state,
5942 : "Zone Other Equipment Lost Heat Energy",
5943 : Constant::Units::J,
5944 25 : state.dataHeatBal->ZoneRpt(zoneNum).OtherLost,
5945 : OutputProcessor::TimeStepType::Zone,
5946 : OutputProcessor::StoreType::Sum,
5947 25 : state.dataHeatBal->Zone(zoneNum).Name);
5948 50 : SetupOutputVariable(state,
5949 : "Zone Other Equipment Lost Heat Rate",
5950 : Constant::Units::W,
5951 25 : state.dataHeatBal->ZoneRpt(zoneNum).OtherLostRate,
5952 : OutputProcessor::TimeStepType::Zone,
5953 : OutputProcessor::StoreType::Average,
5954 25 : state.dataHeatBal->Zone(zoneNum).Name);
5955 50 : SetupOutputVariable(state,
5956 : "Zone Other Equipment Total Heating Energy",
5957 : Constant::Units::J,
5958 25 : state.dataHeatBal->ZoneRpt(zoneNum).OtherTotGain,
5959 : OutputProcessor::TimeStepType::Zone,
5960 : OutputProcessor::StoreType::Sum,
5961 25 : state.dataHeatBal->Zone(zoneNum).Name);
5962 50 : SetupOutputVariable(state,
5963 : "Zone Other Equipment Total Heating Rate",
5964 : Constant::Units::W,
5965 25 : state.dataHeatBal->ZoneRpt(zoneNum).OtherTotGainRate,
5966 : OutputProcessor::TimeStepType::Zone,
5967 : OutputProcessor::StoreType::Average,
5968 25 : state.dataHeatBal->Zone(zoneNum).Name);
5969 : }
5970 : // Reset zone output flag
5971 206 : addZoneOutputs(zoneNum) = false;
5972 : }
5973 :
5974 : // Space total report variables
5975 392 : for (int spaceNum = 1; spaceNum <= state.dataGlobal->numSpaces; ++spaceNum) {
5976 225 : if (addSpaceOutputs(spaceNum)) {
5977 31 : for (size_t i = 0; i < state.dataHeatBal->space(spaceNum).otherEquipFuelTypeNums.size(); ++i) {
5978 5 : Constant::eFuel fuelType = state.dataHeatBal->space(spaceNum).otherEquipFuelTypeNums[i];
5979 5 : if (fuelType == Constant::eFuel::Invalid || fuelType == Constant::eFuel::None) continue;
5980 :
5981 15 : SetupOutputVariable(state,
5982 10 : format("Space Other Equipment {} Rate", Constant::eFuelNames[(int)fuelType]),
5983 : Constant::Units::W,
5984 5 : state.dataHeatBal->spaceRpt(spaceNum).OtherPower[(int)fuelType],
5985 : OutputProcessor::TimeStepType::Zone,
5986 : OutputProcessor::StoreType::Average,
5987 5 : state.dataHeatBal->space(spaceNum).Name);
5988 15 : SetupOutputVariable(state,
5989 10 : format("Space Other Equipment {} Energy", Constant::eFuelNames[(int)fuelType]),
5990 : Constant::Units::J,
5991 5 : state.dataHeatBal->spaceRpt(spaceNum).OtherConsump[(int)fuelType],
5992 : OutputProcessor::TimeStepType::Zone,
5993 : OutputProcessor::StoreType::Sum,
5994 5 : state.dataHeatBal->space(spaceNum).Name);
5995 : }
5996 :
5997 52 : SetupOutputVariable(state,
5998 : "Space Other Equipment Radiant Heating Energy",
5999 : Constant::Units::J,
6000 26 : state.dataHeatBal->spaceRpt(spaceNum).OtherRadGain,
6001 : OutputProcessor::TimeStepType::Zone,
6002 : OutputProcessor::StoreType::Sum,
6003 26 : state.dataHeatBal->space(spaceNum).Name);
6004 52 : SetupOutputVariable(state,
6005 : "Space Other Equipment Radiant Heating Rate",
6006 : Constant::Units::W,
6007 26 : state.dataHeatBal->spaceRpt(spaceNum).OtherRadGainRate,
6008 : OutputProcessor::TimeStepType::Zone,
6009 : OutputProcessor::StoreType::Average,
6010 26 : state.dataHeatBal->space(spaceNum).Name);
6011 52 : SetupOutputVariable(state,
6012 : "Space Other Equipment Convective Heating Energy",
6013 : Constant::Units::J,
6014 26 : state.dataHeatBal->spaceRpt(spaceNum).OtherConGain,
6015 : OutputProcessor::TimeStepType::Zone,
6016 : OutputProcessor::StoreType::Sum,
6017 26 : state.dataHeatBal->space(spaceNum).Name);
6018 52 : SetupOutputVariable(state,
6019 : "Space Other Equipment Convective Heating Rate",
6020 : Constant::Units::W,
6021 26 : state.dataHeatBal->spaceRpt(spaceNum).OtherConGainRate,
6022 : OutputProcessor::TimeStepType::Zone,
6023 : OutputProcessor::StoreType::Average,
6024 26 : state.dataHeatBal->space(spaceNum).Name);
6025 52 : SetupOutputVariable(state,
6026 : "Space Other Equipment Latent Gain Energy",
6027 : Constant::Units::J,
6028 26 : state.dataHeatBal->spaceRpt(spaceNum).OtherLatGain,
6029 : OutputProcessor::TimeStepType::Zone,
6030 : OutputProcessor::StoreType::Sum,
6031 26 : state.dataHeatBal->space(spaceNum).Name);
6032 52 : SetupOutputVariable(state,
6033 : "Space Other Equipment Latent Gain Rate",
6034 : Constant::Units::W,
6035 26 : state.dataHeatBal->spaceRpt(spaceNum).OtherLatGainRate,
6036 : OutputProcessor::TimeStepType::Zone,
6037 : OutputProcessor::StoreType::Average,
6038 26 : state.dataHeatBal->space(spaceNum).Name);
6039 52 : SetupOutputVariable(state,
6040 : "Space Other Equipment Lost Heat Energy",
6041 : Constant::Units::J,
6042 26 : state.dataHeatBal->spaceRpt(spaceNum).OtherLost,
6043 : OutputProcessor::TimeStepType::Zone,
6044 : OutputProcessor::StoreType::Sum,
6045 26 : state.dataHeatBal->space(spaceNum).Name);
6046 52 : SetupOutputVariable(state,
6047 : "Space Other Equipment Lost Heat Rate",
6048 : Constant::Units::W,
6049 26 : state.dataHeatBal->spaceRpt(spaceNum).OtherLostRate,
6050 : OutputProcessor::TimeStepType::Zone,
6051 : OutputProcessor::StoreType::Average,
6052 26 : state.dataHeatBal->space(spaceNum).Name);
6053 52 : SetupOutputVariable(state,
6054 : "Space Other Equipment Total Heating Energy",
6055 : Constant::Units::J,
6056 26 : state.dataHeatBal->spaceRpt(spaceNum).OtherTotGain,
6057 : OutputProcessor::TimeStepType::Zone,
6058 : OutputProcessor::StoreType::Sum,
6059 26 : state.dataHeatBal->space(spaceNum).Name);
6060 52 : SetupOutputVariable(state,
6061 : "Space Other Equipment Total Heating Rate",
6062 : Constant::Units::W,
6063 26 : state.dataHeatBal->spaceRpt(spaceNum).OtherTotGainRate,
6064 : OutputProcessor::TimeStepType::Zone,
6065 : OutputProcessor::StoreType::Average,
6066 26 : state.dataHeatBal->space(spaceNum).Name);
6067 : }
6068 : // Reset space output flag
6069 225 : addSpaceOutputs(spaceNum) = false;
6070 : }
6071 : // Object report variables
6072 179 : for (int itEqNum = 1; itEqNum <= state.dataHeatBal->TotITEquip; ++itEqNum) {
6073 : // Set flags for zone and space total report variables
6074 12 : addZoneOutputs(state.dataHeatBal->ZoneITEq(itEqNum).ZonePtr) = true;
6075 12 : addSpaceOutputs(state.dataHeatBal->ZoneITEq(itEqNum).spaceIndex) = true;
6076 :
6077 12 : constexpr std::array<std::string_view, (int)PERptVars::Num> PowerOutputVariableStrings = {
6078 : "ITE CPU Electricity Rate",
6079 : "ITE Fan Electricity Rate",
6080 : "ITE UPS Electricity Rate",
6081 : "ITE CPU Electricity Rate at Design Inlet Conditions",
6082 : "ITE Fan Electricity Rate at Design Inlet Conditions",
6083 : "ITE UPS Heat Gain to Zone Rate",
6084 : "ITE Total Heat Gain to Zone Rate"};
6085 :
6086 96 : for (int i = 0; i < (int)PERptVars::Num; ++i) {
6087 168 : SetupOutputVariable(state,
6088 84 : PowerOutputVariableStrings[i],
6089 : Constant::Units::W,
6090 84 : state.dataHeatBal->ZoneITEq(itEqNum).PowerRpt[i],
6091 : OutputProcessor::TimeStepType::Zone,
6092 : OutputProcessor::StoreType::Average,
6093 84 : state.dataHeatBal->ZoneITEq(itEqNum).Name);
6094 : }
6095 :
6096 24 : SetupOutputVariable(state,
6097 : "ITE CPU Electricity Energy",
6098 : Constant::Units::J,
6099 12 : state.dataHeatBal->ZoneITEq(itEqNum).EnergyRpt[(int)PERptVars::CPU],
6100 : OutputProcessor::TimeStepType::Zone,
6101 : OutputProcessor::StoreType::Sum,
6102 12 : state.dataHeatBal->ZoneITEq(itEqNum).Name,
6103 : Constant::eResource::Electricity,
6104 : OutputProcessor::Group::Building,
6105 : OutputProcessor::EndUseCat::InteriorEquipment,
6106 12 : state.dataHeatBal->ZoneITEq(itEqNum).EndUseSubcategoryCPU,
6107 12 : state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(itEqNum).ZonePtr).Name,
6108 12 : state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(itEqNum).ZonePtr).Multiplier,
6109 12 : state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(itEqNum).ZonePtr).ListMultiplier,
6110 12 : state.dataHeatBal->space(state.dataHeatBal->ZoneITEq(itEqNum).spaceIndex).spaceType);
6111 :
6112 24 : SetupOutputVariable(state,
6113 : "ITE Fan Electricity Energy",
6114 : Constant::Units::J,
6115 12 : state.dataHeatBal->ZoneITEq(itEqNum).EnergyRpt[(int)PERptVars::Fan],
6116 : OutputProcessor::TimeStepType::Zone,
6117 : OutputProcessor::StoreType::Sum,
6118 12 : state.dataHeatBal->ZoneITEq(itEqNum).Name,
6119 : Constant::eResource::Electricity,
6120 : OutputProcessor::Group::Building,
6121 : OutputProcessor::EndUseCat::InteriorEquipment,
6122 12 : state.dataHeatBal->ZoneITEq(itEqNum).EndUseSubcategoryFan,
6123 12 : state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(itEqNum).ZonePtr).Name,
6124 12 : state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(itEqNum).ZonePtr).Multiplier,
6125 12 : state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(itEqNum).ZonePtr).ListMultiplier,
6126 12 : state.dataHeatBal->space(state.dataHeatBal->ZoneITEq(itEqNum).spaceIndex).spaceType);
6127 24 : SetupOutputVariable(state,
6128 : "ITE UPS Electricity Energy",
6129 : Constant::Units::J,
6130 12 : state.dataHeatBal->ZoneITEq(itEqNum).EnergyRpt[(int)PERptVars::UPS],
6131 : OutputProcessor::TimeStepType::Zone,
6132 : OutputProcessor::StoreType::Sum,
6133 12 : state.dataHeatBal->ZoneITEq(itEqNum).Name,
6134 : Constant::eResource::Electricity,
6135 : OutputProcessor::Group::Building,
6136 : OutputProcessor::EndUseCat::InteriorEquipment,
6137 12 : state.dataHeatBal->ZoneITEq(itEqNum).EndUseSubcategoryUPS,
6138 12 : state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(itEqNum).ZonePtr).Name,
6139 12 : state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(itEqNum).ZonePtr).Multiplier,
6140 12 : state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(itEqNum).ZonePtr).ListMultiplier,
6141 12 : state.dataHeatBal->space(state.dataHeatBal->ZoneITEq(itEqNum).spaceIndex).spaceType);
6142 24 : SetupOutputVariable(state,
6143 : "ITE CPU Electricity Energy at Design Inlet Conditions",
6144 : Constant::Units::J,
6145 12 : state.dataHeatBal->ZoneITEq(itEqNum).EnergyRpt[(int)PERptVars::CPUAtDesign],
6146 : OutputProcessor::TimeStepType::Zone,
6147 : OutputProcessor::StoreType::Sum,
6148 12 : state.dataHeatBal->ZoneITEq(itEqNum).Name);
6149 24 : SetupOutputVariable(state,
6150 : "ITE Fan Electricity Energy at Design Inlet Conditions",
6151 : Constant::Units::J,
6152 12 : state.dataHeatBal->ZoneITEq(itEqNum).EnergyRpt[(int)PERptVars::FanAtDesign],
6153 : OutputProcessor::TimeStepType::Zone,
6154 : OutputProcessor::StoreType::Sum,
6155 12 : state.dataHeatBal->ZoneITEq(itEqNum).Name);
6156 24 : SetupOutputVariable(state,
6157 : "ITE UPS Heat Gain to Zone Energy",
6158 : Constant::Units::J,
6159 12 : state.dataHeatBal->ZoneITEq(itEqNum).EnergyRpt[(int)PERptVars::UPSGainToZone],
6160 : OutputProcessor::TimeStepType::Zone,
6161 : OutputProcessor::StoreType::Sum,
6162 12 : state.dataHeatBal->ZoneITEq(itEqNum).Name);
6163 24 : SetupOutputVariable(state,
6164 : "ITE Total Heat Gain to Zone Energy",
6165 : Constant::Units::J,
6166 12 : state.dataHeatBal->ZoneITEq(itEqNum).EnergyRpt[(int)PERptVars::ConGainToZone],
6167 : OutputProcessor::TimeStepType::Zone,
6168 : OutputProcessor::StoreType::Sum,
6169 12 : state.dataHeatBal->ZoneITEq(itEqNum).Name);
6170 :
6171 24 : SetupOutputVariable(state,
6172 : "ITE Standard Density Air Volume Flow Rate",
6173 : Constant::Units::m3_s,
6174 12 : state.dataHeatBal->ZoneITEq(itEqNum).AirVolFlowStdDensity,
6175 : OutputProcessor::TimeStepType::Zone,
6176 : OutputProcessor::StoreType::Average,
6177 12 : state.dataHeatBal->ZoneITEq(itEqNum).Name);
6178 24 : SetupOutputVariable(state,
6179 : "ITE Current Density Air Volume Flow Rate",
6180 : Constant::Units::m3_s,
6181 12 : state.dataHeatBal->ZoneITEq(itEqNum).AirVolFlowCurDensity,
6182 : OutputProcessor::TimeStepType::Zone,
6183 : OutputProcessor::StoreType::Average,
6184 12 : state.dataHeatBal->ZoneITEq(itEqNum).Name);
6185 24 : SetupOutputVariable(state,
6186 : "ITE Air Mass Flow Rate",
6187 : Constant::Units::kg_s,
6188 12 : state.dataHeatBal->ZoneITEq(itEqNum).AirMassFlow,
6189 : OutputProcessor::TimeStepType::Zone,
6190 : OutputProcessor::StoreType::Average,
6191 12 : state.dataHeatBal->ZoneITEq(itEqNum).Name);
6192 24 : SetupOutputVariable(state,
6193 : "ITE Air Inlet Dry-Bulb Temperature",
6194 : Constant::Units::C,
6195 12 : state.dataHeatBal->ZoneITEq(itEqNum).AirInletDryBulbT,
6196 : OutputProcessor::TimeStepType::Zone,
6197 : OutputProcessor::StoreType::Average,
6198 12 : state.dataHeatBal->ZoneITEq(itEqNum).Name);
6199 24 : SetupOutputVariable(state,
6200 : "ITE Air Inlet Dewpoint Temperature",
6201 : Constant::Units::C,
6202 12 : state.dataHeatBal->ZoneITEq(itEqNum).AirInletDewpointT,
6203 : OutputProcessor::TimeStepType::Zone,
6204 : OutputProcessor::StoreType::Average,
6205 12 : state.dataHeatBal->ZoneITEq(itEqNum).Name);
6206 24 : SetupOutputVariable(state,
6207 : "ITE Air Inlet Relative Humidity",
6208 : Constant::Units::Perc,
6209 12 : state.dataHeatBal->ZoneITEq(itEqNum).AirInletRelHum,
6210 : OutputProcessor::TimeStepType::Zone,
6211 : OutputProcessor::StoreType::Average,
6212 12 : state.dataHeatBal->ZoneITEq(itEqNum).Name);
6213 24 : SetupOutputVariable(state,
6214 : "ITE Air Outlet Dry-Bulb Temperature",
6215 : Constant::Units::C,
6216 12 : state.dataHeatBal->ZoneITEq(itEqNum).AirOutletDryBulbT,
6217 : OutputProcessor::TimeStepType::Zone,
6218 : OutputProcessor::StoreType::Average,
6219 12 : state.dataHeatBal->ZoneITEq(itEqNum).Name);
6220 12 : if (state.dataHeatBal->ZoneITEq(itEqNum).SupplyAirNodeNum != 0) {
6221 14 : SetupOutputVariable(state,
6222 : "ITE Supply Heat Index",
6223 : Constant::Units::None,
6224 7 : state.dataHeatBal->ZoneITEq(itEqNum).SHI,
6225 : OutputProcessor::TimeStepType::Zone,
6226 : OutputProcessor::StoreType::Average,
6227 7 : state.dataHeatBal->ZoneITEq(itEqNum).Name);
6228 : }
6229 24 : SetupOutputVariable(state,
6230 : "ITE Air Inlet Operating Range Exceeded Time",
6231 : Constant::Units::hr,
6232 12 : state.dataHeatBal->ZoneITEq(itEqNum).TimeOutOfOperRange,
6233 : OutputProcessor::TimeStepType::Zone,
6234 : OutputProcessor::StoreType::Sum,
6235 12 : state.dataHeatBal->ZoneITEq(itEqNum).Name);
6236 24 : SetupOutputVariable(state,
6237 : "ITE Air Inlet Dry-Bulb Temperature Above Operating Range Time",
6238 : Constant::Units::hr,
6239 12 : state.dataHeatBal->ZoneITEq(itEqNum).TimeAboveDryBulbT,
6240 : OutputProcessor::TimeStepType::Zone,
6241 : OutputProcessor::StoreType::Sum,
6242 12 : state.dataHeatBal->ZoneITEq(itEqNum).Name);
6243 24 : SetupOutputVariable(state,
6244 : "ITE Air Inlet Dry-Bulb Temperature Below Operating Range Time",
6245 : Constant::Units::hr,
6246 12 : state.dataHeatBal->ZoneITEq(itEqNum).TimeBelowDryBulbT,
6247 : OutputProcessor::TimeStepType::Zone,
6248 : OutputProcessor::StoreType::Sum,
6249 12 : state.dataHeatBal->ZoneITEq(itEqNum).Name);
6250 24 : SetupOutputVariable(state,
6251 : "ITE Air Inlet Dewpoint Temperature Above Operating Range Time",
6252 : Constant::Units::hr,
6253 12 : state.dataHeatBal->ZoneITEq(itEqNum).TimeAboveDewpointT,
6254 : OutputProcessor::TimeStepType::Zone,
6255 : OutputProcessor::StoreType::Sum,
6256 12 : state.dataHeatBal->ZoneITEq(itEqNum).Name);
6257 24 : SetupOutputVariable(state,
6258 : "ITE Air Inlet Dewpoint Temperature Below Operating Range Time",
6259 : Constant::Units::hr,
6260 12 : state.dataHeatBal->ZoneITEq(itEqNum).TimeBelowDewpointT,
6261 : OutputProcessor::TimeStepType::Zone,
6262 : OutputProcessor::StoreType::Sum,
6263 12 : state.dataHeatBal->ZoneITEq(itEqNum).Name);
6264 24 : SetupOutputVariable(state,
6265 : "ITE Air Inlet Relative Humidity Above Operating Range Time",
6266 : Constant::Units::hr,
6267 12 : state.dataHeatBal->ZoneITEq(itEqNum).TimeAboveRH,
6268 : OutputProcessor::TimeStepType::Zone,
6269 : OutputProcessor::StoreType::Sum,
6270 12 : state.dataHeatBal->ZoneITEq(itEqNum).Name);
6271 24 : SetupOutputVariable(state,
6272 : "ITE Air Inlet Relative Humidity Below Operating Range Time",
6273 : Constant::Units::hr,
6274 12 : state.dataHeatBal->ZoneITEq(itEqNum).TimeBelowRH,
6275 : OutputProcessor::TimeStepType::Zone,
6276 : OutputProcessor::StoreType::Sum,
6277 12 : state.dataHeatBal->ZoneITEq(itEqNum).Name);
6278 24 : SetupOutputVariable(state,
6279 : "ITE Air Inlet Dry-Bulb Temperature Difference Above Operating Range",
6280 : Constant::Units::deltaC,
6281 12 : state.dataHeatBal->ZoneITEq(itEqNum).DryBulbTAboveDeltaT,
6282 : OutputProcessor::TimeStepType::Zone,
6283 : OutputProcessor::StoreType::Average,
6284 12 : state.dataHeatBal->ZoneITEq(itEqNum).Name);
6285 24 : SetupOutputVariable(state,
6286 : "ITE Air Inlet Dry-Bulb Temperature Difference Below Operating Range",
6287 : Constant::Units::deltaC,
6288 12 : state.dataHeatBal->ZoneITEq(itEqNum).DryBulbTBelowDeltaT,
6289 : OutputProcessor::TimeStepType::Zone,
6290 : OutputProcessor::StoreType::Average,
6291 12 : state.dataHeatBal->ZoneITEq(itEqNum).Name);
6292 24 : SetupOutputVariable(state,
6293 : "ITE Air Inlet Dewpoint Temperature Difference Above Operating Range",
6294 : Constant::Units::deltaC,
6295 12 : state.dataHeatBal->ZoneITEq(itEqNum).DewpointTAboveDeltaT,
6296 : OutputProcessor::TimeStepType::Zone,
6297 : OutputProcessor::StoreType::Average,
6298 12 : state.dataHeatBal->ZoneITEq(itEqNum).Name);
6299 24 : SetupOutputVariable(state,
6300 : "ITE Air Inlet Dewpoint Temperature Difference Below Operating Range",
6301 : Constant::Units::deltaC,
6302 12 : state.dataHeatBal->ZoneITEq(itEqNum).DewpointTBelowDeltaT,
6303 : OutputProcessor::TimeStepType::Zone,
6304 : OutputProcessor::StoreType::Average,
6305 12 : state.dataHeatBal->ZoneITEq(itEqNum).Name);
6306 24 : SetupOutputVariable(state,
6307 : "ITE Air Inlet Relative Humidity Difference Above Operating Range",
6308 : Constant::Units::Perc,
6309 12 : state.dataHeatBal->ZoneITEq(itEqNum).RHAboveDeltaRH,
6310 : OutputProcessor::TimeStepType::Zone,
6311 : OutputProcessor::StoreType::Average,
6312 12 : state.dataHeatBal->ZoneITEq(itEqNum).Name);
6313 24 : SetupOutputVariable(state,
6314 : "ITE Air Inlet Relative Humidity Difference Below Operating Range",
6315 : Constant::Units::Perc,
6316 12 : state.dataHeatBal->ZoneITEq(itEqNum).RHBelowDeltaRH,
6317 : OutputProcessor::TimeStepType::Zone,
6318 : OutputProcessor::StoreType::Average,
6319 12 : state.dataHeatBal->ZoneITEq(itEqNum).Name);
6320 : }
6321 :
6322 : // Zone total report variables
6323 373 : for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) {
6324 206 : if (addZoneOutputs(zoneNum)) {
6325 :
6326 12 : constexpr std::array<std::string_view, (int)PERptVars::Num> PowerOutputVariableStrings = {
6327 : "Zone ITE CPU Electricity Rate",
6328 : "Zone ITE Fan Electricity Rate",
6329 : "Zone ITE UPS Electricity Rate",
6330 : "Zone ITE CPU Electricity Rate at Design Inlet Conditions",
6331 : "Zone ITE Fan Electricity Rate at Design Inlet Conditions",
6332 : "Zone ITE UPS Heat Gain to Zone Rate",
6333 : "Zone ITE Total Heat Gain to Zone Rate"};
6334 :
6335 96 : for (int i = 0; i < (int)PERptVars::Num; ++i) {
6336 168 : SetupOutputVariable(state,
6337 84 : PowerOutputVariableStrings[i],
6338 : Constant::Units::W,
6339 84 : state.dataHeatBal->ZoneRpt(zoneNum).PowerRpt[i],
6340 : OutputProcessor::TimeStepType::Zone,
6341 : OutputProcessor::StoreType::Average,
6342 84 : state.dataHeatBal->Zone(zoneNum).Name);
6343 : }
6344 :
6345 24 : SetupOutputVariable(state,
6346 : "Zone ITE Adjusted Return Air Temperature",
6347 : Constant::Units::C,
6348 12 : state.dataHeatBal->ZoneRpt(zoneNum).ITEAdjReturnTemp,
6349 : OutputProcessor::TimeStepType::Zone,
6350 : OutputProcessor::StoreType::Average,
6351 12 : state.dataHeatBal->Zone(zoneNum).Name);
6352 :
6353 12 : constexpr std::array<std::string_view, (int)PERptVars::Num> EnergyOutputVariableStrings = {
6354 : "Zone ITE CPU Electricity Energy",
6355 : "Zone ITE Fan Electricity Energy",
6356 : "Zone ITE UPS Electricity Energy",
6357 : "Zone ITE CPU Electricity Energy at Design Inlet Conditions",
6358 : "Zone ITE Fan Electricity Energy at Design Inlet Conditions",
6359 : "Zone ITE UPS Heat Gain to Zone Energy",
6360 : "Zone ITE Total Heat Gain to Zone Energy"};
6361 :
6362 96 : for (int i = 0; i < (int)PERptVars::Num; ++i) {
6363 168 : SetupOutputVariable(state,
6364 84 : EnergyOutputVariableStrings[i],
6365 : Constant::Units::J,
6366 84 : state.dataHeatBal->ZoneRpt(zoneNum).EnergyRpt[i],
6367 : OutputProcessor::TimeStepType::Zone,
6368 : OutputProcessor::StoreType::Sum,
6369 84 : state.dataHeatBal->Zone(zoneNum).Name);
6370 : }
6371 :
6372 24 : SetupOutputVariable(state,
6373 : "Zone ITE Standard Density Air Volume Flow Rate",
6374 : Constant::Units::m3_s,
6375 12 : state.dataHeatBal->ZoneRpt(zoneNum).ITEqAirVolFlowStdDensity,
6376 : OutputProcessor::TimeStepType::Zone,
6377 : OutputProcessor::StoreType::Average,
6378 12 : state.dataHeatBal->Zone(zoneNum).Name);
6379 24 : SetupOutputVariable(state,
6380 : "Zone ITE Air Mass Flow Rate",
6381 : Constant::Units::kg_s,
6382 12 : state.dataHeatBal->ZoneRpt(zoneNum).ITEqAirMassFlow,
6383 : OutputProcessor::TimeStepType::Zone,
6384 : OutputProcessor::StoreType::Average,
6385 12 : state.dataHeatBal->Zone(zoneNum).Name);
6386 24 : SetupOutputVariable(state,
6387 : "Zone ITE Average Supply Heat Index",
6388 : Constant::Units::None,
6389 12 : state.dataHeatBal->ZoneRpt(zoneNum).ITEqSHI,
6390 : OutputProcessor::TimeStepType::Zone,
6391 : OutputProcessor::StoreType::Average,
6392 12 : state.dataHeatBal->Zone(zoneNum).Name);
6393 24 : SetupOutputVariable(state,
6394 : "Zone ITE Any Air Inlet Operating Range Exceeded Time",
6395 : Constant::Units::hr,
6396 12 : state.dataHeatBal->ZoneRpt(zoneNum).ITEqTimeOutOfOperRange,
6397 : OutputProcessor::TimeStepType::Zone,
6398 : OutputProcessor::StoreType::Sum,
6399 12 : state.dataHeatBal->Zone(zoneNum).Name);
6400 24 : SetupOutputVariable(state,
6401 : "Zone ITE Any Air Inlet Dry-Bulb Temperature Above Operating Range Time",
6402 : Constant::Units::hr,
6403 12 : state.dataHeatBal->ZoneRpt(zoneNum).ITEqTimeAboveDryBulbT,
6404 : OutputProcessor::TimeStepType::Zone,
6405 : OutputProcessor::StoreType::Sum,
6406 12 : state.dataHeatBal->Zone(zoneNum).Name);
6407 24 : SetupOutputVariable(state,
6408 : "Zone ITE Any Air Inlet Dry-Bulb Temperature Below Operating Range Time",
6409 : Constant::Units::hr,
6410 12 : state.dataHeatBal->ZoneRpt(zoneNum).ITEqTimeBelowDryBulbT,
6411 : OutputProcessor::TimeStepType::Zone,
6412 : OutputProcessor::StoreType::Sum,
6413 12 : state.dataHeatBal->Zone(zoneNum).Name);
6414 24 : SetupOutputVariable(state,
6415 : "Zone ITE Any Air Inlet Dewpoint Temperature Above Operating Range Time",
6416 : Constant::Units::hr,
6417 12 : state.dataHeatBal->ZoneRpt(zoneNum).ITEqTimeAboveDewpointT,
6418 : OutputProcessor::TimeStepType::Zone,
6419 : OutputProcessor::StoreType::Sum,
6420 12 : state.dataHeatBal->Zone(zoneNum).Name);
6421 24 : SetupOutputVariable(state,
6422 : "Zone ITE Any Air Inlet Dewpoint Temperature Below Operating Range Time",
6423 : Constant::Units::hr,
6424 12 : state.dataHeatBal->ZoneRpt(zoneNum).ITEqTimeBelowDewpointT,
6425 : OutputProcessor::TimeStepType::Zone,
6426 : OutputProcessor::StoreType::Sum,
6427 12 : state.dataHeatBal->Zone(zoneNum).Name);
6428 24 : SetupOutputVariable(state,
6429 : "Zone ITE Any Air Inlet Relative Humidity Above Operating Range Time",
6430 : Constant::Units::hr,
6431 12 : state.dataHeatBal->ZoneRpt(zoneNum).ITEqTimeAboveRH,
6432 : OutputProcessor::TimeStepType::Zone,
6433 : OutputProcessor::StoreType::Sum,
6434 12 : state.dataHeatBal->Zone(zoneNum).Name);
6435 24 : SetupOutputVariable(state,
6436 : "Zone ITE Any Air Inlet Relative Humidity Below Operating Range Time",
6437 : Constant::Units::hr,
6438 12 : state.dataHeatBal->ZoneRpt(zoneNum).ITEqTimeBelowRH,
6439 : OutputProcessor::TimeStepType::Zone,
6440 : OutputProcessor::StoreType::Sum,
6441 12 : state.dataHeatBal->Zone(zoneNum).Name);
6442 : }
6443 : // Reset zone output flag
6444 206 : addZoneOutputs(zoneNum) = false;
6445 : }
6446 :
6447 : // Space total report variables
6448 392 : for (int spaceNum = 1; spaceNum <= state.dataGlobal->numSpaces; ++spaceNum) {
6449 225 : if (addSpaceOutputs(spaceNum)) {
6450 12 : constexpr std::array<std::string_view, (int)PERptVars::Num> PowerOutputVariableStrings = {
6451 : "Space ITE CPU Electricity Rate",
6452 : "Space ITE Fan Electricity Rate",
6453 : "Space ITE UPS Electricity Rate",
6454 : "Space ITE CPU Electricity Rate at Design Inlet Conditions",
6455 : "Space ITE Fan Electricity Rate at Design Inlet Conditions",
6456 : "Space ITE UPS Heat Gain to Zone Rate",
6457 : "Space ITE Total Heat Gain to Zone Rate"};
6458 :
6459 96 : for (int i = 0; i < (int)PERptVars::Num; ++i) {
6460 168 : SetupOutputVariable(state,
6461 84 : PowerOutputVariableStrings[i],
6462 : Constant::Units::W,
6463 84 : state.dataHeatBal->spaceRpt(spaceNum).PowerRpt[i],
6464 : OutputProcessor::TimeStepType::Zone,
6465 : OutputProcessor::StoreType::Average,
6466 84 : state.dataHeatBal->space(spaceNum).Name);
6467 : }
6468 :
6469 : // Not applicable for space until space has it's own air temperatures
6470 : // Setup Output Variable(state,
6471 : // "Space ITE Adjusted Return Air Temperature",
6472 : // Constant::Units::W,
6473 : // state.dataHeatBal->spaceRpt(spaceNum).ITEAdjReturnTemp,
6474 : // OutputProcessor::TimeStepType::Zone,
6475 : // OutputProcessor::StoreType::Average,
6476 : // state.dataHeatBal->space(spaceNum).Name);
6477 :
6478 12 : constexpr std::array<std::string_view, (int)PERptVars::Num> EnergyOutputVariableStrings = {
6479 : "Space ITE CPU Electricity Energy",
6480 : "Space ITE Fan Electricity Energy",
6481 : "Space ITE UPS Electricity Energy",
6482 : "Space ITE CPU Electricity Energy at Design Inlet Conditions",
6483 : "Space ITE Fan Electricity Energy at Design Inlet Conditions",
6484 : "Space ITE UPS Heat Gain to Zone Energy",
6485 : "Space ITE Total Heat Gain to Zone Energy"};
6486 :
6487 96 : for (int i = 0; i < (int)PERptVars::Num; ++i) {
6488 168 : SetupOutputVariable(state,
6489 84 : EnergyOutputVariableStrings[i],
6490 : Constant::Units::J,
6491 84 : state.dataHeatBal->spaceRpt(spaceNum).EnergyRpt[i],
6492 : OutputProcessor::TimeStepType::Zone,
6493 : OutputProcessor::StoreType::Sum,
6494 84 : state.dataHeatBal->space(spaceNum).Name);
6495 : }
6496 :
6497 24 : SetupOutputVariable(state,
6498 : "Space ITE Standard Density Air Volume Flow Rate",
6499 : Constant::Units::m3_s,
6500 12 : state.dataHeatBal->spaceRpt(spaceNum).ITEqAirVolFlowStdDensity,
6501 : OutputProcessor::TimeStepType::Zone,
6502 : OutputProcessor::StoreType::Average,
6503 12 : state.dataHeatBal->space(spaceNum).Name);
6504 24 : SetupOutputVariable(state,
6505 : "Space ITE Air Mass Flow Rate",
6506 : Constant::Units::kg_s,
6507 12 : state.dataHeatBal->spaceRpt(spaceNum).ITEqAirMassFlow,
6508 : OutputProcessor::TimeStepType::Zone,
6509 : OutputProcessor::StoreType::Average,
6510 12 : state.dataHeatBal->space(spaceNum).Name);
6511 24 : SetupOutputVariable(state,
6512 : "Space ITE Average Supply Heat Index",
6513 : Constant::Units::None,
6514 12 : state.dataHeatBal->spaceRpt(spaceNum).ITEqSHI,
6515 : OutputProcessor::TimeStepType::Zone,
6516 : OutputProcessor::StoreType::Average,
6517 12 : state.dataHeatBal->space(spaceNum).Name);
6518 24 : SetupOutputVariable(state,
6519 : "Space ITE Any Air Inlet Operating Range Exceeded Time",
6520 : Constant::Units::hr,
6521 12 : state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeOutOfOperRange,
6522 : OutputProcessor::TimeStepType::Zone,
6523 : OutputProcessor::StoreType::Sum,
6524 12 : state.dataHeatBal->space(spaceNum).Name);
6525 24 : SetupOutputVariable(state,
6526 : "Space ITE Any Air Inlet Dry-Bulb Temperature Above Operating Range Time",
6527 : Constant::Units::hr,
6528 12 : state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeAboveDryBulbT,
6529 : OutputProcessor::TimeStepType::Zone,
6530 : OutputProcessor::StoreType::Sum,
6531 12 : state.dataHeatBal->space(spaceNum).Name);
6532 24 : SetupOutputVariable(state,
6533 : "Space ITE Any Air Inlet Dry-Bulb Temperature Below Operating Range Time",
6534 : Constant::Units::hr,
6535 12 : state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeBelowDryBulbT,
6536 : OutputProcessor::TimeStepType::Zone,
6537 : OutputProcessor::StoreType::Sum,
6538 12 : state.dataHeatBal->space(spaceNum).Name);
6539 24 : SetupOutputVariable(state,
6540 : "Space ITE Any Air Inlet Dewpoint Temperature Above Operating Range Time",
6541 : Constant::Units::hr,
6542 12 : state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeAboveDewpointT,
6543 : OutputProcessor::TimeStepType::Zone,
6544 : OutputProcessor::StoreType::Sum,
6545 12 : state.dataHeatBal->space(spaceNum).Name);
6546 24 : SetupOutputVariable(state,
6547 : "Space ITE Any Air Inlet Dewpoint Temperature Below Operating Range Time",
6548 : Constant::Units::hr,
6549 12 : state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeBelowDewpointT,
6550 : OutputProcessor::TimeStepType::Zone,
6551 : OutputProcessor::StoreType::Sum,
6552 12 : state.dataHeatBal->space(spaceNum).Name);
6553 24 : SetupOutputVariable(state,
6554 : "Space ITE Any Air Inlet Relative Humidity Above Operating Range Time",
6555 : Constant::Units::hr,
6556 12 : state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeAboveRH,
6557 : OutputProcessor::TimeStepType::Zone,
6558 : OutputProcessor::StoreType::Sum,
6559 12 : state.dataHeatBal->space(spaceNum).Name);
6560 24 : SetupOutputVariable(state,
6561 : "Space ITE Any Air Inlet Relative Humidity Below Operating Range Time",
6562 : Constant::Units::hr,
6563 12 : state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeBelowRH,
6564 : OutputProcessor::TimeStepType::Zone,
6565 : OutputProcessor::StoreType::Sum,
6566 12 : state.dataHeatBal->space(spaceNum).Name);
6567 : }
6568 : // Reset space output flag
6569 225 : addSpaceOutputs(spaceNum) = false;
6570 : }
6571 :
6572 : // Object report variables
6573 169 : for (int bbHeatNum = 1; bbHeatNum <= state.dataHeatBal->TotBBHeat; ++bbHeatNum) {
6574 : // Set flags for zone and space total report variables
6575 2 : addZoneOutputs(state.dataHeatBal->ZoneBBHeat(bbHeatNum).ZonePtr) = true;
6576 2 : addSpaceOutputs(state.dataHeatBal->ZoneBBHeat(bbHeatNum).spaceIndex) = true;
6577 4 : SetupOutputVariable(state,
6578 : "Baseboard Electricity Rate",
6579 : Constant::Units::W,
6580 2 : state.dataHeatBal->ZoneBBHeat(bbHeatNum).Power,
6581 : OutputProcessor::TimeStepType::Zone,
6582 : OutputProcessor::StoreType::Average,
6583 2 : state.dataHeatBal->ZoneBBHeat(bbHeatNum).Name);
6584 4 : SetupOutputVariable(state,
6585 : "Baseboard Electricity Energy",
6586 : Constant::Units::J,
6587 2 : state.dataHeatBal->ZoneBBHeat(bbHeatNum).Consumption,
6588 : OutputProcessor::TimeStepType::Zone,
6589 : OutputProcessor::StoreType::Sum,
6590 2 : state.dataHeatBal->ZoneBBHeat(bbHeatNum).Name,
6591 : Constant::eResource::Electricity,
6592 : OutputProcessor::Group::Building,
6593 : OutputProcessor::EndUseCat::InteriorEquipment,
6594 2 : state.dataHeatBal->ZoneBBHeat(bbHeatNum).EndUseSubcategory,
6595 2 : state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(bbHeatNum).ZonePtr).Name,
6596 2 : state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(bbHeatNum).ZonePtr).Multiplier,
6597 2 : state.dataHeatBal->Zone(state.dataHeatBal->ZoneBBHeat(bbHeatNum).ZonePtr).ListMultiplier,
6598 2 : state.dataHeatBal->space(state.dataHeatBal->ZoneBBHeat(bbHeatNum).spaceIndex).spaceType);
6599 :
6600 4 : SetupOutputVariable(state,
6601 : "Baseboard Radiant Heating Energy",
6602 : Constant::Units::J,
6603 2 : state.dataHeatBal->ZoneBBHeat(bbHeatNum).RadGainEnergy,
6604 : OutputProcessor::TimeStepType::Zone,
6605 : OutputProcessor::StoreType::Sum,
6606 2 : state.dataHeatBal->ZoneBBHeat(bbHeatNum).Name);
6607 4 : SetupOutputVariable(state,
6608 : "Baseboard Radiant Heating Rate",
6609 : Constant::Units::W,
6610 2 : state.dataHeatBal->ZoneBBHeat(bbHeatNum).RadGainRate,
6611 : OutputProcessor::TimeStepType::Zone,
6612 : OutputProcessor::StoreType::Average,
6613 2 : state.dataHeatBal->ZoneBBHeat(bbHeatNum).Name);
6614 4 : SetupOutputVariable(state,
6615 : "Baseboard Convective Heating Energy",
6616 : Constant::Units::J,
6617 2 : state.dataHeatBal->ZoneBBHeat(bbHeatNum).ConGainEnergy,
6618 : OutputProcessor::TimeStepType::Zone,
6619 : OutputProcessor::StoreType::Sum,
6620 2 : state.dataHeatBal->ZoneBBHeat(bbHeatNum).Name);
6621 4 : SetupOutputVariable(state,
6622 : "Baseboard Convective Heating Rate",
6623 : Constant::Units::W,
6624 2 : state.dataHeatBal->ZoneBBHeat(bbHeatNum).ConGainRate,
6625 : OutputProcessor::TimeStepType::Zone,
6626 : OutputProcessor::StoreType::Average,
6627 2 : state.dataHeatBal->ZoneBBHeat(bbHeatNum).Name);
6628 4 : SetupOutputVariable(state,
6629 : "Baseboard Total Heating Energy",
6630 : Constant::Units::J,
6631 2 : state.dataHeatBal->ZoneBBHeat(bbHeatNum).TotGainEnergy,
6632 : OutputProcessor::TimeStepType::Zone,
6633 : OutputProcessor::StoreType::Sum,
6634 2 : state.dataHeatBal->ZoneBBHeat(bbHeatNum).Name);
6635 4 : SetupOutputVariable(state,
6636 : "Baseboard Total Heating Rate",
6637 : Constant::Units::W,
6638 2 : state.dataHeatBal->ZoneBBHeat(bbHeatNum).TotGainRate,
6639 : OutputProcessor::TimeStepType::Zone,
6640 : OutputProcessor::StoreType::Average,
6641 2 : state.dataHeatBal->ZoneBBHeat(bbHeatNum).Name);
6642 : }
6643 :
6644 : // Zone total report variables
6645 373 : for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) {
6646 206 : if (addZoneOutputs(zoneNum)) {
6647 2 : SetupOutputVariable(state,
6648 : "Zone Baseboard Electricity Rate",
6649 : Constant::Units::W,
6650 1 : state.dataHeatBal->ZoneRpt(zoneNum).BaseHeatPower,
6651 : OutputProcessor::TimeStepType::Zone,
6652 : OutputProcessor::StoreType::Average,
6653 1 : state.dataHeatBal->Zone(zoneNum).Name);
6654 2 : SetupOutputVariable(state,
6655 : "Zone Baseboard Electricity Energy",
6656 : Constant::Units::J,
6657 1 : state.dataHeatBal->ZoneRpt(zoneNum).BaseHeatElecCons,
6658 : OutputProcessor::TimeStepType::Zone,
6659 : OutputProcessor::StoreType::Sum,
6660 1 : state.dataHeatBal->Zone(zoneNum).Name);
6661 :
6662 2 : SetupOutputVariable(state,
6663 : "Zone Baseboard Radiant Heating Energy",
6664 : Constant::Units::J,
6665 1 : state.dataHeatBal->ZoneRpt(zoneNum).BaseHeatRadGain,
6666 : OutputProcessor::TimeStepType::Zone,
6667 : OutputProcessor::StoreType::Sum,
6668 1 : state.dataHeatBal->Zone(zoneNum).Name);
6669 2 : SetupOutputVariable(state,
6670 : "Zone Baseboard Radiant Heating Rate",
6671 : Constant::Units::W,
6672 1 : state.dataHeatBal->ZoneRpt(zoneNum).BaseHeatRadGainRate,
6673 : OutputProcessor::TimeStepType::Zone,
6674 : OutputProcessor::StoreType::Average,
6675 1 : state.dataHeatBal->Zone(zoneNum).Name);
6676 2 : SetupOutputVariable(state,
6677 : "Zone Baseboard Convective Heating Energy",
6678 : Constant::Units::J,
6679 1 : state.dataHeatBal->ZoneRpt(zoneNum).BaseHeatConGain,
6680 : OutputProcessor::TimeStepType::Zone,
6681 : OutputProcessor::StoreType::Sum,
6682 1 : state.dataHeatBal->Zone(zoneNum).Name);
6683 2 : SetupOutputVariable(state,
6684 : "Zone Baseboard Convective Heating Rate",
6685 : Constant::Units::W,
6686 1 : state.dataHeatBal->ZoneRpt(zoneNum).BaseHeatConGainRate,
6687 : OutputProcessor::TimeStepType::Zone,
6688 : OutputProcessor::StoreType::Average,
6689 1 : state.dataHeatBal->Zone(zoneNum).Name);
6690 2 : SetupOutputVariable(state,
6691 : "Zone Baseboard Total Heating Energy",
6692 : Constant::Units::J,
6693 1 : state.dataHeatBal->ZoneRpt(zoneNum).BaseHeatTotGain,
6694 : OutputProcessor::TimeStepType::Zone,
6695 : OutputProcessor::StoreType::Sum,
6696 1 : state.dataHeatBal->Zone(zoneNum).Name);
6697 2 : SetupOutputVariable(state,
6698 : "Zone Baseboard Total Heating Rate",
6699 : Constant::Units::W,
6700 1 : state.dataHeatBal->ZoneRpt(zoneNum).BaseHeatTotGainRate,
6701 : OutputProcessor::TimeStepType::Zone,
6702 : OutputProcessor::StoreType::Average,
6703 1 : state.dataHeatBal->Zone(zoneNum).Name);
6704 : }
6705 : // Reset zone output flag
6706 206 : addZoneOutputs(zoneNum) = false;
6707 : }
6708 :
6709 : // Space total report variables
6710 392 : for (int spaceNum = 1; spaceNum <= state.dataGlobal->numSpaces; ++spaceNum) {
6711 225 : if (addSpaceOutputs(spaceNum)) {
6712 4 : SetupOutputVariable(state,
6713 : "Space Baseboard Electricity Rate",
6714 : Constant::Units::W,
6715 2 : state.dataHeatBal->spaceRpt(spaceNum).BaseHeatPower,
6716 : OutputProcessor::TimeStepType::Zone,
6717 : OutputProcessor::StoreType::Average,
6718 2 : state.dataHeatBal->space(spaceNum).Name);
6719 4 : SetupOutputVariable(state,
6720 : "Space Baseboard Electricity Energy",
6721 : Constant::Units::J,
6722 2 : state.dataHeatBal->spaceRpt(spaceNum).BaseHeatElecCons,
6723 : OutputProcessor::TimeStepType::Zone,
6724 : OutputProcessor::StoreType::Sum,
6725 2 : state.dataHeatBal->space(spaceNum).Name);
6726 :
6727 4 : SetupOutputVariable(state,
6728 : "Space Baseboard Radiant Heating Energy",
6729 : Constant::Units::J,
6730 2 : state.dataHeatBal->spaceRpt(spaceNum).BaseHeatRadGain,
6731 : OutputProcessor::TimeStepType::Zone,
6732 : OutputProcessor::StoreType::Sum,
6733 2 : state.dataHeatBal->space(spaceNum).Name);
6734 4 : SetupOutputVariable(state,
6735 : "Space Baseboard Radiant Heating Rate",
6736 : Constant::Units::W,
6737 2 : state.dataHeatBal->spaceRpt(spaceNum).BaseHeatRadGainRate,
6738 : OutputProcessor::TimeStepType::Zone,
6739 : OutputProcessor::StoreType::Average,
6740 2 : state.dataHeatBal->space(spaceNum).Name);
6741 4 : SetupOutputVariable(state,
6742 : "Space Baseboard Convective Heating Energy",
6743 : Constant::Units::J,
6744 2 : state.dataHeatBal->spaceRpt(spaceNum).BaseHeatConGain,
6745 : OutputProcessor::TimeStepType::Zone,
6746 : OutputProcessor::StoreType::Sum,
6747 2 : state.dataHeatBal->space(spaceNum).Name);
6748 4 : SetupOutputVariable(state,
6749 : "Space Baseboard Convective Heating Rate",
6750 : Constant::Units::W,
6751 2 : state.dataHeatBal->spaceRpt(spaceNum).BaseHeatConGainRate,
6752 : OutputProcessor::TimeStepType::Zone,
6753 : OutputProcessor::StoreType::Average,
6754 2 : state.dataHeatBal->space(spaceNum).Name);
6755 4 : SetupOutputVariable(state,
6756 : "Space Baseboard Total Heating Energy",
6757 : Constant::Units::J,
6758 2 : state.dataHeatBal->spaceRpt(spaceNum).BaseHeatTotGain,
6759 : OutputProcessor::TimeStepType::Zone,
6760 : OutputProcessor::StoreType::Sum,
6761 2 : state.dataHeatBal->space(spaceNum).Name);
6762 4 : SetupOutputVariable(state,
6763 : "Space Baseboard Total Heating Rate",
6764 : Constant::Units::W,
6765 2 : state.dataHeatBal->spaceRpt(spaceNum).BaseHeatTotGainRate,
6766 : OutputProcessor::TimeStepType::Zone,
6767 : OutputProcessor::StoreType::Average,
6768 2 : state.dataHeatBal->space(spaceNum).Name);
6769 : }
6770 : // Reset space output flag
6771 225 : addSpaceOutputs(spaceNum) = false;
6772 : }
6773 167 : }
6774 :
6775 249958 : void InitInternalHeatGains(EnergyPlusData &state)
6776 : {
6777 :
6778 : // SUBROUTINE INFORMATION:
6779 : // AUTHOR Linda K. Lawrie
6780 : // DATE WRITTEN September 1997
6781 : // MODIFIED November 1998, FW: add adjustment to elec lights for dayltg controls
6782 : // August 2003, FCW: add optional calculation of light-to-return fraction
6783 : // as a function of return plenum air temperature.
6784 : // RE-ENGINEERED na
6785 :
6786 : // PURPOSE OF THIS SUBROUTINE:
6787 : // This subroutine sets up the zone internal heat gains
6788 : // that are independent of the zone air temperature.
6789 :
6790 : // Using/Aliasing
6791 : using Dayltg::FigureTDDZoneGains;
6792 : using FuelCellElectricGenerator::FigureFuelCellZoneGains;
6793 : using MicroCHPElectricGenerator::FigureMicroCHPZoneGains;
6794 : using OutputReportTabular::AllocateLoadComponentArrays;
6795 : using Psychrometrics::PsyRhoAirFnPbTdbW;
6796 : using RefrigeratedCase::FigureRefrigerationZoneGains;
6797 : using WaterThermalTanks::CalcWaterThermalTankZoneGains;
6798 : using WaterUse::CalcWaterUseZoneGains;
6799 :
6800 : // SUBROUTINE PARAMETER DEFINITIONS:
6801 : static constexpr std::array<Real64, 9> C = {
6802 : 6.4611027, 0.946892, 0.0000255737, 7.139322, -0.0627909, 0.0000589271, -0.198550, 0.000940018, -0.00000149532};
6803 249958 : static ZoneCatEUseData const zeroZoneCatEUse; // For initialization
6804 :
6805 : // SUBROUTINE LOCAL VARIABLE DECLARATIONS:
6806 : Real64 ActivityLevel_WperPerson; // Units on Activity Level (Schedule)
6807 : Real64 NumberOccupants; // Number of occupants
6808 : Real64 Q; // , QR
6809 : Real64 TotalPeopleGain; // Total heat gain from people (intermediate calculational variable)
6810 : Real64 SensiblePeopleGain; // Sensible heat gain from people (intermediate calculational variable)
6811 : Real64 FractionConvected; // For general lighting, fraction of heat from lights convected to zone air
6812 : Real64 FractionReturnAir; // For general lighting, fraction of heat from lights convected to zone's return air
6813 : Real64 FractionRadiant; // For general lighting, fraction of heat from lights to zone that is long wave
6814 : Real64 ReturnPlenumTemp; // Air temperature of a zone's return air plenum (C)
6815 : Real64 pulseMultipler; // use to create a pulse for the load component report computations
6816 :
6817 : // REAL(r64), ALLOCATABLE, SAVE, DIMENSION(:) :: QSA
6818 :
6819 : // IF (.NOT. ALLOCATED(QSA)) ALLOCATE(QSA(NumOfZones))
6820 :
6821 : // Zero out time step variables
6822 622915 : for (auto &e : state.dataHeatBal->spaceIntGain) {
6823 372957 : e.NOFOCC = 0.0;
6824 372957 : e.QLTSW = 0.0;
6825 : }
6826 :
6827 249958 : state.dataHeatBal->ZoneIntEEuse = zeroZoneCatEUse; // Set all member arrays to zeros
6828 :
6829 586610 : for (auto &e : state.dataHeatBal->ZoneRpt) {
6830 336652 : e.CO2Rate = 0.0;
6831 : }
6832 :
6833 622915 : for (auto &e : state.dataHeatBal->spaceRpt) {
6834 : // People
6835 372957 : e.PeopleRadGain = 0.0;
6836 372957 : e.PeopleConGain = 0.0;
6837 372957 : e.PeopleSenGain = 0.0;
6838 372957 : e.PeopleNumOcc = 0.0;
6839 372957 : e.PeopleLatGain = 0.0;
6840 372957 : e.PeopleTotGain = 0.0;
6841 372957 : e.PeopleRadGainRate = 0.0;
6842 372957 : e.PeopleConGainRate = 0.0;
6843 372957 : e.PeopleSenGainRate = 0.0;
6844 372957 : e.PeopleLatGainRate = 0.0;
6845 372957 : e.PeopleTotGainRate = 0.0;
6846 : // Lights
6847 372957 : e.LtsPower = 0.0;
6848 372957 : e.LtsElecConsump = 0.0;
6849 372957 : e.LtsRadGain = 0.0;
6850 372957 : e.LtsVisGain = 0.0;
6851 372957 : e.LtsConGain = 0.0;
6852 372957 : e.LtsRetAirGain = 0.0;
6853 372957 : e.LtsTotGain = 0.0;
6854 372957 : e.LtsRadGainRate = 0.0;
6855 372957 : e.LtsVisGainRate = 0.0;
6856 372957 : e.LtsConGainRate = 0.0;
6857 372957 : e.LtsRetAirGainRate = 0.0;
6858 372957 : e.LtsTotGainRate = 0.0;
6859 : // Baseboard Heat
6860 372957 : e.BaseHeatPower = 0.0;
6861 372957 : e.BaseHeatElecCons = 0.0;
6862 372957 : e.BaseHeatRadGain = 0.0;
6863 372957 : e.BaseHeatConGain = 0.0;
6864 372957 : e.BaseHeatTotGain = 0.0;
6865 372957 : e.BaseHeatRadGainRate = 0.0;
6866 372957 : e.BaseHeatConGainRate = 0.0;
6867 372957 : e.BaseHeatTotGainRate = 0.0;
6868 : // Electric Equipment
6869 372957 : e.ElecPower = 0.0;
6870 372957 : e.ElecConsump = 0.0;
6871 372957 : e.ElecRadGain = 0.0;
6872 372957 : e.ElecConGain = 0.0;
6873 372957 : e.ElecLatGain = 0.0;
6874 372957 : e.ElecLost = 0.0;
6875 372957 : e.ElecTotGain = 0.0;
6876 372957 : e.ElecRadGainRate = 0.0;
6877 372957 : e.ElecConGainRate = 0.0;
6878 372957 : e.ElecLatGainRate = 0.0;
6879 372957 : e.ElecLostRate = 0.0;
6880 372957 : e.ElecTotGainRate = 0.0;
6881 : // Gas Equipment
6882 372957 : e.GasPower = 0.0;
6883 372957 : e.GasConsump = 0.0;
6884 372957 : e.GasRadGain = 0.0;
6885 372957 : e.GasConGain = 0.0;
6886 372957 : e.GasLatGain = 0.0;
6887 372957 : e.GasLost = 0.0;
6888 372957 : e.GasTotGain = 0.0;
6889 372957 : e.GasRadGainRate = 0.0;
6890 372957 : e.GasConGainRate = 0.0;
6891 372957 : e.GasLatGainRate = 0.0;
6892 372957 : e.GasLostRate = 0.0;
6893 372957 : e.GasTotGainRate = 0.0;
6894 : // Hot Water Equipment
6895 372957 : e.HWPower = 0.0;
6896 372957 : e.HWConsump = 0.0;
6897 372957 : e.HWRadGain = 0.0;
6898 372957 : e.HWConGain = 0.0;
6899 372957 : e.HWLatGain = 0.0;
6900 372957 : e.HWLost = 0.0;
6901 372957 : e.HWTotGain = 0.0;
6902 372957 : e.HWRadGainRate = 0.0;
6903 372957 : e.HWConGainRate = 0.0;
6904 372957 : e.HWLatGainRate = 0.0;
6905 372957 : e.HWLostRate = 0.0;
6906 372957 : e.HWTotGainRate = 0.0;
6907 : // Steam Equipment
6908 372957 : e.SteamPower = 0.0;
6909 372957 : e.SteamConsump = 0.0;
6910 372957 : e.SteamRadGain = 0.0;
6911 372957 : e.SteamConGain = 0.0;
6912 372957 : e.SteamLatGain = 0.0;
6913 372957 : e.SteamLost = 0.0;
6914 372957 : e.SteamTotGain = 0.0;
6915 372957 : e.SteamRadGainRate = 0.0;
6916 372957 : e.SteamConGainRate = 0.0;
6917 372957 : e.SteamLatGainRate = 0.0;
6918 372957 : e.SteamLostRate = 0.0;
6919 372957 : e.SteamTotGainRate = 0.0;
6920 : // Other Equipment
6921 372957 : e.OtherRadGain = 0.0;
6922 372957 : e.OtherConGain = 0.0;
6923 372957 : e.OtherLatGain = 0.0;
6924 372957 : e.OtherLost = 0.0;
6925 372957 : e.OtherTotGain = 0.0;
6926 372957 : e.OtherRadGainRate = 0.0;
6927 372957 : e.OtherConGainRate = 0.0;
6928 372957 : e.OtherLatGainRate = 0.0;
6929 372957 : e.OtherLostRate = 0.0;
6930 372957 : e.OtherTotGainRate = 0.0;
6931 : // Overall Zone Variables
6932 372957 : e.TotRadiantGain = 0.0;
6933 372957 : e.TotVisHeatGain = 0.0;
6934 372957 : e.TotConvectiveGain = 0.0;
6935 372957 : e.TotLatentGain = 0.0;
6936 372957 : e.TotTotalHeatGain = 0.0;
6937 372957 : e.TotRadiantGainRate = 0.0;
6938 372957 : e.TotVisHeatGainRate = 0.0;
6939 372957 : e.TotConvectiveGainRate = 0.0;
6940 372957 : e.TotLatentGainRate = 0.0;
6941 372957 : e.TotTotalHeatGainRate = 0.0;
6942 : // Contaminant
6943 372957 : e.CO2Rate = 0.0;
6944 372957 : e.GCRate = 0.0;
6945 5967312 : for (int i = 0; i < (int)Constant::eFuel::Num; ++i) {
6946 5594355 : e.OtherPower[i] = 0.0;
6947 5594355 : e.OtherConsump[i] = 0.0;
6948 : }
6949 : }
6950 :
6951 586610 : for (auto &e : state.dataHeatBal->ZonePreDefRep) {
6952 336652 : e.NumOcc = 0.0;
6953 : }
6954 :
6955 : // QSA = 0.0
6956 :
6957 : // Process Internal Heat Gains, People done below
6958 : // Occupant Stuff
6959 : // METHOD:
6960 : // The function is based on a curve fit to data presented in
6961 : // Table 48 'Heat Gain From People' of Chapter 1 of the 'Carrier
6962 : // Handbook of Air Conditioning System Design', 1965. Values of
6963 : // Sensible gain were obtained from the table at average adjusted
6964 : // metabolic rates 350, 400, 450, 500, 750, 850, 1000, and
6965 : // 1450 Btu/hr each at temperatures 82, 80, 78, 75, and 70F.
6966 : // Sensible gains of 0.0 at 96F and equal to the metabolic rate
6967 : // at 30F were assumed in order to give reasonable values beyond
6968 : // The reported temperature range.
6969 374551 : for (int Loop = 1; Loop <= state.dataHeatBal->TotPeople; ++Loop) {
6970 124593 : auto &thisPeople = state.dataHeatBal->People(Loop);
6971 124593 : int NZ = state.dataHeatBal->People(Loop).ZonePtr;
6972 124593 : int spaceNum = thisPeople.spaceIndex;
6973 124593 : auto const &thisSpaceHB = state.dataZoneTempPredictorCorrector->spaceHeatBalance(spaceNum);
6974 124593 : NumberOccupants = thisPeople.NumberOfPeople * thisPeople.sched->getCurrentVal();
6975 :
6976 124593 : if (thisPeople.EMSPeopleOn) NumberOccupants = thisPeople.EMSNumberOfPeople;
6977 :
6978 124593 : TotalPeopleGain = 0.0;
6979 124593 : SensiblePeopleGain = 0.0;
6980 :
6981 124593 : auto &thisZoneRep = state.dataHeatBal->ZonePreDefRep(NZ);
6982 124593 : if (NumberOccupants > 0.0) {
6983 93521 : ActivityLevel_WperPerson = thisPeople.activityLevelSched->getCurrentVal();
6984 93521 : TotalPeopleGain = NumberOccupants * ActivityLevel_WperPerson;
6985 : // if the user did not specify a sensible fraction, calculate the sensible heat gain
6986 93521 : if (thisPeople.UserSpecSensFrac == Constant::AutoCalculate) {
6987 93517 : Real64 airTemp = thisSpaceHB.MAT;
6988 93517 : if (state.dataRoomAir->anyNonMixingRoomAirModel) {
6989 0 : if (state.dataRoomAir->IsZoneDispVent3Node(NZ) || state.dataRoomAir->IsZoneUFAD(NZ)) {
6990 0 : airTemp = state.dataRoomAir->TCMF(NZ);
6991 : }
6992 : }
6993 93517 : SensiblePeopleGain =
6994 93517 : NumberOccupants * (C[0] + ActivityLevel_WperPerson * (C[1] + ActivityLevel_WperPerson * C[2]) +
6995 93517 : airTemp * ((C[3] + ActivityLevel_WperPerson * (C[4] + ActivityLevel_WperPerson * C[5])) +
6996 93517 : airTemp * (C[6] + ActivityLevel_WperPerson * (C[7] + ActivityLevel_WperPerson * C[8]))));
6997 : } else { // if the user did specify a sensible fraction, use it
6998 4 : SensiblePeopleGain = TotalPeopleGain * thisPeople.UserSpecSensFrac;
6999 : }
7000 :
7001 93521 : if (SensiblePeopleGain > TotalPeopleGain) SensiblePeopleGain = TotalPeopleGain;
7002 93521 : if (SensiblePeopleGain < 0.0) SensiblePeopleGain = 0.0;
7003 :
7004 : // For predefined tabular reports related to outside air ventilation
7005 93521 : thisZoneRep.isOccupied = true; // set flag to occupied to be used in tabular reporting for ventilation
7006 93521 : thisZoneRep.NumOcc += NumberOccupants;
7007 93521 : thisZoneRep.NumOccAccum += NumberOccupants * state.dataGlobal->TimeStepZone;
7008 93521 : thisZoneRep.NumOccAccumTime += state.dataGlobal->TimeStepZone;
7009 : } else {
7010 31072 : state.dataHeatBal->ZonePreDefRep(NZ).isOccupied = false; // set flag to occupied to be used in tabular reporting for ventilation
7011 : }
7012 :
7013 124593 : thisPeople.NumOcc = NumberOccupants;
7014 124593 : thisPeople.RadGainRate = SensiblePeopleGain * thisPeople.FractionRadiant;
7015 124593 : thisPeople.ConGainRate = SensiblePeopleGain * thisPeople.FractionConvected;
7016 124593 : thisPeople.SenGainRate = SensiblePeopleGain;
7017 124593 : thisPeople.LatGainRate = TotalPeopleGain - SensiblePeopleGain;
7018 124593 : thisPeople.TotGainRate = TotalPeopleGain;
7019 124593 : thisPeople.CO2GainRate = TotalPeopleGain * thisPeople.CO2RateFactor;
7020 :
7021 124593 : auto &thisSpaceIntGain = state.dataHeatBal->spaceIntGain(spaceNum);
7022 124593 : thisSpaceIntGain.NOFOCC += thisPeople.NumOcc;
7023 124593 : auto &thisSpaceRpt = state.dataHeatBal->spaceRpt(spaceNum);
7024 124593 : thisSpaceRpt.PeopleRadGainRate += thisPeople.RadGainRate;
7025 124593 : thisSpaceRpt.PeopleConGainRate += thisPeople.ConGainRate;
7026 124593 : thisSpaceRpt.PeopleSenGainRate += thisPeople.SenGainRate;
7027 124593 : thisSpaceRpt.PeopleLatGainRate += thisPeople.LatGainRate;
7028 124593 : thisSpaceRpt.PeopleTotGainRate += thisPeople.TotGainRate;
7029 : }
7030 :
7031 379270 : for (int Loop = 1; Loop <= state.dataHeatBal->TotLights; ++Loop) {
7032 129312 : auto &thisLights = state.dataHeatBal->Lights(Loop);
7033 129312 : int NZ = thisLights.ZonePtr;
7034 129312 : int spaceNum = thisLights.spaceIndex;
7035 129312 : Q = thisLights.DesignLevel * thisLights.sched->getCurrentVal();
7036 :
7037 129312 : if (state.dataDayltg->ZoneDaylight(NZ).totRefPts > 0) {
7038 676 : if (thisLights.FractionReplaceable > 0.0) { // FractionReplaceable can only be 0 or 1 for these models
7039 676 : Q *= state.dataDayltg->spacePowerReductionFactor(spaceNum);
7040 : }
7041 : }
7042 :
7043 : // Reduce lighting power due to demand limiting
7044 129312 : if (thisLights.ManageDemand && (Q > thisLights.DemandLimit)) Q = thisLights.DemandLimit;
7045 :
7046 : // Set Q to EMS override if being called for by EMs
7047 129312 : if (thisLights.EMSLightsOn) Q = thisLights.EMSLightingPower;
7048 :
7049 129312 : FractionConvected = thisLights.FractionConvected;
7050 129312 : FractionReturnAir = thisLights.FractionReturnAir;
7051 129312 : FractionRadiant = thisLights.FractionRadiant;
7052 129312 : if (thisLights.FractionReturnAirIsCalculated && !state.dataGlobal->ZoneSizingCalc && state.dataGlobal->SimTimeSteps > 1) {
7053 : // Calculate FractionReturnAir based on conditions in the zone's return air plenum, if there is one.
7054 0 : if (state.dataHeatBal->Zone(NZ).IsControlled) {
7055 0 : int retNum = thisLights.ZoneReturnNum;
7056 0 : int ReturnZonePlenumCondNum = state.dataZoneEquip->ZoneEquipConfig(NZ).ReturnNodePlenumNum(retNum);
7057 0 : if (ReturnZonePlenumCondNum > 0) {
7058 0 : ReturnPlenumTemp = state.dataZonePlenum->ZoneRetPlenCond(ReturnZonePlenumCondNum).ZoneTemp;
7059 0 : FractionReturnAir =
7060 0 : thisLights.FractionReturnAirPlenTempCoeff1 - thisLights.FractionReturnAirPlenTempCoeff2 * ReturnPlenumTemp;
7061 0 : FractionReturnAir = max(0.0, min(1.0, FractionReturnAir));
7062 0 : if (FractionReturnAir >= (1.0 - thisLights.FractionShortWave)) {
7063 0 : FractionReturnAir = 1.0 - thisLights.FractionShortWave;
7064 0 : FractionRadiant = 0.0;
7065 0 : FractionConvected = 0.0;
7066 : } else {
7067 0 : FractionRadiant = ((1.0 - FractionReturnAir - thisLights.FractionShortWave) /
7068 0 : (thisLights.FractionRadiant + thisLights.FractionConvected)) *
7069 0 : thisLights.FractionRadiant;
7070 0 : FractionConvected = 1.0 - (FractionReturnAir + FractionRadiant + thisLights.FractionShortWave);
7071 : }
7072 : }
7073 : }
7074 : }
7075 :
7076 129312 : thisLights.Power = Q;
7077 129312 : thisLights.RadGainRate = Q * FractionRadiant;
7078 129312 : thisLights.VisGainRate = Q * thisLights.FractionShortWave;
7079 129312 : thisLights.ConGainRate = Q * FractionConvected;
7080 129312 : thisLights.RetAirGainRate = Q * FractionReturnAir;
7081 129312 : thisLights.TotGainRate = Q;
7082 :
7083 129312 : auto &thisSpaceRpt = state.dataHeatBal->spaceRpt(spaceNum);
7084 129312 : thisSpaceRpt.LtsPower += thisLights.Power;
7085 129312 : thisSpaceRpt.LtsRadGainRate += thisLights.RadGainRate;
7086 129312 : thisSpaceRpt.LtsVisGainRate += thisLights.VisGainRate;
7087 129312 : state.dataHeatBal->spaceIntGain(spaceNum).QLTSW += thisLights.VisGainRate;
7088 129312 : thisSpaceRpt.LtsConGainRate += thisLights.ConGainRate;
7089 129312 : thisSpaceRpt.LtsRetAirGainRate += thisLights.RetAirGainRate;
7090 129312 : thisSpaceRpt.LtsTotGainRate += thisLights.TotGainRate;
7091 : }
7092 :
7093 435378 : for (int Loop = 1; Loop <= state.dataHeatBal->TotElecEquip; ++Loop) {
7094 185420 : auto &thisElecEq = state.dataHeatBal->ZoneElectric(Loop);
7095 185420 : Q = thisElecEq.DesignLevel * thisElecEq.sched->getCurrentVal();
7096 :
7097 : // Reduce equipment power due to demand limiting
7098 185420 : if (thisElecEq.ManageDemand && (Q > thisElecEq.DemandLimit)) Q = thisElecEq.DemandLimit;
7099 :
7100 : // Set Q to EMS override if being called for by EMs
7101 185420 : if (thisElecEq.EMSZoneEquipOverrideOn) Q = thisElecEq.EMSEquipPower;
7102 :
7103 185420 : thisElecEq.Power = Q;
7104 185420 : thisElecEq.RadGainRate = Q * thisElecEq.FractionRadiant;
7105 185420 : thisElecEq.ConGainRate = Q * thisElecEq.FractionConvected;
7106 185420 : thisElecEq.LatGainRate = Q * thisElecEq.FractionLatent;
7107 185420 : thisElecEq.LostRate = Q * thisElecEq.FractionLost;
7108 185420 : thisElecEq.TotGainRate = Q - thisElecEq.LostRate;
7109 :
7110 185420 : auto &thisSpaceRpt = state.dataHeatBal->spaceRpt(thisElecEq.spaceIndex);
7111 185420 : thisSpaceRpt.ElecPower += thisElecEq.Power;
7112 185420 : thisSpaceRpt.ElecRadGainRate += thisElecEq.RadGainRate;
7113 185420 : thisSpaceRpt.ElecConGainRate += thisElecEq.ConGainRate;
7114 185420 : thisSpaceRpt.ElecLatGainRate += thisElecEq.LatGainRate;
7115 185420 : thisSpaceRpt.ElecLostRate += thisElecEq.LostRate;
7116 : }
7117 :
7118 249962 : for (int Loop = 1; Loop <= state.dataHeatBal->TotGasEquip; ++Loop) {
7119 4 : auto &thisGasEq = state.dataHeatBal->ZoneGas(Loop);
7120 4 : Q = thisGasEq.DesignLevel * thisGasEq.sched->getCurrentVal();
7121 :
7122 : // Set Q to EMS override if being called for by EMs
7123 4 : if (thisGasEq.EMSZoneEquipOverrideOn) Q = thisGasEq.EMSEquipPower;
7124 :
7125 4 : thisGasEq.Power = Q;
7126 4 : thisGasEq.RadGainRate = Q * thisGasEq.FractionRadiant;
7127 4 : thisGasEq.ConGainRate = Q * thisGasEq.FractionConvected;
7128 4 : thisGasEq.LatGainRate = Q * thisGasEq.FractionLatent;
7129 4 : thisGasEq.LostRate = Q * thisGasEq.FractionLost;
7130 4 : thisGasEq.TotGainRate = Q - thisGasEq.LostRate;
7131 4 : thisGasEq.CO2GainRate = Q * thisGasEq.CO2RateFactor;
7132 :
7133 4 : auto &thisSpaceRpt = state.dataHeatBal->spaceRpt(thisGasEq.spaceIndex);
7134 4 : thisSpaceRpt.GasPower += thisGasEq.Power;
7135 4 : thisSpaceRpt.GasRadGainRate += thisGasEq.RadGainRate;
7136 4 : thisSpaceRpt.GasConGainRate += thisGasEq.ConGainRate;
7137 4 : thisSpaceRpt.GasLatGainRate += thisGasEq.LatGainRate;
7138 4 : thisSpaceRpt.GasLostRate += thisGasEq.LostRate;
7139 : }
7140 :
7141 493040 : for (int Loop = 1; Loop <= state.dataHeatBal->TotOthEquip; ++Loop) {
7142 243082 : auto &thisOtherEq = state.dataHeatBal->ZoneOtherEq(Loop);
7143 243082 : Q = thisOtherEq.DesignLevel * thisOtherEq.sched->getCurrentVal();
7144 :
7145 : // Set Q to EMS override if being called for by EMs
7146 243082 : if (thisOtherEq.EMSZoneEquipOverrideOn) Q = thisOtherEq.EMSEquipPower;
7147 :
7148 243082 : thisOtherEq.Power = Q;
7149 243082 : thisOtherEq.RadGainRate = Q * thisOtherEq.FractionRadiant;
7150 243082 : thisOtherEq.ConGainRate = Q * thisOtherEq.FractionConvected;
7151 243082 : thisOtherEq.LatGainRate = Q * thisOtherEq.FractionLatent;
7152 243082 : thisOtherEq.LostRate = Q * thisOtherEq.FractionLost;
7153 243082 : thisOtherEq.TotGainRate = Q - thisOtherEq.LostRate;
7154 :
7155 243082 : int fuelType = (int)thisOtherEq.OtherEquipFuelType;
7156 243082 : auto &thisSpaceRpt = state.dataHeatBal->spaceRpt(thisOtherEq.spaceIndex);
7157 243082 : thisSpaceRpt.OtherPower[fuelType] += thisOtherEq.Power;
7158 243082 : thisSpaceRpt.OtherTotGainRate += thisOtherEq.TotGainRate;
7159 243082 : thisSpaceRpt.OtherRadGainRate += thisOtherEq.RadGainRate;
7160 243082 : thisSpaceRpt.OtherConGainRate += thisOtherEq.ConGainRate;
7161 243082 : thisSpaceRpt.OtherLatGainRate += thisOtherEq.LatGainRate;
7162 243082 : thisSpaceRpt.OtherLostRate += thisOtherEq.LostRate;
7163 : }
7164 :
7165 249962 : for (int Loop = 1; Loop <= state.dataHeatBal->TotHWEquip; ++Loop) {
7166 4 : auto &thisHWEq = state.dataHeatBal->ZoneHWEq(Loop);
7167 4 : Q = thisHWEq.DesignLevel * thisHWEq.sched->getCurrentVal();
7168 :
7169 : // Set Q to EMS override if being called for by EMs
7170 4 : if (thisHWEq.EMSZoneEquipOverrideOn) Q = thisHWEq.EMSEquipPower;
7171 :
7172 4 : thisHWEq.Power = Q;
7173 4 : thisHWEq.RadGainRate = Q * thisHWEq.FractionRadiant;
7174 4 : thisHWEq.ConGainRate = Q * thisHWEq.FractionConvected;
7175 4 : thisHWEq.LatGainRate = Q * thisHWEq.FractionLatent;
7176 4 : thisHWEq.LostRate = Q * thisHWEq.FractionLost;
7177 4 : thisHWEq.TotGainRate = Q - thisHWEq.LostRate;
7178 :
7179 4 : auto &thisSpaceRpt = state.dataHeatBal->spaceRpt(thisHWEq.spaceIndex);
7180 4 : thisSpaceRpt.HWPower += thisHWEq.Power;
7181 4 : thisSpaceRpt.HWRadGainRate += thisHWEq.RadGainRate;
7182 4 : thisSpaceRpt.HWConGainRate += thisHWEq.ConGainRate;
7183 4 : thisSpaceRpt.HWLatGainRate += thisHWEq.LatGainRate;
7184 4 : thisSpaceRpt.HWLostRate += thisHWEq.LostRate;
7185 : }
7186 :
7187 249962 : for (int Loop = 1; Loop <= state.dataHeatBal->TotStmEquip; ++Loop) {
7188 4 : auto &thisSteamEq = state.dataHeatBal->ZoneSteamEq(Loop);
7189 4 : Q = thisSteamEq.DesignLevel * thisSteamEq.sched->getCurrentVal();
7190 :
7191 : // Set Q to EMS override if being called for by EMs
7192 4 : if (thisSteamEq.EMSZoneEquipOverrideOn) Q = thisSteamEq.EMSEquipPower;
7193 :
7194 4 : thisSteamEq.Power = Q;
7195 4 : thisSteamEq.RadGainRate = Q * thisSteamEq.FractionRadiant;
7196 4 : thisSteamEq.ConGainRate = Q * thisSteamEq.FractionConvected;
7197 4 : thisSteamEq.LatGainRate = Q * thisSteamEq.FractionLatent;
7198 4 : thisSteamEq.LostRate = Q * thisSteamEq.FractionLost;
7199 4 : thisSteamEq.TotGainRate = Q - thisSteamEq.LostRate;
7200 :
7201 4 : auto &thisSpaceRpt = state.dataHeatBal->spaceRpt(thisSteamEq.spaceIndex);
7202 4 : thisSpaceRpt.SteamPower += thisSteamEq.Power;
7203 4 : thisSpaceRpt.SteamRadGainRate += thisSteamEq.RadGainRate;
7204 4 : thisSpaceRpt.SteamConGainRate += thisSteamEq.ConGainRate;
7205 4 : thisSpaceRpt.SteamLatGainRate += thisSteamEq.LatGainRate;
7206 4 : thisSpaceRpt.SteamLostRate += thisSteamEq.LostRate;
7207 : }
7208 :
7209 249962 : for (int Loop = 1; Loop <= state.dataHeatBal->TotBBHeat; ++Loop) {
7210 4 : auto &thisBBHeat = state.dataHeatBal->ZoneBBHeat(Loop);
7211 4 : int NZ = thisBBHeat.ZonePtr;
7212 4 : if (state.dataHeatBal->Zone(NZ).OutDryBulbTemp >= thisBBHeat.HighTemperature) {
7213 0 : Q = 0.0;
7214 4 : } else if (state.dataHeatBal->Zone(NZ).OutDryBulbTemp > thisBBHeat.LowTemperature) {
7215 0 : Q = (state.dataHeatBal->Zone(NZ).OutDryBulbTemp - thisBBHeat.LowTemperature) *
7216 0 : (thisBBHeat.CapatHighTemperature - thisBBHeat.CapatLowTemperature) /
7217 0 : (thisBBHeat.HighTemperature - thisBBHeat.LowTemperature) +
7218 0 : thisBBHeat.CapatLowTemperature;
7219 : } else {
7220 4 : Q = thisBBHeat.CapatLowTemperature;
7221 : }
7222 4 : Q *= thisBBHeat.sched->getCurrentVal();
7223 :
7224 : // set with EMS value if being called for.
7225 4 : if (thisBBHeat.EMSZoneBaseboardOverrideOn) Q = thisBBHeat.EMSZoneBaseboardPower;
7226 :
7227 4 : thisBBHeat.Power = Q;
7228 4 : thisBBHeat.RadGainRate = Q * thisBBHeat.FractionRadiant;
7229 4 : thisBBHeat.ConGainRate = Q * thisBBHeat.FractionConvected;
7230 4 : thisBBHeat.TotGainRate = Q;
7231 :
7232 4 : auto &thisSpaceRpt = state.dataHeatBal->spaceRpt(thisBBHeat.spaceIndex);
7233 4 : thisSpaceRpt.BaseHeatPower += thisBBHeat.Power;
7234 4 : thisSpaceRpt.BaseHeatRadGainRate += thisBBHeat.RadGainRate;
7235 4 : thisSpaceRpt.BaseHeatConGainRate += thisBBHeat.ConGainRate;
7236 : }
7237 :
7238 249960 : for (int Loop = 1; Loop <= state.dataHeatBal->TotCO2Gen; ++Loop) {
7239 2 : int NZ = state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr;
7240 2 : state.dataHeatBal->ZoneCO2Gen(Loop).CO2GainRate =
7241 2 : state.dataHeatBal->ZoneCO2Gen(Loop).CO2DesignRate * state.dataHeatBal->ZoneCO2Gen(Loop).sched->getCurrentVal();
7242 2 : state.dataHeatBal->ZoneRpt(NZ).CO2Rate += state.dataHeatBal->ZoneCO2Gen(Loop).CO2GainRate;
7243 : }
7244 :
7245 249958 : if (state.dataHeatBal->TotITEquip > 0) CalcZoneITEq(state);
7246 :
7247 249958 : CalcWaterThermalTankZoneGains(state);
7248 249958 : PipeHeatTransfer::PipeHTData::CalcZonePipesHeatGain(state);
7249 249958 : CalcWaterUseZoneGains(state);
7250 249958 : FigureFuelCellZoneGains(state);
7251 249958 : FigureMicroCHPZoneGains(state);
7252 249958 : initializeElectricPowerServiceZoneGains(state);
7253 249958 : FigureTDDZoneGains(state);
7254 249958 : FigureRefrigerationZoneGains(state);
7255 :
7256 : // store pointer values to hold generic internal gain values constant for entire timestep
7257 249958 : UpdateInternalGainValues(state);
7258 :
7259 586610 : for (int NZ = 1; NZ <= state.dataGlobal->NumOfZones; ++NZ) {
7260 336652 : InternalHeatGains::SumAllInternalLatentGains(state, NZ); // Sets zone and space latent gains
7261 : // Added for hybrid model
7262 336652 : if (state.dataHybridModel->FlagHybridModel_PC) {
7263 0 : InternalHeatGains::SumAllInternalLatentGainsExceptPeople(state, NZ); // Also sets space gains
7264 : }
7265 : }
7266 :
7267 : // QL is per radiant enclosure (one or more spaces if grouped by air boundaries)
7268 605532 : for (int enclosureNum = 1; enclosureNum <= state.dataViewFactor->NumOfRadiantEnclosures; ++enclosureNum) {
7269 355574 : auto &thisEnclosure(state.dataViewFactor->EnclRadInfo(enclosureNum));
7270 355574 : thisEnclosure.radQThermalRad = 0.0;
7271 728527 : for (int const spaceNum : thisEnclosure.spaceNums) {
7272 372953 : Real64 spaceQL = SumAllSpaceInternalRadiationGains(state, spaceNum);
7273 372953 : thisEnclosure.radQThermalRad += spaceQL;
7274 : }
7275 : }
7276 :
7277 249958 : pulseMultipler = 0.01; // the W/sqft pulse for the zone
7278 249958 : if (state.dataGlobal->CompLoadReportIsReq) {
7279 19260 : AllocateLoadComponentArrays(state);
7280 : }
7281 586610 : for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) { // Loop through all surfaces...
7282 709609 : for (int spaceNum : state.dataHeatBal->Zone(zoneNum).spaceIndexes) {
7283 372957 : auto const &thisSpace = state.dataHeatBal->space(spaceNum);
7284 372957 : int const firstSurf = thisSpace.HTSurfaceFirst;
7285 372957 : int const lastSurf = thisSpace.HTSurfaceLast;
7286 372957 : if (firstSurf <= 0) continue;
7287 2447269 : for (int SurfNum = firstSurf; SurfNum <= lastSurf; ++SurfNum) {
7288 2074316 : auto const &thisEnclosure = state.dataViewFactor->EnclRadInfo(state.dataSurface->Surface(SurfNum).RadEnclIndex);
7289 :
7290 2074316 : if (!state.dataGlobal->doLoadComponentPulseNow) {
7291 2074198 : state.dataHeatBal->SurfQdotRadIntGainsInPerArea(SurfNum) =
7292 2074198 : thisEnclosure.radQThermalRad * thisEnclosure.radThermAbsMult * state.dataHeatBalSurf->SurfAbsThermalInt(SurfNum);
7293 : } else {
7294 : // radiant value prior to adjustment for pulse for load component report
7295 118 : Real64 const curQL = thisEnclosure.radQThermalRad;
7296 : // for the loads component report during the special sizing run increase the radiant portion
7297 : // a small amount to create a "pulse" of heat that is used for the delayed loads
7298 : // radiant value including adjustment for pulse for load component report
7299 118 : Real64 const adjQL = curQL + thisEnclosure.FloorArea * pulseMultipler;
7300 : // ITABSF is the Inside Thermal Absorptance
7301 : // EnclRadThermAbsMult is a multiplier for each zone
7302 : // SurfQdotRadIntGainsInPerArea is the thermal radiation absorbed on inside surfaces
7303 118 : state.dataHeatBal->SurfQdotRadIntGainsInPerArea(SurfNum) =
7304 118 : adjQL * thisEnclosure.radThermAbsMult * state.dataHeatBalSurf->SurfAbsThermalInt(SurfNum);
7305 : // store the magnitude and time of the pulse
7306 118 : state.dataOutRptTab->radiantPulseTimestep(state.dataSize->CurOverallSimDay, zoneNum) =
7307 118 : (state.dataGlobal->HourOfDay - 1) * state.dataGlobal->TimeStepsInHour + state.dataGlobal->TimeStep;
7308 118 : state.dataOutRptTab->radiantPulseReceived(state.dataSize->CurOverallSimDay, SurfNum) =
7309 118 : (adjQL - curQL) * thisEnclosure.radThermAbsMult * state.dataHeatBalSurf->SurfAbsThermalInt(SurfNum) *
7310 118 : state.dataSurface->Surface(SurfNum).Area;
7311 : }
7312 : }
7313 : }
7314 : }
7315 249958 : }
7316 :
7317 249956 : void CheckReturnAirHeatGain(EnergyPlusData &state)
7318 : {
7319 : // SUBROUTINE INFORMATION:
7320 : // AUTHOR Xuan Luo
7321 : // DATE WRITTEN Jan 2018
7322 :
7323 : // PURPOSE OF THIS SUBROUTINE:
7324 : // This subroutine currently creates the values for standard "zone loads" reporting
7325 : // from the heat balance module.
7326 586606 : for (auto const &zone : state.dataHeatBal->Zone) {
7327 336650 : if (zone.HasAdjustedReturnTempByITE && zone.HasLtsRetAirGain) {
7328 0 : ShowFatalError(state,
7329 : "Return air heat gains from lights are not allowed when Air Flow Calculation Method = "
7330 : "FlowControlWithApproachTemperatures in zones with ITE objects.");
7331 : }
7332 336650 : if (zone.HasAdjustedReturnTempByITE && zone.HasAirFlowWindowReturn) {
7333 0 : ShowFatalError(state,
7334 : "Return air heat gains from windows are not allowed when Air Flow Calculation Method = "
7335 : "FlowControlWithApproachTemperatures in zones with ITE objects.");
7336 : }
7337 : }
7338 249956 : }
7339 :
7340 10 : void CalcZoneITEq(EnergyPlusData &state)
7341 : {
7342 :
7343 : // SUBROUTINE INFORMATION:
7344 : // AUTHOR M.J. Witte
7345 : // DATE WRITTEN October 2014
7346 :
7347 : // PURPOSE OF THIS SUBROUTINE:
7348 : // This subroutine calculates the gains and other results for ElectricEquipment:ITE:AirCooled.
7349 : // This broken into a separate subroutine, because the calculations are more detailed than the other
7350 : // types of internal gains.
7351 :
7352 : using namespace Psychrometrics;
7353 : using Curve::CurveValue;
7354 : using HVAC::SmallAirVolFlow;
7355 : using HVAC::SmallTempDiff;
7356 :
7357 : // Operating Limits for environmental class: None, A1, A2, A3, A4, B, C, H1
7358 : // From ASHRAE 2021 Thermal Guidelines environmental classes for Air-Cooled ITE
7359 : static constexpr std::array<Real64, static_cast<int>(ITEClass::Num)> DBMin = {
7360 : -99.0, 15.0, 10.0, 5.0, 5.0, 5.0, 5.0, 5.0}; // Minimum dry-bulb temperature [C]
7361 : static constexpr std::array<Real64, static_cast<int>(ITEClass::Num)> DBMax = {
7362 : 99.0, 32.0, 35.0, 40.0, 45.0, 35.0, 40.0, 25.0}; // Maximum dry-bulb temperature [C]
7363 : static constexpr std::array<Real64, static_cast<int>(ITEClass::Num)> DPMin = {
7364 : -99.0, -12.0, -12.0, -12.0, -12.0, -99.0, -99.0, -12.0}; // Minimum dewpoint temperature [C]
7365 : static constexpr std::array<Real64, static_cast<int>(ITEClass::Num)> DPMax = {
7366 : 99.0, 17.0, 21.0, 24.0, 24.0, 28.0, 28.0, 17.0}; // Maximum dewpoint temperature [C]
7367 : static constexpr std::array<Real64, static_cast<int>(ITEClass::Num)> RHMin = {
7368 : 0.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0}; // Minimum relative humidity [%]
7369 : static constexpr std::array<Real64, static_cast<int>(ITEClass::Num)> RHMax = {
7370 : 99.0, 80.0, 80.0, 85.0, 90.0, 80.0, 80.0, 80.0}; // Maximum relative humidity [%]
7371 :
7372 : static constexpr std::string_view RoutineName("CalcZoneITEq");
7373 : Real64 OperSchedFrac; // Operating schedule fraction
7374 : Real64 CPULoadSchedFrac; // CPU loading schedule fraction
7375 : ITEInletConnection AirConnection; // Air connection type
7376 10 : Real64 TSupply(0.0); // Supply air temperature [C]
7377 : Real64 WSupply; // Supply air humidity ratio [kgWater/kgDryAir]
7378 : Real64 RecircFrac; // Recirculation fraction - current
7379 : Real64 TRecirc; // Recirculation air temperature [C]
7380 : Real64 WRecirc; // Recirculation air humidity ratio [kgWater/kgDryAir]
7381 : Real64 TAirIn; // Entering air dry-bulb temperature [C]
7382 : Real64 TAirInDesign; // Design entering air dry-bulb temperature [C]
7383 : Real64 WAirIn; // Entering air humidity ratio [kgWater/kgDryAir]
7384 : Real64 TDPAirIn; // Entering air dewpoint temperature [C]
7385 : Real64 RHAirIn; // Entering air relative humidity [%]
7386 : Real64 SupplyHeatIndex; // Supply heat index
7387 : Real64 TAirOut; // Leaving air temperature [C]
7388 : Real64 AirVolFlowFrac; // Air volume flow fraction
7389 : Real64 AirVolFlowFracDesignT; // Air volume flow fraction at design entering air temperature
7390 : Real64 AirVolFlowRate; // Air volume flow rate at current density [m3/s]
7391 : Real64 AirMassFlowRate; // Air mass flow rate [kg/s]
7392 : Real64 CPUPower; // CPU power input [W]
7393 : Real64 FanPower; // Fan power input [W]
7394 : Real64 UPSPower; // UPS new power input (losses) [W]
7395 : Real64 UPSPartLoadRatio; // UPS part load ratio (current total power input / design total power input)
7396 : Real64 UPSHeatGain; // UPS convective heat gain to zone [W]
7397 :
7398 10 : std::map<int, std::vector<int>> ZoneITEMap;
7399 :
7400 : // Zero out time step variables
7401 : // Object report variables
7402 20 : for (int Loop = 1; Loop <= state.dataHeatBal->TotITEquip; ++Loop) {
7403 :
7404 80 : for (int i = 0; i < (int)PERptVars::Num; ++i) {
7405 70 : state.dataHeatBal->ZoneITEq(Loop).PowerRpt[i] = 0.0;
7406 70 : state.dataHeatBal->ZoneITEq(Loop).EnergyRpt[i] = 0.0;
7407 : }
7408 :
7409 10 : state.dataHeatBal->ZoneITEq(Loop).AirVolFlowStdDensity = 0.0;
7410 10 : state.dataHeatBal->ZoneITEq(Loop).AirVolFlowCurDensity = 0.0;
7411 10 : state.dataHeatBal->ZoneITEq(Loop).AirMassFlow = 0.0;
7412 10 : state.dataHeatBal->ZoneITEq(Loop).AirInletDryBulbT = 0.0;
7413 10 : state.dataHeatBal->ZoneITEq(Loop).AirInletDewpointT = 0.0;
7414 10 : state.dataHeatBal->ZoneITEq(Loop).AirInletRelHum = 0.0;
7415 10 : state.dataHeatBal->ZoneITEq(Loop).AirOutletDryBulbT = 0.0;
7416 10 : state.dataHeatBal->ZoneITEq(Loop).SHI = 0.0;
7417 10 : state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = 0.0;
7418 10 : state.dataHeatBal->ZoneITEq(Loop).TimeAboveDryBulbT = 0.0;
7419 10 : state.dataHeatBal->ZoneITEq(Loop).TimeBelowDryBulbT = 0.0;
7420 10 : state.dataHeatBal->ZoneITEq(Loop).TimeAboveDewpointT = 0.0;
7421 10 : state.dataHeatBal->ZoneITEq(Loop).TimeBelowDewpointT = 0.0;
7422 10 : state.dataHeatBal->ZoneITEq(Loop).TimeAboveRH = 0.0;
7423 10 : state.dataHeatBal->ZoneITEq(Loop).TimeBelowRH = 0.0;
7424 10 : state.dataHeatBal->ZoneITEq(Loop).DryBulbTAboveDeltaT = 0.0;
7425 10 : state.dataHeatBal->ZoneITEq(Loop).DryBulbTBelowDeltaT = 0.0;
7426 10 : state.dataHeatBal->ZoneITEq(Loop).DewpointTAboveDeltaT = 0.0;
7427 10 : state.dataHeatBal->ZoneITEq(Loop).DewpointTBelowDeltaT = 0.0;
7428 10 : state.dataHeatBal->ZoneITEq(Loop).RHAboveDeltaRH = 0.0;
7429 10 : state.dataHeatBal->ZoneITEq(Loop).RHBelowDeltaRH = 0.0;
7430 : } // ZoneITEq init loop
7431 :
7432 : // Zone total report variables
7433 20 : for (int Loop = 1; Loop <= state.dataGlobal->NumOfZones; ++Loop) {
7434 :
7435 80 : for (int i = 0; i < (int)PERptVars::Num; ++i) {
7436 70 : state.dataHeatBal->ZoneRpt(Loop).PowerRpt[i] = 0.0;
7437 70 : state.dataHeatBal->ZoneRpt(Loop).EnergyRpt[i] = 0.0;
7438 : }
7439 :
7440 10 : state.dataHeatBal->ZoneRpt(Loop).ITEAdjReturnTemp = 0.0;
7441 :
7442 10 : state.dataHeatBal->ZoneRpt(Loop).ITEqAirVolFlowStdDensity = 0.0;
7443 10 : state.dataHeatBal->ZoneRpt(Loop).ITEqAirMassFlow = 0.0;
7444 10 : state.dataHeatBal->ZoneRpt(Loop).ITEqSHI = 0.0;
7445 10 : state.dataHeatBal->ZoneRpt(Loop).ITEqTimeOutOfOperRange = 0.0;
7446 10 : state.dataHeatBal->ZoneRpt(Loop).ITEqTimeAboveDryBulbT = 0.0;
7447 10 : state.dataHeatBal->ZoneRpt(Loop).ITEqTimeBelowDryBulbT = 0.0;
7448 10 : state.dataHeatBal->ZoneRpt(Loop).ITEqTimeAboveDewpointT = 0.0;
7449 10 : state.dataHeatBal->ZoneRpt(Loop).ITEqTimeBelowDewpointT = 0.0;
7450 10 : state.dataHeatBal->ZoneRpt(Loop).ITEqTimeAboveRH = 0.0;
7451 10 : state.dataHeatBal->ZoneRpt(Loop).ITEqTimeBelowRH = 0.0;
7452 :
7453 10 : state.dataHeatBal->ZoneRpt(Loop).SumTinMinusTSup = 0.0;
7454 10 : state.dataHeatBal->ZoneRpt(Loop).SumToutMinusTSup = 0.0;
7455 : } // Zone init loop
7456 :
7457 : // Space total report variables
7458 20 : for (int spaceNum = 1; spaceNum <= state.dataGlobal->numSpaces; ++spaceNum) {
7459 :
7460 80 : for (int i = 0; i < (int)PERptVars::Num; ++i) {
7461 70 : state.dataHeatBal->spaceRpt(spaceNum).PowerRpt[i] = 0.0;
7462 70 : state.dataHeatBal->spaceRpt(spaceNum).EnergyRpt[i] = 0.0;
7463 : }
7464 :
7465 10 : state.dataHeatBal->spaceRpt(spaceNum).ITEAdjReturnTemp = 0.0;
7466 :
7467 10 : state.dataHeatBal->spaceRpt(spaceNum).ITEqAirVolFlowStdDensity = 0.0;
7468 10 : state.dataHeatBal->spaceRpt(spaceNum).ITEqAirMassFlow = 0.0;
7469 10 : state.dataHeatBal->spaceRpt(spaceNum).ITEqSHI = 0.0;
7470 10 : state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeOutOfOperRange = 0.0;
7471 10 : state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeAboveDryBulbT = 0.0;
7472 10 : state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeBelowDryBulbT = 0.0;
7473 10 : state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeAboveDewpointT = 0.0;
7474 10 : state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeBelowDewpointT = 0.0;
7475 10 : state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeAboveRH = 0.0;
7476 10 : state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeBelowRH = 0.0;
7477 :
7478 10 : state.dataHeatBal->spaceRpt(spaceNum).SumTinMinusTSup = 0.0;
7479 10 : state.dataHeatBal->spaceRpt(spaceNum).SumToutMinusTSup = 0.0;
7480 : } // Space init spaceNum
7481 :
7482 20 : for (int Loop = 1; Loop <= state.dataHeatBal->TotITEquip; ++Loop) {
7483 : // Get schedules
7484 10 : int NZ = state.dataHeatBal->ZoneITEq(Loop).ZonePtr;
7485 10 : auto const &thisZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(NZ);
7486 10 : int spaceNum = state.dataHeatBal->ZoneITEq(Loop).spaceIndex;
7487 10 : OperSchedFrac = state.dataHeatBal->ZoneITEq(Loop).operSched->getCurrentVal();
7488 10 : CPULoadSchedFrac = state.dataHeatBal->ZoneITEq(Loop).cpuLoadSched->getCurrentVal();
7489 :
7490 : // Determine inlet air temperature and humidity
7491 10 : AirConnection = state.dataHeatBal->ZoneITEq(Loop).AirConnectionType;
7492 10 : RecircFrac = 0.0;
7493 10 : int SupplyNodeNum = state.dataHeatBal->ZoneITEq(Loop).SupplyAirNodeNum;
7494 10 : if (state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps) {
7495 1 : TSupply = state.dataLoopNodes->Node(SupplyNodeNum).Temp;
7496 1 : WSupply = state.dataLoopNodes->Node(SupplyNodeNum).HumRat;
7497 1 : if (state.dataHeatBal->ZoneITEq(Loop).supplyApproachTempSched != nullptr) {
7498 0 : TAirIn = TSupply + state.dataHeatBal->ZoneITEq(Loop).supplyApproachTempSched->getCurrentVal();
7499 : } else {
7500 1 : TAirIn = TSupply + state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTemp;
7501 : }
7502 1 : WAirIn = state.dataLoopNodes->Node(SupplyNodeNum).HumRat;
7503 : } else {
7504 9 : if (AirConnection == ITEInletConnection::AdjustedSupply) {
7505 4 : TSupply = state.dataLoopNodes->Node(SupplyNodeNum).Temp;
7506 4 : WSupply = state.dataLoopNodes->Node(SupplyNodeNum).HumRat;
7507 4 : if (state.dataHeatBal->ZoneITEq(Loop).RecircFLTCurve != 0) {
7508 3 : RecircFrac = state.dataHeatBal->ZoneITEq(Loop).DesignRecircFrac *
7509 3 : CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).RecircFLTCurve, CPULoadSchedFrac, TSupply);
7510 : } else {
7511 1 : RecircFrac = state.dataHeatBal->ZoneITEq(Loop).DesignRecircFrac;
7512 : }
7513 4 : TRecirc = thisZoneHB.MAT;
7514 4 : WRecirc = thisZoneHB.airHumRat;
7515 4 : TAirIn = TRecirc * RecircFrac + TSupply * (1.0 - RecircFrac);
7516 4 : WAirIn = WRecirc * RecircFrac + WSupply * (1.0 - RecircFrac);
7517 5 : } else if (AirConnection == ITEInletConnection::RoomAirModel) {
7518 : // Room air model option: TAirIn=TAirZone, according to EngineeringRef 17.1.4
7519 0 : TAirIn = thisZoneHB.MAT;
7520 0 : TSupply = TAirIn;
7521 0 : WAirIn = thisZoneHB.airHumRat;
7522 : } else {
7523 : // TAirIn = TRoomAirNodeIn, according to EngineeringRef 17.1.4
7524 5 : if (state.dataHeatBal->ZoneITEq(Loop).inControlledZone) {
7525 0 : int ZoneAirInletNode = state.dataZoneEquip->ZoneEquipConfig(NZ).InletNode(1);
7526 0 : TSupply = state.dataLoopNodes->Node(ZoneAirInletNode).Temp;
7527 : } else {
7528 5 : TSupply = thisZoneHB.MAT;
7529 : }
7530 5 : TAirIn = thisZoneHB.MAT;
7531 5 : WAirIn = thisZoneHB.airHumRat;
7532 : }
7533 : }
7534 10 : TDPAirIn = PsyTdpFnWPb(state, WAirIn, state.dataEnvrn->StdBaroPress, RoutineName);
7535 10 : RHAirIn = 100.0 * PsyRhFnTdbWPb(state, TAirIn, WAirIn, state.dataEnvrn->StdBaroPress, RoutineName); // RHAirIn is %
7536 :
7537 : // Calculate power input and airflow
7538 10 : TAirInDesign = state.dataHeatBal->ZoneITEq(Loop).DesignTAirIn;
7539 :
7540 10 : if (state.dataGlobal->DoingSizing && state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps) {
7541 :
7542 0 : TAirInDesign = state.dataHeatBal->ZoneITEq(Loop).SizingTAirIn;
7543 0 : if (state.dataHeatBal->ZoneITEq(Loop).supplyApproachTempSched != nullptr) {
7544 0 : TAirInDesign = TAirInDesign + state.dataHeatBal->ZoneITEq(Loop).supplyApproachTempSched->getCurrentVal();
7545 : } else {
7546 0 : TAirInDesign = TAirInDesign + state.dataHeatBal->ZoneITEq(Loop).SupplyApproachTemp;
7547 : }
7548 0 : OperSchedFrac = state.dataHeatBal->ZoneITEq(Loop).operSched->getCurrentVal();
7549 0 : CPULoadSchedFrac = state.dataHeatBal->ZoneITEq(Loop).cpuLoadSched->getCurrentVal();
7550 : }
7551 :
7552 10 : CPUPower = max(state.dataHeatBal->ZoneITEq(Loop).DesignCPUPower * OperSchedFrac *
7553 10 : CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).CPUPowerFLTCurve, CPULoadSchedFrac, TAirIn),
7554 : 0.0);
7555 10 : state.dataHeatBal->ZoneITEq(Loop).PowerRpt[(int)PERptVars::CPUAtDesign] =
7556 10 : max(state.dataHeatBal->ZoneITEq(Loop).DesignCPUPower * OperSchedFrac *
7557 10 : CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).CPUPowerFLTCurve, CPULoadSchedFrac, TAirInDesign),
7558 : 0.0);
7559 :
7560 10 : AirVolFlowFrac = max(CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).AirFlowFLTCurve, CPULoadSchedFrac, TAirIn), 0.0);
7561 10 : AirVolFlowRate = state.dataHeatBal->ZoneITEq(Loop).DesignAirVolFlowRate * OperSchedFrac * AirVolFlowFrac;
7562 10 : if (AirVolFlowRate < SmallAirVolFlow) {
7563 3 : AirVolFlowRate = 0.0;
7564 : }
7565 10 : AirVolFlowFracDesignT = max(CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).AirFlowFLTCurve, CPULoadSchedFrac, TAirInDesign), 0.0);
7566 :
7567 10 : FanPower = max(state.dataHeatBal->ZoneITEq(Loop).DesignFanPower * OperSchedFrac *
7568 10 : CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).FanPowerFFCurve, AirVolFlowFrac),
7569 : 0.0);
7570 10 : state.dataHeatBal->ZoneITEq(Loop).PowerRpt[(int)PERptVars::FanAtDesign] =
7571 10 : max(state.dataHeatBal->ZoneITEq(Loop).DesignFanPower * OperSchedFrac *
7572 10 : CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).FanPowerFFCurve, AirVolFlowFracDesignT),
7573 : 0.0);
7574 :
7575 : // Calculate UPS net power input (power in less power to ITEquip) and UPS heat gain to zone
7576 10 : if (state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower > 0.0) {
7577 10 : UPSPartLoadRatio = (CPUPower + FanPower) / state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower;
7578 : } else {
7579 0 : UPSPartLoadRatio = 0.0;
7580 : }
7581 10 : if (state.dataHeatBal->ZoneITEq(Loop).UPSEfficFPLRCurve != 0) {
7582 4 : UPSPower =
7583 4 : (CPUPower + FanPower) * max((1.0 - state.dataHeatBal->ZoneITEq(Loop).DesignUPSEfficiency *
7584 4 : CurveValue(state, state.dataHeatBal->ZoneITEq(Loop).UPSEfficFPLRCurve, UPSPartLoadRatio)),
7585 : 0.0);
7586 : } else {
7587 6 : UPSPower = (CPUPower + FanPower) * max((1.0 - state.dataHeatBal->ZoneITEq(Loop).DesignUPSEfficiency), 0.0);
7588 : }
7589 10 : UPSHeatGain = UPSPower * state.dataHeatBal->ZoneITEq(Loop).UPSLossToZoneFrac;
7590 :
7591 : // Calculate air outlet conditions and convective heat gain to zone
7592 :
7593 10 : AirMassFlowRate = AirVolFlowRate * PsyRhoAirFnPbTdbW(state, state.dataEnvrn->StdBaroPress, TAirIn, WAirIn, RoutineName);
7594 10 : if (AirMassFlowRate > 0.0) {
7595 7 : TAirOut = TAirIn + (CPUPower + FanPower) / AirMassFlowRate / PsyCpAirFnW(WAirIn);
7596 : } else {
7597 3 : TAirOut = TAirIn;
7598 : }
7599 :
7600 10 : if (std::abs(TAirOut - TSupply) < SmallTempDiff) {
7601 0 : TAirOut = TSupply;
7602 : }
7603 :
7604 10 : if ((SupplyNodeNum != 0) && (TAirOut != TSupply)) {
7605 5 : SupplyHeatIndex = (TAirIn - TSupply) / (TAirOut - TSupply);
7606 : } else {
7607 5 : SupplyHeatIndex = 0.0;
7608 : }
7609 :
7610 10 : if (AirConnection == ITEInletConnection::AdjustedSupply || AirConnection == ITEInletConnection::ZoneAirNode) {
7611 : // If not a room air model, then all ITEquip power input is a convective heat gain to the zone heat balance, plus UPS heat gain
7612 10 : state.dataHeatBal->ZoneITEq(Loop).PowerRpt[(int)PERptVars::ConGainToZone] = CPUPower + FanPower + UPSHeatGain;
7613 0 : } else if (AirConnection == ITEInletConnection::RoomAirModel) {
7614 : // Room air model option not implemented yet - set room air model outlet node conditions here
7615 : // If a room air model, then the only convective heat gain to the zone heat balance is the UPS heat gain
7616 0 : state.dataHeatBal->ZoneITEq(Loop).PowerRpt[(int)PERptVars::ConGainToZone] = UPSHeatGain;
7617 : }
7618 10 : if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).HasAdjustedReturnTempByITE) {
7619 1 : ZoneITEMap[state.dataHeatBal->ZoneITEq(Loop).ZonePtr].push_back(Loop);
7620 : }
7621 10 : if (state.dataGlobal->DoingSizing && state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps) {
7622 0 : if (state.dataHeatBal->ZoneITEq(Loop).PowerRpt[(int)PERptVars::FanAtDesign] +
7623 0 : state.dataHeatBal->ZoneITEq(Loop).PowerRpt[(int)PERptVars::CPUAtDesign] >
7624 0 : state.dataHeatBal->ZoneITEq(Loop).DesignTotalPower) {
7625 0 : state.dataHeatBal->ZoneITEq(Loop).PowerRpt[(int)PERptVars::ConGainToZone] =
7626 0 : state.dataHeatBal->ZoneITEq(Loop).PowerRpt[(int)PERptVars::FanAtDesign] +
7627 0 : state.dataHeatBal->ZoneITEq(Loop).PowerRpt[(int)PERptVars::CPUAtDesign];
7628 : }
7629 : }
7630 : // Object report variables
7631 10 : state.dataHeatBal->ZoneITEq(Loop).PowerRpt[(int)PERptVars::CPU] = CPUPower;
7632 10 : state.dataHeatBal->ZoneITEq(Loop).PowerRpt[(int)PERptVars::Fan] = FanPower;
7633 10 : state.dataHeatBal->ZoneITEq(Loop).PowerRpt[(int)PERptVars::UPS] = UPSPower;
7634 : // ZoneITEq( Loop ).CPUPowerAtDesign = set above
7635 : // ZoneITEq( Loop ).FanPowerAtDesign = set above
7636 10 : state.dataHeatBal->ZoneITEq(Loop).PowerRpt[(int)PERptVars::UPSGainToZone] = UPSHeatGain; // UPSGainRateToZone = UPSHeatGain;
7637 : // ZoneITEq( Loop ).ConGainRateToZone = set above
7638 :
7639 80 : for (int i = 0; i < (int)PERptVars::Num; ++i) {
7640 70 : state.dataHeatBal->ZoneRpt(NZ).PowerRpt[i] += state.dataHeatBal->ZoneITEq(Loop).PowerRpt[i];
7641 70 : state.dataHeatBal->spaceRpt(spaceNum).PowerRpt[i] += state.dataHeatBal->ZoneITEq(Loop).PowerRpt[i];
7642 70 : state.dataHeatBal->ZoneITEq(Loop).EnergyRpt[i] = state.dataHeatBal->ZoneITEq(Loop).PowerRpt[i] * state.dataGlobal->TimeStepZoneSec;
7643 70 : state.dataHeatBal->ZoneRpt(NZ).EnergyRpt[i] += state.dataHeatBal->ZoneITEq(Loop).EnergyRpt[i];
7644 70 : state.dataHeatBal->spaceRpt(spaceNum).EnergyRpt[i] += state.dataHeatBal->ZoneITEq(Loop).EnergyRpt[i];
7645 : }
7646 :
7647 10 : state.dataHeatBal->ZoneITEq(Loop).AirVolFlowStdDensity = AirMassFlowRate / state.dataEnvrn->StdRhoAir;
7648 10 : state.dataHeatBal->ZoneITEq(Loop).AirVolFlowCurDensity = AirVolFlowRate;
7649 10 : state.dataHeatBal->ZoneITEq(Loop).AirMassFlow = AirMassFlowRate;
7650 10 : state.dataHeatBal->ZoneITEq(Loop).AirInletDryBulbT = TAirIn;
7651 10 : state.dataHeatBal->ZoneITEq(Loop).AirInletDewpointT = TDPAirIn;
7652 10 : state.dataHeatBal->ZoneITEq(Loop).AirInletRelHum = RHAirIn;
7653 10 : state.dataHeatBal->ZoneITEq(Loop).AirOutletDryBulbT = TAirOut;
7654 10 : state.dataHeatBal->ZoneITEq(Loop).SHI = SupplyHeatIndex;
7655 :
7656 10 : state.dataHeatBal->ZoneRpt(NZ).ITEqAirVolFlowStdDensity += state.dataHeatBal->ZoneITEq(Loop).AirVolFlowStdDensity;
7657 10 : state.dataHeatBal->ZoneRpt(NZ).ITEqAirMassFlow += state.dataHeatBal->ZoneITEq(Loop).AirMassFlow;
7658 10 : state.dataHeatBal->ZoneRpt(NZ).SumTinMinusTSup += (TAirIn - TSupply) * AirVolFlowRate;
7659 10 : state.dataHeatBal->ZoneRpt(NZ).SumToutMinusTSup += (TAirOut - TSupply) * AirVolFlowRate;
7660 :
7661 10 : state.dataHeatBal->spaceRpt(spaceNum).ITEqAirVolFlowStdDensity += state.dataHeatBal->ZoneITEq(Loop).AirVolFlowStdDensity;
7662 10 : state.dataHeatBal->spaceRpt(spaceNum).ITEqAirMassFlow += state.dataHeatBal->ZoneITEq(Loop).AirMassFlow;
7663 10 : state.dataHeatBal->spaceRpt(spaceNum).SumTinMinusTSup += (TAirIn - TSupply) * AirVolFlowRate;
7664 10 : state.dataHeatBal->spaceRpt(spaceNum).SumToutMinusTSup += (TAirOut - TSupply) * AirVolFlowRate;
7665 :
7666 : // Check environmental class operating range limits (defined as parameters in this subroutine)
7667 : // Index for environmental class (None=0, A1=1, A2=2, A3=3, A4=4, B=5, C=6, H1=7)
7668 10 : int EnvClass = static_cast<int>(state.dataHeatBal->ZoneITEq(Loop).Class);
7669 10 : if (EnvClass > 0) {
7670 10 : if (TAirIn > DBMax[EnvClass]) {
7671 5 : state.dataHeatBal->ZoneITEq(Loop).TimeAboveDryBulbT = state.dataGlobal->TimeStepZone;
7672 5 : state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = state.dataGlobal->TimeStepZone;
7673 5 : state.dataHeatBal->ZoneITEq(Loop).DryBulbTAboveDeltaT = TAirIn - DBMax[EnvClass];
7674 5 : state.dataHeatBal->ZoneRpt(NZ).ITEqTimeAboveDryBulbT = state.dataGlobal->TimeStepZone;
7675 5 : state.dataHeatBal->ZoneRpt(NZ).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone;
7676 5 : state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeAboveDryBulbT = state.dataGlobal->TimeStepZone;
7677 5 : state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone;
7678 : }
7679 10 : if (TAirIn < DBMin[EnvClass]) {
7680 3 : state.dataHeatBal->ZoneITEq(Loop).TimeBelowDryBulbT = state.dataGlobal->TimeStepZone;
7681 3 : state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = state.dataGlobal->TimeStepZone;
7682 3 : state.dataHeatBal->ZoneITEq(Loop).DryBulbTBelowDeltaT = TAirIn - DBMin[EnvClass];
7683 3 : state.dataHeatBal->ZoneRpt(NZ).ITEqTimeBelowDryBulbT = state.dataGlobal->TimeStepZone;
7684 3 : state.dataHeatBal->ZoneRpt(NZ).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone;
7685 3 : state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeBelowDryBulbT = state.dataGlobal->TimeStepZone;
7686 3 : state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone;
7687 : }
7688 10 : if (TDPAirIn > DPMax[EnvClass]) {
7689 2 : state.dataHeatBal->ZoneITEq(Loop).TimeAboveDewpointT = state.dataGlobal->TimeStepZone;
7690 2 : state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = state.dataGlobal->TimeStepZone;
7691 2 : state.dataHeatBal->ZoneITEq(Loop).DewpointTAboveDeltaT = TDPAirIn - DPMax[EnvClass];
7692 2 : state.dataHeatBal->ZoneRpt(NZ).ITEqTimeAboveDewpointT = state.dataGlobal->TimeStepZone;
7693 2 : state.dataHeatBal->ZoneRpt(NZ).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone;
7694 2 : state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeAboveDewpointT = state.dataGlobal->TimeStepZone;
7695 2 : state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone;
7696 : }
7697 10 : if (TDPAirIn < DPMin[EnvClass]) {
7698 5 : state.dataHeatBal->ZoneITEq(Loop).TimeBelowDewpointT = state.dataGlobal->TimeStepZone;
7699 5 : state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = state.dataGlobal->TimeStepZone;
7700 5 : state.dataHeatBal->ZoneITEq(Loop).DewpointTBelowDeltaT = TDPAirIn - DPMin[EnvClass];
7701 5 : state.dataHeatBal->ZoneRpt(NZ).ITEqTimeBelowDewpointT = state.dataGlobal->TimeStepZone;
7702 5 : state.dataHeatBal->ZoneRpt(NZ).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone;
7703 5 : state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeBelowDewpointT = state.dataGlobal->TimeStepZone;
7704 5 : state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone;
7705 : }
7706 10 : if (RHAirIn > RHMax[EnvClass]) {
7707 0 : state.dataHeatBal->ZoneITEq(Loop).TimeAboveRH = state.dataGlobal->TimeStepZone;
7708 0 : state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = state.dataGlobal->TimeStepZone;
7709 0 : state.dataHeatBal->ZoneITEq(Loop).RHAboveDeltaRH = RHAirIn - RHMax[EnvClass];
7710 0 : state.dataHeatBal->ZoneRpt(NZ).ITEqTimeAboveRH = state.dataGlobal->TimeStepZone;
7711 0 : state.dataHeatBal->ZoneRpt(NZ).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone;
7712 0 : state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeAboveRH = state.dataGlobal->TimeStepZone;
7713 0 : state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone;
7714 : }
7715 10 : if (RHAirIn < RHMin[EnvClass]) {
7716 2 : state.dataHeatBal->ZoneITEq(Loop).TimeBelowRH = state.dataGlobal->TimeStepZone;
7717 2 : state.dataHeatBal->ZoneITEq(Loop).TimeOutOfOperRange = state.dataGlobal->TimeStepZone;
7718 2 : state.dataHeatBal->ZoneITEq(Loop).RHBelowDeltaRH = RHAirIn - RHMin[EnvClass];
7719 2 : state.dataHeatBal->ZoneRpt(NZ).ITEqTimeBelowRH = state.dataGlobal->TimeStepZone;
7720 2 : state.dataHeatBal->ZoneRpt(NZ).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone;
7721 2 : state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeBelowRH = state.dataGlobal->TimeStepZone;
7722 2 : state.dataHeatBal->spaceRpt(spaceNum).ITEqTimeOutOfOperRange = state.dataGlobal->TimeStepZone;
7723 : }
7724 : }
7725 :
7726 : } // ZoneITEq calc loop
7727 :
7728 : // Zone and space-level sensible heat index
7729 20 : for (int Loop = 1; Loop <= state.dataHeatBal->TotITEquip; ++Loop) {
7730 10 : int ZN = state.dataHeatBal->ZoneITEq(Loop).ZonePtr;
7731 10 : int spaceNum = state.dataHeatBal->ZoneITEq(Loop).spaceIndex;
7732 10 : if (state.dataHeatBal->ZoneRpt(ZN).SumToutMinusTSup != 0.0) {
7733 7 : state.dataHeatBal->ZoneRpt(ZN).ITEqSHI =
7734 7 : state.dataHeatBal->ZoneRpt(ZN).SumTinMinusTSup / state.dataHeatBal->ZoneRpt(ZN).SumToutMinusTSup;
7735 : }
7736 10 : if (state.dataHeatBal->spaceRpt(spaceNum).SumToutMinusTSup != 0.0) {
7737 7 : state.dataHeatBal->spaceRpt(spaceNum).ITEqSHI =
7738 7 : state.dataHeatBal->spaceRpt(spaceNum).SumTinMinusTSup / state.dataHeatBal->spaceRpt(spaceNum).SumToutMinusTSup;
7739 : }
7740 : }
7741 :
7742 10 : std::map<int, std::vector<int>>::iterator it = ZoneITEMap.begin();
7743 : Real64 totalGain;
7744 : Real64 totalRate;
7745 : Real64 TAirReturn;
7746 11 : while (it != ZoneITEMap.end()) {
7747 1 : if (state.dataHeatBal->Zone(it->first).HasAdjustedReturnTempByITE) {
7748 1 : totalGain = 0;
7749 1 : totalRate = 0;
7750 2 : for (int i : it->second) {
7751 1 : if (state.dataHeatBal->ZoneITEq(i).returnApproachTempSched != nullptr) {
7752 0 : TAirReturn = state.dataHeatBal->ZoneITEq(i).AirOutletDryBulbT +
7753 0 : state.dataHeatBal->ZoneITEq(i).returnApproachTempSched->getCurrentVal();
7754 : } else {
7755 1 : TAirReturn = state.dataHeatBal->ZoneITEq(i).AirOutletDryBulbT + state.dataHeatBal->ZoneITEq(i).ReturnApproachTemp;
7756 : }
7757 1 : totalRate += state.dataHeatBal->ZoneITEq(i).AirMassFlow;
7758 1 : totalGain += state.dataHeatBal->ZoneITEq(i).AirMassFlow * TAirReturn;
7759 : }
7760 1 : if (totalRate != 0) {
7761 1 : state.dataHeatBal->Zone(it->first).AdjustedReturnTempByITE = totalGain / totalRate;
7762 1 : state.dataHeatBal->ZoneRpt(it->first).ITEAdjReturnTemp = state.dataHeatBal->Zone(it->first).AdjustedReturnTempByITE;
7763 : }
7764 : }
7765 1 : ++it;
7766 : }
7767 :
7768 10 : } // End CalcZoneITEq
7769 :
7770 249958 : void ReportInternalHeatGains(EnergyPlusData &state)
7771 : {
7772 :
7773 : // SUBROUTINE INFORMATION:
7774 : // AUTHOR Richard Liesen
7775 : // DATE WRITTEN June 1997
7776 : // MODIFIED July 1997 RKS
7777 : // RE-ENGINEERED December 1998 LKL
7778 :
7779 : // PURPOSE OF THIS SUBROUTINE:
7780 : // This subroutine currently creates the values for standard "zone loads" reporting
7781 : // from the heat balance module.
7782 :
7783 : // METHODOLOGY EMPLOYED:
7784 : // The reporting methodology is described in the OutputDataStructure.doc
7785 : // as the "modified modular" format.
7786 :
7787 : // REFERENCES:
7788 : // OutputDataStructure.doc (EnergyPlus documentation)
7789 :
7790 : // SUBROUTINE LOCAL VARIABLE DECLARATIONS:
7791 : static constexpr std::array<DataHeatBalance::IntGainType, 8> TradIntGainTypes = {DataHeatBalance::IntGainType::People,
7792 : DataHeatBalance::IntGainType::Lights,
7793 : DataHeatBalance::IntGainType::ElectricEquipment,
7794 : DataHeatBalance::IntGainType::ElectricEquipmentITEAirCooled,
7795 : DataHeatBalance::IntGainType::GasEquipment,
7796 : DataHeatBalance::IntGainType::HotWaterEquipment,
7797 : DataHeatBalance::IntGainType::SteamEquipment,
7798 : DataHeatBalance::IntGainType::OtherEquipment};
7799 :
7800 374551 : for (int Loop = 1; Loop <= state.dataHeatBal->TotPeople; ++Loop) {
7801 124593 : auto &thisPeople = state.dataHeatBal->People(Loop);
7802 124593 : thisPeople.RadGainEnergy = thisPeople.RadGainRate * state.dataGlobal->TimeStepZoneSec;
7803 124593 : thisPeople.ConGainEnergy = thisPeople.ConGainRate * state.dataGlobal->TimeStepZoneSec;
7804 124593 : thisPeople.SenGainEnergy = thisPeople.SenGainRate * state.dataGlobal->TimeStepZoneSec;
7805 124593 : thisPeople.LatGainEnergy = thisPeople.LatGainRate * state.dataGlobal->TimeStepZoneSec;
7806 124593 : thisPeople.TotGainEnergy = thisPeople.TotGainRate * state.dataGlobal->TimeStepZoneSec;
7807 : }
7808 :
7809 379270 : for (int Loop = 1; Loop <= state.dataHeatBal->TotLights; ++Loop) {
7810 129312 : auto &thisLights = state.dataHeatBal->Lights(Loop);
7811 129312 : thisLights.Consumption = thisLights.Power * state.dataGlobal->TimeStepZoneSec;
7812 129312 : thisLights.RadGainEnergy = thisLights.RadGainRate * state.dataGlobal->TimeStepZoneSec;
7813 129312 : thisLights.VisGainEnergy = thisLights.VisGainRate * state.dataGlobal->TimeStepZoneSec;
7814 129312 : thisLights.ConGainEnergy = thisLights.ConGainRate * state.dataGlobal->TimeStepZoneSec;
7815 129312 : thisLights.RetAirGainEnergy = thisLights.RetAirGainRate * state.dataGlobal->TimeStepZoneSec;
7816 129312 : thisLights.TotGainEnergy = thisLights.TotGainRate * state.dataGlobal->TimeStepZoneSec;
7817 129312 : if (!state.dataGlobal->WarmupFlag) {
7818 21040 : if (state.dataGlobal->DoOutputReporting && state.dataOutRptTab->WriteTabularFiles &&
7819 2531 : (state.dataGlobal->KindOfSim == Constant::KindOfSim::RunPeriodWeather)) { // for weather simulations only
7820 : // for tabular report, accumulate the total electricity used for each Light object
7821 0 : thisLights.SumConsumption += thisLights.Consumption;
7822 : // for tabular report, accumulate the time when each Light has consumption (using a very small threshold instead of zero)
7823 0 : if (thisLights.Power > 0.01 * thisLights.DesignLevel) {
7824 0 : thisLights.SumTimeNotZeroCons += state.dataGlobal->TimeStepZone;
7825 : }
7826 : }
7827 : }
7828 : }
7829 :
7830 435378 : for (int Loop = 1; Loop <= state.dataHeatBal->TotElecEquip; ++Loop) {
7831 185420 : auto &thisElecEquip = state.dataHeatBal->ZoneElectric(Loop);
7832 185420 : thisElecEquip.Consumption = thisElecEquip.Power * state.dataGlobal->TimeStepZoneSec;
7833 185420 : thisElecEquip.RadGainEnergy = thisElecEquip.RadGainRate * state.dataGlobal->TimeStepZoneSec;
7834 185420 : thisElecEquip.ConGainEnergy = thisElecEquip.ConGainRate * state.dataGlobal->TimeStepZoneSec;
7835 185420 : thisElecEquip.LatGainEnergy = thisElecEquip.LatGainRate * state.dataGlobal->TimeStepZoneSec;
7836 185420 : thisElecEquip.LostEnergy = thisElecEquip.LostRate * state.dataGlobal->TimeStepZoneSec;
7837 185420 : thisElecEquip.TotGainEnergy = thisElecEquip.TotGainRate * state.dataGlobal->TimeStepZoneSec;
7838 : }
7839 :
7840 249962 : for (int Loop = 1; Loop <= state.dataHeatBal->TotGasEquip; ++Loop) {
7841 4 : auto &thisGasEquip = state.dataHeatBal->ZoneGas(Loop);
7842 4 : thisGasEquip.Consumption = thisGasEquip.Power * state.dataGlobal->TimeStepZoneSec;
7843 4 : thisGasEquip.RadGainEnergy = thisGasEquip.RadGainRate * state.dataGlobal->TimeStepZoneSec;
7844 4 : thisGasEquip.ConGainEnergy = thisGasEquip.ConGainRate * state.dataGlobal->TimeStepZoneSec;
7845 4 : thisGasEquip.LatGainEnergy = thisGasEquip.LatGainRate * state.dataGlobal->TimeStepZoneSec;
7846 4 : thisGasEquip.LostEnergy = thisGasEquip.LostRate * state.dataGlobal->TimeStepZoneSec;
7847 4 : thisGasEquip.TotGainEnergy = thisGasEquip.TotGainRate * state.dataGlobal->TimeStepZoneSec;
7848 : }
7849 :
7850 493040 : for (int Loop = 1; Loop <= state.dataHeatBal->TotOthEquip; ++Loop) {
7851 243082 : auto &thisOtherEquip = state.dataHeatBal->ZoneOtherEq(Loop);
7852 243082 : thisOtherEquip.Consumption = thisOtherEquip.Power * state.dataGlobal->TimeStepZoneSec;
7853 243082 : thisOtherEquip.RadGainEnergy = thisOtherEquip.RadGainRate * state.dataGlobal->TimeStepZoneSec;
7854 243082 : thisOtherEquip.ConGainEnergy = thisOtherEquip.ConGainRate * state.dataGlobal->TimeStepZoneSec;
7855 243082 : thisOtherEquip.LatGainEnergy = thisOtherEquip.LatGainRate * state.dataGlobal->TimeStepZoneSec;
7856 243082 : thisOtherEquip.LostEnergy = thisOtherEquip.LostRate * state.dataGlobal->TimeStepZoneSec;
7857 243082 : thisOtherEquip.TotGainEnergy = thisOtherEquip.TotGainRate * state.dataGlobal->TimeStepZoneSec;
7858 : }
7859 :
7860 249962 : for (int Loop = 1; Loop <= state.dataHeatBal->TotHWEquip; ++Loop) {
7861 4 : auto &thisHWEquip = state.dataHeatBal->ZoneHWEq(Loop);
7862 4 : thisHWEquip.Consumption = thisHWEquip.Power * state.dataGlobal->TimeStepZoneSec;
7863 4 : thisHWEquip.RadGainEnergy = thisHWEquip.RadGainRate * state.dataGlobal->TimeStepZoneSec;
7864 4 : thisHWEquip.ConGainEnergy = thisHWEquip.ConGainRate * state.dataGlobal->TimeStepZoneSec;
7865 4 : thisHWEquip.LatGainEnergy = thisHWEquip.LatGainRate * state.dataGlobal->TimeStepZoneSec;
7866 4 : thisHWEquip.LostEnergy = thisHWEquip.LostRate * state.dataGlobal->TimeStepZoneSec;
7867 4 : thisHWEquip.TotGainEnergy = thisHWEquip.TotGainRate * state.dataGlobal->TimeStepZoneSec;
7868 : }
7869 :
7870 249962 : for (int Loop = 1; Loop <= state.dataHeatBal->TotStmEquip; ++Loop) {
7871 4 : auto &thisSteamEquip = state.dataHeatBal->ZoneSteamEq(Loop);
7872 4 : thisSteamEquip.Consumption = thisSteamEquip.Power * state.dataGlobal->TimeStepZoneSec;
7873 4 : thisSteamEquip.RadGainEnergy = thisSteamEquip.RadGainRate * state.dataGlobal->TimeStepZoneSec;
7874 4 : thisSteamEquip.ConGainEnergy = thisSteamEquip.ConGainRate * state.dataGlobal->TimeStepZoneSec;
7875 4 : thisSteamEquip.LatGainEnergy = thisSteamEquip.LatGainRate * state.dataGlobal->TimeStepZoneSec;
7876 4 : thisSteamEquip.LostEnergy = thisSteamEquip.LostRate * state.dataGlobal->TimeStepZoneSec;
7877 4 : thisSteamEquip.TotGainEnergy = thisSteamEquip.TotGainRate * state.dataGlobal->TimeStepZoneSec;
7878 : }
7879 :
7880 249962 : for (int Loop = 1; Loop <= state.dataHeatBal->TotBBHeat; ++Loop) {
7881 4 : auto &thisBBHeat = state.dataHeatBal->ZoneBBHeat(Loop);
7882 4 : thisBBHeat.Consumption = thisBBHeat.Power * state.dataGlobal->TimeStepZoneSec;
7883 4 : thisBBHeat.RadGainEnergy = thisBBHeat.RadGainRate * state.dataGlobal->TimeStepZoneSec;
7884 4 : thisBBHeat.ConGainEnergy = thisBBHeat.ConGainRate * state.dataGlobal->TimeStepZoneSec;
7885 4 : thisBBHeat.TotGainEnergy = thisBBHeat.TotGainRate * state.dataGlobal->TimeStepZoneSec;
7886 : }
7887 :
7888 : // Zero zone-level values
7889 586610 : for (auto &e : state.dataHeatBal->ZoneIntGain) {
7890 336652 : e.NOFOCC = 0.0;
7891 336652 : e.QLTSW = 0.0;
7892 : }
7893 :
7894 586610 : for (auto &e : state.dataHeatBal->ZoneRpt) {
7895 : // People
7896 336652 : e.PeopleRadGain = 0.0;
7897 336652 : e.PeopleConGain = 0.0;
7898 336652 : e.PeopleSenGain = 0.0;
7899 336652 : e.PeopleNumOcc = 0.0;
7900 336652 : e.PeopleLatGain = 0.0;
7901 336652 : e.PeopleTotGain = 0.0;
7902 336652 : e.PeopleRadGainRate = 0.0;
7903 336652 : e.PeopleConGainRate = 0.0;
7904 336652 : e.PeopleSenGainRate = 0.0;
7905 336652 : e.PeopleLatGainRate = 0.0;
7906 336652 : e.PeopleTotGainRate = 0.0;
7907 : // Lights
7908 336652 : e.LtsPower = 0.0;
7909 336652 : e.LtsElecConsump = 0.0;
7910 336652 : e.LtsRadGain = 0.0;
7911 336652 : e.LtsVisGain = 0.0;
7912 336652 : e.LtsConGain = 0.0;
7913 336652 : e.LtsRetAirGain = 0.0;
7914 336652 : e.LtsTotGain = 0.0;
7915 336652 : e.LtsRadGainRate = 0.0;
7916 336652 : e.LtsVisGainRate = 0.0;
7917 336652 : e.LtsConGainRate = 0.0;
7918 336652 : e.LtsRetAirGainRate = 0.0;
7919 336652 : e.LtsTotGainRate = 0.0;
7920 : // Baseboard Heat
7921 336652 : e.BaseHeatPower = 0.0;
7922 336652 : e.BaseHeatElecCons = 0.0;
7923 336652 : e.BaseHeatRadGain = 0.0;
7924 336652 : e.BaseHeatConGain = 0.0;
7925 336652 : e.BaseHeatTotGain = 0.0;
7926 336652 : e.BaseHeatRadGainRate = 0.0;
7927 336652 : e.BaseHeatConGainRate = 0.0;
7928 336652 : e.BaseHeatTotGainRate = 0.0;
7929 : // Electric Equipment
7930 336652 : e.ElecPower = 0.0;
7931 336652 : e.ElecConsump = 0.0;
7932 336652 : e.ElecRadGain = 0.0;
7933 336652 : e.ElecConGain = 0.0;
7934 336652 : e.ElecLatGain = 0.0;
7935 336652 : e.ElecLost = 0.0;
7936 336652 : e.ElecTotGain = 0.0;
7937 336652 : e.ElecRadGainRate = 0.0;
7938 336652 : e.ElecConGainRate = 0.0;
7939 336652 : e.ElecLatGainRate = 0.0;
7940 336652 : e.ElecLostRate = 0.0;
7941 336652 : e.ElecTotGainRate = 0.0;
7942 : // Gas Equipment
7943 336652 : e.GasPower = 0.0;
7944 336652 : e.GasConsump = 0.0;
7945 336652 : e.GasRadGain = 0.0;
7946 336652 : e.GasConGain = 0.0;
7947 336652 : e.GasLatGain = 0.0;
7948 336652 : e.GasLost = 0.0;
7949 336652 : e.GasTotGain = 0.0;
7950 336652 : e.GasRadGainRate = 0.0;
7951 336652 : e.GasConGainRate = 0.0;
7952 336652 : e.GasLatGainRate = 0.0;
7953 336652 : e.GasLostRate = 0.0;
7954 336652 : e.GasTotGainRate = 0.0;
7955 : // Hot Water Equipment
7956 336652 : e.HWPower = 0.0;
7957 336652 : e.HWConsump = 0.0;
7958 336652 : e.HWRadGain = 0.0;
7959 336652 : e.HWConGain = 0.0;
7960 336652 : e.HWLatGain = 0.0;
7961 336652 : e.HWLost = 0.0;
7962 336652 : e.HWTotGain = 0.0;
7963 336652 : e.HWRadGainRate = 0.0;
7964 336652 : e.HWConGainRate = 0.0;
7965 336652 : e.HWLatGainRate = 0.0;
7966 336652 : e.HWLostRate = 0.0;
7967 336652 : e.HWTotGainRate = 0.0;
7968 : // Steam Equipment
7969 336652 : e.SteamPower = 0.0;
7970 336652 : e.SteamConsump = 0.0;
7971 336652 : e.SteamRadGain = 0.0;
7972 336652 : e.SteamConGain = 0.0;
7973 336652 : e.SteamLatGain = 0.0;
7974 336652 : e.SteamLost = 0.0;
7975 336652 : e.SteamTotGain = 0.0;
7976 336652 : e.SteamRadGainRate = 0.0;
7977 336652 : e.SteamConGainRate = 0.0;
7978 336652 : e.SteamLatGainRate = 0.0;
7979 336652 : e.SteamLostRate = 0.0;
7980 336652 : e.SteamTotGainRate = 0.0;
7981 : // Other Equipment
7982 336652 : e.OtherRadGain = 0.0;
7983 336652 : e.OtherConGain = 0.0;
7984 336652 : e.OtherLatGain = 0.0;
7985 336652 : e.OtherLost = 0.0;
7986 336652 : e.OtherTotGain = 0.0;
7987 336652 : e.OtherRadGainRate = 0.0;
7988 336652 : e.OtherConGainRate = 0.0;
7989 336652 : e.OtherLatGainRate = 0.0;
7990 336652 : e.OtherLostRate = 0.0;
7991 336652 : e.OtherTotGainRate = 0.0;
7992 : // Overall Zone Variables
7993 336652 : e.TotRadiantGain = 0.0;
7994 336652 : e.TotVisHeatGain = 0.0;
7995 336652 : e.TotConvectiveGain = 0.0;
7996 336652 : e.TotLatentGain = 0.0;
7997 336652 : e.TotTotalHeatGain = 0.0;
7998 336652 : e.TotRadiantGainRate = 0.0;
7999 336652 : e.TotVisHeatGainRate = 0.0;
8000 336652 : e.TotConvectiveGainRate = 0.0;
8001 336652 : e.TotLatentGainRate = 0.0;
8002 336652 : e.TotTotalHeatGainRate = 0.0;
8003 : // Contaminant
8004 : // e.CO2Rate = 0.0; - cleared and accumulated in InitInternalHeatGains
8005 336652 : e.GCRate = 0.0;
8006 5386432 : for (int i = 0; i < (int)Constant::eFuel::Num; ++i) {
8007 5049780 : e.OtherPower[i] = 0.0;
8008 5049780 : e.OtherConsump[i] = 0.0;
8009 : }
8010 : }
8011 :
8012 622915 : for (int spaceNum = 1; spaceNum <= state.dataGlobal->numSpaces; ++spaceNum) {
8013 372957 : auto &thisSpaceRpt = state.dataHeatBal->spaceRpt(spaceNum);
8014 372957 : auto &thisSpaceIntGain = state.dataHeatBal->spaceIntGain(spaceNum);
8015 372957 : int zoneNum = state.dataHeatBal->space(spaceNum).zoneNum;
8016 372957 : auto &thisZoneRpt = state.dataHeatBal->ZoneRpt(zoneNum);
8017 372957 : auto &thisZoneIntGain = state.dataHeatBal->ZoneIntGain(zoneNum);
8018 : // People
8019 372957 : thisSpaceRpt.PeopleNumOcc = thisSpaceIntGain.NOFOCC;
8020 372957 : thisSpaceRpt.PeopleRadGain = thisSpaceRpt.PeopleRadGainRate * state.dataGlobal->TimeStepZoneSec;
8021 372957 : thisSpaceRpt.PeopleConGain = thisSpaceRpt.PeopleConGainRate * state.dataGlobal->TimeStepZoneSec;
8022 372957 : thisSpaceRpt.PeopleSenGain = thisSpaceRpt.PeopleSenGainRate * state.dataGlobal->TimeStepZoneSec;
8023 372957 : thisSpaceRpt.PeopleLatGain = thisSpaceRpt.PeopleLatGainRate * state.dataGlobal->TimeStepZoneSec;
8024 372957 : thisSpaceRpt.PeopleTotGain = thisSpaceRpt.PeopleTotGainRate * state.dataGlobal->TimeStepZoneSec;
8025 :
8026 372957 : thisZoneIntGain.NOFOCC += thisSpaceIntGain.NOFOCC;
8027 372957 : thisZoneRpt.PeopleRadGainRate += thisSpaceRpt.PeopleRadGainRate;
8028 372957 : thisZoneRpt.PeopleConGainRate += thisSpaceRpt.PeopleConGainRate;
8029 372957 : thisZoneRpt.PeopleSenGainRate += thisSpaceRpt.PeopleSenGainRate;
8030 372957 : thisZoneRpt.PeopleLatGainRate += thisSpaceRpt.PeopleLatGainRate;
8031 372957 : thisZoneRpt.PeopleTotGainRate += thisSpaceRpt.PeopleTotGainRate;
8032 :
8033 : // General Lights
8034 372957 : thisSpaceRpt.LtsElecConsump = thisSpaceRpt.LtsPower * state.dataGlobal->TimeStepZoneSec;
8035 372957 : thisSpaceRpt.LtsRetAirGain = thisSpaceRpt.LtsRetAirGainRate * state.dataGlobal->TimeStepZoneSec;
8036 372957 : thisSpaceRpt.LtsRadGain = thisSpaceRpt.LtsRadGainRate * state.dataGlobal->TimeStepZoneSec;
8037 372957 : thisSpaceRpt.LtsTotGain = thisSpaceRpt.LtsTotGainRate * state.dataGlobal->TimeStepZoneSec;
8038 372957 : thisSpaceRpt.LtsConGain = thisSpaceRpt.LtsConGainRate * state.dataGlobal->TimeStepZoneSec;
8039 372957 : thisSpaceRpt.LtsVisGain = thisSpaceRpt.LtsVisGainRate * state.dataGlobal->TimeStepZoneSec;
8040 :
8041 372957 : thisZoneRpt.LtsPower += thisSpaceRpt.LtsPower;
8042 372957 : thisZoneRpt.LtsRetAirGainRate += thisSpaceRpt.LtsRetAirGainRate;
8043 372957 : thisZoneRpt.LtsRadGainRate += thisSpaceRpt.LtsRadGainRate;
8044 372957 : thisZoneRpt.LtsTotGainRate += thisSpaceRpt.LtsTotGainRate;
8045 372957 : thisZoneRpt.LtsConGainRate += thisSpaceRpt.LtsConGainRate;
8046 372957 : thisZoneRpt.LtsVisGainRate += thisSpaceRpt.LtsVisGainRate;
8047 372957 : thisZoneIntGain.QLTSW += thisSpaceIntGain.QLTSW;
8048 :
8049 : // Electric Equipment
8050 372957 : thisSpaceRpt.ElecConsump = thisSpaceRpt.ElecPower * state.dataGlobal->TimeStepZoneSec;
8051 372957 : thisSpaceRpt.ElecConGain = thisSpaceRpt.ElecConGainRate * state.dataGlobal->TimeStepZoneSec;
8052 372957 : thisSpaceRpt.ElecRadGain = thisSpaceRpt.ElecRadGainRate * state.dataGlobal->TimeStepZoneSec;
8053 372957 : thisSpaceRpt.ElecLatGain = thisSpaceRpt.ElecLatGainRate * state.dataGlobal->TimeStepZoneSec;
8054 372957 : thisSpaceRpt.ElecLost = thisSpaceRpt.ElecLostRate * state.dataGlobal->TimeStepZoneSec;
8055 372957 : thisSpaceRpt.ElecTotGainRate = thisSpaceRpt.ElecConGainRate + thisSpaceRpt.ElecRadGainRate + thisSpaceRpt.ElecLatGainRate;
8056 372957 : thisSpaceRpt.ElecTotGain = thisSpaceRpt.ElecTotGainRate * state.dataGlobal->TimeStepZoneSec;
8057 :
8058 372957 : thisZoneRpt.ElecPower += thisSpaceRpt.ElecPower;
8059 372957 : thisZoneRpt.ElecConGainRate += thisSpaceRpt.ElecConGainRate;
8060 372957 : thisZoneRpt.ElecRadGainRate += thisSpaceRpt.ElecRadGainRate;
8061 372957 : thisZoneRpt.ElecLatGainRate += thisSpaceRpt.ElecLatGainRate;
8062 372957 : thisZoneRpt.ElecLostRate += thisSpaceRpt.ElecLostRate;
8063 372957 : thisZoneRpt.ElecTotGainRate += thisSpaceRpt.ElecTotGainRate;
8064 :
8065 : // Gas Equipment
8066 372957 : thisSpaceRpt.GasConsump = thisSpaceRpt.GasPower * state.dataGlobal->TimeStepZoneSec;
8067 372957 : thisSpaceRpt.GasConGain = thisSpaceRpt.GasConGainRate * state.dataGlobal->TimeStepZoneSec;
8068 372957 : thisSpaceRpt.GasRadGain = thisSpaceRpt.GasRadGainRate * state.dataGlobal->TimeStepZoneSec;
8069 372957 : thisSpaceRpt.GasLatGain = thisSpaceRpt.GasLatGainRate * state.dataGlobal->TimeStepZoneSec;
8070 372957 : thisSpaceRpt.GasLost = thisSpaceRpt.GasLostRate * state.dataGlobal->TimeStepZoneSec;
8071 372957 : thisSpaceRpt.GasTotGainRate = thisSpaceRpt.GasConGainRate + thisSpaceRpt.GasRadGainRate + thisSpaceRpt.GasLatGainRate;
8072 372957 : thisSpaceRpt.GasTotGain = thisSpaceRpt.GasTotGainRate * state.dataGlobal->TimeStepZoneSec;
8073 :
8074 372957 : thisZoneRpt.GasPower += thisSpaceRpt.GasPower;
8075 372957 : thisZoneRpt.GasConGainRate += thisSpaceRpt.GasConGainRate;
8076 372957 : thisZoneRpt.GasRadGainRate += thisSpaceRpt.GasRadGainRate;
8077 372957 : thisZoneRpt.GasLatGainRate += thisSpaceRpt.GasLatGainRate;
8078 372957 : thisZoneRpt.GasLostRate += thisSpaceRpt.GasLostRate;
8079 372957 : thisZoneRpt.GasTotGainRate += thisSpaceRpt.GasTotGainRate;
8080 :
8081 : // Hot Water Equipment
8082 372957 : thisSpaceRpt.HWConsump = thisSpaceRpt.HWPower * state.dataGlobal->TimeStepZoneSec;
8083 372957 : thisSpaceRpt.HWConGain = thisSpaceRpt.HWConGainRate * state.dataGlobal->TimeStepZoneSec;
8084 372957 : thisSpaceRpt.HWRadGain = thisSpaceRpt.HWRadGainRate * state.dataGlobal->TimeStepZoneSec;
8085 372957 : thisSpaceRpt.HWLatGain = thisSpaceRpt.HWLatGainRate * state.dataGlobal->TimeStepZoneSec;
8086 372957 : thisSpaceRpt.HWLost = thisSpaceRpt.HWLostRate * state.dataGlobal->TimeStepZoneSec;
8087 372957 : thisSpaceRpt.HWTotGainRate = thisSpaceRpt.HWConGainRate + thisSpaceRpt.HWRadGainRate + thisSpaceRpt.HWLatGainRate;
8088 372957 : thisSpaceRpt.HWTotGain = thisSpaceRpt.HWTotGainRate * state.dataGlobal->TimeStepZoneSec;
8089 :
8090 372957 : thisZoneRpt.HWPower += thisSpaceRpt.HWPower;
8091 372957 : thisZoneRpt.HWConGainRate += thisSpaceRpt.HWConGainRate;
8092 372957 : thisZoneRpt.HWRadGainRate += thisSpaceRpt.HWRadGainRate;
8093 372957 : thisZoneRpt.HWLatGainRate += thisSpaceRpt.HWLatGainRate;
8094 372957 : thisZoneRpt.HWLostRate += thisSpaceRpt.HWLostRate;
8095 372957 : thisZoneRpt.HWTotGainRate += thisSpaceRpt.HWTotGainRate;
8096 :
8097 : // Steam Equipment
8098 372957 : thisSpaceRpt.SteamConsump = thisSpaceRpt.SteamPower * state.dataGlobal->TimeStepZoneSec;
8099 372957 : thisSpaceRpt.SteamConGain = thisSpaceRpt.SteamConGainRate * state.dataGlobal->TimeStepZoneSec;
8100 372957 : thisSpaceRpt.SteamRadGain = thisSpaceRpt.SteamRadGainRate * state.dataGlobal->TimeStepZoneSec;
8101 372957 : thisSpaceRpt.SteamLatGain = thisSpaceRpt.SteamLatGainRate * state.dataGlobal->TimeStepZoneSec;
8102 372957 : thisSpaceRpt.SteamLost = thisSpaceRpt.SteamLostRate * state.dataGlobal->TimeStepZoneSec;
8103 372957 : thisSpaceRpt.SteamTotGainRate = thisSpaceRpt.SteamConGainRate + thisSpaceRpt.SteamRadGainRate + thisSpaceRpt.SteamLatGainRate;
8104 372957 : thisSpaceRpt.SteamTotGain = thisSpaceRpt.SteamTotGainRate * state.dataGlobal->TimeStepZoneSec;
8105 :
8106 372957 : thisZoneRpt.SteamPower += thisSpaceRpt.SteamPower;
8107 372957 : thisZoneRpt.SteamConGainRate += thisSpaceRpt.SteamConGainRate;
8108 372957 : thisZoneRpt.SteamRadGainRate += thisSpaceRpt.SteamRadGainRate;
8109 372957 : thisZoneRpt.SteamLatGainRate += thisSpaceRpt.SteamLatGainRate;
8110 372957 : thisZoneRpt.SteamLostRate += thisSpaceRpt.SteamLostRate;
8111 372957 : thisZoneRpt.SteamTotGainRate += thisSpaceRpt.SteamTotGainRate;
8112 :
8113 : // Other Equipment
8114 372957 : thisSpaceRpt.OtherConGain = thisSpaceRpt.OtherConGainRate * state.dataGlobal->TimeStepZoneSec;
8115 372957 : thisSpaceRpt.OtherRadGain = thisSpaceRpt.OtherRadGainRate * state.dataGlobal->TimeStepZoneSec;
8116 372957 : thisSpaceRpt.OtherLatGain = thisSpaceRpt.OtherLatGainRate * state.dataGlobal->TimeStepZoneSec;
8117 372957 : thisSpaceRpt.OtherLost = thisSpaceRpt.OtherLostRate * state.dataGlobal->TimeStepZoneSec;
8118 372957 : thisSpaceRpt.OtherTotGainRate = thisSpaceRpt.OtherConGainRate + thisSpaceRpt.OtherRadGainRate + thisSpaceRpt.OtherLatGainRate;
8119 372957 : thisSpaceRpt.OtherTotGain = thisSpaceRpt.OtherTotGainRate * state.dataGlobal->TimeStepZoneSec;
8120 :
8121 372957 : thisZoneRpt.OtherConGainRate += thisSpaceRpt.OtherConGainRate;
8122 372957 : thisZoneRpt.OtherRadGainRate += thisSpaceRpt.OtherRadGainRate;
8123 372957 : thisZoneRpt.OtherLatGainRate += thisSpaceRpt.OtherLatGainRate;
8124 372957 : thisZoneRpt.OtherLostRate += thisSpaceRpt.OtherLostRate;
8125 372957 : thisZoneRpt.OtherTotGainRate += thisSpaceRpt.OtherTotGainRate;
8126 :
8127 372965 : for (Constant::eFuel fuelTypeNum : state.dataHeatBal->space(spaceNum).otherEquipFuelTypeNums) {
8128 8 : int fuelIdx = (int)fuelTypeNum;
8129 8 : thisSpaceRpt.OtherConsump[fuelIdx] = thisSpaceRpt.OtherPower[fuelIdx] * state.dataGlobal->TimeStepZoneSec;
8130 8 : thisZoneRpt.OtherPower[fuelIdx] += thisSpaceRpt.OtherPower[fuelIdx];
8131 : }
8132 :
8133 : // Baseboard Heat
8134 372957 : thisSpaceRpt.BaseHeatElecCons = thisSpaceRpt.BaseHeatPower * state.dataGlobal->TimeStepZoneSec;
8135 372957 : thisSpaceRpt.BaseHeatConGain = thisSpaceRpt.BaseHeatConGainRate * state.dataGlobal->TimeStepZoneSec;
8136 372957 : thisSpaceRpt.BaseHeatRadGain = thisSpaceRpt.BaseHeatRadGainRate * state.dataGlobal->TimeStepZoneSec;
8137 372957 : thisSpaceRpt.BaseHeatTotGainRate = thisSpaceRpt.BaseHeatConGainRate + thisSpaceRpt.BaseHeatRadGainRate;
8138 372957 : thisSpaceRpt.BaseHeatTotGain = thisSpaceRpt.BaseHeatTotGainRate * state.dataGlobal->TimeStepZoneSec;
8139 :
8140 372957 : thisZoneRpt.BaseHeatPower += thisSpaceRpt.BaseHeatPower;
8141 372957 : thisZoneRpt.BaseHeatConGainRate += thisSpaceRpt.BaseHeatConGainRate;
8142 372957 : thisZoneRpt.BaseHeatRadGainRate += thisSpaceRpt.BaseHeatRadGainRate;
8143 372957 : thisZoneRpt.BaseHeatTotGainRate += thisSpaceRpt.BaseHeatTotGainRate;
8144 :
8145 : // Overall Space Variables
8146 :
8147 : // these overalls include component gains from devices like water heater, water use, and generators
8148 : // working vars QFCConv QGenConv QFCRad QGenRad WaterUseLatentGain WaterThermalTankGain WaterUseSensibleGain
8149 :
8150 372957 : thisSpaceRpt.TotVisHeatGain = thisSpaceRpt.LtsVisGain;
8151 372957 : thisSpaceRpt.TotVisHeatGainRate = thisSpaceRpt.LtsVisGainRate;
8152 :
8153 372957 : thisSpaceRpt.TotRadiantGainRate = SumInternalRadiationGainsByTypes(state, zoneNum, TradIntGainTypes, spaceNum);
8154 372957 : thisSpaceRpt.TotRadiantGain = thisSpaceRpt.TotRadiantGainRate * state.dataGlobal->TimeStepZoneSec;
8155 :
8156 372957 : thisSpaceRpt.TotConvectiveGainRate = SumInternalConvectionGainsByTypes(state, zoneNum, TradIntGainTypes, spaceNum);
8157 372957 : thisSpaceRpt.TotConvectiveGain = thisSpaceRpt.TotConvectiveGainRate * state.dataGlobal->TimeStepZoneSec;
8158 :
8159 372957 : thisSpaceRpt.TotLatentGainRate = SumInternalLatentGainsByTypes(state, zoneNum, TradIntGainTypes, spaceNum);
8160 372957 : thisSpaceRpt.TotLatentGain = thisSpaceRpt.TotLatentGainRate * state.dataGlobal->TimeStepZoneSec;
8161 :
8162 372957 : thisSpaceRpt.TotTotalHeatGainRate = thisSpaceRpt.TotLatentGainRate + thisSpaceRpt.TotRadiantGainRate +
8163 372957 : thisSpaceRpt.TotConvectiveGainRate + thisSpaceRpt.TotVisHeatGainRate;
8164 372957 : thisSpaceRpt.TotTotalHeatGain = thisSpaceRpt.TotTotalHeatGainRate * state.dataGlobal->TimeStepZoneSec;
8165 : }
8166 :
8167 586610 : for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) {
8168 336652 : auto &thisZoneRpt = state.dataHeatBal->ZoneRpt(zoneNum);
8169 336652 : auto &thisZoneIntGain = state.dataHeatBal->ZoneIntGain(zoneNum);
8170 :
8171 : // People
8172 336652 : thisZoneRpt.PeopleNumOcc = thisZoneIntGain.NOFOCC;
8173 336652 : thisZoneRpt.PeopleRadGain = thisZoneRpt.PeopleRadGainRate * state.dataGlobal->TimeStepZoneSec;
8174 336652 : thisZoneRpt.PeopleConGain = thisZoneRpt.PeopleConGainRate * state.dataGlobal->TimeStepZoneSec;
8175 336652 : thisZoneRpt.PeopleSenGain = thisZoneRpt.PeopleSenGainRate * state.dataGlobal->TimeStepZoneSec;
8176 336652 : thisZoneRpt.PeopleLatGain = thisZoneRpt.PeopleLatGainRate * state.dataGlobal->TimeStepZoneSec;
8177 336652 : thisZoneRpt.PeopleTotGain = thisZoneRpt.PeopleTotGainRate * state.dataGlobal->TimeStepZoneSec;
8178 :
8179 : // General Lights
8180 336652 : thisZoneRpt.LtsRetAirGain = thisZoneRpt.LtsRetAirGainRate * state.dataGlobal->TimeStepZoneSec;
8181 336652 : thisZoneRpt.LtsRadGain = thisZoneRpt.LtsRadGainRate * state.dataGlobal->TimeStepZoneSec;
8182 336652 : thisZoneRpt.LtsTotGain = thisZoneRpt.LtsTotGainRate * state.dataGlobal->TimeStepZoneSec;
8183 336652 : thisZoneRpt.LtsConGain = thisZoneRpt.LtsConGainRate * state.dataGlobal->TimeStepZoneSec;
8184 336652 : thisZoneRpt.LtsVisGain = thisZoneRpt.LtsVisGainRate * state.dataGlobal->TimeStepZoneSec;
8185 336652 : thisZoneRpt.LtsElecConsump = thisZoneRpt.LtsPower * state.dataGlobal->TimeStepZoneSec;
8186 :
8187 : // Electric Equipment
8188 336652 : thisZoneRpt.ElecConGain = thisZoneRpt.ElecConGainRate * state.dataGlobal->TimeStepZoneSec;
8189 336652 : thisZoneRpt.ElecRadGain = thisZoneRpt.ElecRadGainRate * state.dataGlobal->TimeStepZoneSec;
8190 336652 : thisZoneRpt.ElecLatGain = thisZoneRpt.ElecLatGainRate * state.dataGlobal->TimeStepZoneSec;
8191 336652 : thisZoneRpt.ElecLost = thisZoneRpt.ElecLostRate * state.dataGlobal->TimeStepZoneSec;
8192 336652 : thisZoneRpt.ElecConsump = thisZoneRpt.ElecPower * state.dataGlobal->TimeStepZoneSec;
8193 336652 : thisZoneRpt.ElecTotGain = thisZoneRpt.ElecTotGainRate * state.dataGlobal->TimeStepZoneSec;
8194 :
8195 : // Gas Equipment
8196 336652 : thisZoneRpt.GasConGain = thisZoneRpt.GasConGainRate * state.dataGlobal->TimeStepZoneSec;
8197 336652 : thisZoneRpt.GasRadGain = thisZoneRpt.GasRadGainRate * state.dataGlobal->TimeStepZoneSec;
8198 336652 : thisZoneRpt.GasLatGain = thisZoneRpt.GasLatGainRate * state.dataGlobal->TimeStepZoneSec;
8199 336652 : thisZoneRpt.GasLost = thisZoneRpt.GasLostRate * state.dataGlobal->TimeStepZoneSec;
8200 336652 : thisZoneRpt.GasConsump = thisZoneRpt.GasPower * state.dataGlobal->TimeStepZoneSec;
8201 336652 : thisZoneRpt.GasTotGain = thisZoneRpt.GasTotGainRate * state.dataGlobal->TimeStepZoneSec;
8202 :
8203 : // Hot Water Equipment
8204 336652 : thisZoneRpt.HWConGain = thisZoneRpt.HWConGainRate * state.dataGlobal->TimeStepZoneSec;
8205 336652 : thisZoneRpt.HWRadGain = thisZoneRpt.HWRadGainRate * state.dataGlobal->TimeStepZoneSec;
8206 336652 : thisZoneRpt.HWLatGain = thisZoneRpt.HWLatGainRate * state.dataGlobal->TimeStepZoneSec;
8207 336652 : thisZoneRpt.HWLost = thisZoneRpt.HWLostRate * state.dataGlobal->TimeStepZoneSec;
8208 336652 : thisZoneRpt.HWConsump = thisZoneRpt.HWPower * state.dataGlobal->TimeStepZoneSec;
8209 336652 : thisZoneRpt.HWTotGain = thisZoneRpt.HWTotGainRate * state.dataGlobal->TimeStepZoneSec;
8210 :
8211 : // Steam Equipment
8212 336652 : thisZoneRpt.SteamConGain = thisZoneRpt.SteamConGainRate * state.dataGlobal->TimeStepZoneSec;
8213 336652 : thisZoneRpt.SteamRadGain = thisZoneRpt.SteamRadGainRate * state.dataGlobal->TimeStepZoneSec;
8214 336652 : thisZoneRpt.SteamLatGain = thisZoneRpt.SteamLatGainRate * state.dataGlobal->TimeStepZoneSec;
8215 336652 : thisZoneRpt.SteamLost = thisZoneRpt.SteamLostRate * state.dataGlobal->TimeStepZoneSec;
8216 336652 : thisZoneRpt.SteamConsump = thisZoneRpt.SteamPower * state.dataGlobal->TimeStepZoneSec;
8217 336652 : thisZoneRpt.SteamTotGain = thisZoneRpt.SteamTotGainRate * state.dataGlobal->TimeStepZoneSec;
8218 :
8219 : // Other Equipment
8220 336652 : thisZoneRpt.OtherConGain = thisZoneRpt.OtherConGainRate * state.dataGlobal->TimeStepZoneSec;
8221 336652 : thisZoneRpt.OtherRadGain = thisZoneRpt.OtherRadGainRate * state.dataGlobal->TimeStepZoneSec;
8222 336652 : thisZoneRpt.OtherLatGain = thisZoneRpt.OtherLatGainRate * state.dataGlobal->TimeStepZoneSec;
8223 336652 : thisZoneRpt.OtherLost = thisZoneRpt.OtherLostRate * state.dataGlobal->TimeStepZoneSec;
8224 336652 : thisZoneRpt.OtherTotGain = thisZoneRpt.OtherTotGainRate * state.dataGlobal->TimeStepZoneSec;
8225 336656 : for (Constant::eFuel fuelTypeNum : state.dataHeatBal->Zone(zoneNum).otherEquipFuelTypeNums) {
8226 4 : int fuelIdx = (int)fuelTypeNum;
8227 4 : thisZoneRpt.OtherConsump[fuelIdx] = thisZoneRpt.OtherPower[fuelIdx] * state.dataGlobal->TimeStepZoneSec;
8228 : }
8229 :
8230 : // Baseboard Heat
8231 336652 : thisZoneRpt.BaseHeatConGain = thisZoneRpt.BaseHeatConGainRate * state.dataGlobal->TimeStepZoneSec;
8232 336652 : thisZoneRpt.BaseHeatRadGain = thisZoneRpt.BaseHeatRadGainRate * state.dataGlobal->TimeStepZoneSec;
8233 336652 : thisZoneRpt.BaseHeatElecCons = thisZoneRpt.BaseHeatPower * state.dataGlobal->TimeStepZoneSec;
8234 336652 : thisZoneRpt.BaseHeatTotGain = thisZoneRpt.BaseHeatTotGainRate * state.dataGlobal->TimeStepZoneSec;
8235 :
8236 : // Overall Zone Variables
8237 :
8238 : // these overalls include component gains from devices like water heater, water use, and generators
8239 : // working vars QFCConv QGenConv QFCRad QGenRad WaterUseLatentGain WaterThermalTankGain WaterUseSensibleGain
8240 :
8241 336652 : thisZoneRpt.TotVisHeatGain = thisZoneRpt.LtsVisGain;
8242 336652 : thisZoneRpt.TotVisHeatGainRate = thisZoneRpt.LtsVisGainRate;
8243 :
8244 336652 : thisZoneRpt.TotRadiantGainRate = SumInternalRadiationGainsByTypes(state, zoneNum, TradIntGainTypes);
8245 336652 : thisZoneRpt.TotRadiantGain = thisZoneRpt.TotRadiantGainRate * state.dataGlobal->TimeStepZoneSec;
8246 :
8247 336652 : thisZoneRpt.TotConvectiveGainRate = SumInternalConvectionGainsByTypes(state, zoneNum, TradIntGainTypes);
8248 336652 : thisZoneRpt.TotConvectiveGain = thisZoneRpt.TotConvectiveGainRate * state.dataGlobal->TimeStepZoneSec;
8249 :
8250 336652 : thisZoneRpt.TotLatentGainRate = SumInternalLatentGainsByTypes(state, zoneNum, TradIntGainTypes);
8251 336652 : thisZoneRpt.TotLatentGain = thisZoneRpt.TotLatentGainRate * state.dataGlobal->TimeStepZoneSec;
8252 :
8253 336652 : thisZoneRpt.TotTotalHeatGainRate =
8254 336652 : thisZoneRpt.TotLatentGainRate + thisZoneRpt.TotRadiantGainRate + thisZoneRpt.TotConvectiveGainRate + thisZoneRpt.TotVisHeatGainRate;
8255 336652 : thisZoneRpt.TotTotalHeatGain = thisZoneRpt.TotTotalHeatGainRate * state.dataGlobal->TimeStepZoneSec;
8256 : }
8257 249958 : }
8258 :
8259 17 : Real64 GetDesignLightingLevelForZone(EnergyPlusData &state, int const WhichZone) // name of zone
8260 : {
8261 :
8262 : // FUNCTION INFORMATION:
8263 : // AUTHOR Linda Lawrie
8264 : // DATE WRITTEN April 2007; January 2008 - moved to InternalGains
8265 : // MODIFIED na
8266 : // RE-ENGINEERED na
8267 :
8268 : // PURPOSE OF THIS FUNCTION:
8269 : // This routine sums the Lighting Level for a zone.
8270 : // Will issue a severe error for illegal zone.
8271 : // Must be called after InternalHeatGains get input.
8272 :
8273 : // Using/Aliasing
8274 : using namespace DataHeatBalance;
8275 : // Return value
8276 : Real64 DesignLightingLevelSum; // Sum of design lighting level for this zone
8277 :
8278 : // FUNCTION LOCAL VARIABLE DECLARATIONS:
8279 : int Loop;
8280 :
8281 17 : if (state.dataInternalHeatGains->GetInternalHeatGainsInputFlag) {
8282 0 : ShowFatalError(state, "GetDesignLightingLevelForZone: Function called prior to Getting Lights Input.");
8283 : }
8284 :
8285 17 : DesignLightingLevelSum = 0.0;
8286 :
8287 43 : for (Loop = 1; Loop <= state.dataHeatBal->TotLights; ++Loop) {
8288 26 : if (state.dataHeatBal->Lights(Loop).ZonePtr == WhichZone) {
8289 14 : DesignLightingLevelSum += state.dataHeatBal->Lights(Loop).DesignLevel;
8290 : }
8291 : }
8292 :
8293 17 : return DesignLightingLevelSum;
8294 : }
8295 :
8296 9 : bool CheckThermalComfortSchedules(bool const WorkEffSch, // Blank work efficiency schedule = true
8297 : bool const CloInsSch, // Blank clothing insulation schedule = true
8298 : bool const AirVeloSch) // Blank air velocity schedule = true
8299 : {
8300 9 : bool TCSchedsPresent = false;
8301 :
8302 9 : if (!WorkEffSch || !CloInsSch || !AirVeloSch) {
8303 7 : TCSchedsPresent = true;
8304 : }
8305 :
8306 9 : return TCSchedsPresent;
8307 : }
8308 :
8309 17 : void CheckLightsReplaceableMinMaxForZone(EnergyPlusData &state, int const WhichZone) // Zone Number
8310 : {
8311 :
8312 : // SUBROUTINE INFORMATION:
8313 : // AUTHOR Linda Lawrie
8314 : // DATE WRITTEN April 2007
8315 : // MODIFIED na
8316 : // RE-ENGINEERED na
8317 :
8318 : // PURPOSE OF THIS SUBROUTINE:
8319 : // Daylighting is not available unless Lights (replaceable) is 0.0 or 1.0. No dimming will be done
8320 : // unless the lights replaceable fraction is 1.0. This is documented in the InputOutputReference but
8321 : // not warned about. Also, this will sum the Zone Design Lighting level, in case the calling routine
8322 : // would like to have an error if the lights is zero and daylighting is requested.
8323 :
8324 : // METHODOLOGY EMPLOYED:
8325 : // Traverse the LIGHTS structure and get fraction replaceable - min/max as well as lighting
8326 : // level for a zone.
8327 :
8328 : // Using/Aliasing
8329 : // SUBROUTINE LOCAL VARIABLE DECLARATIONS:
8330 : int Loop;
8331 : Real64 LightsRepMin; // Minimum Lighting replacement fraction for any lights statement for this zone
8332 : Real64 LightsRepMax; // Maximum Lighting replacement fraction for any lights statement for this zone
8333 : int NumLights; // Number of Lights statement for that zone.
8334 :
8335 17 : if (state.dataInternalHeatGains->GetInternalHeatGainsInputFlag) {
8336 0 : ShowFatalError(state, "CheckLightsReplaceableMinMaxForZone: Function called prior to Getting Lights Input.");
8337 : }
8338 :
8339 17 : LightsRepMin = 99999.0;
8340 17 : LightsRepMax = -99999.0;
8341 17 : NumLights = 0;
8342 :
8343 43 : for (Loop = 1; Loop <= state.dataHeatBal->TotLights; ++Loop) {
8344 26 : if (state.dataHeatBal->Lights(Loop).ZonePtr != WhichZone) continue;
8345 14 : LightsRepMin = min(LightsRepMin, state.dataHeatBal->Lights(Loop).FractionReplaceable);
8346 14 : LightsRepMax = max(LightsRepMax, state.dataHeatBal->Lights(Loop).FractionReplaceable);
8347 14 : ++NumLights;
8348 28 : if ((state.dataDayltg->ZoneDaylight(WhichZone).totRefPts > 0) &&
8349 14 : (state.dataHeatBal->Lights(Loop).FractionReplaceable > 0.0 && state.dataHeatBal->Lights(Loop).FractionReplaceable < 1.0)) {
8350 0 : ShowWarningError(state, "CheckLightsReplaceableMinMaxForZone: Fraction Replaceable must be 0.0 or 1.0 if used with daylighting.");
8351 0 : ShowContinueError(state,
8352 0 : format("..Lights=\"{}\", Fraction Replaceable will be reset to 1.0 to allow dimming controls",
8353 0 : state.dataHeatBal->Lights(Loop).Name));
8354 0 : ShowContinueError(state, format("..in Zone={}", state.dataHeatBal->Zone(WhichZone).Name));
8355 0 : state.dataHeatBal->Lights(Loop).FractionReplaceable = 1.0;
8356 : }
8357 : }
8358 :
8359 17 : if (state.dataDayltg->ZoneDaylight(WhichZone).totRefPts > 0) {
8360 17 : if (LightsRepMax == 0.0) {
8361 0 : ShowWarningError(state,
8362 0 : format("CheckLightsReplaceable: Zone \"{}\" has Daylighting:Controls.", state.dataHeatBal->Zone(WhichZone).Name));
8363 0 : ShowContinueError(state, "but all of the LIGHTS object in that zone have zero Fraction Replaceable.");
8364 0 : ShowContinueError(state, "The daylighting controls will have no effect.");
8365 : }
8366 17 : if (NumLights == 0) {
8367 6 : ShowWarningError(state,
8368 6 : format("CheckLightsReplaceable: Zone \"{}\" has Daylighting:Controls.", state.dataHeatBal->Zone(WhichZone).Name));
8369 6 : ShowContinueError(state, "but there are no LIGHTS objects in that zone.");
8370 9 : ShowContinueError(state, "The daylighting controls will have no effect.");
8371 : }
8372 : }
8373 17 : }
8374 :
8375 547216 : void UpdateInternalGainValues(EnergyPlusData &state, bool const SuppressRadiationUpdate, bool const SumLatentGains)
8376 : {
8377 :
8378 : // SUBROUTINE INFORMATION:
8379 : // AUTHOR B. Griffith
8380 : // DATE WRITTEN Dec. 2011
8381 547216 : bool DoRadiationUpdate{!SuppressRadiationUpdate};
8382 :
8383 : // store pointer values to hold generic internal gain values constant for entire timestep
8384 1393557 : for (int spaceNum = 1; spaceNum <= state.dataGlobal->numSpaces; ++spaceNum) {
8385 846341 : auto &thisIntGain = state.dataHeatBal->spaceIntGainDevices(spaceNum);
8386 2268539 : for (int Loop = 1; Loop <= thisIntGain.numberOfDevices; ++Loop) {
8387 1422198 : thisIntGain.device(Loop).ConvectGainRate = *thisIntGain.device(Loop).PtrConvectGainRate * thisIntGain.device(Loop).spaceGainFrac;
8388 2844396 : thisIntGain.device(Loop).ReturnAirConvGainRate =
8389 1422198 : *thisIntGain.device(Loop).PtrReturnAirConvGainRate * thisIntGain.device(Loop).spaceGainFrac;
8390 1422198 : if (DoRadiationUpdate)
8391 683172 : thisIntGain.device(Loop).RadiantGainRate = *thisIntGain.device(Loop).PtrRadiantGainRate * thisIntGain.device(Loop).spaceGainFrac;
8392 1422198 : thisIntGain.device(Loop).LatentGainRate = *thisIntGain.device(Loop).PtrLatentGainRate * thisIntGain.device(Loop).spaceGainFrac;
8393 2844396 : thisIntGain.device(Loop).ReturnAirLatentGainRate =
8394 1422198 : *thisIntGain.device(Loop).PtrReturnAirLatentGainRate * thisIntGain.device(Loop).spaceGainFrac;
8395 2844396 : thisIntGain.device(Loop).CarbonDioxideGainRate =
8396 1422198 : *thisIntGain.device(Loop).PtrCarbonDioxideGainRate * thisIntGain.device(Loop).spaceGainFrac;
8397 1422198 : thisIntGain.device(Loop).GenericContamGainRate =
8398 1422198 : *thisIntGain.device(Loop).PtrGenericContamGainRate * thisIntGain.device(Loop).spaceGainFrac;
8399 : }
8400 : }
8401 547216 : if (SumLatentGains) {
8402 715584 : for (int NZ = 1; NZ <= state.dataGlobal->NumOfZones; ++NZ) {
8403 418328 : InternalHeatGains::SumAllInternalLatentGains(state, NZ);
8404 : // Added for the hybrid model
8405 418328 : if (state.dataHybridModel->FlagHybridModel_PC) {
8406 0 : InternalHeatGains::SumAllInternalLatentGainsExceptPeople(state, NZ);
8407 : }
8408 : }
8409 : }
8410 :
8411 547216 : if (state.dataContaminantBalance->Contaminant.GenericContamSimulation && allocated(state.dataContaminantBalance->ZoneGCGain)) {
8412 0 : for (int NZ = 1; NZ <= state.dataGlobal->NumOfZones; ++NZ) {
8413 0 : state.dataContaminantBalance->ZoneGCGain(NZ) = InternalHeatGains::SumAllInternalGenericContamGains(state, NZ);
8414 0 : state.dataHeatBal->ZoneRpt(NZ).GCRate = state.dataContaminantBalance->ZoneGCGain(NZ);
8415 : }
8416 : }
8417 547216 : }
8418 :
8419 1310302 : Real64 zoneSumAllInternalConvectionGains(EnergyPlusData &state,
8420 : int const zoneNum // zone index pointer to sum gains for
8421 : )
8422 : {
8423 1310302 : Real64 zoneSumConvGainRate(0.0);
8424 : // worker routine for summing all the internal gain types
8425 :
8426 2822621 : for (int spaceNum : state.dataHeatBal->Zone(zoneNum).spaceIndexes) {
8427 1512319 : if (state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices == 0) continue;
8428 978496 : zoneSumConvGainRate += InternalHeatGains::spaceSumAllInternalConvectionGains(state, spaceNum);
8429 : }
8430 :
8431 1310302 : return zoneSumConvGainRate;
8432 : }
8433 :
8434 1078288 : Real64 spaceSumAllInternalConvectionGains(EnergyPlusData &state,
8435 : int const spaceNum // space index pointer to sum gains for
8436 : )
8437 : {
8438 : // SUBROUTINE INFORMATION:
8439 : // AUTHOR B. Griffith
8440 : // DATE WRITTEN Nov. 2011
8441 :
8442 : // PURPOSE OF THIS SUBROUTINE:
8443 : // worker routine for summing all the internal gain types
8444 :
8445 1078288 : Real64 spaceSumConvGainRate(0.0);
8446 :
8447 3346265 : for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices; ++DeviceNum) {
8448 2267977 : spaceSumConvGainRate += state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).ConvectGainRate;
8449 : }
8450 1078288 : return spaceSumConvGainRate;
8451 : }
8452 :
8453 : // For HybridModel
8454 0 : Real64 SumAllInternalConvectionGainsExceptPeople(EnergyPlusData &state, int const ZoneNum)
8455 : {
8456 : // Return value
8457 0 : Real64 SumConvGainRateExceptPeople = 0.0;
8458 :
8459 0 : for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) {
8460 0 : if (state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices == 0) {
8461 0 : continue;
8462 : }
8463 0 : for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices; ++DeviceNum) {
8464 0 : if (state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).CompType != DataHeatBalance::IntGainType::People) {
8465 0 : SumConvGainRateExceptPeople += state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).ConvectGainRate;
8466 : }
8467 : }
8468 : }
8469 :
8470 0 : return SumConvGainRateExceptPeople;
8471 : }
8472 :
8473 823232 : Real64 SumInternalConvectionGainsByTypes(
8474 : EnergyPlusData &state,
8475 : int const ZoneNum, // zone index pointer for which zone to sum gains for
8476 : gsl::span<const DataHeatBalance::IntGainType> GainTypeARR, // variable length 1-d array of enum valued gain types
8477 : int const spaceIndex) // space index pointer, sum gains only for this space
8478 : {
8479 :
8480 : // SUBROUTINE INFORMATION:
8481 : // AUTHOR B. Griffith
8482 : // DATE WRITTEN Nov. 2011cl
8483 :
8484 : // PURPOSE OF THIS SUBROUTINE:
8485 : // worker routine for summing a subset of the internal gain types
8486 :
8487 : // Return value
8488 823232 : Real64 SumConvGainRate = 0.0;
8489 :
8490 823232 : int NumberOfTypes = GainTypeARR.size();
8491 :
8492 : // TODO MJW: This could be refactored to avoid duplicate code, but for now . . . .
8493 823232 : if (spaceIndex > 0) {
8494 1056058 : for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->spaceIntGainDevices(spaceIndex).numberOfDevices; ++DeviceNum) {
8495 6147909 : for (int TypeNum = 0; TypeNum < NumberOfTypes; ++TypeNum) {
8496 5464808 : if (state.dataHeatBal->spaceIntGainDevices(spaceIndex).device(DeviceNum).CompType == GainTypeARR[TypeNum]) {
8497 682419 : SumConvGainRate += state.dataHeatBal->spaceIntGainDevices(spaceIndex).device(DeviceNum).ConvectGainRate;
8498 : }
8499 : }
8500 : }
8501 : } else {
8502 936855 : for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) {
8503 486580 : if (state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices == 0) {
8504 90317 : continue;
8505 : }
8506 1334204 : for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices; ++DeviceNum) {
8507 8091379 : for (int TypeNum = 0; TypeNum < NumberOfTypes; ++TypeNum) {
8508 7153438 : if (state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).CompType == GainTypeARR[TypeNum]) {
8509 714278 : SumConvGainRate += state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).ConvectGainRate;
8510 : }
8511 : }
8512 : }
8513 : }
8514 : }
8515 :
8516 823232 : return SumConvGainRate;
8517 : }
8518 :
8519 318125 : Real64 zoneSumAllReturnAirConvectionGains(EnergyPlusData &state,
8520 : int const zoneNum, // zone index pointer to sum gains for
8521 : int const returnNodeNum // return air node number
8522 : )
8523 : {
8524 318125 : Real64 zoneSumReturnAirGainRate = 0.0;
8525 657637 : for (int spaceNum : state.dataHeatBal->Zone(zoneNum).spaceIndexes) {
8526 339512 : if (state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices == 0) continue;
8527 262168 : zoneSumReturnAirGainRate += InternalHeatGains::spaceSumAllReturnAirConvectionGains(state, spaceNum, returnNodeNum);
8528 : }
8529 :
8530 318125 : return zoneSumReturnAirGainRate;
8531 : }
8532 :
8533 262168 : Real64 spaceSumAllReturnAirConvectionGains(EnergyPlusData &state,
8534 : int const spaceNum, // space index pointer to sum gains for
8535 : int const returnNodeNum // return air node number
8536 : )
8537 : {
8538 :
8539 : // SUBROUTINE INFORMATION:
8540 : // AUTHOR B. Griffith
8541 : // DATE WRITTEN Dec. 2011
8542 :
8543 : // PURPOSE OF THIS SUBROUTINE:
8544 : // worker routine for summing all the internal gain types
8545 :
8546 262168 : Real64 spaceSumReturnAirGainRate = 0.0;
8547 :
8548 950826 : for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices; ++DeviceNum) {
8549 : // If ReturnNodeNum is zero, sum for entire zone, otherwise sum only for specified ReturnNodeNum
8550 688658 : if ((returnNodeNum == 0) || (returnNodeNum == state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).ReturnAirNodeNum)) {
8551 287944 : spaceSumReturnAirGainRate += state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).ReturnAirConvGainRate;
8552 : }
8553 : }
8554 :
8555 262168 : return spaceSumReturnAirGainRate;
8556 : }
8557 :
8558 28406 : Real64 SumReturnAirConvectionGainsByTypes(
8559 : EnergyPlusData &state,
8560 : int const ZoneNum, // zone index pointer for which zone to sum gains for
8561 : gsl::span<const DataHeatBalance::IntGainType> GainTypeARR, // variable length 1-d array of integer valued gain types
8562 : int const spaceIndex // space index pointer, sum gains only for this space
8563 : )
8564 : {
8565 :
8566 : // SUBROUTINE INFORMATION:
8567 : // AUTHOR B. Griffith
8568 : // DATE WRITTEN Nov. 2011
8569 :
8570 : // PURPOSE OF THIS SUBROUTINE:
8571 : // worker routine for summing a subset of the internal gain types
8572 :
8573 : // Return value
8574 28406 : Real64 SumReturnAirGainRate(0.0);
8575 :
8576 28406 : int NumberOfTypes = GainTypeARR.size();
8577 :
8578 : // TODO MJW: This could be refactored to avoid duplicate code, but for now . . . .
8579 28406 : if (spaceIndex > 0) {
8580 0 : for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->spaceIntGainDevices(spaceIndex).numberOfDevices; ++DeviceNum) {
8581 0 : for (int TypeNum = 0; TypeNum < NumberOfTypes; ++TypeNum) {
8582 0 : if (state.dataHeatBal->spaceIntGainDevices(spaceIndex).device(DeviceNum).CompType == GainTypeARR[TypeNum]) {
8583 0 : SumReturnAirGainRate += state.dataHeatBal->spaceIntGainDevices(spaceIndex).device(DeviceNum).ReturnAirConvGainRate;
8584 : }
8585 : }
8586 : }
8587 : } else {
8588 56812 : for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) {
8589 28406 : if (state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices == 0) {
8590 5400 : continue;
8591 : }
8592 :
8593 86730 : for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices; ++DeviceNum) {
8594 414206 : for (int TypeNum = 0; TypeNum < NumberOfTypes; ++TypeNum) {
8595 :
8596 350482 : if (state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).CompType == GainTypeARR[TypeNum]) {
8597 11513 : SumReturnAirGainRate += state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).ReturnAirConvGainRate;
8598 : }
8599 : }
8600 : }
8601 : }
8602 : }
8603 :
8604 28406 : return SumReturnAirGainRate;
8605 : }
8606 :
8607 372953 : Real64 SumAllSpaceInternalRadiationGains(EnergyPlusData &state,
8608 : int const spaceNum // space index pointer for which space to sum gains for
8609 : )
8610 : {
8611 :
8612 : // SUBROUTINE INFORMATION:
8613 : // AUTHOR B. Griffith
8614 : // DATE WRITTEN Nov. 2011
8615 :
8616 : // PURPOSE OF THIS SUBROUTINE:
8617 : // worker routine for summing all the internal gain types
8618 :
8619 : // Return value
8620 372953 : Real64 sumRadGainRate(0.0);
8621 :
8622 372953 : if (state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices == 0) {
8623 68717 : sumRadGainRate = 0.0;
8624 68717 : return sumRadGainRate;
8625 : }
8626 :
8627 987297 : for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices; ++DeviceNum) {
8628 683061 : sumRadGainRate += state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).RadiantGainRate;
8629 : }
8630 :
8631 304236 : return sumRadGainRate;
8632 : }
8633 :
8634 : Real64
8635 709609 : SumInternalRadiationGainsByTypes(EnergyPlusData &state,
8636 : int const ZoneNum, // zone index pointer for which zone to sum gains for
8637 : gsl::span<const DataHeatBalance::IntGainType> GainTypeARR, // variable length 1-d array of enum valued gain types
8638 : int const spaceIndex) // space index pointer, sum gains only for this space
8639 : {
8640 :
8641 : // SUBROUTINE INFORMATION:
8642 : // AUTHOR B. Griffith
8643 : // DATE WRITTEN Dec. 2011
8644 :
8645 : // PURPOSE OF THIS SUBROUTINE:
8646 : // worker routine for summing a subset of the internal gain types
8647 :
8648 : // Return value
8649 709609 : Real64 SumRadiationGainRate(0.0);
8650 :
8651 709609 : int NumberOfTypes = GainTypeARR.size();
8652 :
8653 : // TODO MJW: This could be refactored to avoid duplicate code, but for now . . . .
8654 709609 : if (spaceIndex > 0) {
8655 1056058 : for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->spaceIntGainDevices(spaceIndex).numberOfDevices; ++DeviceNum) {
8656 6147909 : for (int TypeNum = 0; TypeNum < NumberOfTypes; ++TypeNum) {
8657 5464808 : if (state.dataHeatBal->spaceIntGainDevices(spaceIndex).device(DeviceNum).CompType == GainTypeARR[TypeNum]) {
8658 682419 : SumRadiationGainRate += state.dataHeatBal->spaceIntGainDevices(spaceIndex).device(DeviceNum).RadiantGainRate;
8659 : }
8660 : }
8661 : }
8662 : } else {
8663 709609 : for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) {
8664 372957 : if (state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices == 0) {
8665 68717 : continue;
8666 : }
8667 987341 : for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices; ++DeviceNum) {
8668 6147909 : for (int TypeNum = 0; TypeNum < NumberOfTypes; ++TypeNum) {
8669 5464808 : if (state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).CompType == GainTypeARR[TypeNum]) {
8670 682419 : SumRadiationGainRate += state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).RadiantGainRate;
8671 : }
8672 : }
8673 : }
8674 : }
8675 : }
8676 :
8677 709609 : return SumRadiationGainRate;
8678 : }
8679 :
8680 71010 : Real64 SumEnclosureInternalRadiationGainsByTypes(
8681 : EnergyPlusData &state,
8682 : int const enclosureNum, // enclosure to sum gains for
8683 : gsl::span<const DataHeatBalance::IntGainType> GainTypeARR) // variable length 1-d array of enum valued gain types
8684 : {
8685 : // Return value
8686 71010 : Real64 SumRadiationGainRate(0.0);
8687 :
8688 71010 : int NumberOfTypes = GainTypeARR.size();
8689 :
8690 142020 : for (int spaceNum : state.dataViewFactor->EnclRadInfo(enclosureNum).spaceNums) {
8691 71010 : if (state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices == 0) {
8692 13500 : continue;
8693 : }
8694 216540 : for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices; ++DeviceNum) {
8695 1399464 : for (int TypeNum = 0; TypeNum < NumberOfTypes; ++TypeNum) {
8696 1240434 : if (state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).CompType == GainTypeARR[TypeNum]) {
8697 31806 : SumRadiationGainRate += state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).RadiantGainRate;
8698 : }
8699 : }
8700 : }
8701 : }
8702 :
8703 71010 : return SumRadiationGainRate;
8704 : }
8705 :
8706 754980 : void SumAllInternalLatentGains(EnergyPlusData &state,
8707 : int const ZoneNum // zone index pointer for which zone to sum gains for
8708 : )
8709 : {
8710 :
8711 : // SUBROUTINE INFORMATION:
8712 : // AUTHOR B. Griffith
8713 : // DATE WRITTEN Nov. 2011
8714 :
8715 : // PURPOSE OF THIS SUBROUTINE:
8716 : // worker routine for summing all the internal gain types
8717 :
8718 754980 : Real64 zoneLatentGainRate = 0.0;
8719 :
8720 1601314 : for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) {
8721 846334 : if (state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices == 0) {
8722 215929 : state.dataZoneTempPredictorCorrector->spaceHeatBalance(spaceNum).latentGain = 0.0;
8723 215929 : continue;
8724 : }
8725 :
8726 630405 : Real64 spaceLatentGainRate = 0.0;
8727 2052532 : for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices; ++DeviceNum) {
8728 1422127 : spaceLatentGainRate += state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).LatentGainRate;
8729 : }
8730 630405 : state.dataZoneTempPredictorCorrector->spaceHeatBalance(spaceNum).latentGain = spaceLatentGainRate;
8731 630405 : zoneLatentGainRate += spaceLatentGainRate;
8732 : }
8733 :
8734 754980 : state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).latentGain = zoneLatentGainRate;
8735 754980 : }
8736 :
8737 : // Added for hybrid model -- calculate the latent gain from all sources except for people
8738 0 : void SumAllInternalLatentGainsExceptPeople(EnergyPlusData &state,
8739 : int const ZoneNum // zone index pointer for which zone to sum gains for
8740 : )
8741 : {
8742 0 : Real64 zoneLatentGainRateExceptPeople(0.0);
8743 :
8744 0 : for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) {
8745 0 : if (state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices == 0) {
8746 0 : continue;
8747 : }
8748 :
8749 0 : Real64 spaceLatentGainRateExceptPeople = 0.0;
8750 0 : for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices; ++DeviceNum) {
8751 0 : if (state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).CompType != DataHeatBalance::IntGainType::People) {
8752 0 : spaceLatentGainRateExceptPeople += state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).LatentGainRate;
8753 : }
8754 : }
8755 0 : state.dataZoneTempPredictorCorrector->spaceHeatBalance(spaceNum).latentGainExceptPeople = spaceLatentGainRateExceptPeople;
8756 0 : zoneLatentGainRateExceptPeople += spaceLatentGainRateExceptPeople;
8757 : }
8758 :
8759 0 : state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).latentGainExceptPeople = zoneLatentGainRateExceptPeople;
8760 0 : }
8761 :
8762 : Real64
8763 766421 : SumInternalLatentGainsByTypes(EnergyPlusData &state,
8764 : int const ZoneNum, // zone index pointer for which zone to sum gains for
8765 : gsl::span<const DataHeatBalance::IntGainType> GainTypeARR, // variable length 1-d array of enum valued gain types
8766 : int const spaceIndex) // space index pointer, sum gains only for this space
8767 : {
8768 : // SUBROUTINE INFORMATION:
8769 : // AUTHOR B. Griffith
8770 : // DATE WRITTEN Dec. 2011
8771 :
8772 : // PURPOSE OF THIS SUBROUTINE:
8773 : // worker routine for summing a subset of the internal gain types
8774 :
8775 : // Return value
8776 766421 : Real64 SumLatentGainRate(0.0);
8777 :
8778 766421 : int NumberOfTypes = GainTypeARR.size();
8779 :
8780 : // TODO MJW: This could be refactored to avoid duplicate code, but for now . . . .
8781 766421 : if (spaceIndex > 0) {
8782 1056058 : for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->spaceIntGainDevices(spaceIndex).numberOfDevices; ++DeviceNum) {
8783 6147909 : for (int TypeNum = 0; TypeNum < NumberOfTypes; ++TypeNum) {
8784 5464808 : if (state.dataHeatBal->spaceIntGainDevices(spaceIndex).device(DeviceNum).CompType == GainTypeARR[TypeNum]) {
8785 682419 : SumLatentGainRate += state.dataHeatBal->spaceIntGainDevices(spaceIndex).device(DeviceNum).LatentGainRate;
8786 : }
8787 : }
8788 : }
8789 : } else {
8790 823233 : for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) {
8791 429769 : if (state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices == 0) {
8792 79517 : continue;
8793 : }
8794 1160801 : for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices; ++DeviceNum) {
8795 6944459 : for (int TypeNum = 0; TypeNum < NumberOfTypes; ++TypeNum) {
8796 6133910 : if (state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).CompType == GainTypeARR[TypeNum]) {
8797 702745 : SumLatentGainRate += state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).LatentGainRate;
8798 : }
8799 : }
8800 : }
8801 : }
8802 : }
8803 :
8804 766421 : return SumLatentGainRate;
8805 : }
8806 :
8807 268499 : Real64 SumAllReturnAirLatentGains(EnergyPlusData &state,
8808 : int const ZoneNum, // zone index pointer for which zone to sum gains for
8809 : int const ReturnNodeNum // return air node number
8810 : )
8811 : {
8812 :
8813 : // SUBROUTINE INFORMATION:
8814 : // AUTHOR B. Griffith
8815 : // DATE WRITTEN Nov. 2011
8816 :
8817 : // PURPOSE OF THIS SUBROUTINE:
8818 : // worker routine for summing all the internal gain types
8819 :
8820 268499 : Real64 SumRetAirLatentGainRate(0.0);
8821 :
8822 558193 : for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) {
8823 289694 : if (state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices == 0) {
8824 63796 : continue;
8825 : }
8826 :
8827 820770 : for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices; ++DeviceNum) {
8828 : // If ReturnNodeNum is zero, sum for entire zone, otherwise sum only for specified ReturnNodeNum
8829 594872 : if ((ReturnNodeNum == 0) || (ReturnNodeNum == state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).ReturnAirNodeNum)) {
8830 194158 : SumRetAirLatentGainRate += state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).ReturnAirLatentGainRate;
8831 : }
8832 : }
8833 : }
8834 :
8835 268499 : return SumRetAirLatentGainRate;
8836 : }
8837 :
8838 0 : Real64 SumAllInternalCO2Gains(EnergyPlusData &state,
8839 : int const ZoneNum // zone index pointer for which zone to sum gains for
8840 : )
8841 : {
8842 :
8843 : // SUBROUTINE INFORMATION:
8844 : // AUTHOR B. Griffith
8845 : // DATE WRITTEN Dec. 2011
8846 :
8847 : // PURPOSE OF THIS SUBROUTINE:
8848 : // worker routine for summing all the internal gain types
8849 :
8850 : // Return value
8851 0 : Real64 SumCO2GainRate(0.0);
8852 :
8853 0 : for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) {
8854 0 : if (state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices == 0) {
8855 0 : continue;
8856 : }
8857 :
8858 0 : for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices; ++DeviceNum) {
8859 0 : SumCO2GainRate += state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).CarbonDioxideGainRate;
8860 : }
8861 : }
8862 :
8863 0 : return SumCO2GainRate;
8864 : }
8865 :
8866 : // Added for hybrid model -- function for calculating CO2 gains except people
8867 0 : Real64 SumAllInternalCO2GainsExceptPeople(EnergyPlusData &state,
8868 : int const ZoneNum // zone index pointer for which zone to sum gains for
8869 : )
8870 : {
8871 : // Return value
8872 0 : Real64 SumCO2GainRateExceptPeople(0.0);
8873 :
8874 0 : for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) {
8875 0 : if (state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices == 0) {
8876 0 : continue;
8877 : }
8878 :
8879 0 : for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices; ++DeviceNum) {
8880 0 : if (state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).CompType != DataHeatBalance::IntGainType::People) {
8881 0 : SumCO2GainRateExceptPeople += state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).CarbonDioxideGainRate;
8882 : }
8883 : }
8884 : }
8885 :
8886 0 : return SumCO2GainRateExceptPeople;
8887 : }
8888 :
8889 : Real64
8890 0 : SumInternalCO2GainsByTypes(EnergyPlusData &state,
8891 : int const ZoneNum, // zone index pointer for which zone to sum gains for
8892 : gsl::span<const DataHeatBalance::IntGainType> GainTypeARR // variable length 1-d array of integer valued gain types
8893 : )
8894 : {
8895 :
8896 : // SUBROUTINE INFORMATION:
8897 : // AUTHOR B. Griffith
8898 : // DATE WRITTEN Dec. 2011
8899 :
8900 : // PURPOSE OF THIS SUBROUTINE:
8901 : // worker routine for summing a subset of the internal gain types
8902 :
8903 : // Return value
8904 0 : Real64 SumCO2GainRate(0.0);
8905 :
8906 0 : int NumberOfTypes = GainTypeARR.size();
8907 :
8908 0 : for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) {
8909 0 : if (state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices == 0) {
8910 0 : continue;
8911 : }
8912 :
8913 0 : for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices; ++DeviceNum) {
8914 0 : for (int TypeNum = 0; TypeNum < NumberOfTypes; ++TypeNum) {
8915 :
8916 0 : if (state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).CompType == GainTypeARR[TypeNum]) {
8917 0 : SumCO2GainRate += state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).CarbonDioxideGainRate;
8918 : }
8919 : }
8920 : }
8921 : }
8922 :
8923 0 : return SumCO2GainRate;
8924 : }
8925 :
8926 0 : Real64 SumAllInternalGenericContamGains(EnergyPlusData &state,
8927 : int const ZoneNum // zone index pointer for which zone to sum gains for
8928 : )
8929 : {
8930 :
8931 : // SUBROUTINE INFORMATION:
8932 : // AUTHOR L. Gu
8933 : // DATE WRITTEN Feb. 2012
8934 :
8935 : // PURPOSE OF THIS SUBROUTINE:
8936 : // worker routine for summing all the internal gain types based on the existing subroutine SumAllInternalCO2Gains
8937 :
8938 : // Return value
8939 0 : Real64 SumGCGainRate(0.0);
8940 :
8941 0 : for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) {
8942 0 : if (state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices == 0) {
8943 0 : continue;
8944 : }
8945 :
8946 0 : for (int DeviceNum = 1; DeviceNum <= state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices; ++DeviceNum) {
8947 0 : SumGCGainRate += state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).GenericContamGainRate;
8948 : }
8949 : }
8950 :
8951 0 : return SumGCGainRate;
8952 : }
8953 :
8954 83023 : void GatherComponentLoadsIntGain(EnergyPlusData &state)
8955 : {
8956 : // SUBROUTINE INFORMATION:
8957 : // AUTHOR Jason Glazer
8958 : // DATE WRITTEN September 2012
8959 : // MODIFIED na
8960 : // RE-ENGINEERED na
8961 :
8962 : // PURPOSE OF THIS SUBROUTINE:
8963 : // Gather values during sizing used for loads component report.
8964 :
8965 : // METHODOLOGY EMPLOYED:
8966 : // Save sequence of values for report during sizing.
8967 :
8968 : // Using/Aliasing
8969 : using namespace DataHeatBalance;
8970 :
8971 83023 : if (state.dataGlobal->CompLoadReportIsReq && !state.dataGlobal->isPulseZoneSizing) {
8972 7453 : int TimeStepInDay = (state.dataGlobal->HourOfDay - 1) * state.dataGlobal->TimeStepsInHour + state.dataGlobal->TimeStep;
8973 21656 : for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) {
8974 14203 : auto &znCLDayTS = state.dataOutRptTab->znCompLoads[state.dataSize->CurOverallSimDay - 1].ts[TimeStepInDay - 1].spacezone[iZone - 1];
8975 14203 : gatherCompLoadIntGain2(state, znCLDayTS, iZone);
8976 : }
8977 21655 : for (int iEncl = 1; iEncl <= state.dataViewFactor->NumOfRadiantEnclosures; ++iEncl) {
8978 14202 : auto &enclCLDayTS = state.dataOutRptTab->enclCompLoads[state.dataSize->CurOverallSimDay - 1].ts[TimeStepInDay - 1].encl[iEncl - 1];
8979 14202 : enclCLDayTS.peopleRadSeq = SumEnclosureInternalRadiationGainsByTypes(state, iEncl, IntGainTypesPeople);
8980 14202 : enclCLDayTS.lightLWRadSeq = SumEnclosureInternalRadiationGainsByTypes(state, iEncl, IntGainTypesLight);
8981 14202 : enclCLDayTS.equipRadSeq = SumEnclosureInternalRadiationGainsByTypes(state, iEncl, IntGainTypesEquip);
8982 14202 : enclCLDayTS.hvacLossRadSeq = SumEnclosureInternalRadiationGainsByTypes(state, iEncl, IntGainTypesHvacLoss);
8983 14202 : enclCLDayTS.powerGenRadSeq = SumEnclosureInternalRadiationGainsByTypes(state, iEncl, IntGainTypesPowerGen);
8984 : }
8985 7453 : if (state.dataHeatBal->doSpaceHeatBalanceSizing) {
8986 0 : for (int iSpace = 1; iSpace <= state.dataGlobal->NumOfZones; ++iSpace) {
8987 : auto &spCLDayTS =
8988 0 : state.dataOutRptTab->spCompLoads[state.dataSize->CurOverallSimDay - 1].ts[TimeStepInDay - 1].spacezone[iSpace - 1];
8989 0 : gatherCompLoadIntGain2(state, spCLDayTS, state.dataHeatBal->space(iSpace).zoneNum, iSpace);
8990 : }
8991 : }
8992 : }
8993 83023 : }
8994 :
8995 : void
8996 14203 : gatherCompLoadIntGain2(EnergyPlusData &state, OutputReportTabular::compLoadsSpaceZone &szCompLoadDayTS, int const zoneNum, int const spaceNum)
8997 : {
8998 : // Make sure all types of internal gains have been gathered
8999 113624 : assert((int)(size(IntGainTypesPeople) + size(IntGainTypesLight) + size(IntGainTypesEquip) + size(IntGainTypesRefrig) +
9000 : size(IntGainTypesWaterUse) + size(IntGainTypesHvacLoss) + size(IntGainTypesPowerGen) + size(ExcludedIntGainTypes)) ==
9001 : (int)DataHeatBalance::IntGainType::Num);
9002 :
9003 14203 : szCompLoadDayTS.peopleInstantSeq = SumInternalConvectionGainsByTypes(state, zoneNum, IntGainTypesPeople, spaceNum);
9004 14203 : szCompLoadDayTS.peopleLatentSeq = SumInternalLatentGainsByTypes(state, zoneNum, IntGainTypesPeople, spaceNum);
9005 :
9006 14203 : szCompLoadDayTS.lightInstantSeq = SumInternalConvectionGainsByTypes(state, zoneNum, IntGainTypesLight, spaceNum);
9007 14203 : szCompLoadDayTS.lightRetAirSeq = SumReturnAirConvectionGainsByTypes(state, zoneNum, IntGainTypesLight, spaceNum);
9008 :
9009 14203 : szCompLoadDayTS.equipInstantSeq = SumInternalConvectionGainsByTypes(state, zoneNum, IntGainTypesEquip, spaceNum);
9010 14203 : szCompLoadDayTS.equipLatentSeq = SumInternalLatentGainsByTypes(state, zoneNum, IntGainTypesEquip, spaceNum);
9011 :
9012 14203 : szCompLoadDayTS.refrigInstantSeq = SumInternalConvectionGainsByTypes(state, zoneNum, IntGainTypesRefrig, spaceNum);
9013 14203 : szCompLoadDayTS.refrigRetAirSeq = SumReturnAirConvectionGainsByTypes(state, zoneNum, IntGainTypesRefrig, spaceNum);
9014 14203 : szCompLoadDayTS.refrigLatentSeq = SumInternalLatentGainsByTypes(state, zoneNum, IntGainTypesRefrig, spaceNum);
9015 :
9016 14203 : szCompLoadDayTS.waterUseInstantSeq = SumInternalConvectionGainsByTypes(state, zoneNum, IntGainTypesWaterUse, spaceNum);
9017 14203 : szCompLoadDayTS.waterUseLatentSeq = SumInternalLatentGainsByTypes(state, zoneNum, IntGainTypesWaterUse, spaceNum);
9018 :
9019 14203 : szCompLoadDayTS.hvacLossInstantSeq = SumInternalConvectionGainsByTypes(state, zoneNum, IntGainTypesHvacLoss, spaceNum);
9020 :
9021 14203 : szCompLoadDayTS.powerGenInstantSeq = SumInternalConvectionGainsByTypes(state, zoneNum, IntGainTypesPowerGen, spaceNum);
9022 14203 : }
9023 :
9024 21 : int GetInternalGainDeviceIndex(EnergyPlusData &state,
9025 : int const spaceNum, // space index pointer for which space to sum gains for
9026 : DataHeatBalance::IntGainType const intGainType, // space internal gain type enum
9027 : std::string_view const intGainName) // Internal gain name
9028 : {
9029 :
9030 : // SUBROUTINE INFORMATION:
9031 : // AUTHOR B. Griffith
9032 : // DATE WRITTEN June 2012
9033 :
9034 : // PURPOSE OF THIS SUBROUTINE:
9035 : // utility to retrieve index pointer to a specific internal gain
9036 : // the subroutine returns the index of matched internal gain device or -1 if no match found.
9037 :
9038 : int DeviceNum;
9039 : int DeviceIndex;
9040 21 : if (state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices == 0) {
9041 0 : DeviceIndex = -1;
9042 0 : return DeviceIndex;
9043 : }
9044 48 : for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices; ++DeviceNum) {
9045 63 : if ((Util::SameString(state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).CompObjectName, intGainName.data())) &&
9046 18 : (state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).CompType == intGainType)) {
9047 18 : DeviceIndex = DeviceNum;
9048 18 : break;
9049 : } else {
9050 27 : DeviceIndex = -1;
9051 : }
9052 : }
9053 21 : return DeviceIndex;
9054 : }
9055 :
9056 3 : Real64 SumInternalConvectionGainsByIndices(
9057 : EnergyPlusData &state,
9058 : int const numGains, // number of device gains to sum
9059 : const Array1D_int &deviceSpaceARR, // variable length 1-d array of integer space index pointers to include in summation
9060 : const Array1D_int &deviceIndexARR, // variable length 1-d array of integer device index pointers to include in summation
9061 : const Array1D<Real64> &fractionARR // array of fractional multipliers to apply to devices
9062 : )
9063 : {
9064 :
9065 : // SUBROUTINE INFORMATION:
9066 : // AUTHOR B. Griffith
9067 : // DATE WRITTEN June 2012
9068 :
9069 : // PURPOSE OF THIS SUBROUTINE:
9070 : // worker routine for summing a subset of the internal gains by index
9071 :
9072 : // Return value
9073 3 : Real64 sumConvGainRate(0.0);
9074 :
9075 3 : assert(numGains <= isize(deviceSpaceARR));
9076 3 : assert(numGains <= isize(deviceIndexARR));
9077 3 : assert(numGains <= isize(fractionARR));
9078 :
9079 6 : for (int loop = 1; loop <= numGains; ++loop) {
9080 3 : int spaceNum = deviceSpaceARR(loop);
9081 3 : int deviceNum = deviceIndexARR(loop);
9082 3 : Real64 deviceFraction = fractionARR(loop);
9083 3 : sumConvGainRate += state.dataHeatBal->spaceIntGainDevices(spaceNum).device(deviceNum).ConvectGainRate * deviceFraction;
9084 : }
9085 3 : return sumConvGainRate;
9086 : }
9087 :
9088 3 : Real64 SumInternalLatentGainsByIndices(
9089 : EnergyPlusData &state,
9090 : int const numGains, // number of device gains to sum
9091 : const Array1D_int &deviceSpaceARR, // variable length 1-d array of integer space index pointers to include in summation
9092 : const Array1D_int &deviceIndexARR, // variable length 1-d array of integer device index pointers to include in summation
9093 : const Array1D<Real64> &fractionARR // array of fractional multipliers to apply to devices
9094 : )
9095 : {
9096 :
9097 : // SUBROUTINE INFORMATION:
9098 : // AUTHOR B. Griffith
9099 : // DATE WRITTEN June 2012
9100 :
9101 : // PURPOSE OF THIS SUBROUTINE:
9102 : // worker routine for summing a subset of the internal gains by index
9103 :
9104 : // Return value
9105 3 : Real64 sumLatentGainRate(0.0);
9106 :
9107 3 : assert(numGains <= isize(deviceSpaceARR));
9108 3 : assert(numGains <= isize(deviceIndexARR));
9109 3 : assert(numGains <= isize(fractionARR));
9110 :
9111 6 : for (int loop = 1; loop <= numGains; ++loop) {
9112 3 : int spaceNum = deviceSpaceARR(loop);
9113 3 : int deviceNum = deviceIndexARR(loop);
9114 3 : Real64 deviceFraction = fractionARR(loop);
9115 3 : sumLatentGainRate =
9116 3 : sumLatentGainRate + state.dataHeatBal->spaceIntGainDevices(spaceNum).device(deviceNum).LatentGainRate * deviceFraction;
9117 : }
9118 3 : return sumLatentGainRate;
9119 : }
9120 :
9121 0 : Real64 SumReturnAirConvectionGainsByIndices(
9122 : EnergyPlusData &state,
9123 : int const numGains, // number of device gains to sum
9124 : const Array1D_int &deviceSpaceARR, // variable length 1-d array of integer space index pointers to include in summation
9125 : const Array1D_int &deviceIndexARR, // variable length 1-d array of integer device index pointers to include in summation
9126 : const Array1D<Real64> &fractionARR // array of fractional multipliers to apply to devices
9127 : )
9128 : {
9129 :
9130 : // SUBROUTINE INFORMATION:
9131 : // AUTHOR B. Griffith
9132 : // DATE WRITTEN June 2012
9133 :
9134 : // PURPOSE OF THIS SUBROUTINE:
9135 : // worker routine for summing a subset of the internal gains by index
9136 :
9137 : // Return value
9138 0 : Real64 sumReturnAirGainRate(0.0);
9139 :
9140 0 : assert(numGains <= isize(deviceSpaceARR));
9141 0 : assert(numGains <= isize(deviceIndexARR));
9142 0 : assert(numGains <= isize(fractionARR));
9143 :
9144 0 : for (int loop = 1; loop <= numGains; ++loop) {
9145 0 : int spaceNum = deviceSpaceARR(loop);
9146 0 : int deviceNum = deviceIndexARR(loop);
9147 0 : Real64 deviceFraction = fractionARR(loop);
9148 0 : sumReturnAirGainRate =
9149 0 : sumReturnAirGainRate + state.dataHeatBal->spaceIntGainDevices(spaceNum).device(deviceNum).ReturnAirConvGainRate * deviceFraction;
9150 : }
9151 0 : return sumReturnAirGainRate;
9152 : }
9153 : } // namespace InternalHeatGains
9154 :
9155 : } // namespace EnergyPlus
|