From 7acc071e9e89bab79e716f1823c6ecb701c7cf7b Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Wed, 7 Oct 2020 16:12:41 -0600 Subject: [PATCH 01/15] moving DataGlobals to state --- src/EnergyPlus/DataGlobalConstants.hh | 19 ++- src/EnergyPlus/DataGlobals.cc | 38 ----- src/EnergyPlus/DataGlobals.hh | 35 +---- src/EnergyPlus/EMSManager.cc | 2 +- src/EnergyPlus/HVACManager.cc | 5 +- src/EnergyPlus/HeatBalanceAirManager.cc | 6 +- src/EnergyPlus/MicroCHPElectricGenerator.cc | 2 +- src/EnergyPlus/SimAirServingZones.cc | 11 +- src/EnergyPlus/SimAirServingZones.hh | 3 +- src/EnergyPlus/SizingManager.cc | 31 +++-- src/EnergyPlus/SizingManager.hh | 2 +- src/EnergyPlus/SystemAvailabilityManager.cc | 4 +- src/EnergyPlus/ZoneEquipmentManager.cc | 14 +- src/EnergyPlus/ZoneEquipmentManager.hh | 3 +- src/EnergyPlus/api/runtime.cc | 145 ++++++++++---------- 15 files changed, 128 insertions(+), 192 deletions(-) diff --git a/src/EnergyPlus/DataGlobalConstants.hh b/src/EnergyPlus/DataGlobalConstants.hh index 158ad0311c8..4f1f164020f 100644 --- a/src/EnergyPlus/DataGlobalConstants.hh +++ b/src/EnergyPlus/DataGlobalConstants.hh @@ -239,19 +239,18 @@ namespace DataGlobalConstants { extern int const iEvapCoolerInDirectRDDSpecial; extern int const iEvapCoolerDirectResearchSpecial; - // DERIVED TYPE DEFINITIONS: - // na + enum class CallIndicator { + BeginDay = 1, + DuringDay = 2, + EndDay = 3, + EndZoneSizingCalc = 4, + EndSysSizingCalc = 5 + }; - // MODULE VARIABLE DECLARATIONS: - // na - - // SUBROUTINE SPECIFICATIONS FOR MODULE DataGlobalConstants - - // Functions + Real64 constexpr MaxEXPArg () { return 709.78; } // maximum exponent in EXP() function int AssignResourceTypeNum(std::string const &ResourceTypeChar); - - std::string GetResourceTypeChar(int const ResourceTypeNum); + std::string GetResourceTypeChar(int ResourceTypeNum); } // namespace DataGlobalConstants diff --git a/src/EnergyPlus/DataGlobals.cc b/src/EnergyPlus/DataGlobals.cc index 6f5904a4055..c197ee63970 100644 --- a/src/EnergyPlus/DataGlobals.cc +++ b/src/EnergyPlus/DataGlobals.cc @@ -52,7 +52,6 @@ #include // EnergyPlus Headers -#include #include #include @@ -73,40 +72,6 @@ namespace DataGlobals { // This data-only module is a repository for all variables which are considered // to be "global" in nature in EnergyPlus. - // METHODOLOGY EMPLOYED: - // na - - // REFERENCES: - // na - - // OTHER NOTES: - // na - - // Using/Aliasing - - // Data - // -only module should be available to other modules and routines. - // Thus, all variables in this module must be PUBLIC. -// bool runReadVars(false); -// bool DDOnlySimulation(false); -// bool outputEpJSONConversion(false); -// bool outputEpJSONConversionOnly(false); -// bool isEpJSON(false); -// bool isCBOR(false); -// bool isMsgPack(false); -// bool isUBJSON(false); -// bool isBSON(false); -// bool preserveIDFOrder(true); -// bool stopSimulation(false); - std::function externalHVACManager; - bool externalHVACManagerInitialized(false); - - // MODULE PARAMETER DEFINITIONS: - int const BeginDay(1); - int const DuringDay(2); - int const EndDay(3); - int const EndSysSizingCalc(5); - // Parameters for KindOfSim int const ksDesignDay(1); int const ksRunPeriodDesign(2); @@ -115,7 +80,6 @@ namespace DataGlobals { int const ksHVACSizeRunPeriodDesign(5); // a weather period design day run during HVAC Sizing Simulation int const ksReadAllWeatherData(6); // a weather period for reading all weather data prior to the simulation - Real64 const MaxEXPArg(709.78); // maximum exponent in EXP() function Real64 const Pi(3.14159265358979324); // Pi 3.1415926535897932384626435 Real64 const PiOvr2(Pi / 2.0); // Pi/2 Real64 const TwoPi(2.0 * Pi); // 2*Pi 6.2831853071795864769252868 @@ -262,8 +226,6 @@ namespace DataGlobals { // Needed for unit tests, should not be normally called. void clear_state(IOFiles &ioFiles) { - externalHVACManager = nullptr; - externalHVACManagerInitialized = false; BeginDayFlag = false; BeginEnvrnFlag = false; BeginHourFlag = false; diff --git a/src/EnergyPlus/DataGlobals.hh b/src/EnergyPlus/DataGlobals.hh index 2708ee106bd..22959ae7d52 100644 --- a/src/EnergyPlus/DataGlobals.hh +++ b/src/EnergyPlus/DataGlobals.hh @@ -69,26 +69,6 @@ namespace DataGlobals { // -only module should be available to other modules and routines. // Thus, all variables in this module must be PUBLIC. -// extern bool runReadVars; -// extern bool DDOnlySimulation; -// extern bool outputEpJSONConversion; -// extern bool outputEpJSONConversionOnly; -// extern bool isEpJSON; -// extern bool isCBOR; -// extern bool isMsgPack; -// extern bool isUBJSON; -// extern bool isBSON; -// extern bool preserveIDFOrder; -// extern bool stopSimulation; - extern std::function externalHVACManager; - extern bool externalHVACManagerInitialized; - - // MODULE PARAMETER DEFINITIONS: - extern int const BeginDay; - extern int const DuringDay; - extern int const EndDay; - extern int const EndSysSizingCalc; - // Parameters for KindOfSim extern int const ksDesignDay; extern int const ksRunPeriodDesign; @@ -97,7 +77,6 @@ namespace DataGlobals { extern int const ksHVACSizeRunPeriodDesign; // a weather period design day run during HVAC Sizing Simulation extern int const ksReadAllWeatherData; // a weather period for reading all weather data prior to the simulation - extern Real64 const MaxEXPArg; // maximum exponent in EXP() function extern Real64 const Pi; // Pi 3.1415926535897932384626435 extern Real64 const PiOvr2; // Pi/2 extern Real64 const TwoPi; // 2*Pi 6.2831853071795864769252868 @@ -149,15 +128,6 @@ namespace DataGlobals { extern int const ScheduleAlwaysOn; // Value when passed to schedule routines gives back 1.0 (on) - // DERIVED TYPE DEFINITIONS: - // na - - // INTERFACE BLOCK SPECIFICATIONS: - // see DataOmterfaces fpr global interface statements - - // MODULE VARIABLE DECLARATIONS: - - extern bool BeginDayFlag; // True at the start of each day, False after first time step in day extern bool BeginEnvrnFlag; // True at the start of each environment, False after first time step in environ extern bool beginEnvrnWarmStartFlag; // Sizing Speed Up true if at the start of each environment, would rather retain thermal history and the like. @@ -263,7 +233,8 @@ namespace DataGlobals { bool preserveIDFOrder = true; bool stopSimulation= false; - static constexpr int EndZoneSizingCalc = 4; + std::function externalHVACManager; + bool externalHVACManagerInitialized = false; void clear_state() override { this->AnnualSimulation = false; @@ -279,6 +250,8 @@ namespace DataGlobals { this->isBSON = false; this->preserveIDFOrder = true; this->stopSimulation= false; + this->externalHVACManager = nullptr; + this->externalHVACManagerInitialized = false; } }; diff --git a/src/EnergyPlus/EMSManager.cc b/src/EnergyPlus/EMSManager.cc index c37c888069c..be67a88dc3d 100644 --- a/src/EnergyPlus/EMSManager.cc +++ b/src/EnergyPlus/EMSManager.cc @@ -227,7 +227,7 @@ namespace EMSManager { AnyEnergyManagementSystemInModel = false; } - AnyEnergyManagementSystemInModel = AnyEnergyManagementSystemInModel || DataGlobals::externalHVACManager; + AnyEnergyManagementSystemInModel = AnyEnergyManagementSystemInModel || state.dataGlobal->externalHVACManager; if (AnyEnergyManagementSystemInModel) { diff --git a/src/EnergyPlus/HVACManager.cc b/src/EnergyPlus/HVACManager.cc index 9872c59d197..a5ed1698363 100644 --- a/src/EnergyPlus/HVACManager.cc +++ b/src/EnergyPlus/HVACManager.cc @@ -135,7 +135,6 @@ namespace HVACManager { using DataGlobals::DayOfSim; using DataGlobals::DisplayExtraWarnings; using DataGlobals::DoOutputReporting; - using DataGlobals::DuringDay; using DataGlobals::emsCallFromAfterHVACManagers; using DataGlobals::emsCallFromBeforeHVACManagers; using DataGlobals::emsCallFromBeginTimestepBeforePredictor; @@ -542,8 +541,8 @@ namespace HVACManager { UpdateTabularReports(state, OutputProcessor::TimeStepType::TimeStepSystem); } if (ZoneSizingCalc) { - UpdateZoneSizing(state, DuringDay); - UpdateFacilitySizing(state, DuringDay); + UpdateZoneSizing(state, DataGlobalConstants::CallIndicator::DuringDay); + UpdateFacilitySizing(state, DataGlobalConstants::CallIndicator::DuringDay); } EIRPlantLoopHeatPumps::EIRPlantLoopHeatPump::checkConcurrentOperation(); } else if (!KickOffSimulation && DoOutputReporting && ReportDuringWarmup) { diff --git a/src/EnergyPlus/HeatBalanceAirManager.cc b/src/EnergyPlus/HeatBalanceAirManager.cc index a51d50f8725..73cf78077b0 100644 --- a/src/EnergyPlus/HeatBalanceAirManager.cc +++ b/src/EnergyPlus/HeatBalanceAirManager.cc @@ -4226,11 +4226,11 @@ namespace HeatBalanceAirManager { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: // na - if(DataGlobals::externalHVACManager) { - if (!DataGlobals::externalHVACManagerInitialized) { + if(state.dataGlobal->externalHVACManager) { + if (!state.dataGlobal->externalHVACManagerInitialized) { initializeForExternalHVACManager(state); } - DataGlobals::externalHVACManager(&state); + state.dataGlobal->externalHVACManager(&state); } else { ManageHVAC(state); } diff --git a/src/EnergyPlus/MicroCHPElectricGenerator.cc b/src/EnergyPlus/MicroCHPElectricGenerator.cc index 455238b3451..648a1c37f8b 100644 --- a/src/EnergyPlus/MicroCHPElectricGenerator.cc +++ b/src/EnergyPlus/MicroCHPElectricGenerator.cc @@ -1198,7 +1198,7 @@ namespace MicroCHPElectricGenerator { Real64 a = (MdotCpcw * TcwIn / MCcw) + (UAHX * Teng / MCcw); Real64 b = ((-1.0 * MdotCpcw / MCcw) + (-1.0 * UAHX / MCcw)); - if (b * time < (-1.0 * DataGlobals::MaxEXPArg)) { + if (b * time < (-1.0 * DataGlobalConstants::MaxEXPArg())) { return -a / b; } else { return (TcwoutLast + a / b) * std::exp(b * time) - a / b; diff --git a/src/EnergyPlus/SimAirServingZones.cc b/src/EnergyPlus/SimAirServingZones.cc index 25e4ce050f6..10c9925e89c 100644 --- a/src/EnergyPlus/SimAirServingZones.cc +++ b/src/EnergyPlus/SimAirServingZones.cc @@ -68,6 +68,7 @@ #include #include #include +#include #include #include #include @@ -5297,7 +5298,7 @@ namespace SimAirServingZones { // have moved std 62.1 table report writing to ManageSystemVentilationAdjustments in SizingManager } - void UpdateSysSizing(EnergyPlusData &state, int const CallIndicator) + void UpdateSysSizing(EnergyPlusData &state, DataGlobalConstants::CallIndicator const CallIndicator) { // SUBROUTINE INFORMATION: @@ -5444,7 +5445,7 @@ namespace SimAirServingZones { { auto const SELECT_CASE_var(CallIndicator); - if (SELECT_CASE_var == BeginDay) { + if (SELECT_CASE_var == DataGlobalConstants::CallIndicator::BeginDay) { // Correct the zone return temperature in ZoneSizing for the case of induction units. The calc in // ZoneEquipmentManager assumes all the air entering the zone goes into the return node. @@ -5525,7 +5526,7 @@ namespace SimAirServingZones { } // End of begin day loop over primary air systems - } else if (SELECT_CASE_var == DuringDay) { + } else if (SELECT_CASE_var == DataGlobalConstants::CallIndicator::DuringDay) { TimeStepInDay = (HourOfDay - 1) * NumOfTimeStepInHour + TimeStep; // calculate current zone time step index @@ -5886,7 +5887,7 @@ namespace SimAirServingZones { } // end of loop over primary air systems - } else if (SELECT_CASE_var == EndDay) { + } else if (SELECT_CASE_var == DataGlobalConstants::CallIndicator::EndDay) { // the entire set of std. 62.1 code here seems misplaced, should have been placed in EndSysSizCalc block // Get design flows @@ -6430,7 +6431,7 @@ namespace SimAirServingZones { } } - } else if (SELECT_CASE_var == EndSysSizingCalc) { + } else if (SELECT_CASE_var == DataGlobalConstants::CallIndicator::EndSysSizingCalc) { // Correct the zone return temperature in FinalZoneSizing for the case of induction units. The calc in // ZoneEquipmentManager assumes all the air entering the zone goes into the return node. diff --git a/src/EnergyPlus/SimAirServingZones.hh b/src/EnergyPlus/SimAirServingZones.hh index 77649443e92..c2ce6789bf3 100644 --- a/src/EnergyPlus/SimAirServingZones.hh +++ b/src/EnergyPlus/SimAirServingZones.hh @@ -52,6 +52,7 @@ #include // EnergyPlus Headers +#include #include #include @@ -195,7 +196,7 @@ namespace SimAirServingZones { void SizeSysOutdoorAir(EnergyPlusData &state); - void UpdateSysSizing(EnergyPlusData &state, int const CallIndicator); + void UpdateSysSizing(EnergyPlusData &state, DataGlobalConstants::CallIndicator const CallIndicator); void UpdateSysSizingForScalableInputs(int const AirLoopNum); diff --git a/src/EnergyPlus/SizingManager.cc b/src/EnergyPlus/SizingManager.cc index d43f1eb5932..38d81a5cfbf 100644 --- a/src/EnergyPlus/SizingManager.cc +++ b/src/EnergyPlus/SizingManager.cc @@ -55,6 +55,7 @@ #include #include #include +#include #include #include #include @@ -359,8 +360,8 @@ namespace SizingManager { DisplayString("...for Sizing Period: #" + RoundSigDigits(NumSizingPeriodsPerformed) + ' ' + EnvironmentName); } } - UpdateZoneSizing(state, BeginDay); - UpdateFacilitySizing(state, BeginDay); + UpdateZoneSizing(state, DataGlobalConstants::CallIndicator::BeginDay); + UpdateFacilitySizing(state, DataGlobalConstants::CallIndicator::BeginDay); } for (HourOfDay = 1; HourOfDay <= 24; ++HourOfDay) { // Begin hour loop ... @@ -419,8 +420,8 @@ namespace SizingManager { } // ... End hour loop. if (EndDayFlag) { - UpdateZoneSizing(state, EndDay); - UpdateFacilitySizing(state, EndDay); + UpdateZoneSizing(state, DataGlobalConstants::CallIndicator::EndDay); + UpdateFacilitySizing(state, DataGlobalConstants::CallIndicator::EndDay); } if (!WarmupFlag && (DayOfSim > 0) && (DayOfSim < NumOfDayInEnvrn)) { @@ -435,8 +436,8 @@ namespace SizingManager { } // ... End environment loop if (NumSizingPeriodsPerformed > 0) { - UpdateZoneSizing(state, state.dataGlobal->EndZoneSizingCalc); - UpdateFacilitySizing(state, state.dataGlobal->EndZoneSizingCalc); + UpdateZoneSizing(state, DataGlobalConstants::CallIndicator::EndZoneSizingCalc); + UpdateFacilitySizing(state, DataGlobalConstants::CallIndicator::EndZoneSizingCalc); ZoneSizingRunDone = true; } else { ShowSevereError(RoutineName + "No Sizing periods were performed for Zone Sizing. No Zone Sizing calculations saved."); @@ -542,7 +543,7 @@ namespace SizingManager { DisplayString("Calculating System sizing"); DisplayString("...for Sizing Period: #" + RoundSigDigits(NumSizingPeriodsPerformed) + ' ' + EnvironmentName); } - UpdateSysSizing(state, BeginDay); + UpdateSysSizing(state, DataGlobalConstants::CallIndicator::BeginDay); } for (HourOfDay = 1; HourOfDay <= 24; ++HourOfDay) { // Begin hour loop ... @@ -571,7 +572,7 @@ namespace SizingManager { ManageWeather(state); - UpdateSysSizing(state, DuringDay); + UpdateSysSizing(state, DataGlobalConstants::CallIndicator::DuringDay); BeginHourFlag = false; BeginDayFlag = false; @@ -583,7 +584,7 @@ namespace SizingManager { } // ... End hour loop. - if (EndDayFlag) UpdateSysSizing(state, EndDay); + if (EndDayFlag) UpdateSysSizing(state, DataGlobalConstants::CallIndicator::EndDay); if (!WarmupFlag && (DayOfSim > 0) && (DayOfSim < NumOfDayInEnvrn)) { ++CurOverallSimDay; @@ -594,7 +595,7 @@ namespace SizingManager { } // ... End environment loop if (NumSizingPeriodsPerformed > 0) { - UpdateSysSizing(state, EndSysSizingCalc); + UpdateSysSizing(state, DataGlobalConstants::CallIndicator::EndSysSizingCalc); SysSizingRunDone = true; } else { ShowSevereError(RoutineName + "No Sizing periods were performed for System Sizing. No System Sizing calculations saved."); @@ -4799,7 +4800,7 @@ namespace SizingManager { } // Update the sizing for the entire facilty to gather values for reporting - Glazer January 2017 - void UpdateFacilitySizing(EnergyPlusData &state, int const CallIndicator) + void UpdateFacilitySizing(EnergyPlusData &EP_UNUSED(state), DataGlobalConstants::CallIndicator const CallIndicator) { int NumOfTimeStepInDay = NumOfTimeStepInHour * 24; @@ -4853,10 +4854,10 @@ namespace SizingManager { CalcFinalFacilitySizing.HeatZoneTempSeq = 0.; CalcFinalFacilitySizing.HeatLoadSeq = 0.; } - if (CallIndicator == BeginDay) { + if (CallIndicator == DataGlobalConstants::CallIndicator::BeginDay) { CalcFacilitySizing(CurOverallSimDay).HeatDDNum = CurOverallSimDay; CalcFacilitySizing(CurOverallSimDay).CoolDDNum = CurOverallSimDay; - } else if (CallIndicator == DuringDay) { + } else if (CallIndicator == DataGlobalConstants::CallIndicator::DuringDay) { int TimeStepInDay = (HourOfDay - 1) * NumOfTimeStepInHour + TimeStep; // save the results of the ideal zone component calculation in the CalcZoneSizing sequence variables Real64 sumCoolLoad = 0.; @@ -4899,7 +4900,7 @@ namespace SizingManager { CalcFacilitySizing(CurOverallSimDay).HeatOutHumRatSeq(TimeStepInDay) = wghtdHeatHumRat / sumHeatLoad; } - } else if (CallIndicator == EndDay) { + } else if (CallIndicator == DataGlobalConstants::CallIndicator::EndDay) { for (int TimeStepIndex = 1; TimeStepIndex <= NumOfTimeStepInDay; ++TimeStepIndex) { if (CalcFacilitySizing(CurOverallSimDay).CoolLoadSeq(TimeStepIndex) > CalcFacilitySizing(CurOverallSimDay).DesCoolLoad) { CalcFacilitySizing(CurOverallSimDay).DesCoolLoad = CalcFacilitySizing(CurOverallSimDay).CoolLoadSeq(TimeStepIndex); @@ -4911,7 +4912,7 @@ namespace SizingManager { } } - } else if (CallIndicator == state.dataGlobal->EndZoneSizingCalc) { + } else if (CallIndicator == DataGlobalConstants::CallIndicator::EndZoneSizingCalc) { for (int DDNum = 1; DDNum <= DataEnvironment::TotDesDays + DataEnvironment::TotRunDesPersDays; ++DDNum) { if (CalcFacilitySizing(DDNum).DesCoolLoad > CalcFinalFacilitySizing.DesCoolLoad) { CalcFinalFacilitySizing.DesCoolLoad = CalcFacilitySizing(DDNum).DesCoolLoad; diff --git a/src/EnergyPlus/SizingManager.hh b/src/EnergyPlus/SizingManager.hh index 95371a4a0f8..3cb9c0b9cfa 100644 --- a/src/EnergyPlus/SizingManager.hh +++ b/src/EnergyPlus/SizingManager.hh @@ -177,7 +177,7 @@ namespace SizingManager { std::string TimeIndexToHrMinString(int timeIndex); - void UpdateFacilitySizing(EnergyPlusData &state, int const CallIndicator); + void UpdateFacilitySizing(EnergyPlusData &state, DataGlobalConstants::CallIndicator const CallIndicator); void UpdateTermUnitFinalZoneSizing(); diff --git a/src/EnergyPlus/SystemAvailabilityManager.cc b/src/EnergyPlus/SystemAvailabilityManager.cc index 5f64a2a3454..c208fa2c8e9 100644 --- a/src/EnergyPlus/SystemAvailabilityManager.cc +++ b/src/EnergyPlus/SystemAvailabilityManager.cc @@ -3157,7 +3157,7 @@ namespace SystemAvailabilityManager { if (WarmupFlag) { AdaTempGradHeat = OptStartMgr.InitTGradHeat; AdaTempGradCool = OptStartMgr.InitTGradCool; - } else if (DayOfSim == BeginDay && BeginDayFlag) { + } else if (DayOfSim == DataGlobalConstants::CallIndicator::BeginDay && BeginDayFlag) { OptStart_AdaTempGradTrdHeat = OptStartMgr.InitTGradHeat; AdaTempGradHeat = OptStartMgr.InitTGradHeat; OptStart_AdaTempGradTrdCool = OptStartMgr.InitTGradCool; @@ -3429,7 +3429,7 @@ namespace SystemAvailabilityManager { if (WarmupFlag) { AdaTempGradHeat = OptStartMgr.InitTGradHeat; AdaTempGradCool = OptStartMgr.InitTGradCool; - } else if (DayOfSim == BeginDay && BeginDayFlag) { + } else if (DayOfSim == DataGlobalConstants::CallIndicator::BeginDay && BeginDayFlag) { OptStart_AdaTempGradTrdHeat = OptStartMgr.InitTGradHeat; AdaTempGradHeat = OptStartMgr.InitTGradHeat; OptStart_AdaTempGradTrdCool = OptStartMgr.InitTGradCool; diff --git a/src/EnergyPlus/ZoneEquipmentManager.cc b/src/EnergyPlus/ZoneEquipmentManager.cc index 0ef4166c791..7c073c4081d 100644 --- a/src/EnergyPlus/ZoneEquipmentManager.cc +++ b/src/EnergyPlus/ZoneEquipmentManager.cc @@ -68,6 +68,7 @@ #include #include #include +#include #include #include #include @@ -1402,7 +1403,7 @@ namespace ZoneEquipmentManager { } } - void UpdateZoneSizing(EnergyPlusData &state, int const CallIndicator) + void UpdateZoneSizing(EnergyPlusData &state, DataGlobalConstants::CallIndicator const CallIndicator) { // SUBROUTINE INFORMATION: @@ -1424,10 +1425,7 @@ namespace ZoneEquipmentManager { using DataEnvironment::StdBaroPress; using DataEnvironment::StdRhoAir; using DataGlobals::AnyEnergyManagementSystemInModel; - using DataGlobals::BeginDay; - using DataGlobals::DuringDay; using DataGlobals::emsCallFromZoneSizing; - using DataGlobals::EndDay; using DataGlobals::HourOfDay; using DataGlobals::isPulseZoneSizing; using DataGlobals::MinutesPerTimeStep; @@ -1473,7 +1471,7 @@ namespace ZoneEquipmentManager { { auto const SELECT_CASE_var(CallIndicator); - if (SELECT_CASE_var == BeginDay) { + if (SELECT_CASE_var == DataGlobalConstants::CallIndicator::BeginDay) { for (CtrlZoneNum = 1; CtrlZoneNum <= NumOfZones; ++CtrlZoneNum) { @@ -1487,7 +1485,7 @@ namespace ZoneEquipmentManager { CalcZoneSizing(CurOverallSimDay, CtrlZoneNum).CoolDDNum = CurOverallSimDay; } - } else if (SELECT_CASE_var == DuringDay) { + } else if (SELECT_CASE_var == DataGlobalConstants::CallIndicator::DuringDay) { TimeStepInDay = (HourOfDay - 1) * NumOfTimeStepInHour + TimeStep; @@ -1552,7 +1550,7 @@ namespace ZoneEquipmentManager { CalcZoneSizing(CurOverallSimDay, CtrlZoneNum).DOASTotCoolLoad * FracTimeStepZone; } - } else if (SELECT_CASE_var == EndDay) { + } else if (SELECT_CASE_var == DataGlobalConstants::CallIndicator::EndDay) { // average some of the zone sequences to reduce peakiness for (CtrlZoneNum = 1; CtrlZoneNum <= NumOfZones; ++CtrlZoneNum) { if (!ZoneEquipConfig(CtrlZoneNum).IsControlled) continue; @@ -1784,7 +1782,7 @@ namespace ZoneEquipmentManager { } } - } else if (SELECT_CASE_var == state.dataGlobal->EndZoneSizingCalc) { + } else if (SELECT_CASE_var == DataGlobalConstants::CallIndicator::EndZoneSizingCalc) { // candidate EMS calling point to customize CalcFinalZoneSizing bool anyEMSRan; diff --git a/src/EnergyPlus/ZoneEquipmentManager.hh b/src/EnergyPlus/ZoneEquipmentManager.hh index 42d46da21e6..d342129f242 100644 --- a/src/EnergyPlus/ZoneEquipmentManager.hh +++ b/src/EnergyPlus/ZoneEquipmentManager.hh @@ -55,6 +55,7 @@ // EnergyPlus Headers #include #include +#include #include namespace EnergyPlus { @@ -97,7 +98,7 @@ namespace ZoneEquipmentManager { void RezeroZoneSizingArrays(); - void UpdateZoneSizing(EnergyPlusData &state, int const CallIndicator); + void UpdateZoneSizing(EnergyPlusData &state, DataGlobalConstants::CallIndicator const CallIndicator); void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool &SimAir); diff --git a/src/EnergyPlus/api/runtime.cc b/src/EnergyPlus/api/runtime.cc index 8608a8894e4..eda0e6a022e 100644 --- a/src/EnergyPlus/api/runtime.cc +++ b/src/EnergyPlus/api/runtime.cc @@ -63,8 +63,8 @@ int energyplus(EnergyPlusState state, int argc, const char *argv[]) { // argv[5] = "-i"; // argv[6] = epcomp->iddPath.c_str(); // argv[7] = epcomp->idfInputPath.c_str(); - auto *this_state = reinterpret_cast(state); - return runEnergyPlusAsLibrary(*this_state, argc, argv); + auto *thisState = reinterpret_cast(state); + return runEnergyPlusAsLibrary(*thisState, argc, argv); } void stopSimulation(EnergyPlusState state) { @@ -97,8 +97,9 @@ void registerStdOutCallback(EnergyPlusState state, void (*f)(const char *)) { registerStdOutCallback(state, std::function(stdf)); } -void registerExternalHVACManager(EnergyPlusState EP_UNUSED(state), std::function f) { - EnergyPlus::DataGlobals::externalHVACManager = f; +void registerExternalHVACManager(EnergyPlusState state, std::function f) { + auto *thisState = reinterpret_cast(state); + thisState->dataGlobal->externalHVACManager = f; } void registerExternalHVACManager(EnergyPlusState state, void (*f)(EnergyPlusState)) { @@ -106,163 +107,163 @@ void registerExternalHVACManager(EnergyPlusState state, void (*f)(EnergyPlusStat } void callbackBeginNewEnvironment(EnergyPlusState state, std::function const &f) { - auto *this_state = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*this_state, EnergyPlus::DataGlobals::emsCallFromBeginNewEvironment, f); + auto *thisState = reinterpret_cast(state); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromBeginNewEvironment, f); } void callbackBeginNewEnvironment(EnergyPlusState state, void (*f)(EnergyPlusState)) { - auto *this_state = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*this_state, EnergyPlus::DataGlobals::emsCallFromBeginNewEvironment, f); + auto *thisState = reinterpret_cast(state); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromBeginNewEvironment, f); } void callbackBeginZoneTimestepBeforeSetCurrentWeather(EnergyPlusState state, std::function const& f) { - auto* this_state = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*this_state, EnergyPlus::DataGlobals::emsCallFromBeginZoneTimestepBeforeSetCurrentWeather, f); + auto* thisState = reinterpret_cast(state); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromBeginZoneTimestepBeforeSetCurrentWeather, f); } void callbackBeginZoneTimestepBeforeSetCurrentWeather(EnergyPlusState state, void (*f)(EnergyPlusState)) { - auto* this_state = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*this_state, EnergyPlus::DataGlobals::emsCallFromBeginZoneTimestepBeforeSetCurrentWeather, f); + auto* thisState = reinterpret_cast(state); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromBeginZoneTimestepBeforeSetCurrentWeather, f); } void callbackAfterNewEnvironmentWarmupComplete(EnergyPlusState state, std::function const &f) { - auto *this_state = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*this_state, EnergyPlus::DataGlobals::emsCallFromBeginNewEvironmentAfterWarmUp, f); + auto *thisState = reinterpret_cast(state); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromBeginNewEvironmentAfterWarmUp, f); } void callbackAfterNewEnvironmentWarmupComplete(EnergyPlusState state, void (*f)(EnergyPlusState)) { - auto *this_state = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*this_state, EnergyPlus::DataGlobals::emsCallFromBeginNewEvironmentAfterWarmUp, f); + auto *thisState = reinterpret_cast(state); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromBeginNewEvironmentAfterWarmUp, f); } void callbackBeginZoneTimeStepBeforeInitHeatBalance(EnergyPlusState state, std::function const &f) { - auto *this_state = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*this_state, EnergyPlus::DataGlobals::emsCallFromBeginZoneTimestepBeforeInitHeatBalance, f); + auto *thisState = reinterpret_cast(state); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromBeginZoneTimestepBeforeInitHeatBalance, f); } void callbackBeginZoneTimeStepBeforeInitHeatBalance(EnergyPlusState state, void (*f)(EnergyPlusState)) { - auto *this_state = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*this_state, EnergyPlus::DataGlobals::emsCallFromBeginZoneTimestepBeforeInitHeatBalance, f); + auto *thisState = reinterpret_cast(state); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromBeginZoneTimestepBeforeInitHeatBalance, f); } void callbackBeginZoneTimeStepAfterInitHeatBalance(EnergyPlusState state, std::function const &f) { - auto *this_state = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*this_state, EnergyPlus::DataGlobals::emsCallFromBeginZoneTimestepAfterInitHeatBalance, f); + auto *thisState = reinterpret_cast(state); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromBeginZoneTimestepAfterInitHeatBalance, f); } void callbackBeginZoneTimeStepAfterInitHeatBalance(EnergyPlusState state, void (*f)(EnergyPlusState)) { - auto *this_state = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*this_state, EnergyPlus::DataGlobals::emsCallFromBeginZoneTimestepAfterInitHeatBalance, f); + auto *thisState = reinterpret_cast(state); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromBeginZoneTimestepAfterInitHeatBalance, f); } void callbackBeginTimeStepBeforePredictor(EnergyPlusState state, std::function const &f) { - auto *this_state = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*this_state, EnergyPlus::DataGlobals::emsCallFromBeginTimestepBeforePredictor, f); + auto *thisState = reinterpret_cast(state); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromBeginTimestepBeforePredictor, f); } void callbackBeginTimeStepBeforePredictor(EnergyPlusState state, void (*f)(EnergyPlusState)) { - auto *this_state = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*this_state, EnergyPlus::DataGlobals::emsCallFromBeginTimestepBeforePredictor, f); + auto *thisState = reinterpret_cast(state); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromBeginTimestepBeforePredictor, f); } void callbackAfterPredictorBeforeHVACManagers(EnergyPlusState state, std::function const &f) { - auto *this_state = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*this_state, EnergyPlus::DataGlobals::emsCallFromBeforeHVACManagers, f); + auto *thisState = reinterpret_cast(state); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromBeforeHVACManagers, f); } void callbackAfterPredictorBeforeHVACManagers(EnergyPlusState state, void (*f)(EnergyPlusState)) { - auto *this_state = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*this_state, EnergyPlus::DataGlobals::emsCallFromBeforeHVACManagers, f); + auto *thisState = reinterpret_cast(state); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromBeforeHVACManagers, f); } void callbackAfterPredictorAfterHVACManagers(EnergyPlusState state, std::function const &f) { - auto *this_state = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*this_state, EnergyPlus::DataGlobals::emsCallFromAfterHVACManagers, f); + auto *thisState = reinterpret_cast(state); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromAfterHVACManagers, f); } void callbackAfterPredictorAfterHVACManagers(EnergyPlusState state, void (*f)(EnergyPlusState)) { - auto *this_state = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*this_state, EnergyPlus::DataGlobals::emsCallFromAfterHVACManagers, f); + auto *thisState = reinterpret_cast(state); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromAfterHVACManagers, f); } void callbackInsideSystemIterationLoop(EnergyPlusState state, std::function const &f) { - auto *this_state = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*this_state, EnergyPlus::DataGlobals::emsCallFromHVACIterationLoop, f); + auto *thisState = reinterpret_cast(state); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromHVACIterationLoop, f); } void callbackInsideSystemIterationLoop(EnergyPlusState state, void (*f)(EnergyPlusState)) { - auto *this_state = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*this_state, EnergyPlus::DataGlobals::emsCallFromHVACIterationLoop, f); + auto *thisState = reinterpret_cast(state); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromHVACIterationLoop, f); } void callbackEndOfZoneTimeStepBeforeZoneReporting(EnergyPlusState state, std::function const &f) { - auto *this_state = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*this_state, EnergyPlus::DataGlobals::emsCallFromEndZoneTimestepBeforeZoneReporting, f); + auto *thisState = reinterpret_cast(state); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromEndZoneTimestepBeforeZoneReporting, f); } void callbackEndOfZoneTimeStepBeforeZoneReporting(EnergyPlusState state, void (*f)(EnergyPlusState)) { - auto *this_state = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*this_state, EnergyPlus::DataGlobals::emsCallFromEndZoneTimestepBeforeZoneReporting, f); + auto *thisState = reinterpret_cast(state); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromEndZoneTimestepBeforeZoneReporting, f); } void callbackEndOfZoneTimeStepAfterZoneReporting(EnergyPlusState state, std::function const &f) { - auto *this_state = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*this_state, EnergyPlus::DataGlobals::emsCallFromEndZoneTimestepAfterZoneReporting, f); + auto *thisState = reinterpret_cast(state); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromEndZoneTimestepAfterZoneReporting, f); } void callbackEndOfZoneTimeStepAfterZoneReporting(EnergyPlusState state, void (*f)(EnergyPlusState)) { - auto *this_state = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*this_state, EnergyPlus::DataGlobals::emsCallFromEndZoneTimestepAfterZoneReporting, f); + auto *thisState = reinterpret_cast(state); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromEndZoneTimestepAfterZoneReporting, f); } void callbackEndOfSystemTimeStepBeforeHVACReporting(EnergyPlusState state, std::function const &f) { - auto *this_state = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*this_state, EnergyPlus::DataGlobals::emsCallFromEndSystemTimestepBeforeHVACReporting, f); + auto *thisState = reinterpret_cast(state); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromEndSystemTimestepBeforeHVACReporting, f); } void callbackEndOfSystemTimeStepBeforeHVACReporting(EnergyPlusState state, void (*f)(EnergyPlusState)) { - auto *this_state = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*this_state, EnergyPlus::DataGlobals::emsCallFromEndSystemTimestepBeforeHVACReporting, f); + auto *thisState = reinterpret_cast(state); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromEndSystemTimestepBeforeHVACReporting, f); } void callbackEndOfSystemTimeStepAfterHVACReporting(EnergyPlusState state, std::function const &f) { - auto *this_state = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*this_state, EnergyPlus::DataGlobals::emsCallFromEndSystemTimestepAfterHVACReporting, f); + auto *thisState = reinterpret_cast(state); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromEndSystemTimestepAfterHVACReporting, f); } void callbackEndOfSystemTimeStepAfterHVACReporting(EnergyPlusState state, void (*f)(EnergyPlusState)) { - auto *this_state = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*this_state, EnergyPlus::DataGlobals::emsCallFromEndSystemTimestepAfterHVACReporting, f); + auto *thisState = reinterpret_cast(state); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromEndSystemTimestepAfterHVACReporting, f); } void callbackEndOfZoneSizing(EnergyPlusState state, std::function const &f) { - auto *this_state = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*this_state, EnergyPlus::DataGlobals::emsCallFromZoneSizing, f); + auto *thisState = reinterpret_cast(state); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromZoneSizing, f); } void callbackEndOfZoneSizing(EnergyPlusState state, void (*f)(EnergyPlusState)) { - auto *this_state = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*this_state, EnergyPlus::DataGlobals::emsCallFromZoneSizing, f); + auto *thisState = reinterpret_cast(state); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromZoneSizing, f); } void callbackEndOfSystemSizing(EnergyPlusState state, std::function const &f) { - auto *this_state = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*this_state, EnergyPlus::DataGlobals::emsCallFromSystemSizing, f); + auto *thisState = reinterpret_cast(state); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromSystemSizing, f); } void callbackEndOfSystemSizing(EnergyPlusState state, void (*f)(EnergyPlusState)) { - auto *this_state = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*this_state, EnergyPlus::DataGlobals::emsCallFromSystemSizing, f); + auto *thisState = reinterpret_cast(state); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromSystemSizing, f); } void callbackEndOfAfterComponentGetInput(EnergyPlusState state, std::function const &f) { - auto *this_state = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*this_state, EnergyPlus::DataGlobals::emsCallFromComponentGetInput, f); + auto *thisState = reinterpret_cast(state); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromComponentGetInput, f); } void callbackEndOfAfterComponentGetInput(EnergyPlusState state, void (*f)(EnergyPlusState)) { - auto *this_state = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*this_state, EnergyPlus::DataGlobals::emsCallFromComponentGetInput, f); + auto *thisState = reinterpret_cast(state); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromComponentGetInput, f); } //void callbackUserDefinedComponentModel(EnergyPlusState state, std::function f) { @@ -274,11 +275,11 @@ void callbackEndOfAfterComponentGetInput(EnergyPlusState state, void (*f)(Energy //} void callbackUnitarySystemSizing(EnergyPlusState state, std::function const &f) { - auto *this_state = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*this_state, EnergyPlus::DataGlobals::emsCallFromUnitarySystemSizing, f); + auto *thisState = reinterpret_cast(state); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromUnitarySystemSizing, f); } void callbackUnitarySystemSizing(EnergyPlusState state, void (*f)(EnergyPlusState)) { - auto *this_state = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*this_state, EnergyPlus::DataGlobals::emsCallFromUnitarySystemSizing, f); + auto *thisState = reinterpret_cast(state); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromUnitarySystemSizing, f); } From 221c76df457c3d179ca9aa185f78cce8c2f6c712 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Wed, 7 Oct 2020 16:26:21 -0600 Subject: [PATCH 02/15] cast call indicator --- src/EnergyPlus/SystemAvailabilityManager.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/EnergyPlus/SystemAvailabilityManager.cc b/src/EnergyPlus/SystemAvailabilityManager.cc index c208fa2c8e9..fab243a3ef0 100644 --- a/src/EnergyPlus/SystemAvailabilityManager.cc +++ b/src/EnergyPlus/SystemAvailabilityManager.cc @@ -55,13 +55,14 @@ #include // EnergyPlus Headers +#include #include #include #include #include -#include #include #include +#include #include #include #include @@ -3157,7 +3158,7 @@ namespace SystemAvailabilityManager { if (WarmupFlag) { AdaTempGradHeat = OptStartMgr.InitTGradHeat; AdaTempGradCool = OptStartMgr.InitTGradCool; - } else if (DayOfSim == DataGlobalConstants::CallIndicator::BeginDay && BeginDayFlag) { + } else if (DayOfSim == static_cast(DataGlobalConstants::CallIndicator::BeginDay) && BeginDayFlag) { OptStart_AdaTempGradTrdHeat = OptStartMgr.InitTGradHeat; AdaTempGradHeat = OptStartMgr.InitTGradHeat; OptStart_AdaTempGradTrdCool = OptStartMgr.InitTGradCool; @@ -3429,7 +3430,7 @@ namespace SystemAvailabilityManager { if (WarmupFlag) { AdaTempGradHeat = OptStartMgr.InitTGradHeat; AdaTempGradCool = OptStartMgr.InitTGradCool; - } else if (DayOfSim == DataGlobalConstants::CallIndicator::BeginDay && BeginDayFlag) { + } else if (DayOfSim == static_cast(DataGlobalConstants::CallIndicator::BeginDay) && BeginDayFlag) { OptStart_AdaTempGradTrdHeat = OptStartMgr.InitTGradHeat; AdaTempGradHeat = OptStartMgr.InitTGradHeat; OptStart_AdaTempGradTrdCool = OptStartMgr.InitTGradCool; From 3faeb9b1fcf9b9045fe9044445003793ae05974a Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Thu, 8 Oct 2020 14:03:17 -0600 Subject: [PATCH 03/15] moving CallIndicator and KindOfSim to enums --- src/EnergyPlus/DataGlobalConstants.hh | 21 +++-- src/EnergyPlus/DataGlobals.cc | 10 --- src/EnergyPlus/DataGlobals.hh | 13 +-- src/EnergyPlus/DaylightingManager.cc | 6 +- src/EnergyPlus/EconomicTariff.cc | 4 +- src/EnergyPlus/ExteriorEnergyUse.cc | 4 +- src/EnergyPlus/ExternalInterface.cc | 14 +-- .../FiniteDifferenceGroundTemperatureModel.cc | 8 +- src/EnergyPlus/HVACManager.cc | 7 +- src/EnergyPlus/HVACSizingSimulationManager.cc | 10 +-- src/EnergyPlus/HeatBalanceManager.cc | 10 +-- src/EnergyPlus/HeatBalanceSurfaceManager.cc | 18 ++-- src/EnergyPlus/HeatBalanceSurfaceManager.hh | 6 +- src/EnergyPlus/InternalHeatGains.cc | 6 +- src/EnergyPlus/InternalHeatGains.hh | 2 +- src/EnergyPlus/OutputReportTabular.cc | 12 +-- src/EnergyPlus/SQLiteProcedures.cc | 4 +- src/EnergyPlus/SQLiteProcedures.hh | 2 +- src/EnergyPlus/SimulationManager.cc | 16 ++-- src/EnergyPlus/SizingAnalysisObjects.cc | 22 +++-- src/EnergyPlus/SizingAnalysisObjects.hh | 4 +- src/EnergyPlus/SizingManager.cc | 21 +++-- src/EnergyPlus/SizingManager.hh | 2 +- src/EnergyPlus/SolarShading.cc | 4 +- src/EnergyPlus/SystemAvailabilityManager.cc | 4 +- src/EnergyPlus/ThermalComfort.cc | 20 ++--- src/EnergyPlus/ThermalComfort.hh | 2 +- src/EnergyPlus/WeatherManager.cc | 86 +++++++++---------- src/EnergyPlus/WeatherManager.hh | 5 +- src/EnergyPlus/ZoneTempPredictorCorrector.cc | 2 +- src/EnergyPlus/api/datatransfer.cc | 5 +- tst/EnergyPlus/unit/EconomicTariff.unit.cc | 2 +- .../unit/HVACSizingSimulationManager.unit.cc | 34 ++++---- .../unit/HeatBalanceSurfaceManager.unit.cc | 24 +++--- .../unit/OutputReportTabular.unit.cc | 6 +- tst/EnergyPlus/unit/SQLite.unit.cc | 12 +-- .../unit/SizingAnalysisObjects.unit.cc | 44 +++++----- tst/EnergyPlus/unit/SizingManager.unit.cc | 33 ++++--- tst/EnergyPlus/unit/SolarShading.unit.cc | 2 +- tst/EnergyPlus/unit/WeatherManager.unit.cc | 2 +- .../unit/ZoneTempPredictorCorrector.unit.cc | 2 +- 41 files changed, 244 insertions(+), 267 deletions(-) diff --git a/src/EnergyPlus/DataGlobalConstants.hh b/src/EnergyPlus/DataGlobalConstants.hh index 4f1f164020f..4ffe3802d4b 100644 --- a/src/EnergyPlus/DataGlobalConstants.hh +++ b/src/EnergyPlus/DataGlobalConstants.hh @@ -240,11 +240,22 @@ namespace DataGlobalConstants { extern int const iEvapCoolerDirectResearchSpecial; enum class CallIndicator { - BeginDay = 1, - DuringDay = 2, - EndDay = 3, - EndZoneSizingCalc = 4, - EndSysSizingCalc = 5 + BeginDay, + DuringDay, + EndDay, + EndZoneSizingCalc, + EndSysSizingCalc + }; + + // Parameters for KindOfSim + enum class KindOfSim { + Unassigned = 0, + DesignDay = 1, + RunPeriodDesign = 2, + RunPeriodWeather = 3, + HVACSizeDesignDay = 4, // a regular design day run during HVAC Sizing Simulation + HVACSizeRunPeriodDesign = 5, // a weather period design day run during HVAC Sizing Simulation + ReadAllWeatherData = 6 // a weather period for reading all weather data prior to the simulation }; Real64 constexpr MaxEXPArg () { return 709.78; } // maximum exponent in EXP() function diff --git a/src/EnergyPlus/DataGlobals.cc b/src/EnergyPlus/DataGlobals.cc index c197ee63970..60a75ead756 100644 --- a/src/EnergyPlus/DataGlobals.cc +++ b/src/EnergyPlus/DataGlobals.cc @@ -72,14 +72,6 @@ namespace DataGlobals { // This data-only module is a repository for all variables which are considered // to be "global" in nature in EnergyPlus. - // Parameters for KindOfSim - int const ksDesignDay(1); - int const ksRunPeriodDesign(2); - int const ksRunPeriodWeather(3); - int const ksHVACSizeDesignDay(4); // a regular design day run during HVAC Sizing Simulation - int const ksHVACSizeRunPeriodDesign(5); // a weather period design day run during HVAC Sizing Simulation - int const ksReadAllWeatherData(6); // a weather period for reading all weather data prior to the simulation - Real64 const Pi(3.14159265358979324); // Pi 3.1415926535897932384626435 Real64 const PiOvr2(Pi / 2.0); // Pi/2 Real64 const TwoPi(2.0 * Pi); // 2*Pi 6.2831853071795864769252868 @@ -176,7 +168,6 @@ namespace DataGlobals { bool DoHVACSizingSimulation(false); // User input in SimulationControl object int HVACSizingSimMaxIterations(0); // User input in SimulationControl object bool WeathSimReq(false); // Input has a RunPeriod request - int KindOfSim(0); // See parameters. (ksDesignDay, ksRunPeriodDesign, ksRunPeriodWeather) bool DoOutputReporting(false); // TRUE if variables to be written out bool DoingSizing(false); // TRUE when "sizing" is being performed (some error messages won't be displayed) bool DoingHVACSizingSimulations(false); // true when HVAC Sizing Simulations are being performed. @@ -268,7 +259,6 @@ namespace DataGlobals { DoHVACSizingSimulation = false; HVACSizingSimMaxIterations = 0; WeathSimReq = false; - KindOfSim = 0; DoOutputReporting = false; DoingSizing = false; DoingHVACSizingSimulations = false; diff --git a/src/EnergyPlus/DataGlobals.hh b/src/EnergyPlus/DataGlobals.hh index 22959ae7d52..e6942b088d5 100644 --- a/src/EnergyPlus/DataGlobals.hh +++ b/src/EnergyPlus/DataGlobals.hh @@ -56,6 +56,7 @@ // EnergyPlus Headers #include "IOFiles.hh" #include +#include #include namespace EnergyPlus { @@ -69,14 +70,6 @@ namespace DataGlobals { // -only module should be available to other modules and routines. // Thus, all variables in this module must be PUBLIC. - // Parameters for KindOfSim - extern int const ksDesignDay; - extern int const ksRunPeriodDesign; - extern int const ksRunPeriodWeather; - extern int const ksHVACSizeDesignDay; // a regular design day run during HVAC Sizing Simulation - extern int const ksHVACSizeRunPeriodDesign; // a weather period design day run during HVAC Sizing Simulation - extern int const ksReadAllWeatherData; // a weather period for reading all weather data prior to the simulation - extern Real64 const Pi; // Pi 3.1415926535897932384626435 extern Real64 const PiOvr2; // Pi/2 extern Real64 const TwoPi; // 2*Pi 6.2831853071795864769252868 @@ -166,7 +159,6 @@ namespace DataGlobals { extern bool DoHVACSizingSimulation; // User input in SimulationControl object extern int HVACSizingSimMaxIterations; // User input in SimulationControl object extern bool WeathSimReq; // Input has a RunPeriod request - extern int KindOfSim; // See parameters. (ksDesignDay, ksRunPeriodDesign, ksRunPeriodWeather) extern bool DoOutputReporting; // TRUE if variables to be written out extern bool DoingSizing; // TRUE when "sizing" is being performed (some error messages won't be displayed) extern bool DoingHVACSizingSimulations; // true when HVAC Sizing Simulations are being performed. @@ -232,9 +224,9 @@ namespace DataGlobals { bool isBSON= false; bool preserveIDFOrder = true; bool stopSimulation= false; - std::function externalHVACManager; bool externalHVACManagerInitialized = false; + DataGlobalConstants::KindOfSim KindOfSim = DataGlobalConstants::KindOfSim::Unassigned; void clear_state() override { this->AnnualSimulation = false; @@ -252,6 +244,7 @@ namespace DataGlobals { this->stopSimulation= false; this->externalHVACManager = nullptr; this->externalHVACManagerInitialized = false; + KindOfSim = DataGlobalConstants::KindOfSim::Unassigned; } }; diff --git a/src/EnergyPlus/DaylightingManager.cc b/src/EnergyPlus/DaylightingManager.cc index f831aff4a31..104a14a0dec 100644 --- a/src/EnergyPlus/DaylightingManager.cc +++ b/src/EnergyPlus/DaylightingManager.cc @@ -757,8 +757,6 @@ namespace DaylightingManager { } } - // TH 7/2010 report all daylight factors for the two reference points of daylight zones ... - // Skip if no daylight windows if (TotWindowsWithDayl == 0) return; @@ -772,12 +770,12 @@ namespace DaylightingManager { if (DFSReportSizingDays) { if (DoWeathSim && DoDesDaySim) { - if (KindOfSim == ksRunPeriodWeather) return; + if (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather) return; } } if (DFSReportAllShadowCalculationDays) { - if (KindOfSim != ksRunPeriodWeather) return; + if (state.dataGlobal->KindOfSim != DataGlobalConstants::KindOfSim::RunPeriodWeather) return; } // open a new file eplusout.dfs for saving the daylight factors diff --git a/src/EnergyPlus/EconomicTariff.cc b/src/EnergyPlus/EconomicTariff.cc index 55701ada1cd..576bc4123d8 100644 --- a/src/EnergyPlus/EconomicTariff.cc +++ b/src/EnergyPlus/EconomicTariff.cc @@ -328,8 +328,6 @@ namespace EconomicTariff { // routines for economics. using DataGlobals::DoOutputReporting; - using DataGlobals::KindOfSim; - using DataGlobals::ksRunPeriodWeather; using OutputReportTabular::AddTOCEntry; using OutputReportTabular::displayEconomicResultSummary; @@ -353,7 +351,7 @@ namespace EconomicTariff { Update_GetInput = false; if (ErrorsFound) ShowFatalError("UpdateUtilityBills: Preceding errors cause termination."); } - if (DoOutputReporting && (KindOfSim == ksRunPeriodWeather)) { + if (DoOutputReporting && (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather)) { GatherForEconomics(); } } diff --git a/src/EnergyPlus/ExteriorEnergyUse.cc b/src/EnergyPlus/ExteriorEnergyUse.cc index b3328a95e97..634df44d9ee 100644 --- a/src/EnergyPlus/ExteriorEnergyUse.cc +++ b/src/EnergyPlus/ExteriorEnergyUse.cc @@ -545,8 +545,6 @@ namespace ExteriorEnergyUse { // Using/Aliasing using DataEnvironment::SunIsUp; using DataGlobals::DoOutputReporting; - using DataGlobals::KindOfSim; - using DataGlobals::ksRunPeriodWeather; using DataGlobals::WarmupFlag; using ScheduleManager::GetCurrentScheduleValue; @@ -599,7 +597,7 @@ namespace ExteriorEnergyUse { // gather for tabular reports if (!WarmupFlag) { // IF (DoOutputReporting .AND. WriteTabularFiles .and. (KindOfSim == ksRunPeriodWeather)) THEN !for weather simulations only - if (DoOutputReporting && (KindOfSim == ksRunPeriodWeather)) { // for weather simulations only + if (DoOutputReporting && (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather)) { // for weather simulations only // for tabular report, accumua the total electricity used for each ExteriorLights object state.dataExteriorEnergyUse->ExteriorLights(Item).SumConsumption += state.dataExteriorEnergyUse->ExteriorLights(Item).CurrentUse; // for tabular report, accumulate the time when each ExteriorLights has consumption diff --git a/src/EnergyPlus/ExternalInterface.cc b/src/EnergyPlus/ExternalInterface.cc index d23402d8211..b7156621c44 100644 --- a/src/EnergyPlus/ExternalInterface.cc +++ b/src/EnergyPlus/ExternalInterface.cc @@ -235,8 +235,6 @@ namespace ExternalInterface { // Exchanges variables between EnergyPlus and the BCVTB socket. // Using/Aliasing - using DataGlobals::KindOfSim; - using DataGlobals::ksRunPeriodWeather; using DataGlobals::WarmupFlag; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -253,7 +251,7 @@ namespace ExternalInterface { // Exchange data only after sizing and after warm-up. // Note that checking for ZoneSizingCalc SysSizingCalc does not work here, hence we // use the KindOfSim flag - if (!WarmupFlag && (KindOfSim == ksRunPeriodWeather)) { + if (!WarmupFlag && (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather)) { CalcExternalInterface(state); } } @@ -736,8 +734,6 @@ namespace ExternalInterface { // Using/Aliasing using DataGlobals::emsCallFromExternalInterface; - using DataGlobals::KindOfSim; - using DataGlobals::ksRunPeriodWeather; using DataGlobals::WarmupFlag; using EMSManager::ManageEMS; using General::TrimSigDigits; @@ -1990,8 +1986,6 @@ namespace ExternalInterface { using DataEnvironment::TotalOverallSimDays; using DataEnvironment::TotDesDays; using DataGlobals::emsCallFromExternalInterface; - using DataGlobals::KindOfSim; - using DataGlobals::ksRunPeriodWeather; using DataGlobals::TimeStepZone; using DataGlobals::WarmupFlag; using DataSystemVariables::UpdateDataDuringWarmupExternalInterface; @@ -2012,13 +2006,13 @@ namespace ExternalInterface { Array1D_int keyIndexes(1); // Array index for Array1D_string NamesOfKeys(1); // Specific key name - if (WarmupFlag && (KindOfSim != ksRunPeriodWeather)) { // No data exchange during design days + if (WarmupFlag && (state.dataGlobal->KindOfSim != DataGlobalConstants::KindOfSim::RunPeriodWeather)) { // No data exchange during design days if (FirstCallDesignDays) { ShowWarningError("ExternalInterface/CalcExternalInterfaceFMUImport: ExternalInterface does not exchange data during design days."); } FirstCallDesignDays = false; } - if (WarmupFlag && (KindOfSim == ksRunPeriodWeather)) { // Data exchange after design days + if (WarmupFlag && (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather)) { // Data exchange after design days if (FirstCallWUp) { // set the report during warmup to true so that variables are also updated during the warmup UpdateDataDuringWarmupExternalInterface = true; @@ -2142,7 +2136,7 @@ namespace ExternalInterface { } } // BeginSimulation - if (!WarmupFlag && (KindOfSim == ksRunPeriodWeather)) { + if (!WarmupFlag && (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather)) { if (FirstCallTStep) { // reset the UpdateDataDuringWarmupExternalInterface to be false. diff --git a/src/EnergyPlus/GroundTemperatureModeling/FiniteDifferenceGroundTemperatureModel.cc b/src/EnergyPlus/GroundTemperatureModeling/FiniteDifferenceGroundTemperatureModel.cc index c8e2406af67..a2110c7b6c5 100644 --- a/src/EnergyPlus/GroundTemperatureModeling/FiniteDifferenceGroundTemperatureModel.cc +++ b/src/EnergyPlus/GroundTemperatureModeling/FiniteDifferenceGroundTemperatureModel.cc @@ -197,7 +197,7 @@ void FiniteDiffGroundTempsModel::getWeatherData(EnergyPlusData &state) // Save current environment so we can revert back when done int Envrn_reset = state.dataWeatherManager->Envrn; - int KindOfSim_reset = KindOfSim; + DataGlobalConstants::KindOfSim KindOfSim_reset = state.dataGlobal->KindOfSim; int TimeStep_reset = TimeStep; int HourOfDay_reset = HourOfDay; bool BeginEnvrnFlag_reset = BeginEnvrnFlag; @@ -224,7 +224,7 @@ void FiniteDiffGroundTempsModel::getWeatherData(EnergyPlusData &state) ++state.dataWeatherManager->TotRunPers; state.dataWeatherManager->Environment.redimension(state.dataWeatherManager->NumOfEnvrn); state.dataWeatherManager->RunPeriodInput.redimension(state.dataWeatherManager->TotRunPers); - state.dataWeatherManager->Environment(state.dataWeatherManager->NumOfEnvrn).KindOfEnvrn = ksReadAllWeatherData; + state.dataWeatherManager->Environment(state.dataWeatherManager->NumOfEnvrn).KindOfEnvrn = DataGlobalConstants::KindOfSim::ReadAllWeatherData; state.dataWeatherManager->RPReadAllWeatherData = true; WeathSimReq = true; // RunPeriod is initialized to be one year of simulation @@ -241,7 +241,7 @@ void FiniteDiffGroundTempsModel::getWeatherData(EnergyPlusData &state) ShowFatalError("Site:GroundTemperature:Undisturbed:FiniteDifference: error in reading weather file data"); } - if (KindOfSim != ksReadAllWeatherData) { + if (state.dataGlobal->KindOfSim != DataGlobalConstants::KindOfSim::ReadAllWeatherData) { // This shouldn't happen ShowFatalError("Site:GroundTemperature:Undisturbed:FiniteDifference: error in reading weather file data, bad KindOfSim."); } @@ -349,7 +349,7 @@ void FiniteDiffGroundTempsModel::getWeatherData(EnergyPlusData &state) // Reset Envrionment when done reading data --state.dataWeatherManager->NumOfEnvrn; // May need better way of eliminating the extra envrionment that was added to read the data --state.dataWeatherManager->TotRunPers; - KindOfSim = KindOfSim_reset; + state.dataGlobal->KindOfSim = KindOfSim_reset; state.dataWeatherManager->RPReadAllWeatherData = false; state.dataWeatherManager->Environment.redimension(state.dataWeatherManager->NumOfEnvrn); state.dataWeatherManager->RunPeriodInput.redimension(state.dataWeatherManager->TotRunPers); diff --git a/src/EnergyPlus/HVACManager.cc b/src/EnergyPlus/HVACManager.cc index a5ed1698363..ea1b8a0a962 100644 --- a/src/EnergyPlus/HVACManager.cc +++ b/src/EnergyPlus/HVACManager.cc @@ -263,9 +263,6 @@ namespace HVACManager { using DataContaminantBalance::ZoneAirGCAvg; using DataContaminantBalance::ZoneAirGCTemp; using DataGlobals::CompLoadReportIsReq; - using DataGlobals::KindOfSim; - using DataGlobals::ksHVACSizeDesignDay; - using DataGlobals::ksHVACSizeRunPeriodDesign; using DataHeatBalFanSys::QRadSurfAFNDuct; using DataHeatBalFanSys::SysDepZoneLoads; using DataHeatBalFanSys::SysDepZoneLoadsLagged; @@ -535,7 +532,7 @@ namespace HVACManager { if (DoOutputReporting) { ReportMaxVentilationLoads(state); UpdateDataandReport(state, OutputProcessor::TimeStepType::TimeStepSystem); - if (KindOfSim == ksHVACSizeDesignDay || KindOfSim == ksHVACSizeRunPeriodDesign) { + if (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::HVACSizeDesignDay || state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::HVACSizeRunPeriodDesign) { if (hvacSizingSimulationManager) hvacSizingSimulationManager->UpdateSizingLogsSystemStep(state); } UpdateTabularReports(state, OutputProcessor::TimeStepType::TimeStepSystem); @@ -581,7 +578,7 @@ namespace HVACManager { } CalcMoreNodeInfo(state); UpdateDataandReport(state, OutputProcessor::TimeStepType::TimeStepSystem); - if (KindOfSim == ksHVACSizeDesignDay || KindOfSim == ksHVACSizeRunPeriodDesign) { + if (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::HVACSizeDesignDay || state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::HVACSizeRunPeriodDesign) { if (hvacSizingSimulationManager) hvacSizingSimulationManager->UpdateSizingLogsSystemStep(state); } } else if (UpdateDataDuringWarmupExternalInterface) { // added for FMI diff --git a/src/EnergyPlus/HVACSizingSimulationManager.cc b/src/EnergyPlus/HVACSizingSimulationManager.cc index 3f4bfc0e292..bec24f499da 100644 --- a/src/EnergyPlus/HVACSizingSimulationManager.cc +++ b/src/EnergyPlus/HVACSizingSimulationManager.cc @@ -267,9 +267,9 @@ void ManageHVACSizingSimulation(EnergyPlusData &state, bool &ErrorsFound) hvacSizingSimulationManager->sizingLogger.SetupSizingLogsNewEnvironment(state); // if (!DoDesDaySim) continue; // not sure about this, may need to force users to set this on input for this method, but maybe not - if (KindOfSim == ksRunPeriodWeather) continue; - if (KindOfSim == ksDesignDay) continue; - if (KindOfSim == ksRunPeriodDesign) continue; + if (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather) continue; + if (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::DesignDay) continue; + if (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodDesign) continue; if (state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).HVACSizingIterationNum != HVACSizingIterCount) continue; @@ -277,7 +277,7 @@ void ManageHVACSizingSimulation(EnergyPlusData &state, bool &ErrorsFound) if (sqlite) { sqlite->sqliteBegin(); sqlite->createSQLiteEnvironmentPeriodRecord( - DataEnvironment::CurEnvirNum, DataEnvironment::EnvironmentName, DataGlobals::KindOfSim); + DataEnvironment::CurEnvirNum, DataEnvironment::EnvironmentName, state.dataGlobal->KindOfSim); sqlite->sqliteCommit(); } } @@ -286,7 +286,7 @@ void ManageHVACSizingSimulation(EnergyPlusData &state, bool &ErrorsFound) DisplayString("Initializing New Environment Parameters, HVAC Sizing Simulation"); BeginEnvrnFlag = true; - if ((KindOfSim == ksHVACSizeDesignDay) && (state.dataWeatherManager->DesDayInput(state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).DesignDayNum).suppressBegEnvReset)) { + if ((state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::HVACSizeDesignDay) && (state.dataWeatherManager->DesDayInput(state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).DesignDayNum).suppressBegEnvReset)) { // user has input in SizingPeriod:DesignDay directing to skip begin environment rests, for accuracy-with-speed as zones can more // easily converge fewer warmup days are allowed DisplayString("Suppressing Initialization of New Environment Parameters"); diff --git a/src/EnergyPlus/HeatBalanceManager.cc b/src/EnergyPlus/HeatBalanceManager.cc index f7246a4b68e..17f0988d381 100644 --- a/src/EnergyPlus/HeatBalanceManager.cc +++ b/src/EnergyPlus/HeatBalanceManager.cc @@ -5318,7 +5318,7 @@ namespace HeatBalanceManager { PerformSolarCalculations(state); } - if (BeginDayFlag && !WarmupFlag && KindOfSim == ksRunPeriodWeather && ReportExtShadingSunlitFrac) { + if (BeginDayFlag && !WarmupFlag && state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather && ReportExtShadingSunlitFrac) { for (int iHour = 1; iHour <= 24; ++iHour) { // Do for all hours. for (int TS = 1; TS <= NumOfTimeStepInHour; ++TS) { static constexpr auto ShdFracFmt1(" {:02}/{:02} {:02}:{:02},"); @@ -5957,15 +5957,13 @@ namespace HeatBalanceManager { using OutputReportTabular::UpdateTabularReports; using ScheduleManager::ReportScheduleValues; using namespace DataReportingFlags; - using DataGlobals::KindOfSim; - using DataGlobals::ksHVACSizeDesignDay; ReportScheduleValues(state); if (!WarmupFlag && DoOutputReporting) { CalcMoreNodeInfo(state); UpdateDataandReport(state, OutputProcessor::TimeStepType::TimeStepZone); - if (KindOfSim == ksHVACSizeDesignDay || KindOfSim == ksHVACSizeRunPeriodDesign) { + if (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::HVACSizeDesignDay || state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::HVACSizeRunPeriodDesign) { if (hvacSizingSimulationManager) hvacSizingSimulationManager->UpdateSizingLogsZoneStep(state); } @@ -6008,13 +6006,13 @@ namespace HeatBalanceManager { } CalcMoreNodeInfo(state); UpdateDataandReport(state, OutputProcessor::TimeStepType::TimeStepZone); - if (KindOfSim == ksHVACSizeDesignDay || KindOfSim == ksHVACSizeRunPeriodDesign) { + if (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::HVACSizeDesignDay || state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::HVACSizeRunPeriodDesign) { if (hvacSizingSimulationManager) hvacSizingSimulationManager->UpdateSizingLogsZoneStep(state); } } else if (UpdateDataDuringWarmupExternalInterface) { // added for FMI UpdateDataandReport(state, OutputProcessor::TimeStepType::TimeStepZone); - if (KindOfSim == ksHVACSizeDesignDay || KindOfSim == ksHVACSizeRunPeriodDesign) { + if (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::HVACSizeDesignDay || state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::HVACSizeRunPeriodDesign) { if (hvacSizingSimulationManager) hvacSizingSimulationManager->UpdateSizingLogsZoneStep(state); } } diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index cd1d0551404..0c65a859fe8 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -310,15 +310,15 @@ namespace HeatBalanceSurfaceManager { CalcThermalResilience(state); if (OutputReportTabular::displayThermalResilienceSummary) { - ReportThermalResilience(); + ReportThermalResilience(state); } if (OutputReportTabular::displayCO2ResilienceSummary) { - ReportCO2Resilience(); + ReportCO2Resilience(state); } if (OutputReportTabular::displayVisualResilienceSummary) { - ReportVisualResilience(); + ReportVisualResilience(state); } ManageSurfaceHeatBalancefirstTime = false; @@ -5157,7 +5157,7 @@ namespace HeatBalanceSurfaceManager { } } - void ReportThermalResilience() { + void ReportThermalResilience(EnergyPlusData &state) { int HINoBins = 5; // Heat Index range - number of bins int HumidexNoBins = 5; // Humidex range - number of bins @@ -5188,7 +5188,7 @@ namespace HeatBalanceSurfaceManager { } // Count hours only during weather simulation periods - if (ksRunPeriodWeather == KindOfSim && !WarmupFlag) { + if (DataGlobalConstants::KindOfSim::RunPeriodWeather == state.dataGlobal->KindOfSim && !WarmupFlag) { // Trace current time step Zone Pierce SET; NaN if no occupant or SET not calculated // Record last time step SET to trace SET unmet duration; for (int iPeople = 1; iPeople <= TotPeople; ++iPeople) { @@ -5299,7 +5299,7 @@ namespace HeatBalanceSurfaceManager { } // loop over zones } - void ReportCO2Resilience() { + void ReportCO2Resilience(EnergyPlusData &state) { int NoBins = 3; if (reportCO2ResilienceFirstTime) { for (int ZoneNum = 1; ZoneNum <= NumOfZones; ++ZoneNum) { @@ -5318,7 +5318,7 @@ namespace HeatBalanceSurfaceManager { } } - if (ksRunPeriodWeather == KindOfSim && !WarmupFlag) { + if (DataGlobalConstants::KindOfSim::RunPeriodWeather == state.dataGlobal->KindOfSim && !WarmupFlag) { for (int iPeople = 1; iPeople <= TotPeople; ++iPeople) { int ZoneNum = People(iPeople).ZonePtr; ZoneNumOcc(ZoneNum) = People(iPeople).NumberOfPeople * GetCurrentScheduleValue(People(iPeople).NumberOfPeoplePtr); @@ -5341,7 +5341,7 @@ namespace HeatBalanceSurfaceManager { } // loop over zones } - void ReportVisualResilience() { + void ReportVisualResilience(EnergyPlusData &state) { int NoBins = 4; if (reportVisualResilienceFirstTime) { for (int ZoneNum = 1; ZoneNum <= NumOfZones; ++ZoneNum) { @@ -5367,7 +5367,7 @@ namespace HeatBalanceSurfaceManager { } } - if (ksRunPeriodWeather == KindOfSim && !WarmupFlag) { + if (DataGlobalConstants::KindOfSim::RunPeriodWeather == state.dataGlobal->KindOfSim && !WarmupFlag) { for (int iPeople = 1; iPeople <= TotPeople; ++iPeople) { int ZoneNum = People(iPeople).ZonePtr; ZoneNumOcc(ZoneNum) = People(iPeople).NumberOfPeople * GetCurrentScheduleValue(People(iPeople).NumberOfPeoplePtr); diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.hh b/src/EnergyPlus/HeatBalanceSurfaceManager.hh index f5e15ae76c9..9d367f0fd39 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.hh +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.hh @@ -136,11 +136,11 @@ namespace HeatBalanceSurfaceManager { void CalcThermalResilience(EnergyPlusData &state); - void ReportThermalResilience(); + void ReportThermalResilience(EnergyPlusData &state); - void ReportCO2Resilience(); + void ReportCO2Resilience(EnergyPlusData &state); - void ReportVisualResilience(); + void ReportVisualResilience(EnergyPlusData &state); // End of Reporting subroutines for the HB Module diff --git a/src/EnergyPlus/InternalHeatGains.cc b/src/EnergyPlus/InternalHeatGains.cc index 08e3a8d0a35..c214f5413e3 100644 --- a/src/EnergyPlus/InternalHeatGains.cc +++ b/src/EnergyPlus/InternalHeatGains.cc @@ -179,7 +179,7 @@ namespace InternalHeatGains { InitInternalHeatGains(state); - ReportInternalHeatGains(); + ReportInternalHeatGains(state); CheckReturnAirHeatGain(); @@ -6033,7 +6033,7 @@ namespace InternalHeatGains { } // End CalcZoneITEq - void ReportInternalHeatGains() + void ReportInternalHeatGains(EnergyPlusData &state) { // SUBROUTINE INFORMATION: @@ -6086,7 +6086,7 @@ namespace InternalHeatGains { Lights(Loop).RetAirGainEnergy = Lights(Loop).RetAirGainRate * TimeStepZoneSec; Lights(Loop).TotGainEnergy = Lights(Loop).TotGainRate * TimeStepZoneSec; if (!WarmupFlag) { - if (DoOutputReporting && WriteTabularFiles && (KindOfSim == ksRunPeriodWeather)) { // for weather simulations only + if (DoOutputReporting && WriteTabularFiles && (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather)) { // for weather simulations only // for tabular report, accumulate the total electricity used for each Light object Lights(Loop).SumConsumption += Lights(Loop).Consumption; // for tabular report, accumulate the time when each Light has consumption (using a very small threshold instead of zero) diff --git a/src/EnergyPlus/InternalHeatGains.hh b/src/EnergyPlus/InternalHeatGains.hh index fa0391dcdaf..bacfaf4aa0b 100644 --- a/src/EnergyPlus/InternalHeatGains.hh +++ b/src/EnergyPlus/InternalHeatGains.hh @@ -78,7 +78,7 @@ namespace InternalHeatGains { void CalcZoneITEq(EnergyPlusData &state); - void ReportInternalHeatGains(); + void ReportInternalHeatGains(EnergyPlusData &state); Real64 GetDesignLightingLevelForZone(int const WhichZone); // name of zone diff --git a/src/EnergyPlus/OutputReportTabular.cc b/src/EnergyPlus/OutputReportTabular.cc index f8af0519488..35b4f992761 100644 --- a/src/EnergyPlus/OutputReportTabular.cc +++ b/src/EnergyPlus/OutputReportTabular.cc @@ -175,10 +175,6 @@ namespace OutputReportTabular { using DataGlobals::DoOutputReporting; using DataGlobals::DoWeathSim; using DataGlobals::HourOfDay; - using DataGlobals::KindOfSim; - using DataGlobals::ksDesignDay; - using DataGlobals::ksRunPeriodDesign; - using DataGlobals::ksRunPeriodWeather; using DataGlobals::NumOfZones; using DataGlobals::SecInHour; using DataGlobals::TimeStep; @@ -784,7 +780,7 @@ namespace OutputReportTabular { UpdateTabularReportsGetInput = false; date_and_time(_, _, _, td); } - if (DoOutputReporting && WriteTabularFiles && (KindOfSim == ksRunPeriodWeather)) { + if (DoOutputReporting && WriteTabularFiles && (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather)) { if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepZone) { gatherElapsedTimeBEPS += TimeStepZone; } @@ -1287,12 +1283,12 @@ namespace OutputReportTabular { if (KeyCount == 0) { ++ErrCount1; - if (ErrCount1 == 1 && !DisplayExtraWarnings && KindOfSim == ksRunPeriodWeather) { + if (ErrCount1 == 1 && !DisplayExtraWarnings && state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather) { ShowWarningError("Processing Monthly Tabular Reports: Variable names not valid for this simulation"); ShowContinueError("...use Output:Diagnostics,DisplayExtraWarnings; to show more details on individual variables."); } // fixing CR5878 removed the showing of the warning once about a specific variable. - if (DisplayExtraWarnings && KindOfSim == ksRunPeriodWeather) { + if (DisplayExtraWarnings && state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather) { ShowWarningError("Processing Monthly Tabular Reports: " + MonthlyInput(TabNum).name); ShowContinueError("..Variable name=" + curVariMeter + " not valid for this simulation."); if (VarWarning) { @@ -1445,7 +1441,7 @@ namespace OutputReportTabular { } } else { // if no key corresponds to this instance of the report // fixing CR5878 removed the showing of the warning once about a specific variable. - if (DisplayExtraWarnings && KindOfSim == ksRunPeriodWeather) { + if (DisplayExtraWarnings && state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather) { ShowWarningError("Processing Monthly Tabular Reports: " + MonthlyInput(TabNum).name); ShowContinueError("..Variable name=" + curVariMeter + " not valid for this simulation."); ShowContinueError("..i.e., Variable name=" + UniqueKeyNames(kUniqueKey) + ':' + curVariMeter + diff --git a/src/EnergyPlus/SQLiteProcedures.cc b/src/EnergyPlus/SQLiteProcedures.cc index 041dd2ce70f..3ca063d49fa 100644 --- a/src/EnergyPlus/SQLiteProcedures.cc +++ b/src/EnergyPlus/SQLiteProcedures.cc @@ -2065,14 +2065,14 @@ void SQLite::createZoneExtendedOutput() void SQLite::createSQLiteEnvironmentPeriodRecord(const int curEnvirNum, const std::string &environmentName, - const int kindOfSim, + const DataGlobalConstants::KindOfSim kindOfSim, const int simulationIndex) { if (m_writeOutputToSQLite) { sqliteBindInteger(m_environmentPeriodInsertStmt, 1, curEnvirNum); sqliteBindForeignKey(m_environmentPeriodInsertStmt, 2, simulationIndex); sqliteBindText(m_environmentPeriodInsertStmt, 3, environmentName); - sqliteBindInteger(m_environmentPeriodInsertStmt, 4, kindOfSim); + sqliteBindInteger(m_environmentPeriodInsertStmt, 4, static_cast(kindOfSim)); sqliteStepCommand(m_environmentPeriodInsertStmt); sqliteResetCommand(m_environmentPeriodInsertStmt); diff --git a/src/EnergyPlus/SQLiteProcedures.hh b/src/EnergyPlus/SQLiteProcedures.hh index cd499a3a4ab..05a8c965e22 100644 --- a/src/EnergyPlus/SQLiteProcedures.hh +++ b/src/EnergyPlus/SQLiteProcedures.hh @@ -259,7 +259,7 @@ public: void createSQLiteEnvironmentPeriodRecord(const int curEnvirNum, const std::string &environmentName, - const int kindOfSim, + const DataGlobalConstants::KindOfSim kindOfSim, const int simulationIndex = 1); void sqliteWriteMessage(const std::string &message); diff --git a/src/EnergyPlus/SimulationManager.cc b/src/EnergyPlus/SimulationManager.cc index d27ba8701cb..230de4cbcb5 100644 --- a/src/EnergyPlus/SimulationManager.cc +++ b/src/EnergyPlus/SimulationManager.cc @@ -498,17 +498,17 @@ namespace SimulationManager { if (!Available) break; if (ErrorsFound) break; - if ((!DoDesDaySim) && (KindOfSim != ksRunPeriodWeather)) continue; - if ((!DoWeathSim) && (KindOfSim == ksRunPeriodWeather)) continue; - if (KindOfSim == ksHVACSizeDesignDay) continue; // don't run these here, only for sizing simulations + if ((!DoDesDaySim) && (state.dataGlobal->KindOfSim != DataGlobalConstants::KindOfSim::RunPeriodWeather)) continue; + if ((!DoWeathSim) && (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather)) continue; + if (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::HVACSizeDesignDay) continue; // don't run these here, only for sizing simulations - if (KindOfSim == ksHVACSizeRunPeriodDesign) continue; // don't run these here, only for sizing simulations + if (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::HVACSizeRunPeriodDesign) continue; // don't run these here, only for sizing simulations ++EnvCount; if (sqlite) { sqlite->sqliteBegin(); - sqlite->createSQLiteEnvironmentPeriodRecord(DataEnvironment::CurEnvirNum, DataEnvironment::EnvironmentName, DataGlobals::KindOfSim); + sqlite->createSQLiteEnvironmentPeriodRecord(DataEnvironment::CurEnvirNum, DataEnvironment::EnvironmentName, state.dataGlobal->KindOfSim); sqlite->sqliteCommit(); } @@ -517,7 +517,7 @@ namespace SimulationManager { DisplayString("Initializing New Environment Parameters"); BeginEnvrnFlag = true; - if ((KindOfSim == ksDesignDay) && (state.dataWeatherManager->DesDayInput(state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).DesignDayNum).suppressBegEnvReset)) { + if ((state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::DesignDay) && (state.dataWeatherManager->DesDayInput(state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).DesignDayNum).suppressBegEnvReset)) { // user has input in SizingPeriod:DesignDay directing to skip begin environment rests, for accuracy-with-speed as zones can more // easily converge fewer warmup days are allowed DisplayString("Design Day Fast Warmup Mode: Suppressing Initialization of New Environment Parameters"); @@ -567,7 +567,7 @@ namespace SimulationManager { cWarmupDay = TrimSigDigits(NumOfWarmupDays); DisplayString("Warming up {" + cWarmupDay + '}'); } else if (DayOfSim == 1) { - if (KindOfSim == ksRunPeriodWeather) { + if (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather) { DisplayString("Starting Simulation at " + DataEnvironment::CurMnDyYr + " for " + EnvironmentName); } else { DisplayString("Starting Simulation at " + DataEnvironment::CurMnDy + " for " + EnvironmentName); @@ -576,7 +576,7 @@ namespace SimulationManager { print(state.files.eio, Format_700, NumOfWarmupDays); ResetAccumulationWhenWarmupComplete(); } else if (DisplayPerfSimulationFlag) { - if (KindOfSim == ksRunPeriodWeather) { + if (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather) { DisplayString("Continuing Simulation at " + DataEnvironment::CurMnDyYr + " for " + EnvironmentName); } else { DisplayString("Continuing Simulation at " + DataEnvironment::CurMnDy + " for " + EnvironmentName); diff --git a/src/EnergyPlus/SizingAnalysisObjects.cc b/src/EnergyPlus/SizingAnalysisObjects.cc index d4153c78c23..a621ddf948e 100644 --- a/src/EnergyPlus/SizingAnalysisObjects.cc +++ b/src/EnergyPlus/SizingAnalysisObjects.cc @@ -72,7 +72,7 @@ namespace EnergyPlus { ZoneTimestepObject::ZoneTimestepObject() { - kindOfSim = 0; + kindOfSim = DataGlobalConstants::KindOfSim::Unassigned; envrnNum = 0; dayOfSim = 0; hourOfDay = 0; @@ -83,7 +83,7 @@ ZoneTimestepObject::ZoneTimestepObject() } ZoneTimestepObject::ZoneTimestepObject( - int kindSim, // kind of simulation, e.g. ksDesignDay, ksHVACSizeDesignDay, usally DataGlobals::KindOfSim + DataGlobalConstants::KindOfSim kindSim, // kind of simulation int environmentNum, // index in Environment data structure, usually WeatherManager::Envrn int daySim, // days into simulation period, usually DataGlobals::DayOfSim int hourDay, // hour into day, 1-24, filled by DataGlobals::HourOfDay @@ -269,10 +269,10 @@ ZoneTimestepObject SizingLog::GetLogVariableDataMax() } for (auto &zt : ztStepObj) { - if (zt.envrnNum > 0 && zt.kindOfSim > 0 && zt.runningAvgDataValue > MaxVal) { + if (zt.envrnNum > 0 && zt.kindOfSim != DataGlobalConstants::KindOfSim::Unassigned && zt.runningAvgDataValue > MaxVal) { MaxVal = zt.runningAvgDataValue; tmpztStepStamp = zt; - } else if (zt.envrnNum == 0 && zt.kindOfSim == 0) { // null timestamp, problem to fix + } else if (zt.envrnNum == 0 && zt.kindOfSim == DataGlobalConstants::KindOfSim::Unassigned) { // null timestamp, problem to fix ShowWarningMessage("GetLogVariableDataMax: null timestamp in log"); } } @@ -304,8 +304,6 @@ void SizingLog::SetupNewEnvironment(int const seedEnvrnNum, int const newEnvrnNu int SizingLoggerFramework::SetupVariableSizingLog(EnergyPlusData& state, Real64 &rVariable, int stepsInAverage) { - using DataGlobals::ksDesignDay; - using DataGlobals::ksRunPeriodDesign; using DataGlobals::NumOfTimeStepInHour; int VectorLength(0); int const HoursPerDay(24); @@ -318,11 +316,11 @@ int SizingLoggerFramework::SetupVariableSizingLog(EnergyPlusData& state, Real64 // search environment structure for sizing periods // this is coded to occur before the additions to Environment structure that will occur to run them as HVAC Sizing sims for (int i = 1; i <= state.dataWeatherManager->NumOfEnvrn; ++i) { - if (state.dataWeatherManager->Environment(i).KindOfEnvrn == ksDesignDay) { + if (state.dataWeatherManager->Environment(i).KindOfEnvrn == DataGlobalConstants::KindOfSim::DesignDay) { ++tmpLog.NumOfEnvironmentsInLogSet; ++tmpLog.NumOfDesignDaysInLogSet; } - if (state.dataWeatherManager->Environment(i).KindOfEnvrn == ksRunPeriodDesign) { + if (state.dataWeatherManager->Environment(i).KindOfEnvrn == DataGlobalConstants::KindOfSim::RunPeriodDesign) { ++tmpLog.NumOfEnvironmentsInLogSet; ++tmpLog.NumberOfSizingPeriodsInLogSet; } @@ -331,10 +329,10 @@ int SizingLoggerFramework::SetupVariableSizingLog(EnergyPlusData& state, Real64 // next fill in the count of steps into map for (int i = 1; i <= state.dataWeatherManager->NumOfEnvrn; ++i) { - if (state.dataWeatherManager->Environment(i).KindOfEnvrn == ksDesignDay) { + if (state.dataWeatherManager->Environment(i).KindOfEnvrn == DataGlobalConstants::KindOfSim::DesignDay) { tmpLog.ztStepCountByEnvrnMap[i] = HoursPerDay * NumOfTimeStepInHour; } - if (state.dataWeatherManager->Environment(i).KindOfEnvrn == ksRunPeriodDesign) { + if (state.dataWeatherManager->Environment(i).KindOfEnvrn == DataGlobalConstants::KindOfSim::RunPeriodDesign) { tmpLog.ztStepCountByEnvrnMap[i] = HoursPerDay * NumOfTimeStepInHour * state.dataWeatherManager->Environment(i).TotalDays; } } @@ -382,7 +380,7 @@ ZoneTimestepObject SizingLoggerFramework::PrepareZoneTimestepStamp(EnergyPlusDat } ZoneTimestepObject tmpztStepStamp( // call constructor - DataGlobals::KindOfSim, + state.dataGlobal->KindOfSim, state.dataWeatherManager->Envrn, locDayOfSim, DataGlobals::HourOfDay, @@ -635,7 +633,7 @@ bool PlantCoinicidentAnalysis::CheckTimeStampForNull(ZoneTimestepObject testStam if (testStamp.envrnNum != 0) { isNull = false; } - if (testStamp.kindOfSim != 0) { + if (testStamp.kindOfSim != DataGlobalConstants::KindOfSim::Unassigned) { isNull = false; } diff --git a/src/EnergyPlus/SizingAnalysisObjects.hh b/src/EnergyPlus/SizingAnalysisObjects.hh index 5dc97df9f66..af12ed556e1 100644 --- a/src/EnergyPlus/SizingAnalysisObjects.hh +++ b/src/EnergyPlus/SizingAnalysisObjects.hh @@ -77,7 +77,7 @@ public: class ZoneTimestepObject { public: - int kindOfSim = 0; + DataGlobalConstants::KindOfSim kindOfSim = DataGlobalConstants::KindOfSim::Unassigned; int envrnNum = 0; int dayOfSim = 0; // since start of simulation int hourOfDay = 0; @@ -92,7 +92,7 @@ public: std::vector subSteps; // nested object array for system timesteps inside here. ZoneTimestepObject( // full constructor - int kindSim, + DataGlobalConstants::KindOfSim kindSim, int environmentNum, int daySim, int hourDay, diff --git a/src/EnergyPlus/SizingManager.cc b/src/EnergyPlus/SizingManager.cc index 38d81a5cfbf..f9f6ec1078d 100644 --- a/src/EnergyPlus/SizingManager.cc +++ b/src/EnergyPlus/SizingManager.cc @@ -315,14 +315,14 @@ namespace SizingManager { if (ErrorsFound) break; // check that environment is one of the design days - if (KindOfSim == ksRunPeriodWeather) { + if (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather) { continue; } ++NumSizingPeriodsPerformed; BeginEnvrnFlag = true; - if ((KindOfSim == ksDesignDay) && (state.dataWeatherManager->DesDayInput(state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).DesignDayNum).suppressBegEnvReset)) { + if ((state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::DesignDay) && (state.dataWeatherManager->DesDayInput(state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).DesignDayNum).suppressBegEnvReset)) { // user has input in SizingPeriod:DesignDay directing to skip begin environment rests, for accuracy-with-speed as zones can // more easily converge fewer warmup days are allowed DisplayString("Suppressing Initialization of New Environment Parameters"); @@ -392,7 +392,7 @@ namespace SizingManager { // set flag for pulse used in load component reporting doLoadComponentPulseNow = - CalcdoLoadComponentPulseNow(isPulseZoneSizing, WarmupFlag, HourOfDay, TimeStep, KindOfSim, DayOfSim); + CalcdoLoadComponentPulseNow(isPulseZoneSizing, WarmupFlag, HourOfDay, TimeStep, state.dataGlobal->KindOfSim, DayOfSim); ManageWeather(state); @@ -501,7 +501,7 @@ namespace SizingManager { GetNextEnvironment(state, Available, ErrorsFound); // get an environment // check that environment is one of the design days - if (KindOfSim == ksRunPeriodWeather) { + if (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather) { continue; } @@ -511,7 +511,7 @@ namespace SizingManager { ++NumSizingPeriodsPerformed; BeginEnvrnFlag = true; - if ((KindOfSim == ksDesignDay) && (state.dataWeatherManager->DesDayInput(state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).DesignDayNum).suppressBegEnvReset)) { + if ((state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::DesignDay) && (state.dataWeatherManager->DesDayInput(state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).DesignDayNum).suppressBegEnvReset)) { // user has input in SizingPeriod:DesignDay directing to skip begin environment rests, for accuracy-with-speed as zones can more // easily converge fewer warmup days are allowed DisplayString("Suppressing Initialization of New Environment Parameters"); @@ -850,7 +850,12 @@ namespace SizingManager { } bool CalcdoLoadComponentPulseNow( - bool const isPulseZoneSizing, bool const WarmupFlag, int const HourOfDay, int const TimeStep, int const KindOfSim, int const DayOfSim) + bool const isPulseZoneSizing, + bool const WarmupFlag, + int const HourOfDay, + int const TimeStep, + DataGlobalConstants::KindOfSim const KindOfSim, + int const DayOfSim) { // This routine decides whether or not to do a Load Component Pulse. True when yes it should, false when in shouldn't // This check looks to do the pulse at the first time step of the 10th hour of the day while not in warmup mode. @@ -861,7 +866,7 @@ namespace SizingManager { int const TimeStepToPulse(1); if ((isPulseZoneSizing) && (!WarmupFlag) && (HourOfDay == HourDayToPulse) && (TimeStep == TimeStepToPulse) && - ((KindOfSim == ksRunPeriodDesign) || (DayOfSim == 1))) { + ((KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodDesign) || (DayOfSim == 1))) { return true; } else { return false; @@ -3930,7 +3935,7 @@ namespace SizingManager { if (ErrorsFound) break; // check that environment is one of the design days - if (KindOfSim == ksRunPeriodWeather) { + if (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather) { continue; } diff --git a/src/EnergyPlus/SizingManager.hh b/src/EnergyPlus/SizingManager.hh index 3cb9c0b9cfa..f0132caeb44 100644 --- a/src/EnergyPlus/SizingManager.hh +++ b/src/EnergyPlus/SizingManager.hh @@ -101,7 +101,7 @@ namespace SizingManager { bool const WarmupFlag, int const HourOfDay, int const TimeStep, - int const KindOfSim, + DataGlobalConstants::KindOfSim const KindOfSim, int const DayOfSim ); diff --git a/src/EnergyPlus/SolarShading.cc b/src/EnergyPlus/SolarShading.cc index 551f3838116..53c435728c8 100644 --- a/src/EnergyPlus/SolarShading.cc +++ b/src/EnergyPlus/SolarShading.cc @@ -5123,7 +5123,7 @@ namespace SolarShading { CosIncAng(iTimeStep, iHour, SurfNum) = CTHETA(SurfNum); } - if ((shadingMethod == ShadingMethod::Scheduled || shadingMethod == ShadingMethod::Imported) && !DoingSizing && KindOfSim == ksRunPeriodWeather){ + if ((shadingMethod == ShadingMethod::Scheduled || shadingMethod == ShadingMethod::Imported) && !DoingSizing && state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather){ for (int SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { if (Surface(SurfNum).SchedExternalShadingFrac) { SunlitFrac(iTimeStep, iHour, SurfNum) = LookUpScheduleValue(state, Surface(SurfNum).ExternalShadingSchInd, iHour, iTimeStep); @@ -9254,7 +9254,7 @@ namespace SolarShading { // Calculate average Equation of Time, Declination Angle for this period if (!WarmupFlag) { - if (KindOfSim == ksRunPeriodWeather) { + if (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather) { DisplayString("Updating Shadowing Calculations, Start Date=" + CurMnDyYr); } else { DisplayString("Updating Shadowing Calculations, Start Date=" + CurMnDy); diff --git a/src/EnergyPlus/SystemAvailabilityManager.cc b/src/EnergyPlus/SystemAvailabilityManager.cc index fab243a3ef0..04845ba45c2 100644 --- a/src/EnergyPlus/SystemAvailabilityManager.cc +++ b/src/EnergyPlus/SystemAvailabilityManager.cc @@ -3158,7 +3158,7 @@ namespace SystemAvailabilityManager { if (WarmupFlag) { AdaTempGradHeat = OptStartMgr.InitTGradHeat; AdaTempGradCool = OptStartMgr.InitTGradCool; - } else if (DayOfSim == static_cast(DataGlobalConstants::CallIndicator::BeginDay) && BeginDayFlag) { + } else if (DayOfSim == 1 && BeginDayFlag) { OptStart_AdaTempGradTrdHeat = OptStartMgr.InitTGradHeat; AdaTempGradHeat = OptStartMgr.InitTGradHeat; OptStart_AdaTempGradTrdCool = OptStartMgr.InitTGradCool; @@ -3430,7 +3430,7 @@ namespace SystemAvailabilityManager { if (WarmupFlag) { AdaTempGradHeat = OptStartMgr.InitTGradHeat; AdaTempGradCool = OptStartMgr.InitTGradCool; - } else if (DayOfSim == static_cast(DataGlobalConstants::CallIndicator::BeginDay) && BeginDayFlag) { + } else if (DayOfSim == 1 && BeginDayFlag) { OptStart_AdaTempGradTrdHeat = OptStartMgr.InitTGradHeat; AdaTempGradHeat = OptStartMgr.InitTGradHeat; OptStart_AdaTempGradTrdCool = OptStartMgr.InitTGradCool; diff --git a/src/EnergyPlus/ThermalComfort.cc b/src/EnergyPlus/ThermalComfort.cc index b0f04974a5c..3583df8c16d 100644 --- a/src/EnergyPlus/ThermalComfort.cc +++ b/src/EnergyPlus/ThermalComfort.cc @@ -397,7 +397,7 @@ namespace ThermalComfort { CalcThermalComfortFanger(state); CalcThermalComfortPierce(state); CalcThermalComfortKSU(state); - CalcThermalComfortSimpleASH55(); + CalcThermalComfortSimpleASH55(state); CalcIfSetPointMet(state); if (ASH55Flag) CalcThermalComfortAdaptiveASH55(state, false); if (CEN15251Flag) CalcThermalComfortAdaptiveCEN15251(state, false); @@ -2186,7 +2186,7 @@ namespace ThermalComfort { return CalcRadTemp; } - void CalcThermalComfortSimpleASH55() + void CalcThermalComfortSimpleASH55(EnergyPlusData &state) { // SUBROUTINE INFORMATION: // AUTHOR Jason Glazer @@ -2360,12 +2360,12 @@ namespace ThermalComfort { TotalAnyZoneTimeNotSimpleASH55Either = 0.0; // report how the aggregation is conducted { - auto const SELECT_CASE_var(KindOfSim); - if (SELECT_CASE_var == ksDesignDay) { + auto const SELECT_CASE_var(state.dataGlobal->KindOfSim); + if (SELECT_CASE_var == DataGlobalConstants::KindOfSim::DesignDay) { addFootNoteSubTable(pdstSimpleComfort, "Aggregated over the Design Days"); - } else if (SELECT_CASE_var == ksRunPeriodDesign) { + } else if (SELECT_CASE_var == DataGlobalConstants::KindOfSim::RunPeriodDesign) { addFootNoteSubTable(pdstSimpleComfort, "Aggregated over the RunPeriods for Design"); - } else if (SELECT_CASE_var == ksRunPeriodWeather) { + } else if (SELECT_CASE_var == DataGlobalConstants::KindOfSim::RunPeriodWeather) { addFootNoteSubTable(pdstSimpleComfort, "Aggregated over the RunPeriods for Weather"); } } @@ -2545,12 +2545,12 @@ namespace ThermalComfort { TotalAnyZoneNotMetOccupied = 0.0; // report how the aggregation is conducted { - auto const SELECT_CASE_var(KindOfSim); - if (SELECT_CASE_var == ksDesignDay) { + auto const SELECT_CASE_var(state.dataGlobal->KindOfSim); + if (SELECT_CASE_var == DataGlobalConstants::KindOfSim::DesignDay) { addFootNoteSubTable(pdstUnmetLoads, "Aggregated over the Design Days"); - } else if (SELECT_CASE_var == ksRunPeriodDesign) { + } else if (SELECT_CASE_var == DataGlobalConstants::KindOfSim::RunPeriodDesign) { addFootNoteSubTable(pdstUnmetLoads, "Aggregated over the RunPeriods for Design"); - } else if (SELECT_CASE_var == ksRunPeriodWeather) { + } else if (SELECT_CASE_var == DataGlobalConstants::KindOfSim::RunPeriodWeather) { addFootNoteSubTable(pdstUnmetLoads, "Aggregated over the RunPeriods for Weather"); } } diff --git a/src/EnergyPlus/ThermalComfort.hh b/src/EnergyPlus/ThermalComfort.hh index f04f32de75c..dd99d74ec6c 100644 --- a/src/EnergyPlus/ThermalComfort.hh +++ b/src/EnergyPlus/ThermalComfort.hh @@ -318,7 +318,7 @@ namespace ThermalComfort { Real64 CalcRadTemp(EnergyPlusData &state, int const PeopleListNum); // Type of MRT calculation (zone averaged or surface weighted) - void CalcThermalComfortSimpleASH55(); + void CalcThermalComfortSimpleASH55(EnergyPlusData &state); void ResetThermalComfortSimpleASH55(); diff --git a/src/EnergyPlus/WeatherManager.cc b/src/EnergyPlus/WeatherManager.cc index a307edef8d3..9c01cdd0470 100644 --- a/src/EnergyPlus/WeatherManager.cc +++ b/src/EnergyPlus/WeatherManager.cc @@ -546,8 +546,8 @@ namespace WeatherManager { if ( state.dataWeatherManager->NumOfEnvrn > 0) { ResolveLocationInformation(state, ErrorsFound); // Obtain weather related info from input file CheckLocationValidity(); - if ((state.dataWeatherManager->Environment( state.dataWeatherManager->NumOfEnvrn).KindOfEnvrn != DataGlobals::ksDesignDay) && - (state.dataWeatherManager->Environment( state.dataWeatherManager->NumOfEnvrn).KindOfEnvrn != DataGlobals::ksHVACSizeDesignDay)) { + if ((state.dataWeatherManager->Environment( state.dataWeatherManager->NumOfEnvrn).KindOfEnvrn != DataGlobalConstants::KindOfSim::DesignDay) && + (state.dataWeatherManager->Environment( state.dataWeatherManager->NumOfEnvrn).KindOfEnvrn != DataGlobalConstants::KindOfSim::HVACSizeDesignDay)) { CheckWeatherFileValidity(state); } if (ErrorsFound) { @@ -580,7 +580,7 @@ namespace WeatherManager { DataEnvironment::MaxNumberSimYears = 1; for (int i = 1; i <= state.dataWeatherManager->NumOfEnvrn; ++i) { DataEnvironment::TotalOverallSimDays += state.dataWeatherManager->Environment(i).TotalDays; - if (state.dataWeatherManager->Environment(i).KindOfEnvrn == DataGlobals::ksRunPeriodWeather) { + if (state.dataWeatherManager->Environment(i).KindOfEnvrn == DataGlobalConstants::KindOfSim::RunPeriodWeather) { DataEnvironment::MaxNumberSimYears = max(DataEnvironment::MaxNumberSimYears, state.dataWeatherManager->Environment(i).NumSimYears); } } @@ -595,7 +595,7 @@ namespace WeatherManager { state.dataWeatherManager->Envrn = 0; DataEnvironment::CurEnvirNum = 0; } else { - DataGlobals::KindOfSim = state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).KindOfEnvrn; + state.dataGlobal->KindOfSim = state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).KindOfEnvrn; DataEnvironment::DayOfYear = state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).StartJDay; DataEnvironment::DayOfMonth = state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).StartDay; DataGlobals::CalendarYear = state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).StartYear; @@ -604,7 +604,7 @@ namespace WeatherManager { DataGlobals::NumOfDayInEnvrn = state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).TotalDays; // Set day loop maximum from DataGlobals if (!DataGlobals::DoingSizing && !DataGlobals::KickOffSimulation) { if (DataHeatBalance::AdaptiveComfortRequested_ASH55 || DataHeatBalance::AdaptiveComfortRequested_CEN15251) { - if (DataGlobals::KindOfSim == DataGlobals::ksDesignDay) { + if (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::DesignDay) { if (DataGlobals::DoDesDaySim) { ShowWarningError(RoutineName + "Adaptive Comfort being reported during design day."); Real64 GrossApproxAvgDryBulb = @@ -628,17 +628,17 @@ namespace WeatherManager { OpenEPlusWeatherFile(state, ErrorsFound, false); } Available = true; - if ((DataGlobals::KindOfSim == DataGlobals::ksRunPeriodWeather) && (!state.dataWeatherManager->WeatherFileExists && DataGlobals::DoWeathSim)) { + if ((state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather) && (!state.dataWeatherManager->WeatherFileExists && DataGlobals::DoWeathSim)) { if (!DataGlobals::DoingSizing && !DataGlobals::KickOffSimulation) { ShowSevereError("Weather Simulation requested, but no weather file attached."); ErrorsFound = true; } if (!DataGlobals::DoingHVACSizingSimulations) state.dataWeatherManager->Envrn = 0; Available = false; - } else if ((DataGlobals::KindOfSim == DataGlobals::ksRunPeriodWeather) && (!state.dataWeatherManager->WeatherFileExists && !DataGlobals::DoWeathSim)) { + } else if ((state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather) && (!state.dataWeatherManager->WeatherFileExists && !DataGlobals::DoWeathSim)) { Available = false; if (!DataGlobals::DoingHVACSizingSimulations) state.dataWeatherManager->Envrn = 0; - } else if ((DataGlobals::KindOfSim == DataGlobals::ksRunPeriodWeather) && DataGlobals::DoingSizing) { + } else if ((state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather) && DataGlobals::DoingSizing) { Available = false; state.dataWeatherManager->Envrn = 0; } @@ -647,8 +647,8 @@ namespace WeatherManager { DataEnvironment::EnvironmentName = state.dataWeatherManager->Environment( state.dataWeatherManager->Envrn).Title; DataEnvironment::CurEnvirNum = state.dataWeatherManager->Envrn; DataEnvironment::RunPeriodStartDayOfWeek = 0; - if ((DataGlobals::DoDesDaySim && (DataGlobals::KindOfSim != DataGlobals::ksRunPeriodWeather)) || - ((DataGlobals::KindOfSim == DataGlobals::ksRunPeriodWeather) && DataGlobals::DoWeathSim)) { + if ((DataGlobals::DoDesDaySim && (state.dataGlobal->KindOfSim != DataGlobalConstants::KindOfSim::RunPeriodWeather)) || + ((state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather) && DataGlobals::DoWeathSim)) { if (state.dataWeatherManager->PrntEnvHeaders && DataReportingFlags::DoWeatherInitReporting) { static constexpr auto EnvironFormat( "! ,Environment Name,Environment Type, Start Date, End Date, Start DayOfWeek, Duration {#days}, " @@ -661,9 +661,9 @@ namespace WeatherManager { state.dataWeatherManager->PrntEnvHeaders = false; } - if ((DataGlobals::KindOfSim == DataGlobals::ksRunPeriodWeather) || (DataGlobals::KindOfSim == DataGlobals::ksRunPeriodDesign)) { + if ((state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather) || (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodDesign)) { std::string kindOfRunPeriod = state.dataWeatherManager->Environment( state.dataWeatherManager->Envrn).cKindOfEnvrn; - DataEnvironment::RunPeriodEnvironment = DataGlobals::KindOfSim == DataGlobals::ksRunPeriodWeather; + DataEnvironment::RunPeriodEnvironment = state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather; Array1D_int ActEndDayOfMonth(12); ActEndDayOfMonth = state.dataWeatherManager->EndDayOfMonth; DataEnvironment::CurrentYearIsLeapYear = state.dataWeatherManager->Environment( state.dataWeatherManager->Envrn).IsLeapYear; @@ -771,7 +771,7 @@ namespace WeatherManager { // Following builds Environment start/end for ASHRAE 55 warnings StDate = format(DateFormat, state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).StartMonth, state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).StartDay); EnDate = format(DateFormat, state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).EndMonth, state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).EndDay); - if (state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).KindOfEnvrn == DataGlobals::ksRunPeriodWeather) { + if (state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).KindOfEnvrn == DataGlobalConstants::KindOfSim::RunPeriodWeather) { StDate += "/" + General::RoundSigDigits(state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).StartYear); EnDate += "/" + General::RoundSigDigits(state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).EndYear); } @@ -805,7 +805,7 @@ namespace WeatherManager { } if (!DataGlobals::DoingSizing && !DataGlobals::KickOffSimulation) { - if ((DataGlobals::KindOfSim == DataGlobals::ksRunPeriodWeather && DataGlobals::DoWeathSim)) { + if ((state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather && DataGlobals::DoWeathSim)) { if (DataHeatBalance::AdaptiveComfortRequested_ASH55 || DataHeatBalance::AdaptiveComfortRequested_CEN15251) { if (state.dataWeatherManager->WFAllowsLeapYears) { ShowSevereError(RoutineName + @@ -937,8 +937,8 @@ namespace WeatherManager { } } - } else if (DataGlobals::KindOfSim == DataGlobals::ksDesignDay || - DataGlobals::KindOfSim == DataGlobals::ksHVACSizeDesignDay) { // Design Day + } else if (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::DesignDay || + state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::HVACSizeDesignDay) { // Design Day DataEnvironment::RunPeriodEnvironment = false; StDate = format( DateFormat, state.dataWeatherManager->DesDayInput(state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).DesignDayNum).Month, state.dataWeatherManager->DesDayInput(state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).DesignDayNum).DayOfMonth); @@ -1001,18 +1001,18 @@ namespace WeatherManager { int OrigNumOfEnvrn{ state.dataWeatherManager->NumOfEnvrn}; for (int i = 1; i <= OrigNumOfEnvrn; ++i) { - if (state.dataWeatherManager->Environment(i).KindOfEnvrn == DataGlobals::ksDesignDay) { + if (state.dataWeatherManager->Environment(i).KindOfEnvrn == DataGlobalConstants::KindOfSim::DesignDay) { state.dataWeatherManager->Environment.redimension(++ state.dataWeatherManager->NumOfEnvrn); state.dataWeatherManager->Environment( state.dataWeatherManager->NumOfEnvrn) = state.dataWeatherManager->Environment(i); // copy over seed data from current array element state.dataWeatherManager->Environment( state.dataWeatherManager->NumOfEnvrn).SeedEnvrnNum = i; - state.dataWeatherManager->Environment( state.dataWeatherManager->NumOfEnvrn).KindOfEnvrn = DataGlobals::ksHVACSizeDesignDay; + state.dataWeatherManager->Environment( state.dataWeatherManager->NumOfEnvrn).KindOfEnvrn = DataGlobalConstants::KindOfSim::HVACSizeDesignDay; state.dataWeatherManager->Environment( state.dataWeatherManager->NumOfEnvrn).Title = state.dataWeatherManager->Environment(i).Title + " HVAC Sizing Pass " + General::RoundSigDigits(HVACSizingIterCount); state.dataWeatherManager->Environment( state.dataWeatherManager->NumOfEnvrn).HVACSizingIterationNum = HVACSizingIterCount; - } else if (state.dataWeatherManager->Environment(i).KindOfEnvrn == DataGlobals::ksRunPeriodDesign) { + } else if (state.dataWeatherManager->Environment(i).KindOfEnvrn == DataGlobalConstants::KindOfSim::RunPeriodDesign) { state.dataWeatherManager->Environment.redimension(++ state.dataWeatherManager->NumOfEnvrn); state.dataWeatherManager->Environment( state.dataWeatherManager->NumOfEnvrn) = state.dataWeatherManager->Environment(i); // copy over seed data state.dataWeatherManager->Environment( state.dataWeatherManager->NumOfEnvrn).SeedEnvrnNum = i; - state.dataWeatherManager->Environment( state.dataWeatherManager->NumOfEnvrn).KindOfEnvrn = DataGlobals::ksHVACSizeRunPeriodDesign; + state.dataWeatherManager->Environment( state.dataWeatherManager->NumOfEnvrn).KindOfEnvrn = DataGlobalConstants::KindOfSim::HVACSizeRunPeriodDesign; state.dataWeatherManager->Environment( state.dataWeatherManager->NumOfEnvrn).Title = state.dataWeatherManager->Environment(i).Title + " HVAC Sizing Pass " + General::RoundSigDigits(HVACSizingIterCount); state.dataWeatherManager->Environment( state.dataWeatherManager->NumOfEnvrn).HVACSizingIterationNum = HVACSizingIterCount; } @@ -1509,7 +1509,7 @@ namespace WeatherManager { if (DataGlobals::BeginEnvrnFlag) { // Call and setup the Design Day environment - if (state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).KindOfEnvrn != DataGlobals::ksRunPeriodWeather) { + if (state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).KindOfEnvrn != DataGlobalConstants::KindOfSim::RunPeriodWeather) { if (state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).DesignDayNum > 0) { SetUpDesignDay(state, state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).DesignDayNum); DataEnvironment::EnvironmentName = state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).Title; @@ -1572,7 +1572,7 @@ namespace WeatherManager { state.dataWeatherManager->SpecialDays(i).Used = false; } - if ((DataGlobals::KindOfSim != DataGlobals::ksDesignDay) && (DataGlobals::KindOfSim != DataGlobals::ksHVACSizeDesignDay)) { + if ((state.dataGlobal->KindOfSim != DataGlobalConstants::KindOfSim::DesignDay) && (state.dataGlobal->KindOfSim != DataGlobalConstants::KindOfSim::HVACSizeDesignDay)) { ReadWeatherForDay(state, 1, state.dataWeatherManager->Envrn, false); // Read first day's weather } else { state.dataWeatherManager->TomorrowVariables = state.dataWeatherManager->DesignDay(state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).DesignDayNum); @@ -1595,8 +1595,8 @@ namespace WeatherManager { // In a multi year simulation with run period less than 365, we need to position the weather line // appropriately. - if ((!DataGlobals::WarmupFlag) && ((state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).KindOfEnvrn != DataGlobals::ksDesignDay) && - (state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).KindOfEnvrn != DataGlobals::ksHVACSizeDesignDay))) { + if ((!DataGlobals::WarmupFlag) && ((state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).KindOfEnvrn != DataGlobalConstants::KindOfSim::DesignDay) && + (state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).KindOfEnvrn != DataGlobalConstants::KindOfSim::HVACSizeDesignDay))) { if (DataGlobals::DayOfSim < DataGlobals::NumOfDayInEnvrn) { if (DataGlobals::DayOfSim == state.dataWeatherManager->curSimDayForEndOfRunPeriod) { state.dataWeatherManager->curSimDayForEndOfRunPeriod += state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).RawSimDays; @@ -1634,7 +1634,7 @@ namespace WeatherManager { DataEnvironment::HolidayIndexTomorrow = state.dataWeatherManager->TomorrowVariables.HolidayIndex; DataEnvironment::YearTomorrow = state.dataWeatherManager->TomorrowVariables.Year; - if (state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).KindOfEnvrn == DataGlobals::ksRunPeriodWeather) { + if (state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).KindOfEnvrn == DataGlobalConstants::KindOfSim::RunPeriodWeather) { if (DataEnvironment::Month == 1 && DataEnvironment::DayOfMonth == 1 && state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).ActualWeather) { if (state.dataWeatherManager->DatesShouldBeReset) { if (state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).TreatYearsAsConsecutive) { @@ -1719,12 +1719,12 @@ namespace WeatherManager { if (!DataGlobals::BeginDayFlag && !DataGlobals::WarmupFlag && (DataEnvironment::Month != state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).StartMonth || DataEnvironment::DayOfMonth != state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).StartDay) && - !state.dataWeatherManager->DatesShouldBeReset && state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).KindOfEnvrn == DataGlobals::ksRunPeriodWeather) { + !state.dataWeatherManager->DatesShouldBeReset && state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).KindOfEnvrn == DataGlobalConstants::KindOfSim::RunPeriodWeather) { state.dataWeatherManager->DatesShouldBeReset = true; } - if (DataGlobals::EndEnvrnFlag && (state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).KindOfEnvrn != DataGlobals::ksDesignDay) && - (state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).KindOfEnvrn != DataGlobals::ksHVACSizeDesignDay)) { + if (DataGlobals::EndEnvrnFlag && (state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).KindOfEnvrn != DataGlobalConstants::KindOfSim::DesignDay) && + (state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).KindOfEnvrn != DataGlobalConstants::KindOfSim::HVACSizeDesignDay)) { state.files.inputWeatherFile.rewind(); SkipEPlusWFHeader(state); ReportMissing_RangeData(state); @@ -1924,7 +1924,7 @@ namespace WeatherManager { DataEnvironment::OutDewPointTemp = DataEnvironment::OutWetBulbTemp; } - if ((DataGlobals::KindOfSim == DataGlobals::ksDesignDay) || (DataGlobals::KindOfSim == DataGlobals::ksHVACSizeDesignDay)) { + if ((state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::DesignDay) || (state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::HVACSizeDesignDay)) { state.dataWeatherManager->SPSiteDryBulbRangeModScheduleValue = -999.0; // N/A Drybulb Temperature Range Modifier Schedule Value state.dataWeatherManager->SPSiteHumidityConditionScheduleValue = -999.0; // N/A Humidity Condition Schedule Value state.dataWeatherManager->SPSiteBeamSolarScheduleValue = -999.0; // N/A Beam Solar Schedule Value @@ -2384,7 +2384,7 @@ namespace WeatherManager { } // Positioned to proper day - if (!DataGlobals::KickOffSimulation && !DataGlobals::DoingSizing && state.dataWeatherManager->Environment(Environ).KindOfEnvrn == DataGlobals::ksRunPeriodWeather) { + if (!DataGlobals::KickOffSimulation && !DataGlobals::DoingSizing && state.dataWeatherManager->Environment(Environ).KindOfEnvrn == DataGlobalConstants::KindOfSim::RunPeriodWeather) { ++state.dataWeatherManager->Environment(Environ).CurrentCycle; if (!state.dataWeatherManager->Environment(Environ).RollDayTypeOnRepeat) { SetDayOfWeekInitialValues(state.dataWeatherManager->Environment(Environ).DayOfWeek, state.dataWeatherManager->CurDayOfWeek); @@ -4335,7 +4335,7 @@ namespace WeatherManager { // in this module. At some point, this subroutine will be converted // to read information directly from the new input file. - if (state.dataWeatherManager->Environment( state.dataWeatherManager->NumOfEnvrn).KindOfEnvrn == DataGlobals::ksRunPeriodWeather && state.dataWeatherManager->WeatherFileExists) { + if (state.dataWeatherManager->Environment( state.dataWeatherManager->NumOfEnvrn).KindOfEnvrn == DataGlobalConstants::KindOfSim::RunPeriodWeather && state.dataWeatherManager->WeatherFileExists) { if (state.dataWeatherManager->LocationGathered) { // See if "matching" location if (std::abs(DataEnvironment::Latitude - state.dataWeatherManager->WeatherFileLatitude) > 1.0 || @@ -4685,17 +4685,17 @@ namespace WeatherManager { // Set all Environments to DesignDay and then the weather environment will be set // in the get annual run data subroutine for (int Env = 1; Env <= DataEnvironment::TotDesDays; ++Env) { - state.dataWeatherManager->Environment(Env).KindOfEnvrn = DataGlobals::ksDesignDay; + state.dataWeatherManager->Environment(Env).KindOfEnvrn = DataGlobalConstants::KindOfSim::DesignDay; } for (int Env = 1; Env <= RPD1 + RPD2; ++Env) { if (!DataSystemVariables::DDOnly) { - state.dataWeatherManager->Environment(DataEnvironment::TotDesDays + Env).KindOfEnvrn = DataGlobals::ksRunPeriodDesign; + state.dataWeatherManager->Environment(DataEnvironment::TotDesDays + Env).KindOfEnvrn = DataGlobalConstants::KindOfSim::RunPeriodDesign; } else { - state.dataWeatherManager->Environment(DataEnvironment::TotDesDays + Env).KindOfEnvrn = DataGlobals::ksRunPeriodWeather; + state.dataWeatherManager->Environment(DataEnvironment::TotDesDays + Env).KindOfEnvrn = DataGlobalConstants::KindOfSim::RunPeriodWeather; } } for (int Env = 1; Env <= state.dataWeatherManager->TotRunPers; ++Env) { - state.dataWeatherManager->Environment(DataEnvironment::TotDesDays + RPD1 + RPD2 + Env).KindOfEnvrn = DataGlobals::ksRunPeriodWeather; + state.dataWeatherManager->Environment(DataEnvironment::TotDesDays + RPD1 + RPD2 + Env).KindOfEnvrn = DataGlobalConstants::KindOfSim::RunPeriodWeather; } if (DataEnvironment::TotDesDays >= 1) { @@ -5107,7 +5107,7 @@ namespace WeatherManager { if (nRunPeriods == 0 && DataSystemVariables::FullAnnualRun) { ShowWarningError("No Run Periods input but Full Annual Simulation selected. Adding Run Period to 1/1 through 12/31."); state.dataWeatherManager->Environment.redimension(++ state.dataWeatherManager->NumOfEnvrn); - state.dataWeatherManager->Environment( state.dataWeatherManager->NumOfEnvrn).KindOfEnvrn = DataGlobals::ksRunPeriodWeather; + state.dataWeatherManager->Environment( state.dataWeatherManager->NumOfEnvrn).KindOfEnvrn = DataGlobalConstants::KindOfSim::RunPeriodWeather; nRunPeriods = 1; DataGlobals::WeathSimReq = true; state.dataWeatherManager->RunPeriodInput.allocate(nRunPeriods); @@ -6443,7 +6443,7 @@ namespace WeatherManager { } state.dataWeatherManager->Environment(EnvrnNum).Title = state.dataWeatherManager->DesDayInput(EnvrnNum).Title; - state.dataWeatherManager->Environment(EnvrnNum).KindOfEnvrn = DataGlobals::ksDesignDay; + state.dataWeatherManager->Environment(EnvrnNum).KindOfEnvrn = DataGlobalConstants::KindOfSim::DesignDay; state.dataWeatherManager->Environment(EnvrnNum).DesignDayNum = EnvrnNum; state.dataWeatherManager->Environment(EnvrnNum).RunPeriodDesignNum = 0; state.dataWeatherManager->Environment(EnvrnNum).TotalDays = 1; @@ -6574,7 +6574,7 @@ namespace WeatherManager { if (DataIPShortCuts::cAlphaArgs(1).empty()) { Found = 0; for (int j = 1; j <= state.dataWeatherManager->NumOfEnvrn; ++j) { - if (state.dataWeatherManager->Environment(j).KindOfEnvrn != DataGlobals::ksRunPeriodWeather) continue; + if (state.dataWeatherManager->Environment(j).KindOfEnvrn != DataGlobalConstants::KindOfSim::RunPeriodWeather) continue; if (state.dataWeatherManager->Environment(j).WP_Type1 != 0) { ShowSevereError(RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\", indicated Environment Name already assigned."); @@ -6664,8 +6664,8 @@ namespace WeatherManager { if (state.dataWeatherManager->WPSkyTemperature(i).IsSchedule) { state.dataWeatherManager->WPSkyTemperature(i).ScheduleName = DataIPShortCuts::cAlphaArgs(3); - if (state.dataWeatherManager->Environment(Found).KindOfEnvrn == DataGlobals::ksRunPeriodWeather || - state.dataWeatherManager->Environment(Found).KindOfEnvrn == DataGlobals::ksRunPeriodDesign) { + if (state.dataWeatherManager->Environment(Found).KindOfEnvrn == DataGlobalConstants::KindOfSim::RunPeriodWeather || + state.dataWeatherManager->Environment(Found).KindOfEnvrn == DataGlobalConstants::KindOfSim::RunPeriodDesign) { state.dataWeatherManager->WPSkyTemperature(i).ScheduleName = DataIPShortCuts::cAlphaArgs(3); // See if it's a schedule. Found = ScheduleManager::GetScheduleIndex(state, DataIPShortCuts::cAlphaArgs(3)); @@ -8211,7 +8211,7 @@ namespace WeatherManager { env.UseHolidays = runPer.useHolidays; env.Title = runPer.title; env.cKindOfEnvrn = runPer.periodType; - env.KindOfEnvrn = DataGlobals::ksRunPeriodDesign; + env.KindOfEnvrn = DataGlobalConstants::KindOfSim::RunPeriodDesign; env.DesignDayNum = 0; env.RunPeriodDesignNum = i; env.DayOfWeek = runPer.dayOfWeek; @@ -8295,11 +8295,11 @@ namespace WeatherManager { } else { env.Title = runPer.title; } - if (env.KindOfEnvrn == DataGlobals::ksReadAllWeatherData) { + if (env.KindOfEnvrn == DataGlobalConstants::KindOfSim::ReadAllWeatherData) { env.cKindOfEnvrn = "ReadAllWeatherDataRunPeriod"; } else { env.cKindOfEnvrn = "WeatherFileRunPeriod"; - env.KindOfEnvrn = DataGlobals::ksRunPeriodWeather; + env.KindOfEnvrn = DataGlobalConstants::KindOfSim::RunPeriodWeather; } env.DayOfWeek = runPer.dayOfWeek; env.MonWeekDay = runPer.monWeekDay; diff --git a/src/EnergyPlus/WeatherManager.hh b/src/EnergyPlus/WeatherManager.hh index 54d9fa6a478..ebb7826f790 100644 --- a/src/EnergyPlus/WeatherManager.hh +++ b/src/EnergyPlus/WeatherManager.hh @@ -146,7 +146,7 @@ namespace WeatherManager { // Members std::string Title; // Environment name std::string cKindOfEnvrn; // kind of environment - int KindOfEnvrn; // Type of environment (see Parameters for KindOfSim in DataGlobals) + DataGlobalConstants::KindOfSim KindOfEnvrn; // Type of environment (see Parameters for KindOfSim in DataGlobals) int DesignDayNum; // index in DesignDay structure and DesignDayInput int RunPeriodDesignNum; // for WeatherFileDays, index in RunPeriodDesign and RunPeriodDesignInput int SeedEnvrnNum; // for HVAC sizing sim, new environments are copies of original environments, this is the index for original @@ -185,7 +185,8 @@ namespace WeatherManager { // Default Constructor EnvironmentData() - : KindOfEnvrn(0), DesignDayNum(0), RunPeriodDesignNum(0), SeedEnvrnNum(0), HVACSizingIterationNum(0), TotalDays(0), StartJDay(0), + : KindOfEnvrn(DataGlobalConstants::KindOfSim::Unassigned), DesignDayNum(0), RunPeriodDesignNum(0), SeedEnvrnNum(0), + HVACSizingIterationNum(0), TotalDays(0), StartJDay(0), StartMonth(0), StartDay(0), StartYear(0), StartDate(0), EndMonth(0), EndDay(0), EndJDay(0), EndYear(0), EndDate(0), DayOfWeek(0), UseDST(false), UseHolidays(false), ApplyWeekendRule(false), UseRain(true), UseSnow(true), MonWeekDay(12, 0), SetWeekDays(false), NumSimYears(1), CurrentCycle(0), WP_Type1(0), SkyTempModel(EmissivityCalcType::ClarkAllenModel), UseWeatherFileHorizontalIR(true), diff --git a/src/EnergyPlus/ZoneTempPredictorCorrector.cc b/src/EnergyPlus/ZoneTempPredictorCorrector.cc index 04a1d77c293..04cb42674d2 100644 --- a/src/EnergyPlus/ZoneTempPredictorCorrector.cc +++ b/src/EnergyPlus/ZoneTempPredictorCorrector.cc @@ -6971,7 +6971,7 @@ namespace ZoneTempPredictorCorrector { // FLOW: // adjust zone operative setpoint if (!(TempControlledZone(TempControlledZoneID).AdaptiveComfortTempControl)) return; // do nothing to setpoint - if ((state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).KindOfEnvrn != ksDesignDay) && (state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).KindOfEnvrn != ksHVACSizeDesignDay)) { + if ((state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).KindOfEnvrn != DataGlobalConstants::KindOfSim::DesignDay) && (state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).KindOfEnvrn != DataGlobalConstants::KindOfSim::HVACSizeDesignDay)) { // Adjust run period cooling set point switch (AdaptiveComfortModelTypeIndex) { case static_cast(AdaptiveComfortModel::ASH55_CENTRAL): diff --git a/src/EnergyPlus/api/datatransfer.cc b/src/EnergyPlus/api/datatransfer.cc index 259003995da..9c6ca112777 100644 --- a/src/EnergyPlus/api/datatransfer.cc +++ b/src/EnergyPlus/api/datatransfer.cc @@ -660,8 +660,9 @@ int currentEnvironmentNum(EnergyPlusState) { return EnergyPlus::DataEnvironment::CurEnvirNum; } -int kindOfSim(EnergyPlusState) { - return EnergyPlus::DataGlobals::KindOfSim; +int kindOfSim(EnergyPlusState state) { + auto *thisState = reinterpret_cast(state); + return static_cast(thisState->dataGlobal->KindOfSim); } int getConstructionHandle(EnergyPlusState state, const char* constructionName) { diff --git a/tst/EnergyPlus/unit/EconomicTariff.unit.cc b/tst/EnergyPlus/unit/EconomicTariff.unit.cc index b31247fabf2..bb4692c515f 100644 --- a/tst/EnergyPlus/unit/EconomicTariff.unit.cc +++ b/tst/EnergyPlus/unit/EconomicTariff.unit.cc @@ -617,7 +617,7 @@ TEST_F(EnergyPlusFixture, EconomicTariff_GatherForEconomics) EXPECT_EQ(EconomicTariff::seasonSummer, EconomicTariff::chargeSimple(2).season); EXPECT_EQ(0.04, EconomicTariff::chargeSimple(2).costPerVal); - DataGlobals::KindOfSim = DataGlobals::ksRunPeriodWeather; // fake a weather run + state.dataGlobal->KindOfSim = DataGlobalConstants::KindOfSim::RunPeriodWeather; // fake a weather run // Unitialized: default initialized to 0 EXPECT_EQ(0, EconomicTariff::tariff(1).seasonForMonth(5)); diff --git a/tst/EnergyPlus/unit/HVACSizingSimulationManager.unit.cc b/tst/EnergyPlus/unit/HVACSizingSimulationManager.unit.cc index 59fba9d3dcd..7db677f8123 100644 --- a/tst/EnergyPlus/unit/HVACSizingSimulationManager.unit.cc +++ b/tst/EnergyPlus/unit/HVACSizingSimulationManager.unit.cc @@ -84,10 +84,10 @@ class HVACSizingSimulationManagerTest : public EnergyPlusFixture // setup weather manager state needed state.dataWeatherManager->NumOfEnvrn = 2; state.dataWeatherManager->Environment.allocate(state.dataWeatherManager->NumOfEnvrn); - state.dataWeatherManager->Environment(1).KindOfEnvrn = ksDesignDay; + state.dataWeatherManager->Environment(1).KindOfEnvrn = DataGlobalConstants::KindOfSim::DesignDay; state.dataWeatherManager->Environment(1).DesignDayNum = 1; - state.dataWeatherManager->Environment(2).KindOfEnvrn = ksDesignDay; + state.dataWeatherManager->Environment(2).KindOfEnvrn = DataGlobalConstants::KindOfSim::DesignDay; state.dataWeatherManager->Environment(2).DesignDayNum = 2; // setup plant sizing data structure @@ -152,17 +152,17 @@ TEST_F(HVACSizingSimulationManagerTest, WeatherFileDaysTest3) // setup weather manager state needed state.dataWeatherManager->NumOfEnvrn = 4; state.dataWeatherManager->Environment.allocate(state.dataWeatherManager->NumOfEnvrn); - state.dataWeatherManager->Environment(1).KindOfEnvrn = ksDesignDay; + state.dataWeatherManager->Environment(1).KindOfEnvrn = DataGlobalConstants::KindOfSim::DesignDay; state.dataWeatherManager->Environment(1).DesignDayNum = 1; - state.dataWeatherManager->Environment(2).KindOfEnvrn = ksDesignDay; + state.dataWeatherManager->Environment(2).KindOfEnvrn = DataGlobalConstants::KindOfSim::DesignDay; state.dataWeatherManager->Environment(2).DesignDayNum = 2; - state.dataWeatherManager->Environment(3).KindOfEnvrn = ksRunPeriodDesign; + state.dataWeatherManager->Environment(3).KindOfEnvrn = DataGlobalConstants::KindOfSim::RunPeriodDesign; state.dataWeatherManager->Environment(3).DesignDayNum = 0; state.dataWeatherManager->Environment(3).TotalDays = 4; - state.dataWeatherManager->Environment(4).KindOfEnvrn = ksRunPeriodDesign; + state.dataWeatherManager->Environment(4).KindOfEnvrn = DataGlobalConstants::KindOfSim::RunPeriodDesign; state.dataWeatherManager->Environment(4).DesignDayNum = 0; state.dataWeatherManager->Environment(4).TotalDays = 4; @@ -184,7 +184,7 @@ TEST_F(HVACSizingSimulationManagerTest, WeatherFileDaysTest3) TimeStepSys = TimeStepZone / NumOfSysTimeSteps; // first HVAC Sizing Simulation DD emulation - KindOfSim = ksHVACSizeDesignDay; + state.dataGlobal->KindOfSim = DataGlobalConstants::KindOfSim::HVACSizeDesignDay; DayOfSim = 1; state.dataWeatherManager->Envrn = 5; state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).DesignDayNum = 1; @@ -208,7 +208,7 @@ TEST_F(HVACSizingSimulationManagerTest, WeatherFileDaysTest3) } // ... End hour loop. // second HVAC Sizing Simulation DD emulation - KindOfSim = ksHVACSizeDesignDay; + state.dataGlobal->KindOfSim = DataGlobalConstants::KindOfSim::HVACSizeDesignDay; DayOfSim = 1; state.dataWeatherManager->Envrn = 6; @@ -232,8 +232,8 @@ TEST_F(HVACSizingSimulationManagerTest, WeatherFileDaysTest3) } // TimeStep loop } // End hour loop. - // first HVAC Sizing Simulation WEatherFileDAys emulation - KindOfSim = ksHVACSizeRunPeriodDesign; + // first HVAC Sizing Simulation WeatherFileDays emulation + state.dataGlobal->KindOfSim = DataGlobalConstants::KindOfSim::HVACSizeRunPeriodDesign; DayOfSim = 0; state.dataWeatherManager->Envrn = 7; NumOfDayInEnvrn = 4; @@ -259,7 +259,7 @@ TEST_F(HVACSizingSimulationManagerTest, WeatherFileDaysTest3) } // day loop // second HVAC Sizing Simulation WEatherFileDAys emulation - KindOfSim = ksHVACSizeRunPeriodDesign; + state.dataGlobal->KindOfSim = DataGlobalConstants::KindOfSim::HVACSizeRunPeriodDesign; DayOfSim = 0; state.dataWeatherManager->Envrn = 8; NumOfDayInEnvrn = 4; @@ -378,7 +378,7 @@ TEST_F(HVACSizingSimulationManagerTest, TopDownTestSysTimestep3) TimeStepSys = TimeStepZone / NumOfSysTimeSteps; // first HVAC Sizing Simulation DD emulation - KindOfSim = 4; + state.dataGlobal->KindOfSim = DataGlobalConstants::KindOfSim::HVACSizeDesignDay; DayOfSim = 1; state.dataWeatherManager->Envrn = 3; state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).DesignDayNum = 1; @@ -401,7 +401,7 @@ TEST_F(HVACSizingSimulationManagerTest, TopDownTestSysTimestep3) } // ... End hour loop. // second HVAC Sizing Simulation DD emulation - KindOfSim = 4; + state.dataGlobal->KindOfSim = DataGlobalConstants::KindOfSim::HVACSizeDesignDay; DayOfSim = 1; state.dataWeatherManager->Envrn = 4; state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).DesignDayNum = 2; @@ -510,7 +510,7 @@ TEST_F(HVACSizingSimulationManagerTest, TopDownTestSysTimestep1) TimeStepSys = TimeStepZone / NumOfSysTimeSteps; // first HVAC Sizing Simulation DD emulation - KindOfSim = 4; + state.dataGlobal->KindOfSim = DataGlobalConstants::KindOfSim::HVACSizeDesignDay; DayOfSim = 1; state.dataWeatherManager->Envrn = 3; state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).DesignDayNum = 1; @@ -535,7 +535,7 @@ TEST_F(HVACSizingSimulationManagerTest, TopDownTestSysTimestep1) } // ... End hour loop. // second HVAC Sizing Simulation DD emulation - KindOfSim = 4; + state.dataGlobal->KindOfSim = DataGlobalConstants::KindOfSim::HVACSizeDesignDay; DayOfSim = 1; state.dataWeatherManager->Envrn = 4; state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).DesignDayNum = 2; @@ -594,7 +594,7 @@ TEST_F(HVACSizingSimulationManagerTest, VarySysTimesteps) TimeStepSys = TimeStepZone / NumOfSysTimeSteps; // first HVAC Sizing Simulation DD emulation - KindOfSim = 4; + state.dataGlobal->KindOfSim = DataGlobalConstants::KindOfSim::HVACSizeDesignDay; DayOfSim = 1; state.dataWeatherManager->Envrn = 3; state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).DesignDayNum = 1; @@ -622,7 +622,7 @@ TEST_F(HVACSizingSimulationManagerTest, VarySysTimesteps) } // ... End hour loop. // second HVAC Sizing Simulation DD emulation - KindOfSim = 4; + state.dataGlobal->KindOfSim = DataGlobalConstants::KindOfSim::HVACSizeDesignDay; DayOfSim = 1; state.dataWeatherManager->Envrn = 4; state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).DesignDayNum = 2; diff --git a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc index 7b7a5703782..133097b46c1 100644 --- a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc @@ -2617,7 +2617,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestResilienceMetricReport) { int NumOfZones = 1; - DataGlobals::KindOfSim = DataGlobals::ksRunPeriodWeather; + state.dataGlobal->KindOfSim = DataGlobalConstants::KindOfSim::RunPeriodWeather; OutputReportTabular::displayThermalResilienceSummary = true; DataEnvironment::Month = 7; DataEnvironment::DayOfMonth = 1; @@ -2661,7 +2661,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestResilienceMetricReport) DataHeatBalFanSys::ZTAV(1) = 25; DataHeatBalFanSys::ZoneAirHumRatAvg(1) = 0.00988; // RH = 50% CalcThermalResilience(state); - ReportThermalResilience(); + ReportThermalResilience(state); EXPECT_NEAR(25, DataHeatBalFanSys::ZoneHeatIndex(1), 0.5); EXPECT_NEAR(28, DataHeatBalFanSys::ZoneHumidex(1), 1); @@ -2670,7 +2670,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestResilienceMetricReport) DataHeatBalFanSys::ZTAV(1) = 27; DataHeatBalFanSys::ZoneAirHumRatAvg(1) = 0.02035; // RH = 90% CalcThermalResilience(state); - ReportThermalResilience(); + ReportThermalResilience(state); EXPECT_NEAR(31, DataHeatBalFanSys::ZoneHeatIndex(1), 0.5); EXPECT_NEAR(39, DataHeatBalFanSys::ZoneHumidex(1), 1); @@ -2679,7 +2679,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestResilienceMetricReport) DataHeatBalFanSys::ZTAV(1) = 27; DataHeatBalFanSys::ZoneAirHumRatAvg(1) = 0.0022; // RH = 10% CalcThermalResilience(state); - ReportThermalResilience(); + ReportThermalResilience(state); EXPECT_NEAR(26, DataHeatBalFanSys::ZoneHeatIndex(1), 0.5); EXPECT_NEAR(23, DataHeatBalFanSys::ZoneHumidex(1), 1); @@ -2688,7 +2688,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestResilienceMetricReport) DataHeatBalFanSys::ZTAV(1) = 30; DataHeatBalFanSys::ZoneAirHumRatAvg(1) = 0.01604; // RH = 60% CalcThermalResilience(state); - ReportThermalResilience(); + ReportThermalResilience(state); EXPECT_NEAR(33, DataHeatBalFanSys::ZoneHeatIndex(1), 0.5); EXPECT_NEAR(38, DataHeatBalFanSys::ZoneHumidex(1), 1); @@ -2712,7 +2712,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestResilienceMetricReport) for (int hour = 5; hour <= 7; hour++) { DataGlobals::HourOfDay = hour; // CalcThermalResilience(state); - ReportThermalResilience(); + ReportThermalResilience(state); } // Test SET-hours calculation - Heating unmet EXPECT_EQ(3, DataHeatBalFanSys::ZoneLowSETHours(1)[0]); // SET Hours = (12.2 - 11.2) * 3 Hours @@ -2721,7 +2721,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestResilienceMetricReport) EnergyPlus::ThermalComfort::ThermalComfortData(1).PierceSET = 32; for (int hour = 8; hour <= 10; hour++) { DataGlobals::HourOfDay = hour; - ReportThermalResilience(); + ReportThermalResilience(state); } // Test SET-hours calculation - Cooling unmet EXPECT_EQ(6, DataHeatBalFanSys::ZoneHighSETHours(1)[0]); // SET Hours = (32 - 30) * 3 Hours @@ -2730,17 +2730,17 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestResilienceMetricReport) EnergyPlus::ThermalComfort::ThermalComfortData(1).PierceSET = 25; for (int hour = 11; hour <= 12; hour++) { DataGlobals::HourOfDay = hour; - ReportThermalResilience(); + ReportThermalResilience(state); } EnergyPlus::ThermalComfort::ThermalComfortData(1).PierceSET = 11.2; for (int hour = 13; hour <= 18; hour++) { DataGlobals::HourOfDay = hour; - ReportThermalResilience(); + ReportThermalResilience(state); } ScheduleManager::Schedule(1).CurrentValue = 0; for (int hour = 18; hour <= 20; hour++) { DataGlobals::HourOfDay = hour; - ReportThermalResilience(); + ReportThermalResilience(state); } // Test SET longest duration calculation @@ -2758,7 +2758,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestResilienceMetricReport) ScheduleManager::Schedule(1).CurrentValue = 1; OutputReportTabular::displayCO2ResilienceSummary = true; DataContaminantBalance::ZoneAirCO2Avg(1) = 1100; - ReportCO2Resilience(); + ReportCO2Resilience(state); EXPECT_EQ(1, DataHeatBalFanSys::ZoneCO2LevelHourBins(1)[1]); EXPECT_EQ(2, DataHeatBalFanSys::ZoneCO2LevelOccuHourBins(1)[1]); @@ -2773,7 +2773,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestResilienceMetricReport) DataDaylighting::ZoneDaylight(1).IllumSetPoint(1) = 400; OutputReportTabular::displayVisualResilienceSummary = true; - ReportVisualResilience(); + ReportVisualResilience(state); EXPECT_EQ(1, DataHeatBalFanSys::ZoneLightingLevelHourBins(1)[2]); EXPECT_EQ(2, DataHeatBalFanSys::ZoneLightingLevelOccuHourBins(1)[2]); diff --git a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc index 36a6ff6c8ef..acd63ff1630 100644 --- a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc +++ b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc @@ -1449,7 +1449,7 @@ TEST_F(EnergyPlusFixture, OutputReportTabular_ZoneMultiplierTest) 0.00001); DataGlobals::DoWeathSim = true; // flag to trick tabular reports to scan meters - DataGlobals::KindOfSim = DataGlobals::ksRunPeriodWeather; // fake a weather run since a weather file can't be used (could it?) + state.dataGlobal->KindOfSim = DataGlobalConstants::KindOfSim::RunPeriodWeather; // fake a weather run since a weather file can't be used (could it?) UpdateTabularReports(state, OutputProcessor::TimeStepType::TimeStepSystem); // zone equipment should report single zone magnitude, multipliers do not apply, should be > 0 or what's the point @@ -2477,7 +2477,7 @@ TEST_F(EnergyPlusFixture, AirloopHVAC_ZoneSumTest) EXPECT_EQ(10.0, (Zone(2).Volume * Zone(2).Multiplier * Zone(2).ListMultiplier) / (Zone(1).Volume * Zone(1).Multiplier * Zone(1).ListMultiplier)); DataGlobals::DoWeathSim = true; // flag to trick tabular reports to scan meters - DataGlobals::KindOfSim = DataGlobals::ksRunPeriodWeather; // fake a weather run since a weather file can't be used (could it?) + state.dataGlobal->KindOfSim = DataGlobalConstants::KindOfSim::RunPeriodWeather; // fake a weather run since a weather file can't be used (could it?) UpdateTabularReports(state, OutputProcessor::TimeStepType::TimeStepSystem); EXPECT_NEAR(1.86168, DataSizing::FinalSysSizing(1).DesOutAirVolFlow, 0.0001); @@ -3452,7 +3452,7 @@ TEST_F(EnergyPlusFixture, AirloopHVAC_ZoneSumTest) // ).ListMultiplier ) ); // DataGlobals::DoWeathSim = true; // flag to trick tabular reports to scan meters -// DataGlobals::KindOfSim = DataGlobals::ksRunPeriodWeather; // fake a weather run since a weather file can't be used (could it?) +// DataGlobals::KindOfSim = DataGlobalConstants::KindOfSim::RunPeriodWeather; // fake a weather run since a weather file can't be used (could it?) // UpdateTabularReports( OutputProcessor::TimeStepType::TimeStepSystem ); // EXPECT_NEAR( 1.86168, DataSizing::FinalSysSizing( 1 ).DesOutAirVolFlow, 0.0001 ); diff --git a/tst/EnergyPlus/unit/SQLite.unit.cc b/tst/EnergyPlus/unit/SQLite.unit.cc index 18584cfcbd6..31e88774d81 100644 --- a/tst/EnergyPlus/unit/SQLite.unit.cc +++ b/tst/EnergyPlus/unit/SQLite.unit.cc @@ -117,10 +117,10 @@ TEST_F(SQLiteFixture, SQLiteProcedures_createSQLiteEnvironmentPeriodRecord) EnergyPlus::sqlite->sqliteBegin(); // There needs to be a simulation record otherwise the foreign key constraint will fail EnergyPlus::sqlite->createSQLiteSimulationsRecord(1, "EnergyPlus Version", "Current Time"); - EnergyPlus::sqlite->createSQLiteEnvironmentPeriodRecord(1, "CHICAGO ANN HTG 99.6% CONDNS DB", 1); - EnergyPlus::sqlite->createSQLiteEnvironmentPeriodRecord(2, "CHICAGO ANN CLG .4% CONDNS WB=>MDB", 1, 1); - EnergyPlus::sqlite->createSQLiteEnvironmentPeriodRecord(3, "CHICAGO ANN HTG 99.6% CONDNS DB", 2); - EnergyPlus::sqlite->createSQLiteEnvironmentPeriodRecord(4, "CHICAGO ANN CLG .4% CONDNS WB=>MDB", 3, 1); + EnergyPlus::sqlite->createSQLiteEnvironmentPeriodRecord(1, "CHICAGO ANN HTG 99.6% CONDNS DB", DataGlobalConstants::KindOfSim::DesignDay); + EnergyPlus::sqlite->createSQLiteEnvironmentPeriodRecord(2, "CHICAGO ANN CLG .4% CONDNS WB=>MDB", DataGlobalConstants::KindOfSim::DesignDay, 1); + EnergyPlus::sqlite->createSQLiteEnvironmentPeriodRecord(3, "CHICAGO ANN HTG 99.6% CONDNS DB", DataGlobalConstants::KindOfSim::RunPeriodDesign); + EnergyPlus::sqlite->createSQLiteEnvironmentPeriodRecord(4, "CHICAGO ANN CLG .4% CONDNS WB=>MDB", DataGlobalConstants::KindOfSim::RunPeriodWeather, 1); auto result = queryResult("SELECT * FROM EnvironmentPeriods;", "EnvironmentPeriods"); EnergyPlus::sqlite->sqliteCommit(); @@ -136,9 +136,9 @@ TEST_F(SQLiteFixture, SQLiteProcedures_createSQLiteEnvironmentPeriodRecord) EnergyPlus::sqlite->sqliteBegin(); // This should fail to insert due to foreign key constraint - EnergyPlus::sqlite->createSQLiteEnvironmentPeriodRecord(5, "CHICAGO ANN HTG 99.6% CONDNS DB", 1, 100); + EnergyPlus::sqlite->createSQLiteEnvironmentPeriodRecord(5, "CHICAGO ANN HTG 99.6% CONDNS DB", DataGlobalConstants::KindOfSim::DesignDay, 100); // This should fail to insert due to duplicate primary key - EnergyPlus::sqlite->createSQLiteEnvironmentPeriodRecord(4, "CHICAGO ANN CLG .4% CONDNS WB=>MDB", 1, 1); + EnergyPlus::sqlite->createSQLiteEnvironmentPeriodRecord(4, "CHICAGO ANN CLG .4% CONDNS WB=>MDB", DataGlobalConstants::KindOfSim::DesignDay, 1); result = queryResult("SELECT * FROM EnvironmentPeriods;", "EnvironmentPeriods"); EnergyPlus::sqlite->sqliteCommit(); diff --git a/tst/EnergyPlus/unit/SizingAnalysisObjects.unit.cc b/tst/EnergyPlus/unit/SizingAnalysisObjects.unit.cc index e4f04ae0fb1..370a6c120a7 100644 --- a/tst/EnergyPlus/unit/SizingAnalysisObjects.unit.cc +++ b/tst/EnergyPlus/unit/SizingAnalysisObjects.unit.cc @@ -90,10 +90,10 @@ class SizingAnalysisObjectsTest : public EnergyPlusFixture // setup weather manager state needed state.dataWeatherManager->NumOfEnvrn = 2; state.dataWeatherManager->Environment.allocate(state.dataWeatherManager->NumOfEnvrn); - state.dataWeatherManager->Environment(1).KindOfEnvrn = ksDesignDay; + state.dataWeatherManager->Environment(1).KindOfEnvrn = DataGlobalConstants::KindOfSim::DesignDay; state.dataWeatherManager->Environment(1).DesignDayNum = 1; - state.dataWeatherManager->Environment(2).KindOfEnvrn = ksDesignDay; + state.dataWeatherManager->Environment(2).KindOfEnvrn = DataGlobalConstants::KindOfSim::DesignDay; state.dataWeatherManager->Environment(2).DesignDayNum = 2; averagingWindow = 1; @@ -102,11 +102,11 @@ class SizingAnalysisObjectsTest : public EnergyPlusFixture state.dataWeatherManager->NumOfEnvrn = 4; state.dataWeatherManager->Environment.redimension(state.dataWeatherManager->NumOfEnvrn); - state.dataWeatherManager->Environment(3).KindOfEnvrn = ksHVACSizeDesignDay; + state.dataWeatherManager->Environment(3).KindOfEnvrn = DataGlobalConstants::KindOfSim::HVACSizeDesignDay; state.dataWeatherManager->Environment(3).DesignDayNum = 1; state.dataWeatherManager->Environment(3).SeedEnvrnNum = 1; - state.dataWeatherManager->Environment(4).KindOfEnvrn = ksHVACSizeDesignDay; + state.dataWeatherManager->Environment(4).KindOfEnvrn = DataGlobalConstants::KindOfSim::HVACSizeDesignDay; state.dataWeatherManager->Environment(4).DesignDayNum = 2; state.dataWeatherManager->Environment(4).SeedEnvrnNum = 2; @@ -155,7 +155,7 @@ TEST_F(SizingAnalysisObjectsTest, testZoneUpdateInLoggerFramework) ShowMessage("Begin Test: SizingAnalysisObjectsTest, testZoneUpdateInLoggerFramework"); // first step - KindOfSim = 4; + state.dataGlobal->KindOfSim = DataGlobalConstants::KindOfSim::HVACSizeDesignDay; DayOfSim = 1; HourOfDay = 1; state.dataWeatherManager->Envrn = 3; @@ -215,7 +215,7 @@ TEST_F(SizingAnalysisObjectsTest, BasicLogging4stepsPerHour) TestLogObj.ztStepObj.resize(TestLogObj.NumOfStepsInLogSet); // fill first step in log with zone step data - int KindOfSim(4); + state.dataGlobal->KindOfSim = DataGlobalConstants::KindOfSim::HVACSizeDesignDay; int Envrn(3); int DayOfSim(1); int HourofDay(1); @@ -224,7 +224,7 @@ TEST_F(SizingAnalysisObjectsTest, BasicLogging4stepsPerHour) int numTimeStepsInHour(4); LogVal = lowLogVal; ZoneTimestepObject tmpztStepStamp1( // call constructor - KindOfSim, Envrn, DayOfSim, HourofDay, timeStp, timeStepDuration, numTimeStepsInHour); + state.dataGlobal->KindOfSim, Envrn, DayOfSim, HourofDay, timeStp, timeStepDuration, numTimeStepsInHour); TestLogObj.FillZoneStep(tmpztStepStamp1); // fill second step log with zone step data @@ -232,21 +232,21 @@ TEST_F(SizingAnalysisObjectsTest, BasicLogging4stepsPerHour) timeStp = 2; LogVal = midLogVal; ZoneTimestepObject tmpztStepStamp2( // call constructor - KindOfSim, Envrn, DayOfSim, HourofDay, timeStp, timeStepDuration, numTimeStepsInHour); + state.dataGlobal->KindOfSim, Envrn, DayOfSim, HourofDay, timeStp, timeStepDuration, numTimeStepsInHour); TestLogObj.FillZoneStep(tmpztStepStamp2); // fill third step log with zone step data timeStp = 3; LogVal = midLogVal; ZoneTimestepObject tmpztStepStamp3( // call constructor - KindOfSim, Envrn, DayOfSim, HourofDay, timeStp, timeStepDuration, numTimeStepsInHour); + state.dataGlobal->KindOfSim, Envrn, DayOfSim, HourofDay, timeStp, timeStepDuration, numTimeStepsInHour); TestLogObj.FillZoneStep(tmpztStepStamp3); // fill fourth step log with zone step data timeStp = 4; LogVal = hiLogVal; ZoneTimestepObject tmpztStepStamp4( // call constructor - KindOfSim, Envrn, DayOfSim, HourofDay, timeStp, timeStepDuration, numTimeStepsInHour); + state.dataGlobal->KindOfSim, Envrn, DayOfSim, HourofDay, timeStp, timeStepDuration, numTimeStepsInHour); TestLogObj.FillZoneStep(tmpztStepStamp4); // now check that the correct values were stored in the right spot @@ -283,7 +283,7 @@ TEST_F(SizingAnalysisObjectsTest, LoggingDDWrap1stepPerHour) TestLogObj.ztStepObj.resize(TestLogObj.NumOfStepsInLogSet); // fill first step in log with zone step data - int KindOfSim(4); + state.dataGlobal->KindOfSim = DataGlobalConstants::KindOfSim::HVACSizeDesignDay; int Envrn(3); int DayOfSim(1); int HourofDay(1); @@ -295,7 +295,7 @@ TEST_F(SizingAnalysisObjectsTest, LoggingDDWrap1stepPerHour) for (int hr = 1; hr <= 24; ++hr) { HourofDay = hr; ZoneTimestepObject tmpztStepStamp1( // call constructor - KindOfSim, Envrn, DayOfSim, HourofDay, timeStp, timeStepDuration, numTimeStepsInHour); + state.dataGlobal->KindOfSim, Envrn, DayOfSim, HourofDay, timeStp, timeStepDuration, numTimeStepsInHour); TestLogObj.FillZoneStep(tmpztStepStamp1); } @@ -304,7 +304,7 @@ TEST_F(SizingAnalysisObjectsTest, LoggingDDWrap1stepPerHour) for (int hr = 1; hr <= 24; ++hr) { HourofDay = hr; ZoneTimestepObject tmpztStepStamp1( // call constructor - KindOfSim, Envrn, DayOfSim, HourofDay, timeStp, timeStepDuration, numTimeStepsInHour); + state.dataGlobal->KindOfSim, Envrn, DayOfSim, HourofDay, timeStp, timeStepDuration, numTimeStepsInHour); TestLogObj.FillZoneStep(tmpztStepStamp1); } @@ -339,7 +339,7 @@ TEST_F(SizingAnalysisObjectsTest, PlantCoincidentAnalyObjTest) PlantCoinicidentAnalysis TestAnalysisObj(loopName, loopNum, nodeNum, density, cp, timestepsInAvg, plantSizingIndex); // fill first step in log with zone step data - int KindOfSim(4); + state.dataGlobal->KindOfSim = DataGlobalConstants::KindOfSim::HVACSizeDesignDay; int Envrn(4); int DayOfSim(1); int HourofDay(1); @@ -348,7 +348,7 @@ TEST_F(SizingAnalysisObjectsTest, PlantCoincidentAnalyObjTest) int numTimeStepsInHour(4); ZoneTimestepObject tmpztStepStamp1( // call constructor - KindOfSim, Envrn, DayOfSim, HourofDay, timeStp, timeStepDuration, numTimeStepsInHour); + state.dataGlobal->KindOfSim, Envrn, DayOfSim, HourofDay, timeStp, timeStepDuration, numTimeStepsInHour); LogVal = 1.5; // kg/s tmpztStepStamp1.runningAvgDataValue = 1.5; sizingLoggerFrameObj.logObjs[logIndex].FillZoneStep(tmpztStepStamp1); @@ -394,7 +394,7 @@ TEST_F(SizingAnalysisObjectsTest, LoggingSubStep4stepPerHour) TestLogObj.ztStepObj.resize(TestLogObj.NumOfStepsInLogSet); - int KindOfSim(4); + state.dataGlobal->KindOfSim = DataGlobalConstants::KindOfSim::HVACSizeDesignDay; int Envrn(3); int DayOfSim(1); int HourofDay(0); @@ -408,7 +408,7 @@ TEST_F(SizingAnalysisObjectsTest, LoggingSubStep4stepPerHour) for (int timeStp = 1; timeStp <= 4; ++timeStp) { // 15 minute zone timestep for (int subTimeStp = 1; subTimeStp <= 5; ++subTimeStp) { // 5 system substeps, so 3 minute system timestep Real64 const minutesPerHour(60.0); - ZoneTimestepObject tmpztStepStamp(KindOfSim, Envrn, DayOfSim, HourofDay, timeStp, zoneTimeStepDuration, + ZoneTimestepObject tmpztStepStamp(state.dataGlobal->KindOfSim, Envrn, DayOfSim, HourofDay, timeStp, zoneTimeStepDuration, numTimeStepsInHour); // call constructor SystemTimestepObject tmpSysStepStamp; tmpSysStepStamp.CurMinuteEnd = (timeStp - 1) * (minutesPerHour * zoneTimeStepDuration) + @@ -421,7 +421,7 @@ TEST_F(SizingAnalysisObjectsTest, LoggingSubStep4stepPerHour) TestLogObj.FillSysStep(tmpztStepStamp, tmpSysStepStamp); } - ZoneTimestepObject tmpztStepStamp1(KindOfSim, Envrn, DayOfSim, HourofDay, timeStp, zoneTimeStepDuration, + ZoneTimestepObject tmpztStepStamp1(state.dataGlobal->KindOfSim, Envrn, DayOfSim, HourofDay, timeStp, zoneTimeStepDuration, numTimeStepsInHour); // call constructor TestLogObj.FillZoneStep(tmpztStepStamp1); } @@ -434,7 +434,7 @@ TEST_F(SizingAnalysisObjectsTest, LoggingSubStep4stepPerHour) for (int timeStp = 1; timeStp <= 4; ++timeStp) { // 15 minute zone timestep for (int subTimeStp = 1; subTimeStp <= 5; ++subTimeStp) { // 5 system substeps, so 3 minute system timestep Real64 const minutesPerHour(60.0); - ZoneTimestepObject tmpztStepStamp(KindOfSim, Envrn, DayOfSim, HourofDay, timeStp, zoneTimeStepDuration, + ZoneTimestepObject tmpztStepStamp(state.dataGlobal->KindOfSim, Envrn, DayOfSim, HourofDay, timeStp, zoneTimeStepDuration, numTimeStepsInHour); // call constructor SystemTimestepObject tmpSysStepStamp; tmpSysStepStamp.CurMinuteEnd = (timeStp - 1) * (minutesPerHour * zoneTimeStepDuration) + @@ -447,7 +447,7 @@ TEST_F(SizingAnalysisObjectsTest, LoggingSubStep4stepPerHour) TestLogObj.FillSysStep(tmpztStepStamp, tmpSysStepStamp); } - ZoneTimestepObject tmpztStepStamp1(KindOfSim, Envrn, DayOfSim, HourofDay, timeStp, zoneTimeStepDuration, + ZoneTimestepObject tmpztStepStamp1(state.dataGlobal->KindOfSim, Envrn, DayOfSim, HourofDay, timeStp, zoneTimeStepDuration, numTimeStepsInHour); // call constructor TestLogObj.FillZoneStep(tmpztStepStamp1); } @@ -493,7 +493,7 @@ TEST_F(SizingAnalysisObjectsTest, PlantCoincidentAnalyObjTestNullMassFlowRateTim PlantCoinicidentAnalysis TestAnalysisObj(loopName, loopNum, nodeNum, density, cp, timestepsInAvg, plantSizingIndex); // fill first step in log with zone step data - int KindOfSim(4); + state.dataGlobal->KindOfSim = DataGlobalConstants::KindOfSim::HVACSizeDesignDay; int Envrn(4); int DayOfSim(1); int HourofDay(1); @@ -502,7 +502,7 @@ TEST_F(SizingAnalysisObjectsTest, PlantCoincidentAnalyObjTestNullMassFlowRateTim int numTimeStepsInHour(4); ZoneTimestepObject tmpztStepStamp1( // call full constructor - KindOfSim, Envrn, DayOfSim, HourofDay, timeStp, timeStepDuration, numTimeStepsInHour); + state.dataGlobal->KindOfSim, Envrn, DayOfSim, HourofDay, timeStp, timeStepDuration, numTimeStepsInHour); LogVal = 1.5; // kg/s tmpztStepStamp1.runningAvgDataValue = 1.5; sizingLoggerFrameObj.logObjs[logIndex].FillZoneStep(tmpztStepStamp1); diff --git a/tst/EnergyPlus/unit/SizingManager.unit.cc b/tst/EnergyPlus/unit/SizingManager.unit.cc index cf8ee77a8dd..9620a3a44ec 100644 --- a/tst/EnergyPlus/unit/SizingManager.unit.cc +++ b/tst/EnergyPlus/unit/SizingManager.unit.cc @@ -397,7 +397,6 @@ TEST_F(EnergyPlusFixture, SizingManager_CalcdoLoadComponentPulseNowTest) bool Warmup; int HourNum; int TimeStepNum; - int KindSim; int DaySim; //Tests for when to do a pulse test for the Load Component Output Report @@ -407,9 +406,9 @@ TEST_F(EnergyPlusFixture, SizingManager_CalcdoLoadComponentPulseNowTest) Warmup = false; HourNum = 10; TimeStepNum = 1; - KindSim = EnergyPlus::DataGlobals::ksRunPeriodDesign; + state.dataGlobal->KindOfSim = EnergyPlus::DataGlobalConstants::KindOfSim::RunPeriodDesign; DaySim = 2; - Answer = CalcdoLoadComponentPulseNow(PulseSizing,Warmup,HourNum,TimeStepNum,KindSim,DaySim); + Answer = CalcdoLoadComponentPulseNow(PulseSizing,Warmup,HourNum,TimeStepNum,state.dataGlobal->KindOfSim,DaySim); ASSERT_TRUE(Answer); //Test 16: Everything as it should be to set this to true-->result should be true @@ -417,9 +416,9 @@ TEST_F(EnergyPlusFixture, SizingManager_CalcdoLoadComponentPulseNowTest) Warmup = false; HourNum = 10; TimeStepNum = 1; - KindSim = EnergyPlus::DataGlobals::ksDesignDay; + state.dataGlobal->KindOfSim = EnergyPlus::DataGlobalConstants::KindOfSim::DesignDay; DaySim = 1; - Answer = CalcdoLoadComponentPulseNow(PulseSizing,Warmup,HourNum,TimeStepNum,KindSim,DaySim); + Answer = CalcdoLoadComponentPulseNow(PulseSizing,Warmup,HourNum,TimeStepNum,state.dataGlobal->KindOfSim,DaySim); ASSERT_TRUE(Answer); //Test 2: PulseSizing is false-->result should be false @@ -427,9 +426,9 @@ TEST_F(EnergyPlusFixture, SizingManager_CalcdoLoadComponentPulseNowTest) Warmup = false; HourNum = 10; TimeStepNum = 1; - KindSim = EnergyPlus::DataGlobals::ksRunPeriodDesign; + state.dataGlobal->KindOfSim = EnergyPlus::DataGlobalConstants::KindOfSim::RunPeriodDesign; DaySim = 1; - Answer = CalcdoLoadComponentPulseNow(PulseSizing,Warmup,HourNum,TimeStepNum,KindSim,DaySim); + Answer = CalcdoLoadComponentPulseNow(PulseSizing,Warmup,HourNum,TimeStepNum,state.dataGlobal->KindOfSim,DaySim); ASSERT_FALSE(Answer); //Test 3: Warmup is true-->result should be false @@ -437,9 +436,9 @@ TEST_F(EnergyPlusFixture, SizingManager_CalcdoLoadComponentPulseNowTest) Warmup = true; HourNum = 10; TimeStepNum = 1; - KindSim = EnergyPlus::DataGlobals::ksRunPeriodDesign; + state.dataGlobal->KindOfSim = EnergyPlus::DataGlobalConstants::KindOfSim::RunPeriodDesign; DaySim = 1; - Answer = CalcdoLoadComponentPulseNow(PulseSizing,Warmup,HourNum,TimeStepNum,KindSim,DaySim); + Answer = CalcdoLoadComponentPulseNow(PulseSizing,Warmup,HourNum,TimeStepNum,state.dataGlobal->KindOfSim,DaySim); ASSERT_FALSE(Answer); //Test 4: HourNum not 10-->result should be false @@ -447,9 +446,9 @@ TEST_F(EnergyPlusFixture, SizingManager_CalcdoLoadComponentPulseNowTest) Warmup = false; HourNum = 7; TimeStepNum = 1; - KindSim = EnergyPlus::DataGlobals::ksRunPeriodDesign; + state.dataGlobal->KindOfSim = EnergyPlus::DataGlobalConstants::KindOfSim::RunPeriodDesign; DaySim = 1; - Answer = CalcdoLoadComponentPulseNow(PulseSizing,Warmup,HourNum,TimeStepNum,KindSim,DaySim); + Answer = CalcdoLoadComponentPulseNow(PulseSizing,Warmup,HourNum,TimeStepNum,state.dataGlobal->KindOfSim,DaySim); ASSERT_FALSE(Answer); //Test 5: TimeStepNum not 1-->result should be false @@ -457,9 +456,9 @@ TEST_F(EnergyPlusFixture, SizingManager_CalcdoLoadComponentPulseNowTest) Warmup = false; HourNum = 10; TimeStepNum = 2; - KindSim = EnergyPlus::DataGlobals::ksRunPeriodDesign; + state.dataGlobal->KindOfSim = EnergyPlus::DataGlobalConstants::KindOfSim::RunPeriodDesign; DaySim = 1; - Answer = CalcdoLoadComponentPulseNow(PulseSizing,Warmup,HourNum,TimeStepNum,KindSim,DaySim); + Answer = CalcdoLoadComponentPulseNow(PulseSizing,Warmup,HourNum,TimeStepNum,state.dataGlobal->KindOfSim,DaySim); ASSERT_FALSE(Answer); //Test 6: DaySim not 1 and KindSim not weather file period --> result should be false @@ -467,9 +466,9 @@ TEST_F(EnergyPlusFixture, SizingManager_CalcdoLoadComponentPulseNowTest) Warmup = false; HourNum = 10; TimeStepNum = 1; - KindSim = EnergyPlus::DataGlobals::ksDesignDay; + state.dataGlobal->KindOfSim = EnergyPlus::DataGlobalConstants::KindOfSim::DesignDay; DaySim = 2; - Answer = CalcdoLoadComponentPulseNow(PulseSizing,Warmup,HourNum,TimeStepNum,KindSim,DaySim); + Answer = CalcdoLoadComponentPulseNow(PulseSizing,Warmup,HourNum,TimeStepNum,state.dataGlobal->KindOfSim,DaySim); ASSERT_FALSE(Answer); //Test 7: everything set to make the answer false @@ -477,9 +476,9 @@ TEST_F(EnergyPlusFixture, SizingManager_CalcdoLoadComponentPulseNowTest) Warmup = true; HourNum = 2; TimeStepNum = 7; - KindSim = EnergyPlus::DataGlobals::ksDesignDay; + state.dataGlobal->KindOfSim = EnergyPlus::DataGlobalConstants::KindOfSim::DesignDay; DaySim = 2; - Answer = CalcdoLoadComponentPulseNow(PulseSizing,Warmup,HourNum,TimeStepNum,KindSim,DaySim); + Answer = CalcdoLoadComponentPulseNow(PulseSizing,Warmup,HourNum,TimeStepNum,state.dataGlobal->KindOfSim,DaySim); ASSERT_FALSE(Answer); } diff --git a/tst/EnergyPlus/unit/SolarShading.unit.cc b/tst/EnergyPlus/unit/SolarShading.unit.cc index 647dfbb665c..117040b201f 100644 --- a/tst/EnergyPlus/unit/SolarShading.unit.cc +++ b/tst/EnergyPlus/unit/SolarShading.unit.cc @@ -1056,7 +1056,7 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_ExternalShadingIO) DataGlobals::TimeStep = 4; DataGlobals::HourOfDay = 9; DataGlobals::DoingSizing = false; - DataGlobals::KindOfSim = DataGlobals::ksRunPeriodWeather; + state.dataGlobal->KindOfSim = DataGlobalConstants::KindOfSim::RunPeriodWeather; compare_err_stream(""); // just for debugging diff --git a/tst/EnergyPlus/unit/WeatherManager.unit.cc b/tst/EnergyPlus/unit/WeatherManager.unit.cc index 168d0b30777..db410e01863 100644 --- a/tst/EnergyPlus/unit/WeatherManager.unit.cc +++ b/tst/EnergyPlus/unit/WeatherManager.unit.cc @@ -690,7 +690,7 @@ TEST_F(EnergyPlusFixture, WeatherManager_NoLocation) { EXPECT_TRUE(compare_err_stream(error_string, true)); EXPECT_EQ(1, state.dataWeatherManager->NumOfEnvrn); - EXPECT_EQ(state.dataWeatherManager->Environment(1).KindOfEnvrn, DataGlobals::ksDesignDay); + EXPECT_EQ(state.dataWeatherManager->Environment(1).KindOfEnvrn, DataGlobalConstants::KindOfSim::DesignDay); } // Test for https://github.com/NREL/EnergyPlus/issues/7550 diff --git a/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc b/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc index 4a48a75f228..67dfb5f80b5 100644 --- a/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc +++ b/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc @@ -829,7 +829,7 @@ TEST_F(EnergyPlusFixture, ZoneTempPredictorCorrector_AdaptiveThermostat) state.dataWeatherManager->Envrn = 1; state.dataWeatherManager->Environment.allocate(1); state.dataWeatherManager->DesDayInput.allocate(1); - state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).KindOfEnvrn = ksRunPeriodWeather; + state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).KindOfEnvrn = DataGlobalConstants::KindOfSim::RunPeriodWeather; state.dataWeatherManager->DesDayInput(state.dataWeatherManager->Envrn).DayType = summerDesignDayTypeIndex; state.dataWeatherManager->DesDayInput(state.dataWeatherManager->Envrn).MaxDryBulb = 30.0; state.dataWeatherManager->DesDayInput(state.dataWeatherManager->Envrn).DailyDBRange = 10.0; From dafa5b75b1f35da30dc787ef44993cdf18999281 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Thu, 8 Oct 2020 15:18:31 -0600 Subject: [PATCH 04/15] moving constants DataGlobals to DataGlobalConstants --- .../AirflowNetwork/src/Elements.cpp | 18 +- src/EnergyPlus/AirflowNetwork/src/Solver.cpp | 8 +- .../AirflowNetworkBalanceManager.cc | 29 ++- src/EnergyPlus/ConvectionCoefficients.cc | 6 +- src/EnergyPlus/CrossVentMgr.cc | 2 +- src/EnergyPlus/CurveManager.cc | 4 +- src/EnergyPlus/DElightManagerF.cc | 8 +- src/EnergyPlus/DXFEarClipping.cc | 16 +- src/EnergyPlus/DataContaminantBalance.cc | 1 - src/EnergyPlus/DataGlobalConstants.hh | 12 +- src/EnergyPlus/DataGlobals.cc | 6 - src/EnergyPlus/DataGlobals.hh | 6 - src/EnergyPlus/DataHeatBalance.cc | 54 +++--- src/EnergyPlus/DaylightingDevices.cc | 29 ++- src/EnergyPlus/DaylightingManager.cc | 166 +++++++++--------- src/EnergyPlus/EarthTube.cc | 16 +- src/EnergyPlus/General.cc | 56 +++--- src/EnergyPlus/GeneralRoutines.cc | 4 +- src/EnergyPlus/GroundHeatExchangers.cc | 59 +++---- .../KusudaAchenbachGroundTemperatureModel.cc | 5 +- .../XingGroundTemperatureModel.cc | 10 +- src/EnergyPlus/HVACCooledBeam.cc | 5 +- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 14 +- src/EnergyPlus/HeatBalanceHAMTManager.cc | 8 +- src/EnergyPlus/HeatBalanceKivaManager.cc | 4 +- src/EnergyPlus/HeatBalanceManager.cc | 6 +- src/EnergyPlus/HeatBalanceSurfaceManager.cc | 2 +- src/EnergyPlus/LowTempRadiantSystem.cc | 13 +- src/EnergyPlus/MoistureBalanceEMPDManager.cc | 2 +- src/EnergyPlus/PVWatts.cc | 6 +- src/EnergyPlus/PVWattsSSC.cc | 128 +++++++------- src/EnergyPlus/PVWattsSSC.hh | 2 +- src/EnergyPlus/Photovoltaics.cc | 9 +- src/EnergyPlus/PipeHeatTransfer.cc | 14 +- src/EnergyPlus/PlantPipingSystemsManager.cc | 66 +++---- src/EnergyPlus/PlantPipingSystemsManager.hh | 4 +- src/EnergyPlus/PlantPressureSystem.cc | 1 - src/EnergyPlus/PondGroundHeatExchanger.cc | 6 +- src/EnergyPlus/RefrigeratedCase.cc | 2 +- src/EnergyPlus/RuntimeLanguageProcessor.cc | 8 +- src/EnergyPlus/SolarCollectors.cc | 18 +- src/EnergyPlus/SolarReflectionManager.cc | 30 ++-- src/EnergyPlus/SolarShading.cc | 64 +++---- src/EnergyPlus/SurfaceGeometry.cc | 86 ++++----- src/EnergyPlus/SurfaceGroundHeatExchanger.cc | 8 +- src/EnergyPlus/TARCOGArgs.cc | 7 +- src/EnergyPlus/TARCOGCommon.cc | 8 +- src/EnergyPlus/TARCOGDeflection.cc | 2 +- src/EnergyPlus/TARCOGGasses90.cc | 2 +- src/EnergyPlus/TarcogShading.cc | 16 +- src/EnergyPlus/ThermalEN673Calc.cc | 5 +- src/EnergyPlus/ThermalISO15099Calc.cc | 23 +-- src/EnergyPlus/TranspiredCollector.cc | 6 +- src/EnergyPlus/UFADManager.cc | 4 +- src/EnergyPlus/Vectors.cc | 5 +- src/EnergyPlus/VentilatedSlab.cc | 6 +- src/EnergyPlus/WaterCoils.cc | 8 +- src/EnergyPlus/WaterThermalTanks.cc | 14 +- src/EnergyPlus/WeatherManager.cc | 34 ++-- src/EnergyPlus/WindTurbine.cc | 14 +- src/EnergyPlus/WindowComplexManager.cc | 68 ++++--- src/EnergyPlus/WindowEquivalentLayer.cc | 71 +++----- src/EnergyPlus/WindowEquivalentLayer.hh | 2 +- src/EnergyPlus/WindowManager.cc | 58 +++--- src/EnergyPlus/WindowManagerExteriorData.cc | 8 +- tst/EnergyPlus/unit/BaseboardRadiator.unit.cc | 12 +- tst/EnergyPlus/unit/DElightManager.unit.cc | 4 +- tst/EnergyPlus/unit/DataSurfaces.unit.cc | 58 +++--- .../unit/DaylightingManager.unit.cc | 24 +-- .../unit/ElectricBaseboardRadiator.unit.cc | 20 +-- ...teDifferenceGroundTemperatureModel.unit.cc | 5 +- tst/EnergyPlus/unit/OutputReports.unit.cc | 4 +- tst/EnergyPlus/unit/SolarShading.unit.cc | 24 +-- tst/EnergyPlus/unit/SurfaceGeometry.unit.cc | 16 +- .../unit/TranspiredCollector.unit.cc | 4 +- .../unit/WindowEquivalentLayer.unit.cc | 6 +- tst/EnergyPlus/unit/WindowManager.unit.cc | 26 +-- 77 files changed, 733 insertions(+), 852 deletions(-) diff --git a/src/EnergyPlus/AirflowNetwork/src/Elements.cpp b/src/EnergyPlus/AirflowNetwork/src/Elements.cpp index c4a03af715e..7c529f79f62 100644 --- a/src/EnergyPlus/AirflowNetwork/src/Elements.cpp +++ b/src/EnergyPlus/AirflowNetwork/src/Elements.cpp @@ -1650,8 +1650,6 @@ namespace AirflowNetwork { // Lawrence Berkeley National Laboratory, Berkeley, CA, May 1990 // USE STATEMENTS: - using DataGlobals::PiOvr2; - // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -1958,7 +1956,7 @@ namespace AirflowNetwork { DpZeroOffset = DifLim * 1e-3; // New definition for opening factors for LVO type 2: opening angle = 90 degrees --> opening factor = 1.0 // should be PIOvr2 in below? - alpha = Fact * PiOvr2; + alpha = Fact * DataGlobalConstants::PiOvr2(); Real64 const cos_alpha(std::cos(alpha)); Real64 const tan_alpha(std::tan(alpha)); h2 = Axishght * (1.0 - cos_alpha); @@ -2500,7 +2498,7 @@ namespace AirflowNetwork { // ed = Rough / DisSysCompCoilData(CompNum).hydraulicDiameter; ed = Rough / hydraulicDiameter; - area = square(hydraulicDiameter) * DataGlobals::Pi; + area = square(hydraulicDiameter) * DataGlobalConstants::Pi(); ld = L / hydraulicDiameter; g = 1.14 - 0.868589 * std::log(ed); AA1 = g; @@ -2658,7 +2656,7 @@ namespace AirflowNetwork { // ed = Rough / DisSysCompCoilData(CompNum).hydraulicDiameter; ed = Rough / hydraulicDiameter; - area = square(hydraulicDiameter) * DataGlobals::Pi; + area = square(hydraulicDiameter) * DataGlobalConstants::Pi(); ld = L / hydraulicDiameter; g = 1.14 - 0.868589 * std::log(ed); AA1 = g; @@ -2810,7 +2808,7 @@ namespace AirflowNetwork { // FLOW: // Get component properties ed = Rough / hydraulicDiameter; - area = pow_2(hydraulicDiameter) * DataGlobals::Pi; + area = pow_2(hydraulicDiameter) * DataGlobalConstants::Pi(); ld = L / hydraulicDiameter; g = 1.14 - 0.868589 * std::log(ed); AA1 = g; @@ -2975,7 +2973,7 @@ namespace AirflowNetwork { // FLOW: // Get component properties ed = Rough / hydraulicDiameter; - area = pow_2(hydraulicDiameter) * DataGlobals::Pi; + area = pow_2(hydraulicDiameter) * DataGlobalConstants::Pi(); ld = L / hydraulicDiameter; g = 1.14 - 0.868589 * std::log(ed); AA1 = g; @@ -3121,7 +3119,7 @@ namespace AirflowNetwork { // FLOW: // Get component properties ed = Rough / hydraulicDiameter; - area = pow_2(hydraulicDiameter) * DataGlobals::Pi; + area = pow_2(hydraulicDiameter) * DataGlobalConstants::Pi(); ld = L / hydraulicDiameter; g = 1.14 - 0.868589 * std::log(ed); AA1 = g; @@ -3475,8 +3473,6 @@ namespace AirflowNetwork { // NISTIR 89-4052, National Institute of Standards and Technology, Gaithersburg, MD // USE STATEMENTS: - using DataGlobals::Pi; - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: Real64 RhozAver; Real64 expn; @@ -3509,7 +3505,7 @@ namespace AirflowNetwork { // Slope = MultizoneCompHorOpeningData(CompNum).Slope; // DischCoeff = MultizoneCompHorOpeningData(CompNum).DischCoeff; Cshape = 0.942 * Width / Height; - OpenArea = Width * Height * Fact * std::sin(Slope * Pi / 180.0) * (1.0 + std::cos(Slope * Pi / 180.0)); + OpenArea = Width * Height * Fact * std::sin(Slope * DataGlobalConstants::Pi() / 180.0) * (1.0 + std::cos(Slope * DataGlobalConstants::Pi() / 180.0)); DH = 4.0 * (Width * Height) / 2.0 / (Width + Height) * Fact; // Check which zone is higher diff --git a/src/EnergyPlus/AirflowNetwork/src/Solver.cpp b/src/EnergyPlus/AirflowNetwork/src/Solver.cpp index 192d471b003..fb71b0a7829 100644 --- a/src/EnergyPlus/AirflowNetwork/src/Solver.cpp +++ b/src/EnergyPlus/AirflowNetwork/src/Solver.cpp @@ -100,9 +100,7 @@ namespace AirflowNetwork { using DataEnvironment::OutDryBulbTemp; using DataEnvironment::OutHumRat; using DataEnvironment::StdBaroPress; - using DataGlobals::DegToRadians; using DataGlobals::KelvinConv; - using DataGlobals::Pi; using DataGlobals::rTinyValue; using DataSurfaces::Surface; @@ -1214,7 +1212,7 @@ namespace AirflowNetwork { // FLOW: // Get component properties Real64 ed = Rough / Diameter; - Real64 area = Diameter * Diameter * Pi / 4.0; + Real64 area = Diameter * Diameter * DataGlobalConstants::Pi() / 4.0; Real64 ld = Length / Diameter; Real64 g = 1.14 - 0.868589 * std::log(ed); Real64 AA1 = g; @@ -1966,8 +1964,6 @@ namespace AirflowNetwork { // Lawrence Berkeley National Laboratory, Berkeley, CA, May 1990 // USE STATEMENTS: - using DataGlobals::Pi; - // Locals // SUBROUTINE ARGUMENT DEFINITIONS: // na @@ -2039,7 +2035,7 @@ namespace AirflowNetwork { // FLOW: RhoREF = AIRDENSITY(PSea, OutDryBulbTemp, OutHumRat); - CONV = Latitude * 2.0 * Pi / 360.0; + CONV = Latitude * 2.0 * DataGlobalConstants::Pi() / 360.0; G = 9.780373 * (1.0 + 0.0052891 * pow_2(std::sin(CONV)) - 0.0000059 * pow_2(std::sin(2.0 * CONV))); Hfl = 1.0; diff --git a/src/EnergyPlus/AirflowNetworkBalanceManager.cc b/src/EnergyPlus/AirflowNetworkBalanceManager.cc index cb154afcce8..2abb827fc06 100644 --- a/src/EnergyPlus/AirflowNetworkBalanceManager.cc +++ b/src/EnergyPlus/AirflowNetworkBalanceManager.cc @@ -141,10 +141,8 @@ namespace AirflowNetworkBalanceManager { using DataGlobals::BeginEnvrnFlag; using DataGlobals::CurrentTime; using DataGlobals::DayOfSim; - using DataGlobals::DegToRadians; using DataGlobals::DisplayExtraWarnings; using DataGlobals::NumOfZones; - using DataGlobals::Pi; using DataGlobals::ScheduleAlwaysOn; using DataGlobals::SecInHour; using DataGlobals::TimeStepZone; @@ -6339,7 +6337,7 @@ namespace AirflowNetworkBalanceManager { // Wind-pressure coefficients for vertical facades, low-rise building if (UtilityRoutines::SameString(AirflowNetworkBalanceManager::AirflowNetworkSimu.BldgType, "LowRise") && FacadeNum <= 4) { - IncRad = IncAng * AirflowNetworkBalanceManager::DegToRadians; + IncRad = IncAng * DataGlobalConstants::DegToRadians(); Real64 const cos_IncRad_over_2(std::cos(IncRad / 2.0)); vals[windDirNum - 1] = 0.6 * std::log(1.248 - 0.703 * std::sin(IncRad / 2.0) - 1.175 * pow_2(std::sin(IncRad)) + 0.131 * pow_3(std::sin(2.0 * IncRad * SideRatioFac)) + 0.769 * cos_IncRad_over_2 + @@ -6417,7 +6415,7 @@ namespace AirflowNetworkBalanceManager { DelAng = mod(IncAng, 10.0); WtAng = 1.0 - DelAng / 10.0; // Wind-pressure coefficients for vertical facades, low-rise building - IncRad = IncAng * AirflowNetworkBalanceManager::DegToRadians; + IncRad = IncAng * DataGlobalConstants::DegToRadians(); valsByFacade[FacadeNum - 1][windDirNum - 1] = 0.6 * std::log(1.248 - 0.703 * std::sin(IncRad / 2.0) - 1.175 * pow_2(std::sin(IncRad)) + 0.131 * pow_3(std::sin(2.0 * IncRad * SideRatioFac)) + 0.769 * std::cos(IncRad / 2.0) + @@ -6558,7 +6556,7 @@ namespace AirflowNetworkBalanceManager { Real64 Tair_IP = Tair * 1.8 + 32.0; // Convert C to F Real64 mdot_IP = mdot * 2.20462 * 3600; // Convert kg/s to lb/hr Real64 Dh_IP = Dh * 3.28084; // Convert m to ft - Real64 Ai_IP = pow_2(Dh_IP) * Pi / 4; + Real64 Ai_IP = pow_2(Dh_IP) * DataGlobalConstants::Pi() / 4; Real64 CorrelationCoeff = 0.00368 + 1.5e-6 * (Tair_IP - 80); Real64 MassFlux = mdot_IP / Ai_IP; // lb/hr-ft2 @@ -6601,7 +6599,6 @@ namespace AirflowNetworkBalanceManager { // ASTM C1340 using DataEnvironment::WindSpeed; - using DataGlobals::GravityConstant; using DataGlobals::KelvinConv; Real64 k = airThermConductivity(Ts); @@ -6614,7 +6611,7 @@ namespace AirflowNetworkBalanceManager { Real64 Pr = airPrandtl((Ts + Tamb) / 2, Wamb, Pamb); Real64 KinVisc = airKinematicVisc((Ts + Tamb) / 2, Wamb, Pamb); Real64 Beta = 2.0 / ((Tamb + KelvinConv) + (Ts + KelvinConv)); - Real64 Gr = GravityConstant * Beta * std::abs(Ts - Tamb) * pow_3(Dh) / pow_2(KinVisc); + Real64 Gr = DataGlobalConstants::GravityConstant() * Beta * std::abs(Ts - Tamb) * pow_3(Dh) / pow_2(KinVisc); Real64 Ra = Gr * Pr; Real64 Nu_free(0); @@ -6779,7 +6776,7 @@ namespace AirflowNetworkBalanceManager { Real64 Tin = AirflowNetworkNodeSimu(LF).TZ; Real64 TDuctSurf = (Tamb + Tin) / 2.0; Real64 TDuctSurf_K = TDuctSurf + KelvinConv; - Real64 DuctSurfArea = DisSysCompDuctData(TypeNum).L * DisSysCompDuctData(TypeNum).hydraulicDiameter * Pi; + Real64 DuctSurfArea = DisSysCompDuctData(TypeNum).L * DisSysCompDuctData(TypeNum).hydraulicDiameter * DataGlobalConstants::Pi(); // If user defined view factors not present, calculate air-to-air heat transfer if (AirflowNetworkLinkageData(i).LinkageViewFactorObjectNum == 0) { @@ -6946,11 +6943,11 @@ namespace AirflowNetworkBalanceManager { LT = AirflowNetworkLinkageData(i).NodeNums[0]; DirSign = -1.0; } - Ei = General::epexp(-0.001 * DisSysCompTermUnitData(TypeNum).L * DisSysCompTermUnitData(TypeNum).hydraulicDiameter * Pi, + Ei = General::epexp(-0.001 * DisSysCompTermUnitData(TypeNum).L * DisSysCompTermUnitData(TypeNum).hydraulicDiameter * DataGlobalConstants::Pi(), (DirSign * AirflowNetworkLinkSimu(i).FLOW * CpAir)); Tamb = AirflowNetworkNodeSimu(LT).TZ; if (!state.dataAirflowNetworkBalanceManager->LoopOnOffFlag(AirflowNetworkLinkageData(i).AirLoopNum) && AirflowNetworkLinkSimu(i).FLOW <= 0.0) { - Ei = General::epexp(-0.001 * DisSysCompTermUnitData(TypeNum).L * DisSysCompTermUnitData(TypeNum).hydraulicDiameter * Pi, + Ei = General::epexp(-0.001 * DisSysCompTermUnitData(TypeNum).L * DisSysCompTermUnitData(TypeNum).hydraulicDiameter * DataGlobalConstants::Pi(), (AirflowNetworkLinkSimu(i).FLOW2 * CpAir)); state.dataAirflowNetworkBalanceManager->MA((LT - 1) * AirflowNetworkNumOfNodes + LT) += std::abs(AirflowNetworkLinkSimu(i).FLOW2) * CpAir; state.dataAirflowNetworkBalanceManager->MA((LT - 1) * AirflowNetworkNumOfNodes + LF) = -std::abs(AirflowNetworkLinkSimu(i).FLOW2) * CpAir * Ei; @@ -7208,7 +7205,7 @@ namespace AirflowNetworkBalanceManager { DirSign = -1.0; } Ei = General::epexp(-DisSysCompDuctData(TypeNum).UMoisture * DisSysCompDuctData(TypeNum).L * - DisSysCompDuctData(TypeNum).hydraulicDiameter * Pi, (DirSign * AirflowNetworkLinkSimu(i).FLOW)); + DisSysCompDuctData(TypeNum).hydraulicDiameter * DataGlobalConstants::Pi(), (DirSign * AirflowNetworkLinkSimu(i).FLOW)); if (AirflowNetworkLinkageData(i).ZoneNum < 0) { Wamb = OutHumRat; } else if (AirflowNetworkLinkageData(i).ZoneNum == 0) { @@ -7218,7 +7215,7 @@ namespace AirflowNetworkBalanceManager { } if (!state.dataAirflowNetworkBalanceManager->LoopOnOffFlag(AirflowNetworkLinkageData(i).AirLoopNum) && AirflowNetworkLinkSimu(i).FLOW <= 0.0) { Ei = General::epexp(-DisSysCompDuctData(TypeNum).UMoisture * DisSysCompDuctData(TypeNum).L * - DisSysCompDuctData(TypeNum).hydraulicDiameter * Pi, (AirflowNetworkLinkSimu(i).FLOW2)); + DisSysCompDuctData(TypeNum).hydraulicDiameter * DataGlobalConstants::Pi(), (AirflowNetworkLinkSimu(i).FLOW2)); state.dataAirflowNetworkBalanceManager->MA((LT - 1) * AirflowNetworkNumOfNodes + LT) += std::abs(AirflowNetworkLinkSimu(i).FLOW2); state.dataAirflowNetworkBalanceManager->MA((LT - 1) * AirflowNetworkNumOfNodes + LF) = -std::abs(AirflowNetworkLinkSimu(i).FLOW2) * Ei; state.dataAirflowNetworkBalanceManager->MV(LT) += std::abs(AirflowNetworkLinkSimu(i).FLOW2) * Wamb * (1.0 - Ei); @@ -7239,12 +7236,12 @@ namespace AirflowNetworkBalanceManager { LT = AirflowNetworkLinkageData(i).NodeNums[0]; DirSign = -1.0; } - Ei = General::epexp(-0.0001 * DisSysCompTermUnitData(TypeNum).L * DisSysCompTermUnitData(TypeNum).hydraulicDiameter * Pi, + Ei = General::epexp(-0.0001 * DisSysCompTermUnitData(TypeNum).L * DisSysCompTermUnitData(TypeNum).hydraulicDiameter * DataGlobalConstants::Pi(), (DirSign * AirflowNetworkLinkSimu(i).FLOW)); Wamb = AirflowNetworkNodeSimu(LT).WZ; if (!state.dataAirflowNetworkBalanceManager->LoopOnOffFlag(AirflowNetworkLinkageData(i).AirLoopNum) && AirflowNetworkLinkSimu(i).FLOW <= 0.0) { - Ei = General::epexp(-0.0001 * DisSysCompTermUnitData(TypeNum).L * DisSysCompTermUnitData(TypeNum).hydraulicDiameter * Pi, + Ei = General::epexp(-0.0001 * DisSysCompTermUnitData(TypeNum).L * DisSysCompTermUnitData(TypeNum).hydraulicDiameter * DataGlobalConstants::Pi(), (AirflowNetworkLinkSimu(i).FLOW2)); state.dataAirflowNetworkBalanceManager->MA((LT - 1) * AirflowNetworkNumOfNodes + LT) += std::abs(AirflowNetworkLinkSimu(i).FLOW2); state.dataAirflowNetworkBalanceManager->MA((LT - 1) * AirflowNetworkNumOfNodes + LF) = -std::abs(AirflowNetworkLinkSimu(i).FLOW2) * Ei; @@ -10838,9 +10835,9 @@ namespace AirflowNetworkBalanceManager { if (std::abs(state.dataAirflowNetworkBalanceManager->IncAng) > 180.0) state.dataAirflowNetworkBalanceManager->IncAng -= 360.0; if (UtilityRoutines::SameString(AirflowNetworkSimu.WPCCntr, "SurfaceAverageCalculation")) { if (std::abs(state.dataAirflowNetworkBalanceManager->IncAng) <= 67.5) { - PiFormula(windDirNum) = 0.44 * sign(std::sin(2.67 * std::abs(state.dataAirflowNetworkBalanceManager->IncAng) * Pi / 180.0), state.dataAirflowNetworkBalanceManager->IncAng); + PiFormula(windDirNum) = 0.44 * sign(std::sin(2.67 * std::abs(state.dataAirflowNetworkBalanceManager->IncAng) * DataGlobalConstants::Pi() / 180.0), state.dataAirflowNetworkBalanceManager->IncAng); } else if (std::abs(state.dataAirflowNetworkBalanceManager->IncAng) <= 180.0) { - PiFormula(windDirNum) = -0.69 * sign(std::sin((288 - 1.6 * std::abs(state.dataAirflowNetworkBalanceManager->IncAng)) * Pi / 180.0), state.dataAirflowNetworkBalanceManager->IncAng); + PiFormula(windDirNum) = -0.69 * sign(std::sin((288 - 1.6 * std::abs(state.dataAirflowNetworkBalanceManager->IncAng)) * DataGlobalConstants::Pi() / 180.0), state.dataAirflowNetworkBalanceManager->IncAng); } SigmaFormula(windDirNum) = 0.423 - 0.00163 * std::abs(state.dataAirflowNetworkBalanceManager->IncAng); DeltaCp(ZnNum).WindDir(windDirNum) = diff --git a/src/EnergyPlus/ConvectionCoefficients.cc b/src/EnergyPlus/ConvectionCoefficients.cc index 23c787a476b..aece5ac4917 100644 --- a/src/EnergyPlus/ConvectionCoefficients.cc +++ b/src/EnergyPlus/ConvectionCoefficients.cc @@ -3060,7 +3060,7 @@ namespace ConvectionCoefficients { Real64 sintilt; tilt = Surface(SurfNum).Tilt; - tiltr = tilt * DegToRadians; + tiltr = tilt * DataGlobalConstants::DegToRadians(); costilt = Surface(SurfNum).CosTilt; sintilt = Surface(SurfNum).SinTilt; ra = gr * pr; @@ -6185,12 +6185,12 @@ namespace ConvectionCoefficients { } else if (SELECT_CASE_var == RefWindParallComp) { // WindSpeed , WindDir, surface Azimuth Theta = WindDir - Surface(SurfNum).Azimuth - 90.0; // TODO double check theta - ThetaRad = Theta * DegToRadians; + ThetaRad = Theta * DataGlobalConstants::DegToRadians(); windVel = std::cos(ThetaRad) * WindSpeed; } else if (SELECT_CASE_var == RefWindParallCompAtZ) { // Surface WindSpeed , Surface WindDir, surface Azimuth Theta = Surface(SurfNum).WindDir - Surface(SurfNum).Azimuth - 90.0; // TODO double check theta - ThetaRad = Theta * DegToRadians; + ThetaRad = Theta * DataGlobalConstants::DegToRadians(); windVel = std::cos(ThetaRad) * Surface(SurfNum).WindSpeed; } } diff --git a/src/EnergyPlus/CrossVentMgr.cc b/src/EnergyPlus/CrossVentMgr.cc index a2b5b5cfe61..8ca7f0d10f4 100644 --- a/src/EnergyPlus/CrossVentMgr.cc +++ b/src/EnergyPlus/CrossVentMgr.cc @@ -383,7 +383,7 @@ namespace CrossVentMgr { // Check if wind direction is within +/- 90 degrees of the outward normal of the dominant surface SurfNorm = Surface(AirflowNetwork::MultizoneSurfaceData(MaxSurf).SurfNum).Azimuth; - CosPhi = std::cos((WindDir - SurfNorm) * DegToRadians); + CosPhi = std::cos((WindDir - SurfNorm) * DataGlobalConstants::DegToRadians()); if (CosPhi <= 0) { AirModel(ZoneNum).SimAirModel = false; auto flows(CVJetRecFlows(_, ZoneNum)); diff --git a/src/EnergyPlus/CurveManager.cc b/src/EnergyPlus/CurveManager.cc index 3119c2d918d..a61e63dc063 100644 --- a/src/EnergyPlus/CurveManager.cc +++ b/src/EnergyPlus/CurveManager.cc @@ -2863,8 +2863,6 @@ namespace CurveManager { // DP = [f*(L/D) + K] * (rho * V^2) / 2 // Using/Aliasing - using DataGlobals::Pi; - // Return value Real64 PressureCurveValue; @@ -2889,7 +2887,7 @@ namespace CurveManager { ConstantF = DataBranchAirLoopPlant::PressureCurve(PressureCurveIndex).ConstantF; // Intermediate calculations - CrossSectArea = (Pi / 4.0) * pow_2(Diameter); + CrossSectArea = (DataGlobalConstants::Pi() / 4.0) * pow_2(Diameter); Velocity = MassFlow / (Density * CrossSectArea); ReynoldsNumber = Density * Diameter * Velocity / Viscosity; // assuming mu here RoughnessRatio = Roughness / Diameter; diff --git a/src/EnergyPlus/DElightManagerF.cc b/src/EnergyPlus/DElightManagerF.cc index 44c77bd5b80..6fad1ceb42c 100644 --- a/src/EnergyPlus/DElightManagerF.cc +++ b/src/EnergyPlus/DElightManagerF.cc @@ -228,8 +228,8 @@ namespace DElightManagerF { print(delightInFile, Format_902, cNameWOBlanks, Latitude, Longitude, Elevation * M2FT, BuildingAzimuth, TimeZoneNumber); // Calc cos and sin of Building Relative North values for later use in transforming Reference Point coordinates - CosBldgRelNorth = std::cos(-BuildingAzimuth * DegToRadians); - SinBldgRelNorth = std::sin(-BuildingAzimuth * DegToRadians); + CosBldgRelNorth = std::cos(-BuildingAzimuth * DataGlobalConstants::DegToRadians()); + SinBldgRelNorth = std::sin(-BuildingAzimuth * DataGlobalConstants::DegToRadians()); // Loop through the Daylighting:Controls objects that use DElight checking for a host Zone for (auto &znDayl : ZoneDaylight) { @@ -298,8 +298,8 @@ namespace DElightManagerF { znDayl.DElightGriddingResolution * M22FT2); // Calc cos and sin of Zone Relative North values for later use in transforming Reference Point coordinates - CosZoneRelNorth = std::cos(-zn.RelNorth * DegToRadians); - SinZoneRelNorth = std::sin(-zn.RelNorth * DegToRadians); + CosZoneRelNorth = std::cos(-zn.RelNorth * DataGlobalConstants::DegToRadians()); + SinZoneRelNorth = std::sin(-zn.RelNorth * DataGlobalConstants::DegToRadians()); // Zone Lighting Schedule Data Section // NOTE: Schedules are not required since hourly values are retrieved from EnergyPlus as needed diff --git a/src/EnergyPlus/DXFEarClipping.cc b/src/EnergyPlus/DXFEarClipping.cc index be9f1075f58..d1b95d9d7db 100644 --- a/src/EnergyPlus/DXFEarClipping.cc +++ b/src/EnergyPlus/DXFEarClipping.cc @@ -89,10 +89,6 @@ namespace DXFEarClipping { // Using/Aliasing using namespace DataPrecisionGlobals; using namespace DataVectorTypes; - using DataGlobals::Pi; - using DataGlobals::RadToDeg; - using DataGlobals::TwoPi; - // Data // Derived type definitions: @@ -162,7 +158,7 @@ namespace DXFEarClipping { } } - if (std::abs(anglesum - TwoPi) <= epsilon) { + if (std::abs(anglesum - DataGlobalConstants::TwoPi()) <= epsilon) { InPolygon = true; } @@ -329,7 +325,7 @@ namespace DXFEarClipping { } ShowMessage(format(" number of triangles found={:12}", ncount)); for (int j = 1; j <= nrangles; ++j) { - ShowMessage(format(" r angle={} vert={} deg={:.1R}", j, r_angles(j), rangles(j) * RadToDeg)); + ShowMessage(format(" r angle={} vert={} deg={:.1R}", j, r_angles(j), rangles(j) * DataGlobalConstants::RadToDeg())); } } break; // while loop @@ -446,7 +442,7 @@ namespace DXFEarClipping { angle = std::acos(t); if (x2 * y1 - y2 * x1 < 0.0E+00) { - angle = 2.0E+00 * Pi - angle; + angle = 2.0E+00 * DataGlobalConstants::Pi() - angle; } return angle; @@ -624,7 +620,7 @@ namespace DXFEarClipping { ang = angle_2dvector(vertex(svert).x, vertex(svert).y, vertex(mvert).x, vertex(mvert).y, vertex(evert).x, vertex(evert).y); - if (ang > Pi) { // sufficiently close to 180 degrees. + if (ang > DataGlobalConstants::Pi()) { // sufficiently close to 180 degrees. ++nrverts; r_vertices(nrverts) = mvert; rangles(nrverts) = ang; @@ -724,7 +720,7 @@ namespace DXFEarClipping { Real64 const alpha = surfazimuth; Real64 const alpha180 = 180.0 - alpha; // amount to rotate - Real64 const alphrad = alpha180 / RadToDeg; + Real64 const alphrad = alpha180 / DataGlobalConstants::RadToDeg(); Real64 const cos_alphrad = std::cos(alphrad); Real64 const sin_alphrad = std::sin(alphrad); @@ -784,7 +780,7 @@ namespace DXFEarClipping { // Subroutine local variable declarations: Real64 const alpha = -surftilt; - Real64 const alphrad = alpha / RadToDeg; + Real64 const alphrad = alpha / DataGlobalConstants::RadToDeg(); Real64 const cos_alphrad = std::cos(alphrad); Real64 const sin_alphrad = std::sin(alphrad); diff --git a/src/EnergyPlus/DataContaminantBalance.cc b/src/EnergyPlus/DataContaminantBalance.cc index 495bc44f2f6..fe53798ef50 100644 --- a/src/EnergyPlus/DataContaminantBalance.cc +++ b/src/EnergyPlus/DataContaminantBalance.cc @@ -67,7 +67,6 @@ namespace DataContaminantBalance { // Using/Aliasing using namespace DataPrecisionGlobals; using DataGlobals::AutoCalculate; - using DataGlobals::DegToRadians; using DataSurfaces::MaxSlatAngs; // Data diff --git a/src/EnergyPlus/DataGlobalConstants.hh b/src/EnergyPlus/DataGlobalConstants.hh index 4ffe3802d4b..52ccb825bd2 100644 --- a/src/EnergyPlus/DataGlobalConstants.hh +++ b/src/EnergyPlus/DataGlobalConstants.hh @@ -253,12 +253,18 @@ namespace DataGlobalConstants { DesignDay = 1, RunPeriodDesign = 2, RunPeriodWeather = 3, - HVACSizeDesignDay = 4, // a regular design day run during HVAC Sizing Simulation - HVACSizeRunPeriodDesign = 5, // a weather period design day run during HVAC Sizing Simulation - ReadAllWeatherData = 6 // a weather period for reading all weather data prior to the simulation + HVACSizeDesignDay = 4, // a regular design day run during HVAC Sizing Simulation + HVACSizeRunPeriodDesign = 5, // a weather period design day run during HVAC Sizing Simulation + ReadAllWeatherData = 6 // a weather period for reading all weather data prior to the simulation }; Real64 constexpr MaxEXPArg () { return 709.78; } // maximum exponent in EXP() function + Real64 constexpr Pi () { return 3.14159265358979324; } // Pi 3.1415926535897932384626435 + Real64 constexpr PiOvr2 () { return Pi() / 2.0; } // Pi/2 + Real64 constexpr TwoPi () { return 2.0 * Pi(); } // 2*Pi 6.2831853071795864769252868 + Real64 constexpr GravityConstant () { return 9.807; } + Real64 constexpr DegToRadians () { return Pi() / 180.0; } // Conversion for Degrees to Radians + Real64 constexpr RadToDeg () { return 180.0 / Pi(); } // Conversion for Radians to Degrees int AssignResourceTypeNum(std::string const &ResourceTypeChar); std::string GetResourceTypeChar(int ResourceTypeNum); diff --git a/src/EnergyPlus/DataGlobals.cc b/src/EnergyPlus/DataGlobals.cc index 60a75ead756..dd6f06a09f3 100644 --- a/src/EnergyPlus/DataGlobals.cc +++ b/src/EnergyPlus/DataGlobals.cc @@ -72,12 +72,6 @@ namespace DataGlobals { // This data-only module is a repository for all variables which are considered // to be "global" in nature in EnergyPlus. - Real64 const Pi(3.14159265358979324); // Pi 3.1415926535897932384626435 - Real64 const PiOvr2(Pi / 2.0); // Pi/2 - Real64 const TwoPi(2.0 * Pi); // 2*Pi 6.2831853071795864769252868 - Real64 const GravityConstant(9.807); - Real64 const DegToRadians(Pi / 180.0); // Conversion for Degrees to Radians - Real64 const RadToDeg(180.0 / Pi); // Conversion for Radians to Degrees Real64 const SecInHour(3600.0); // Conversion for hours to seconds Real64 const HoursInDay(24.0); // Number of Hours in Day Real64 const SecsInDay(SecInHour *HoursInDay); // Number of seconds in Day diff --git a/src/EnergyPlus/DataGlobals.hh b/src/EnergyPlus/DataGlobals.hh index e6942b088d5..03fc66f972b 100644 --- a/src/EnergyPlus/DataGlobals.hh +++ b/src/EnergyPlus/DataGlobals.hh @@ -70,12 +70,6 @@ namespace DataGlobals { // -only module should be available to other modules and routines. // Thus, all variables in this module must be PUBLIC. - extern Real64 const Pi; // Pi 3.1415926535897932384626435 - extern Real64 const PiOvr2; // Pi/2 - extern Real64 const TwoPi; // 2*Pi 6.2831853071795864769252868 - extern Real64 const GravityConstant; - extern Real64 const DegToRadians; // Conversion for Degrees to Radians - extern Real64 const RadToDeg; // Conversion for Radians to Degrees extern Real64 const SecInHour; // Conversion for hours to seconds extern Real64 const HoursInDay; // Number of Hours in Day extern Real64 const SecsInDay; // Number of seconds in Day diff --git a/src/EnergyPlus/DataHeatBalance.cc b/src/EnergyPlus/DataHeatBalance.cc index 874a54d9553..70e85b380e5 100644 --- a/src/EnergyPlus/DataHeatBalance.cc +++ b/src/EnergyPlus/DataHeatBalance.cc @@ -93,7 +93,6 @@ namespace DataHeatBalance { // Using/Aliasing using DataGlobals::AutoCalculate; - using DataGlobals::DegToRadians; using DataSurfaces::MaxSlatAngs; using namespace DataVectorTypes; using DataBSDFWindow::BSDFLayerAbsorpStruct; @@ -1823,7 +1822,7 @@ namespace DataHeatBalance { // Minimum and maximum slat angles allowed by slat geometry if (Blind(TotBlinds).SlatWidth > Blind(TotBlinds).SlatSeparation) { MinSlatAngGeom = - std::asin(Blind(TotBlinds).SlatThickness / (Blind(TotBlinds).SlatThickness + Blind(TotBlinds).SlatSeparation)) / DegToRadians; + std::asin(Blind(TotBlinds).SlatThickness / (Blind(TotBlinds).SlatThickness + Blind(TotBlinds).SlatSeparation)) / DataGlobalConstants::DegToRadians(); } else { MinSlatAngGeom = 0.0; } @@ -1924,9 +1923,6 @@ namespace DataHeatBalance { // Using/Aliasing using DataEnvironment::SOLCOS; - using DataGlobals::DegToRadians; - using DataGlobals::Pi; - using DataGlobals::PiOvr2; using DataSurfaces::DoNotModel; using DataSurfaces::ModelAsDiffuse; using DataSurfaces::ModelAsDirectBeam; @@ -1992,22 +1988,22 @@ namespace DataHeatBalance { if (present(Theta)) { SunAzimuthToScreenNormal = std::abs(Theta); - if (SunAzimuthToScreenNormal > Pi) { + if (SunAzimuthToScreenNormal > DataGlobalConstants::Pi()) { SunAzimuthToScreenNormal = 0.0; } else { - if (SunAzimuthToScreenNormal > PiOvr2) { - SunAzimuthToScreenNormal = Pi - SunAzimuthToScreenNormal; + if (SunAzimuthToScreenNormal > DataGlobalConstants::PiOvr2()) { + SunAzimuthToScreenNormal = DataGlobalConstants::Pi() - SunAzimuthToScreenNormal; } } NormalAzimuth = SunAzimuthToScreenNormal; } else { SunAzimuth = std::atan2(SOLCOS(1), SOLCOS(2)); - if (SunAzimuth < 0.0) SunAzimuth += 2.0 * Pi; - SurfaceAzimuth = Surface(SurfaceNum).Azimuth * DegToRadians; + if (SunAzimuth < 0.0) SunAzimuth += 2.0 * DataGlobalConstants::Pi(); + SurfaceAzimuth = Surface(SurfaceNum).Azimuth * DataGlobalConstants::DegToRadians(); NormalAzimuth = SunAzimuth - SurfaceAzimuth; // Calculate the transmittance whether sun is in front of or behind screen, place result in BmBmTrans or BmBmTransBack - if (std::abs(SunAzimuth - SurfaceAzimuth) > PiOvr2) { - SunAzimuthToScreenNormal = std::abs(SunAzimuth - SurfaceAzimuth) - PiOvr2; + if (std::abs(SunAzimuth - SurfaceAzimuth) > DataGlobalConstants::PiOvr2()) { + SunAzimuthToScreenNormal = std::abs(SunAzimuth - SurfaceAzimuth) - DataGlobalConstants::PiOvr2(); } else { SunAzimuthToScreenNormal = std::abs(SunAzimuth - SurfaceAzimuth); } @@ -2015,23 +2011,23 @@ namespace DataHeatBalance { if (present(Phi)) { SunAltitudeToScreenNormal = std::abs(Phi); - if (SunAltitudeToScreenNormal > PiOvr2) { - SunAltitudeToScreenNormal = Pi - SunAltitudeToScreenNormal; + if (SunAltitudeToScreenNormal > DataGlobalConstants::PiOvr2()) { + SunAltitudeToScreenNormal = DataGlobalConstants::Pi() - SunAltitudeToScreenNormal; } SunAltitude = SunAltitudeToScreenNormal; } else { - SunAltitude = (PiOvr2 - std::acos(SOLCOS(3))); - SurfaceTilt = Surface(SurfaceNum).Tilt * DegToRadians; - SunAltitudeToScreenNormal = std::abs(SunAltitude + (SurfaceTilt - PiOvr2)); - if (SunAltitudeToScreenNormal > PiOvr2) { - SunAltitudeToScreenNormal -= PiOvr2; + SunAltitude = (DataGlobalConstants::PiOvr2() - std::acos(SOLCOS(3))); + SurfaceTilt = Surface(SurfaceNum).Tilt * DataGlobalConstants::DegToRadians(); + SunAltitudeToScreenNormal = std::abs(SunAltitude + (SurfaceTilt - DataGlobalConstants::PiOvr2())); + if (SunAltitudeToScreenNormal > DataGlobalConstants::PiOvr2()) { + SunAltitudeToScreenNormal -= DataGlobalConstants::PiOvr2(); } } if (SurfaceNum == 0 || !present(ScreenNumber)) { NormalAltitude = SunAltitude; } else { - NormalAltitude = SunAltitude + (SurfaceTilt - PiOvr2); + NormalAltitude = SunAltitude + (SurfaceTilt - DataGlobalConstants::PiOvr2()); } if (NormalAltitude != 0.0 && NormalAzimuth != 0.0) { @@ -2052,11 +2048,11 @@ namespace DataHeatBalance { // ************************************************************************************************ // calculate compliment of relative solar azimuth - Beta = PiOvr2 - SunAzimuthToScreenNormal; + Beta = DataGlobalConstants::PiOvr2() - SunAzimuthToScreenNormal; // Catch all divide by zero instances if (Beta > Small) { - if (std::abs(SunAltitudeToScreenNormal - PiOvr2) > Small) { + if (std::abs(SunAltitudeToScreenNormal - DataGlobalConstants::PiOvr2()) > Small) { AlphaDblPrime = std::atan(std::tan(SunAltitudeToScreenNormal) / std::cos(SunAzimuthToScreenNormal)); TransYDir = 1.0 - Gamma * (std::cos(AlphaDblPrime) + std::sin(AlphaDblPrime) * std::tan(SunAltitudeToScreenNormal) * std::sqrt(1.0 + pow_2(1.0 / std::tan(Beta)))); @@ -2072,7 +2068,7 @@ namespace DataHeatBalance { pow_2(std::sin(SunAltitudeToScreenNormal))); if (COSMu > Small) { Epsilon = std::acos(std::cos(SunAltitudeToScreenNormal) * std::cos(SunAzimuthToScreenNormal) / COSMu); - Eta = PiOvr2 - Epsilon; + Eta = DataGlobalConstants::PiOvr2() - Epsilon; if (std::cos(Epsilon) != 0.0) { MuPrime = std::atan(std::tan(std::acos(COSMu)) / std::cos(Epsilon)); if (Eta != 0.0) { @@ -2097,13 +2093,13 @@ namespace DataHeatBalance { ReflectCyl = SurfaceScreens(ScNum).ReflectCylinder; ReflectCylVis = SurfaceScreens(ScNum).ReflectCylinderVis; - if (std::abs(SunAzimuthToScreenNormal - PiOvr2) < Small || std::abs(SunAltitudeToScreenNormal - PiOvr2) < Small) { + if (std::abs(SunAzimuthToScreenNormal - DataGlobalConstants::PiOvr2()) < Small || std::abs(SunAltitudeToScreenNormal - DataGlobalConstants::PiOvr2()) < Small) { Tscattered = 0.0; TscatteredVis = 0.0; } else { // DeltaMax and Delta are in degrees DeltaMax = 89.7 - (10.0 * Gamma / 0.16); - Delta = std::sqrt(pow_2(SunAzimuthToScreenNormal / DegToRadians) + pow_2(SunAltitudeToScreenNormal / DegToRadians)); + Delta = std::sqrt(pow_2(SunAzimuthToScreenNormal / DataGlobalConstants::DegToRadians()) + pow_2(SunAltitudeToScreenNormal / DataGlobalConstants::DegToRadians())); // Use empirical model to determine maximum (peak) scattering Tscattermax = 0.0229 * Gamma + 0.2971 * ReflectCyl - 0.03624 * pow_2(Gamma) + 0.04763 * pow_2(ReflectCyl) - 0.44416 * Gamma * ReflectCyl; @@ -2137,7 +2133,7 @@ namespace DataHeatBalance { TscatteredVis = max(0.0, TscatteredVis); if (SurfaceScreens(ScNum).ScreenBeamReflectanceAccounting == DoNotModel) { - if (std::abs(IncidentAngle) <= PiOvr2) { + if (std::abs(IncidentAngle) <= DataGlobalConstants::PiOvr2()) { SurfaceScreens(ScNum).BmBmTrans = Tdirect; SurfaceScreens(ScNum).BmBmTransVis = Tdirect; SurfaceScreens(ScNum).BmBmTransBack = 0.0; @@ -2149,7 +2145,7 @@ namespace DataHeatBalance { Tscattered = 0.0; TscatteredVis = 0.0; } else if (SurfaceScreens(ScNum).ScreenBeamReflectanceAccounting == ModelAsDirectBeam) { - if (std::abs(IncidentAngle) <= PiOvr2) { + if (std::abs(IncidentAngle) <= DataGlobalConstants::PiOvr2()) { SurfaceScreens(ScNum).BmBmTrans = Tdirect + Tscattered; SurfaceScreens(ScNum).BmBmTransVis = Tdirect + TscatteredVis; SurfaceScreens(ScNum).BmBmTransBack = 0.0; @@ -2161,7 +2157,7 @@ namespace DataHeatBalance { Tscattered = 0.0; TscatteredVis = 0.0; } else if (SurfaceScreens(ScNum).ScreenBeamReflectanceAccounting == ModelAsDiffuse) { - if (std::abs(IncidentAngle) <= PiOvr2) { + if (std::abs(IncidentAngle) <= DataGlobalConstants::PiOvr2()) { SurfaceScreens(ScNum).BmBmTrans = Tdirect; SurfaceScreens(ScNum).BmBmTransVis = Tdirect; SurfaceScreens(ScNum).BmBmTransBack = 0.0; @@ -2172,7 +2168,7 @@ namespace DataHeatBalance { } } - if (std::abs(IncidentAngle) <= PiOvr2) { + if (std::abs(IncidentAngle) <= DataGlobalConstants::PiOvr2()) { SurfaceScreens(ScNum).BmDifTrans = Tscattered; SurfaceScreens(ScNum).BmDifTransVis = TscatteredVis; SurfaceScreens(ScNum).BmDifTransBack = 0.0; diff --git a/src/EnergyPlus/DaylightingDevices.cc b/src/EnergyPlus/DaylightingDevices.cc index 8a21a526387..3abbf9150e8 100644 --- a/src/EnergyPlus/DaylightingDevices.cc +++ b/src/EnergyPlus/DaylightingDevices.cc @@ -169,10 +169,7 @@ namespace DaylightingDevices { // Using/Aliasing using namespace DataPrecisionGlobals; - using DataGlobals::DegToRadians; using DataGlobals::NumOfZones; - using DataGlobals::Pi; - using DataGlobals::PiOvr2; using DataHeatBalance::MinimalShadowing; using DataHeatBalance::SolarDistribution; using DataHeatBalance::TotConstructs; @@ -280,8 +277,8 @@ namespace DaylightingDevices { COSAngle(1) = 0.0; COSAngle(NumOfAngles) = 1.0; - dTheta = 90.0 * DegToRadians / (NumOfAngles - 1.0); - Theta = 90.0 * DegToRadians; + dTheta = 90.0 * DataGlobalConstants::DegToRadians() / (NumOfAngles - 1.0); + Theta = 90.0 * DataGlobalConstants::DegToRadians(); for (AngleNum = 2; AngleNum <= NumOfAngles - 1; ++AngleNum) { Theta -= dTheta; COSAngle(AngleNum) = std::cos(Theta); @@ -321,7 +318,7 @@ namespace DaylightingDevices { TDDPipeStored(NumStored).TransBeam(NumOfAngles) = 1.0; // Calculate intermediate beam transmittances between 0 and 90 degrees - Theta = 90.0 * DegToRadians; + Theta = 90.0 * DataGlobalConstants::DegToRadians(); for (AngleNum = 2; AngleNum <= NumOfAngles - 1; ++AngleNum) { Theta -= dTheta; TDDPipeStored(NumStored).TransBeam(AngleNum) = CalcPipeTransBeam(Reflectance, TDDPipe(PipeNum).AspectRatio, Theta); @@ -673,7 +670,7 @@ namespace DaylightingDevices { ErrorsFound = true; } - PipeArea = 0.25 * Pi * pow_2(TDDPipe(PipeNum).Diameter); + PipeArea = 0.25 * DataGlobalConstants::Pi() * pow_2(TDDPipe(PipeNum).Diameter); if (TDDPipe(PipeNum).Dome > 0 && std::abs(PipeArea - Surface(TDDPipe(PipeNum).Dome).Area) > 0.1) { if (SafeDivide(std::abs(PipeArea - Surface(TDDPipe(PipeNum).Dome).Area), Surface(TDDPipe(PipeNum).Dome).Area) > 0.1) { // greater than 10% @@ -1011,7 +1008,7 @@ namespace DaylightingDevices { xLimit = (std::log(pow_2(N) * myLocalTiny) / std::log(R)) / xTol; c1 = A * std::tan(Theta); - c2 = 4.0 / Pi; + c2 = 4.0 / DataGlobalConstants::Pi(); s = i; while (s < (1.0 - i)) { @@ -1073,13 +1070,13 @@ namespace DaylightingDevices { Real64 COSI; // Cosine of incident angle Real64 SINI; // Sine of incident angle - Real64 const dPH = 90.0 * DegToRadians / NPH; // Altitude angle of sky element + Real64 const dPH = 90.0 * DataGlobalConstants::DegToRadians() / NPH; // Altitude angle of sky element Real64 PH = 0.5 * dPH; // Altitude angle increment // Integrate from 0 to Pi/2 altitude for (int N = 1; N <= NPH; ++N) { - COSI = std::cos(PiOvr2 - PH); - SINI = std::sin(PiOvr2 - PH); + COSI = std::cos(DataGlobalConstants::PiOvr2() - PH); + SINI = std::sin(DataGlobalConstants::PiOvr2() - PH); Real64 P = COSI; // Angular distribution function: P = COS(Incident Angle) for diffuse isotropic @@ -1137,14 +1134,14 @@ namespace DaylightingDevices { Real64 CosPhi; // Cosine of TDD:DOME altitude angle Real64 Theta; // TDD:DOME azimuth angle - CosPhi = std::cos(PiOvr2 - Surface(TDDPipe(PipeNum).Dome).Tilt * DegToRadians); - Theta = Surface(TDDPipe(PipeNum).Dome).Azimuth * DegToRadians; + CosPhi = std::cos(DataGlobalConstants::PiOvr2() - Surface(TDDPipe(PipeNum).Dome).Tilt * DataGlobalConstants::DegToRadians()); + Theta = Surface(TDDPipe(PipeNum).Dome).Azimuth * DataGlobalConstants::DegToRadians(); if (CosPhi > 0.01) { // Dome has a view of the horizon // Integrate over the semicircle - Real64 const THMIN = Theta - PiOvr2; // Minimum azimuth integration limit + Real64 const THMIN = Theta - DataGlobalConstants::PiOvr2(); // Minimum azimuth integration limit // Real64 const THMAX = Theta + PiOvr2; // Maximum azimuth integration limit - Real64 const dTH = 180.0 * DegToRadians / NTH; // Azimuth angle increment + Real64 const dTH = 180.0 * DataGlobalConstants::DegToRadians() / NTH; // Azimuth angle increment Real64 TH = THMIN + 0.5 * dTH; // Azimuth angle of sky horizon element for (int N = 1; N <= NTH; ++N) { @@ -1583,7 +1580,7 @@ namespace DaylightingDevices { E3 = std::pow(pow_2(M) * (1.0 + pow_2(M) + pow_2(N)) / ((1.0 + pow_2(M)) * (pow_2(M) + pow_2(N))), pow_2(M)); E4 = std::pow(pow_2(N) * (1.0 + pow_2(M) + pow_2(N)) / ((1.0 + pow_2(N)) * (pow_2(M) + pow_2(N))), pow_2(N)); - Shelf(ShelfNum).ViewFactor = (1.0 / (Pi * M)) * (E1 + 0.25 * std::log(E2 * E3 * E4)); + Shelf(ShelfNum).ViewFactor = (1.0 / (DataGlobalConstants::Pi() * M)) * (E1 + 0.25 * std::log(E2 * E3 * E4)); } void FigureTDDZoneGains() diff --git a/src/EnergyPlus/DaylightingManager.cc b/src/EnergyPlus/DaylightingManager.cc index 104a14a0dec..378271bfbd3 100644 --- a/src/EnergyPlus/DaylightingManager.cc +++ b/src/EnergyPlus/DaylightingManager.cc @@ -649,7 +649,7 @@ namespace DaylightingManager { GILSU = 0.0; for (IHR = 1; IHR <= 24; ++IHR) { if (SUNCOSHR(IHR, 3) < SunIsUpValue) continue; // Skip if sun is below horizon //Autodesk SUNCOSHR was uninitialized here - PHSUN = PiOvr2 - std::acos(SUNCOSHR(IHR, 3)); + PHSUN = DataGlobalConstants::PiOvr2() - std::acos(SUNCOSHR(IHR, 3)); PHSUNHR(IHR) = PHSUN; SPHSUNHR(IHR) = std::sin(PHSUN); CPHSUNHR(IHR) = std::cos(PHSUN); @@ -674,7 +674,7 @@ namespace DaylightingManager { GILSK(HourOfDay, {1, 4}) = 0.0; GILSU(HourOfDay) = 0.0; if (!(SUNCOSHR(HourOfDay, 3) < SunIsUpValue)) { // Skip if sun is below horizon - PHSUN = PiOvr2 - std::acos(SUNCOSHR(HourOfDay, 3)); + PHSUN = DataGlobalConstants::PiOvr2() - std::acos(SUNCOSHR(HourOfDay, 3)); PHSUNHR(HourOfDay) = PHSUN; SPHSUNHR(HourOfDay) = std::sin(PHSUN); CPHSUNHR(HourOfDay) = std::cos(PHSUN); @@ -1049,7 +1049,7 @@ namespace DaylightingManager { } // Azimuth of view vector in absolute coord sys - AZVIEW = (ZoneDaylight(ZoneNum).ViewAzimuthForGlare + Zone(ZoneNum).RelNorth + BuildingAzimuth + BuildingRotationAppendixG) * DegToRadians; + AZVIEW = (ZoneDaylight(ZoneNum).ViewAzimuthForGlare + Zone(ZoneNum).RelNorth + BuildingAzimuth + BuildingRotationAppendixG) * DataGlobalConstants::DegToRadians(); // View vector components in absolute coord sys VIEWVC(1) = std::sin(AZVIEW); VIEWVC(2) = std::cos(AZVIEW); @@ -1453,7 +1453,7 @@ namespace DaylightingManager { } // Azimuth of view vector in absolute coord sys - AZVIEW = (ZoneDaylight(ZoneNum).ViewAzimuthForGlare + Zone(ZoneNum).RelNorth + BuildingAzimuth + BuildingRotationAppendixG) * DegToRadians; + AZVIEW = (ZoneDaylight(ZoneNum).ViewAzimuthForGlare + Zone(ZoneNum).RelNorth + BuildingAzimuth + BuildingRotationAppendixG) * DataGlobalConstants::DegToRadians(); // View vector components in absolute coord sys VIEWVC(1) = std::sin(AZVIEW); VIEWVC(2) = std::cos(AZVIEW); @@ -2582,7 +2582,7 @@ namespace DaylightingManager { DWX = Surface(IWin).Width / NWX; DWY = Surface(IWin).Height / NWY; - AZVIEW = (ZoneDaylight(ZoneNum).ViewAzimuthForGlare + Zone(ZoneNum).RelNorth + BuildingAzimuth + BuildingRotationAppendixG) * DegToRadians; + AZVIEW = (ZoneDaylight(ZoneNum).ViewAzimuthForGlare + Zone(ZoneNum).RelNorth + BuildingAzimuth + BuildingRotationAppendixG) * DataGlobalConstants::DegToRadians(); // Perform necessary calculations for window coordinates and vectors. This will be used to calculate centroids for // each window element @@ -3199,7 +3199,7 @@ namespace DaylightingManager { elPos = DaylghtAltAndAzimuth(V); - XR = std::tan(std::abs(PiOvr2 - AZVIEW - elPos.Azimuth) + 0.001); + XR = std::tan(std::abs(DataGlobalConstants::PiOvr2() - AZVIEW - elPos.Azimuth) + 0.001); YR = std::tan(elPos.Altitude + 0.001); RefPointMap.RefPtIntPosFac(iTrnRay) = DayltgGlarePositionFactor(XR, YR); } @@ -3262,8 +3262,8 @@ namespace DaylightingManager { assert(AzimSteps <= AzimAngStepsForSolReflCalc); - DPhi = PiOvr2 / (AltSteps / 2.0); - DTheta = Pi / AzimSteps; + DPhi = DataGlobalConstants::PiOvr2() / (AltSteps / 2.0); + DTheta = DataGlobalConstants::Pi() / AzimSteps; SkyGndObs = 0.0; SkyGndUnObs = 0.0; @@ -3297,7 +3297,7 @@ namespace DaylightingManager { dOmegaGnd = CPhi * DTheta * DPhi; // Cosine of angle of incidence of ground ray on ground plane CosIncAngURay = SPhi; - IncAngSolidAngFac = CosIncAngURay * dOmegaGnd / Pi; + IncAngSolidAngFac = CosIncAngURay * dOmegaGnd / DataGlobalConstants::Pi(); // Azimuth loop for (int ITheta = 1; ITheta <= 2 * AzimSteps; ++ITheta) { URay(1) = CPhi * cos_Theta(ITheta); @@ -3606,10 +3606,10 @@ namespace DaylightingManager { if (dot(Ray, Surface(NearestHitSurfNum).OutNormVec) > 0.0) NearestHitSurfNumX = NearestHitSurfNum + 1; } if (!DetailedSkyDiffuseAlgorithm || !ShadingTransmittanceVaries || SolarDistribution == MinimalShadowing) { - SkyReflVisLum = ObsVisRefl * Surface(NearestHitSurfNumX).ViewFactorSky * DifShdgRatioIsoSky(NearestHitSurfNumX) / Pi; + SkyReflVisLum = ObsVisRefl * Surface(NearestHitSurfNumX).ViewFactorSky * DifShdgRatioIsoSky(NearestHitSurfNumX) / DataGlobalConstants::Pi(); } else { SkyReflVisLum = - ObsVisRefl * Surface(NearestHitSurfNumX).ViewFactorSky * DifShdgRatioIsoSkyHRTS(1, iHour, NearestHitSurfNumX) / Pi; + ObsVisRefl * Surface(NearestHitSurfNumX).ViewFactorSky * DifShdgRatioIsoSkyHRTS(1, iHour, NearestHitSurfNumX) / DataGlobalConstants::Pi(); } assert(equal_dimensions(AVWLSK, EDIRSK)); auto l2(GILSK.index(iHour, 1)); @@ -3667,9 +3667,9 @@ namespace DaylightingManager { GroundHitPt(2) = RWIN2(2); } } - Real64 const GILSK_mult((GndReflectanceForDayltg / Pi) * ObTrans * SkyObstructionMult); + Real64 const GILSK_mult((GndReflectanceForDayltg / DataGlobalConstants::Pi()) * ObTrans * SkyObstructionMult); Real64 const TVISB_ObTrans(TVISB * ObTrans); - Real64 const AVWLSU_add(TVISB_ObTrans * GILSU(iHour) * (GndReflectanceForDayltg / Pi)); + Real64 const AVWLSU_add(TVISB_ObTrans * GILSU(iHour) * (GndReflectanceForDayltg / DataGlobalConstants::Pi())); Vector3 const SUNCOS_iHour(SUNCOSHR(iHour, {1, 3})); assert(equal_dimensions(EDIRSK, AVWLSK)); auto l(EDIRSK.index(iHour, 1, 1)); @@ -3824,9 +3824,9 @@ namespace DaylightingManager { for (JB = 1; JB <= MaxSlatAngs; ++JB) { // IF (.NOT.SurfaceWindow(IWin)%MovableSlats .AND. JB > 1) EXIT if (SurfWinMovableSlats(IWin)) { - SlatAng = (JB - 1) * Pi / (MaxSlatAngs - 1); + SlatAng = (JB - 1) * DataGlobalConstants::Pi() / (MaxSlatAngs - 1); } else { - SlatAng = Blind(BlNum).SlatAngle * DegToRadians; + SlatAng = Blind(BlNum).SlatAngle * DataGlobalConstants::DegToRadians(); } TransBmBmMult(JB) = BlindBeamBeamTrans( ProfAng, SlatAng, Blind(BlNum).SlatWidth, Blind(BlNum).SlatSeparation, Blind(BlNum).SlatThickness); @@ -3848,7 +3848,7 @@ namespace DaylightingManager { // Position factor for sun (note that AZVIEW is wrt y-axis and THSUN is wrt // x-axis of absolute coordinate system. - XR = std::tan(std::abs(PiOvr2 - AZVIEW - THSUN) + 0.001); + XR = std::tan(std::abs(DataGlobalConstants::PiOvr2() - AZVIEW - THSUN) + 0.001); YR = std::tan(PHSUN + 0.001); POSFAC = DayltgGlarePositionFactor(XR, YR); @@ -3988,13 +3988,13 @@ namespace DaylightingManager { if (ShType == WSC_ST_ExteriorBlind || ShType == WSC_ST_InteriorBlind || ShType == WSC_ST_BetweenGlassBlind) { ProfileAngle(IWin, SunVecMir, Blind(BlNum).SlatOrientation, ProfAng); // Contribution of reflected beam passing through slats and reaching reference point - Real64 const Pi_SlatAng_fac(Pi / (MaxSlatAngs - 1)); + Real64 const Pi_SlatAng_fac(DataGlobalConstants::Pi() / (MaxSlatAngs - 1)); for (JB = 1; JB <= MaxSlatAngs; ++JB) { // IF (.NOT.SurfaceWindow(IWin)%MovableSlats .AND. JB > 1) EXIT if (SurfWinMovableSlats(IWin)) { SlatAng = double(JB - 1) * Pi_SlatAng_fac; } else { - SlatAng = Blind(BlNum).SlatAngle * DegToRadians; + SlatAng = Blind(BlNum).SlatAngle * DataGlobalConstants::DegToRadians(); } TransBmBmMultRefl(JB) = BlindBeamBeamTrans( ProfAng, SlatAng, Blind(BlNum).SlatWidth, Blind(BlNum).SlatSeparation, Blind(BlNum).SlatThickness); @@ -4015,7 +4015,7 @@ namespace DaylightingManager { PHSUNrefl = SunVecMir(3); THSUNrefl = std::atan2(SunVecMir(2), SunVecMir(1)); - XR = std::tan(std::abs(PiOvr2 - AZVIEW - THSUNrefl) + 0.001); + XR = std::tan(std::abs(DataGlobalConstants::PiOvr2() - AZVIEW - THSUNrefl) + 0.001); YR = std::tan(PHSUNrefl + 0.001); POSFAC = DayltgGlarePositionFactor(XR, YR); if (POSFAC != 0.0 && SurfaceWindow(IWin).SolidAngAtRefPtWtd(iRefPoint) > 0.000001) { @@ -4155,7 +4155,7 @@ namespace DaylightingManager { ZoneDaylight(ZoneNum).DaylSourceFacSky(iHour, JSH, ISky, iRefPoint, loopwin) = AVWLSK(iHour, JSH, ISky) / (NWX * NWY * GILSK(iHour, ISky)); ZoneDaylight(ZoneNum).DaylBackFacSky(iHour, JSH, ISky, iRefPoint, loopwin) = - EINTSK(iHour, JSH, ISky) * ZoneDaylight(ZoneNum).AveVisDiffReflect / (Pi * GILSK(iHour, ISky)); + EINTSK(iHour, JSH, ISky) * ZoneDaylight(ZoneNum).AveVisDiffReflect / (DataGlobalConstants::Pi() * GILSK(iHour, ISky)); } else { ZoneDaylight(ZoneNum).DaylIllFacSky(iHour, JSH, ISky, iRefPoint, loopwin) = 0.0; ZoneDaylight(ZoneNum).DaylSourceFacSky(iHour, JSH, ISky, iRefPoint, loopwin) = 0.0; @@ -4175,9 +4175,9 @@ namespace DaylightingManager { AVWLSUdisk(iHour, JSH) / (NWX * NWY * (GILSU(iHour) + 0.0001)); ZoneDaylight(ZoneNum).DaylBackFacSun(iHour, JSH, iRefPoint, loopwin) = - EINTSU(iHour, JSH) * ZoneDaylight(ZoneNum).AveVisDiffReflect / (Pi * (GILSU(iHour) + 0.0001)); + EINTSU(iHour, JSH) * ZoneDaylight(ZoneNum).AveVisDiffReflect / (DataGlobalConstants::Pi() * (GILSU(iHour) + 0.0001)); ZoneDaylight(ZoneNum).DaylBackFacSunDisk(iHour, JSH, iRefPoint, loopwin) = - EINTSUdisk(iHour, JSH) * ZoneDaylight(ZoneNum).AveVisDiffReflect / (Pi * (GILSU(iHour) + 0.0001)); + EINTSUdisk(iHour, JSH) * ZoneDaylight(ZoneNum).AveVisDiffReflect / (DataGlobalConstants::Pi() * (GILSU(iHour) + 0.0001)); } else { ZoneDaylight(ZoneNum).DaylIllFacSun(iHour, JSH, iRefPoint, loopwin) = 0.0; ZoneDaylight(ZoneNum).DaylIllFacSunDisk(iHour, JSH, iRefPoint, loopwin) = 0.0; @@ -4300,7 +4300,7 @@ namespace DaylightingManager { IllumMapCalc(MapNum).DaylSourceFacSky(iHour, JSH, ISky, iMapPoint, loopwin) = AVWLSK(iHour, JSH, ISky) / (NWX * NWY * GILSK(iHour, ISky)); IllumMapCalc(MapNum).DaylBackFacSky(iHour, JSH, ISky, iMapPoint, loopwin) = - EINTSK(iHour, JSH, ISky) * ZoneDaylight(ZoneNum).AveVisDiffReflect / (Pi * GILSK(iHour, ISky)); + EINTSK(iHour, JSH, ISky) * ZoneDaylight(ZoneNum).AveVisDiffReflect / (DataGlobalConstants::Pi() * GILSK(iHour, ISky)); } else { IllumMapCalc(MapNum).DaylIllFacSky(iHour, JSH, ISky, iMapPoint, loopwin) = 0.0; IllumMapCalc(MapNum).DaylSourceFacSky(iHour, JSH, ISky, iMapPoint, loopwin) = 0.0; @@ -4320,9 +4320,9 @@ namespace DaylightingManager { AVWLSUdisk(iHour, JSH) / (NWX * NWY * (GILSU(iHour) + 0.0001)); IllumMapCalc(MapNum).DaylBackFacSun(iHour, JSH, iMapPoint, loopwin) = - EINTSU(iHour, JSH) * ZoneDaylight(ZoneNum).AveVisDiffReflect / (Pi * (GILSU(iHour) + 0.0001)); + EINTSU(iHour, JSH) * ZoneDaylight(ZoneNum).AveVisDiffReflect / (DataGlobalConstants::Pi() * (GILSU(iHour) + 0.0001)); IllumMapCalc(MapNum).DaylBackFacSunDisk(iHour, JSH, iMapPoint, loopwin) = - EINTSUdisk(iHour, JSH) * ZoneDaylight(ZoneNum).AveVisDiffReflect / (Pi * (GILSU(iHour) + 0.0001)); + EINTSUdisk(iHour, JSH) * ZoneDaylight(ZoneNum).AveVisDiffReflect / (DataGlobalConstants::Pi() * (GILSU(iHour) + 0.0001)); } else { IllumMapCalc(MapNum).DaylIllFacSun(iHour, JSH, iMapPoint, loopwin) = 0.0; IllumMapCalc(MapNum).DaylIllFacSunDisk(iHour, JSH, iMapPoint, loopwin) = 0.0; @@ -4719,11 +4719,11 @@ namespace DaylightingManager { Real64 NewAspectRatio; Array1D_bool ZoneMsgDone; - CosBldgRelNorth = std::cos(-(BuildingAzimuth + BuildingRotationAppendixG) * DegToRadians); - SinBldgRelNorth = std::sin(-(BuildingAzimuth + BuildingRotationAppendixG) * DegToRadians); + CosBldgRelNorth = std::cos(-(BuildingAzimuth + BuildingRotationAppendixG) * DataGlobalConstants::DegToRadians()); + SinBldgRelNorth = std::sin(-(BuildingAzimuth + BuildingRotationAppendixG) * DataGlobalConstants::DegToRadians()); // these are only for Building Rotation for Appendix G when using world coordinate system - CosBldgRotAppGonly = std::cos(-BuildingRotationAppendixG * DegToRadians); - SinBldgRotAppGonly = std::sin(-BuildingRotationAppendixG * DegToRadians); + CosBldgRotAppGonly = std::cos(-BuildingRotationAppendixG * DataGlobalConstants::DegToRadians()); + SinBldgRotAppGonly = std::sin(-BuildingRotationAppendixG * DataGlobalConstants::DegToRadians()); doTransform = false; OldAspectRatio = 1.0; @@ -4862,8 +4862,8 @@ namespace DaylightingManager { if (IllumMap(MapNum).Zone > 0) { auto &zone(Zone(IllumMap(MapNum).Zone)); // Calc cos and sin of Zone Relative North values for later use in transforming Reference Point coordinates - CosZoneRelNorth = std::cos(-zone.RelNorth * DegToRadians); - SinZoneRelNorth = std::sin(-zone.RelNorth * DegToRadians); + CosZoneRelNorth = std::cos(-zone.RelNorth * DataGlobalConstants::DegToRadians()); + SinZoneRelNorth = std::sin(-zone.RelNorth * DataGlobalConstants::DegToRadians()); if (IllumMap(MapNum).Xnum * IllumMap(MapNum).Ynum > 0) { // Add additional daylighting reference points for map AddMapPoints = IllumMap(MapNum).Xnum * IllumMap(MapNum).Ynum; @@ -5322,11 +5322,11 @@ namespace DaylightingManager { Real64 rLightLevel; // Calc cos and sin of Building Relative North values for later use in transforming Reference Point coordinates - CosBldgRelNorth = std::cos(-(BuildingAzimuth + BuildingRotationAppendixG) * DegToRadians); - SinBldgRelNorth = std::sin(-(BuildingAzimuth + BuildingRotationAppendixG) * DegToRadians); + CosBldgRelNorth = std::cos(-(BuildingAzimuth + BuildingRotationAppendixG) * DataGlobalConstants::DegToRadians()); + SinBldgRelNorth = std::sin(-(BuildingAzimuth + BuildingRotationAppendixG) * DataGlobalConstants::DegToRadians()); // these are only for Building Rotation for Appendix G when using world coordinate system - CosBldgRotAppGonly = std::cos(-BuildingRotationAppendixG * DegToRadians); - SinBldgRotAppGonly = std::sin(-BuildingRotationAppendixG * DegToRadians); + CosBldgRotAppGonly = std::cos(-BuildingRotationAppendixG * DataGlobalConstants::DegToRadians()); + SinBldgRotAppGonly = std::sin(-BuildingRotationAppendixG * DataGlobalConstants::DegToRadians()); doTransform = false; OldAspectRatio = 1.0; @@ -5340,8 +5340,8 @@ namespace DaylightingManager { auto &zone(Zone(zoneIndex)); // Calc cos and sin of Zone Relative North values for later use in transforming Reference Point coordinates - CosZoneRelNorth = std::cos(-zone.RelNorth * DegToRadians); - SinZoneRelNorth = std::sin(-zone.RelNorth * DegToRadians); + CosZoneRelNorth = std::cos(-zone.RelNorth * DataGlobalConstants::DegToRadians()); + SinZoneRelNorth = std::sin(-zone.RelNorth * DataGlobalConstants::DegToRadians()); rLightLevel = GetDesignLightingLevelForZone(zoneIndex); CheckLightsReplaceableMinMaxForZone(zoneIndex); @@ -5826,8 +5826,8 @@ namespace DaylightingManager { RefPoints = ZoneDaylight(ZoneNum).TotalDaylRefPoints; for (IL = 1; IL <= RefPoints; ++IL) { - BacLum = ZoneDaylight(ZoneNum).BacLum(IL) + ZoneDaylight(ZoneNum).InterReflIllFrIntWins * ZoneDaylight(ZoneNum).AveVisDiffReflect / Pi; - BacLum = max(ZoneDaylight(ZoneNum).IllumSetPoint(IL) * ZoneDaylight(ZoneNum).AveVisDiffReflect / Pi, BacLum); + BacLum = ZoneDaylight(ZoneNum).BacLum(IL) + ZoneDaylight(ZoneNum).InterReflIllFrIntWins * ZoneDaylight(ZoneNum).AveVisDiffReflect / DataGlobalConstants::Pi(); + BacLum = max(ZoneDaylight(ZoneNum).IllumSetPoint(IL) * ZoneDaylight(ZoneNum).AveVisDiffReflect / DataGlobalConstants::Pi(), BacLum); // Loop over exterior windows associated with zone for (loop = 1; loop <= ZoneDaylight(ZoneNum).NumOfDayltgExtWins; ++loop) { @@ -5888,8 +5888,8 @@ namespace DaylightingManager { // SUBROUTINE PARAMETER DEFINITIONS: int const NTH(18); // Number of azimuth steps for sky integration int const NPH(8); // Number of altitude steps for sky integration - Real64 const DTH((2.0 * Pi) / double(NTH)); // Sky integration azimuth stepsize (radians) - Real64 const DPH(PiOvr2 / double(NPH)); // Sky integration altitude stepsize (radians) + Real64 const DTH((2.0 * DataGlobalConstants::Pi()) / double(NTH)); // Sky integration azimuth stepsize (radians) + Real64 const DPH(DataGlobalConstants::PiOvr2() / double(NPH)); // Sky integration altitude stepsize (radians) // INTERFACE BLOCK SPECIFICATIONS // na @@ -6827,7 +6827,7 @@ namespace DaylightingManager { // Calculate glare index at each reference point assuming the daylight illuminance setpoint is // met at both reference points, either by daylight or electric lights for (IL = 1; IL <= NREFPT; ++IL) { - BACL = max(SetPnt(IL) * ZoneDaylight(ZoneNum).AveVisDiffReflect / Pi, ZoneDaylight(ZoneNum).BacLum(IL)); + BACL = max(SetPnt(IL) * ZoneDaylight(ZoneNum).AveVisDiffReflect / DataGlobalConstants::Pi(), ZoneDaylight(ZoneNum).BacLum(IL)); // DayltgGlare uses ZoneDaylight(ZoneNum)%SourceLumFromWinAtRefPt(IL,1,loop) for unshaded windows, and // ZoneDaylight(ZoneNum)%SourceLumFromWinAtRefPt(IL,2,loop) for shaded windows DayltgGlare(IL, BACL, GLRNDX(IL), ZoneNum); @@ -6940,7 +6940,7 @@ namespace DaylightingManager { // Re-calc daylight and glare at shaded state. For switchable glazings, it is the fully dark state. for (IL = 1; IL <= NREFPT; ++IL) { - BACL = max(SetPnt(IL) * ZoneDaylight(ZoneNum).AveVisDiffReflect / Pi, RBACLU(IL, igroup)); + BACL = max(SetPnt(IL) * ZoneDaylight(ZoneNum).AveVisDiffReflect / DataGlobalConstants::Pi(), RBACLU(IL, igroup)); // DayltgGlare uses ZoneDaylight(ZoneNum)%SourceLumFromWinAtRefPt(IL,2,loop) for shaded state DayltgGlare(IL, BACL, GLRNEW(IL), ZoneNum); } @@ -7077,7 +7077,7 @@ namespace DaylightingManager { RDAYIL(IL, igroup) = DaylIllum(IL) + (WDAYIL(1, IL, igroup) - WDAYIL(2, IL, igroup)) * (1.0 - tmpSWFactor); RBACLU(IL, igroup) = ZoneDaylight(ZoneNum).BacLum(IL) + (WBACLU(1, IL, igroup) - WBACLU(2, IL, igroup)) * (1.0 - tmpSWFactor); - BACL = max(SetPnt(IL) * ZoneDaylight(ZoneNum).AveVisDiffReflect / Pi, RBACLU(IL, igroup)); + BACL = max(SetPnt(IL) * ZoneDaylight(ZoneNum).AveVisDiffReflect / DataGlobalConstants::Pi(), RBACLU(IL, igroup)); // needs to update SourceLumFromWinAtRefPt(IL,2,loop) before re-calc DayltgGlare tmpMult = (TVIS1(igroup) - (TVIS1(igroup) - TVIS2(igroup)) * tmpSWFactor) / TVIS2(igroup); if (IL == 1) { @@ -7123,7 +7123,7 @@ namespace DaylightingManager { RDAYIL(IL, igroup) = DaylIllum(IL) + (WDAYIL(1, IL, igroup) - WDAYIL(2, IL, igroup)) * (1.0 - tmpSWFactor); RBACLU(IL, igroup) = ZoneDaylight(ZoneNum).BacLum(IL) + (WBACLU(1, IL, igroup) - WBACLU(2, IL, igroup)) * (1.0 - tmpSWFactor); - BACL = max(SetPnt(IL) * ZoneDaylight(ZoneNum).AveVisDiffReflect / Pi, RBACLU(IL, igroup)); + BACL = max(SetPnt(IL) * ZoneDaylight(ZoneNum).AveVisDiffReflect / DataGlobalConstants::Pi(), RBACLU(IL, igroup)); // needs to update SourceLumFromWinAtRefPt(IL,2,IWin) before re-calc DayltgGlare tmpMult = (TVIS1(igroup) - (TVIS1(igroup) - TVIS2(igroup)) * tmpSWFactor) / TVIS2(igroup); @@ -7795,8 +7795,8 @@ namespace DaylightingManager { // Azimuth ranges over a maximum of 2 Pi radians. // Altitude ranges over a maximum of Pi/2 radians between -Pi/2 < PH < +Pi/2, so that elements are not counted twice // PH = 0 at the horizon; PH = Pi/2 at the zenith - PHMIN = max(-PiOvr2, SurfWinPhi(IWin) - PiOvr2); - PHMAX = min(PiOvr2, SurfWinPhi(IWin) + PiOvr2); + PHMIN = max(-DataGlobalConstants::PiOvr2(), SurfWinPhi(IWin) - DataGlobalConstants::PiOvr2()); + PHMAX = min(DataGlobalConstants::PiOvr2(), SurfWinPhi(IWin) + DataGlobalConstants::PiOvr2()); DPH = (PHMAX - PHMIN) / double(NPHMAX); // Sky/ground element altitude integration @@ -7813,9 +7813,9 @@ namespace DaylightingManager { PhWin = SurfWinPhi(IWin); ThWin = SurfWinTheta(IWin); if (PhWin >= 0.0) { - if (PH >= PiOvr2 - PhWin) { - ThMin = -Pi; - ThMax = Pi; + if (PH >= DataGlobalConstants::PiOvr2() - PhWin) { + ThMin = -DataGlobalConstants::Pi(); + ThMax = DataGlobalConstants::Pi(); } else { ACosTanTan = std::acos(-std::tan(PH) * std::tan(PhWin)); ThMin = ThWin - std::abs(ACosTanTan); @@ -7823,9 +7823,9 @@ namespace DaylightingManager { } } else { // PhiSurf < 0.0 - if (PH <= -PhWin - PiOvr2) { - ThMin = -Pi; - ThMax = Pi; + if (PH <= -PhWin - DataGlobalConstants::PiOvr2()) { + ThMin = -DataGlobalConstants::Pi(); + ThMax = DataGlobalConstants::Pi(); } else { ACosTanTan = std::acos(-std::tan(PH) * std::tan(PhWin)); ThMin = ThWin - std::abs(ACosTanTan); @@ -7890,7 +7890,7 @@ namespace DaylightingManager { for (ISky = 1; ISky <= 4; ++ISky) { // Below, luminance of ground in cd/m2 is illuminance on ground in lumens/m2 // times ground reflectance, divided by pi, times obstruction multiplier. - ZSK(ISky) = (GILSK(IHR, ISky) * GndReflectanceForDayltg / Pi) * COSB * DA * ObTransM(IPH, ITH) * SkyObstructionMult(IPH, ITH); + ZSK(ISky) = (GILSK(IHR, ISky) * GndReflectanceForDayltg / DataGlobalConstants::Pi()) * COSB * DA * ObTransM(IPH, ITH) * SkyObstructionMult(IPH, ITH); } // Determine if sun illuminates the point that ray hits the ground. If the solar reflection // calculation has been requested (CalcSolRefl = .TRUE.) shading by obstructions, including @@ -7907,7 +7907,7 @@ namespace DaylightingManager { } if (hitObs) SunObstructionMult = 0.0; } - ZSU = (GILSU(IHR) * GndReflectanceForDayltg / Pi) * COSB * DA * ObTransM(IPH, ITH) * SunObstructionMult; + ZSU = (GILSU(IHR) * GndReflectanceForDayltg / DataGlobalConstants::Pi()) * COSB * DA * ObTransM(IPH, ITH) * SunObstructionMult; } // BEAM SOLAR AND SKY SOLAR REFLECTED FROM NEAREST OBSTRUCTION @@ -7956,10 +7956,10 @@ namespace DaylightingManager { if (dot(U, Surface(NearestHitSurfNum).OutNormVec) > 0.0) NearestHitSurfNumX = NearestHitSurfNum + 1; } if (!DetailedSkyDiffuseAlgorithm || !ShadingTransmittanceVaries || SolarDistribution == MinimalShadowing) { - SkyReflVisLum = ObsVisRefl * Surface(NearestHitSurfNumX).ViewFactorSky * DifShdgRatioIsoSky(NearestHitSurfNumX) / Pi; + SkyReflVisLum = ObsVisRefl * Surface(NearestHitSurfNumX).ViewFactorSky * DifShdgRatioIsoSky(NearestHitSurfNumX) / DataGlobalConstants::Pi(); } else { SkyReflVisLum = - ObsVisRefl * Surface(NearestHitSurfNumX).ViewFactorSky * DifShdgRatioIsoSkyHRTS(1, IHR, NearestHitSurfNumX) / Pi; + ObsVisRefl * Surface(NearestHitSurfNumX).ViewFactorSky * DifShdgRatioIsoSkyHRTS(1, IHR, NearestHitSurfNumX) / DataGlobalConstants::Pi(); } dReflObsSky = SkyReflVisLum * COSB * DA; for (ISky = 1; ISky <= 4; ++ISky) { @@ -7980,7 +7980,7 @@ namespace DaylightingManager { // Make all transmitted light diffuse for a TDD with a bare diffuser for (ISky = 1; ISky <= 4; ++ISky) { - WLUMSK(IHR, 1, ISky) += ZSK(ISky) * TVISBR / Pi; + WLUMSK(IHR, 1, ISky) += ZSK(ISky) * TVISBR / DataGlobalConstants::Pi(); FLFWSK(1, ISky) += ZSK(ISky) * TVISBR * (1.0 - SurfWinFractionUpgoing(IWin)); FLCWSK(1, ISky) += ZSK(ISky) * TVISBR * SurfWinFractionUpgoing(IWin); @@ -7989,7 +7989,7 @@ namespace DaylightingManager { TDDFluxTrans(IHR, ISky, PipeNum) += ZSK(ISky) * TVISBR; if (ISky == 1) { - WLUMSU(IHR, 1) += ZSU * TVISBR / Pi; + WLUMSU(IHR, 1) += ZSU * TVISBR / DataGlobalConstants::Pi(); FLFWSU(1) += ZSU * TVISBR * (1.0 - SurfWinFractionUpgoing(IWin)); FLCWSU(1) += ZSU * TVISBR * SurfWinFractionUpgoing(IWin); @@ -8161,9 +8161,9 @@ namespace DaylightingManager { } if (SurfWinMovableSlats(IWin)) { - SlatAng = (JB - 1) * Pi / (MaxSlatAngs - 1); + SlatAng = (JB - 1) * DataGlobalConstants::Pi() / (MaxSlatAngs - 1); } else { - SlatAng = Blind(BlNum).SlatAngle * DegToRadians; + SlatAng = Blind(BlNum).SlatAngle * DataGlobalConstants::DegToRadians(); } TransBmBmMult(JB) = TVISBR * @@ -8193,13 +8193,13 @@ namespace DaylightingManager { // EXIT after first pass if not movable slats or exterior window screen if (!SurfWinMovableSlats(IWin) && JB > 1) break; - WLUMSK(IHR, JB + 1, ISky) += ZSK(ISky) * TransMult(JB) / Pi; + WLUMSK(IHR, JB + 1, ISky) += ZSK(ISky) * TransMult(JB) / DataGlobalConstants::Pi(); FLFWSK(JB + 1, ISky) += ZSK(ISky) * TransMult(JB) * (1.0 - SurfWinFractionUpgoing(IWin)); if (PH > 0.0 && (BlindOn || ScreenOn)) FLFWSK(JB + 1, ISky) += ZSK(ISky) * TransBmBmMult(JB); FLCWSK(JB + 1, ISky) += ZSK(ISky) * TransMult(JB) * SurfWinFractionUpgoing(IWin); if (PH <= 0.0 && (BlindOn || ScreenOn)) FLCWSK(JB + 1, ISky) += ZSK(ISky) * TransBmBmMult(JB); if (ISky == 1) { - WLUMSU(IHR, JB + 1) += ZSU * TransMult(JB) / Pi; + WLUMSU(IHR, JB + 1) += ZSU * TransMult(JB) / DataGlobalConstants::Pi(); FLFWSU(JB + 1) += ZSU * TransMult(JB) * (1.0 - SurfWinFractionUpgoing(IWin)); if (PH > 0.0 && (BlindOn || ScreenOn)) FLFWSU(JB + 1) += ZSU * TransBmBmMult(JB); FLCWSU(JB + 1) += ZSU * TransMult(JB) * SurfWinFractionUpgoing(IWin); @@ -8276,7 +8276,7 @@ namespace DaylightingManager { FLFWSUdisk(1) = 0.0; // Diffuse light only - WLUMSU(IHR, 1) += ZSU1 * TVISBSun / Pi; + WLUMSU(IHR, 1) += ZSU1 * TVISBSun / DataGlobalConstants::Pi(); FLFWSU(1) += ZSU1 * TVISBSun * (1.0 - SurfWinFractionUpgoing(IWin)); FLCWSU(1) += ZSU1 * TVISBSun * SurfWinFractionUpgoing(IWin); @@ -8363,9 +8363,9 @@ namespace DaylightingManager { } } if (SurfWinMovableSlats(IWin)) { - SlatAng = (JB - 1) * Pi / (MaxSlatAngs - 1); + SlatAng = (JB - 1) * DataGlobalConstants::Pi() / (MaxSlatAngs - 1); } else { - SlatAng = Blind(BlNum).SlatAngle * DegToRadians; + SlatAng = Blind(BlNum).SlatAngle * DataGlobalConstants::DegToRadians(); } TransBmBmMult(JB) = TVISBSun * @@ -8382,8 +8382,8 @@ namespace DaylightingManager { // SurfaceWindow(IWin)%FractionUpgoing is already set to 1.0 earlier } - WLUMSU(IHR, JB + 1) += ZSU1 * TransMult(JB) / Pi; - WLUMSUdisk(IHR, JB + 1) = ZSU1 * TransBmBmMult(JB) / Pi; + WLUMSU(IHR, JB + 1) += ZSU1 * TransMult(JB) / DataGlobalConstants::Pi(); + WLUMSUdisk(IHR, JB + 1) = ZSU1 * TransBmBmMult(JB) / DataGlobalConstants::Pi(); FLFWSU(JB + 1) += ZSU1 * TransMult(JB) * (1.0 - SurfWinFractionUpgoing(IWin)); FLFWSUdisk(JB + 1) = ZSU1 * TransBmBmMult(JB); FLCWSU(JB + 1) += ZSU1 * TransMult(JB) * SurfWinFractionUpgoing(IWin); @@ -8460,7 +8460,7 @@ namespace DaylightingManager { } // End of check of interior/exterior/between-glass blind } // ShadeOn/BlindOn - WLUMSU(IHR, JB + 1) += ZSU1refl * TransMult(JB) / Pi; + WLUMSU(IHR, JB + 1) += ZSU1refl * TransMult(JB) / DataGlobalConstants::Pi(); FLFWSU(JB + 1) += ZSU1refl * TransMult(JB) * (1.0 - SurfWinFractionUpgoing(IWin)); FLCWSU(JB + 1) += ZSU1refl * TransMult(JB) * SurfWinFractionUpgoing(IWin); } // End of loop over slat angles @@ -8561,17 +8561,17 @@ namespace DaylightingManager { // Ray from ground element // BeamObstrMultiplier = ComplexWind(IWin)%DaylghtGeom(CurCplxFenState)%GndObstrMultiplier(WinEl, iIncElem) for (iSky = 1; iSky <= 4; ++iSky) { - ElementLuminanceSky(iSky, iIncElem) = GILSK(IHR, iSky) * GndReflectanceForDayltg / Pi * LambdaInc; + ElementLuminanceSky(iSky, iIncElem) = GILSK(IHR, iSky) * GndReflectanceForDayltg / DataGlobalConstants::Pi() * LambdaInc; } - ElementLuminanceSun(iIncElem) = GILSU(IHR) * GndReflectanceForDayltg / Pi * LambdaInc; + ElementLuminanceSun(iIncElem) = GILSU(IHR) * GndReflectanceForDayltg / DataGlobalConstants::Pi() * LambdaInc; } else { // Ray from the element which is half sky and half ground for (iSky = 1; iSky <= 4; ++iSky) { // in this case half of the pach is coming from the sky and half from the ground ElementLuminanceSky(iSky, iIncElem) = 0.5 * DayltgSkyLuminance(iSky, Azimuth, Altitude) * LambdaInc; - ElementLuminanceSky(iSky, iIncElem) += 0.5 * GILSK(IHR, iSky) * GndReflectanceForDayltg / Pi * LambdaInc; + ElementLuminanceSky(iSky, iIncElem) += 0.5 * GILSK(IHR, iSky) * GndReflectanceForDayltg / DataGlobalConstants::Pi() * LambdaInc; } - ElementLuminanceSun(iIncElem) = 0.5 * GILSU(IHR) * GndReflectanceForDayltg / Pi * LambdaInc; + ElementLuminanceSun(iIncElem) = 0.5 * GILSU(IHR) * GndReflectanceForDayltg / DataGlobalConstants::Pi() * LambdaInc; } // Sun beam calculations if ((SolBmIndex == iIncElem) && (SunlitFracHR(IHR, IWin) > 0.0)) { @@ -9025,7 +9025,7 @@ namespace DaylightingManager { // Need to recalculate position factor for dominant direction in case of specular bsdf. Otherwise this will produce // very inaccurate results because of position factor of the sun and bsdf pach can vary by lot if (iTrnElem == SolBmIndex) { - XR = std::tan(std::abs(PiOvr2 - AZVIEW - THSUN) + 0.001); + XR = std::tan(std::abs(DataGlobalConstants::PiOvr2() - AZVIEW - THSUN) + 0.001); YR = std::tan(PHSUN + 0.001); PosFac = DayltgGlarePositionFactor(XR, YR); RayZ = SPHSUN; @@ -9127,7 +9127,7 @@ namespace DaylightingManager { // FLOW: SPHSKY = max(std::sin(PHSKY), 0.01); // Prevent floating point underflows - Z = PiOvr2 - PHSUN; + Z = DataGlobalConstants::PiOvr2() - PHSUN; if (ISky >= 1 && ISky <= 3) { // Following not needed for overcast sky COSG = SPHSKY * SPHSUN + std::cos(PHSKY) * CPHSUN * std::cos(THSKY - THSUN); COSG = max(constant_minusone, min(COSG, 1.0)); // Prevent out of range due to roundoff @@ -9214,20 +9214,20 @@ namespace DaylightingManager { // FLOW: if (HorOrVert == Horizontal) { // Profile angle for horizontal structures - ElevWin = PiOvr2 - Surface(SurfNum).Tilt * DegToRadians; - AzimWin = (90.0 - Surface(SurfNum).Azimuth) * DegToRadians; + ElevWin = DataGlobalConstants::PiOvr2() - Surface(SurfNum).Tilt * DataGlobalConstants::DegToRadians(); + AzimWin = (90.0 - Surface(SurfNum).Azimuth) * DataGlobalConstants::DegToRadians(); ElevSun = std::asin(CosDirSun(3)); AzimSun = std::atan2(CosDirSun(2), CosDirSun(1)); ProfileAng = std::atan(std::sin(ElevSun) / std::abs(std::cos(ElevSun) * std::cos(AzimWin - AzimSun))) - ElevWin; } else { // Profile angle for vertical structures - ElevWin = PiOvr2 - Surface(SurfNum).Tilt * DegToRadians; - AzimWin = Surface(SurfNum).Azimuth * DegToRadians; // 7952 + ElevWin = DataGlobalConstants::PiOvr2() - Surface(SurfNum).Tilt * DataGlobalConstants::DegToRadians(); + AzimWin = Surface(SurfNum).Azimuth * DataGlobalConstants::DegToRadians(); // 7952 AzimSun = std::atan2(CosDirSun(1), CosDirSun(2)); // 7952 if (std::abs(ElevWin) < 0.1) { // Near-vertical window ProfileAng = AzimWin - AzimSun; // CR7952 allow sign changes. } else { WinNorm = Surface(SurfNum).OutNormVec; - ThWin = AzimWin - PiOvr2; + ThWin = AzimWin - DataGlobalConstants::PiOvr2(); Real64 const sin_ElevWin(std::sin(ElevWin)); WinNormCrossBase(1) = -sin_ElevWin * std::cos(ThWin); WinNormCrossBase(2) = sin_ElevWin * std::sin(ThWin); @@ -9238,7 +9238,7 @@ namespace DaylightingManager { if ((AzimWin - AzimSun) < 0.0) ProfileAng = -1.0 * ProfileAng; } // Constrain to 0 to pi - if (ProfileAng > Pi) ProfileAng = 2.0 * Pi - ProfileAng; + if (ProfileAng > DataGlobalConstants::Pi()) ProfileAng = 2.0 * DataGlobalConstants::Pi() - ProfileAng; } } @@ -9444,7 +9444,7 @@ namespace DaylightingManager { DiffVisRefl = 0.0; } } - LumAtReflHitPtFrSun = CosIncAngAtHitPt * DiffVisRefl / Pi; + LumAtReflHitPtFrSun = CosIncAngAtHitPt * DiffVisRefl / DataGlobalConstants::Pi(); } void DayltgInteriorMapIllum(EnergyPlusData &state, int &ZoneNum) // Zone number @@ -10773,7 +10773,7 @@ namespace DaylightingManager { // FLOW: for (ZoneNum = 1; ZoneNum <= NumOfZones; ++ZoneNum) { - ZoneDaylight(ZoneNum).MinIntWinSolidAng = 2.0 * Pi; + ZoneDaylight(ZoneNum).MinIntWinSolidAng = 2.0 * DataGlobalConstants::Pi(); if (ZoneDaylight(ZoneNum).TotalDaylRefPoints == 0) continue; if (ZoneDaylight(ZoneNum).NumOfIntWinAdjZones == 0) continue; for (IWin = Zone(ZoneNum).SurfaceFirst; IWin <= Zone(ZoneNum).SurfaceLast; ++IWin) { diff --git a/src/EnergyPlus/EarthTube.cc b/src/EnergyPlus/EarthTube.cc index cd5b29348f6..4d6a9c7ba42 100644 --- a/src/EnergyPlus/EarthTube.cc +++ b/src/EnergyPlus/EarthTube.cc @@ -566,16 +566,16 @@ namespace EarthTube { EarthTubeSys(Loop).FanPower = EAMFL(NZ) * EarthTubeSys(Loop).FanPressure / (EarthTubeSys(Loop).FanEfficiency * AirDensity); } - AverPipeAirVel = EVF / Pi / pow_2(EarthTubeSys(Loop).r1); + AverPipeAirVel = EVF / DataGlobalConstants::Pi() / pow_2(EarthTubeSys(Loop).r1); AirMassFlowRate = EVF * AirDensity; // Calculation of Average Ground Temperature between Depth z1 and z2 at time t GroundTempz1z2t = EarthTubeSys(Loop).AverSoilSurTemp - EarthTubeSys(Loop).ApmlSoilSurTemp * - std::exp(-EarthTubeSys(Loop).z * std::sqrt(Pi / 365.0 / EarthTubeSys(Loop).SoilThermDiff)) * - std::cos(2.0 * Pi / 365.0 * + std::exp(-EarthTubeSys(Loop).z * std::sqrt(DataGlobalConstants::Pi() / 365.0 / EarthTubeSys(Loop).SoilThermDiff)) * + std::cos(2.0 * DataGlobalConstants::Pi() / 365.0 * (DayOfYear - EarthTubeSys(Loop).SoilSurPhaseConst - - EarthTubeSys(Loop).z / 2.0 * std::sqrt(365.0 / Pi / EarthTubeSys(Loop).SoilThermDiff))); + EarthTubeSys(Loop).z / 2.0 * std::sqrt(365.0 / DataGlobalConstants::Pi() / EarthTubeSys(Loop).SoilThermDiff))); EarthTubeSys(Loop).GroundTempz1z2t = GroundTempz1z2t; // Calculation of Convective Heat Transfer Coefficient at Inner Pipe Surface @@ -596,11 +596,11 @@ namespace EarthTube { } PipeHeatTransCoef = Nu * AirThermCond / 2.0 / EarthTubeSys(Loop).r1; - // Claculation of Thermal Resistance and Overall Heat Transger Coefficient - Rc = 1.0 / 2.0 / Pi / EarthTubeSys(Loop).r1 / PipeHeatTransCoef; - Rp = std::log((EarthTubeSys(Loop).r1 + EarthTubeSys(Loop).r2) / EarthTubeSys(Loop).r1) / 2.0 / Pi / EarthTubeSys(Loop).PipeThermCond; + // Calculation of Thermal Resistance and Overall Heat Transfer Coefficient + Rc = 1.0 / 2.0 / DataGlobalConstants::Pi() / EarthTubeSys(Loop).r1 / PipeHeatTransCoef; + Rp = std::log((EarthTubeSys(Loop).r1 + EarthTubeSys(Loop).r2) / EarthTubeSys(Loop).r1) / 2.0 / DataGlobalConstants::Pi() / EarthTubeSys(Loop).PipeThermCond; Rs = std::log((EarthTubeSys(Loop).r1 + EarthTubeSys(Loop).r2 + EarthTubeSys(Loop).r3) / (EarthTubeSys(Loop).r1 + EarthTubeSys(Loop).r2)) / - 2.0 / Pi / EarthTubeSys(Loop).SoilThermCond; + 2.0 / DataGlobalConstants::Pi() / EarthTubeSys(Loop).SoilThermCond; Rt = Rc + Rp + Rs; OverallHeatTransCoef = 1.0 / Rt; diff --git a/src/EnergyPlus/General.cc b/src/EnergyPlus/General.cc index 4e08a6b41d6..45654feef26 100644 --- a/src/EnergyPlus/General.cc +++ b/src/EnergyPlus/General.cc @@ -1040,9 +1040,6 @@ namespace General { // na // Using/Aliasing - using DataGlobals::Pi; - using DataGlobals::PiOvr2; - // Return value Real64 InterpBlind; @@ -1053,7 +1050,7 @@ namespace General { // FUNCTION ARGUMENT DEFINITIONS: // FUNCTION PARAMETER DEFINITIONS: - Real64 const DeltaAngRad(Pi / 36.0); // Profile angle increment (rad) + Real64 const DeltaAngRad(DataGlobalConstants::Pi() / 36.0); // Profile angle increment (rad) // INTERFACE BLOCK SPECIFICATIONS // na @@ -1065,11 +1062,11 @@ namespace General { Real64 InterpFac; // Interpolation factor int IAlpha; // Profile angle index - if (ProfAng > PiOvr2 || ProfAng < -PiOvr2) { + if (ProfAng > DataGlobalConstants::PiOvr2() || ProfAng < -DataGlobalConstants::PiOvr2()) { InterpBlind = 0.0; } else { - IAlpha = 1 + int((ProfAng + PiOvr2) / DeltaAngRad); - InterpFac = (ProfAng - (-PiOvr2 + DeltaAngRad * (IAlpha - 1))) / DeltaAngRad; + IAlpha = 1 + int((ProfAng + DataGlobalConstants::PiOvr2()) / DeltaAngRad); + InterpFac = (ProfAng - (-DataGlobalConstants::PiOvr2() + DeltaAngRad * (IAlpha - 1))) / DeltaAngRad; InterpBlind = (1.0 - InterpFac) * PropArray(IAlpha) + InterpFac * PropArray(IAlpha + 1); } return InterpBlind; @@ -1095,9 +1092,6 @@ namespace General { // REFERENCES:na // Using/Aliasing - using DataGlobals::Pi; - using DataGlobals::PiOvr2; - // Return value Real64 InterpProfAng; @@ -1105,18 +1099,18 @@ namespace General { // FUNCTION ARGUMENT DEFINITIONS: // FUNCTION PARAMETER DEFINITIONS: - Real64 const DeltaAngRad(Pi / 36.0); // Profile angle increment (rad) + Real64 const DeltaAngRad(DataGlobalConstants::Pi() / 36.0); // Profile angle increment (rad) // FUNCTION LOCAL VARIABLE DECLARATIONS: Real64 InterpFac; // Interpolation factor int IAlpha; // Profile angle index // DeltaAng = Pi/36 - if (ProfAng > PiOvr2 || ProfAng < -PiOvr2) { + if (ProfAng > DataGlobalConstants::PiOvr2() || ProfAng < -DataGlobalConstants::PiOvr2()) { InterpProfAng = 0.0; } else { - IAlpha = 1 + int((ProfAng + PiOvr2) / DeltaAngRad); - InterpFac = (ProfAng - (-PiOvr2 + DeltaAngRad * (IAlpha - 1))) / DeltaAngRad; + IAlpha = 1 + int((ProfAng + DataGlobalConstants::PiOvr2()) / DeltaAngRad); + InterpFac = (ProfAng - (-DataGlobalConstants::PiOvr2() + DeltaAngRad * (IAlpha - 1))) / DeltaAngRad; InterpProfAng = (1.0 - InterpFac) * PropArray(IAlpha) + InterpFac * PropArray(IAlpha + 1); } return InterpProfAng; @@ -1147,9 +1141,7 @@ namespace General { // // // USE STATEMENTS: // // Using/Aliasing - // using DataGlobals::Pi; - // using DataGlobals::PiOvr2; - // using DataSurfaces::MaxSlatAngs; + // // // using DataSurfaces::MaxSlatAngs; // // // Return value // Real64 InterpSlatAng; @@ -1210,7 +1202,6 @@ namespace General { // REFERENCES:na // Using/Aliasing - using DataGlobals::Pi; using DataSurfaces::MaxSlatAngs; // Return value @@ -1220,19 +1211,19 @@ namespace General { // FUNCTION ARGUMENT DEFINITIONS: // FUNCTION PARAMETER DEFINITIONS: - static Real64 const DeltaAng(Pi / (double(MaxSlatAngs) - 1.0)); - static Real64 const DeltaAng_inv((double(MaxSlatAngs) - 1.0) / Pi); + static Real64 const DeltaAng(DataGlobalConstants::Pi() / (double(MaxSlatAngs) - 1.0)); + static Real64 const DeltaAng_inv((double(MaxSlatAngs) - 1.0) / DataGlobalConstants::Pi()); // FUNCTION LOCAL VARIABLE DECLARATIONS: Real64 InterpFac; // Interpolation factor int IBeta; // Slat angle index Real64 SlatAng1; - if (SlatAng > Pi || SlatAng < 0.0) { + if (SlatAng > DataGlobalConstants::Pi() || SlatAng < 0.0) { // InterpSlatAng = 0.0 // RETURN // END IF - SlatAng1 = min(max(SlatAng, 0.0), Pi); + SlatAng1 = min(max(SlatAng, 0.0), DataGlobalConstants::Pi()); } else { SlatAng1 = SlatAng; } @@ -1271,8 +1262,6 @@ namespace General { // REFERENCES:na // Using/Aliasing - using DataGlobals::Pi; - using DataGlobals::PiOvr2; using DataSurfaces::MaxSlatAngs; // Return value @@ -1285,8 +1274,8 @@ namespace General { // FUNCTION ARGUMENT DEFINITIONS: // FUNCTION PARAMETER DEFINITIONS: - Real64 const DeltaProfAng(Pi / 36.0); - Real64 const DeltaSlatAng(Pi / (double(MaxSlatAngs) - 1.0)); + Real64 const DeltaProfAng(DataGlobalConstants::Pi() / 36.0); + Real64 const DeltaSlatAng(DataGlobalConstants::Pi() / (double(MaxSlatAngs) - 1.0)); // FUNCTION LOCAL VARIABLE DECLARATIONS: Real64 ProfAngRatio; // Profile angle interpolation factor @@ -1302,21 +1291,21 @@ namespace General { Real64 SlatAng1; Real64 ProfAng1; - if (SlatAng > Pi || SlatAng < 0.0 || ProfAng > PiOvr2 || ProfAng < -PiOvr2) { + if (SlatAng > DataGlobalConstants::Pi() || SlatAng < 0.0 || ProfAng > DataGlobalConstants::PiOvr2() || ProfAng < -DataGlobalConstants::PiOvr2()) { // InterpProfSlatAng = 0.0 // RETURN - SlatAng1 = min(max(SlatAng, 0.0), Pi); + SlatAng1 = min(max(SlatAng, 0.0), DataGlobalConstants::Pi()); // This is not correct, fixed 2/17/2010 // ProfAng1 = MIN(MAX(SlatAng,-PiOvr2),PiOvr2) - ProfAng1 = min(max(ProfAng, -PiOvr2), PiOvr2); + ProfAng1 = min(max(ProfAng, -DataGlobalConstants::PiOvr2()), DataGlobalConstants::PiOvr2()); } else { SlatAng1 = SlatAng; ProfAng1 = ProfAng; } - IAlpha = int((ProfAng1 + PiOvr2) / DeltaProfAng) + 1; - ProfAngRatio = (ProfAng1 + PiOvr2 - (IAlpha - 1) * DeltaProfAng) / DeltaProfAng; + IAlpha = int((ProfAng1 + DataGlobalConstants::PiOvr2()) / DeltaProfAng) + 1; + ProfAngRatio = (ProfAng1 + DataGlobalConstants::PiOvr2() - (IAlpha - 1) * DeltaProfAng) / DeltaProfAng; if (VarSlats) { // Variable-angle slats: interpolate in profile angle and slat angle IBeta = int(SlatAng1 / DeltaSlatAng) + 1; @@ -1360,9 +1349,6 @@ namespace General { // REFERENCES:na // Using/Aliasing - using DataGlobals::Pi; - using DataGlobals::PiOvr2; - // Return value Real64 BlindBeamBeamTrans; @@ -1394,7 +1380,7 @@ namespace General { fEdge = 0.0; fEdge1 = 0.0; if (std::abs(std::sin(gamma)) > 0.01) { - if ((SlatAng > 0.0 && SlatAng <= PiOvr2 && ProfAng <= SlatAng) || (SlatAng > PiOvr2 && SlatAng <= Pi && ProfAng > -(Pi - SlatAng))) + if ((SlatAng > 0.0 && SlatAng <= DataGlobalConstants::PiOvr2() && ProfAng <= SlatAng) || (SlatAng > DataGlobalConstants::PiOvr2() && SlatAng <= DataGlobalConstants::Pi() && ProfAng > -(DataGlobalConstants::Pi() - SlatAng))) fEdge1 = SlatThickness * std::abs(std::sin(gamma)) / ((SlatSeparation + SlatThickness / std::abs(std::sin(SlatAng))) * CosProfAng); fEdge = min(1.0, std::abs(fEdge1)); diff --git a/src/EnergyPlus/GeneralRoutines.cc b/src/EnergyPlus/GeneralRoutines.cc index bed40c33e61..efb13820ca5 100644 --- a/src/EnergyPlus/GeneralRoutines.cc +++ b/src/EnergyPlus/GeneralRoutines.cc @@ -1294,8 +1294,6 @@ void PassiveGapNusseltNumber(Real64 const AspRat, // Aspect Ratio of Gap height // Window5 source code; ISO 15099 // Using/Aliasing - using DataGlobals::DegToRadians; - // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -1324,7 +1322,7 @@ void PassiveGapNusseltNumber(Real64 const AspRat, // Aspect Ratio of Gap height Real64 ang; Real64 tiltr; - tiltr = Tilt * DegToRadians; + tiltr = Tilt * DataGlobalConstants::DegToRadians(); Ra = Gr * Pr; if (Ra > 2.0e6) { diff --git a/src/EnergyPlus/GroundHeatExchangers.cc b/src/EnergyPlus/GroundHeatExchangers.cc index 7f84328544d..411acdc7ed4 100644 --- a/src/EnergyPlus/GroundHeatExchangers.cc +++ b/src/EnergyPlus/GroundHeatExchangers.cc @@ -122,7 +122,6 @@ namespace GroundHeatExchangers { using DataGlobals::BeginTimeStepFlag; using DataGlobals::DayOfSim; using DataGlobals::HourOfDay; - using DataGlobals::Pi; using DataGlobals::SecInHour; using DataGlobals::TimeStep; using DataGlobals::TimeStepZone; @@ -774,7 +773,7 @@ namespace GroundHeatExchangers { thisCell.radius_inner = radius_conv + i * thisCell.thickness; thisCell.radius_center = thisCell.radius_inner + thisCell.thickness / 2.0; thisCell.radius_outer = thisCell.radius_inner + thisCell.thickness; - thisCell.conductivity = log(radius_pipe_in / radius_conv) / (2 * Pi * bh_equivalent_resistance_convection); + thisCell.conductivity = log(radius_pipe_in / radius_conv) / (2 * DataGlobalConstants::Pi() * bh_equivalent_resistance_convection); thisCell.rhoCp = 1; Cells.push_back(thisCell); } @@ -787,7 +786,7 @@ namespace GroundHeatExchangers { thisCell.radius_inner = radius_pipe_in + i * thisCell.thickness; thisCell.radius_center = thisCell.radius_inner + thisCell.thickness / 2.0; thisCell.radius_outer = thisCell.radius_inner + thisCell.thickness; - thisCell.conductivity = log(radius_grout / radius_pipe_in) / (2 * Pi * bh_equivalent_resistance_tube_grout); + thisCell.conductivity = log(radius_grout / radius_pipe_in) / (2 * DataGlobalConstants::Pi() * bh_equivalent_resistance_tube_grout); thisCell.rhoCp = pipe.rhoCp; Cells.push_back(thisCell); } @@ -800,7 +799,7 @@ namespace GroundHeatExchangers { thisCell.radius_inner = radius_pipe_out + i * thisCell.thickness; thisCell.radius_center = thisCell.radius_inner + thisCell.thickness / 2.0; thisCell.radius_outer = thisCell.radius_inner + thisCell.thickness; - thisCell.conductivity = log(radius_grout / radius_pipe_in) / (2 * Pi * bh_equivalent_resistance_tube_grout); + thisCell.conductivity = log(radius_grout / radius_pipe_in) / (2 * DataGlobalConstants::Pi() * bh_equivalent_resistance_tube_grout); thisCell.rhoCp = grout.rhoCp; Cells.push_back(thisCell); } @@ -820,7 +819,7 @@ namespace GroundHeatExchangers { // other non-geometric specific setup for (auto &thisCell : Cells) { - thisCell.vol = Pi * (pow_2(thisCell.radius_outer) - pow_2(thisCell.radius_inner)); + thisCell.vol = DataGlobalConstants::Pi() * (pow_2(thisCell.radius_outer) - pow_2(thisCell.radius_inner)); thisCell.temperature = initial_temperature; } @@ -855,8 +854,8 @@ namespace GroundHeatExchangers { auto &thisCell = Cells[cell_index]; auto &eastCell = Cells[cell_index + 1]; - Real64 FE1 = log(thisCell.radius_outer / thisCell.radius_center) / (2 * Pi * thisCell.conductivity); - Real64 FE2 = log(eastCell.radius_center / eastCell.radius_inner) / (2 * Pi * eastCell.conductivity); + Real64 FE1 = log(thisCell.radius_outer / thisCell.radius_center) / (2 * DataGlobalConstants::Pi() * thisCell.conductivity); + Real64 FE2 = log(eastCell.radius_center / eastCell.radius_inner) / (2 * DataGlobalConstants::Pi() * eastCell.conductivity); Real64 AE = 1 / (FE1 + FE2); Real64 AD = thisCell.rhoCp * thisCell.vol / time_step; @@ -883,12 +882,12 @@ namespace GroundHeatExchangers { auto &thisCell = Cells[cell_index]; auto &eastCell = Cells[cell_index + 1]; - Real64 FE1 = log(thisCell.radius_outer / thisCell.radius_center) / (2 * Pi * thisCell.conductivity); - Real64 FE2 = log(eastCell.radius_center / eastCell.radius_inner) / (2 * Pi * eastCell.conductivity); + Real64 FE1 = log(thisCell.radius_outer / thisCell.radius_center) / (2 * DataGlobalConstants::Pi() * thisCell.conductivity); + Real64 FE2 = log(eastCell.radius_center / eastCell.radius_inner) / (2 * DataGlobalConstants::Pi() * eastCell.conductivity); Real64 AE = 1 / (FE1 + FE2); - Real64 FW1 = log(westCell.radius_outer / westCell.radius_center) / (2 * Pi * westCell.conductivity); - Real64 FW2 = log(thisCell.radius_center / thisCell.radius_inner) / (2 * Pi * thisCell.conductivity); + Real64 FW1 = log(westCell.radius_outer / westCell.radius_center) / (2 * DataGlobalConstants::Pi() * westCell.conductivity); + Real64 FW2 = log(thisCell.radius_center / thisCell.radius_inner) / (2 * DataGlobalConstants::Pi() * thisCell.conductivity); Real64 AW = -1 / (FW1 + FW2); Real64 AD = thisCell.rhoCp * thisCell.vol / time_step; @@ -915,8 +914,8 @@ namespace GroundHeatExchangers { if (leftCell.type == CellType::GROUT && rightCell.type == CellType::SOIL) { - Real64 left_conductance = 2 * Pi * leftCell.conductivity / log(leftCell.radius_outer / leftCell.radius_inner); - Real64 right_conductance = 2 * Pi * rightCell.conductivity / log(rightCell.radius_center / leftCell.radius_inner); + Real64 left_conductance = 2 * DataGlobalConstants::Pi() * leftCell.conductivity / log(leftCell.radius_outer / leftCell.radius_inner); + Real64 right_conductance = 2 * DataGlobalConstants::Pi() * rightCell.conductivity / log(rightCell.radius_center / leftCell.radius_inner); T_bhWall = (left_conductance * leftCell.temperature + right_conductance * rightCell.temperature) / (left_conductance + right_conductance); @@ -926,7 +925,7 @@ namespace GroundHeatExchangers { total_time += time_step; - GFNC_shortTimestep.push_back(2 * Pi * soil.k * ((Cells[0].temperature - initial_temperature) / heat_flux - bhResistance)); + GFNC_shortTimestep.push_back(2 * DataGlobalConstants::Pi() * soil.k * ((Cells[0].temperature - initial_temperature) / heat_flux - bhResistance)); LNTTS_shortTimestep.push_back(log(total_time / t_s)); } // end timestep loop @@ -1368,7 +1367,7 @@ namespace GroundHeatExchangers { } // n1 } // m1 - myRespFactors->GFNC(NT) = (gFunc * (coilDiameter / 2.0)) / (4 * Pi * fraction * numTrenches * numCoils); + myRespFactors->GFNC(NT) = (gFunc * (coilDiameter / 2.0)) / (4 * DataGlobalConstants::Pi() * fraction * numTrenches * numCoils); myRespFactors->LNTTS(NT) = tLg; } // NT time @@ -1459,7 +1458,7 @@ namespace GroundHeatExchangers { errFunc1 = std::erfc(0.5 * distance / sqrtAlphaT); errFunc2 = std::erfc(0.5 * sqrtDistDepth / sqrtAlphaT); - return 4 * pow_2(Pi) * (errFunc1 / distance - errFunc2 / sqrtDistDepth); + return 4 * pow_2(DataGlobalConstants::Pi()) * (errFunc1 / distance - errFunc2 / sqrtDistDepth); } //****************************************************************************** @@ -1600,7 +1599,7 @@ namespace GroundHeatExchangers { Real64 sumIntF(0.0); Real64 theta(0.0); Real64 theta1(0.0); - Real64 theta2(2 * Pi); + Real64 theta2(2 * DataGlobalConstants::Pi()); Real64 h; int j; Array1D f(J0, 0.0); @@ -1649,7 +1648,7 @@ namespace GroundHeatExchangers { Real64 sumIntF(0.0); Real64 eta(0.0); Real64 eta1(0.0); - Real64 eta2(2 * Pi); + Real64 eta2(2 * DataGlobalConstants::Pi()); Real64 h; int i; Array1D g(I0, 0.0); @@ -1793,7 +1792,7 @@ namespace GroundHeatExchangers { cpFluid = GetSpecificHeatGlycol(state, PlantLoop(loopNum).FluidName, inletTemp, PlantLoop(loopNum).FluidIndex, RoutineName); fluidDensity = GetDensityGlycol(state, PlantLoop(loopNum).FluidName, inletTemp, PlantLoop(loopNum).FluidIndex, RoutineName); - kGroundFactor = 2.0 * Pi * soil.k; + kGroundFactor = 2.0 * DataGlobalConstants::Pi() * soil.k; // Get time constants getAnnualTimeConstant(); @@ -2762,7 +2761,7 @@ namespace GroundHeatExchangers { thisGLHE.numCoils = thisGLHE.trenchLength / thisGLHE.coilPitch; // Total tube length - thisGLHE.totalTubeLength = Pi * thisGLHE.coilDiameter * thisGLHE.trenchLength * thisGLHE.numTrenches / thisGLHE.coilPitch; + thisGLHE.totalTubeLength = DataGlobalConstants::Pi() * thisGLHE.coilDiameter * thisGLHE.trenchLength * thisGLHE.numTrenches / thisGLHE.coilPitch; // Get g function data thisGLHE.SubAGG = 15; @@ -2855,7 +2854,7 @@ namespace GroundHeatExchangers { // Equation 13 - Real64 const beta = 2 * Pi * grout.k * calcPipeResistance(state); + Real64 const beta = 2 * DataGlobalConstants::Pi() * grout.k * calcPipeResistance(state); Real64 const final_term_1 = log(theta_2 / (2 * theta_1 * pow(1 - pow_4(theta_1), sigma))); Real64 const num_final_term_2 = pow_2(theta_3) * pow_2(1 - (4 * sigma * pow_4(theta_1)) / (1 - pow_4(theta_1))); @@ -2864,7 +2863,7 @@ namespace GroundHeatExchangers { Real64 const den_final_term_2 = den_final_term_2_pt_1 + den_final_term_2_pt_2; Real64 const final_term_2 = num_final_term_2 / den_final_term_2; - return (1 / (4 * Pi * grout.k)) * (beta + final_term_1 - final_term_2); + return (1 / (4 * DataGlobalConstants::Pi() * grout.k)) * (beta + final_term_1 - final_term_2); } //****************************************************************************** @@ -2878,7 +2877,7 @@ namespace GroundHeatExchangers { // Equation 26 - Real64 beta = 2 * Pi * grout.k * calcPipeResistance(state); + Real64 beta = 2 * DataGlobalConstants::Pi() * grout.k * calcPipeResistance(state); Real64 final_term_1 = log(pow(1 + pow_2(theta_1), sigma) / (theta_3 * pow(1 - pow_2(theta_1), sigma))); Real64 num_term_2 = pow_2(theta_3) * pow_2(1 - pow_4(theta_1) + 4 * sigma * pow_2(theta_1)); @@ -2888,7 +2887,7 @@ namespace GroundHeatExchangers { Real64 den_term_2 = den_term_2_pt_1 - den_term_2_pt_2 + den_term_2_pt_3; Real64 final_term_2 = num_term_2 / den_term_2; - return (1 / (Pi * grout.k)) * (beta + final_term_1 - final_term_2); + return (1 / (DataGlobalConstants::Pi() * grout.k)) * (beta + final_term_1 - final_term_2); } //****************************************************************************** @@ -2939,7 +2938,7 @@ namespace GroundHeatExchangers { // Javed, S. & Spitler, J.D. 2016. 'Accuracy of Borehole Thermal Resistance Calculation Methods // for Grouted Single U-tube Ground Heat Exchangers.' Applied Energy. 187:790-806. - return log(pipe.outDia / pipe.innerDia) / (2 * Pi * pipe.k); + return log(pipe.outDia / pipe.innerDia) / (2 * DataGlobalConstants::Pi() * pipe.k); } //****************************************************************************** @@ -2972,7 +2971,7 @@ namespace GroundHeatExchangers { Real64 const bhMassFlowRate = massFlowRate / myRespFactors->numBoreholes; - Real64 const reynoldsNum = 4 * bhMassFlowRate / (fluidViscosity * Pi * pipe.innerDia); + Real64 const reynoldsNum = 4 * bhMassFlowRate / (fluidViscosity * DataGlobalConstants::Pi() * pipe.innerDia); Real64 nusseltNum = 0.0; if (reynoldsNum < lower_limit) { @@ -2992,7 +2991,7 @@ namespace GroundHeatExchangers { Real64 h = nusseltNum * kFluid / pipe.innerDia; - return 1 / (h * Pi * pipe.innerDia); + return 1 / (h * DataGlobalConstants::Pi() * pipe.innerDia); } //****************************************************************************** @@ -3098,7 +3097,7 @@ namespace GroundHeatExchangers { Rconv = 0.0; } else { // Re=Rho*V*D/Mu - reynoldsNum = fluidDensity * pipeInnerDia * (singleSlinkyMassFlowRate / fluidDensity / (Pi * pow_2(pipeInnerRad))) / fluidViscosity; + reynoldsNum = fluidDensity * pipeInnerDia * (singleSlinkyMassFlowRate / fluidDensity / (DataGlobalConstants::Pi() * pow_2(pipeInnerRad))) / fluidViscosity; prandtlNum = (cpFluid * fluidViscosity) / (kFluid); // Convection Resistance if (reynoldsNum <= 2300) { @@ -3111,11 +3110,11 @@ namespace GroundHeatExchangers { nusseltNum = 0.023 * std::pow(reynoldsNum, 0.8) * std::pow(prandtlNum, 0.35); } hci = nusseltNum * kFluid / pipeInnerDia; - Rconv = 1.0 / (2.0 * Pi * pipeInnerDia * hci); + Rconv = 1.0 / (2.0 * DataGlobalConstants::Pi() * pipeInnerDia * hci); } // Conduction Resistance - Rcond = std::log(pipeOuterRad / pipeInnerRad) / (2.0 * Pi * pipe.k) / 2.0; // pipe in parallel so /2 + Rcond = std::log(pipeOuterRad / pipeInnerRad) / (2.0 * DataGlobalConstants::Pi() * pipe.k) / 2.0; // pipe in parallel so /2 return Rcond + Rconv; } diff --git a/src/EnergyPlus/GroundTemperatureModeling/KusudaAchenbachGroundTemperatureModel.cc b/src/EnergyPlus/GroundTemperatureModeling/KusudaAchenbachGroundTemperatureModel.cc index 8888679d353..5b7d52c1885 100644 --- a/src/EnergyPlus/GroundTemperatureModeling/KusudaAchenbachGroundTemperatureModel.cc +++ b/src/EnergyPlus/GroundTemperatureModeling/KusudaAchenbachGroundTemperatureModel.cc @@ -186,7 +186,6 @@ Real64 KusudaGroundTempsModel::getGroundTemp(EnergyPlusData& state) // Kusuda and Achenbach correlation is used // Using/Aliasing - using DataGlobals::Pi; using DataGlobals::SecsInDay; // FUNCTION LOCAL VARIABLE DECLARATIONS: @@ -197,8 +196,8 @@ Real64 KusudaGroundTempsModel::getGroundTemp(EnergyPlusData& state) secsInYear = SecsInDay * state.dataWeatherManager->NumDaysInYear; - term1 = -depth * std::sqrt(Pi / (secsInYear * groundThermalDiffisivity)); - term2 = (2 * Pi / secsInYear) * (simTimeInSeconds - phaseShiftInSecs - (depth / 2) * std::sqrt(secsInYear / (Pi * groundThermalDiffisivity))); + term1 = -depth * std::sqrt(DataGlobalConstants::Pi() / (secsInYear * groundThermalDiffisivity)); + term2 = (2 * DataGlobalConstants::Pi() / secsInYear) * (simTimeInSeconds - phaseShiftInSecs - (depth / 2) * std::sqrt(secsInYear / (DataGlobalConstants::Pi() * groundThermalDiffisivity))); retVal = aveGroundTemp - aveGroundTempAmplitude * std::exp(term1) * std::cos(term2); diff --git a/src/EnergyPlus/GroundTemperatureModeling/XingGroundTemperatureModel.cc b/src/EnergyPlus/GroundTemperatureModeling/XingGroundTemperatureModel.cc index 5d3d0830178..1d4a4f8d726 100644 --- a/src/EnergyPlus/GroundTemperatureModeling/XingGroundTemperatureModel.cc +++ b/src/EnergyPlus/GroundTemperatureModeling/XingGroundTemperatureModel.cc @@ -136,8 +136,6 @@ Real64 XingGroundTempsModel::getGroundTemp(EnergyPlusData &state) // Returns the ground temperature for the Site:GroundTemperature:Undisturbed:Xing // USE STATEMENTS: - using DataGlobals::Pi; - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int n; Real64 static tp(state.dataWeatherManager->NumDaysInYear); // Period of soil temperature cycle @@ -161,12 +159,12 @@ Real64 XingGroundTempsModel::getGroundTemp(EnergyPlusData &state) PL_2 = phaseShift_2; n = 1; - term1 = -depth * std::sqrt((n * Pi) / (groundThermalDiffisivity * tp)); - term2 = (2 * Pi * n) / tp * (simTimeInDays - PL_1) - depth * std::sqrt((n * Pi) / (groundThermalDiffisivity * tp)); + term1 = -depth * std::sqrt((n * DataGlobalConstants::Pi()) / (groundThermalDiffisivity * tp)); + term2 = (2 * DataGlobalConstants::Pi() * n) / tp * (simTimeInDays - PL_1) - depth * std::sqrt((n * DataGlobalConstants::Pi()) / (groundThermalDiffisivity * tp)); n = 2; - term3 = -depth * std::sqrt((n * Pi) / (groundThermalDiffisivity * tp)); - term4 = (2 * Pi * n) / tp * (simTimeInDays - PL_2) - depth * std::sqrt((n * Pi) / (groundThermalDiffisivity * tp)); + term3 = -depth * std::sqrt((n * DataGlobalConstants::Pi()) / (groundThermalDiffisivity * tp)); + term4 = (2 * DataGlobalConstants::Pi() * n) / tp * (simTimeInDays - PL_2) - depth * std::sqrt((n * DataGlobalConstants::Pi()) / (groundThermalDiffisivity * tp)); summation = std::exp(term1) * Ts_1 * std::cos(term2) + std::exp(term3) * Ts_2 * std::cos(term4); diff --git a/src/EnergyPlus/HVACCooledBeam.cc b/src/EnergyPlus/HVACCooledBeam.cc index 80a44118a1a..bea1e9e9023 100644 --- a/src/EnergyPlus/HVACCooledBeam.cc +++ b/src/EnergyPlus/HVACCooledBeam.cc @@ -111,7 +111,6 @@ namespace HVACCooledBeam { using DataEnvironment::StdRhoAir; using DataGlobals::BeginEnvrnFlag; using DataGlobals::NumOfZones; - using DataGlobals::Pi; using DataGlobals::ScheduleAlwaysOn; using DataGlobals::SecInHour; using DataGlobals::SysSizingCalc; @@ -855,7 +854,7 @@ namespace HVACCooledBeam { DesLoadPerBeam = DesCoilLoad / NumBeams; DesAirFlowPerBeam = CoolBeam(CBNum).MaxAirVolFlow / NumBeams; WaterVolFlowPerBeam = CoolBeam(CBNum).MaxCoolWaterVolFlow / NumBeams; - WaterVel = WaterVolFlowPerBeam / (Pi * pow_2(CoolBeam(CBNum).InDiam) / 4.0); + WaterVel = WaterVolFlowPerBeam / (DataGlobalConstants::Pi() * pow_2(CoolBeam(CBNum).InDiam) / 4.0); if (TermUnitFinalZoneSizing(CurTermUnitSizingNum).ZoneTempAtCoolPeak > 0.0) { DT = TermUnitFinalZoneSizing(CurTermUnitSizingNum).ZoneTempAtCoolPeak - 0.5 * (CoolBeam(CBNum).DesInletWaterTemp + CoolBeam(CBNum).DesOutletWaterTemp); @@ -1165,7 +1164,7 @@ namespace HVACCooledBeam { IndFlow = CoolBeam(CBNum).K1 * std::pow(DT, CoolBeam(CBNum).n) + CoolBeam(CBNum).Kin * CoolBeam(CBNum).BeamFlow / CoolBeam(CBNum).BeamLength; CoilFlow = (IndFlow / CoolBeam(CBNum).a0) * StdRhoAir; - WaterVel = CWFlowPerBeam / (rho * Pi * pow_2(CoolBeam(CBNum).InDiam) / 4.0); + WaterVel = CWFlowPerBeam / (rho * DataGlobalConstants::Pi() * pow_2(CoolBeam(CBNum).InDiam) / 4.0); if (WaterVel > MinWaterVel) { K = CoolBeam(CBNum).a * std::pow(DT, CoolBeam(CBNum).n1) * std::pow(CoilFlow, CoolBeam(CBNum).n2) * std::pow(WaterVel, CoolBeam(CBNum).n3); diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index 0b4106cf840..ce06c9cb85b 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -14091,7 +14091,6 @@ namespace HVACVariableRefrigerantFlow { // METHODOLOGY EMPLOYED: // Use a physics based piping loss model. - using DataGlobals::Pi; using DXCoils::DXCoil; using FluidProperties::FindRefrigerant; using FluidProperties::GetSupHeatDensityRefrig; @@ -14167,10 +14166,10 @@ namespace HVACVariableRefrigerantFlow { if (Pipe_viscosity_ref <= 0) Pipe_viscosity_ref = 16.26; // default superheated vapor viscosity data (MuPa*s) at T=353.15 K, P=2MPa Pipe_v_ref = - Pipe_m_ref / (Pi * pow_2(this->RefPipDiaSuc) * 0.25) / + Pipe_m_ref / (DataGlobalConstants::Pi() * pow_2(this->RefPipDiaSuc) * 0.25) / GetSupHeatDensityRefrig( state, this->RefrigerantName, this->EvaporatingTemp + Pipe_SH_merged, max(min(Pevap, RefPHigh), RefPLow), RefrigerantIndex, RoutineName); - Pipe_Num_Re = Pipe_m_ref / (Pi * pow_2(this->RefPipDiaSuc) * 0.25) * this->RefPipDiaSuc / Pipe_viscosity_ref * 1000000; + Pipe_Num_Re = Pipe_m_ref / (DataGlobalConstants::Pi() * pow_2(this->RefPipDiaSuc) * 0.25) * this->RefPipDiaSuc / Pipe_viscosity_ref * 1000000; Pipe_Num_Pr = Pipe_viscosity_ref * Pipe_cp_ref * 0.001 / Pipe_conductivity_ref; Pipe_Num_Nu = 0.023 * std::pow(Pipe_Num_Re, 0.8) * std::pow(Pipe_Num_Pr, 0.3); Pipe_Num_St = Pipe_Num_Nu / Pipe_Num_Re / Pipe_Num_Pr; @@ -14202,7 +14201,7 @@ namespace HVACVariableRefrigerantFlow { } Pipe_Q = max(0.0, - (Pi * this->RefPipLen) * (OutdoorDryBulb / 2 + Pipe_T_room / 2 - this->EvaporatingTemp - Pipe_SH_merged) / + (DataGlobalConstants::Pi() * this->RefPipLen) * (OutdoorDryBulb / 2 + Pipe_T_room / 2 - this->EvaporatingTemp - Pipe_SH_merged) / (1 / Pipe_Coe_k1 + 1 / Pipe_Coe_k2 + 1 / Pipe_Coe_k3)); Pipe_h_comp_in = Pipe_h_IU_out + Pipe_Q / Pipe_m_ref; @@ -14239,7 +14238,6 @@ namespace HVACVariableRefrigerantFlow { // METHODOLOGY EMPLOYED: // Use a physics based piping loss model. - using DataGlobals::Pi; using DXCoils::DXCoil; using FluidProperties::FindRefrigerant; using FluidProperties::GetSatTemperatureRefrig; @@ -14330,9 +14328,9 @@ namespace HVACVariableRefrigerantFlow { if (Pipe_viscosity_ref <= 0) Pipe_viscosity_ref = 16.26; // default superheated vapor viscosity data (MuPa*s) at T=353.15 K, P=2MPa Pipe_v_ref = - Pipe_m_ref / (Pi * pow_2(this->RefPipDiaDis) * 0.25) / + Pipe_m_ref / (DataGlobalConstants::Pi() * pow_2(this->RefPipDiaDis) * 0.25) / GetSupHeatDensityRefrig(state, this->RefrigerantName, Pipe_T_IU_in, max(min(Pcond, RefPHigh), RefPLow), RefrigerantIndex, RoutineName); - Pipe_Num_Re = Pipe_m_ref / (Pi * pow_2(this->RefPipDiaDis) * 0.25) * this->RefPipDiaDis / Pipe_viscosity_ref * 1000000; + Pipe_Num_Re = Pipe_m_ref / (DataGlobalConstants::Pi() * pow_2(this->RefPipDiaDis) * 0.25) * this->RefPipDiaDis / Pipe_viscosity_ref * 1000000; Pipe_Num_Pr = Pipe_viscosity_ref * Pipe_cp_ref * 0.001 / Pipe_conductivity_ref; Pipe_Num_Nu = 0.023 * std::pow(Pipe_Num_Re, 0.8) * std::pow(Pipe_Num_Pr, 0.4); Pipe_Num_St = Pipe_Num_Nu / Pipe_Num_Re / Pipe_Num_Pr; @@ -14342,7 +14340,7 @@ namespace HVACVariableRefrigerantFlow { Pipe_Coe_k3 = RefPipInsH * (this->RefPipDiaDis + 2 * this->RefPipInsThi); Pipe_Q = max(0.0, - (Pi * this->RefPipLen) * (Pipe_T_IU_in - OutdoorDryBulb / 2 - Pipe_T_room / 2) / + (DataGlobalConstants::Pi() * this->RefPipLen) * (Pipe_T_IU_in - OutdoorDryBulb / 2 - Pipe_T_room / 2) / (1 / Pipe_Coe_k1 + 1 / Pipe_Coe_k2 + 1 / Pipe_Coe_k3)); // [W] Pipe_DeltP = max(0.0, 8 * Pipe_Num_St * std::pow(Pipe_Num_Pr, 0.6667) * this->RefPipEquLen / this->RefPipDiaDis * diff --git a/src/EnergyPlus/HeatBalanceHAMTManager.cc b/src/EnergyPlus/HeatBalanceHAMTManager.cc index 779af0cf791..55d092bcecd 100644 --- a/src/EnergyPlus/HeatBalanceHAMTManager.cc +++ b/src/EnergyPlus/HeatBalanceHAMTManager.cc @@ -831,10 +831,10 @@ namespace HeatBalanceHAMTManager { dataMaterial.Material(matid).divs = dataMaterial.Material(matid).divmax; } // Check length of cell - reduce number of divisions if necessary - Real64 const sin_negPIOvr2 = std::sin(-Pi / 2.0); + Real64 const sin_negPIOvr2 = std::sin(-DataGlobalConstants::Pi() / 2.0); while (true) { testlen = - dataMaterial.Material(matid).Thickness * ((std::sin(Pi * (-1.0 / double(dataMaterial.Material(matid).divs)) - Pi / 2.0) / 2.0) - (sin_negPIOvr2 / 2.0)); + dataMaterial.Material(matid).Thickness * ((std::sin(DataGlobalConstants::Pi() * (-1.0 / double(dataMaterial.Material(matid).divs)) - DataGlobalConstants::Pi() / 2.0) / 2.0) - (sin_negPIOvr2 / 2.0)); if (testlen > adjdist) break; --dataMaterial.Material(matid).divs; if (dataMaterial.Material(matid).divs < 1) { @@ -936,8 +936,8 @@ namespace HeatBalanceHAMTManager { // Make cells smaller near the surface cells(cid).length(1) = - dataMaterial.Material(matid).Thickness * ((std::sin(Pi * (-double(did) / double(dataMaterial.Material(matid).divs)) - Pi / 2.0) / 2.0) - - (std::sin(Pi * (-double(did - 1) / double(dataMaterial.Material(matid).divs)) - Pi / 2.0) / 2.0)); + dataMaterial.Material(matid).Thickness * ((std::sin(DataGlobalConstants::Pi() * (-double(did) / double(dataMaterial.Material(matid).divs)) - DataGlobalConstants::Pi() / 2.0) / 2.0) - + (std::sin(DataGlobalConstants::Pi() * (-double(did - 1) / double(dataMaterial.Material(matid).divs)) - DataGlobalConstants::Pi() / 2.0) / 2.0)); cells(cid).origin(1) = runor + cells(cid).length(1) / 2.0; runor += cells(cid).length(1); diff --git a/src/EnergyPlus/HeatBalanceKivaManager.cc b/src/EnergyPlus/HeatBalanceKivaManager.cc index 2fcb3b8f573..c56d55f7692 100644 --- a/src/EnergyPlus/HeatBalanceKivaManager.cc +++ b/src/EnergyPlus/HeatBalanceKivaManager.cc @@ -363,9 +363,9 @@ namespace HeatBalanceKivaManager { bcs->outdoorTemp = DataEnvironment::OutDryBulbTemp + DataGlobals::KelvinConv; bcs->localWindSpeed = DataEnvironment::WindSpeedAt(instance.ground->foundation.grade.roughness); - bcs->windDirection = DataEnvironment::WindDir * DataGlobals::DegToRadians; + bcs->windDirection = DataEnvironment::WindDir * DataGlobalConstants::DegToRadians(); bcs->solarAzimuth = std::atan2(DataEnvironment::SOLCOS(1), DataEnvironment::SOLCOS(2)); - bcs->solarAltitude = DataGlobals::PiOvr2 - std::acos(DataEnvironment::SOLCOS(3)); + bcs->solarAltitude = DataGlobalConstants::PiOvr2() - std::acos(DataEnvironment::SOLCOS(3)); bcs->directNormalFlux = DataEnvironment::BeamSolarRad; bcs->diffuseHorizontalFlux = DataEnvironment::DifSolarRad; bcs->skyEmissivity = pow4(DataEnvironment::SkyTempKelvin) / pow4(bcs->outdoorTemp); diff --git a/src/EnergyPlus/HeatBalanceManager.cc b/src/EnergyPlus/HeatBalanceManager.cc index 17f0988d381..1b5700d1913 100644 --- a/src/EnergyPlus/HeatBalanceManager.cc +++ b/src/EnergyPlus/HeatBalanceManager.cc @@ -3446,7 +3446,7 @@ namespace HeatBalanceManager { // Minimum and maximum slat angles allowed by slat geometry if (Blind(Loop).SlatWidth > Blind(Loop).SlatSeparation) { - MinSlatAngGeom = std::asin(Blind(Loop).SlatThickness / (Blind(Loop).SlatThickness + Blind(Loop).SlatSeparation)) / DegToRadians; + MinSlatAngGeom = std::asin(Blind(Loop).SlatThickness / (Blind(Loop).SlatThickness + Blind(Loop).SlatSeparation)) / DataGlobalConstants::DegToRadians(); } else { MinSlatAngGeom = 0.0; } @@ -6754,13 +6754,13 @@ namespace HeatBalanceManager { // Pre-calculate constants for (IPhi = 1; IPhi <= 10; ++IPhi) { - CosPhiIndepVar(IPhi) = std::cos((IPhi - 1) * 10.0 * DegToRadians); + CosPhiIndepVar(IPhi) = std::cos((IPhi - 1) * 10.0 * DataGlobalConstants::DegToRadians()); } // Pre-calculate constants for (IPhi = 1; IPhi <= 10; ++IPhi) { Phi = double(IPhi - 1) * 10.0; - CosPhi(IPhi) = std::cos(Phi * DegToRadians); + CosPhi(IPhi) = std::cos(Phi * DataGlobalConstants::DegToRadians()); if (std::abs(CosPhi(IPhi)) < 0.0001) CosPhi(IPhi) = 0.0; } diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index 0c65a859fe8..7750f2b8a47 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -5819,7 +5819,7 @@ namespace HeatBalanceSurfaceManager { // Allow for modification of TemperatureCoefficient with unitary sine wave. Real64 ConstantTempCoef; // Temperature Coefficient as input or modified using sine wave COP mod if (OSC(OPtr).SinusoidalConstTempCoef) { // Sine wave C4 - ConstantTempCoef = std::sin(2 * Pi * CurrentTime / OSC(OPtr).SinusoidPeriod); + ConstantTempCoef = std::sin(2 * DataGlobalConstants::Pi() * CurrentTime / OSC(OPtr).SinusoidPeriod); } else { ConstantTempCoef = OSC(OPtr).ConstTempCoef; } diff --git a/src/EnergyPlus/LowTempRadiantSystem.cc b/src/EnergyPlus/LowTempRadiantSystem.cc index da2fcfedf67..24bad79b6db 100644 --- a/src/EnergyPlus/LowTempRadiantSystem.cc +++ b/src/EnergyPlus/LowTempRadiantSystem.cc @@ -5346,7 +5346,6 @@ namespace LowTempRadiantSystem { // Code based loosely on code from IBLAST program (research version) // Using/Aliasing - using DataGlobals::Pi; using DataPlant::PlantLoop; using FluidProperties::GetSpecificHeatGlycol; @@ -5437,12 +5436,12 @@ namespace LowTempRadiantSystem { // Calculate the NTU parameter // NTU = UA/[(Mdot*Cp)min] // where: U = h (convection coefficient) and h = (k)(Nu)/D - // A = Pi*D*TubeLength - NTU = U * Pi * this->TubeDiameterOuter * this->TubeLength / (WaterMassFlow * CpWater); // FlowFraction cancels out here + // A = DataGlobalConstants::Pi()*D*TubeLength + NTU = U * DataGlobalConstants::Pi() * this->TubeDiameterOuter * this->TubeLength / (WaterMassFlow * CpWater); // FlowFraction cancels out here } else { // (this->FluidToSlabHeatTransfer == FluidToSlabHeatTransferTypes::ConvectionOnly) // Calculate the Reynold's number from RE=(4*Mdot)/(Pi*Mu*Diameter) - ReD = 4.0 * WaterMassFlow * FlowFraction / (Pi * MUactual * this->TubeDiameterInner * NumCircs); + ReD = 4.0 * WaterMassFlow * FlowFraction / (DataGlobalConstants::Pi() * MUactual * this->TubeDiameterInner * NumCircs); // Calculate the Nusselt number based on what flow regime one is in if (ReD >= MaxLaminarRe) { // Turbulent flow --> use Colburn equation @@ -5458,7 +5457,7 @@ namespace LowTempRadiantSystem { // NTU = UA/[(Mdot*Cp)min] // where: U = h (convection coefficient) and h = (k)(Nu)/D // A = Pi*D*TubeLength - NTU = Pi * Kactual * NuD * this->TubeLength / (WaterMassFlow * CpWater); // FlowFraction cancels out here + NTU = DataGlobalConstants::Pi() * Kactual * NuD * this->TubeLength / (WaterMassFlow * CpWater); // FlowFraction cancels out here } // Calculate Epsilon*MassFlowRate*Cp @@ -5491,10 +5490,10 @@ namespace LowTempRadiantSystem { // Fluid resistance to heat transfer, assumes turbulent flow (Equation B5, p. 38 of ISO Standard 11855-2) Real64 distanceBetweenPipes = 2.0 * state.dataConstruction->Construct(constructionNumber).ThicknessPerpend; Real64 ratioDiameterToMassFlowLength = this->TubeDiameterInner / WaterMassFlow / this->TubeLength; - Real64 rFluid = 0.125 / DataGlobals::Pi * std::pow(distanceBetweenPipes, 0.13) * std::pow(ratioDiameterToMassFlowLength,0.87); + Real64 rFluid = 0.125 / DataGlobalConstants::Pi() * std::pow(distanceBetweenPipes, 0.13) * std::pow(ratioDiameterToMassFlowLength,0.87); // Resistance to heat transfer (conduction through the piping material, Equation B6, p. 38 of ISO Standard 11855-2) - Real64 rTube = 0.5 * distanceBetweenPipes * std::log(this->TubeDiameterOuter/this->TubeDiameterInner) / DataGlobals::Pi / this->TubeConductivity; + Real64 rTube = 0.5 * distanceBetweenPipes * std::log(this->TubeDiameterOuter/this->TubeDiameterInner) / DataGlobalConstants::Pi() / this->TubeConductivity; calculateUFromISOStandard = 1.0 / (rFluid + rTube); diff --git a/src/EnergyPlus/MoistureBalanceEMPDManager.cc b/src/EnergyPlus/MoistureBalanceEMPDManager.cc index e12d84ef455..dc2ba8b084b 100644 --- a/src/EnergyPlus/MoistureBalanceEMPDManager.cc +++ b/src/EnergyPlus/MoistureBalanceEMPDManager.cc @@ -163,7 +163,7 @@ namespace MoistureBalanceEMPDManager { Real64 const EMPDdiffusivity = diffusivity_air / mat.EMPDmu; // Calculate penetration depth - Real64 const PenetrationDepth = std::sqrt(EMPDdiffusivity * PV_sat * period / (mat.Density * slope_MC * DataGlobals::Pi)); + Real64 const PenetrationDepth = std::sqrt(EMPDdiffusivity * PV_sat * period / (mat.Density * slope_MC * DataGlobalConstants::Pi())); return PenetrationDepth; } diff --git a/src/EnergyPlus/PVWatts.cc b/src/EnergyPlus/PVWatts.cc index 8ad7bab5248..55c395af23e 100644 --- a/src/EnergyPlus/PVWatts.cc +++ b/src/EnergyPlus/PVWatts.cc @@ -465,8 +465,6 @@ namespace PVWatts { PVWattsGenerator::powerout(Real64 &shad_beam, Real64 shad_diff, Real64 dni, Real64 alb, Real64 wspd, Real64 tdry, IrradianceOutput &irr_st) { - using DataGlobals::DegToRadians; - using DataGlobals::RadToDeg; using General::RoundSigDigits; const Real64 &gcr = m_groundCoverageRatio; @@ -485,8 +483,8 @@ namespace PVWatts { Real64 Fgnddiff = 1.0; // worst-case mask angle using calculated surface tilt - Real64 phi0 = RadToDeg * std::atan2(std::sin(irr_st.stilt * DegToRadians), - 1.0 / m_groundCoverageRatio - std::cos(irr_st.stilt * DegToRadians)); + Real64 phi0 = DataGlobalConstants::RadToDeg() * std::atan2(std::sin(irr_st.stilt * DataGlobalConstants::DegToRadians()), + 1.0 / m_groundCoverageRatio - std::cos(irr_st.stilt * DataGlobalConstants::DegToRadians())); // calculate sky and gnd diffuse derate factors // based on view factor reductions from self-shading diff --git a/src/EnergyPlus/PVWattsSSC.cc b/src/EnergyPlus/PVWattsSSC.cc index 987ad6ad89c..91d36fb8740 100644 --- a/src/EnergyPlus/PVWattsSSC.cc +++ b/src/EnergyPlus/PVWattsSSC.cc @@ -408,10 +408,10 @@ namespace PVWatts { double *tst, double *hextra) { - if (solazi != 0) *solazi = sun[0] * (180 / DataGlobals::Pi); - if (solzen != 0) *solzen = sun[1] * (180 / DataGlobals::Pi); - if (solelv != 0) *solelv = sun[2] * (180 / DataGlobals::Pi); - if (soldec != 0) *soldec = sun[3] * (180 / DataGlobals::Pi); + if (solazi != 0) *solazi = sun[0] * (180 / DataGlobalConstants::Pi()); + if (solzen != 0) *solzen = sun[1] * (180 / DataGlobalConstants::Pi()); + if (solelv != 0) *solelv = sun[2] * (180 / DataGlobalConstants::Pi()); + if (soldec != 0) *soldec = sun[3] * (180 / DataGlobalConstants::Pi()); if (sunrise != 0) *sunrise = sun[4]; if (sunset != 0) *sunset = sun[5]; if (sunup != 0) *sunup = tms[2]; @@ -422,11 +422,11 @@ namespace PVWatts { void irrad::get_angles(double *aoi, double *surftilt, double *surfazi, double *axisrot, double *btdiff) { - if (aoi != 0) *aoi = angle[0] * (180 / DataGlobals::Pi); - if (surftilt != 0) *surftilt = angle[1] * (180 / DataGlobals::Pi); - if (surfazi != 0) *surfazi = angle[2] * (180 / DataGlobals::Pi); - if (axisrot != 0) *axisrot = angle[3] * (180 / DataGlobals::Pi); - if (btdiff != 0) *btdiff = angle[4] * (180 / DataGlobals::Pi); + if (aoi != 0) *aoi = angle[0] * (180 / DataGlobalConstants::Pi()); + if (surftilt != 0) *surftilt = angle[1] * (180 / DataGlobalConstants::Pi()); + if (surfazi != 0) *surfazi = angle[2] * (180 / DataGlobalConstants::Pi()); + if (axisrot != 0) *axisrot = angle[3] * (180 / DataGlobalConstants::Pi()); + if (btdiff != 0) *btdiff = angle[4] * (180 / DataGlobalConstants::Pi()); } void irrad::get_poa(double *beam, double *skydiff, double *gnddiff, double *isotrop, double *circum, double *horizon) @@ -903,9 +903,9 @@ namespace PVWatts { den = cos(eclong); ra = atan(num / den); /* Right ascension in radians */ if (den < 0.0) - ra = ra + DataGlobals::Pi; + ra = ra + DataGlobalConstants::Pi(); else if (num < 0.0) - ra = ra + 2.0 * DataGlobals::Pi; + ra = ra + 2.0 * DataGlobalConstants::Pi(); dec = asin(sin(oblqec) * sin(eclong)); /* Declination in radians */ @@ -919,36 +919,36 @@ namespace PVWatts { lmst = lmst * 15.0 * DTOR; /* Local mean sidereal time in radians */ ha = lmst - ra; - if (ha < -DataGlobals::Pi) - ha = ha + 2 * DataGlobals::Pi; - else if (ha > DataGlobals::Pi) - ha = ha - 2 * DataGlobals::Pi; /* Hour angle in radians between -pi and pi */ + if (ha < -DataGlobalConstants::Pi()) + ha = ha + 2 * DataGlobalConstants::Pi(); + else if (ha > DataGlobalConstants::Pi()) + ha = ha - 2 * DataGlobalConstants::Pi(); /* Hour angle in radians between -pi and pi */ lat = lat * DTOR; /* Change latitude to radians */ arg = sin(dec) * sin(lat) + cos(dec) * cos(lat) * cos(ha); /* For elevation in radians */ if (arg > 1.0) - elv = DataGlobals::Pi / 2.0; + elv = DataGlobalConstants::Pi() / 2.0; else if (arg < -1.0) - elv = -DataGlobals::Pi / 2.0; + elv = -DataGlobalConstants::Pi() / 2.0; else elv = asin(arg); if (cos(elv) == 0.0) { - azm = DataGlobals::Pi; /* Assign azimuth = 180 deg if elv = 90 or -90 */ + azm = DataGlobalConstants::Pi(); /* Assign azimuth = 180 deg if elv = 90 or -90 */ } else { /* For solar azimuth in radians per Iqbal */ arg = ((sin(elv) * sin(lat) - sin(dec)) / (cos(elv) * cos(lat))); /* for azimuth */ if (arg > 1.0) azm = 0.0; /* Azimuth(radians)*/ else if (arg < -1.0) - azm = DataGlobals::Pi; + azm = DataGlobalConstants::Pi(); else azm = acos(arg); - if ((ha <= 0.0 && ha >= -DataGlobals::Pi) || ha >= DataGlobals::Pi) - azm = DataGlobals::Pi - azm; + if ((ha <= 0.0 && ha >= -DataGlobalConstants::Pi()) || ha >= DataGlobalConstants::Pi()) + azm = DataGlobalConstants::Pi() - azm; else - azm = DataGlobals::Pi + azm; + azm = DataGlobalConstants::Pi() + azm; } elv = elv / DTOR; /* Change to degrees for atmospheric correction */ @@ -971,7 +971,7 @@ namespace PVWatts { if (arg >= 1.0) ws = 0.0; /* No sunrise, continuous nights */ else if (arg <= -1.0) - ws = DataGlobals::Pi; /* No sunset, continuous days */ + ws = DataGlobalConstants::Pi(); /* No sunset, continuous days */ else ws = acos(arg); /* Sunrise hour angle in radians */ @@ -985,10 +985,10 @@ namespace PVWatts { tst = hour + minute / 60.0 + (lng / 15.0 - tz) + E; /* True solar time (hr) */ /* 25aug2011 apd: addition of calculation of horizontal extraterrestrial irradiance */ - zen = 0.5 * DataGlobals::Pi - elv; + zen = 0.5 * DataGlobalConstants::Pi() - elv; Gon = 1367 * - (1 + 0.033 * cos(360.0 / 365.0 * day_of_year(month, day) * DataGlobals::Pi / 180)); /* D&B eq 1.4.1a, using solar constant=1367 W/m2 */ - if (zen > 0 && zen < DataGlobals::Pi / 2) /* if sun is up */ + (1 + 0.033 * cos(360.0 / 365.0 * day_of_year(month, day) * DataGlobalConstants::Pi() / 180)); /* D&B eq 1.4.1a, using solar constant=1367 W/m2 */ + if (zen > 0 && zen < DataGlobalConstants::Pi() / 2) /* if sun is up */ hextra = Gon * cos(zen); /* elevation is incidence angle (zen=90-elv) with horizontal */ else if (zen == 0) hextra = Gon; @@ -1047,7 +1047,7 @@ namespace PVWatts { arg = sin(zen) * cos(azm - sazm) * sin(tilt) + cos(zen) * cos(tilt); rot = 0; if (arg < -1.0) - inc = DataGlobals::Pi; + inc = DataGlobalConstants::Pi(); else if (arg > 1.0) inc = 0.0; else @@ -1060,40 +1060,40 @@ namespace PVWatts { /* Find rotation angle of axis for peak tracking */ if (fabs(cos(xtilt)) < 0.001745) /* 89.9 to 90.1 degrees */ { /* For vertical axis only */ - if (xsazm <= DataGlobals::Pi) { - if (azm <= xsazm + DataGlobals::Pi) + if (xsazm <= DataGlobalConstants::Pi()) { + if (azm <= xsazm + DataGlobalConstants::Pi()) rot = azm - xsazm; else - rot = azm - xsazm - 2.0 * DataGlobals::Pi; + rot = azm - xsazm - 2.0 * DataGlobalConstants::Pi(); } else /* For xsazm > pi */ { - if (azm >= xsazm - DataGlobals::Pi) + if (azm >= xsazm - DataGlobalConstants::Pi()) rot = azm - xsazm; else - rot = azm - xsazm + 2.0 * DataGlobals::Pi; + rot = azm - xsazm + 2.0 * DataGlobalConstants::Pi(); } } else /* For other than vertical axis */ { arg = sin(zen) * sin(azm - xsazm) / (sin(zen) * cos(azm - xsazm) * sin(xtilt) + cos(zen) * cos(xtilt)); if (arg < -99999.9) - rot = -DataGlobals::Pi / 2.0; + rot = -DataGlobalConstants::Pi() / 2.0; else if (arg > 99999.9) - rot = DataGlobals::Pi / 2.0; + rot = DataGlobalConstants::Pi() / 2.0; else rot = atan(arg); /* Put rot in II or III quadrant if needed */ - if (xsazm <= DataGlobals::Pi) { - if (azm > xsazm && azm <= xsazm + DataGlobals::Pi) { /* Ensure positive rotation */ - if (rot < 0.0) rot = DataGlobals::Pi + rot; /* Put in II quadrant: 90 to 180 deg */ + if (xsazm <= DataGlobalConstants::Pi()) { + if (azm > xsazm && azm <= xsazm + DataGlobalConstants::Pi()) { /* Ensure positive rotation */ + if (rot < 0.0) rot = DataGlobalConstants::Pi() + rot; /* Put in II quadrant: 90 to 180 deg */ } else { /* Ensure negative rotation */ - if (rot > 0.0) rot = rot - DataGlobals::Pi; /* Put in III quadrant: -90 to -180 deg */ + if (rot > 0.0) rot = rot - DataGlobalConstants::Pi(); /* Put in III quadrant: -90 to -180 deg */ } } else /* For xsazm > pi */ { - if (azm < xsazm && azm >= xsazm - DataGlobals::Pi) { /* Ensure negative rotation */ - if (rot > 0.0) rot = rot - DataGlobals::Pi; /* Put in III quadrant: -90 to -180 deg */ + if (azm < xsazm && azm >= xsazm - DataGlobalConstants::Pi()) { /* Ensure negative rotation */ + if (rot > 0.0) rot = rot - DataGlobalConstants::Pi(); /* Put in III quadrant: -90 to -180 deg */ } else { /* Ensure positive rotation */ - if (rot < 0.0) rot = DataGlobals::Pi + rot; /* Put in II quadrant: 90 to 180 deg */ + if (rot < 0.0) rot = DataGlobalConstants::Pi() + rot; /* Put in II quadrant: 90 to 180 deg */ } } } @@ -1108,52 +1108,52 @@ namespace PVWatts { // coded originally by intern M.Kasberg summer 2011 if (en_backtrack) { // find backtracking rotation angle - double backrot = backtrack(azm * 180 / DataGlobals::Pi, - zen * 180 / DataGlobals::Pi, // solar azimuth, zenith (deg) + double backrot = backtrack(azm * 180 / DataGlobalConstants::Pi(), + zen * 180 / DataGlobalConstants::Pi(), // solar azimuth, zenith (deg) tilt, sazm, // axis tilt, axis azimuth (deg) - rlim * 180 / DataGlobals::Pi, + rlim * 180 / DataGlobalConstants::Pi(), gcr, // rotation limit, GCR - rot * 180 / DataGlobals::Pi); // ideal rotation angle + rot * 180 / DataGlobalConstants::Pi()); // ideal rotation angle - btdiff = backrot - rot * 180 / DataGlobals::Pi; // log the difference (degrees) - btdiff *= DataGlobals::Pi / 180; // convert output to radians - rot = backrot * DataGlobals::Pi / 180; // convert backtracked rotation angle to radians + btdiff = backrot - rot * 180 / DataGlobalConstants::Pi(); // log the difference (degrees) + btdiff *= DataGlobalConstants::Pi() / 180; // convert output to radians + rot = backrot * DataGlobalConstants::Pi() / 180; // convert backtracked rotation angle to radians } /* Find tilt angle for the tracking surface */ arg = cos(xtilt) * cos(rot); if (arg < -1.0) - tilt = DataGlobals::Pi; + tilt = DataGlobalConstants::Pi(); else if (arg > 1.0) tilt = 0.0; else tilt = acos(arg); /* Find surface azimuth for the tracking surface */ if (tilt == 0.0) - sazm = DataGlobals::Pi; /* Assign any value if tilt is zero */ + sazm = DataGlobalConstants::Pi(); /* Assign any value if tilt is zero */ else { arg = sin(rot) / sin(tilt); if (arg < -1.0) - sazm = 1.5 * DataGlobals::Pi + xsazm; + sazm = 1.5 * DataGlobalConstants::Pi() + xsazm; else if (arg > 1.0) - sazm = 0.5 * DataGlobals::Pi + xsazm; - else if (rot < -0.5 * DataGlobals::Pi) - sazm = xsazm - DataGlobals::Pi - asin(arg); - else if (rot > 0.5 * DataGlobals::Pi) - sazm = xsazm + DataGlobals::Pi - asin(arg); + sazm = 0.5 * DataGlobalConstants::Pi() + xsazm; + else if (rot < -0.5 * DataGlobalConstants::Pi()) + sazm = xsazm - DataGlobalConstants::Pi() - asin(arg); + else if (rot > 0.5 * DataGlobalConstants::Pi()) + sazm = xsazm + DataGlobalConstants::Pi() - asin(arg); else sazm = asin(arg) + xsazm; - if (sazm > 2.0 * DataGlobals::Pi) /* Keep between 0 and 2pi */ - sazm = sazm - 2.0 * DataGlobals::Pi; + if (sazm > 2.0 * DataGlobalConstants::Pi()) /* Keep between 0 and 2pi */ + sazm = sazm - 2.0 * DataGlobalConstants::Pi(); else if (sazm < 0.0) - sazm = sazm + 2.0 * DataGlobals::Pi; + sazm = sazm + 2.0 * DataGlobalConstants::Pi(); } /* printf("zen=%6.1f azm-sazm=%6.1f tilt=%6.1f arg=%7.4f\n",zen/DTOR,(azm-sazm)/DTOR,tilt/DTOR,arg); */ /* Find incident angle */ arg = sin(zen) * cos(azm - sazm) * sin(tilt) + cos(zen) * cos(tilt); if (arg < -1.0) - inc = DataGlobals::Pi; + inc = DataGlobalConstants::Pi(); else if (arg > 1.0) inc = 0.0; else @@ -1444,7 +1444,7 @@ namespace PVWatts { diffc[1] = circumsolar diffc[2] = horizon brightening */ - double r90(DataGlobals::Pi / 2), r80(80.0 / 180 * DataGlobals::Pi), r65(65.0 / 180 * DataGlobals::Pi); + double r90(DataGlobalConstants::Pi() / 2), r80(80.0 / 180 * DataGlobalConstants::Pi()), r65(65.0 / 180 * DataGlobalConstants::Pi()); /* if ( (angle[0] != pA->inc[pA->i]) || (wfPOA != pA->POA[ pA->i ])) { std::cout << "Error wih POA decomp" << std::endl; @@ -1496,7 +1496,7 @@ namespace PVWatts { avgKtp /= count; // Calculate Kt - double am = Min(15.25, 1.0 / (cos(sun[1]) + 0.15 * (pow(93.9 - sun[1] * 180 / DataGlobals::Pi, -1.253)))); // air mass + double am = Min(15.25, 1.0 / (cos(sun[1]) + 0.15 * (pow(93.9 - sun[1] * 180 / DataGlobalConstants::Pi(), -1.253)))); // air mass double ktpam = am * exp(-0.0001184 * pA->elev); double Kt = avgKtp * (1.031 * exp(-1.4 / (0.9 + 9.4 / ktpam)) + 0.1); @@ -2186,13 +2186,13 @@ namespace PVWatts { { // reference: duffie & beckman, Ch 5.3 - double theta1 = theta1_deg * DataGlobals::Pi / 180.0; + double theta1 = theta1_deg * DataGlobalConstants::Pi() / 180.0; double theta2 = asin(n_incoming / n_cover * sin(theta1)); // snell's law, assuming n_air = 1.0 // fresnel's equation for non-reflected unpolarized radiation as an average of perpendicular and parallel components double tr = 1 - 0.5 * (pow(sin(theta2 - theta1), 2) / pow(sin(theta2 + theta1), 2) + pow(tan(theta2 - theta1), 2) / pow(tan(theta2 + theta1), 2)); - if (_theta2_deg) *_theta2_deg = theta2 * 180 / DataGlobals::Pi; + if (_theta2_deg) *_theta2_deg = theta2 * 180 / DataGlobalConstants::Pi(); return tr * exp(-k * l_thick / cos(theta2)); } diff --git a/src/EnergyPlus/PVWattsSSC.hh b/src/EnergyPlus/PVWattsSSC.hh index 2f92f6f4088..4b645c17aaa 100644 --- a/src/EnergyPlus/PVWattsSSC.hh +++ b/src/EnergyPlus/PVWattsSSC.hh @@ -60,7 +60,7 @@ namespace PVWatts { const Real64 AOI_MIN(0.5); const Real64 AOI_MAX(89.5); - const Real64 DTOR(DataGlobals::DegToRadians); + const Real64 DTOR(DataGlobalConstants::DegToRadians()); enum RADMODE { DN_DF, diff --git a/src/EnergyPlus/Photovoltaics.cc b/src/EnergyPlus/Photovoltaics.cc index 5f299b51975..91682fc1525 100644 --- a/src/EnergyPlus/Photovoltaics.cc +++ b/src/EnergyPlus/Photovoltaics.cc @@ -970,7 +970,6 @@ namespace Photovoltaics { // Using/Aliasing using DataEnvironment::Elevation; using DataEnvironment::SOLCOS; - using DataGlobals::DegToRadians; using DataHeatBalance::CosIncidenceAngle; using DataHeatBalance::QRadSWOutIncident; using DataHeatBalance::QRadSWOutIncidentBeam; @@ -1000,8 +999,8 @@ namespace Photovoltaics { // get input from elsewhere in Energyplus for the current point in the simulation PVarray(PVnum).SNLPVinto.IcBeam = QRadSWOutIncidentBeam(ThisSurf); //(W/m2)from DataHeatBalance PVarray(PVnum).SNLPVinto.IcDiffuse = QRadSWOutIncident(ThisSurf) - QRadSWOutIncidentBeam(ThisSurf); //(W/ m2)(was kJ/hr m2) - PVarray(PVnum).SNLPVinto.IncidenceAngle = std::acos(CosIncidenceAngle(ThisSurf)) / DegToRadians; // (deg) from dataHeatBalance - PVarray(PVnum).SNLPVinto.ZenithAngle = std::acos(SOLCOS(3)) / DegToRadians; //(degrees), + PVarray(PVnum).SNLPVinto.IncidenceAngle = std::acos(CosIncidenceAngle(ThisSurf)) / DataGlobalConstants::DegToRadians(); // (deg) from dataHeatBalance + PVarray(PVnum).SNLPVinto.ZenithAngle = std::acos(SOLCOS(3)) / DataGlobalConstants::DegToRadians(); //(degrees), PVarray(PVnum).SNLPVinto.Tamb = Surface(ThisSurf).OutDryBulbTemp; //(deg. C) PVarray(PVnum).SNLPVinto.WindSpeed = Surface(ThisSurf).WindSpeed; // (m/s) PVarray(PVnum).SNLPVinto.Altitude = Elevation; // from DataEnvironment via USE @@ -2164,8 +2163,6 @@ namespace Photovoltaics { // na // Using/Aliasing - using DataGlobals::DegToRadians; - // Return value Real64 AbsoluteAirMass; @@ -2185,7 +2182,7 @@ namespace Photovoltaics { // na if (SolZen < 89.9) { - Real64 const AM(1.0 / (std::cos(SolZen * DegToRadians) + 0.5057 * std::pow(96.08 - SolZen, -1.634))); + Real64 const AM(1.0 / (std::cos(SolZen * DataGlobalConstants::DegToRadians()) + 0.5057 * std::pow(96.08 - SolZen, -1.634))); AbsoluteAirMass = std::exp(-0.0001184 * Altitude) * AM; } else { Real64 const AM(36.32); // evaluated above at SolZen = 89.9 issue #5528 diff --git a/src/EnergyPlus/PipeHeatTransfer.cc b/src/EnergyPlus/PipeHeatTransfer.cc index cc879e805a8..b89c438080a 100644 --- a/src/EnergyPlus/PipeHeatTransfer.cc +++ b/src/EnergyPlus/PipeHeatTransfer.cc @@ -256,7 +256,6 @@ namespace PipeHeatTransfer { // needed to define and simulate the surface. // Using/Aliasing - using DataGlobals::Pi; using DataGlobals::SecInHour; using DataHeatBalance::IntGainTypeOf_PipeIndoor; using DataHeatBalance::Zone; @@ -681,15 +680,15 @@ namespace PipeHeatTransfer { PipeHT(Item).PreviousPipeTemp = 0.0; // work out heat transfer areas (area per section) - PipeHT(Item).InsideArea = Pi * PipeHT(Item).PipeID * PipeHT(Item).Length / NumSections; - PipeHT(Item).OutsideArea = Pi * (PipeHT(Item).PipeOD + 2 * PipeHT(Item).InsulationThickness) * PipeHT(Item).Length / NumSections; + PipeHT(Item).InsideArea = DataGlobalConstants::Pi() * PipeHT(Item).PipeID * PipeHT(Item).Length / NumSections; + PipeHT(Item).OutsideArea = DataGlobalConstants::Pi() * (PipeHT(Item).PipeOD + 2 * PipeHT(Item).InsulationThickness) * PipeHT(Item).Length / NumSections; // cross sectional area - PipeHT(Item).SectionArea = Pi * 0.25 * pow_2(PipeHT(Item).PipeID); + PipeHT(Item).SectionArea = DataGlobalConstants::Pi() * 0.25 * pow_2(PipeHT(Item).PipeID); // pipe & insulation mass PipeHT(Item).PipeHeatCapacity = PipeHT(Item).PipeCp * PipeHT(Item).PipeDensity * - (Pi * 0.25 * pow_2(PipeHT(Item).PipeOD) - PipeHT(Item).SectionArea); // the metal component + (DataGlobalConstants::Pi() * 0.25 * pow_2(PipeHT(Item).PipeOD) - PipeHT(Item).SectionArea); // the metal component } // final error check @@ -852,7 +851,6 @@ namespace PipeHeatTransfer { using DataGlobals::BeginSimFlag; using DataGlobals::DayOfSim; using DataGlobals::HourOfDay; - using DataGlobals::Pi; using DataGlobals::SecInHour; using DataGlobals::TimeStep; using DataGlobals::TimeStepZone; @@ -1283,7 +1281,6 @@ namespace PipeHeatTransfer { using DataEnvironment::WindSpeed; using DataGlobals::HourOfDay; using DataGlobals::KelvinConv; - using DataGlobals::Pi; using DataGlobals::rTinyValue; using DataGlobals::TimeStep; using DataLoopNode::Node; @@ -1655,7 +1652,6 @@ namespace PipeHeatTransfer { // Code based loosely on code from IBLAST program (research version) // Using/Aliasing - using DataGlobals::Pi; using DataPlant::PlantLoop; using FluidProperties::GetConductivityGlycol; using FluidProperties::GetViscosityGlycol; @@ -1735,7 +1731,7 @@ namespace PipeHeatTransfer { 1000.0; // Note fluid properties routine returns mPa-s, we need Pa-s // Calculate the Reynold's number from RE=(4*Mdot)/(Pi*Mu*Diameter) - as RadiantSysLowTemp - ReD = 4.0 * MassFlowRate / (Pi * MUactual * Diameter); + ReD = 4.0 * MassFlowRate / (DataGlobalConstants::Pi() * MUactual * Diameter); if (ReD == 0.0) { // No flow diff --git a/src/EnergyPlus/PlantPipingSystemsManager.cc b/src/EnergyPlus/PlantPipingSystemsManager.cc index 611e1de4cad..72df2bb18e1 100644 --- a/src/EnergyPlus/PlantPipingSystemsManager.cc +++ b/src/EnergyPlus/PlantPipingSystemsManager.cc @@ -2618,7 +2618,7 @@ namespace EnergyPlus { } //'also assign the interface cell surrounding the radial system - this->InterfaceVolume = (1.0 - (DataGlobals::Pi / 4.0)) * pow_2(GridCellWidth) * CellDepth; + this->InterfaceVolume = (1.0 - (DataGlobalConstants::Pi() / 4.0)) * pow_2(GridCellWidth) * CellDepth; } void Domain::developMesh() { @@ -4451,7 +4451,7 @@ namespace EnergyPlus { } // Latitude, converted to radians...positive for northern hemisphere, [radians] - Latitude_Radians = DataGlobals::Pi / 180.0 * Latitude_Degrees; + Latitude_Radians = DataGlobalConstants::Pi() / 180.0 * Latitude_Degrees; // The day of year at this point in the simulation DayOfYear = int(this->Cur.CurSimTimeSeconds / DataGlobals::SecsInDay); @@ -4466,11 +4466,11 @@ namespace EnergyPlus { CurAirTempK = this->Cur.CurAirTemp + 273.15; // Calculate some angles - dr = 1.0 + 0.033 * std::cos(2.0 * DataGlobals::Pi * DayOfYear / 365.0); - Declination = 0.409 * std::sin(2.0 * DataGlobals::Pi / 365.0 * DayOfYear - 1.39); - b_SC = 2.0 * DataGlobals::Pi * (DayOfYear - 81.0) / 364.0; + dr = 1.0 + 0.033 * std::cos(2.0 * DataGlobalConstants::Pi() * DayOfYear / 365.0); + Declination = 0.409 * std::sin(2.0 * DataGlobalConstants::Pi() / 365.0 * DayOfYear - 1.39); + b_SC = 2.0 * DataGlobalConstants::Pi() * (DayOfYear - 81.0) / 364.0; Sc = 0.1645 * std::sin(2.0 * b_SC) - 0.1255 * std::cos(b_SC) - 0.025 * std::sin(b_SC); - Hour_Angle = DataGlobals::Pi / 12.0 * + Hour_Angle = DataGlobalConstants::Pi() / 12.0 * (((HourOfDay - 0.5) + 0.06667 * (StMeridian_Degrees - Longitude_Degrees) + Sc) - 12.0); // Calculate sunset something, and constrain to a minimum of 0.000001 @@ -4478,12 +4478,12 @@ namespace EnergyPlus { X_sunset = max(X_sunset, 0.000001); // Find sunset angle - Sunset_Angle = DataGlobals::Pi / 2.0 - + Sunset_Angle = DataGlobalConstants::Pi() / 2.0 - std::atan(-std::tan(Latitude_Radians) * std::tan(Declination) / std::sqrt(X_sunset)); // Find solar angles - Solar_Angle_1 = Hour_Angle - DataGlobals::Pi / 24.0; - Solar_Angle_2 = Hour_Angle + DataGlobals::Pi / 24.0; + Solar_Angle_1 = Hour_Angle - DataGlobalConstants::Pi() / 24.0; + Solar_Angle_2 = Hour_Angle + DataGlobalConstants::Pi() / 24.0; // Constrain solar angles if (Solar_Angle_1 < -Sunset_Angle) Solar_Angle_1 = -Sunset_Angle; @@ -4496,7 +4496,7 @@ namespace EnergyPlus { IncidentSolar_MJhrmin = this->Cur.CurIncidentSolar * Convert_Wm2_To_MJhrmin; // Calculate another Q term... - QRAD_A = 12.0 * 60.0 / DataGlobals::Pi * MeanSolarConstant * dr * + QRAD_A = 12.0 * 60.0 / DataGlobalConstants::Pi() * MeanSolarConstant * dr * ((Solar_Angle_2 - Solar_Angle_1) * std::sin(Latitude_Radians) * std::sin(Declination) + std::cos(Latitude_Radians) * std::cos(Declination) * (std::sin(Solar_Angle_2) - std::sin(Solar_Angle_1))); @@ -5019,7 +5019,7 @@ namespace EnergyPlus { Real64 const Prandtl = thisCircuit->CurFluidPropertySet.Prandtl; // Flow calculations - Real64 const Area_c = (DataGlobals::Pi / 4.0) * pow_2(thisCircuit->PipeSize.InnerDia); + Real64 const Area_c = (DataGlobalConstants::Pi() / 4.0) * pow_2(thisCircuit->PipeSize.InnerDia); Real64 const Velocity = thisCircuit->CurCircuitFlowRate / (Density * Area_c); // Determine convection coefficient based on flow conditions @@ -5227,7 +5227,7 @@ namespace EnergyPlus { Real64 OutermostRadialCellRadialCentroid = outerRadialCell.RadialCentroid; Real64 OutermostRadialCellTemperature = outerRadialCell.Temperature; Real64 Resistance = std::log(OutermostRadialCellOuterRadius / OutermostRadialCellRadialCentroid) / - (2.0 * DataGlobals::Pi * cell.depth() * cell.Properties.Conductivity); + (2.0 * DataGlobalConstants::Pi() * cell.depth() * cell.Properties.Conductivity); Numerator += (cell.Beta / Resistance) * OutermostRadialCellTemperature; Denominator += (cell.Beta / Resistance); @@ -5299,15 +5299,15 @@ namespace EnergyPlus { //'add effects from interface cell Real64 Resistance = std::log(ThisRadialCellOuterRadius / ThisRadialCellRadialCentroid) / - (2 * DataGlobals::Pi * cell.depth() * ThisRadialCellConductivity); + (2 * DataGlobalConstants::Pi() * cell.depth() * ThisRadialCellConductivity); Numerator += (Beta / Resistance) * cell.Temperature; Denominator += (Beta / Resistance); //'add effects from inner radial cell Resistance = (std::log(ThisRadialCellRadialCentroid / ThisRadialCellInnerRadius) / - (2 * DataGlobals::Pi * cell.depth() * ThisRadialCellConductivity)) + + (2 * DataGlobalConstants::Pi() * cell.depth() * ThisRadialCellConductivity)) + (std::log(NextOuterRadialCellOuterRadius / NextOuterRadialCellRadialCentroid) / - (2 * DataGlobals::Pi * cell.depth() * NextOuterRadialCellConductivity)); + (2 * DataGlobalConstants::Pi() * cell.depth() * NextOuterRadialCellConductivity)); Numerator += (Beta / Resistance) * NextOuterRadialCellTemperature; Denominator += (Beta / Resistance); @@ -5355,18 +5355,18 @@ namespace EnergyPlus { //'add effects from outer cell Real64 Resistance = (std::log(OuterRadialCellRadialCentroid / OuterRadialCellInnerRadius) / - (2 * DataGlobals::Pi * cell.depth() * OuterRadialCellConductivity)) + + (2 * DataGlobalConstants::Pi() * cell.depth() * OuterRadialCellConductivity)) + (std::log(ThisRadialCellOuterRadius / ThisRadialCellRadialCentroid) / - (2 * DataGlobals::Pi * cell.depth() * ThisRadialCellConductivity)); + (2 * DataGlobalConstants::Pi() * cell.depth() * ThisRadialCellConductivity)); Numerator += (thisSoilCell.Beta / Resistance) * OuterRadialCellTemperature; Denominator += (thisSoilCell.Beta / Resistance); //'add effects from inner cell Resistance = (std::log(ThisRadialCellRadialCentroid / ThisRadialCellInnerRadius) / - (2 * DataGlobals::Pi * cell.depth() * ThisRadialCellConductivity)) + + (2 * DataGlobalConstants::Pi() * cell.depth() * ThisRadialCellConductivity)) + (std::log(InnerRadialCellOuterRadius / InnerRadialCellRadialCentroid) / - (2 * DataGlobals::Pi * cell.depth() * InnerRadialCellConductivity)); + (2 * DataGlobalConstants::Pi() * cell.depth() * InnerRadialCellConductivity)); Numerator += (thisSoilCell.Beta / Resistance) * InnerRadialCellTemperature; Denominator += (thisSoilCell.Beta / Resistance); @@ -5425,17 +5425,17 @@ namespace EnergyPlus { //'add effects from outer radial cell Resistance = (std::log(OuterNeighborRadialCellRadialCentroid / OuterNeighborRadialCellInnerRadius) / - (2 * DataGlobals::Pi * cell.depth() * OuterNeighborRadialCellConductivity)) + + (2 * DataGlobalConstants::Pi() * cell.depth() * OuterNeighborRadialCellConductivity)) + (std::log(ThisRadialCellOuterRadius / ThisRadialCellRadialCentroid) / - (2 * DataGlobals::Pi * cell.depth() * ThisRadialCellConductivity)); + (2 * DataGlobalConstants::Pi() * cell.depth() * ThisRadialCellConductivity)); Numerator += (soilZero.Beta / Resistance) * OuterNeighborRadialCellTemperature; Denominator += (soilZero.Beta / Resistance); //'add effects from pipe cell Resistance = (std::log(ThisRadialCellRadialCentroid / ThisRadialCellInnerRadius) / - (2 * DataGlobals::Pi * cell.depth() * ThisRadialCellConductivity)) + + (2 * DataGlobalConstants::Pi() * cell.depth() * ThisRadialCellConductivity)) + (std::log(InnerNeighborRadialCellOuterRadius / InnerNeighborRadialCellRadialCentroid) / - (2 * DataGlobals::Pi * cell.depth() * InnerNeighborRadialCellConductivity)); + (2 * DataGlobalConstants::Pi() * cell.depth() * InnerNeighborRadialCellConductivity)); Numerator += (soilZero.Beta / Resistance) * InnerNeighborRadialCellTemperature; Denominator += (soilZero.Beta / Resistance); @@ -5466,17 +5466,17 @@ namespace EnergyPlus { //'add effects from outer radial cell Real64 Resistance = (std::log(NextInnerRadialCell.RadialCentroid / NextInnerRadialCell.InnerRadius) / - (2 * DataGlobals::Pi * cell.depth() * NextInnerRadialCell.Properties.Conductivity)) + + (2 * DataGlobalConstants::Pi() * cell.depth() * NextInnerRadialCell.Properties.Conductivity)) + (std::log(ThisInsulationCell.OuterRadius / ThisInsulationCell.RadialCentroid) / - (2 * DataGlobals::Pi * cell.depth() * ThisInsulationCell.Properties.Conductivity)); + (2 * DataGlobalConstants::Pi() * cell.depth() * ThisInsulationCell.Properties.Conductivity)); Numerator += (ThisInsulationCell.Beta / Resistance) * NextInnerRadialCell.Temperature; Denominator += (ThisInsulationCell.Beta / Resistance); //'add effects from pipe cell Resistance = (std::log(ThisInsulationCell.RadialCentroid / ThisInsulationCell.InnerRadius) / - (2 * DataGlobals::Pi * cell.depth() * ThisInsulationCell.Properties.Conductivity)) + + (2 * DataGlobalConstants::Pi() * cell.depth() * ThisInsulationCell.Properties.Conductivity)) + (std::log(PipeCell.OuterRadius / PipeCell.RadialCentroid) / - (2 * DataGlobals::Pi * cell.depth() * PipeCell.Properties.Conductivity)); + (2 * DataGlobalConstants::Pi() * cell.depth() * PipeCell.Properties.Conductivity)); Numerator += (ThisInsulationCell.Beta / Resistance) * PipeCell.Temperature; Denominator += (ThisInsulationCell.Beta / Resistance); @@ -5529,18 +5529,18 @@ namespace EnergyPlus { //'add effects from outer radial cell Real64 Resistance = (std::log(OuterNeighborRadialCellRadialCentroid / OuterNeighborRadialCellInnerRadius) / - (2 * DataGlobals::Pi * cell.depth() * OuterNeighborRadialCellConductivity)) + + (2 * DataGlobalConstants::Pi() * cell.depth() * OuterNeighborRadialCellConductivity)) + (std::log(ThisPipeCellOuterRadius / ThisPipeCellRadialCentroid) / - (2 * DataGlobals::Pi * cell.depth() * ThisPipeCellConductivity)); + (2 * DataGlobalConstants::Pi() * cell.depth() * ThisPipeCellConductivity)); Numerator += (cell.PipeCellData.Pipe.Beta / Resistance) * OuterNeighborRadialCellTemperature; Denominator += (cell.PipeCellData.Pipe.Beta / Resistance); //'add effects from water cell Real64 PipeConductionResistance = std::log(ThisPipeCellRadialCentroid / ThisPipeCellInnerRadius) / - (2 * DataGlobals::Pi * cell.depth() * ThisPipeCellConductivity); + (2 * DataGlobalConstants::Pi() * cell.depth() * ThisPipeCellConductivity); Real64 ConvectiveResistance = - 1.0 / (thisCircuit->CurCircuitConvectionCoefficient * 2 * DataGlobals::Pi * ThisPipeCellInnerRadius * cell.depth()); + 1.0 / (thisCircuit->CurCircuitConvectionCoefficient * 2 * DataGlobalConstants::Pi() * ThisPipeCellInnerRadius * cell.depth()); Resistance = PipeConductionResistance + ConvectiveResistance; Numerator += (cell.PipeCellData.Pipe.Beta / Resistance) * FluidCellTemperature; Denominator += (cell.PipeCellData.Pipe.Beta / Resistance); @@ -5577,9 +5577,9 @@ namespace EnergyPlus { //'add effects from outer pipe cell Real64 PipeConductionResistance = std::log(PipeCellRadialCentroid / PipeCellInnerRadius) / - (2 * DataGlobals::Pi * cell.depth() * PipeCellConductivity); + (2 * DataGlobalConstants::Pi() * cell.depth() * PipeCellConductivity); Real64 ConvectiveResistance = - 1.0 / (thisCircuit->CurCircuitConvectionCoefficient * 2 * DataGlobals::Pi * PipeCellInnerRadius * cell.depth()); + 1.0 / (thisCircuit->CurCircuitConvectionCoefficient * 2 * DataGlobalConstants::Pi() * PipeCellInnerRadius * cell.depth()); Real64 TotalPipeResistance = PipeConductionResistance + ConvectiveResistance; Numerator += (cell.PipeCellData.Fluid.Beta / TotalPipeResistance) * PipeCellTemperature; Denominator += (cell.PipeCellData.Fluid.Beta / TotalPipeResistance); diff --git a/src/EnergyPlus/PlantPipingSystemsManager.hh b/src/EnergyPlus/PlantPipingSystemsManager.hh index 6add3ab3bc9..4c6bab269d6 100644 --- a/src/EnergyPlus/PlantPipingSystemsManager.hh +++ b/src/EnergyPlus/PlantPipingSystemsManager.hh @@ -220,7 +220,7 @@ struct EnergyPlusData; // Get the XY cross sectional area of the radial cell Real64 inline XY_CrossSectArea() const { - return DataGlobals::Pi * (pow_2(this->OuterRadius) - pow_2(this->InnerRadius)); + return DataGlobalConstants::Pi() * (pow_2(this->OuterRadius) - pow_2(this->InnerRadius)); } }; @@ -234,7 +234,7 @@ struct EnergyPlusData; // Member Constructor FluidCellInformation(Real64 const m_PipeInnerRadius, Real64 const m_CellDepth) { - this->Volume = DataGlobals::Pi * pow_2(m_PipeInnerRadius) * m_CellDepth; + this->Volume = DataGlobalConstants::Pi() * pow_2(m_PipeInnerRadius) * m_CellDepth; } }; diff --git a/src/EnergyPlus/PlantPressureSystem.cc b/src/EnergyPlus/PlantPressureSystem.cc index c1d0a846eea..0e51546bbe4 100644 --- a/src/EnergyPlus/PlantPressureSystem.cc +++ b/src/EnergyPlus/PlantPressureSystem.cc @@ -103,7 +103,6 @@ namespace PlantPressureSystem { // Using/Aliasing using namespace DataPrecisionGlobals; - using DataGlobals::Pi; using namespace DataBranchAirLoopPlant; // Data diff --git a/src/EnergyPlus/PondGroundHeatExchanger.cc b/src/EnergyPlus/PondGroundHeatExchanger.cc index 49e99b711bf..a6faeb75eb1 100644 --- a/src/EnergyPlus/PondGroundHeatExchanger.cc +++ b/src/EnergyPlus/PondGroundHeatExchanger.cc @@ -439,7 +439,7 @@ namespace PondGroundHeatExchanger { DataPrecisionGlobals::constant_zero, DataPlant::PlantLoop(this->LoopNum).FluidIndex, RoutineName); - this->DesignMassFlowRate = DataGlobals::Pi / 4.0 * pow_2(this->TubeInDiameter) * DesignVelocity * rho * this->NumCircuits; + this->DesignMassFlowRate = DataGlobalConstants::Pi() / 4.0 * pow_2(this->TubeInDiameter) * DesignVelocity * rho * this->NumCircuits; this->DesignCapacity = this->DesignMassFlowRate * Cp * 10.0; // assume 10C delta T? PlantUtilities::InitComponentNodes(0.0, this->DesignMassFlowRate, @@ -760,7 +760,7 @@ namespace PondGroundHeatExchanger { state, DataPlant::PlantLoop(this->LoopNum).FluidName, InsideTemperature, DataPlant::PlantLoop(this->LoopNum).FluidIndex, CalledFrom); // Calculate the Reynold's number from RE=(4*Mdot)/(Pi*Mu*Diameter) - Real64 ReynoldsNum = 4.0 * massFlowRate / (DataGlobals::Pi * Viscosity * this->TubeInDiameter * this->NumCircuits); + Real64 ReynoldsNum = 4.0 * massFlowRate / (DataGlobalConstants::Pi() * Viscosity * this->TubeInDiameter * this->NumCircuits); Real64 PrantlNum = Viscosity * SpecificHeat / Conductivity; @@ -819,7 +819,7 @@ namespace PondGroundHeatExchanger { if (massFlowRate == 0.0) { CalcEffectiveness = 1.0; } else { - NTU = DataGlobals::Pi * TubeInDiameter * this->CircuitLength * this->NumCircuits / (TotalResistance * massFlowRate * SpecificHeat); + NTU = DataGlobalConstants::Pi() * TubeInDiameter * this->CircuitLength * this->NumCircuits / (TotalResistance * massFlowRate * SpecificHeat); // Calculate effectiveness - formula for static fluid CalcEffectiveness = (1.0 - std::exp(-NTU)); } diff --git a/src/EnergyPlus/RefrigeratedCase.cc b/src/EnergyPlus/RefrigeratedCase.cc index 760e2198860..a8e19e5fda9 100644 --- a/src/EnergyPlus/RefrigeratedCase.cc +++ b/src/EnergyPlus/RefrigeratedCase.cc @@ -13523,7 +13523,7 @@ namespace RefrigeratedCase { // corresponds to walk in temp and 90% assumed RH(kg water/kg dry air) Real64 HumRatioAirWalkIn = Psychrometrics::PsyWFnTdbH(TWalkIn, EnthalpyAirWalkIn); Real64 DensityAirWalkIn = Psychrometrics::PsyRhoAirFnPbTdbW(DataEnvironment::OutBaroPress, TWalkIn, HumRatioAirWalkIn); - Real64 Conv = DataEnvironment::Latitude * 2.0 * DataGlobals::Pi / 360.0; // Convert DataEnvironment::Latitude to radians + Real64 Conv = DataEnvironment::Latitude * 2.0 * DataGlobalConstants::Pi() / 360.0; // Convert DataEnvironment::Latitude to radians Real64 Gravity = 9.780373 * (1.0 + 0.0052891 * pow_2(std::sin(Conv)) - 0.0000059 * pow_2(std::sin(2.0 * Conv))); // CALCULATE ALL LOADS INFLUENCED BY ZONE TEMPERATURE AND RH diff --git a/src/EnergyPlus/RuntimeLanguageProcessor.cc b/src/EnergyPlus/RuntimeLanguageProcessor.cc index 3093b7a6eca..7c09c8234a4 100644 --- a/src/EnergyPlus/RuntimeLanguageProcessor.cc +++ b/src/EnergyPlus/RuntimeLanguageProcessor.cc @@ -244,7 +244,6 @@ namespace RuntimeLanguageProcessor { using DataEnvironment::Year; using DataGlobals::CurrentTime; using DataGlobals::HourOfDay; - using DataGlobals::Pi; using DataGlobals::TimeStepZone; using DataGlobals::WarmupFlag; using DataHVACGlobals::SysTimeElapsed; @@ -282,7 +281,7 @@ namespace RuntimeLanguageProcessor { TrueVariableNum = NewEMSVariable("TRUE", 0, True); OffVariableNum = NewEMSVariable("OFF", 0, False); OnVariableNum = NewEMSVariable("ON", 0, True); - PiVariableNum = NewEMSVariable("PI", 0, SetErlValueNumber(Pi)); + PiVariableNum = NewEMSVariable("PI", 0, SetErlValueNumber(DataGlobalConstants::Pi())); TimeStepsPerHourVariableNum = NewEMSVariable("TIMESTEPSPERHOUR", 0, SetErlValueNumber(double(DataGlobals::NumOfTimeStepInHour))); // Create dynamic built-in variables @@ -1829,7 +1828,6 @@ namespace RuntimeLanguageProcessor { // USE, INTRINSIC :: IEEE_ARITHMETIC, ONLY : IEEE_IS_NAN ! Use IEEE_IS_NAN when GFortran supports it // Using/Aliasing - using DataGlobals::DegToRadians; // unused, TimeStepZone using namespace Psychrometrics; using CurveManager::CurveValue; using General::RoundSigDigits; @@ -2040,9 +2038,9 @@ namespace RuntimeLanguageProcessor { } else if (SELECT_CASE_var == FuncArcCos) { ReturnValue = SetErlValueNumber(std::acos(Operand(1).Number)); } else if (SELECT_CASE_var == FuncDegToRad) { - ReturnValue = SetErlValueNumber(Operand(1).Number * DegToRadians); + ReturnValue = SetErlValueNumber(Operand(1).Number * DataGlobalConstants::DegToRadians()); } else if (SELECT_CASE_var == FuncRadToDeg) { - ReturnValue = SetErlValueNumber(Operand(1).Number / DegToRadians); + ReturnValue = SetErlValueNumber(Operand(1).Number / DataGlobalConstants::DegToRadians()); } else if (SELECT_CASE_var == FuncExp) { if ((Operand(1).Number < 700.0) && (Operand(1).Number > -20.0)) { ReturnValue = SetErlValueNumber(std::exp(Operand(1).Number)); diff --git a/src/EnergyPlus/SolarCollectors.cc b/src/EnergyPlus/SolarCollectors.cc index 6fe496e2124..d4c13cc464c 100644 --- a/src/EnergyPlus/SolarCollectors.cc +++ b/src/EnergyPlus/SolarCollectors.cc @@ -870,14 +870,14 @@ namespace SolarCollectors { this->Tilt = DataSurfaces::Surface(SurfNum).Tilt; this->TiltR2V = std::abs(90.0 - Tilt); - this->CosTilt = std::cos(Tilt * DataGlobals::DegToRadians); - this->SinTilt = std::sin(1.8 * Tilt * DataGlobals::DegToRadians); + this->CosTilt = std::cos(Tilt * DataGlobalConstants::DegToRadians()); + this->SinTilt = std::sin(1.8 * Tilt * DataGlobalConstants::DegToRadians()); // Diffuse reflectance of the cover for solar radiation diffusely reflected back from the absober // plate to the cover. The diffuse solar radiation reflected back from the absober plate to the // cover is represented by the 60 degree equivalent incident angle. This diffuse reflectance is // used to calculate the transmittance - absorptance product (Duffie and Beckman, 1991) - Real64 Theta = 60.0 * DataGlobals::DegToRadians; + Real64 Theta = 60.0 * DataGlobalConstants::DegToRadians(); Real64 TransSys = 0.0; Real64 RefSys = 0.0; Real64 AbsCover1 = 0.0; @@ -894,7 +894,7 @@ namespace SolarCollectors { // transmittance-absorptance product for sky diffuse radiation. Uses equivalent incident angle // of sky radiation (radians), and is calculated according to Brandemuehl and Beckman (1980): - Theta = (59.68 - 0.1388 * Tilt + 0.001497 * pow_2(Tilt)) * DataGlobals::DegToRadians; + Theta = (59.68 - 0.1388 * Tilt + 0.001497 * pow_2(Tilt)) * DataGlobalConstants::DegToRadians(); this->CalcTransRefAbsOfCover(Theta, TransSys, RefSys, AbsCover1, AbsCover2); this->TauAlphaSkyDiffuse = TransSys * SolarCollectors::Parameters(ParamNum).AbsorOfAbsPlate / (1.0 - (1.0 - SolarCollectors::Parameters(ParamNum).AbsorOfAbsPlate) * this->RefDiffInnerCover); @@ -903,7 +903,7 @@ namespace SolarCollectors { // transmittance-absorptance product for ground diffuse radiation. Uses equivalent incident angle // of ground radiation (radians), and is calculated according to Brandemuehl and Beckman (1980): - Theta = (90.0 - 0.5788 * Tilt + 0.002693 * pow_2(Tilt)) * DataGlobals::DegToRadians; + Theta = (90.0 - 0.5788 * Tilt + 0.002693 * pow_2(Tilt)) * DataGlobalConstants::DegToRadians(); this->CalcTransRefAbsOfCover(Theta, TransSys, RefSys, AbsCover1, AbsCover2); this->TauAlphaGndDiffuse = TransSys * SolarCollectors::Parameters(ParamNum).AbsorOfAbsPlate / (1.0 - (1.0 - SolarCollectors::Parameters(ParamNum).AbsorOfAbsPlate) * this->RefDiffInnerCover); @@ -992,10 +992,10 @@ namespace SolarCollectors { Real64 tilt = DataSurfaces::Surface(SurfNum).Tilt; // Equivalent incident angle of sky radiation (radians) - Real64 ThetaSky = (59.68 - 0.1388 * tilt + 0.001497 * pow_2(tilt)) * DataGlobals::DegToRadians; + Real64 ThetaSky = (59.68 - 0.1388 * tilt + 0.001497 * pow_2(tilt)) * DataGlobalConstants::DegToRadians(); // Equivalent incident angle of ground radiation (radians) - Real64 ThetaGnd = (90.0 - 0.5788 * tilt + 0.002693 * pow_2(tilt)) * DataGlobals::DegToRadians; + Real64 ThetaGnd = (90.0 - 0.5788 * tilt + 0.002693 * pow_2(tilt)) * DataGlobalConstants::DegToRadians(); incidentAngleModifier = (DataHeatBalance::QRadSWOutIncidentBeam(SurfNum) * SolarCollectors::Parameters(ParamNum).IAM(ThetaBeam) + DataHeatBalance::QRadSWOutIncidentSkyDiffuse(SurfNum) * SolarCollectors::Parameters(ParamNum).IAM(ThetaSky) + @@ -1209,7 +1209,7 @@ namespace SolarCollectors { Real64 IAM; // cut off IAM for angles greater than 60 degrees. (CR 7534) - Real64 CutoffAngle = 60.0 * DataGlobals::DegToRadians; + Real64 CutoffAngle = 60.0 * DataGlobalConstants::DegToRadians(); if (std::abs(IncidentAngle) > CutoffAngle) { // cut off, model curves not robust beyond cutoff // curves from FSEC/SRCC testing are only certified to 60 degrees, larger angles can cause numerical problems in curves IAM = 0.0; @@ -1943,7 +1943,7 @@ namespace SolarCollectors { // Grashof number Real64 GrNum = gravity * VolExpWater * DensOfWater * DensOfWater * PrOfWater * DeltaT * pow_3(Lc) / pow_2(VisOfWater); - Real64 CosTilt = std::cos(TiltR2V * DataGlobals::DegToRadians); + Real64 CosTilt = std::cos(TiltR2V * DataGlobalConstants::DegToRadians()); Real64 RaNum; // Raleigh number Real64 NuL; // Nusselt number diff --git a/src/EnergyPlus/SolarReflectionManager.cc b/src/EnergyPlus/SolarReflectionManager.cc index cca676cc659..5fa2cfb4975 100644 --- a/src/EnergyPlus/SolarReflectionManager.cc +++ b/src/EnergyPlus/SolarReflectionManager.cc @@ -393,8 +393,8 @@ namespace SolarReflectionManager { } SolReflRecSurf(RecSurfNum).PhiNormVec = PhiSurf; SolReflRecSurf(RecSurfNum).ThetaNormVec = ThetaSurf; - PhiMin = max(-PiOvr2, PhiSurf - PiOvr2); - PhiMax = min(PiOvr2, PhiSurf + PiOvr2); + PhiMin = max(-DataGlobalConstants::PiOvr2(), PhiSurf - DataGlobalConstants::PiOvr2()); + PhiMax = min(DataGlobalConstants::PiOvr2(), PhiSurf + DataGlobalConstants::PiOvr2()); DPhi = (PhiMax - PhiMin) / AltAngStepsForSolReflCalc; RayNum = 0; @@ -407,9 +407,9 @@ namespace SolarReflectionManager { URay(3) = SPhi; if (PhiSurf >= 0.0) { - if (Phi >= PiOvr2 - PhiSurf) { - ThetaMin = -Pi; - ThetaMax = Pi; + if (Phi >= DataGlobalConstants::PiOvr2() - PhiSurf) { + ThetaMin = -DataGlobalConstants::Pi(); + ThetaMax = DataGlobalConstants::Pi(); } else { ACosTanTan = std::acos(-std::tan(Phi) * tan_PhiSurf); ThetaMin = ThetaSurf - std::abs(ACosTanTan); @@ -417,9 +417,9 @@ namespace SolarReflectionManager { } } else { // PhiSurf < 0.0 - if (Phi <= -PhiSurf - PiOvr2) { - ThetaMin = -Pi; - ThetaMax = Pi; + if (Phi <= -PhiSurf - DataGlobalConstants::PiOvr2()) { + ThetaMin = -DataGlobalConstants::Pi(); + ThetaMax = DataGlobalConstants::Pi(); } else { ACosTanTan = std::acos(-std::tan(Phi) * tan_PhiSurf); ThetaMin = ThetaSurf - std::abs(ACosTanTan); @@ -806,13 +806,13 @@ namespace SolarReflectionManager { if (HitPtSurfNum > 0) { // Ray hits an obstruction dReflBeamToDiffSol = BmReflSolRadiance * SolReflRecSurf(RecSurfNum).dOmegaRay(RayNum) * - SolReflRecSurf(RecSurfNum).CosIncAngRay(RayNum) / Pi; + SolReflRecSurf(RecSurfNum).CosIncAngRay(RayNum) / DataGlobalConstants::Pi(); ReflBmToDiffSolObs(RecPtNum) += dReflBeamToDiffSol; } else { // Ray hits ground (in this case we do not multiply by BmReflSolRadiance since // ground reflectance and cos of incidence angle of sun on // ground is taken into account later when ReflFacBmToDiffSolGnd is used) - dReflBeamToDiffSol = SolReflRecSurf(RecSurfNum).dOmegaRay(RayNum) * SolReflRecSurf(RecSurfNum).CosIncAngRay(RayNum) / Pi; + dReflBeamToDiffSol = SolReflRecSurf(RecSurfNum).dOmegaRay(RayNum) * SolReflRecSurf(RecSurfNum).CosIncAngRay(RayNum) / DataGlobalConstants::Pi(); ReflBmToDiffSolGnd(RecPtNum) += dReflBeamToDiffSol; } } @@ -1131,8 +1131,8 @@ namespace SolarReflectionManager { static Vector3 SurfVert(0.0); // Surface vertex (m) // FLOW: - Real64 const DPhi(PiOvr2 / (AltAngStepsForSolReflCalc / 2.0)); // Altitude angle and increment (radians) - Real64 const DTheta(2.0 * Pi / (2.0 * AzimAngStepsForSolReflCalc)); // Azimuth increment (radians) + Real64 const DPhi(DataGlobalConstants::PiOvr2() / (AltAngStepsForSolReflCalc / 2.0)); // Altitude angle and increment (radians) + Real64 const DTheta(2.0 * DataGlobalConstants::Pi() / (2.0 * AzimAngStepsForSolReflCalc)); // Azimuth increment (radians) // Pre-compute these constants // Initialize the 0 index with dummy value so the iterators line up below @@ -1197,7 +1197,7 @@ namespace SolarReflectionManager { SolReflRecSurf(RecSurfNum).HitPtSolRefl(RayNum, RecPtNum); } dReflSkySol = - SkyReflSolRadiance * SolReflRecSurf(RecSurfNum).dOmegaRay(RayNum) * SolReflRecSurf(RecSurfNum).CosIncAngRay(RayNum) / Pi; + SkyReflSolRadiance * SolReflRecSurf(RecSurfNum).dOmegaRay(RayNum) * SolReflRecSurf(RecSurfNum).CosIncAngRay(RayNum) / DataGlobalConstants::Pi(); ReflSkySolObs(RecPtNum) += dReflSkySol; } else { // Ray hits ground; @@ -1240,11 +1240,11 @@ namespace SolarReflectionManager { } if (hitObs) continue; // Obstruction hit // Sky is hit - dReflSkyGnd += CosIncAngRayToSky * dOmega / Pi; + dReflSkyGnd += CosIncAngRayToSky * dOmega / DataGlobalConstants::Pi(); } // End of azimuth loop } // End of altitude loop ReflSkySolGnd(RecPtNum) += - dReflSkyGnd * SolReflRecSurf(RecSurfNum).dOmegaRay(RayNum) * SolReflRecSurf(RecSurfNum).CosIncAngRay(RayNum) / Pi; + dReflSkyGnd * SolReflRecSurf(RecSurfNum).dOmegaRay(RayNum) * SolReflRecSurf(RecSurfNum).CosIncAngRay(RayNum) / DataGlobalConstants::Pi(); } // End of check if ray from receiving point hits obstruction or ground } // End of loop over rays from receiving point } // End of loop over receiving points diff --git a/src/EnergyPlus/SolarShading.cc b/src/EnergyPlus/SolarShading.cc index 53c435728c8..f2a59727c4d 100644 --- a/src/EnergyPlus/SolarShading.cc +++ b/src/EnergyPlus/SolarShading.cc @@ -270,8 +270,8 @@ namespace SolarShading { int const NPhi = 6; // Number of altitude angle steps for sky integration int const NTheta = 24; // Number of azimuth angle steps for sky integration Real64 const Eps = 1.e-10; // Small number - Real64 const DPhi = PiOvr2 / NPhi; // Altitude step size - Real64 const DTheta = 2.0 * Pi / NTheta; // Azimuth step size + Real64 const DPhi = DataGlobalConstants::PiOvr2() / NPhi; // Altitude step size + Real64 const DTheta = 2.0 * DataGlobalConstants::Pi() / NTheta; // Azimuth step size Real64 const DThetaDPhi = DTheta * DPhi; // Product of DTheta and DPhi Real64 const PhiMin = 0.5 * DPhi; // Minimum altitude @@ -2526,7 +2526,7 @@ namespace SolarShading { CosZenithAng = SOLCOS(3); ZenithAng = std::acos(CosZenithAng); - ZenithAngDeg = ZenithAng / DegToRadians; + ZenithAngDeg = ZenithAng / DataGlobalConstants::DegToRadians(); AnisoSkyMult = 0.0; @@ -5773,7 +5773,7 @@ namespace SolarShading { #ifndef EP_NO_OPENGL if (penumbra) { - Real64 ElevSun = PiOvr2 - std::acos(SUNCOS(3)); + Real64 ElevSun = DataGlobalConstants::PiOvr2() - std::acos(SUNCOS(3)); Real64 AzimSun = std::atan2(SUNCOS(1), SUNCOS(2)); penumbra->setSunPosition(AzimSun, ElevSun); penumbra->submitPSSA(); @@ -7051,7 +7051,7 @@ namespace SolarShading { tfshBd = InterpProfSlatAng(ProfAng, SlatAng, VarSlats, Blind(BlNum).SolFrontBeamDiffTrans); tfshd = InterpSlatAng(SlatAng, VarSlats, Blind(BlNum).SolFrontDiffDiffTrans); tbshBB = BlindBeamBeamTrans(ProfAng, - Pi - SlatAng, + DataGlobalConstants::Pi() - SlatAng, Blind(BlNum).SlatWidth, Blind(BlNum).SlatSeparation, Blind(BlNum).SlatThickness); @@ -8048,7 +8048,7 @@ namespace SolarShading { ProfileAngle(BackSurfNum, SOLCOS, Blind(BlNumBack).SlatOrientation, ProfAngBack); TGlBmBack = POLYF(CosIncBack, state.dataConstruction->Construct(ConstrNumBack).TransSolBeamCoef); TBlBmBmBack = BlindBeamBeamTrans(ProfAngBack, - Pi - SlatAngBack, + DataGlobalConstants::Pi() - SlatAngBack, Blind(BlNumBack).SlatWidth, Blind(BlNumBack).SlatSeparation, Blind(BlNumBack).SlatThickness); @@ -8153,7 +8153,7 @@ namespace SolarShading { InterpProfSlatAng(ProfAngBack, SlatAngBack, VarSlatsBack, Blind(BlNumBack).SolFrontBeamDiffTrans); tfshdk = InterpSlatAng(SlatAngBack, VarSlatsBack, Blind(BlNumBack).SolFrontDiffDiffTrans); tbshBBk = BlindBeamBeamTrans(ProfAngBack, - Pi - SlatAngBack, + DataGlobalConstants::Pi() - SlatAngBack, Blind(BlNumBack).SlatWidth, Blind(BlNumBack).SlatSeparation, Blind(BlNumBack).SlatThickness); @@ -9805,7 +9805,7 @@ namespace SolarShading { // Compute the hour angle HrAngle = (15.0 * (12.0 - (CurrentTime + EqOfTime)) + (TimeZoneMeridian - Longitude)); - H = HrAngle * DegToRadians; + H = HrAngle * DataGlobalConstants::DegToRadians(); // Compute the cosine of the solar zenith angle. SUNCOS(3) = SinSolarDeclin * SinLatitude + CosSolarDeclin * CosLatitude * std::cos(H); @@ -10238,7 +10238,7 @@ namespace SolarShading { // Blind in place or may be in place due to glare control int BlNum = SurfWinBlindNumber(ISurf); if (BlNum > 0) { - Real64 InputSlatAngle = Blind(BlNum).SlatAngle * DegToRadians; // Slat angle of associated Material:WindowBlind (rad) + Real64 InputSlatAngle = Blind(BlNum).SlatAngle * DataGlobalConstants::DegToRadians(); // Slat angle of associated Material:WindowBlind (rad) Real64 ProfAng; // Solar profile angle (rad) Real64 SlatAng; // Slat angle this time step (rad) Real64 PermeabilityA; // Intermediate variables in blind permeability calc @@ -10254,11 +10254,11 @@ namespace SolarShading { std::cos(ProfAng) * Blind(BlNum).SlatSeparation / Blind(BlNum).SlatWidth); // There are two solutions for the slat angle that just blocks beam radiation ThetaBlock1 = ProfAng + ThetaBase; - ThetaBlock2 = ProfAng + Pi - ThetaBase; + ThetaBlock2 = ProfAng + DataGlobalConstants::Pi() - ThetaBase; ThetaSmall = min(ThetaBlock1, ThetaBlock2); ThetaBig = max(ThetaBlock1, ThetaBlock2); - ThetaMin = Blind(BlNum).MinSlatAngle * DegToRadians; - ThetaMax = Blind(BlNum).MaxSlatAngle * DegToRadians; + ThetaMin = Blind(BlNum).MinSlatAngle * DataGlobalConstants::DegToRadians(); + ThetaMax = Blind(BlNum).MaxSlatAngle * DataGlobalConstants::DegToRadians(); } // TH 5/20/2010, CR 8064: Slat Width <= Slat Separation @@ -10278,12 +10278,12 @@ namespace SolarShading { // There are two solutions for the slat angle that just blocks beam radiation ThetaBlock1 = ProfAng + ThetaBase; - ThetaBlock2 = ProfAng - ThetaBase + Pi; + ThetaBlock2 = ProfAng - ThetaBase + DataGlobalConstants::Pi(); ThetaSmall = min(ThetaBlock1, ThetaBlock2); ThetaBig = max(ThetaBlock1, ThetaBlock2); - ThetaMin = Blind(BlNum).MinSlatAngle * DegToRadians; - ThetaMax = Blind(BlNum).MaxSlatAngle * DegToRadians; + ThetaMin = Blind(BlNum).MinSlatAngle * DataGlobalConstants::DegToRadians(); + ThetaMax = Blind(BlNum).MaxSlatAngle * DataGlobalConstants::DegToRadians(); } } @@ -10301,7 +10301,7 @@ namespace SolarShading { WindowShadingControl(IShadingCtrl).SlatAngleSchedule); SurfWinSlatAngThisTS(ISurf) = max(Blind(BlNum).MinSlatAngle, min(SurfWinSlatAngThisTS(ISurf), - Blind(BlNum).MaxSlatAngle)) * DegToRadians; + Blind(BlNum).MaxSlatAngle)) * DataGlobalConstants::DegToRadians(); if ((SurfWinSlatAngThisTS(ISurf) <= ThetaSmall || SurfWinSlatAngThisTS(ISurf) >= ThetaBig) && (Blind(BlNum).SlatWidth > Blind(BlNum).SlatSeparation) && (BeamSolarOnWindow > 0.0)) @@ -10349,10 +10349,10 @@ namespace SolarShading { } } - SurfWinSlatAngThisTSDeg(ISurf) = SurfWinSlatAngThisTS(ISurf) / DegToRadians; + SurfWinSlatAngThisTSDeg(ISurf) = SurfWinSlatAngThisTS(ISurf) / DataGlobalConstants::DegToRadians(); if (SurfWinSlatAngThisTSDegEMSon(ISurf)) { SurfWinSlatAngThisTSDeg(ISurf) = SurfWinSlatAngThisTSDegEMSValue(ISurf); - SurfWinSlatAngThisTS(ISurf) = DegToRadians * SurfWinSlatAngThisTSDeg(ISurf); + SurfWinSlatAngThisTS(ISurf) = DataGlobalConstants::DegToRadians() * SurfWinSlatAngThisTSDeg(ISurf); } // Air flow permeability for calculation of convective air flow between blind and glass SlatAng = SurfWinSlatAngThisTS(ISurf); @@ -10749,7 +10749,7 @@ namespace SolarShading { Real64 dot2; Real64 dot3; - ElevSun = PiOvr2 - std::acos(SolCosVec.z); + ElevSun = DataGlobalConstants::PiOvr2() - std::acos(SolCosVec.z); AzimSun = std::atan2(SolCosVec.x, SolCosVec.y); Real64 const cos_ElevSun = std::cos(ElevSun); @@ -10768,8 +10768,8 @@ namespace SolarShading { SurfWinProfileAngVert(SurfNum) = 0.0; if (CosIncAng(TimeStep, HourOfDay, SurfNum) <= 0.0) continue; - ElevWin = PiOvr2 - Surface(SurfNum).Tilt * DegToRadians; - AzimWin = Surface(SurfNum).Azimuth * DegToRadians; + ElevWin = DataGlobalConstants::PiOvr2() - Surface(SurfNum).Tilt * DataGlobalConstants::DegToRadians(); + AzimWin = Surface(SurfNum).Azimuth * DataGlobalConstants::DegToRadians(); ProfileAngHor = std::atan(sin_ElevSun / std::abs(cos_ElevSun * std::cos(AzimWin - AzimSun))) - ElevWin; @@ -10779,7 +10779,7 @@ namespace SolarShading { // ProfileAngVert = ABS(AzimWin-AzimSun) // ELSE WinNorm = Surface(SurfNum).OutNormVec; - ThWin = AzimWin - PiOvr2; + ThWin = AzimWin - DataGlobalConstants::PiOvr2(); Real64 const sin_Elevwin(std::sin(ElevWin)); WinNormCrossBase.x = -(sin_Elevwin * std::cos(ThWin)); WinNormCrossBase.y = sin_Elevwin * std::sin(ThWin); @@ -10797,10 +10797,10 @@ namespace SolarShading { ProfileAngVert = std::abs(std::acos(dot3)); // END IF // Constrain to 0 to pi - if (ProfileAngVert > Pi) ProfileAngVert = TwoPi - ProfileAngVert; + if (ProfileAngVert > DataGlobalConstants::Pi()) ProfileAngVert = DataGlobalConstants::TwoPi() - ProfileAngVert; - SurfWinProfileAngHor(SurfNum) = ProfileAngHor / DegToRadians; - SurfWinProfileAngVert(SurfNum) = ProfileAngVert / DegToRadians; + SurfWinProfileAngHor(SurfNum) = ProfileAngHor / DataGlobalConstants::DegToRadians(); + SurfWinProfileAngVert(SurfNum) = ProfileAngVert / DataGlobalConstants::DegToRadians(); SurfWinTanProfileAngHor(SurfNum) = std::abs(std::tan(ProfileAngHor)); SurfWinTanProfileAngVert(SurfNum) = std::abs(std::tan(ProfileAngVert)); } @@ -10915,9 +10915,9 @@ namespace SolarShading { DivProjIn = FrameDivider(FrDivNum).DividerProjectionIn; GlArea = Surface(SurfNum).Area; - ElevWin = PiOvr2 - Surface(SurfNum).Tilt * DegToRadians; - ElevSun = PiOvr2 - std::acos(SUNCOS(3)); - AzimWin = Surface(SurfNum).Azimuth * DegToRadians; + ElevWin = DataGlobalConstants::PiOvr2() - Surface(SurfNum).Tilt * DataGlobalConstants::DegToRadians(); + ElevSun = DataGlobalConstants::PiOvr2() - std::acos(SUNCOS(3)); + AzimWin = Surface(SurfNum).Azimuth * DataGlobalConstants::DegToRadians(); AzimSun = std::atan2(SUNCOS(1), SUNCOS(2)); ProfileAngHor = std::atan(std::sin(ElevSun) / std::abs(std::cos(ElevSun) * std::cos(AzimWin - AzimSun))) - ElevWin; @@ -10925,7 +10925,7 @@ namespace SolarShading { ProfileAngVert = std::abs(AzimWin - AzimSun); } else { WinNorm = Surface(SurfNum).OutNormVec; - ThWin = AzimWin - PiOvr2; + ThWin = AzimWin - DataGlobalConstants::PiOvr2(); WinNormCrossBase(1) = -std::sin(ElevWin) * std::cos(ThWin); WinNormCrossBase(2) = std::sin(ElevWin) * std::sin(ThWin); WinNormCrossBase(3) = std::cos(ElevWin); @@ -10933,7 +10933,7 @@ namespace SolarShading { ProfileAngVert = std::abs(std::acos(dot(WinNorm, SunPrime) / magnitude(SunPrime))); } // Constrain to 0 to pi - if (ProfileAngVert > Pi) ProfileAngVert = 2 * Pi - ProfileAngVert; + if (ProfileAngVert > DataGlobalConstants::Pi()) ProfileAngVert = 2 * DataGlobalConstants::Pi() - ProfileAngVert; TanProfileAngHor = std::abs(std::tan(ProfileAngHor)); TanProfileAngVert = std::abs(std::tan(ProfileAngVert)); @@ -11401,12 +11401,12 @@ namespace SolarShading { if (L1 == 0.0) { FracToGlassOuts = 0.0; } else { - FracToGlassOuts = 0.5 * (1.0 - std::atan(FrameWidth / L1) / PiOvr2); + FracToGlassOuts = 0.5 * (1.0 - std::atan(FrameWidth / L1) / DataGlobalConstants::PiOvr2()); } if (L2 == 0.0) { FracToGlassIns = 0.0; } else { - FracToGlassIns = 0.5 * (1.0 - std::atan(FrameWidth / L2) / PiOvr2); + FracToGlassIns = 0.5 * (1.0 - std::atan(FrameWidth / L2) / DataGlobalConstants::PiOvr2()); } } // End of check if window has frame diff --git a/src/EnergyPlus/SurfaceGeometry.cc b/src/EnergyPlus/SurfaceGeometry.cc index 6374dd77c5d..1ed22db7b18 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -420,12 +420,12 @@ namespace SurfaceGeometry { // as setting up DaylightingCoords // these include building north axis and Building Rotation for Appendix G - CosBldgRelNorth = std::cos(-(BuildingAzimuth + BuildingRotationAppendixG) * DegToRadians); - SinBldgRelNorth = std::sin(-(BuildingAzimuth + BuildingRotationAppendixG) * DegToRadians); + CosBldgRelNorth = std::cos(-(BuildingAzimuth + BuildingRotationAppendixG) * DataGlobalConstants::DegToRadians()); + SinBldgRelNorth = std::sin(-(BuildingAzimuth + BuildingRotationAppendixG) * DataGlobalConstants::DegToRadians()); // these are only for Building Rotation for Appendix G when using world coordinate system - CosBldgRotAppGonly = std::cos(-BuildingRotationAppendixG * DegToRadians); - SinBldgRotAppGonly = std::sin(-BuildingRotationAppendixG * DegToRadians); + CosBldgRotAppGonly = std::cos(-BuildingRotationAppendixG * DataGlobalConstants::DegToRadians()); + SinBldgRotAppGonly = std::sin(-BuildingRotationAppendixG * DataGlobalConstants::DegToRadians()); CosZoneRelNorth.allocate(NumOfZones); SinZoneRelNorth.allocate(NumOfZones); @@ -435,8 +435,8 @@ namespace SurfaceGeometry { for (ZoneNum = 1; ZoneNum <= NumOfZones; ++ZoneNum) { - CosZoneRelNorth(ZoneNum) = std::cos(-Zone(ZoneNum).RelNorth * DegToRadians); - SinZoneRelNorth(ZoneNum) = std::sin(-Zone(ZoneNum).RelNorth * DegToRadians); + CosZoneRelNorth(ZoneNum) = std::cos(-Zone(ZoneNum).RelNorth * DataGlobalConstants::DegToRadians()); + SinZoneRelNorth(ZoneNum) = std::sin(-Zone(ZoneNum).RelNorth * DataGlobalConstants::DegToRadians()); } GetSurfaceData(state, ErrorsFound); @@ -1314,10 +1314,10 @@ namespace SurfaceGeometry { SurfaceTmp(CurNewSurf).Tilt = SurfTilt; // Sine and cosine of azimuth and tilt - SurfaceTmp(CurNewSurf).SinAzim = std::sin(SurfWorldAz * DegToRadians); - SurfaceTmp(CurNewSurf).CosAzim = std::cos(SurfWorldAz * DegToRadians); - SurfaceTmp(CurNewSurf).SinTilt = std::sin(SurfTilt * DegToRadians); - SurfaceTmp(CurNewSurf).CosTilt = std::cos(SurfTilt * DegToRadians); + SurfaceTmp(CurNewSurf).SinAzim = std::sin(SurfWorldAz * DataGlobalConstants::DegToRadians()); + SurfaceTmp(CurNewSurf).CosAzim = std::cos(SurfWorldAz * DataGlobalConstants::DegToRadians()); + SurfaceTmp(CurNewSurf).SinTilt = std::sin(SurfTilt * DataGlobalConstants::DegToRadians()); + SurfaceTmp(CurNewSurf).CosTilt = std::cos(SurfTilt * DataGlobalConstants::DegToRadians()); // Outward normal unit vector (pointing away from room) SurfaceTmp(CurNewSurf).OutNormVec = SurfaceTmp(CurNewSurf).NewellSurfaceNormalVector; for (n = 1; n <= 3; ++n) { @@ -3875,10 +3875,10 @@ namespace SurfaceGeometry { SurfAzimuth = SurfaceTmp(SurfNum).Azimuth; SurfTilt = SurfaceTmp(SurfNum).Tilt; - CosSurfAzimuth = std::cos(SurfAzimuth * DegToRadians); - SinSurfAzimuth = std::sin(SurfAzimuth * DegToRadians); - CosSurfTilt = std::cos(SurfTilt * DegToRadians); - SinSurfTilt = std::sin(SurfTilt * DegToRadians); + CosSurfAzimuth = std::cos(SurfAzimuth * DataGlobalConstants::DegToRadians()); + SinSurfAzimuth = std::sin(SurfAzimuth * DataGlobalConstants::DegToRadians()); + CosSurfTilt = std::cos(SurfTilt * DataGlobalConstants::DegToRadians()); + SinSurfTilt = std::sin(SurfTilt * DataGlobalConstants::DegToRadians()); if (!SurfWorldCoordSystem) { if (SurfaceTmp(SurfNum).Zone > 0) { Xb = XCoord * CosZoneRelNorth(SurfaceTmp(SurfNum).Zone) - YCoord * SinZoneRelNorth(SurfaceTmp(SurfNum).Zone) + @@ -5152,10 +5152,10 @@ namespace SurfaceGeometry { SurfAzimuth = SurfaceTmp(SurfNum).Azimuth; SurfTilt = SurfaceTmp(SurfNum).Tilt; - CosSurfAzimuth = std::cos(SurfAzimuth * DegToRadians); - SinSurfAzimuth = std::sin(SurfAzimuth * DegToRadians); - CosSurfTilt = std::cos(SurfTilt * DegToRadians); - SinSurfTilt = std::sin(SurfTilt * DegToRadians); + CosSurfAzimuth = std::cos(SurfAzimuth * DataGlobalConstants::DegToRadians()); + SinSurfAzimuth = std::sin(SurfAzimuth * DataGlobalConstants::DegToRadians()); + CosSurfTilt = std::cos(SurfTilt * DataGlobalConstants::DegToRadians()); + SinSurfTilt = std::sin(SurfTilt * DataGlobalConstants::DegToRadians()); BaseCosSurfAzimuth = SurfaceTmp(BaseSurfNum).CosAzim; BaseSinSurfAzimuth = SurfaceTmp(BaseSurfNum).SinAzim; BaseCosSurfTilt = SurfaceTmp(BaseSurfNum).CosTilt; @@ -5698,10 +5698,10 @@ namespace SurfaceGeometry { YLLC = -Xp * SurfaceTmp(BaseSurfNum).SinAzim * SurfaceTmp(BaseSurfNum).CosTilt - Yp * SurfaceTmp(BaseSurfNum).CosAzim * SurfaceTmp(BaseSurfNum).CosTilt + Zp * SurfaceTmp(BaseSurfNum).SinTilt; - SurfaceTmp(SurfNum).CosAzim = std::cos(SurfaceTmp(SurfNum).Azimuth * DegToRadians); - SurfaceTmp(SurfNum).SinAzim = std::sin(SurfaceTmp(SurfNum).Azimuth * DegToRadians); - SurfaceTmp(SurfNum).CosTilt = std::cos(SurfaceTmp(SurfNum).Tilt * DegToRadians); - SurfaceTmp(SurfNum).SinTilt = std::sin(SurfaceTmp(SurfNum).Tilt * DegToRadians); + SurfaceTmp(SurfNum).CosAzim = std::cos(SurfaceTmp(SurfNum).Azimuth * DataGlobalConstants::DegToRadians()); + SurfaceTmp(SurfNum).SinAzim = std::sin(SurfaceTmp(SurfNum).Azimuth * DataGlobalConstants::DegToRadians()); + SurfaceTmp(SurfNum).CosTilt = std::cos(SurfaceTmp(SurfNum).Tilt * DataGlobalConstants::DegToRadians()); + SurfaceTmp(SurfNum).SinTilt = std::sin(SurfaceTmp(SurfNum).Tilt * DataGlobalConstants::DegToRadians()); SurfaceTmp(SurfNum).Sides = 4; SurfaceTmp(SurfNum).Vertex.allocate(SurfaceTmp(SurfNum).Sides); @@ -5785,10 +5785,10 @@ namespace SurfaceGeometry { TiltAngle = SurfaceTmp(Found).Tilt; SurfaceTmp(SurfNum).Tilt = TiltAngle; SurfaceTmp(SurfNum).Azimuth = SurfaceTmp(Found).Azimuth - (180.0 - rNumericArgs(9)); - SurfaceTmp(SurfNum).CosAzim = std::cos(SurfaceTmp(SurfNum).Azimuth * DegToRadians); - SurfaceTmp(SurfNum).SinAzim = std::sin(SurfaceTmp(SurfNum).Azimuth * DegToRadians); - SurfaceTmp(SurfNum).CosTilt = std::cos(SurfaceTmp(SurfNum).Tilt * DegToRadians); - SurfaceTmp(SurfNum).SinTilt = std::sin(SurfaceTmp(SurfNum).Tilt * DegToRadians); + SurfaceTmp(SurfNum).CosAzim = std::cos(SurfaceTmp(SurfNum).Azimuth * DataGlobalConstants::DegToRadians()); + SurfaceTmp(SurfNum).SinAzim = std::sin(SurfaceTmp(SurfNum).Azimuth * DataGlobalConstants::DegToRadians()); + SurfaceTmp(SurfNum).CosTilt = std::cos(SurfaceTmp(SurfNum).Tilt * DataGlobalConstants::DegToRadians()); + SurfaceTmp(SurfNum).SinTilt = std::sin(SurfaceTmp(SurfNum).Tilt * DataGlobalConstants::DegToRadians()); SurfaceTmp(SurfNum).Sides = 4; SurfaceTmp(SurfNum).Vertex.allocate(SurfaceTmp(SurfNum).Sides); @@ -7791,10 +7791,10 @@ namespace SurfaceGeometry { SurfaceTmp(SurfNum).Tilt = SurfTilt; // Sine and cosine of azimuth and tilt - SurfaceTmp(SurfNum).SinAzim = std::sin(SurfWorldAz * DegToRadians); - SurfaceTmp(SurfNum).CosAzim = std::cos(SurfWorldAz * DegToRadians); - SurfaceTmp(SurfNum).SinTilt = std::sin(SurfTilt * DegToRadians); - SurfaceTmp(SurfNum).CosTilt = std::cos(SurfTilt * DegToRadians); + SurfaceTmp(SurfNum).SinAzim = std::sin(SurfWorldAz * DataGlobalConstants::DegToRadians()); + SurfaceTmp(SurfNum).CosAzim = std::cos(SurfWorldAz * DataGlobalConstants::DegToRadians()); + SurfaceTmp(SurfNum).SinTilt = std::sin(SurfTilt * DataGlobalConstants::DegToRadians()); + SurfaceTmp(SurfNum).CosTilt = std::cos(SurfTilt * DataGlobalConstants::DegToRadians()); if (SurfaceTmp(SurfNum).ViewFactorGround == AutoCalculate) { SurfaceTmp(SurfNum).ViewFactorGround = 0.5 * (1.0 - SurfaceTmp(SurfNum).CosTilt); } @@ -8040,10 +8040,10 @@ namespace SurfaceGeometry { SurfaceTmp(SurfNum).Tilt = SurfTilt; // Sine and cosine of azimuth and tilt - SurfaceTmp(SurfNum).SinAzim = std::sin(SurfWorldAz * DegToRadians); - SurfaceTmp(SurfNum).CosAzim = std::cos(SurfWorldAz * DegToRadians); - SurfaceTmp(SurfNum).SinTilt = std::sin(SurfTilt * DegToRadians); - SurfaceTmp(SurfNum).CosTilt = std::cos(SurfTilt * DegToRadians); + SurfaceTmp(SurfNum).SinAzim = std::sin(SurfWorldAz * DataGlobalConstants::DegToRadians()); + SurfaceTmp(SurfNum).CosAzim = std::cos(SurfWorldAz * DataGlobalConstants::DegToRadians()); + SurfaceTmp(SurfNum).SinTilt = std::sin(SurfTilt * DataGlobalConstants::DegToRadians()); + SurfaceTmp(SurfNum).CosTilt = std::cos(SurfTilt * DataGlobalConstants::DegToRadians()); // Outward normal unit vector (pointing away from room) SurfaceTmp(SurfNum).OutNormVec = SurfaceTmp(SurfNum).NewellSurfaceNormalVector; for (n = 1; n <= 3; ++n) { @@ -11092,10 +11092,10 @@ namespace SurfaceGeometry { // Retrieve base surface info Real64 const baseSurfWorldAz = Surface(ThisBaseSurface).Azimuth; Real64 const baseSurfTilt = Surface(ThisBaseSurface).Tilt; - Real64 const BaseCosAzimuth = std::cos(baseSurfWorldAz * DegToRadians); - Real64 const BaseSinAzimuth = std::sin(baseSurfWorldAz * DegToRadians); - Real64 const BaseCosTilt = std::cos(baseSurfTilt * DegToRadians); - Real64 const BaseSinTilt = std::sin(baseSurfTilt * DegToRadians); + Real64 const BaseCosAzimuth = std::cos(baseSurfWorldAz * DataGlobalConstants::DegToRadians()); + Real64 const BaseSinAzimuth = std::sin(baseSurfWorldAz * DataGlobalConstants::DegToRadians()); + Real64 const BaseCosTilt = std::cos(baseSurfTilt * DataGlobalConstants::DegToRadians()); + Real64 const BaseSinTilt = std::sin(baseSurfTilt * DataGlobalConstants::DegToRadians()); Real64 const BaseXLLC = Surface(ThisBaseSurface).Vertex(2).x; Real64 const BaseYLLC = Surface(ThisBaseSurface).Vertex(2).y; Real64 const BaseZLLC = Surface(ThisBaseSurface).Vertex(2).z; @@ -13429,7 +13429,7 @@ namespace SurfaceGeometry { Real64 Diagonal1; // Length of diagonal of 4-sided figure from vertex 1 to vertex 3 (m) Real64 Diagonal2; // Length of diagonal of 4-sided figure from vertex 2 to vertex 4 (m) Real64 DotProd; // Dot product of two adjacent sides - to test for right angle - Real64 const cos89deg = std::cos(89.0 * DegToRadians); // tolerance for right angle + Real64 const cos89deg = std::cos(89.0 * DataGlobalConstants::DegToRadians()); // tolerance for right angle Vector Vect32; // normalized vector from vertex 3 to vertex 2 Vector Vect21; // normalized vector from vertex 2 to vertex 1 @@ -13500,10 +13500,10 @@ namespace SurfaceGeometry { SurfWorldAz = Surface(SurfNum).Azimuth; SurfTilt = Surface(SurfNum).Tilt; - BaseCosAzimuth = std::cos(SurfWorldAz * DegToRadians); - BaseSinAzimuth = std::sin(SurfWorldAz * DegToRadians); - BaseCosTilt = std::cos(SurfTilt * DegToRadians); - BaseSinTilt = std::sin(SurfTilt * DegToRadians); + BaseCosAzimuth = std::cos(SurfWorldAz * DataGlobalConstants::DegToRadians()); + BaseSinAzimuth = std::sin(SurfWorldAz * DataGlobalConstants::DegToRadians()); + BaseCosTilt = std::cos(SurfTilt * DataGlobalConstants::DegToRadians()); + BaseSinTilt = std::sin(SurfTilt * DataGlobalConstants::DegToRadians()); NumSurfSides = Surface(SurfNum).Sides; // Calculate WidthMax and HeightMax diff --git a/src/EnergyPlus/SurfaceGroundHeatExchanger.cc b/src/EnergyPlus/SurfaceGroundHeatExchanger.cc index 5929c64b31c..9dc6c62246f 100644 --- a/src/EnergyPlus/SurfaceGroundHeatExchanger.cc +++ b/src/EnergyPlus/SurfaceGroundHeatExchanger.cc @@ -485,7 +485,6 @@ namespace SurfaceGroundHeatExchanger { // Using/Aliasing using DataGlobals::BeginEnvrnFlag; - using DataGlobals::Pi; using namespace DataEnvironment; using DataHeatBalance::TotConstructs; using DataLoopNode::Node; @@ -522,7 +521,7 @@ namespace SurfaceGroundHeatExchanger { ShowFatalError("InitSurfaceGroundHeatExchanger: Program terminated due to previous condition(s)."); } rho = GetDensityGlycol(state, PlantLoop(this->LoopNum).FluidName, constant_zero, PlantLoop(this->LoopNum).FluidIndex, RoutineName); - this->DesignMassFlowRate = Pi / 4.0 * pow_2(this->TubeDiameter) * DesignVelocity * rho * this->TubeCircuits; + this->DesignMassFlowRate = DataGlobalConstants::Pi() / 4.0 * pow_2(this->TubeDiameter) * DesignVelocity * rho * this->TubeCircuits; InitComponentNodes(0.0, this->DesignMassFlowRate, this->InletNodeNum, @@ -1124,7 +1123,6 @@ namespace SurfaceGroundHeatExchanger { // Code based loosely on code from IBLAST program (research version) // Using/Aliasing - using DataGlobals::Pi; using DataPlant::PlantLoop; using FluidProperties::GetSpecificHeatGlycol; using General::RoundSigDigits; @@ -1213,7 +1211,7 @@ namespace SurfaceGroundHeatExchanger { CpWater = GetSpecificHeatGlycol(state, PlantLoop(this->LoopNum).FluidName, Temperature, PlantLoop(this->LoopNum).FluidIndex, RoutineName); // Calculate the Reynold's number from RE=(4*Mdot)/(Pi*Mu*Diameter) - ReD = 4.0 * WaterMassFlow / (Pi * MUactual * this->TubeDiameter * this->TubeCircuits); + ReD = 4.0 * WaterMassFlow / (DataGlobalConstants::Pi() * MUactual * this->TubeDiameter * this->TubeCircuits); // Calculate the Nusselt number based on what flow regime one is in if (ReD >= MaxLaminarRe) { // Turbulent flow --> use Colburn equation @@ -1229,7 +1227,7 @@ namespace SurfaceGroundHeatExchanger { PipeLength = this->SurfaceLength * this->SurfaceWidth / this->TubeSpacing; - NTU = Pi * Kactual * NuD * PipeLength / (WaterMassFlow * CpWater); + NTU = DataGlobalConstants::Pi() * Kactual * NuD * PipeLength / (WaterMassFlow * CpWater); // Calculate Epsilon*MassFlowRate*Cp if (-NTU >= EXP_LowerLimit) { CalcHXEffectTerm = (1.0 - std::exp(-NTU)) * WaterMassFlow * CpWater; diff --git a/src/EnergyPlus/TARCOGArgs.cc b/src/EnergyPlus/TARCOGArgs.cc index 0adcde255e6..983ee7287a3 100644 --- a/src/EnergyPlus/TARCOGArgs.cc +++ b/src/EnergyPlus/TARCOGArgs.cc @@ -83,7 +83,6 @@ namespace TARCOGArgs { // USE STATEMENTS: // Using/Aliasing - using DataGlobals::Pi; using DataGlobals::StefanBoltzmann; using namespace TARCOGCommon; using namespace TARCOGGassesParams; @@ -664,14 +663,14 @@ namespace TARCOGArgs { if (ThermalMod == THERM_MOD_SCW) { // bi...the idea here is to have glass-to-glass width the same as before scaling // bi...TODO: check for outdoor and indoor blinds! SCW model is only applicable to in-between SDs!!! - thick(i) = SlatWidth(i) * std::cos(SlatAngle(i) * Pi / 180.0); + thick(i) = SlatWidth(i) * std::cos(SlatAngle(i) * DataGlobalConstants::Pi() / 180.0); if (i > 1) gap(i - 1) += (1.0 - SDScalar) / 2.0 * thick(i); // Autodesk:BoundsViolation gap(i-1) @ i=1: Added if condition gap(i) += (1.0 - SDScalar) / 2.0 * thick(i); thick(i) *= SDScalar; if (thick(i) < SlatThick(i)) thick(i) = SlatThick(i); } else if ((ThermalMod == THERM_MOD_ISO15099) || (ThermalMod == THERM_MOD_CSM)) { thick(i) = SlatThick(i); - const Real64 slatAngRad = SlatAngle(i) * 2.0 * DataGlobals::Pi / 360.0; + const Real64 slatAngRad = SlatAngle(i) * 2.0 * DataGlobalConstants::Pi() / 360.0; Real64 C4_VENET(0); if (LayerType(i) == VENETBLIND_HORIZ) { C4_VENET = C4_VENET_HORIZONTAL; @@ -686,7 +685,7 @@ namespace TARCOGArgs { hint = hin; houtt = hout; - tiltr = tilt * 2.0 * DataGlobals::Pi / 360.0; // convert tilt in degrees to radians + tiltr = tilt * 2.0 * DataGlobalConstants::Pi() / 360.0; // convert tilt in degrees to radians // external radiation term { diff --git a/src/EnergyPlus/TARCOGCommon.cc b/src/EnergyPlus/TARCOGCommon.cc index 84cdc03967e..af9aa8e4746 100644 --- a/src/EnergyPlus/TARCOGCommon.cc +++ b/src/EnergyPlus/TARCOGCommon.cc @@ -102,7 +102,6 @@ namespace TARCOGCommon { // Height - glazing system height // Using/Aliasing - using DataGlobals::PiOvr2; using namespace TARCOGParams; // use TARCOGGassesParams @@ -115,10 +114,10 @@ namespace TARCOGCommon { LDSumMax = 0.0; for (i = 1; i <= mmax; i += 2) { - Real64 const sin_i(std::sin(i * PiOvr2)); + Real64 const sin_i(std::sin(i * DataGlobalConstants::PiOvr2())); Real64 const pow_i_W(pow_2(i / Width)); for (j = 1; j <= nmax; j += 2) { - LDSumMax += (sin_i * std::sin(j * PiOvr2)) / (i * j * pow_2(pow_i_W + pow_2(j / Height))); + LDSumMax += (sin_i * std::sin(j * DataGlobalConstants::PiOvr2())) / (i * j * pow_2(pow_i_W + pow_2(j / Height))); } // do j = 1, nmax, 2 } // do i = 1, mmax, 2 @@ -132,7 +131,6 @@ namespace TARCOGCommon { // Height - glazing system height // Using/Aliasing - using DataGlobals::Pi; using namespace TARCOGParams; // use TARCOGGassesParams @@ -140,7 +138,7 @@ namespace TARCOGCommon { Real64 LDSumMean; // Locals - static Real64 const Pi_squared(Pi * Pi); + static Real64 const Pi_squared(DataGlobalConstants::Pi() * DataGlobalConstants::Pi()); int i; int j; diff --git a/src/EnergyPlus/TARCOGDeflection.cc b/src/EnergyPlus/TARCOGDeflection.cc index ce04e7d1739..62211bf1d3d 100644 --- a/src/EnergyPlus/TARCOGDeflection.cc +++ b/src/EnergyPlus/TARCOGDeflection.cc @@ -197,7 +197,7 @@ namespace TARCOGDeflection { // OUTPUT // Static constants - static Real64 const Pi_6(pow_6(Pi)); + static Real64 const Pi_6(pow_6(DataGlobalConstants::Pi())); // localy used Array1D DPressure(maxlay); // delta pressure at each glazing layer diff --git a/src/EnergyPlus/TARCOGGasses90.cc b/src/EnergyPlus/TARCOGGasses90.cc index 31e1abdaa2d..a7594586525 100644 --- a/src/EnergyPlus/TARCOGGasses90.cc +++ b/src/EnergyPlus/TARCOGGasses90.cc @@ -296,7 +296,7 @@ namespace TARCOGGasses90 { return; } - B = alpha * (gama + 1) / (gama - 1) * std::sqrt(UniversalGasConst / (8 * Pi * mwght * tmean)); + B = alpha * (gama + 1) / (gama - 1) * std::sqrt(UniversalGasConst / (8 * DataGlobalConstants::Pi() * mwght * tmean)); cond = B * pressure; } diff --git a/src/EnergyPlus/TarcogShading.cc b/src/EnergyPlus/TarcogShading.cc index 51899a8565c..0a63cbead67 100644 --- a/src/EnergyPlus/TarcogShading.cc +++ b/src/EnergyPlus/TarcogShading.cc @@ -610,10 +610,7 @@ namespace TarcogShading { //************************************************************************************************************** // Using/Aliasing - using DataGlobals::GravityConstant; using DataGlobals::KelvinConv; - using DataGlobals::Pi; - // Argument array dimensioning EP_SIZE_CHECK(iprop1, maxgas); EP_SIZE_CHECK(frct1, maxgas); @@ -681,7 +678,7 @@ namespace TarcogShading { TGapOld1 = 0.0; TGapOld2 = 0.0; - tilt = Pi / 180 * (angle - 90); + tilt = DataGlobalConstants::Pi() / 180 * (angle - 90); T0 = 0.0 + KelvinConv; A1eqin = 0.0; A2eqout = 0.0; @@ -723,7 +720,7 @@ namespace TarcogShading { // A = dens0 * T0 * GravityConstant * ABS(cos(tilt)) * ABS(Tgap1 - Tgap2) / (Tgap1 * Tgap2) // bi...Bug fix #00005: - A = dens0 * T0 * GravityConstant * H * std::abs(cos_Tilt) * std::abs(Tgap1 - Tgap2) / (Tgap1 * Tgap2); + A = dens0 * T0 * DataGlobalConstants::GravityConstant() * H * std::abs(cos_Tilt) * std::abs(Tgap1 - Tgap2) / (Tgap1 * Tgap2); if (A == 0.0) { qv1 = 0.0; @@ -907,10 +904,7 @@ namespace TarcogShading { //************************************************************************************************************** // Using/Aliasing - using DataGlobals::GravityConstant; using DataGlobals::KelvinConv; - using DataGlobals::Pi; - // Argument array dimensioning EP_SIZE_CHECK(iprop1, maxgas); EP_SIZE_CHECK(frct1, maxgas); @@ -955,7 +949,7 @@ namespace TarcogShading { Real64 TGapOld; bool converged; - tilt = Pi / 180.0 * (angle - 90.0); + tilt = DataGlobalConstants::Pi() / 180.0 * (angle - 90.0); T0 = 0.0 + KelvinConv; GASSES90(T0, iprop1, frct1, press1, nmix1, xwght, xgcon, xgvis, xgcp, con0, visc0, dens0, cp0, pr0, 1, nperr, ErrorMessage); @@ -996,7 +990,7 @@ namespace TarcogShading { // A = dens0 * T0 * gravity * ABS(cos(tilt)) * ABS(Tgap - Tenv) / (Tgap * Tenv) // bi...Bug fix #00005: - A = dens0 * T0 * GravityConstant * H * abs_cos_tilt * std::abs(Tgap - Tenv) / (Tgap * Tenv); + A = dens0 * T0 * DataGlobalConstants::GravityConstant() * H * abs_cos_tilt * std::abs(Tgap - Tenv) / (Tgap * Tenv); // A = dens0 * T0 * GravityConstant * H * ABS(cos(tilt)) * (Tgap - Tenv) / (Tgap * Tenv) B1 = dens2 / 2; @@ -1087,7 +1081,7 @@ namespace TarcogShading { { for (int i = 1; i <= nlayer; ++i) { if (LayerType(i) == VENETBLIND_HORIZ || LayerType(i) == VENETBLIND_VERT) { - const Real64 slatAngRad = SlatAngle(i) * 2 * DataGlobals::Pi / 360; + const Real64 slatAngRad = SlatAngle(i) * 2 * DataGlobalConstants::Pi() / 360; Real64 C1_VENET(0); Real64 C2_VENET(0); Real64 C3_VENET(0); diff --git a/src/EnergyPlus/ThermalEN673Calc.cc b/src/EnergyPlus/ThermalEN673Calc.cc index 5ddb90c6a38..4f9f35b57a9 100644 --- a/src/EnergyPlus/ThermalEN673Calc.cc +++ b/src/EnergyPlus/ThermalEN673Calc.cc @@ -260,7 +260,6 @@ namespace ThermalEN673Calc { std::string &ErrorMessage) { // Using - using DataGlobals::GravityConstant; using DataGlobals::StefanBoltzmann; // Argument array dimensioning @@ -410,7 +409,7 @@ namespace ThermalEN673Calc { standard, nperr, ErrorMessage); - Gr(i) = (GravityConstant * pow_3(gap(i)) * dT(i) * pow_2(dens)) / (Tm * pow_2(visc)); + Gr(i) = (DataGlobalConstants::GravityConstant() * pow_3(gap(i)) * dT(i) * pow_2(dens)) / (Tm * pow_2(visc)); Ra(i) = Gr(i) * pr; Nu(i) = A * std::pow(Ra(i), n); if (Nu(i) < 1.0) { @@ -478,7 +477,7 @@ namespace ThermalEN673Calc { standard, nperr, ErrorMessage); - Gr(i) = (GravityConstant * pow_3(gap(i)) * dT(i) * pow_2(dens)) / (Tm * pow_2(visc)); + Gr(i) = (DataGlobalConstants::GravityConstant() * pow_3(gap(i)) * dT(i) * pow_2(dens)) / (Tm * pow_2(visc)); Ra(i) = Gr(i) * pr; Nu(i) = A * std::pow(Ra(i), n); if (Nu(i) < 1.0) { diff --git a/src/EnergyPlus/ThermalISO15099Calc.cc b/src/EnergyPlus/ThermalISO15099Calc.cc index f22cb44e3a6..8cda1128228 100644 --- a/src/EnergyPlus/ThermalISO15099Calc.cc +++ b/src/EnergyPlus/ThermalISO15099Calc.cc @@ -2688,9 +2688,6 @@ namespace ThermalISO15099Calc { // If there is forced air in the room than use SPC142 corelation 5.49 to calculate the room side film coefficient. // Using - using DataGlobals::GravityConstant; - using DataGlobals::Pi; - // Argument array dimensioning iprop.dim(maxgas, maxlay1); frct.dim(maxgas, maxlay1); @@ -2729,7 +2726,7 @@ namespace ThermalISO15099Calc { } } } else { // main IF - else - tiltr = tilt * 2.0 * Pi / 360.0; // convert tilt in degrees to radians + tiltr = tilt * 2.0 * DataGlobalConstants::Pi() / 360.0; // convert tilt in degrees to radians tmean = tair + 0.25 * (t - tair); delt = std::abs(tair - t); @@ -2758,7 +2755,7 @@ namespace ThermalISO15099Calc { // Calculate grashoff number: // The grashoff number is the Rayleigh Number (equation 5.29) in SPC142 divided by the Prandtl Number (prand): - gr = GravityConstant * pow_3(height) * delt * pow_2(dens) / (tmean * pow_2(visc)); + gr = DataGlobalConstants::GravityConstant() * pow_3(height) * delt * pow_2(dens) / (tmean * pow_2(visc)); RaL = gr * pr; // write(*,*)' RaCrit,RaL,gr,pr ' @@ -2841,8 +2838,6 @@ namespace ThermalISO15099Calc { // delt temperature difference // Using - using DataGlobals::GravityConstant; - // Argument array dimensioning EP_SIZE_CHECK(theta, maxlay2); EP_SIZE_CHECK(Tgap, maxlay1); @@ -2900,7 +2895,7 @@ namespace ThermalISO15099Calc { // Calculate grashoff number: // The grashoff number is the Rayleigh Number (equation 5.29) in SPC142 divided by the Prandtl Number (prand): - ra = GravityConstant * pow_3(gap(i)) * delt * cp * pow_2(dens) / (tmean * visc * con); + ra = DataGlobalConstants::GravityConstant() * pow_3(gap(i)) * delt * cp * pow_2(dens) / (tmean * visc * con); Rayleigh(i) = ra; // write(*,*) 'height,gap(i),asp',height,gap(i),asp // asp = 1 @@ -2940,8 +2935,6 @@ namespace ThermalISO15099Calc { //*********************************************************************** // Using - using DataGlobals::Pi; - // Argument array dimensioning EP_SIZE_CHECK(SupportPillar, maxlay); EP_SIZE_CHECK(scon, maxlay); @@ -2972,7 +2965,7 @@ namespace ThermalISO15099Calc { // Average glass conductivity is taken as average from both glass surrounding gap aveGlassConductivity = (scon(i) + scon(i + 1)) / 2; - cpa = 2.0 * aveGlassConductivity * PillarRadius(i) / (pow_2(PillarSpacing(i)) * (1.0 + 2.0 * gap(i) / (Pi * PillarRadius(i)))); + cpa = 2.0 * aveGlassConductivity * PillarRadius(i) / (pow_2(PillarSpacing(i)) * (1.0 + 2.0 * gap(i) / (DataGlobalConstants::Pi() * PillarRadius(i)))); // It is important to add on prevoius values caluculated for gas hcgas(i + 1) += cpa; @@ -2994,8 +2987,6 @@ namespace ThermalISO15099Calc { // nperr // Using - using DataGlobals::Pi; - // Locals Real64 subNu1; Real64 subNu2; @@ -3015,7 +3006,7 @@ namespace ThermalISO15099Calc { Nu90 = 0.0; Nu60 = 0.0; G = 0.0; - tiltr = tilt * 2.0 * Pi / 360.0; // convert tilt in degrees to radians + tiltr = tilt * 2.0 * DataGlobalConstants::Pi() / 360.0; // convert tilt in degrees to radians if ((tilt >= 0.0) && (tilt < 60.0)) { // ISO/DIS 15099 - chapter 5.3.3.1 subNu1 = 1.0 - 1708.0 / (ra * std::cos(tiltr)); subNu1 = pos(subNu1); @@ -3175,8 +3166,6 @@ namespace ThermalISO15099Calc { //******************************************************************** // Using - using DataGlobals::GravityConstant; - // Argument array dimensioning EP_SIZE_CHECK(ibc, 2); EP_SIZE_CHECK(theta, maxlay2); @@ -3309,7 +3298,7 @@ namespace ThermalISO15099Calc { tmean, ipropg, frctg, presure(i + 1), nmix(i + 1), wght, gcon, gvis, gcp, con, visc, dens, cp, pr, ISO15099, nperr, ErrorMessage); gap_NOSD = gap(SDLayerIndex - 1) + gap(SDLayerIndex) + thick(SDLayerIndex); // determine the Rayleigh number: - rayl = GravityConstant * pow_3(gap_NOSD) * delt * cp * pow_2(dens) / (tmean * visc * con); + rayl = DataGlobalConstants::GravityConstant() * pow_3(gap_NOSD) * delt * cp * pow_2(dens) / (tmean * visc * con); asp = height / gap_NOSD; // determine the Nusselt number: nusselt(tilt, rayl, asp, gnu, nperr, ErrorMessage); diff --git a/src/EnergyPlus/TranspiredCollector.cc b/src/EnergyPlus/TranspiredCollector.cc index 0a561896ab6..5387e1651c5 100644 --- a/src/EnergyPlus/TranspiredCollector.cc +++ b/src/EnergyPlus/TranspiredCollector.cc @@ -112,7 +112,6 @@ namespace TranspiredCollector { // See EngineeringReference for details // Using/Aliasing - using DataGlobals::DegToRadians; using DataGlobals::KelvinConv; using DataGlobals::SecInHour; using DataHeatBalance::QRadSWOutIncident; @@ -258,7 +257,6 @@ namespace TranspiredCollector { // Using/Aliasing using namespace DataIPShortCuts; // Data for field names, blank numerics using BranchNodeConnections::TestCompSet; - using DataGlobals::Pi; using DataGlobals::ScheduleAlwaysOn; using DataHeatBalance::MediumRough; using DataHeatBalance::MediumSmooth; @@ -652,10 +650,10 @@ namespace TranspiredCollector { if (SELECT_CASE_var == Layout_Triangle) { // 'TRIANGLE' UTSC(Item).Porosity = 0.907 * pow_2(UTSC(Item).HoleDia / UTSC(Item).Pitch); // Kutscher equation, Triangle layout } else if (SELECT_CASE_var == Layout_Square) { // 'SQUARE' - UTSC(Item).Porosity = (Pi / 4.0) * pow_2(UTSC(Item).HoleDia) / pow_2(UTSC(Item).Pitch); // Waterloo equation, square layout + UTSC(Item).Porosity = (DataGlobalConstants::Pi() / 4.0) * pow_2(UTSC(Item).HoleDia) / pow_2(UTSC(Item).Pitch); // Waterloo equation, square layout } } - TiltRads = std::abs(AvgTilt) * DegToRadians; + TiltRads = std::abs(AvgTilt) * DataGlobalConstants::DegToRadians(); tempHdeltaNPL = std::sin(TiltRads) * UTSC(Item).Height / 4.0; UTSC(Item).HdeltaNPL = max(tempHdeltaNPL, UTSC(Item).PlenGapThick); diff --git a/src/EnergyPlus/UFADManager.cc b/src/EnergyPlus/UFADManager.cc index acce0ae715b..8677e8b99c2 100644 --- a/src/EnergyPlus/UFADManager.cc +++ b/src/EnergyPlus/UFADManager.cc @@ -1127,7 +1127,7 @@ namespace UFADManager { HeightComfort = ZoneUCSDUI(UINum).ComfortHeight; TempDiffCritRep = ZoneUCSDUI(UINum).TempTrigger; DiffArea = ZoneUCSDUI(UINum).DiffArea; - ThrowAngle = DegToRadians * ZoneUCSDUI(UINum).DiffAngle; + ThrowAngle = DataGlobalConstants::DegToRadians() * ZoneUCSDUI(UINum).DiffAngle; SourceHeight = 0.0; NumDiffusers = ZoneUCSDUI(UINum).DiffusersPerZone; PowerPerPlume = ZoneUCSDUI(UINum).PowerPerPlume; @@ -1605,7 +1605,7 @@ namespace UFADManager { HeightComfort = ZoneUCSDUE(UINum).ComfortHeight; TempDiffCritRep = ZoneUCSDUE(UINum).TempTrigger; DiffArea = ZoneUCSDUE(UINum).DiffArea; - ThrowAngle = DegToRadians * ZoneUCSDUE(UINum).DiffAngle; + ThrowAngle = DataGlobalConstants::DegToRadians() * ZoneUCSDUE(UINum).DiffAngle; SourceHeight = ZoneUCSDUE(UINum).HeatSrcHeight; NumDiffusers = ZoneUCSDUE(UINum).DiffusersPerZone; PowerPerPlume = ZoneUCSDUE(UINum).PowerPerPlume; diff --git a/src/EnergyPlus/Vectors.cc b/src/EnergyPlus/Vectors.cc index 5f885164245..8020796f172 100644 --- a/src/EnergyPlus/Vectors.cc +++ b/src/EnergyPlus/Vectors.cc @@ -102,7 +102,6 @@ namespace Vectors { // OTHER NOTES: none // Using/Aliasing - using DataGlobals::DegToRadians; using namespace DataVectorTypes; // MODULE PARAMETER DEFINITIONS @@ -414,11 +413,11 @@ namespace Vectors { } tlt = std::acos(NewellSurfaceNormalVector.z); - tlt /= DegToRadians; + tlt /= DataGlobalConstants::DegToRadians(); az = rotang_0; - az /= DegToRadians; + az /= DataGlobalConstants::DegToRadians(); az = mod(450.0 - az, 360.0); az += 90.0; if (az < 0.0) az += 360.0; diff --git a/src/EnergyPlus/VentilatedSlab.cc b/src/EnergyPlus/VentilatedSlab.cc index 338a9a7e650..8eaffcb0504 100644 --- a/src/EnergyPlus/VentilatedSlab.cc +++ b/src/EnergyPlus/VentilatedSlab.cc @@ -4335,8 +4335,6 @@ namespace VentilatedSlab { // Code based loosely on code from IBLAST program (research version) // Using/Aliasing - using DataGlobals::Pi; - // Return value Real64 CalcVentSlabHXEffectTerm; @@ -4405,7 +4403,7 @@ namespace VentilatedSlab { SysAirMassFlow = AirMassFlow / CoreNumbers; // Calculate the Reynold's number from RE=(4*Mdot)/(Pi*Mu*Diameter) - ReD = 4.0 * SysAirMassFlow * FlowFraction / (Pi * MUactual * CoreDiameter); + ReD = 4.0 * SysAirMassFlow * FlowFraction / (DataGlobalConstants::Pi() * MUactual * CoreDiameter); // Calculate the Nusselt number based on what flow regime one is in if (ReD >= MaxLaminarRe) { // Turbulent flow --> use Colburn equation @@ -4421,7 +4419,7 @@ namespace VentilatedSlab { // NTU = UA/[(Mdot*Cp)min] // where: U = h (convection coefficient) and h = (k)(Nu)/D // A = Pi*D*TubeLength - NTU = Pi * Kactual * NuD * CoreLength / (SysAirMassFlow * CpAppAir); // FlowFraction cancels out here + NTU = DataGlobalConstants::Pi() * Kactual * NuD * CoreLength / (SysAirMassFlow * CpAppAir); // FlowFraction cancels out here // Calculate Epsilon*MassFlowRate*Cp if (NTU > MaxExpPower) { diff --git a/src/EnergyPlus/WaterCoils.cc b/src/EnergyPlus/WaterCoils.cc index ec1500a79a9..a132b9c24be 100644 --- a/src/EnergyPlus/WaterCoils.cc +++ b/src/EnergyPlus/WaterCoils.cc @@ -1164,7 +1164,7 @@ namespace WaterCoils { // effective fin diameter for detailed flat fin coil if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilModel == state.dataWaterCoils->CoilModel_Detailed) { // 'DETAILED FLAT FIN' state.dataWaterCoils->WaterCoil(CoilNum).EffectiveFinDiam = std::sqrt(4.0 * state.dataWaterCoils->WaterCoil(CoilNum).FinDiam * state.dataWaterCoils->WaterCoil(CoilNum).CoilDepth / - (Pi * state.dataWaterCoils->WaterCoil(CoilNum).NumOfTubeRows * state.dataWaterCoils->WaterCoil(CoilNum).NumOfTubesPerRow)); + (DataGlobalConstants::Pi() * state.dataWaterCoils->WaterCoil(CoilNum).NumOfTubeRows * state.dataWaterCoils->WaterCoil(CoilNum).NumOfTubesPerRow)); // calculate fixed geometric parameters of the coil: // Total Area @@ -1183,7 +1183,7 @@ namespace WaterCoils { state.dataWaterCoils->WaterCoil(CoilNum).TubeDepthSpacing *= (pow_2(TubeToFinDiamRatio) + 0.1); state.dataWaterCoils->WaterCoil(CoilNum).CoilDepth = state.dataWaterCoils->WaterCoil(CoilNum).TubeDepthSpacing * state.dataWaterCoils->WaterCoil(CoilNum).NumOfTubeRows; state.dataWaterCoils->WaterCoil(CoilNum).EffectiveFinDiam = std::sqrt(4.0 * state.dataWaterCoils->WaterCoil(CoilNum).FinDiam * state.dataWaterCoils->WaterCoil(CoilNum).CoilDepth / - (Pi * state.dataWaterCoils->WaterCoil(CoilNum).NumOfTubeRows * state.dataWaterCoils->WaterCoil(CoilNum).NumOfTubesPerRow)); + (DataGlobalConstants::Pi() * state.dataWaterCoils->WaterCoil(CoilNum).NumOfTubeRows * state.dataWaterCoils->WaterCoil(CoilNum).NumOfTubesPerRow)); state.dataWaterCoils->WaterCoil(CoilNum).CoilEffectiveInsideDiam = 4.0 * state.dataWaterCoils->WaterCoil(CoilNum).MinAirFlowArea * state.dataWaterCoils->WaterCoil(CoilNum).CoilDepth / state.dataWaterCoils->WaterCoil(CoilNum).TotCoilOutsideSurfArea; TubeToFinDiamRatio = state.dataWaterCoils->WaterCoil(CoilNum).TubeOutsideDiam / state.dataWaterCoils->WaterCoil(CoilNum).EffectiveFinDiam; @@ -3131,7 +3131,7 @@ namespace WaterCoils { RoutineName); // water flow velocity - assuming number of water circuits = NumOfTubesPerRow TubeWaterVel = WaterMassFlowRate * 4.0 / - (state.dataWaterCoils->WaterCoil(CoilNum).NumOfTubesPerRow * rho * Pi * state.dataWaterCoils->WaterCoil(CoilNum).TubeInsideDiam * state.dataWaterCoils->WaterCoil(CoilNum).TubeInsideDiam); + (state.dataWaterCoils->WaterCoil(CoilNum).NumOfTubesPerRow * rho * DataGlobalConstants::Pi() * state.dataWaterCoils->WaterCoil(CoilNum).TubeInsideDiam * state.dataWaterCoils->WaterCoil(CoilNum).TubeInsideDiam); // air mass flow rate per unit area ScaledAirMassFlowRate = (1.0 + InletAirHumRat) * AirMassFlow / state.dataWaterCoils->WaterCoil(CoilNum).MinAirFlowArea; // air flow Reynold's Number @@ -4979,7 +4979,7 @@ namespace WaterCoils { IBessFunc = 1.0; for (LoopCount = 1; LoopCount <= 30; ++LoopCount) { // Start of 1st LoopCount Loop if (std::abs(TERM) <= std::abs(ErrorTol * IBessFunc)) { - IBessFunc *= std::exp(BessFuncArg) / std::sqrt(2.0 * Pi * BessFuncArg); + IBessFunc *= std::exp(BessFuncArg) / std::sqrt(2.0 * DataGlobalConstants::Pi() * BessFuncArg); return; } TERM *= 0.125 / BessFuncArg * (pow_2(2 * LoopCount - 1) - 4 * BessFuncOrd * BessFuncOrd) / double(LoopCount); diff --git a/src/EnergyPlus/WaterThermalTanks.cc b/src/EnergyPlus/WaterThermalTanks.cc index b1a1e8cd18b..a240f64cd24 100644 --- a/src/EnergyPlus/WaterThermalTanks.cc +++ b/src/EnergyPlus/WaterThermalTanks.cc @@ -2721,7 +2721,7 @@ namespace WaterThermalTanks { // adjust tank height used in these calculations for testing heater height Real64 tankHeightForTesting; if (Tank.Shape == TankShapeEnum::HorizCylinder) { - tankHeightForTesting = 2.0 * sqrt((Tank.Volume / Tank.Height) / DataGlobals::Pi); + tankHeightForTesting = 2.0 * sqrt((Tank.Volume / Tank.Height) / DataGlobalConstants::Pi()); } else { tankHeightForTesting = Tank.Height; } @@ -4257,7 +4257,7 @@ namespace WaterThermalTanks { // For horizontal cylinders, the tank "height" is actually the length. // We need to calculate the height. Real64 EndArea = Tank.Volume / Tank.Height; - Real64 Radius = std::sqrt(EndArea / DataGlobals::Pi); + Real64 Radius = std::sqrt(EndArea / DataGlobalConstants::Pi()); TankHeight = 2.0 * Radius; // actual vertical height } @@ -5147,8 +5147,8 @@ namespace WaterThermalTanks { Real64 Perimeter_loc; if (this->Shape == TankShapeEnum::VertCylinder) { - Real64 Radius = std::sqrt(EndArea / DataGlobals::Pi); - Perimeter_loc = 2.0 * DataGlobals::Pi * Radius; + Real64 Radius = std::sqrt(EndArea / DataGlobalConstants::Pi()); + Perimeter_loc = 2.0 * DataGlobalConstants::Pi() * Radius; } else { // TankShapeOther Perimeter_loc = this->Perimeter; } @@ -5179,7 +5179,7 @@ namespace WaterThermalTanks { } else { // Tank%Shape == TankShapeHorizCylinder Real64 TankLength = this->Height; // Height is the length in the axial direction Real64 EndArea = this->Volume / TankLength; - Real64 Radius = std::sqrt(EndArea / DataGlobals::Pi); + Real64 Radius = std::sqrt(EndArea / DataGlobalConstants::Pi()); TankHeight = 2.0 * Radius; // Actual vertical height Real64 NodeEndArea = EndArea / NumNodes; @@ -10582,7 +10582,7 @@ namespace WaterThermalTanks { if ((this->VolumeWasAutoSized) && (this->TypeNum == DataPlant::TypeOf_WtrHeaterStratified) && DataPlant::PlantFirstSizesOkayToFinalize) { // might set height if ((this->HeightWasAutoSized) && (!this->VolumeWasAutoSized)) { - this->Height = std::pow((4.0 * this->Volume * pow_2(this->Sizing.HeightAspectRatio)) / DataGlobals::Pi, 0.3333333333333333); + this->Height = std::pow((4.0 * this->Volume * pow_2(this->Sizing.HeightAspectRatio)) / DataGlobalConstants::Pi(), 0.3333333333333333); if (DataPlant::PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(this->Type, this->Name, "Tank Height [m]", this->Height); } @@ -10709,7 +10709,7 @@ namespace WaterThermalTanks { if ((this->VolumeWasAutoSized) && (this->TypeNum == DataPlant::TypeOf_WtrHeaterStratified) && DataPlant::PlantFirstSizesOkayToFinalize) { // might set height if ((this->HeightWasAutoSized) && (!this->VolumeWasAutoSized)) { - this->Height = std::pow((4.0 * this->Volume * pow_2(this->Sizing.HeightAspectRatio)) / DataGlobals::Pi, 0.3333333333333333); + this->Height = std::pow((4.0 * this->Volume * pow_2(this->Sizing.HeightAspectRatio)) / DataGlobalConstants::Pi(), 0.3333333333333333); if (DataPlant::PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(this->Type, this->Name, "Tank Height [m]", this->Height); } diff --git a/src/EnergyPlus/WeatherManager.cc b/src/EnergyPlus/WeatherManager.cc index 9c01cdd0470..eed09e769e8 100644 --- a/src/EnergyPlus/WeatherManager.cc +++ b/src/EnergyPlus/WeatherManager.cc @@ -286,9 +286,9 @@ namespace WeatherManager { if (DataEnvironment::varyingOrientationSchedIndex > 0) { DataHeatBalance::BuildingAzimuth = mod(ScheduleManager::GetCurrentScheduleValue(DataEnvironment::varyingOrientationSchedIndex), 360.0); SurfaceGeometry::CosBldgRelNorth = - std::cos(-(DataHeatBalance::BuildingAzimuth + DataHeatBalance::BuildingRotationAppendixG) * DataGlobals::DegToRadians); + std::cos(-(DataHeatBalance::BuildingAzimuth + DataHeatBalance::BuildingRotationAppendixG) * DataGlobalConstants::DegToRadians()); SurfaceGeometry::SinBldgRelNorth = - std::sin(-(DataHeatBalance::BuildingAzimuth + DataHeatBalance::BuildingRotationAppendixG) * DataGlobals::DegToRadians); + std::sin(-(DataHeatBalance::BuildingAzimuth + DataHeatBalance::BuildingRotationAppendixG) * DataGlobalConstants::DegToRadians()); for (size_t SurfNum = 1; SurfNum < DataSurfaces::Surface.size(); ++SurfNum) { for (int n = 1; n <= DataSurfaces::Surface(SurfNum).Sides; ++n) { Real64 Xb = DataSurfaces::Surface(SurfNum).Vertex(n).x; @@ -312,8 +312,8 @@ namespace WeatherManager { DataSurfaces::Surface(SurfNum).GrossArea, DataSurfaces::Surface(SurfNum).NewellSurfaceNormalVector); DataSurfaces::Surface(SurfNum).Azimuth = SurfWorldAz; - DataSurfaces::Surface(SurfNum).SinAzim = std::sin(SurfWorldAz * DataGlobals::DegToRadians); - DataSurfaces::Surface(SurfNum).CosAzim = std::cos(SurfWorldAz * DataGlobals::DegToRadians); + DataSurfaces::Surface(SurfNum).SinAzim = std::sin(SurfWorldAz * DataGlobalConstants::DegToRadians()); + DataSurfaces::Surface(SurfNum).CosAzim = std::cos(SurfWorldAz * DataGlobalConstants::DegToRadians()); DataSurfaces::Surface(SurfNum).OutNormVec = DataSurfaces::Surface(SurfNum).NewellSurfaceNormalVector; } } @@ -3517,7 +3517,7 @@ namespace WeatherManager { print(state.files.eio, "{:.4R},", C); print(state.files.eio, "{:.1R},", AVSC); print(state.files.eio, "{:.2R},", state.dataWeatherManager->DesignDay(EnvrnNum).EquationOfTime * 60.0); - print(state.files.eio, "{:.1R},", std::asin(state.dataWeatherManager->DesignDay(EnvrnNum).SinSolarDeclinAngle) / DataGlobals::DegToRadians); + print(state.files.eio, "{:.1R},", std::asin(state.dataWeatherManager->DesignDay(EnvrnNum).SinSolarDeclinAngle) / DataGlobalConstants::DegToRadians()); if (state.dataWeatherManager->DesDayInput(EnvrnNum).SolarModel == DesignDaySolarModel::ASHRAE_ClearSky) { StringOut = "ASHRAEClearSky"; @@ -3874,7 +3874,7 @@ namespace WeatherManager { AirMass = 1.0; } else { // note: COS( Zen) = SIN( Alt) - SunAltD = std::asin(CosZen) / DataGlobals::DegToRadians; // altitude, degrees + SunAltD = std::asin(CosZen) / DataGlobalConstants::DegToRadians(); // altitude, degrees AirMass = 1.0 / (CosZen + 0.50572 * std::pow(6.07995 + SunAltD, -1.6364)); } return AirMass; @@ -4053,7 +4053,7 @@ namespace WeatherManager { // coefficients a, b, and c. // See SUN3 in SolarShading. See SUN2 in BLAST. See SUN3 in Tarp. - Real64 const DayCorrection(DataGlobals::Pi * 2.0 / 366.0); + Real64 const DayCorrection(DataGlobalConstants::Pi() * 2.0 / 366.0); // Fitted coefficients of Fourier series | Sine of declination coefficients static Array1D const SineSolDeclCoef( @@ -4104,7 +4104,7 @@ namespace WeatherManager { if (DataEnvironment::Latitude < 0.0) { // If in southern hemisphere, compute B and C with a six month time shift. - X -= DataGlobals::Pi; + X -= DataGlobalConstants::Pi(); SinX = std::sin(X); CosX = std::cos(X); } @@ -4146,7 +4146,7 @@ namespace WeatherManager { // COMPUTE THE HOUR ANGLE Real64 H = - (15.0 * (12.0 - (TimeValue + EqOfTime)) + (DataEnvironment::TimeZoneMeridian - DataEnvironment::Longitude)) * DataGlobals::DegToRadians; + (15.0 * (12.0 - (TimeValue + EqOfTime)) + (DataEnvironment::TimeZoneMeridian - DataEnvironment::Longitude)) * DataGlobalConstants::DegToRadians(); Real64 COSH = std::cos(H); // COMPUTE THE COSINE OF THE SOLAR ZENITH ANGLE. // This is also the Sine of the Solar Altitude Angle @@ -4188,7 +4188,7 @@ namespace WeatherManager { state.dataWeatherManager->HrAngle = (15.0 * (12.0 - ((DataGlobals::CurrentTime + DataEnvironment::TS1TimeOffset) + state.dataWeatherManager->TodayVariables.EquationOfTime)) + (DataEnvironment::TimeZoneMeridian - DataEnvironment::Longitude)); } - Real64 H = state.dataWeatherManager->HrAngle * DataGlobals::DegToRadians; + Real64 H = state.dataWeatherManager->HrAngle * DataGlobalConstants::DegToRadians(); // Compute the Cosine of the Solar Zenith (Altitude) Angle. Real64 CosZenith = DataEnvironment::SinLatitude * state.dataWeatherManager->TodayVariables.SinSolarDeclinAngle + @@ -4205,8 +4205,8 @@ namespace WeatherManager { CosAzimuth = min(1.0, CosAzimuth); Real64 SolarAzimuth = std::acos(CosAzimuth); - state.dataWeatherManager->SolarAltitudeAngle = SolarAltitude / DataGlobals::DegToRadians; - state.dataWeatherManager->SolarAzimuthAngle = SolarAzimuth / DataGlobals::DegToRadians; + state.dataWeatherManager->SolarAltitudeAngle = SolarAltitude / DataGlobalConstants::DegToRadians(); + state.dataWeatherManager->SolarAzimuthAngle = SolarAzimuth / DataGlobalConstants::DegToRadians(); if ( state.dataWeatherManager->HrAngle < 0.0) { state.dataWeatherManager->SolarAzimuthAngle = 360.0 - state.dataWeatherManager->SolarAzimuthAngle; } @@ -4470,8 +4470,8 @@ namespace WeatherManager { } else { DataEnvironment::TimeZoneMeridian = DataEnvironment::TimeZoneNumber * 15.0 - 360.0; } - DataEnvironment::SinLatitude = std::sin(DataGlobals::DegToRadians * DataEnvironment::Latitude); - DataEnvironment::CosLatitude = std::cos(DataGlobals::DegToRadians * DataEnvironment::Latitude); + DataEnvironment::SinLatitude = std::sin(DataGlobalConstants::DegToRadians() * DataEnvironment::Latitude); + DataEnvironment::CosLatitude = std::cos(DataGlobalConstants::DegToRadians() * DataEnvironment::Latitude); if (DataEnvironment::Latitude == 0.0 && DataEnvironment::Longitude == 0.0 && DataEnvironment::TimeZoneNumber == 0.0) { ShowWarningError("Did you realize that you have Latitude=0.0, Longitude=0.0 and TimeZone=0.0? Your building site is in the middle of " @@ -7037,7 +7037,7 @@ namespace WeatherManager { // calculated water main temp (F) Real64 CurrentWaterMainsTemp = Tavg + Offset + - Ratio * (Tdiff / 2.0) * latitude_sign * std::sin((0.986 * (DataEnvironment::DayOfYear - 15.0 - Lag) - 90) * DataGlobals::DegToRadians); + Ratio * (Tdiff / 2.0) * latitude_sign * std::sin((0.986 * (DataEnvironment::DayOfYear - 15.0 - Lag) - 90) * DataGlobalConstants::DegToRadians()); if (CurrentWaterMainsTemp < 32.0) CurrentWaterMainsTemp = 32.0; @@ -7201,7 +7201,7 @@ namespace WeatherManager { 130471.0}); // Monthly exterrestrial direct normal illuminance (lum/m2) Real64 const SunZenith = std::acos(DataEnvironment::SOLCOS(3)); // Solar zenith angle (radians) - Real64 const SunAltitude = DataGlobals::PiOvr2 - SunZenith; // Solar altitude angle (radians) + Real64 const SunAltitude = DataGlobalConstants::PiOvr2() - SunZenith; // Solar altitude angle (radians) Real64 const SinSunAltitude = std::sin(SunAltitude); // Clearness of sky. SkyClearness close to 1.0 corresponds to an overcast sky. // SkyClearness > 6 is a clear sky. @@ -7212,7 +7212,7 @@ namespace WeatherManager { ((DataEnvironment::DifSolarRad + DataEnvironment::BeamSolarRad) / (DataEnvironment::DifSolarRad + 0.0001) + Zeta) / (1.0 + Zeta); // Relative optical air mass Real64 const AirMass = (1.0 - 0.1 * DataEnvironment::Elevation / 1000.0) / - (SinSunAltitude + 0.15 / std::pow(SunAltitude / DataGlobals::DegToRadians + 3.885, 1.253)); + (SinSunAltitude + 0.15 / std::pow(SunAltitude / DataGlobalConstants::DegToRadians() + 3.885, 1.253)); // In the following, 93.73 is the extraterrestrial luminous efficacy DataEnvironment::SkyBrightness = (DataEnvironment::DifSolarRad * 93.73) * AirMass / ExtraDirNormIll(DataEnvironment::Month); int ISkyClearness; // Sky clearness bin diff --git a/src/EnergyPlus/WindTurbine.cc b/src/EnergyPlus/WindTurbine.cc index 3c4bce9d664..217e39b527c 100644 --- a/src/EnergyPlus/WindTurbine.cc +++ b/src/EnergyPlus/WindTurbine.cc @@ -95,8 +95,6 @@ namespace WindTurbine { // using namespace DataPrecisionGlobals; // using namespace DataGenerators; using DataGlobals::BeginEnvrnFlag; - using DataGlobals::DegToRadians; - using DataGlobals::Pi; using DataGlobals::ScheduleAlwaysOn; using DataGlobals::SecInHour; @@ -818,9 +816,9 @@ namespace WindTurbine { LocalWindSpeed < state.dataWindTurbine->WindTurbineSys(WindTurbineNum).CutOutSpeed) { // System is on - Period = 2.0 * Pi; + Period = 2.0 * DataGlobalConstants::Pi(); Omega = (RotorSpeed * Period) / SecInMin; - SweptArea = (Pi * pow_2(RotorD)) / 4; + SweptArea = (DataGlobalConstants::Pi() * pow_2(RotorD)) / 4; TipSpeedRatio = (Omega * (RotorD / 2.0)) / LocalWindSpeed; // Limit maximum tip speed ratio @@ -888,8 +886,8 @@ namespace WindTurbine { InducedVel = LocalWindSpeed * 2.0 / 3.0; // Velocity components - Real64 const sin_AzimuthAng(std::sin(AzimuthAng * DegToRadians)); - Real64 const cos_AzimuthAng(std::cos(AzimuthAng * DegToRadians)); + Real64 const sin_AzimuthAng(std::sin(AzimuthAng * DataGlobalConstants::DegToRadians())); + Real64 const cos_AzimuthAng(std::cos(AzimuthAng * DataGlobalConstants::DegToRadians())); ChordalVel = RotorVel + InducedVel * cos_AzimuthAng; NormalVel = InducedVel * sin_AzimuthAng; RelFlowVel = std::sqrt(pow_2(ChordalVel) + pow_2(NormalVel)); @@ -898,8 +896,8 @@ namespace WindTurbine { AngOfAttack = std::atan((sin_AzimuthAng / ((RotorVel / LocalWindSpeed) / (InducedVel / LocalWindSpeed) + cos_AzimuthAng))); // Force coefficients - Real64 const sin_AngOfAttack(std::sin(AngOfAttack * DegToRadians)); - Real64 const cos_AngOfAttack(std::cos(AngOfAttack * DegToRadians)); + Real64 const sin_AngOfAttack(std::sin(AngOfAttack * DataGlobalConstants::DegToRadians())); + Real64 const cos_AngOfAttack(std::cos(AngOfAttack * DataGlobalConstants::DegToRadians())); TanForceCoeff = std::abs(state.dataWindTurbine->WindTurbineSys(WindTurbineNum).LiftCoeff * sin_AngOfAttack - state.dataWindTurbine->WindTurbineSys(WindTurbineNum).DragCoeff * cos_AngOfAttack); NorForceCoeff = diff --git a/src/EnergyPlus/WindowComplexManager.cc b/src/EnergyPlus/WindowComplexManager.cc index 02ab8ba6f5f..81db7b61d72 100644 --- a/src/EnergyPlus/WindowComplexManager.cc +++ b/src/EnergyPlus/WindowComplexManager.cc @@ -98,11 +98,9 @@ namespace WindowComplexManager { using namespace DataComplexFenestration; using namespace DataVectorTypes; using namespace DataBSDFWindow; - using DataGlobals::DegToRadians; using DataGlobals::KelvinConv; using DataGlobals::NumOfTimeStepInHour; using DataGlobals::NumOfZones; - using DataGlobals::Pi; using DataGlobals::rTinyValue; using DataGlobals::TimeStepZoneSec; using namespace DataSurfaces; // , ONLY: TotSurfaces,TotWindows,Surface,SurfaceWindow !update this later @@ -1036,11 +1034,11 @@ namespace WindowComplexManager { // No basis symmetry Basis.BasisSymmetryType = BasisSymmetry_None; Thetas(1) = 0.0; // By convention, the first basis point is at the center (theta=0,phi=0) - Thetas(NThetas + 1) = 0.5 * Pi; // and there is an N+1st point (not a basis element) at Pi/2 + Thetas(NThetas + 1) = 0.5 * DataGlobalConstants::Pi(); // and there is an N+1st point (not a basis element) at Pi/2 NPhis(1) = 1; NumElem = 1; for (I = 2; I <= NThetas; ++I) { - Thetas(I) = state.dataConstruction->Construct(IConst).BSDFInput.BasisMat(1, I) * DegToRadians; + Thetas(I) = state.dataConstruction->Construct(IConst).BSDFInput.BasisMat(1, I) * DataGlobalConstants::DegToRadians(); NPhis(I) = std::floor(state.dataConstruction->Construct(IConst).BSDFInput.BasisMat(2, I) + 0.001); if (NPhis(I) <= 0) ShowFatalError("WindowComplexManager: incorrect input, no. phis must be positive."); NumElem += NPhis(I); @@ -1072,22 +1070,22 @@ namespace WindowComplexManager { UpperTheta = Theta + HalfDTheta; } else if (I == NThetas) { LastTheta = Thetas(I - 1); - NextTheta = 0.5 * Pi; + NextTheta = 0.5 * DataGlobalConstants::Pi(); LowerTheta = UpperTheta; // It is assumed that Thetas(N) is the mean between the previous // UpperTheta and pi/2. - UpperTheta = 0.5 * Pi; + UpperTheta = 0.5 * DataGlobalConstants::Pi(); } - DPhi = 2.0 * Pi / NPhis(I); + DPhi = 2.0 * DataGlobalConstants::Pi() / NPhis(I); if (I == 1) { - Lamda = Pi * pow_2(std::sin(UpperTheta)); - SolAng = 2.0 * Pi * (1.0 - std::cos(UpperTheta)); + Lamda = DataGlobalConstants::Pi() * pow_2(std::sin(UpperTheta)); + SolAng = 2.0 * DataGlobalConstants::Pi() * (1.0 - std::cos(UpperTheta)); } else { Lamda = 0.5 * DPhi * (pow_2(std::sin(UpperTheta)) - pow_2(std::sin(LowerTheta))); // For W6 basis, lamda is funct of Theta and // NPhis, not individual Phi SolAng = DPhi * (std::cos(LowerTheta) - std::cos(UpperTheta)); } DTheta = UpperTheta - LowerTheta; - Basis.Phis(I, NPhis(I) + 1) = 2.0 * Pi; // Non-basis-element Phi point for table searching in Phi + Basis.Phis(I, NPhis(I) + 1) = 2.0 * DataGlobalConstants::Pi(); // Non-basis-element Phi point for table searching in Phi for (J = 1; J <= NPhis(I); ++J) { ++ElemNo; Basis.BasisIndex(J, I) = ElemNo; @@ -1110,11 +1108,11 @@ namespace WindowComplexManager { // Axisymmetric basis symmetry (Note this only useful specular systems, where it allows shorter data input) Basis.BasisSymmetryType = BasisSymmetry_Axisymmetric; Thetas(1) = 0.0; // By convention, the first basis point is at the center (theta=0,phi=0) - Thetas(NThetas + 1) = 0.5 * Pi; // and there is an N+1st point (not a basis element) at Pi/2 + Thetas(NThetas + 1) = 0.5 * DataGlobalConstants::Pi(); // and there is an N+1st point (not a basis element) at Pi/2 NPhis = 1; // As insurance, define one phi for each theta NumElem = 1; for (I = 2; I <= NThetas; ++I) { - Thetas(I) = state.dataConstruction->Construct(IConst).BSDFInput.BasisMat(1, I) * DegToRadians; + Thetas(I) = state.dataConstruction->Construct(IConst).BSDFInput.BasisMat(1, I) * DataGlobalConstants::DegToRadians(); ++NumElem; } Basis.Phis.allocate(1, NThetas); @@ -1127,7 +1125,7 @@ namespace WindowComplexManager { Basis.Thetas = Thetas; Basis.NPhis = NPhis; ElemNo = 0; - DPhi = 2.0 * Pi; + DPhi = 2.0 * DataGlobalConstants::Pi(); for (I = 1; I <= NThetas; ++I) { Theta = Thetas(I); if (I == 1) { // First theta value must always be zero @@ -1144,14 +1142,14 @@ namespace WindowComplexManager { UpperTheta = Theta + HalfDTheta; } else if (I == NThetas) { LastTheta = Thetas(I - 1); - NextTheta = 0.5 * Pi; + NextTheta = 0.5 * DataGlobalConstants::Pi(); LowerTheta = UpperTheta; // It is assumed that Thetas(N) is the mean between the previous // UpperTheta and pi/2. - UpperTheta = 0.5 * Pi; + UpperTheta = 0.5 * DataGlobalConstants::Pi(); } if (I == 1) { - Lamda = Pi * pow_2(std::sin(UpperTheta)); - SolAng = 2.0 * Pi * (1.0 - std::cos(UpperTheta)); + Lamda = DataGlobalConstants::Pi() * pow_2(std::sin(UpperTheta)); + SolAng = 2.0 * DataGlobalConstants::Pi() * (1.0 - std::cos(UpperTheta)); } else { Lamda = 0.5 * DPhi * (pow_2(std::sin(UpperTheta)) - pow_2(std::sin(LowerTheta))); // For W6 basis, lamda is funct of Theta and // NPhis, not individual Phi @@ -1208,12 +1206,12 @@ namespace WindowComplexManager { // first element, theta=0, is special case BasisElem.Theta = Theta; BasisElem.Phi = 0.0; - BasisElem.dPhi = 2.0 * Pi; + BasisElem.dPhi = 2.0 * DataGlobalConstants::Pi(); BasisElem.UpprTheta = UpperTheta; BasisElem.dTheta = BasisElem.UpprTheta - Theta; BasisElem.LwrTheta = Theta; BasisElem.LwrPhi = 0.0; - BasisElem.UpprPhi = 2.0 * Pi; + BasisElem.UpprPhi = 2.0 * DataGlobalConstants::Pi(); } else { BasisElem.Theta = Theta; BasisElem.Phi = Phi; @@ -1321,8 +1319,8 @@ namespace WindowComplexManager { // Define the central ray directions (in world coordinate system) SurfaceWindow(ISurf).ComplexFen.State(IState).NLayers = state.dataConstruction->Construct(IConst).BSDFInput.NumLayers; - Azimuth = DegToRadians * Surface(ISurf).Azimuth; - Tilt = DegToRadians * Surface(ISurf).Tilt; + Azimuth = DataGlobalConstants::DegToRadians() * Surface(ISurf).Azimuth; + Tilt = DataGlobalConstants::DegToRadians() * Surface(ISurf).Tilt; // For incoming grid @@ -2094,16 +2092,16 @@ namespace WindowComplexManager { DayPos.Azimuth = std::atan(UnitVect.y / UnitVect.x); } else { if (UnitVect.y >= 0.0) { - DayPos.Azimuth = Pi + std::atan(UnitVect.y / UnitVect.x); + DayPos.Azimuth = DataGlobalConstants::Pi() + std::atan(UnitVect.y / UnitVect.x); } else { - DayPos.Azimuth = -Pi + std::atan(UnitVect.y / UnitVect.x); + DayPos.Azimuth = -DataGlobalConstants::Pi() + std::atan(UnitVect.y / UnitVect.x); } } } else { if (UnitVect.y >= 0.0) { - DayPos.Azimuth = PiOvr2; + DayPos.Azimuth = DataGlobalConstants::PiOvr2(); } else { - DayPos.Azimuth = -PiOvr2; + DayPos.Azimuth = -DataGlobalConstants::PiOvr2(); } } @@ -2239,12 +2237,12 @@ namespace WindowComplexManager { } // get window tilt and azimuth - Gamma = DegToRadians * Surface(ISurf).Tilt; - Alpha = DegToRadians * Surface(ISurf).Azimuth; + Gamma = DataGlobalConstants::DegToRadians() * Surface(ISurf).Tilt; + Alpha = DataGlobalConstants::DegToRadians() * Surface(ISurf).Azimuth; // get the corresponding local Theta, Phi for ray W6CoordsFromWorldVect(state, RayToFind, RadType, Gamma, Alpha, Theta, Phi); - if (Theta >= 0.5 * Pi) { // Ray was in not in correct hemisphere + if (Theta >= 0.5 * DataGlobalConstants::Pi()) { // Ray was in not in correct hemisphere RayIndex = 0; return RayIndex; } @@ -2373,7 +2371,7 @@ namespace WindowComplexManager { RdotX = dot(W6x, RayVect); Psi = std::atan2(-RdotY / Sint, -RdotX / Sint); if (Psi < 0.0) { - Phi = 2.0 * Pi + Psi; + Phi = 2.0 * DataGlobalConstants::Pi() + Psi; } else { Phi = Psi; } @@ -2385,7 +2383,7 @@ namespace WindowComplexManager { RdotX = dot(W6x, RayVect); Psi = std::atan2(RdotY / Sint, RdotX / Sint); if (Psi < 0.0) { - Phi = 2.0 * Pi + Psi; + Phi = 2.0 * DataGlobalConstants::Pi() + Psi; } else { Phi = Psi; } @@ -2398,7 +2396,7 @@ namespace WindowComplexManager { RdotX = dot(W6x, RayVect); Psi = std::atan2(RdotY / Sint, RdotX / Sint); if (Psi < 0.0) { - Phi = 2.0 * Pi + Psi; + Phi = 2.0 * DataGlobalConstants::Pi() + Psi; } else { Phi = Psi; } @@ -2410,7 +2408,7 @@ namespace WindowComplexManager { RdotX = dot(W6x, RayVect); Psi = std::atan2(-RdotY / Sint, -RdotX / Sint); if (Psi < 0.0) { - Phi = 2 * Pi + Psi; + Phi = 2 * DataGlobalConstants::Pi() + Psi; } else { Phi = Psi; } @@ -2423,7 +2421,7 @@ namespace WindowComplexManager { RdotX = dot(W6x, RayVect); Psi = std::atan2(RdotY / Sint, RdotX / Sint); if (Psi < 0.0) { - Phi = 2.0 * Pi + Psi; + Phi = 2.0 * DataGlobalConstants::Pi() + Psi; } else { Phi = Psi; } @@ -2435,7 +2433,7 @@ namespace WindowComplexManager { RdotX = dot(W6x, RayVect); Psi = std::atan2(RdotY / Sint, RdotX / Sint); if (Psi < 0.0) { - Phi = 2.0 * Pi + Psi; + Phi = 2.0 * DataGlobalConstants::Pi() + Psi; } else { Phi = Psi; } @@ -2444,7 +2442,7 @@ namespace WindowComplexManager { } } if (std::abs(Cost) < rTinyValue) Cost = 0.0; - if (Cost < 0.0) Theta = Pi - Theta; // This signals ray out of hemisphere + if (Cost < 0.0) Theta = DataGlobalConstants::Pi() - Theta; // This signals ray out of hemisphere } void CalcComplexWindowThermal(EnergyPlusData &state, diff --git a/src/EnergyPlus/WindowEquivalentLayer.cc b/src/EnergyPlus/WindowEquivalentLayer.cc index 192e2c112df..68fd5ca39a5 100644 --- a/src/EnergyPlus/WindowEquivalentLayer.cc +++ b/src/EnergyPlus/WindowEquivalentLayer.cc @@ -126,10 +126,8 @@ namespace WindowEquivalentLayer { using DataEnvironment::DayOfMonth; using DataEnvironment::Month; using DataGlobals::CurrentTime; - using DataGlobals::GravityConstant; using DataGlobals::HourOfDay; using DataGlobals::KelvinConv; - using DataGlobals::PiOvr2; using DataGlobals::StefanBoltzmann; using DataGlobals::TimeStep; using DataGlobals::UniversalGasConst; @@ -1035,7 +1033,7 @@ namespace WindowEquivalentLayer { int iPX; X1 = 0.0; // integration limits - X2 = PiOvr2; + X2 = DataGlobalConstants::PiOvr2(); nPan = 1; SUM = 0.0; for (K = 1; K <= KMAX; ++K) { @@ -1163,8 +1161,6 @@ namespace WindowEquivalentLayer { // PURPOSE OF THIS SUBROUTINE: // Calculates the roller blind off-normal properties using semi-empirical relations - using DataGlobals::DegToRadians; - // SUBROUTINE ARGUMENT DEFINITIONS: // TAU_BT0 = TAU_BB0 + TAU_BD0 // (openness) @@ -1178,7 +1174,7 @@ namespace WindowEquivalentLayer { Real64 TAUBB_EXPO; // exponent in the beam-beam transmittance model Real64 TAU_BT; // beam-total transmittance - THETA = min(89.99 * DegToRadians, xTHETA); + THETA = min(89.99 * DataGlobalConstants::DegToRadians(), xTHETA); if (TAU_BB0 > 0.9999) { TAU_BB = 1.0; @@ -1193,13 +1189,13 @@ namespace WindowEquivalentLayer { } TAU_BT = TAU_BT0 * std::pow(std::cos(THETA), TAUBT_EXPO); // always 0 - 1 - Real64 const cos_TAU_BB0(std::cos(TAU_BB0 * PiOvr2)); - THETA_CUTOFF = DegToRadians * (90.0 - 25.0 * cos_TAU_BB0); + Real64 const cos_TAU_BB0(std::cos(TAU_BB0 * DataGlobalConstants::PiOvr2())); + THETA_CUTOFF = DataGlobalConstants::DegToRadians() * (90.0 - 25.0 * cos_TAU_BB0); if (THETA >= THETA_CUTOFF) { TAU_BB = 0.0; } else { TAUBB_EXPO = 0.6 * std::pow(cos_TAU_BB0, 0.3); - TAU_BB = TAU_BB0 * std::pow(std::cos(PiOvr2 * THETA / THETA_CUTOFF), TAUBB_EXPO); + TAU_BB = TAU_BB0 * std::pow(std::cos(DataGlobalConstants::PiOvr2() * THETA / THETA_CUTOFF), TAUBB_EXPO); // BB correlation can produce results slightly larger than BT // Enforce consistency TAU_BB = min(TAU_BT, TAU_BB); @@ -1312,8 +1308,6 @@ namespace WindowEquivalentLayer { // Calculates insect screen off-normal solar optical properties // using semi-empirical relations. - using DataGlobals::DegToRadians; - // SUBROUTINE ARGUMENT DEFINITIONS: // TAU_BTO = TAU_BB0 + TAU_BD0 @@ -1328,7 +1322,7 @@ namespace WindowEquivalentLayer { Real64 RHO_BT90; // beam-total reflectance at 90 deg incidence Real64 TAU_BT; // beam-total transmittance - Real64 const THETA(min(89.99 * DegToRadians, xTHETA)); // working incident angle, radians + Real64 const THETA(min(89.99 * DataGlobalConstants::DegToRadians(), xTHETA)); // working incident angle, radians Real64 const COSTHETA(std::cos(THETA)); RHO_W = RHO_BT0 / max(0.00001, 1.0 - TAU_BB0); @@ -1348,7 +1342,7 @@ namespace WindowEquivalentLayer { TAU_BB = 0.0; } else { B = -0.45 * std::log(max(TAU_BB0, 0.01)) + 0.1; - TAU_BB = P01(TAU_BB0 * std::pow(std::cos(PiOvr2 * THETA / THETA_CUTOFF), B), TauBB_Name); + TAU_BB = P01(TAU_BB0 * std::pow(std::cos(DataGlobalConstants::PiOvr2() * THETA / THETA_CUTOFF), B), TauBB_Name); } B = -0.65 * std::log(max(TAU_BT0, 0.01)) + 0.1; @@ -1500,8 +1494,6 @@ namespace WindowEquivalentLayer { // on the forward facingsurface using optical properties at normal incidence and // semi-empirical relations. - using DataGlobals::DegToRadians; - // SUBROUTINE ARGUMENT DEFINITIONS: // TAU_BTO = TAU_BB0 + TAU_BD0 // = openness @@ -1513,7 +1505,7 @@ namespace WindowEquivalentLayer { Real64 RHO_BT90; // beam-total reflectance at 90 deg incidence Real64 TAU_BT; // beam-total transmittance - THETA = std::abs(max(-89.99 * DegToRadians, min(89.99 * DegToRadians, xTHETA))); + THETA = std::abs(max(-89.99 * DataGlobalConstants::DegToRadians(), min(89.99 * DataGlobalConstants::DegToRadians(), xTHETA))); // limit -89.99 - +89.99 // by symmetry, optical properties same at +/- theta Real64 const COSTHETA(std::cos(THETA)); @@ -1782,8 +1774,6 @@ namespace WindowEquivalentLayer { // METHODOLOGY EMPLOYED: // Pleated drape flat-fabric model with rectangular enclosure - using DataGlobals::DegToRadians; - Real64 DE; // length of directly illuminated surface on side of pleat that // is open on front (same units as S and W) Real64 EF; // length of pleat side shaded surface (W-DE) (same units as S and W) @@ -1807,8 +1797,8 @@ namespace WindowEquivalentLayer { Real64 TAUBF_BB_PERP; Real64 TAUBF_BD_PERP; - OMEGA_V = std::abs(max(-89.5 * DegToRadians, min(89.5 * DegToRadians, OHM_V_RAD))); - OMEGA_H = std::abs(max(-89.5 * DegToRadians, min(89.5 * DegToRadians, OHM_H_RAD))); + OMEGA_V = std::abs(max(-89.5 * DataGlobalConstants::DegToRadians(), min(89.5 * DataGlobalConstants::DegToRadians(), OHM_V_RAD))); + OMEGA_H = std::abs(max(-89.5 * DataGlobalConstants::DegToRadians(), min(89.5 * DataGlobalConstants::DegToRadians(), OHM_H_RAD))); // limit profile angles -89.5 - +89.5 // by symmetry, properties same for +/- profile angle @@ -3800,8 +3790,6 @@ namespace WindowEquivalentLayer { // reflectance call this routine a second time with the same input data - except // negative the slat angle, PHI_DEG. - using DataGlobals::DegToRadians; - // SUBROUTINE ARGUMENT DEFINITIONS: // must be > 0 // must be > 0 @@ -3843,9 +3831,9 @@ namespace WindowEquivalentLayer { CORR = 1; // limit slat angle to +/- 90 deg - PHI = max(-DegToRadians * 90.0, min(DegToRadians * 90.0, PHIx)); + PHI = max(-DataGlobalConstants::DegToRadians() * 90.0, min(DataGlobalConstants::DegToRadians() * 90.0, PHIx)); // limit profile angle to +/- 89.5 deg - OMEGA = max(-DegToRadians * 89.5, min(DegToRadians * 89.5, OMEGAx)); + OMEGA = max(-DataGlobalConstants::DegToRadians() * 89.5, min(DataGlobalConstants::DegToRadians() * 89.5, OMEGAx)); SL_RAD = W / max(SL_WR, 0.0000001); SL_THETA = 2.0 * std::asin(0.5 * SL_WR); @@ -4089,7 +4077,7 @@ namespace WindowEquivalentLayer { // PRINT *, PHI, OMEGA, DE, 'BOTLIT' } // CHECK TO SEE IF VENETIAN BLIND IS CLOSED - if (std::abs(PHI - PiOvr2) < state.dataWindowEquivalentLayer->SMALL_ERROR) { // VENETIAN BLIND IS CLOSED + if (std::abs(PHI - DataGlobalConstants::PiOvr2()) < state.dataWindowEquivalentLayer->SMALL_ERROR) { // VENETIAN BLIND IS CLOSED // CHECK TO SEE IF THERE ARE GAPS IN BETWEEN SLATS WHEN THE BLIND IS CLOSED if (W < S) { // YES, THERE ARE GAPS IN BETWEEN SLATS @@ -4209,7 +4197,7 @@ namespace WindowEquivalentLayer { } // CHECK TO SEE IF VENETIAN BLIND IS CLOSED - if (std::abs(PHI - PiOvr2) < state.dataWindowEquivalentLayer->SMALL_ERROR) { // VENETIAN BLIND IS CLOSED + if (std::abs(PHI - DataGlobalConstants::PiOvr2()) < state.dataWindowEquivalentLayer->SMALL_ERROR) { // VENETIAN BLIND IS CLOSED // CHECK TO SEE IF THERE ARE GAPS IN BETWEEN SLATS WHEN THE BLIND IS CLOSED if (W < S) { // YES, THERE ARE GAPS IN BETWEEN SLATS @@ -5958,7 +5946,7 @@ namespace WindowEquivalentLayer { CP = ACP + BCP * TM + BCP * TM * TM; VISC = AVISC + BVISC * TM + BVISC * TM * TM; - FRA = (GravityConstant * RHOGAS * RHOGAS * DT * T * T * T * CP) / (VISC * K * TM * Z * Z); + FRA = (DataGlobalConstants::GravityConstant() * RHOGAS * RHOGAS * DT * T * T * T * CP) / (VISC * K * TM * Z * Z); return FRA; } @@ -6838,8 +6826,6 @@ namespace WindowEquivalentLayer { // Uses a reference glass property. // returns TRUE if RAT_TAU < 1 or RAT_1MR < 1 (and thus Specular_Adjust s/b called) // else FALSE - using DataGlobals::DegToRadians; - // Return value bool Specular_OffNormal; @@ -6868,11 +6854,11 @@ namespace WindowEquivalentLayer { Specular_OffNormal = true; THETA1 = std::abs(THETA); - if (THETA1 > PiOvr2 - DegToRadians) { + if (THETA1 > DataGlobalConstants::PiOvr2() - DataGlobalConstants::DegToRadians()) { // theta > 89 deg RAT_TAU = 0.0; RAT_1MR = 0.0; - } else if (THETA1 >= DegToRadians) { + } else if (THETA1 >= DataGlobalConstants::DegToRadians()) { // theta >= 1 deg N2 = 1.526; KL = 55.0 * 0.006; @@ -7373,8 +7359,6 @@ namespace WindowEquivalentLayer { // Return venetian blind longwave properties from slat properties and geometry. // If not VB layer returns False. - using DataGlobals::DegToRadians; - // Return value bool VB_LWP; @@ -7392,10 +7376,10 @@ namespace WindowEquivalentLayer { RHOUFS_SLAT = 1.0 - L.LWP_MAT.EPSLF - L.LWP_MAT.TAUL; // upward surface // TODO: are there cases where 2 calls not needed (RHODFS_SLAT == RHOUFS_SLAT??) - VB_DIFF(L.S, L.W, DegToRadians * L.PHI_DEG, RHODFS_SLAT, RHOUFS_SLAT, L.LWP_MAT.TAUL, RHOLF, LLWP.TAUL); + VB_DIFF(L.S, L.W, DataGlobalConstants::DegToRadians() * L.PHI_DEG, RHODFS_SLAT, RHOUFS_SLAT, L.LWP_MAT.TAUL, RHOLF, LLWP.TAUL); LLWP.EPSLF = 1.0 - RHOLF - LLWP.TAUL; - VB_DIFF(L.S, L.W, -DegToRadians * L.PHI_DEG, RHODFS_SLAT, RHOUFS_SLAT, L.LWP_MAT.TAUL, RHOLB, TAULX); + VB_DIFF(L.S, L.W, -DataGlobalConstants::DegToRadians() * L.PHI_DEG, RHODFS_SLAT, RHOUFS_SLAT, L.LWP_MAT.TAUL, RHOLB, TAULX); LLWP.EPSLB = 1.0 - RHOLB - LLWP.TAUL; VB_LWP = true; @@ -7417,8 +7401,6 @@ namespace WindowEquivalentLayer { // PURPOSE OF THIS FUNCTION: // Returns venetian blind off-normal short wave properties. If not VB layer // returns False. - using DataGlobals::DegToRadians; - // Return value bool VB_SWP; @@ -7438,15 +7420,15 @@ namespace WindowEquivalentLayer { if (DODIFFUSE) { - VB_DIFF(L.S, L.W, DegToRadians * L.PHI_DEG, L.SWP_MAT.RHOSBDD, L.SWP_MAT.RHOSFDD, L.SWP_MAT.TAUS_DD, LSWP.RHOSFDD, LSWP.TAUS_DD); + VB_DIFF(L.S, L.W, DataGlobalConstants::DegToRadians() * L.PHI_DEG, L.SWP_MAT.RHOSBDD, L.SWP_MAT.RHOSFDD, L.SWP_MAT.TAUS_DD, LSWP.RHOSFDD, LSWP.TAUS_DD); - VB_DIFF(L.S, L.W, -DegToRadians * L.PHI_DEG, L.SWP_MAT.RHOSBDD, L.SWP_MAT.RHOSFDD, L.SWP_MAT.TAUS_DD, LSWP.RHOSBDD, TAUX); + VB_DIFF(L.S, L.W, -DataGlobalConstants::DegToRadians() * L.PHI_DEG, L.SWP_MAT.RHOSBDD, L.SWP_MAT.RHOSFDD, L.SWP_MAT.TAUS_DD, LSWP.RHOSBDD, TAUX); } else { // modify angle-dependent values for actual profile angle VB_SOL46_CURVE(state, L.S, L.W, SL_WR, - DegToRadians * L.PHI_DEG, + DataGlobalConstants::DegToRadians() * L.PHI_DEG, OMEGA, L.SWP_MAT.RHOSBDD, L.SWP_MAT.RHOSFDD, @@ -7458,7 +7440,7 @@ namespace WindowEquivalentLayer { VB_SOL46_CURVE(state, L.S, L.W, SL_WR, - -DegToRadians * L.PHI_DEG, + -DataGlobalConstants::DegToRadians() * L.PHI_DEG, OMEGA, L.SWP_MAT.RHOSBDD, L.SWP_MAT.RHOSFDD, @@ -7577,7 +7559,7 @@ namespace WindowEquivalentLayer { // must be consistent with IsControlledShade() if (IsVBLayer(L) && L.CNTRL != state.dataWindowEquivalentLayer->lscNONE) { - if (THETA < 0.0 || THETA >= PiOvr2) { + if (THETA < 0.0 || THETA >= DataGlobalConstants::PiOvr2()) { OMEGA_DEG = -1.0; // diffuse only } else if (L.LTYPE == ltyVBHOR) { // horiz VB @@ -8315,7 +8297,6 @@ namespace WindowEquivalentLayer { // Uses ISO Standard 15099 method to calculate the inside surface // convection coefficient for fenestration ratings. - using DataGlobals::DegToRadians; using Psychrometrics::PsyRhoAirFnPbTdbW; // Return value @@ -8335,7 +8316,7 @@ namespace WindowEquivalentLayer { Real64 Nuint; // Nusselt number for interior surface convection TiltDeg = 90.0; - sineTilt = std::sin(TiltDeg * DegToRadians); // degrees as arg + sineTilt = std::sin(TiltDeg * DataGlobalConstants::DegToRadians()); // degrees as arg // Begin calculating for ISO 15099 method. // mean film temperature @@ -8349,7 +8330,7 @@ namespace WindowEquivalentLayer { Cp = 1002.737 + 1.2324E-2 * TmeanFilmKelvin; // Table B.3 in ISO 15099 RaH = - (pow_2(rho) * pow_3(Height) * GravityConstant * Cp * std::abs(TSurfIn - TAirIn)) / (TmeanFilmKelvin * mu * lambda); // eq 132 in ISO 15099 + (pow_2(rho) * pow_3(Height) * DataGlobalConstants::GravityConstant() * Cp * std::abs(TSurfIn - TAirIn)) / (TmeanFilmKelvin * mu * lambda); // eq 132 in ISO 15099 // eq. 135 in ISO 15099 (only need this one because tilt is 90 deg) Nuint = 0.56 * root_4(RaH * sineTilt); diff --git a/src/EnergyPlus/WindowEquivalentLayer.hh b/src/EnergyPlus/WindowEquivalentLayer.hh index 391ead6f063..cbe9edfdd59 100644 --- a/src/EnergyPlus/WindowEquivalentLayer.hh +++ b/src/EnergyPlus/WindowEquivalentLayer.hh @@ -763,7 +763,7 @@ namespace WindowEquivalentLayer { struct WindowEquivalentLayerData : BaseGlobalStruct { // Data - Real64 const RadiansToDeg; // Conversion for Radians to Degrees: Not using DataGlobals::Pi to avoid initialization order bug + Real64 const RadiansToDeg; // Conversion for Radians to Degrees: Not using DataGlobalConstants::Pi() to avoid initialization order bug Real64 const PAtmSeaLevel; // Standard atmospheric pressure at sea level (Pa) int const hipRHO; // return reflectance int const hipTAU; // return transmittance diff --git a/src/EnergyPlus/WindowManager.cc b/src/EnergyPlus/WindowManager.cc index b2bb93f34ae..6fefab7b9f8 100644 --- a/src/EnergyPlus/WindowManager.cc +++ b/src/EnergyPlus/WindowManager.cc @@ -343,7 +343,7 @@ namespace WindowManager { // handling of optical properties for (IPhi = 1; IPhi <= 10; ++IPhi) { - state.dataWindowManager->CosPhiIndepVar(IPhi) = std::cos((IPhi - 1) * 10.0 * DegToRadians); + state.dataWindowManager->CosPhiIndepVar(IPhi) = std::cos((IPhi - 1) * 10.0 * DataGlobalConstants::DegToRadians()); } TotLay = state.dataConstruction->Construct(ConstrNum).TotLayers; @@ -616,7 +616,7 @@ namespace WindowManager { for (IPhi = 1; IPhi <= TotalIPhi; ++IPhi) { // 10 degree increment for incident angle is only value for a construction without a layer = SpectralAndAngle Phi = double(IPhi - 1) * 10.0; - CosPhi = std::cos(Phi * DegToRadians); + CosPhi = std::cos(Phi * DataGlobalConstants::DegToRadians()); if (std::abs(CosPhi) < 0.0001) CosPhi = 0.0; // For each wavelength, get glass layer properties at this angle of incidence @@ -808,7 +808,7 @@ namespace WindowManager { // When a construction has a layer = SpectralAndAngle, the 10 degree increment will be overridden. for (IPhi = 1; IPhi <= TotalIPhi; ++IPhi) { Phi = double(IPhi - 1) * 10.0; - CosPhi = std::cos(Phi * DegToRadians); + CosPhi = std::cos(Phi * DataGlobalConstants::DegToRadians()); if (std::abs(CosPhi) < 0.0001) CosPhi = 0.0; // For each wavelength, get glass layer properties at this angle of incidence @@ -1396,7 +1396,7 @@ namespace WindowManager { tvisPhiFit(IPhi) = 0.0; Phi = double(IPhi - 1) * 10.0; - CosPhi = std::cos(Phi * DegToRadians); + CosPhi = std::cos(Phi * DataGlobalConstants::DegToRadians()); if (std::abs(CosPhi) < 0.0001) CosPhi = 0.0; Real64 cos_pow(1.0); for (CoefNum = 1; CoefNum <= 6; ++CoefNum) { @@ -1666,7 +1666,7 @@ namespace WindowManager { } for (IPhi = 1; IPhi <= 10; ++IPhi) { - state.dataWindowManager->CosPhiIndepVar(IPhi) = std::cos((IPhi - 1) * 10.0 * DegToRadians); + state.dataWindowManager->CosPhiIndepVar(IPhi) = std::cos((IPhi - 1) * 10.0 * DataGlobalConstants::DegToRadians()); } } @@ -2234,7 +2234,7 @@ namespace WindowManager { state.dataWindowManager->nglface = 2 * state.dataWindowManager->ngllayer; ShadeFlag = SurfWinShadingFlag(SurfNum); state.dataWindowManager->tilt = surface.Tilt; - state.dataWindowManager->tiltr = state.dataWindowManager->tilt * DegToRadians; + state.dataWindowManager->tiltr = state.dataWindowManager->tilt * DataGlobalConstants::DegToRadians(); SurfNumAdj = surface.ExtBoundCond; state.dataWindowManager->hcin = HConvIn(SurfNum); // Room-side surface convective film conductance @@ -4796,7 +4796,7 @@ namespace WindowManager { asp = 1.524 / state.dataWindowManager->gap(IGap); } - state.dataWindowManager->tiltr = state.dataWindowManager->tilt * DegToRadians; + state.dataWindowManager->tiltr = state.dataWindowManager->tilt * DataGlobalConstants::DegToRadians(); ra = gr * pr; //! fw if (ra > 2.0e6): error that outside range of Rayleigh number? @@ -5613,7 +5613,7 @@ namespace WindowManager { // SUBROUTINE ARGUMENT DEFINITIONS: // 0,10,20,...,80,90 degress - Real64 const DPhiR(10.0 * DegToRadians); // Half of 10-deg incidence angle increment (radians) + Real64 const DPhiR(10.0 * DataGlobalConstants::DegToRadians()); // Half of 10-deg incidence angle increment (radians) int IPhi; // Incidence angle counter // FLOW @@ -5660,11 +5660,11 @@ namespace WindowManager { Sum = 0.0; SumDenom = 0.0; - DPhi = 5.0 * DegToRadians; + DPhi = 5.0 * DataGlobalConstants::DegToRadians(); // Integrate from -90 to 0 deg for (IPhi = 1; IPhi <= 18; ++IPhi) { - Phi = -PiOvr2 + (IPhi - 0.5) * DPhi; + Phi = -DataGlobalConstants::PiOvr2() + (IPhi - 0.5) * DPhi; Sum += std::cos(Phi) * DPhi * InterpProfAng(Phi, Property); SumDenom += std::cos(Phi) * DPhi; } @@ -5707,11 +5707,11 @@ namespace WindowManager { Sum = 0.0; SumDenom = 0.0; - DPhi = 5.0 * DegToRadians; + DPhi = 5.0 * DataGlobalConstants::DegToRadians(); // Integrate from 0 to 90 deg for (IPhi = 19; IPhi <= 36; ++IPhi) { - Phi = -PiOvr2 + (IPhi - 0.5) * DPhi; + Phi = -DataGlobalConstants::PiOvr2() + (IPhi - 0.5) * DPhi; Sum += std::cos(Phi) * DPhi * InterpProfAng(Phi, Property); SumDenom += std::cos(Phi) * DPhi; } @@ -6237,7 +6237,7 @@ namespace WindowManager { } else { VarSlats = false; if (Blind(BlNum).SlatAngleType == VariableSlats) VarSlats = true; - SlatAng = Blind(BlNum).SlatAngle * DegToRadians; + SlatAng = Blind(BlNum).SlatAngle * DataGlobalConstants::DegToRadians(); TBlBmBm = BlindBeamBeamTrans(0.0, SlatAng, Blind(BlNum).SlatWidth, Blind(BlNum).SlatSeparation, Blind(BlNum).SlatThickness); TBmBmBl = TBmBm * TBlBmBm; TBmBmBlVis = TBmBmVis * TBlBmBm; @@ -6527,7 +6527,7 @@ namespace WindowManager { TiltDeg = 90.0; - sineTilt = std::sin(TiltDeg * DegToRadians); // degrees as arg + sineTilt = std::sin(TiltDeg * DataGlobalConstants::DegToRadians()); // degrees as arg while (iter < MaxIterations && errtemp > errtemptol) { for (i = 1; i <= state.dataWindowManager->nglface; ++i) { @@ -7343,9 +7343,9 @@ namespace WindowManager { st_lay = 0.0; if (Blind(BlindNum).SlatAngleType == FixedSlats) { - bld_el = Blind(BlindNum).SlatAngle * DegToRadians; + bld_el = Blind(BlindNum).SlatAngle * DataGlobalConstants::DegToRadians(); } else { // Variable slat angle - bld_el = (Pi / (MaxSlatAngs - 1)) * (ISlatAng - 1); // 0 <= bld_el <= 180 deg + bld_el = (DataGlobalConstants::Pi() / (MaxSlatAngs - 1)) * (ISlatAng - 1); // 0 <= bld_el <= 180 deg } BlindOpticsDiffuse(BlindNum, ISolVis, bld_pr, bld_el, st_lay); @@ -7378,15 +7378,15 @@ namespace WindowManager { // (for MaxSlatAngs = 19). If blind has fixed slat angle, calculate properties at that angle only. for (IProfAng = 1; IProfAng <= 37; ++IProfAng) { - sun_el = -Pi / 2.0 + (Pi / 36.0) * (IProfAng - 1); + sun_el = -DataGlobalConstants::Pi() / 2.0 + (DataGlobalConstants::Pi() / 36.0) * (IProfAng - 1); sun_el_deg(IProfAng) = 57.2958 * sun_el; for (ISlatAng = 1; ISlatAng <= MaxSlatAngs; ++ISlatAng) { st_lay = 0.0; if (Blind(BlindNum).SlatAngleType == FixedSlats) { - bld_el = Blind(BlindNum).SlatAngle * DegToRadians; + bld_el = Blind(BlindNum).SlatAngle * DataGlobalConstants::DegToRadians(); } else { // Variable slat angle - bld_el = (Pi / (MaxSlatAngs - 1)) * (ISlatAng - 1); // 0 <= bld_el <= 180 deg + bld_el = (DataGlobalConstants::Pi() / (MaxSlatAngs - 1)) * (ISlatAng - 1); // 0 <= bld_el <= 180 deg } // Beam solar-optical properties of blind for given profile angle and slat angle @@ -7505,14 +7505,14 @@ namespace WindowManager { relativeAltitude.allocate(N, M); for (j = 0; j <= N - 1; ++j) { - Real64 currAzimuth = (90.0 / N) * j * DegToRadians; + Real64 currAzimuth = (90.0 / N) * j * DataGlobalConstants::DegToRadians(); sunAzimuth.push_back(currAzimuth); // Azimuth angle of sun during integration sin_sunAzimuth.push_back(std::sin(currAzimuth)); cos_sunAzimuth.push_back(std::cos(currAzimuth)); } for (i = 0; i <= M - 1; ++i) { - Real64 currAltitude = (90.0 / M) * i * DegToRadians; + Real64 currAltitude = (90.0 / M) * i * DataGlobalConstants::DegToRadians(); sunAltitude.push_back(currAltitude); // Altitude angle of sun during integration sin_sunAltitude.push_back(std::sin(currAltitude)); cos_sunAltitude.push_back(std::cos(currAltitude)); @@ -7636,8 +7636,8 @@ namespace WindowManager { ScreenTrans(ScreenNum).Scatt = 0.0; for (j = 90 / dataMaterial.Material(MatNum).ScreenMapResolution + 1; j >= 1; --j) { for (i = 90 / dataMaterial.Material(MatNum).ScreenMapResolution + 1; i >= 1; --i) { - Real64 SunAzimuth = dataMaterial.Material(MatNum).ScreenMapResolution * (j - 1) * DegToRadians; - Real64 SunAltitude = dataMaterial.Material(MatNum).ScreenMapResolution * (i - 1) * DegToRadians; + Real64 SunAzimuth = dataMaterial.Material(MatNum).ScreenMapResolution * (j - 1) * DataGlobalConstants::DegToRadians(); + Real64 SunAltitude = dataMaterial.Material(MatNum).ScreenMapResolution * (i - 1) * DataGlobalConstants::DegToRadians(); CalcScreenTransmittance(0, SunAltitude, SunAzimuth, ScreenNum); ScreenTrans(ScreenNum).Trans(i, j) = SurfaceScreens(ScreenNum).BmBmTrans; ScreenTrans(ScreenNum).Scatt(i, j) = SurfaceScreens(ScreenNum).BmDifTrans; @@ -7787,7 +7787,7 @@ namespace WindowManager { // Calculate view factors between slat sections (slat is divided longitudinally into two equal parts) - ViewFac(c(2), c(3), b_el, PiOvr2, F); + ViewFac(c(2), c(3), b_el, DataGlobalConstants::PiOvr2(), F); // Set up exchange matrix X for diffuse properties @@ -7837,7 +7837,7 @@ namespace WindowManager { // Slat edge correction factor phib = b_el; - delphis = PiOvr2 / 10.0; + delphis = DataGlobalConstants::PiOvr2() / 10.0; for (IUpDown = 1; IUpDown <= 2; ++IUpDown) { for (Iphis = 1; Iphis <= 10; ++Iphis) { phis = -(Iphis - 0.5) * delphis; @@ -7846,7 +7846,7 @@ namespace WindowManager { fEdge1 = 0.0; gamma = phib - phis; if (std::abs(std::sin(gamma)) > 0.01) { - if ((phib > 0.0 && phib <= PiOvr2 && phis <= phib) || (phib > PiOvr2 && phib <= Pi && phis > -(Pi - phib))) { + if ((phib > 0.0 && phib <= DataGlobalConstants::PiOvr2() && phis <= phib) || (phib > DataGlobalConstants::PiOvr2() && phib <= DataGlobalConstants::Pi() && phis > -(DataGlobalConstants::Pi() - phib))) { fEdge1 = Blind(BlindNum).SlatThickness * std::abs(std::sin(gamma)) / ((Blind(BlindNum).SlatSeparation + Blind(BlindNum).SlatThickness / std::abs(std::sin(phib))) * std::cos(phis)); } @@ -8115,7 +8115,7 @@ namespace WindowManager { // angle (135 deg). if (i == 2) { - phib = Pi - phib; + phib = DataGlobalConstants::Pi() - phib; } // Correction factor that accounts for finite thickness of slats. It is used to modify the @@ -8127,7 +8127,7 @@ namespace WindowManager { fEdge1 = 0.0; gamma = phib - phis; if (std::abs(std::sin(gamma)) > 0.01) { - if ((phib > 0.0 && phib <= PiOvr2 && phis <= phib) || (phib > PiOvr2 && phib <= Pi && phis > -(Pi - phib))) { + if ((phib > 0.0 && phib <= DataGlobalConstants::PiOvr2() && phis <= phib) || (phib > DataGlobalConstants::PiOvr2() && phib <= DataGlobalConstants::Pi() && phis > -(DataGlobalConstants::Pi() - phib))) { fEdge1 = Blind(BlindNum).SlatThickness * std::abs(std::sin(gamma)) / ((Blind(BlindNum).SlatSeparation + Blind(BlindNum).SlatThickness / std::abs(std::sin(phib))) * std::cos(phis)); } @@ -8162,7 +8162,7 @@ namespace WindowManager { InvertMatrix(X, Xinv, indx, 4, 4); // Set up sources for direct-diffuse slat properties - if (std::abs(phis - phib) <= PiOvr2) { // Beam hits front of slat + if (std::abs(phis - phib) <= DataGlobalConstants::PiOvr2()) { // Beam hits front of slat Q(3) = c(4) + c(7); // beam-beam trans of slat + beam-diff trans of slat Q(4) = c(5) + c(8); // front beam-beam refl of slat + front beam-diff refl of slat } else { // Beam hits back of slat diff --git a/src/EnergyPlus/WindowManagerExteriorData.cc b/src/EnergyPlus/WindowManagerExteriorData.cc index f6aeaf51f33..3143ffdd5ae 100644 --- a/src/EnergyPlus/WindowManagerExteriorData.cc +++ b/src/EnergyPlus/WindowManagerExteriorData.cc @@ -83,8 +83,8 @@ namespace WindowManager { Real64 Phi = 0; // get window tilt and azimuth - Real64 Gamma = DegToRadians * Surface(t_SurfNum).Tilt; - Real64 Alpha = DegToRadians * Surface(t_SurfNum).Azimuth; + Real64 Gamma = DataGlobalConstants::DegToRadians() * Surface(t_SurfNum).Tilt; + Real64 Alpha = DataGlobalConstants::DegToRadians() * Surface(t_SurfNum).Azimuth; int RadType = state.dataWindowComplexManager->Front_Incident; @@ -95,8 +95,8 @@ namespace WindowManager { // get the corresponding local Theta, Phi for ray W6CoordsFromWorldVect(state, t_Ray, RadType, Gamma, Alpha, Theta, Phi); - Theta = 180 / Pi * Theta; - Phi = 180 / Pi * Phi; + Theta = 180 / DataGlobalConstants::Pi() * Theta; + Phi = 180 / DataGlobalConstants::Pi() * Phi; return std::make_pair(Theta, Phi); } diff --git a/tst/EnergyPlus/unit/BaseboardRadiator.unit.cc b/tst/EnergyPlus/unit/BaseboardRadiator.unit.cc index 4a6fe8e6549..2a2565cde46 100644 --- a/tst/EnergyPlus/unit/BaseboardRadiator.unit.cc +++ b/tst/EnergyPlus/unit/BaseboardRadiator.unit.cc @@ -346,12 +346,12 @@ TEST_F(EnergyPlusFixture, BaseboardConvWater_SizingTest) SurfaceGeometry::CosZoneRelNorth.allocate(3); SurfaceGeometry::SinZoneRelNorth.allocate(3); - SurfaceGeometry::CosZoneRelNorth(1) = std::cos(-DataHeatBalance::Zone(1).RelNorth * DataGlobals::DegToRadians); - SurfaceGeometry::CosZoneRelNorth(2) = std::cos(-DataHeatBalance::Zone(2).RelNorth * DataGlobals::DegToRadians); - SurfaceGeometry::CosZoneRelNorth(3) = std::cos(-DataHeatBalance::Zone(3).RelNorth * DataGlobals::DegToRadians); - SurfaceGeometry::SinZoneRelNorth(1) = std::sin(-DataHeatBalance::Zone(1).RelNorth * DataGlobals::DegToRadians); - SurfaceGeometry::SinZoneRelNorth(2) = std::sin(-DataHeatBalance::Zone(2).RelNorth * DataGlobals::DegToRadians); - SurfaceGeometry::SinZoneRelNorth(3) = std::sin(-DataHeatBalance::Zone(3).RelNorth * DataGlobals::DegToRadians); + SurfaceGeometry::CosZoneRelNorth(1) = std::cos(-DataHeatBalance::Zone(1).RelNorth * DataGlobalConstants::DegToRadians()); + SurfaceGeometry::CosZoneRelNorth(2) = std::cos(-DataHeatBalance::Zone(2).RelNorth * DataGlobalConstants::DegToRadians()); + SurfaceGeometry::CosZoneRelNorth(3) = std::cos(-DataHeatBalance::Zone(3).RelNorth * DataGlobalConstants::DegToRadians()); + SurfaceGeometry::SinZoneRelNorth(1) = std::sin(-DataHeatBalance::Zone(1).RelNorth * DataGlobalConstants::DegToRadians()); + SurfaceGeometry::SinZoneRelNorth(2) = std::sin(-DataHeatBalance::Zone(2).RelNorth * DataGlobalConstants::DegToRadians()); + SurfaceGeometry::SinZoneRelNorth(3) = std::sin(-DataHeatBalance::Zone(3).RelNorth * DataGlobalConstants::DegToRadians()); SurfaceGeometry::CosBldgRelNorth = 1.0; SurfaceGeometry::SinBldgRelNorth = 0.0; diff --git a/tst/EnergyPlus/unit/DElightManager.unit.cc b/tst/EnergyPlus/unit/DElightManager.unit.cc index 0ce7e7235a3..e187e5d97d8 100644 --- a/tst/EnergyPlus/unit/DElightManager.unit.cc +++ b/tst/EnergyPlus/unit/DElightManager.unit.cc @@ -319,8 +319,8 @@ TEST_F(EnergyPlusFixture, DElightManagerF_GetInputDElightComplexFenestration_Tes SurfaceGeometry::CosZoneRelNorth.allocate(1); SurfaceGeometry::SinZoneRelNorth.allocate(1); - SurfaceGeometry::CosZoneRelNorth(1) = std::cos(-DataHeatBalance::Zone(1).RelNorth * DataGlobals::DegToRadians); - SurfaceGeometry::SinZoneRelNorth(1) = std::sin(-DataHeatBalance::Zone(1).RelNorth * DataGlobals::DegToRadians); + SurfaceGeometry::CosZoneRelNorth(1) = std::cos(-DataHeatBalance::Zone(1).RelNorth * DataGlobalConstants::DegToRadians()); + SurfaceGeometry::SinZoneRelNorth(1) = std::sin(-DataHeatBalance::Zone(1).RelNorth * DataGlobalConstants::DegToRadians()); SurfaceGeometry::CosBldgRelNorth = 1.0; SurfaceGeometry::SinBldgRelNorth = 0.0; diff --git a/tst/EnergyPlus/unit/DataSurfaces.unit.cc b/tst/EnergyPlus/unit/DataSurfaces.unit.cc index c4ecde08b77..36d2815e910 100644 --- a/tst/EnergyPlus/unit/DataSurfaces.unit.cc +++ b/tst/EnergyPlus/unit/DataSurfaces.unit.cc @@ -177,8 +177,8 @@ TEST_F(EnergyPlusFixture, DataSurfaces_SetSurfaceOutBulbTempAtTest) CosZoneRelNorth.allocate(1); SinZoneRelNorth.allocate(1); - CosZoneRelNorth(1) = std::cos(-Zone(1).RelNorth * DegToRadians); - SinZoneRelNorth(1) = std::sin(-Zone(1).RelNorth * DegToRadians); + CosZoneRelNorth(1) = std::cos(-Zone(1).RelNorth * DataGlobalConstants::DegToRadians()); + SinZoneRelNorth(1) = std::sin(-Zone(1).RelNorth * DataGlobalConstants::DegToRadians()); CosBldgRelNorth = 1.0; SinBldgRelNorth = 0.0; @@ -254,45 +254,45 @@ TEST_F(EnergyPlusFixture, SurfaceTest_AverageHeightRectangle) s.Vertex = {Vector(0, 0, 0), Vector(1, 0, 0), Vector(1, 1, 0), Vector(0, 1, 0)}; Vectors::CreateNewellSurfaceNormalVector(s.Vertex, s.Vertex.size(), s.NewellSurfaceNormalVector); Vectors::DetermineAzimuthAndTilt(s.Vertex,s.Vertex.size(),s.Azimuth,s.Tilt,s.lcsx,s.lcsy,s.lcsz,s.GrossArea,s.NewellSurfaceNormalVector); - s.SinAzim = std::sin(s.Azimuth * DegToRadians); - s.CosAzim = std::cos(s.Azimuth * DegToRadians); - s.SinTilt = std::sin(s.Tilt * DegToRadians); + s.SinAzim = std::sin(s.Azimuth * DataGlobalConstants::DegToRadians()); + s.CosAzim = std::cos(s.Azimuth * DataGlobalConstants::DegToRadians()); + s.SinTilt = std::sin(s.Tilt * DataGlobalConstants::DegToRadians()); EXPECT_DOUBLE_EQ(s.get_average_height(), 0.0); s.Vertex = {Vector(0, 0, 0), Vector(1, 1, 0), Vector(1, 1, 1), Vector(0, 0, 1)}; Vectors::CreateNewellSurfaceNormalVector(s.Vertex, s.Vertex.size(), s.NewellSurfaceNormalVector); Vectors::DetermineAzimuthAndTilt(s.Vertex,s.Vertex.size(),s.Azimuth,s.Tilt,s.lcsx,s.lcsy,s.lcsz,s.GrossArea,s.NewellSurfaceNormalVector); - s.SinAzim = std::sin(s.Azimuth * DegToRadians); - s.CosAzim = std::cos(s.Azimuth * DegToRadians); - s.SinTilt = std::sin(s.Tilt * DegToRadians); + s.SinAzim = std::sin(s.Azimuth * DataGlobalConstants::DegToRadians()); + s.CosAzim = std::cos(s.Azimuth * DataGlobalConstants::DegToRadians()); + s.SinTilt = std::sin(s.Tilt * DataGlobalConstants::DegToRadians()); EXPECT_DOUBLE_EQ(s.get_average_height(), 1.0); s.Vertex = {Vector(0, 0, 0), Vector(1, 0, 0), Vector(1, 1, 1), Vector(0, 1, 1)}; Vectors::CreateNewellSurfaceNormalVector(s.Vertex, s.Vertex.size(), s.NewellSurfaceNormalVector); Vectors::DetermineAzimuthAndTilt(s.Vertex,s.Vertex.size(),s.Azimuth,s.Tilt,s.lcsx,s.lcsy,s.lcsz,s.GrossArea,s.NewellSurfaceNormalVector); - s.SinAzim = std::sin(s.Azimuth * DegToRadians); - s.CosAzim = std::cos(s.Azimuth * DegToRadians); - s.SinTilt = std::sin(s.Tilt * DegToRadians); + s.SinAzim = std::sin(s.Azimuth * DataGlobalConstants::DegToRadians()); + s.CosAzim = std::cos(s.Azimuth * DataGlobalConstants::DegToRadians()); + s.SinTilt = std::sin(s.Tilt * DataGlobalConstants::DegToRadians()); EXPECT_DOUBLE_EQ(s.get_average_height(), 1.0 / s.SinTilt ); s.Vertex = { Vector(0, 0, 0), Vector(0, 1, 0), Vector(0, 1, 1), Vector(0, 0, 1) }; Vectors::CreateNewellSurfaceNormalVector(s.Vertex, s.Vertex.size(), s.NewellSurfaceNormalVector); Vectors::DetermineAzimuthAndTilt(s.Vertex, s.Vertex.size(), s.Azimuth, s.Tilt, s.lcsx, s.lcsy, s.lcsz, s.GrossArea, s.NewellSurfaceNormalVector); - s.SinAzim = std::sin(s.Azimuth * DegToRadians); - s.CosAzim = std::cos(s.Azimuth * DegToRadians); - s.SinTilt = std::sin(s.Tilt * DegToRadians); + s.SinAzim = std::sin(s.Azimuth * DataGlobalConstants::DegToRadians()); + s.CosAzim = std::cos(s.Azimuth * DataGlobalConstants::DegToRadians()); + s.SinTilt = std::sin(s.Tilt * DataGlobalConstants::DegToRadians()); EXPECT_DOUBLE_EQ(s.get_average_height(), 1.0); s.Vertex = { Vector(1, -1, 0), Vector(1, -1, -1), Vector(0, 0, -1), Vector(0, 0, 0) }; Vectors::CreateNewellSurfaceNormalVector(s.Vertex, s.Vertex.size(), s.NewellSurfaceNormalVector); Vectors::DetermineAzimuthAndTilt(s.Vertex, s.Vertex.size(), s.Azimuth, s.Tilt, s.lcsx, s.lcsy, s.lcsz, s.GrossArea, s.NewellSurfaceNormalVector); - s.SinAzim = std::sin(s.Azimuth * DegToRadians); - s.CosAzim = std::cos(s.Azimuth * DegToRadians); - s.SinTilt = std::sin(s.Tilt * DegToRadians); + s.SinAzim = std::sin(s.Azimuth * DataGlobalConstants::DegToRadians()); + s.CosAzim = std::cos(s.Azimuth * DataGlobalConstants::DegToRadians()); + s.SinTilt = std::sin(s.Tilt * DataGlobalConstants::DegToRadians()); EXPECT_DOUBLE_EQ(s.get_average_height(), 1.0); @@ -309,18 +309,18 @@ TEST_F(EnergyPlusFixture, SurfaceTest_AverageHeightTriangle) s.Vertex = {Vector(0, 0, 0), Vector(1, 0, 0), Vector(1, 0, 1)}; Vectors::CreateNewellSurfaceNormalVector(s.Vertex, s.Vertex.size(), s.NewellSurfaceNormalVector); Vectors::DetermineAzimuthAndTilt(s.Vertex,s.Vertex.size(),s.Azimuth,s.Tilt,s.lcsx,s.lcsy,s.lcsz,s.GrossArea,s.NewellSurfaceNormalVector); - s.SinAzim = std::sin(s.Azimuth * DegToRadians); - s.CosAzim = std::cos(s.Azimuth * DegToRadians); - s.SinTilt = std::sin(s.Tilt * DegToRadians); + s.SinAzim = std::sin(s.Azimuth * DataGlobalConstants::DegToRadians()); + s.CosAzim = std::cos(s.Azimuth * DataGlobalConstants::DegToRadians()); + s.SinTilt = std::sin(s.Tilt * DataGlobalConstants::DegToRadians()); EXPECT_DOUBLE_EQ(s.get_average_height(), 0.5); s.Vertex = {Vector(0, 0, 0), Vector(0, 0, 1), Vector(1, 0, 0)}; Vectors::CreateNewellSurfaceNormalVector(s.Vertex, s.Vertex.size(), s.NewellSurfaceNormalVector); Vectors::DetermineAzimuthAndTilt(s.Vertex,s.Vertex.size(),s.Azimuth,s.Tilt,s.lcsx,s.lcsy,s.lcsz,s.GrossArea,s.NewellSurfaceNormalVector); - s.SinAzim = std::sin(s.Azimuth * DegToRadians); - s.CosAzim = std::cos(s.Azimuth * DegToRadians); - s.SinTilt = std::sin(s.Tilt * DegToRadians); + s.SinAzim = std::sin(s.Azimuth * DataGlobalConstants::DegToRadians()); + s.CosAzim = std::cos(s.Azimuth * DataGlobalConstants::DegToRadians()); + s.SinTilt = std::sin(s.Tilt * DataGlobalConstants::DegToRadians()); EXPECT_DOUBLE_EQ(s.get_average_height(), 0.5); } @@ -336,18 +336,18 @@ TEST_F(EnergyPlusFixture, SurfaceTest_AverageHeightL) s.Vertex = {Vector(0, 0, 0), Vector(0, 0, 1), Vector(0.5, 0, 1), Vector(0.5, 0, 0.5), Vector(1, 0, 0.5), Vector(1, 0, 0)}; Vectors::CreateNewellSurfaceNormalVector(s.Vertex, s.Vertex.size(), s.NewellSurfaceNormalVector); Vectors::DetermineAzimuthAndTilt(s.Vertex,s.Vertex.size(),s.Azimuth,s.Tilt,s.lcsx,s.lcsy,s.lcsz,s.GrossArea,s.NewellSurfaceNormalVector); - s.SinAzim = std::sin(s.Azimuth * DegToRadians); - s.CosAzim = std::cos(s.Azimuth * DegToRadians); - s.SinTilt = std::sin(s.Tilt * DegToRadians); + s.SinAzim = std::sin(s.Azimuth * DataGlobalConstants::DegToRadians()); + s.CosAzim = std::cos(s.Azimuth * DataGlobalConstants::DegToRadians()); + s.SinTilt = std::sin(s.Tilt * DataGlobalConstants::DegToRadians()); EXPECT_DOUBLE_EQ(s.get_average_height(), 0.75); s.Vertex = {Vector(0, 0, 0), Vector(0, 0, 1), Vector(1, 0, 1), Vector(1, 0, 0.5), Vector(0.5, 0, 0.5), Vector(0.5, 0, 0)}; Vectors::CreateNewellSurfaceNormalVector(s.Vertex, s.Vertex.size(), s.NewellSurfaceNormalVector); Vectors::DetermineAzimuthAndTilt(s.Vertex,s.Vertex.size(),s.Azimuth,s.Tilt,s.lcsx,s.lcsy,s.lcsz,s.GrossArea,s.NewellSurfaceNormalVector); - s.SinAzim = std::sin(s.Azimuth * DegToRadians); - s.CosAzim = std::cos(s.Azimuth * DegToRadians); - s.SinTilt = std::sin(s.Tilt * DegToRadians); + s.SinAzim = std::sin(s.Azimuth * DataGlobalConstants::DegToRadians()); + s.CosAzim = std::cos(s.Azimuth * DataGlobalConstants::DegToRadians()); + s.SinTilt = std::sin(s.Tilt * DataGlobalConstants::DegToRadians()); EXPECT_DOUBLE_EQ(s.get_average_height(), 0.75); } diff --git a/tst/EnergyPlus/unit/DaylightingManager.unit.cc b/tst/EnergyPlus/unit/DaylightingManager.unit.cc index 4816deed89d..8c89b173e91 100644 --- a/tst/EnergyPlus/unit/DaylightingManager.unit.cc +++ b/tst/EnergyPlus/unit/DaylightingManager.unit.cc @@ -824,10 +824,10 @@ TEST_F(EnergyPlusFixture, DaylightingManager_GetDaylParamInGeoTrans_Test) SurfaceGeometry::CosZoneRelNorth.allocate(2); SurfaceGeometry::SinZoneRelNorth.allocate(2); - SurfaceGeometry::CosZoneRelNorth(1) = std::cos(-DataHeatBalance::Zone(1).RelNorth * DataGlobals::DegToRadians); - SurfaceGeometry::SinZoneRelNorth(1) = std::sin(-DataHeatBalance::Zone(1).RelNorth * DataGlobals::DegToRadians); - SurfaceGeometry::CosZoneRelNorth(2) = std::cos(-DataHeatBalance::Zone(2).RelNorth * DataGlobals::DegToRadians); - SurfaceGeometry::SinZoneRelNorth(2) = std::sin(-DataHeatBalance::Zone(2).RelNorth * DataGlobals::DegToRadians); + SurfaceGeometry::CosZoneRelNorth(1) = std::cos(-DataHeatBalance::Zone(1).RelNorth * DataGlobalConstants::DegToRadians()); + SurfaceGeometry::SinZoneRelNorth(1) = std::sin(-DataHeatBalance::Zone(1).RelNorth * DataGlobalConstants::DegToRadians()); + SurfaceGeometry::CosZoneRelNorth(2) = std::cos(-DataHeatBalance::Zone(2).RelNorth * DataGlobalConstants::DegToRadians()); + SurfaceGeometry::SinZoneRelNorth(2) = std::sin(-DataHeatBalance::Zone(2).RelNorth * DataGlobalConstants::DegToRadians()); SurfaceGeometry::CosBldgRelNorth = 1.0; SurfaceGeometry::SinBldgRelNorth = 0.0; @@ -2098,10 +2098,10 @@ TEST_F(EnergyPlusFixture, DaylightingManager_OutputFormats) SurfaceGeometry::CosZoneRelNorth.allocate(2); SurfaceGeometry::SinZoneRelNorth.allocate(2); - SurfaceGeometry::CosZoneRelNorth(1) = std::cos(-DataHeatBalance::Zone(1).RelNorth * DataGlobals::DegToRadians); - SurfaceGeometry::SinZoneRelNorth(1) = std::sin(-DataHeatBalance::Zone(1).RelNorth * DataGlobals::DegToRadians); - SurfaceGeometry::CosZoneRelNorth(2) = std::cos(-DataHeatBalance::Zone(2).RelNorth * DataGlobals::DegToRadians); - SurfaceGeometry::SinZoneRelNorth(2) = std::sin(-DataHeatBalance::Zone(2).RelNorth * DataGlobals::DegToRadians); + SurfaceGeometry::CosZoneRelNorth(1) = std::cos(-DataHeatBalance::Zone(1).RelNorth * DataGlobalConstants::DegToRadians()); + SurfaceGeometry::SinZoneRelNorth(1) = std::sin(-DataHeatBalance::Zone(1).RelNorth * DataGlobalConstants::DegToRadians()); + SurfaceGeometry::CosZoneRelNorth(2) = std::cos(-DataHeatBalance::Zone(2).RelNorth * DataGlobalConstants::DegToRadians()); + SurfaceGeometry::SinZoneRelNorth(2) = std::sin(-DataHeatBalance::Zone(2).RelNorth * DataGlobalConstants::DegToRadians()); SurfaceGeometry::CosBldgRelNorth = 1.0; SurfaceGeometry::SinBldgRelNorth = 0.0; @@ -2843,10 +2843,10 @@ TEST_F(EnergyPlusFixture, DaylightingManager_TDD_NoDaylightingControls) SurfaceGeometry::CosZoneRelNorth.allocate(2); SurfaceGeometry::SinZoneRelNorth.allocate(2); - SurfaceGeometry::CosZoneRelNorth(1) = std::cos(-DataHeatBalance::Zone(1).RelNorth * DataGlobals::DegToRadians); - SurfaceGeometry::SinZoneRelNorth(1) = std::sin(-DataHeatBalance::Zone(1).RelNorth * DataGlobals::DegToRadians); - SurfaceGeometry::CosZoneRelNorth(2) = std::cos(-DataHeatBalance::Zone(2).RelNorth * DataGlobals::DegToRadians); - SurfaceGeometry::SinZoneRelNorth(2) = std::sin(-DataHeatBalance::Zone(2).RelNorth * DataGlobals::DegToRadians); + SurfaceGeometry::CosZoneRelNorth(1) = std::cos(-DataHeatBalance::Zone(1).RelNorth * DataGlobalConstants::DegToRadians()); + SurfaceGeometry::SinZoneRelNorth(1) = std::sin(-DataHeatBalance::Zone(1).RelNorth * DataGlobalConstants::DegToRadians()); + SurfaceGeometry::CosZoneRelNorth(2) = std::cos(-DataHeatBalance::Zone(2).RelNorth * DataGlobalConstants::DegToRadians()); + SurfaceGeometry::SinZoneRelNorth(2) = std::sin(-DataHeatBalance::Zone(2).RelNorth * DataGlobalConstants::DegToRadians()); SurfaceGeometry::CosBldgRelNorth = 1.0; SurfaceGeometry::SinBldgRelNorth = 0.0; diff --git a/tst/EnergyPlus/unit/ElectricBaseboardRadiator.unit.cc b/tst/EnergyPlus/unit/ElectricBaseboardRadiator.unit.cc index 4b516e61a8f..8822231a657 100644 --- a/tst/EnergyPlus/unit/ElectricBaseboardRadiator.unit.cc +++ b/tst/EnergyPlus/unit/ElectricBaseboardRadiator.unit.cc @@ -284,10 +284,10 @@ TEST_F(EnergyPlusFixture, RadConvElecBaseboard_Test1) SurfaceGeometry::CosZoneRelNorth.allocate(2); SurfaceGeometry::SinZoneRelNorth.allocate(2); - SurfaceGeometry::CosZoneRelNorth(1) = std::cos(-DataHeatBalance::Zone(1).RelNorth * DataGlobals::DegToRadians); - SurfaceGeometry::CosZoneRelNorth(2) = std::cos(-DataHeatBalance::Zone(2).RelNorth * DataGlobals::DegToRadians); - SurfaceGeometry::SinZoneRelNorth(1) = std::sin(-DataHeatBalance::Zone(1).RelNorth * DataGlobals::DegToRadians); - SurfaceGeometry::SinZoneRelNorth(2) = std::sin(-DataHeatBalance::Zone(2).RelNorth * DataGlobals::DegToRadians); + SurfaceGeometry::CosZoneRelNorth(1) = std::cos(-DataHeatBalance::Zone(1).RelNorth * DataGlobalConstants::DegToRadians()); + SurfaceGeometry::CosZoneRelNorth(2) = std::cos(-DataHeatBalance::Zone(2).RelNorth * DataGlobalConstants::DegToRadians()); + SurfaceGeometry::SinZoneRelNorth(1) = std::sin(-DataHeatBalance::Zone(1).RelNorth * DataGlobalConstants::DegToRadians()); + SurfaceGeometry::SinZoneRelNorth(2) = std::sin(-DataHeatBalance::Zone(2).RelNorth * DataGlobalConstants::DegToRadians()); SurfaceGeometry::CosBldgRelNorth = 1.0; SurfaceGeometry::SinBldgRelNorth = 0.0; @@ -575,12 +575,12 @@ TEST_F(EnergyPlusFixture, ElectricBaseboardRadConv_SizingTest) SurfaceGeometry::CosZoneRelNorth.allocate(3); SurfaceGeometry::SinZoneRelNorth.allocate(3); - SurfaceGeometry::CosZoneRelNorth(1) = std::cos(-DataHeatBalance::Zone(1).RelNorth * DataGlobals::DegToRadians); - SurfaceGeometry::CosZoneRelNorth(2) = std::cos(-DataHeatBalance::Zone(2).RelNorth * DataGlobals::DegToRadians); - SurfaceGeometry::CosZoneRelNorth(3) = std::cos(-DataHeatBalance::Zone(3).RelNorth * DataGlobals::DegToRadians); - SurfaceGeometry::SinZoneRelNorth(1) = std::sin(-DataHeatBalance::Zone(1).RelNorth * DataGlobals::DegToRadians); - SurfaceGeometry::SinZoneRelNorth(2) = std::sin(-DataHeatBalance::Zone(2).RelNorth * DataGlobals::DegToRadians); - SurfaceGeometry::SinZoneRelNorth(3) = std::sin(-DataHeatBalance::Zone(3).RelNorth * DataGlobals::DegToRadians); + SurfaceGeometry::CosZoneRelNorth(1) = std::cos(-DataHeatBalance::Zone(1).RelNorth * DataGlobalConstants::DegToRadians()); + SurfaceGeometry::CosZoneRelNorth(2) = std::cos(-DataHeatBalance::Zone(2).RelNorth * DataGlobalConstants::DegToRadians()); + SurfaceGeometry::CosZoneRelNorth(3) = std::cos(-DataHeatBalance::Zone(3).RelNorth * DataGlobalConstants::DegToRadians()); + SurfaceGeometry::SinZoneRelNorth(1) = std::sin(-DataHeatBalance::Zone(1).RelNorth * DataGlobalConstants::DegToRadians()); + SurfaceGeometry::SinZoneRelNorth(2) = std::sin(-DataHeatBalance::Zone(2).RelNorth * DataGlobalConstants::DegToRadians()); + SurfaceGeometry::SinZoneRelNorth(3) = std::sin(-DataHeatBalance::Zone(3).RelNorth * DataGlobalConstants::DegToRadians()); SurfaceGeometry::CosBldgRelNorth = 1.0; SurfaceGeometry::SinBldgRelNorth = 0.0; diff --git a/tst/EnergyPlus/unit/FiniteDifferenceGroundTemperatureModel.unit.cc b/tst/EnergyPlus/unit/FiniteDifferenceGroundTemperatureModel.unit.cc index d304dfbe9b4..798c577c497 100644 --- a/tst/EnergyPlus/unit/FiniteDifferenceGroundTemperatureModel.unit.cc +++ b/tst/EnergyPlus/unit/FiniteDifferenceGroundTemperatureModel.unit.cc @@ -69,7 +69,6 @@ using namespace EnergyPlus; TEST_F(EnergyPlusFixture, FiniteDiffGroundTempModelTest) { - using DataGlobals::Pi; using namespace DataIPShortCuts; std::shared_ptr thisModel(new FiniteDiffGroundTempsModel()); @@ -100,8 +99,8 @@ TEST_F(EnergyPlusFixture, FiniteDiffGroundTempModelTest) for (int day = 1; day <= state.dataWeatherManager->NumDaysInYear; ++day) { auto &tdwd = thisModel->weatherDataArray(day); // "This day weather data" - Real64 theta = 2 * Pi * day / state.dataWeatherManager->NumDaysInYear; - Real64 omega = 2 * Pi * 130 / state.dataWeatherManager->NumDaysInYear; // Shifts min to around the end of Jan + Real64 theta = 2 * DataGlobalConstants::Pi() * day / state.dataWeatherManager->NumDaysInYear; + Real64 omega = 2 * DataGlobalConstants::Pi() * 130 / state.dataWeatherManager->NumDaysInYear; // Shifts min to around the end of Jan tdwd.dryBulbTemp = drybulb_amp * std::sin(theta - omega) + (drybulb_minTemp + drybulb_amp); tdwd.relativeHumidity = relHum_const; diff --git a/tst/EnergyPlus/unit/OutputReports.unit.cc b/tst/EnergyPlus/unit/OutputReports.unit.cc index b66616ecbfd..1d9eaf6c3cd 100644 --- a/tst/EnergyPlus/unit/OutputReports.unit.cc +++ b/tst/EnergyPlus/unit/OutputReports.unit.cc @@ -138,8 +138,8 @@ TEST_F(EnergyPlusFixture, OutputReports_SurfaceDetailsReport) SurfaceGeometry::CosZoneRelNorth.allocate(1); SurfaceGeometry::SinZoneRelNorth.allocate(1); - SurfaceGeometry::CosZoneRelNorth(1) = std::cos(-DataHeatBalance::Zone(1).RelNorth * DataGlobals::DegToRadians); - SurfaceGeometry::SinZoneRelNorth(1) = std::sin(-DataHeatBalance::Zone(1).RelNorth * DataGlobals::DegToRadians); + SurfaceGeometry::CosZoneRelNorth(1) = std::cos(-DataHeatBalance::Zone(1).RelNorth * DataGlobalConstants::DegToRadians()); + SurfaceGeometry::SinZoneRelNorth(1) = std::sin(-DataHeatBalance::Zone(1).RelNorth * DataGlobalConstants::DegToRadians()); SurfaceGeometry::CosBldgRelNorth = 1.0; SurfaceGeometry::SinBldgRelNorth = 0.0; diff --git a/tst/EnergyPlus/unit/SolarShading.unit.cc b/tst/EnergyPlus/unit/SolarShading.unit.cc index 117040b201f..210df5759db 100644 --- a/tst/EnergyPlus/unit/SolarShading.unit.cc +++ b/tst/EnergyPlus/unit/SolarShading.unit.cc @@ -640,8 +640,8 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_FigureSolarBeamAtTimestep) SurfaceGeometry::CosZoneRelNorth.allocate(1); SurfaceGeometry::SinZoneRelNorth.allocate(1); - SurfaceGeometry::CosZoneRelNorth(1) = std::cos(-Zone(1).RelNorth * DegToRadians); - SurfaceGeometry::SinZoneRelNorth(1) = std::sin(-Zone(1).RelNorth * DegToRadians); + SurfaceGeometry::CosZoneRelNorth(1) = std::cos(-Zone(1).RelNorth * DataGlobalConstants::DegToRadians()); + SurfaceGeometry::SinZoneRelNorth(1) = std::sin(-Zone(1).RelNorth * DataGlobalConstants::DegToRadians()); SurfaceGeometry::CosBldgRelNorth = 1.0; SurfaceGeometry::SinBldgRelNorth = 0.0; @@ -1040,8 +1040,8 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_ExternalShadingIO) SurfaceGeometry::CosZoneRelNorth.allocate(1); SurfaceGeometry::SinZoneRelNorth.allocate(1); - SurfaceGeometry::CosZoneRelNorth(1) = std::cos(-Zone(1).RelNorth * DegToRadians); - SurfaceGeometry::SinZoneRelNorth(1) = std::sin(-Zone(1).RelNorth * DegToRadians); + SurfaceGeometry::CosZoneRelNorth(1) = std::cos(-Zone(1).RelNorth * DataGlobalConstants::DegToRadians()); + SurfaceGeometry::SinZoneRelNorth(1) = std::sin(-Zone(1).RelNorth * DataGlobalConstants::DegToRadians()); SurfaceGeometry::CosBldgRelNorth = 1.0; SurfaceGeometry::SinBldgRelNorth = 0.0; @@ -1453,8 +1453,8 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_DisableGroupSelfShading) SurfaceGeometry::CosZoneRelNorth.allocate(1); SurfaceGeometry::SinZoneRelNorth.allocate(1); - SurfaceGeometry::CosZoneRelNorth(1) = std::cos(-Zone(1).RelNorth * DegToRadians); - SurfaceGeometry::SinZoneRelNorth(1) = std::sin(-Zone(1).RelNorth * DegToRadians); + SurfaceGeometry::CosZoneRelNorth(1) = std::cos(-Zone(1).RelNorth * DataGlobalConstants::DegToRadians()); + SurfaceGeometry::SinZoneRelNorth(1) = std::sin(-Zone(1).RelNorth * DataGlobalConstants::DegToRadians()); SurfaceGeometry::CosBldgRelNorth = 1.0; SurfaceGeometry::SinBldgRelNorth = 0.0; @@ -1821,8 +1821,8 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_PolygonClippingDirect) SurfaceGeometry::CosZoneRelNorth.allocate(1); SurfaceGeometry::SinZoneRelNorth.allocate(1); - SurfaceGeometry::CosZoneRelNorth(1) = std::cos(-Zone(1).RelNorth * DegToRadians); - SurfaceGeometry::SinZoneRelNorth(1) = std::sin(-Zone(1).RelNorth * DegToRadians); + SurfaceGeometry::CosZoneRelNorth(1) = std::cos(-Zone(1).RelNorth * DataGlobalConstants::DegToRadians()); + SurfaceGeometry::SinZoneRelNorth(1) = std::sin(-Zone(1).RelNorth * DataGlobalConstants::DegToRadians()); SurfaceGeometry::CosBldgRelNorth = 1.0; SurfaceGeometry::SinBldgRelNorth = 0.0; @@ -2228,8 +2228,8 @@ WindowMaterial:SimpleGlazingSystem, SurfaceGeometry::CosZoneRelNorth.allocate(1); SurfaceGeometry::SinZoneRelNorth.allocate(1); - SurfaceGeometry::CosZoneRelNorth(1) = std::cos(-Zone(1).RelNorth * DegToRadians); - SurfaceGeometry::SinZoneRelNorth(1) = std::sin(-Zone(1).RelNorth * DegToRadians); + SurfaceGeometry::CosZoneRelNorth(1) = std::cos(-Zone(1).RelNorth * DataGlobalConstants::DegToRadians()); + SurfaceGeometry::SinZoneRelNorth(1) = std::sin(-Zone(1).RelNorth * DataGlobalConstants::DegToRadians()); SurfaceGeometry::CosBldgRelNorth = 1.0; SurfaceGeometry::SinBldgRelNorth = 0.0; @@ -2540,8 +2540,8 @@ EXPECT_FALSE(FoundError); SurfaceGeometry::CosZoneRelNorth.allocate(1); SurfaceGeometry::SinZoneRelNorth.allocate(1); -SurfaceGeometry::CosZoneRelNorth(1) = std::cos(-Zone(1).RelNorth * DegToRadians); -SurfaceGeometry::SinZoneRelNorth(1) = std::sin(-Zone(1).RelNorth * DegToRadians); +SurfaceGeometry::CosZoneRelNorth(1) = std::cos(-Zone(1).RelNorth * DataGlobalConstants::DegToRadians()); +SurfaceGeometry::SinZoneRelNorth(1) = std::sin(-Zone(1).RelNorth * DataGlobalConstants::DegToRadians()); SurfaceGeometry::CosBldgRelNorth = 1.0; SurfaceGeometry::SinBldgRelNorth = 0.0; diff --git a/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc b/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc index 29fece299c4..ee7fe7098e9 100644 --- a/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc +++ b/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc @@ -482,8 +482,8 @@ TEST_F(EnergyPlusFixture, DataSurfaces_SurfaceShape) CosZoneRelNorth.allocate(1); SinZoneRelNorth.allocate(1); - CosZoneRelNorth(1) = std::cos(-Zone(1).RelNorth * DataGlobals::DegToRadians); - SinZoneRelNorth(1) = std::sin(-Zone(1).RelNorth * DataGlobals::DegToRadians); + CosZoneRelNorth(1) = std::cos(-Zone(1).RelNorth * DataGlobalConstants::DegToRadians()); + SinZoneRelNorth(1) = std::sin(-Zone(1).RelNorth * DataGlobalConstants::DegToRadians()); CosBldgRelNorth = 1.0; SinBldgRelNorth = 0.0; @@ -934,8 +934,8 @@ TEST_F(EnergyPlusFixture, MakeEquivalentRectangle) EXPECT_FALSE(ErrorsFound); CosZoneRelNorth.allocate(1); SinZoneRelNorth.allocate(1); - CosZoneRelNorth(1) = std::cos(-Zone(1).RelNorth * DataGlobals::DegToRadians); - SinZoneRelNorth(1) = std::sin(-Zone(1).RelNorth * DataGlobals::DegToRadians); + CosZoneRelNorth(1) = std::cos(-Zone(1).RelNorth * DataGlobalConstants::DegToRadians()); + SinZoneRelNorth(1) = std::sin(-Zone(1).RelNorth * DataGlobalConstants::DegToRadians()); CosBldgRelNorth = 1.0; SinBldgRelNorth = 0.0; GetSurfaceData(state, ErrorsFound); // setup zone geometry and get zone data @@ -2837,8 +2837,8 @@ TEST_F(EnergyPlusFixture, MakeRectangularVertices) CosZoneRelNorth.allocate(zoneNum); SinZoneRelNorth.allocate(zoneNum); - CosZoneRelNorth(zoneNum) = std::cos(-Zone(zoneNum).RelNorth * DataGlobals::DegToRadians); - SinZoneRelNorth(zoneNum) = std::sin(-Zone(zoneNum).RelNorth * DataGlobals::DegToRadians); + CosZoneRelNorth(zoneNum) = std::cos(-Zone(zoneNum).RelNorth * DataGlobalConstants::DegToRadians()); + SinZoneRelNorth(zoneNum) = std::sin(-Zone(zoneNum).RelNorth * DataGlobalConstants::DegToRadians()); CosBldgRelNorth = 1.0; SinBldgRelNorth = 0.0; @@ -3890,8 +3890,8 @@ TEST_F(EnergyPlusFixture, SurfaceGeometry_HeatTransferAlgorithmTest) CosZoneRelNorth.allocate(2); SinZoneRelNorth.allocate(2); - CosZoneRelNorth(1) = std::cos(-Zone(1).RelNorth * DataGlobals::DegToRadians); - SinZoneRelNorth(1) = std::sin(-Zone(1).RelNorth * DataGlobals::DegToRadians); + CosZoneRelNorth(1) = std::cos(-Zone(1).RelNorth * DataGlobalConstants::DegToRadians()); + SinZoneRelNorth(1) = std::sin(-Zone(1).RelNorth * DataGlobalConstants::DegToRadians()); CosZoneRelNorth(2) = CosZoneRelNorth(1); SinZoneRelNorth(2) = SinZoneRelNorth(1); CosBldgRelNorth = 1.0; diff --git a/tst/EnergyPlus/unit/TranspiredCollector.unit.cc b/tst/EnergyPlus/unit/TranspiredCollector.unit.cc index 604b6f4a0a6..683fbae114c 100644 --- a/tst/EnergyPlus/unit/TranspiredCollector.unit.cc +++ b/tst/EnergyPlus/unit/TranspiredCollector.unit.cc @@ -224,8 +224,8 @@ TEST_F(EnergyPlusFixture, TranspiredCollectors_InitTranspiredCollectorTest) CosZoneRelNorth.allocate(1); SinZoneRelNorth.allocate(1); - CosZoneRelNorth(1) = std::cos(-Zone(1).RelNorth * DataGlobals::DegToRadians); - SinZoneRelNorth(1) = std::sin(-Zone(1).RelNorth * DataGlobals::DegToRadians); + CosZoneRelNorth(1) = std::cos(-Zone(1).RelNorth * DataGlobalConstants::DegToRadians()); + SinZoneRelNorth(1) = std::sin(-Zone(1).RelNorth * DataGlobalConstants::DegToRadians()); CosBldgRelNorth = 1.0; SinBldgRelNorth = 0.0; diff --git a/tst/EnergyPlus/unit/WindowEquivalentLayer.unit.cc b/tst/EnergyPlus/unit/WindowEquivalentLayer.unit.cc index 06dcf0ca665..8854b8b4a4b 100644 --- a/tst/EnergyPlus/unit/WindowEquivalentLayer.unit.cc +++ b/tst/EnergyPlus/unit/WindowEquivalentLayer.unit.cc @@ -552,7 +552,7 @@ TEST_F(EnergyPlusFixture, WindowEquivalentLayer_VBMaximizeBeamSolar) EXPECT_NEAR(-71.0772, DataSurfaces::SurfWinSlatAngThisTSDeg(SurfNum), 0.0001); // check that for MaximizeSolar slat angle control, the slat angle = -ve vertical profile angle DaylightingManager::ProfileAngle(SurfNum, DataEnvironment::SOLCOS, DataHeatBalance::Horizontal, ProfAngVer); - EXPECT_NEAR(-DataGlobals::RadToDeg * ProfAngVer, DataSurfaces::SurfWinSlatAngThisTSDeg(SurfNum), 0.0001); + EXPECT_NEAR(-DataGlobalConstants::RadToDeg() * ProfAngVer, DataSurfaces::SurfWinSlatAngThisTSDeg(SurfNum), 0.0001); } TEST_F(EnergyPlusFixture, WindowEquivalentLayer_VBBlockBeamSolar) @@ -907,9 +907,9 @@ TEST_F(EnergyPlusFixture, WindowEquivalentLayer_VBBlockBeamSolar) EXPECT_NEAR(18.9228, DataSurfaces::SurfWinSlatAngThisTSDeg(SurfNum), 0.0001); // check that for BlockBeamSolar slat angle control, the slat angle = 90 - ProfAngVer DaylightingManager::ProfileAngle(SurfNum, DataEnvironment::SOLCOS, DataHeatBalance::Horizontal, ProfAngVer); - EXPECT_NEAR(90.0 - DataGlobals::RadToDeg * ProfAngVer, DataSurfaces::SurfWinSlatAngThisTSDeg(SurfNum), 0.0001); + EXPECT_NEAR(90.0 - DataGlobalConstants::RadToDeg() * ProfAngVer, DataSurfaces::SurfWinSlatAngThisTSDeg(SurfNum), 0.0001); // get the slat angle from profile angle - Real64 SlateAngleBlockBeamSolar = VB_CriticalSlatAngle(DataGlobals::RadToDeg * ProfAngVer); + Real64 SlateAngleBlockBeamSolar = VB_CriticalSlatAngle(DataGlobalConstants::RadToDeg() * ProfAngVer); EXPECT_NEAR(SlateAngleBlockBeamSolar, DataSurfaces::SurfWinSlatAngThisTSDeg(SurfNum), 0.0001); } diff --git a/tst/EnergyPlus/unit/WindowManager.unit.cc b/tst/EnergyPlus/unit/WindowManager.unit.cc index 0774fa31051..2c1d4daa723 100644 --- a/tst/EnergyPlus/unit/WindowManager.unit.cc +++ b/tst/EnergyPlus/unit/WindowManager.unit.cc @@ -284,8 +284,8 @@ TEST_F(EnergyPlusFixture, WindowFrameTest) // Use complementary angle for exterior natural convection calculations DataSurfaces::Surface(1).Tilt = 180 - tiltSave; - DataSurfaces::Surface(1).CosTilt = cos(DataSurfaces::Surface(winNum).Tilt * DataGlobals::Pi / 180); - DataSurfaces::Surface(1).SinTilt = sin(DataSurfaces::Surface(winNum).Tilt * DataGlobals::Pi / 180); + DataSurfaces::Surface(1).CosTilt = cos(DataSurfaces::Surface(winNum).Tilt * DataGlobalConstants::Pi() / 180); + DataSurfaces::Surface(1).SinTilt = sin(DataSurfaces::Surface(winNum).Tilt * DataGlobalConstants::Pi() / 180); ConvectionCoefficients::CalcISO15099WindowIntConvCoeff( winNum, outSurfTemp, T_out); // This subroutine sets the global HConvIn( 1 ) variable. We will use it to set the exterior natural convection. @@ -293,8 +293,8 @@ TEST_F(EnergyPlusFixture, WindowFrameTest) // revert tilt for interior natural convection calculations DataSurfaces::Surface(1).Tilt = tiltSave; - DataSurfaces::Surface(1).CosTilt = cos(tiltSave * DataGlobals::Pi / 180); - DataSurfaces::Surface(1).SinTilt = sin(tiltSave * DataGlobals::Pi / 180); + DataSurfaces::Surface(1).CosTilt = cos(tiltSave * DataGlobalConstants::Pi() / 180); + DataSurfaces::Surface(1).SinTilt = sin(tiltSave * DataGlobalConstants::Pi() / 180); ConvectionCoefficients::CalcISO15099WindowIntConvCoeff( winNum, inSurfTemp, T_in); // This time it's actually being used as intended. HConvIn( 1 ) is referenced from the actual heat balance calculation. @@ -349,7 +349,7 @@ TEST_F(EnergyPlusFixture, WindowManager_TransAndReflAtPhi) SimpleGlazingSHGC = 0.335; // SHGC value to use in alternate model for simple glazing system SimpleGlazingU = 1.704; // U-factor value to use in alternate model for simple glazing system - for (Real64 theta = 0.0; theta <= DataGlobals::PiOvr2; theta += DataGlobals::PiOvr2/10.0) { + for (Real64 theta = 0.0; theta <= DataGlobalConstants::PiOvr2(); theta += DataGlobalConstants::PiOvr2() / 10.0) { cs = std::cos(theta); // Cosine of incidence angle TransAndReflAtPhi(cs, tf0, rf0, rb0, tfp, rfp, rbp, SimpleGlazingSystem, SimpleGlazingSHGC, SimpleGlazingU); Real64 afp = 1. - tfp - rfp; @@ -2515,14 +2515,14 @@ TEST_F(EnergyPlusFixture, SpectralAngularPropertyTest) SurfaceGeometry::CosZoneRelNorth.allocate(4); SurfaceGeometry::SinZoneRelNorth.allocate(4); - SurfaceGeometry::CosZoneRelNorth(1) = std::cos(-DataHeatBalance::Zone(1).RelNorth * DataGlobals::DegToRadians); - SurfaceGeometry::CosZoneRelNorth(2) = std::cos(-DataHeatBalance::Zone(2).RelNorth * DataGlobals::DegToRadians); - SurfaceGeometry::CosZoneRelNorth(3) = std::cos(-DataHeatBalance::Zone(3).RelNorth * DataGlobals::DegToRadians); - SurfaceGeometry::CosZoneRelNorth(4) = std::cos(-DataHeatBalance::Zone(4).RelNorth * DataGlobals::DegToRadians); - SurfaceGeometry::SinZoneRelNorth(1) = std::sin(-DataHeatBalance::Zone(1).RelNorth * DataGlobals::DegToRadians); - SurfaceGeometry::SinZoneRelNorth(2) = std::sin(-DataHeatBalance::Zone(2).RelNorth * DataGlobals::DegToRadians); - SurfaceGeometry::SinZoneRelNorth(3) = std::sin(-DataHeatBalance::Zone(3).RelNorth * DataGlobals::DegToRadians); - SurfaceGeometry::SinZoneRelNorth(4) = std::sin(-DataHeatBalance::Zone(4).RelNorth * DataGlobals::DegToRadians); + SurfaceGeometry::CosZoneRelNorth(1) = std::cos(-DataHeatBalance::Zone(1).RelNorth * DataGlobalConstants::DegToRadians()); + SurfaceGeometry::CosZoneRelNorth(2) = std::cos(-DataHeatBalance::Zone(2).RelNorth * DataGlobalConstants::DegToRadians()); + SurfaceGeometry::CosZoneRelNorth(3) = std::cos(-DataHeatBalance::Zone(3).RelNorth * DataGlobalConstants::DegToRadians()); + SurfaceGeometry::CosZoneRelNorth(4) = std::cos(-DataHeatBalance::Zone(4).RelNorth * DataGlobalConstants::DegToRadians()); + SurfaceGeometry::SinZoneRelNorth(1) = std::sin(-DataHeatBalance::Zone(1).RelNorth * DataGlobalConstants::DegToRadians()); + SurfaceGeometry::SinZoneRelNorth(2) = std::sin(-DataHeatBalance::Zone(2).RelNorth * DataGlobalConstants::DegToRadians()); + SurfaceGeometry::SinZoneRelNorth(3) = std::sin(-DataHeatBalance::Zone(3).RelNorth * DataGlobalConstants::DegToRadians()); + SurfaceGeometry::SinZoneRelNorth(4) = std::sin(-DataHeatBalance::Zone(4).RelNorth * DataGlobalConstants::DegToRadians()); SurfaceGeometry::CosBldgRelNorth = 1.0; SurfaceGeometry::SinBldgRelNorth = 0.0; From c8596fb858bc1ee8a048a09d920d0881973941e7 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Fri, 9 Oct 2020 05:59:06 -0600 Subject: [PATCH 05/15] move constants to DataGlobalConstants --- src/EnergyPlus/AirflowNetwork/src/Solver.cpp | 3 +- .../AirflowNetworkBalanceManager.cc | 7 +- src/EnergyPlus/BaseboardElectric.cc | 4 +- src/EnergyPlus/BaseboardRadiator.cc | 2 +- src/EnergyPlus/BoilerSteam.cc | 2 +- src/EnergyPlus/Boilers.cc | 2 +- src/EnergyPlus/CTElectricGenerator.cc | 8 +- src/EnergyPlus/ChilledCeilingPanelSimple.cc | 8 +- src/EnergyPlus/ChillerAbsorption.cc | 8 +- src/EnergyPlus/ChillerElectricEIR.cc | 18 +-- src/EnergyPlus/ChillerExhaustAbsorption.cc | 4 +- src/EnergyPlus/ChillerGasAbsorption.cc | 22 +-- src/EnergyPlus/ChillerIndirectAbsorption.cc | 8 +- src/EnergyPlus/ChillerReformulatedEIR.cc | 10 +- src/EnergyPlus/Coils/CoilCoolingDX.cc | 2 +- .../Coils/CoilCoolingDXCurveFitPerformance.cc | 4 +- src/EnergyPlus/CondenserLoopTowers.cc | 14 +- src/EnergyPlus/Construction.cc | 12 +- src/EnergyPlus/ConvectionCoefficients.cc | 6 +- src/EnergyPlus/CoolTower.cc | 2 +- src/EnergyPlus/DXCoils.cc | 2 +- src/EnergyPlus/DataGlobalConstants.hh | 14 +- src/EnergyPlus/DataGlobals.cc | 8 - src/EnergyPlus/DataGlobals.hh | 8 - src/EnergyPlus/DataHVACGlobals.hh | 1 - src/EnergyPlus/DaylightingDevices.cc | 3 - src/EnergyPlus/DemandManager.cc | 5 +- src/EnergyPlus/DesiccantDehumidifiers.cc | 2 +- src/EnergyPlus/DisplacementVentMgr.cc | 6 +- src/EnergyPlus/DualDuct.hh | 1 - src/EnergyPlus/EarthTube.cc | 2 +- src/EnergyPlus/EconomicTariff.cc | 17 +-- src/EnergyPlus/ElectricBaseboardRadiator.cc | 10 +- src/EnergyPlus/ElectricPowerServiceManager.cc | 100 ++++++------ src/EnergyPlus/EvaporativeCoolers.cc | 16 +- src/EnergyPlus/EvaporativeFluidCoolers.cc | 14 +- src/EnergyPlus/ExternalInterface.cc | 2 +- src/EnergyPlus/FanCoilUnits.cc | 3 +- src/EnergyPlus/Fans.cc | 3 +- src/EnergyPlus/FluidCoolers.cc | 2 +- src/EnergyPlus/FuelCellElectricGenerator.cc | 56 +++---- src/EnergyPlus/General.cc | 16 +- src/EnergyPlus/GeneratorDynamicsManager.cc | 105 +++++++------ src/EnergyPlus/GeneratorFuelSupply.cc | 2 - src/EnergyPlus/GroundHeatExchangers.cc | 11 +- .../FiniteDifferenceGroundTemperatureModel.cc | 10 +- .../KusudaAchenbachGroundTemperatureModel.cc | 19 +-- .../SiteBuildingSurfaceGroundTemperatures.cc | 4 +- .../SiteDeepGroundTemperatures.cc | 4 +- .../SiteFCFactorMethodGroundTemperatures.cc | 4 +- .../SiteShallowGroundTemperatures.cc | 4 +- .../XingGroundTemperatureModel.cc | 4 +- src/EnergyPlus/HVACCooledBeam.cc | 3 +- src/EnergyPlus/HVACFan.cc | 2 +- src/EnergyPlus/HVACFourPipeBeam.cc | 2 +- src/EnergyPlus/HVACInterfaceManager.cc | 6 +- src/EnergyPlus/HVACManager.cc | 88 ++++++----- src/EnergyPlus/HVACMultiSpeedHeatPump.cc | 2 +- src/EnergyPlus/HVACStandAloneERV.cc | 3 +- src/EnergyPlus/HVACUnitaryBypassVAV.cc | 2 +- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 4 +- src/EnergyPlus/HWBaseboardRadiator.cc | 8 +- src/EnergyPlus/HeatBalFiniteDiffManager.cc | 5 +- src/EnergyPlus/HeatBalanceAirManager.cc | 16 +- src/EnergyPlus/HeatBalanceIntRadExchange.cc | 1 - src/EnergyPlus/HeatBalanceManager.cc | 4 - src/EnergyPlus/HeatBalanceSurfaceManager.cc | 3 +- src/EnergyPlus/HeatPumpWaterToWaterCOOLING.cc | 3 +- src/EnergyPlus/HeatPumpWaterToWaterHEATING.cc | 3 +- src/EnergyPlus/HeatPumpWaterToWaterSimple.cc | 5 +- src/EnergyPlus/HeatRecovery.cc | 3 +- src/EnergyPlus/HeatingCoils.cc | 2 +- src/EnergyPlus/HighTempRadiantSystem.cc | 7 +- src/EnergyPlus/Humidifiers.cc | 14 +- src/EnergyPlus/Humidifiers.hh | 1 - src/EnergyPlus/HybridEvapCoolingModel.cc | 31 ++-- src/EnergyPlus/ICEngineElectricGenerator.cc | 10 +- src/EnergyPlus/IceThermalStorage.cc | 10 +- .../InputProcessing/InputProcessor.cc | 2 +- src/EnergyPlus/IntegratedHeatPump.cc | 6 +- src/EnergyPlus/LowTempRadiantSystem.cc | 27 ++-- src/EnergyPlus/MicroCHPElectricGenerator.cc | 14 +- .../MicroturbineElectricGenerator.cc | 10 +- src/EnergyPlus/OutdoorAirUnit.cc | 15 +- src/EnergyPlus/OutputProcessor.cc | 1 - src/EnergyPlus/OutputReportPredefined.hh | 2 - src/EnergyPlus/OutputReportTabular.cc | 49 +++--- src/EnergyPlus/OutputReportTabularAnnual.cc | 2 +- src/EnergyPlus/OutsideEnergySources.cc | 2 +- src/EnergyPlus/PVWatts.cc | 5 +- src/EnergyPlus/PackagedTerminalHeatPump.cc | 3 +- src/EnergyPlus/PackagedThermalStorageCoil.cc | 103 +++++++------ .../PhotovoltaicThermalCollectors.cc | 4 +- src/EnergyPlus/Photovoltaics.cc | 8 +- src/EnergyPlus/PipeHeatTransfer.cc | 15 +- src/EnergyPlus/PlantCentralGSHP.cc | 4 +- src/EnergyPlus/PlantChillers.cc | 64 ++++---- .../PlantComponentTemperatureSources.cc | 6 +- .../PlantHeatExchangerFluidToFluid.cc | 2 +- src/EnergyPlus/PlantLoadProfile.cc | 5 +- src/EnergyPlus/PlantLoopHeatPumpEIR.cc | 2 +- src/EnergyPlus/PlantPipingSystemsManager.cc | 12 +- src/EnergyPlus/PondGroundHeatExchanger.cc | 10 +- src/EnergyPlus/PoweredInductionUnits.cc | 5 +- src/EnergyPlus/Pumps.cc | 7 +- src/EnergyPlus/PurchasedAirManager.cc | 4 +- src/EnergyPlus/RefrigeratedCase.cc | 144 +++++++++--------- src/EnergyPlus/RefrigeratedCase.hh | 1 - src/EnergyPlus/ResultsFramework.cc | 1 - src/EnergyPlus/RoomAirModelAirflowNetwork.cc | 13 +- src/EnergyPlus/RoomAirModelManager.cc | 2 +- src/EnergyPlus/RuntimeLanguageProcessor.cc | 6 - src/EnergyPlus/SimulationManager.cc | 4 +- src/EnergyPlus/SolarCollectors.cc | 4 +- src/EnergyPlus/SteamBaseboardRadiator.cc | 8 +- src/EnergyPlus/SteamCoils.cc | 2 +- src/EnergyPlus/SurfaceGeometry.cc | 2 +- src/EnergyPlus/SurfaceGroundHeatExchanger.cc | 5 +- src/EnergyPlus/SwimmingPool.cc | 10 +- src/EnergyPlus/SystemAvailabilityManager.cc | 2 +- src/EnergyPlus/SystemReports.cc | 38 ++--- src/EnergyPlus/ThermalChimney.cc | 11 +- src/EnergyPlus/TranspiredCollector.cc | 7 +- src/EnergyPlus/UFADManager.cc | 8 +- src/EnergyPlus/UnitHeater.cc | 5 +- src/EnergyPlus/UnitVentilator.cc | 9 +- src/EnergyPlus/UnitarySystem.cc | 4 +- src/EnergyPlus/VariableSpeedCoils.cc | 8 +- src/EnergyPlus/VentilatedSlab.cc | 15 +- src/EnergyPlus/WaterCoils.cc | 2 +- src/EnergyPlus/WaterManager.cc | 56 +++---- src/EnergyPlus/WaterThermalTanks.cc | 60 ++++---- src/EnergyPlus/WaterToAirHeatPump.cc | 10 +- src/EnergyPlus/WaterToAirHeatPumpSimple.cc | 6 +- src/EnergyPlus/WaterUse.cc | 34 ++--- src/EnergyPlus/WindTurbine.cc | 4 +- src/EnergyPlus/WindowAC.cc | 3 +- src/EnergyPlus/WindowAC.hh | 1 - src/EnergyPlus/WindowComplexManager.cc | 3 +- src/EnergyPlus/WindowManager.cc | 6 +- src/EnergyPlus/ZoneAirLoopEquipmentManager.cc | 1 - .../ZoneContaminantPredictorCorrector.cc | 12 +- src/EnergyPlus/ZoneDehumidifier.cc | 5 +- src/EnergyPlus/ZoneEquipmentManager.cc | 7 +- src/EnergyPlus/ZoneTempPredictorCorrector.cc | 34 ++--- tst/EnergyPlus/unit/EconomicTariff.unit.cc | 2 +- tst/EnergyPlus/unit/ExteriorEnergyUse.unit.cc | 2 +- .../unit/LowTempRadiantSystem.unit.cc | 6 +- .../unit/OutputReportTabular.unit.cc | 6 +- tst/EnergyPlus/unit/ScheduleManager.unit.cc | 8 +- tst/EnergyPlus/unit/WaterManager.unit.cc | 2 +- tst/EnergyPlus/unit/WaterThermalTanks.unit.cc | 6 +- 152 files changed, 823 insertions(+), 993 deletions(-) diff --git a/src/EnergyPlus/AirflowNetwork/src/Solver.cpp b/src/EnergyPlus/AirflowNetwork/src/Solver.cpp index fb71b0a7829..d8843a0bd1b 100644 --- a/src/EnergyPlus/AirflowNetwork/src/Solver.cpp +++ b/src/EnergyPlus/AirflowNetwork/src/Solver.cpp @@ -101,7 +101,6 @@ namespace AirflowNetwork { using DataEnvironment::OutHumRat; using DataEnvironment::StdBaroPress; using DataGlobals::KelvinConv; - using DataGlobals::rTinyValue; using DataSurfaces::Surface; //std::vector properties; @@ -785,7 +784,7 @@ namespace AirflowNetwork { C = CCF(n) * CEF(n); } else { // IF (CCF(N) .EQ. 0.0d0) CCF(N)=TINY(CCF(N)) ! 1.0E-40 - if (CCF(n) == 0.0) CCF(n) = rTinyValue; // 1.0E-40 (Epsilon) + if (CCF(n) == 0.0) CCF(n) = DataGlobalConstants::rTinyValue(); // 1.0E-40 (Epsilon) PCF(n) = CCF(n); C = CCF(n); } diff --git a/src/EnergyPlus/AirflowNetworkBalanceManager.cc b/src/EnergyPlus/AirflowNetworkBalanceManager.cc index 2abb827fc06..db54adc6b34 100644 --- a/src/EnergyPlus/AirflowNetworkBalanceManager.cc +++ b/src/EnergyPlus/AirflowNetworkBalanceManager.cc @@ -144,7 +144,6 @@ namespace AirflowNetworkBalanceManager { using DataGlobals::DisplayExtraWarnings; using DataGlobals::NumOfZones; using DataGlobals::ScheduleAlwaysOn; - using DataGlobals::SecInHour; using DataGlobals::TimeStepZone; using DataGlobals::WarmupFlag; using DataHeatBalance::TotCrossMixing; @@ -6911,7 +6910,7 @@ namespace AirflowNetworkBalanceManager { (pow_4(TDuctSurf_K) - pow_4(TSurfj_K)); // Radiant load for this surface [W] int SurfNum = VFObj.LinkageSurfaceData(j).SurfaceNum; Real64 ZoneSurfaceArea = Surface(SurfNum).Area; - QRadSurfAFNDuct(SurfNum) += VFObj.LinkageSurfaceData(j).SurfaceRadLoad * TimeStepSys * SecInHour / + QRadSurfAFNDuct(SurfNum) += VFObj.LinkageSurfaceData(j).SurfaceRadLoad * TimeStepSys * DataGlobalConstants::SecInHour() / ZoneSurfaceArea; // Energy to each surface per unit area [J/m2] VFObj.QRad += VFObj.LinkageSurfaceData(j).SurfaceRadLoad; // Total radiant load from all surfaces for this system timestep [W] } @@ -7981,7 +7980,7 @@ namespace AirflowNetworkBalanceManager { onceSurfFlag.dimension(AirflowNetworkNumOfLinks, false); onetime = true; } - ReportingConstant = TimeStepSys * SecInHour; + ReportingConstant = TimeStepSys * DataGlobalConstants::SecInHour(); ZoneTotalExfiltrationHeatLoss = 0.0; @@ -10930,7 +10929,7 @@ namespace AirflowNetworkBalanceManager { CpAir = PsyCpAirFnW(ZoneAirHumRat(ZoneNum)); RhoAir = PsyRhoAirFnPbTdbW(OutBaroPress, MAT(ZoneNum), ZoneAirHumRat(ZoneNum)); - InfilVolume = (state.dataAirflowNetworkBalanceManager->exchangeData(ZoneNum).SumMCp / CpAir / RhoAir) * TimeStepSys * SecInHour; + InfilVolume = (state.dataAirflowNetworkBalanceManager->exchangeData(ZoneNum).SumMCp / CpAir / RhoAir) * TimeStepSys * DataGlobalConstants::SecInHour(); ACH = InfilVolume / (TimeStepSys * Zone(ZoneNum).Volume); return ACH; diff --git a/src/EnergyPlus/BaseboardElectric.cc b/src/EnergyPlus/BaseboardElectric.cc index a4be922a180..f46695beba4 100644 --- a/src/EnergyPlus/BaseboardElectric.cc +++ b/src/EnergyPlus/BaseboardElectric.cc @@ -143,8 +143,8 @@ namespace BaseboardElectric { PowerMet = baseboard->Baseboard(BaseboardNum).Power; - baseboard->Baseboard(BaseboardNum).Energy = baseboard->Baseboard(BaseboardNum).Power * DataHVACGlobals::TimeStepSys * SecInHour; - baseboard->Baseboard(BaseboardNum).ElecUseLoad = baseboard->Baseboard(BaseboardNum).ElecUseRate * DataHVACGlobals::TimeStepSys * SecInHour; + baseboard->Baseboard(BaseboardNum).Energy = baseboard->Baseboard(BaseboardNum).Power * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + baseboard->Baseboard(BaseboardNum).ElecUseLoad = baseboard->Baseboard(BaseboardNum).ElecUseRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); } void GetBaseboardInput(EnergyPlusData &state) diff --git a/src/EnergyPlus/BaseboardRadiator.cc b/src/EnergyPlus/BaseboardRadiator.cc index fb3f921904c..e74093c4b08 100644 --- a/src/EnergyPlus/BaseboardRadiator.cc +++ b/src/EnergyPlus/BaseboardRadiator.cc @@ -237,7 +237,7 @@ namespace BaseboardRadiator { } UpdateBaseboard(state, BaseboardNum); - baseboard->Baseboard(BaseboardNum).Energy = baseboard->Baseboard(BaseboardNum).Power * DataHVACGlobals::TimeStepSys * SecInHour; + baseboard->Baseboard(BaseboardNum).Energy = baseboard->Baseboard(BaseboardNum).Power * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); } void GetBaseboardInput(EnergyPlusData &state) diff --git a/src/EnergyPlus/BoilerSteam.cc b/src/EnergyPlus/BoilerSteam.cc index a57b569ade5..f4030bdea9d 100644 --- a/src/EnergyPlus/BoilerSteam.cc +++ b/src/EnergyPlus/BoilerSteam.cc @@ -797,7 +797,7 @@ namespace BoilerSteam { // PURPOSE OF THIS SUBROUTINE: // Boiler simulation reporting - Real64 ReportingConstant = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + Real64 ReportingConstant = DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); int BoilerInletNode = this->BoilerInletNodeNum; int BoilerOutletNode = this->BoilerOutletNodeNum; diff --git a/src/EnergyPlus/Boilers.cc b/src/EnergyPlus/Boilers.cc index 2bef46763ae..a9d25a44c19 100644 --- a/src/EnergyPlus/Boilers.cc +++ b/src/EnergyPlus/Boilers.cc @@ -922,7 +922,7 @@ namespace Boilers { // PURPOSE OF THIS SUBROUTINE: // boiler simulation reporting - Real64 const ReportingConstant = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + Real64 const ReportingConstant = DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); int const BoilerInletNode = this->BoilerInletNodeNum; int const BoilerOutletNode = this->BoilerOutletNodeNum; diff --git a/src/EnergyPlus/CTElectricGenerator.cc b/src/EnergyPlus/CTElectricGenerator.cc index 8be1812497d..2abfbcfa50e 100644 --- a/src/EnergyPlus/CTElectricGenerator.cc +++ b/src/EnergyPlus/CTElectricGenerator.cc @@ -608,16 +608,16 @@ namespace CTElectricGenerator { // Calculate Energy // Generator output (J) - Real64 ElectricEnergyGen = elecPowerGenerated * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + Real64 ElectricEnergyGen = elecPowerGenerated * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); // Amount of Fuel Energy Required to run COMBUSTION turbine (J) - Real64 FuelEnergyUsed = FuelUseRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + Real64 FuelEnergyUsed = FuelUseRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); // recovered lube oil heat (J) - Real64 lubeOilEnergyRec = QLubeOilRec * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + Real64 lubeOilEnergyRec = QLubeOilRec * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); // recovered exhaust heat (J) - Real64 exhaustEnergyRec = QExhaustRec * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + Real64 exhaustEnergyRec = QExhaustRec * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); this->ElecPowerGenerated = elecPowerGenerated; this->ElecEnergyGenerated = ElectricEnergyGen; diff --git a/src/EnergyPlus/ChilledCeilingPanelSimple.cc b/src/EnergyPlus/ChilledCeilingPanelSimple.cc index 99313266975..485a37340ac 100644 --- a/src/EnergyPlus/ChilledCeilingPanelSimple.cc +++ b/src/EnergyPlus/ChilledCeilingPanelSimple.cc @@ -1681,10 +1681,10 @@ namespace CoolingPanelSimple { this->ConvPower = -this->ConvPower; this->RadPower = -this->RadPower; - this->TotEnergy = this->TotPower * TimeStepSys * SecInHour; - this->Energy = this->Power * TimeStepSys * SecInHour; - this->ConvEnergy = this->ConvPower * TimeStepSys * SecInHour; - this->RadEnergy = this->RadPower * TimeStepSys * SecInHour; + this->TotEnergy = this->TotPower * TimeStepSys * DataGlobalConstants::SecInHour(); + this->Energy = this->Power * TimeStepSys * DataGlobalConstants::SecInHour(); + this->ConvEnergy = this->ConvPower * TimeStepSys * DataGlobalConstants::SecInHour(); + this->RadEnergy = this->RadPower * TimeStepSys * DataGlobalConstants::SecInHour(); } Real64 SumHATsurf(int const ZoneNum) // Zone number diff --git a/src/EnergyPlus/ChillerAbsorption.cc b/src/EnergyPlus/ChillerAbsorption.cc index 9bf2b860b2d..d8e0ece619e 100644 --- a/src/EnergyPlus/ChillerAbsorption.cc +++ b/src/EnergyPlus/ChillerAbsorption.cc @@ -1721,10 +1721,10 @@ namespace ChillerAbsorption { } // IF(GeneratorInletNode .GT. 0)THEN // convert power to energy - this->GeneratorEnergy = this->QGenerator * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - this->EvaporatorEnergy = this->QEvaporator * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - this->CondenserEnergy = this->QCondenser * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - this->PumpingEnergy = this->PumpingPower * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->GeneratorEnergy = this->QGenerator * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + this->EvaporatorEnergy = this->QEvaporator * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + this->CondenserEnergy = this->QCondenser * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + this->PumpingEnergy = this->PumpingPower * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); } void BLASTAbsorberSpecs::updateRecords(Real64 MyLoad, bool RunFlag) diff --git a/src/EnergyPlus/ChillerElectricEIR.cc b/src/EnergyPlus/ChillerElectricEIR.cc index 7cc412500f4..8cee53b7a2c 100644 --- a/src/EnergyPlus/ChillerElectricEIR.cc +++ b/src/EnergyPlus/ChillerElectricEIR.cc @@ -327,14 +327,14 @@ namespace ChillerElectricEIR { // If the condenser inlet is blank for air cooled and evap cooled condensers then supply a generic name // since it is not used elsewhere for connection if (DataIPShortCuts::lAlphaFieldBlanks(7)) { - if (len(DataIPShortCuts::cAlphaArgs(1)) < DataGlobals::MaxNameLength - 25) { // protect against long name leading to > 100 chars + if (len(DataIPShortCuts::cAlphaArgs(1)) < DataGlobalConstants::MaxNameLength() - 25) { // protect against long name leading to > 100 chars DataIPShortCuts::cAlphaArgs(7) = DataIPShortCuts::cAlphaArgs(1) + " INLET NODE FOR CONDENSER"; } else { DataIPShortCuts::cAlphaArgs(7) = DataIPShortCuts::cAlphaArgs(1).substr(0, 75) + " INLET NODE FOR CONDENSER"; } } if (DataIPShortCuts::lAlphaFieldBlanks(8)) { - if (len(DataIPShortCuts::cAlphaArgs(1)) < DataGlobals::MaxNameLength - 26) { // protect against long name leading to > 100 chars + if (len(DataIPShortCuts::cAlphaArgs(1)) < DataGlobalConstants::MaxNameLength() - 26) { // protect against long name leading to > 100 chars DataIPShortCuts::cAlphaArgs(8) = DataIPShortCuts::cAlphaArgs(1) + " OUTLET NODE FOR CONDENSER"; } else { DataIPShortCuts::cAlphaArgs(8) = DataIPShortCuts::cAlphaArgs(1).substr(0, 74) + " OUTLET NODE FOR CONDENSER"; @@ -2275,7 +2275,7 @@ namespace ChillerElectricEIR { // Reporting // Number of seconds per HVAC system time step, to convert from W (J/s) to J - Real64 ReportingConstant = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + Real64 ReportingConstant = DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); if (MyLoad >= 0 || !RunFlag) { // Chiller not running so pass inlet states to outlet states // Set node conditions @@ -2346,15 +2346,15 @@ namespace ChillerElectricEIR { // Set node flow rates; for these load based models // assume that sufficient evaporator flow rate is available - this->ChillerFalseLoad = this->ChillerFalseLoadRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - this->Energy = this->Power * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - this->EvapEnergy = this->QEvaporator * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - this->CondEnergy = this->QCondenser * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->ChillerFalseLoad = this->ChillerFalseLoadRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + this->Energy = this->Power * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + this->EvapEnergy = this->QEvaporator * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + this->CondEnergy = this->QCondenser * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); this->EvapInletTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp; this->CondInletTemp = DataLoopNode::Node(this->CondInletNodeNum).Temp; this->CondOutletTemp = DataLoopNode::Node(this->CondOutletNodeNum).Temp; this->EvapOutletTemp = DataLoopNode::Node(this->EvapOutletNodeNum).Temp; - this->CondenserFanEnergyConsumption = this->CondenserFanPower * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->CondenserFanEnergyConsumption = this->CondenserFanPower * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); if (this->Power != 0.0) { this->ActualCOP = (this->QEvaporator + this->ChillerFalseLoadRate) / this->Power; } else { @@ -2368,7 +2368,7 @@ namespace ChillerElectricEIR { if (this->HeatRecActive) { PlantUtilities::SafeCopyPlantNode(this->HeatRecInletNodeNum, this->HeatRecOutletNodeNum); - this->EnergyHeatRecovery = this->QHeatRecovered * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->EnergyHeatRecovery = this->QHeatRecovered * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); DataLoopNode::Node(this->HeatRecOutletNodeNum).Temp = this->HeatRecOutletTemp; this->HeatRecInletTemp = DataLoopNode::Node(this->HeatRecInletNodeNum).Temp; this->HeatRecMassFlow = DataLoopNode::Node(this->HeatRecInletNodeNum).MassFlowRate; diff --git a/src/EnergyPlus/ChillerExhaustAbsorption.cc b/src/EnergyPlus/ChillerExhaustAbsorption.cc index 81c642966d0..d81ff048664 100644 --- a/src/EnergyPlus/ChillerExhaustAbsorption.cc +++ b/src/EnergyPlus/ChillerExhaustAbsorption.cc @@ -1978,7 +1978,7 @@ namespace ChillerExhaustAbsorption { } // convert power to energy and instantaneous use to use over the time step - RptConstant = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + RptConstant = DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); this->CoolingEnergy = this->CoolingLoad * RptConstant; this->TowerEnergy = this->TowerLoad * RptConstant; this->ThermalEnergy = this->ThermalEnergyUseRate * RptConstant; @@ -2017,7 +2017,7 @@ namespace ChillerExhaustAbsorption { } // convert power to energy and instantaneous use to use over the time step - RptConstant = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + RptConstant = DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); this->HeatingEnergy = this->HeatingLoad * RptConstant; this->ThermalEnergy = this->ThermalEnergyUseRate * RptConstant; this->HeatThermalEnergy = this->HeatThermalEnergyUseRate * RptConstant; diff --git a/src/EnergyPlus/ChillerGasAbsorption.cc b/src/EnergyPlus/ChillerGasAbsorption.cc index 097ee4b7dc7..3e37e10c437 100644 --- a/src/EnergyPlus/ChillerGasAbsorption.cc +++ b/src/EnergyPlus/ChillerGasAbsorption.cc @@ -1864,12 +1864,12 @@ namespace ChillerGasAbsorption { } // convert power to energy and instantaneous use to use over the time step - this->CoolingEnergy = this->CoolingLoad * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - this->TowerEnergy = this->TowerLoad * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - this->FuelEnergy = this->FuelUseRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - this->CoolFuelEnergy = this->CoolFuelUseRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - this->ElectricEnergy = this->ElectricPower * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - this->CoolElectricEnergy = this->CoolElectricPower * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->CoolingEnergy = this->CoolingLoad * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + this->TowerEnergy = this->TowerLoad * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + this->FuelEnergy = this->FuelUseRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + this->CoolFuelEnergy = this->CoolFuelUseRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + this->ElectricEnergy = this->ElectricPower * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + this->CoolElectricEnergy = this->CoolElectricPower * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); if (this->CoolFuelUseRate != 0.0) { this->FuelCOP = this->CoolingLoad / this->CoolFuelUseRate; } else { @@ -1894,11 +1894,11 @@ namespace ChillerGasAbsorption { } // convert power to energy and instantaneous use to use over the time step - this->HeatingEnergy = this->HeatingLoad * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - this->FuelEnergy = this->FuelUseRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - this->HeatFuelEnergy = this->HeatFuelUseRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - this->ElectricEnergy = this->ElectricPower * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - this->HeatElectricEnergy = this->HeatElectricPower * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->HeatingEnergy = this->HeatingLoad * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + this->FuelEnergy = this->FuelUseRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + this->HeatFuelEnergy = this->HeatFuelUseRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + this->ElectricEnergy = this->ElectricPower * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + this->HeatElectricEnergy = this->HeatElectricPower * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); } } // namespace ChillerGasAbsorption diff --git a/src/EnergyPlus/ChillerIndirectAbsorption.cc b/src/EnergyPlus/ChillerIndirectAbsorption.cc index b4249c25d86..c7a3e310ba0 100644 --- a/src/EnergyPlus/ChillerIndirectAbsorption.cc +++ b/src/EnergyPlus/ChillerIndirectAbsorption.cc @@ -2022,10 +2022,10 @@ namespace ChillerIndirectAbsorption { } // IF(GeneratorInletNode .GT. 0)THEN // convert power to energy - this->GeneratorEnergy = this->QGenerator * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - this->EvaporatorEnergy = this->QEvaporator * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - this->CondenserEnergy = this->QCondenser * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - this->PumpingEnergy = this->PumpingPower * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->GeneratorEnergy = this->QGenerator * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + this->EvaporatorEnergy = this->QEvaporator * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + this->CondenserEnergy = this->QCondenser * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + this->PumpingEnergy = this->PumpingPower * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); // ------ // / \. diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc index 03a1a078a59..a889c611aab 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.cc +++ b/src/EnergyPlus/ChillerReformulatedEIR.cc @@ -1736,10 +1736,10 @@ namespace ChillerReformulatedEIR { DataLoopNode::Node(this->CondOutletNodeNum).Temp = this->CondOutletTemp; // Set node flow rates; for these load based models // assume that sufficient evaporator flow rate is available - this->ChillerFalseLoad = this->ChillerFalseLoadRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - this->Energy = this->Power * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - this->EvapEnergy = this->QEvaporator * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - this->CondEnergy = this->QCondenser * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->ChillerFalseLoad = this->ChillerFalseLoadRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + this->Energy = this->Power * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + this->EvapEnergy = this->QEvaporator * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + this->CondEnergy = this->QCondenser * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); this->EvapInletTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp; this->CondInletTemp = DataLoopNode::Node(this->CondInletNodeNum).Temp; this->CondOutletTemp = DataLoopNode::Node(this->CondOutletNodeNum).Temp; @@ -1752,7 +1752,7 @@ namespace ChillerReformulatedEIR { if (this->HeatRecActive) { PlantUtilities::SafeCopyPlantNode(this->HeatRecInletNodeNum, this->HeatRecOutletNodeNum); - this->EnergyHeatRecovery = this->QHeatRecovery * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->EnergyHeatRecovery = this->QHeatRecovery * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); DataLoopNode::Node(this->HeatRecOutletNodeNum).Temp = this->HeatRecOutletTemp; this->HeatRecInletTemp = DataLoopNode::Node(this->HeatRecInletNodeNum).Temp; this->HeatRecOutletTemp = DataLoopNode::Node(this->HeatRecOutletNodeNum).Temp; diff --git a/src/EnergyPlus/Coils/CoilCoolingDX.cc b/src/EnergyPlus/Coils/CoilCoolingDX.cc index 42a0b910a03..e4a596ce123 100644 --- a/src/EnergyPlus/Coils/CoilCoolingDX.cc +++ b/src/EnergyPlus/Coils/CoilCoolingDX.cc @@ -484,7 +484,7 @@ void CoilCoolingDX::simulate(EnergyPlus::EnergyPlusData &state, int useAlternate } // calculate energy conversion factor - Real64 reportingConstant = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + Real64 reportingConstant = DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); // update condensate collection tank if (this->condensateTankIndex > 0) { diff --git a/src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.cc b/src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.cc index 2b4af3249aa..54dac2b1978 100644 --- a/src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.cc +++ b/src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.cc @@ -181,7 +181,7 @@ void CoilCoolingDXCurveFitPerformance::simulate(EnergyPlus::EnergyPlusData &stat DataLoopNode::NodeData &condOutletNode, Real64 LoadSHR) { - Real64 reportingConstant = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + Real64 reportingConstant = DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); if (useAlternateMode == DataHVACGlobals::coilSubcoolReheatMode) { Real64 totalCoolingRate; @@ -321,7 +321,7 @@ void CoilCoolingDXCurveFitPerformance::calculate(EnergyPlus::EnergyPlusData &sta currentMode.CalcOperatingMode(state, inletNode, outletNode, PLR, speedNum, speedRatio, fanOpMode, condInletNode, condOutletNode); // scaling term to get rate into consumptions - Real64 reportingConstant = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + Real64 reportingConstant = DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); // calculate crankcase heater operation if (DataEnvironment::OutDryBulbTemp < this->maxOutdoorDrybulbForBasin) { diff --git a/src/EnergyPlus/CondenserLoopTowers.cc b/src/EnergyPlus/CondenserLoopTowers.cc index 433e4af9b44..1470b5b27d8 100644 --- a/src/EnergyPlus/CondenserLoopTowers.cc +++ b/src/EnergyPlus/CondenserLoopTowers.cc @@ -5860,17 +5860,17 @@ namespace CondenserLoopTowers { // total water usage // update report variables this->EvaporationVdot = EvapVdot; - this->EvaporationVol = EvapVdot * (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + this->EvaporationVol = EvapVdot * (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); this->DriftVdot = driftVdot; - this->DriftVol = driftVdot * (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + this->DriftVol = driftVdot * (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); this->BlowdownVdot = BlowDownVdot; - this->BlowdownVol = BlowDownVdot * (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + this->BlowdownVol = BlowDownVdot * (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); this->MakeUpVdot = makeUpVdot; - this->MakeUpVol = makeUpVdot * (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + this->MakeUpVol = makeUpVdot * (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); this->TankSupplyVdot = tankSupplyVdot; - this->TankSupplyVol = tankSupplyVdot * (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + this->TankSupplyVol = tankSupplyVdot * (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); this->StarvedMakeUpVdot = StarvedVdot; - this->StarvedMakeUpVol = StarvedVdot * (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + this->StarvedMakeUpVol = StarvedVdot * (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); } void CoolingTower::update() @@ -5966,7 +5966,7 @@ namespace CondenserLoopTowers { // PURPOSE OF THIS SUBROUTINE: // This subroutine updates the report variables for the tower. - Real64 const ReportingConstant = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + Real64 const ReportingConstant = DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); if (!RunFlag) { this->InletWaterTemp = DataLoopNode::Node(this->WaterInletNodeNum).Temp; diff --git a/src/EnergyPlus/Construction.cc b/src/EnergyPlus/Construction.cc index aa84e016c81..e4ce6f25fe6 100644 --- a/src/EnergyPlus/Construction.cc +++ b/src/EnergyPlus/Construction.cc @@ -1235,8 +1235,8 @@ namespace Construction { // Make sure the next term won't cause an underflow. If it will end up being // so small as to go below TinyLimit, then ignore it since it won't add anything // to AMatN anyway. - if (std::abs(AMat1(ic, ict)) > DataGlobals::rTinyValue) { - if (std::abs(AMato(ict, ir)) > std::abs(double(i) * DataGlobals::rTinyValue / AMat1(ic, ict))) + if (std::abs(AMat1(ic, ict)) > DataGlobalConstants::rTinyValue()) { + if (std::abs(AMato(ict, ir)) > std::abs(double(i) * DataGlobalConstants::rTinyValue() / AMat1(ic, ict))) AMatN(ic, ir) += AMato(ict, ir) * AMat1(ic, ict) / double(i); } } @@ -1252,7 +1252,7 @@ namespace Construction { for (ir = 1; ir <= this->rcmax; ++ir) { for (ic = 1; ic <= this->rcmax; ++ic) { // Test of limit criteria: - if (std::abs(this->AExp(ic, ir)) > DataGlobals::rTinyValue) { // Next line divides by AExp entry so it + if (std::abs(this->AExp(ic, ir)) > DataGlobalConstants::rTinyValue()) { // Next line divides by AExp entry so it // must be checked to avoid dividing by zero. // If the ratio between any current element in the power // of AMat and its corresponding element in AExp is @@ -1300,7 +1300,7 @@ namespace Construction { for (ir = 1; ir <= this->rcmax; ++ir) { for (ic = 1; ic <= this->rcmax; ++ic) { for (idm = 1; idm <= this->rcmax; ++idm) { - if (std::abs(AMato(idm, ir) * AMato(ic, idm)) > DataGlobals::rTinyValue) { + if (std::abs(AMato(idm, ir) * AMato(ic, idm)) > DataGlobalConstants::rTinyValue()) { this->AExp(ic, ir) += AMato(idm, ir) * AMato(ic, idm); Backup = false; } @@ -1724,8 +1724,8 @@ namespace Construction { // Make sure the next term won't cause an underflow. If it will end up being // so small as to go below TinyLimit, then ignore it since it won't add anything // to PhiR0 anyway. - if (std::abs(Rnew(ic, is)) > DataGlobals::rTinyValue) { - if (std::abs(this->AExp(is, ir)) > std::abs(DataGlobals::rTinyValue / Rnew(ic, is))) PhiR0(ic, ir) += this->AExp(is, ir) * Rnew(ic, is); + if (std::abs(Rnew(ic, is)) > DataGlobalConstants::rTinyValue()) { + if (std::abs(this->AExp(is, ir)) > std::abs(DataGlobalConstants::rTinyValue() / Rnew(ic, is))) PhiR0(ic, ir) += this->AExp(is, ir) * Rnew(ic, is); } } } diff --git a/src/EnergyPlus/ConvectionCoefficients.cc b/src/EnergyPlus/ConvectionCoefficients.cc index aece5ac4917..e4ff59e6271 100644 --- a/src/EnergyPlus/ConvectionCoefficients.cc +++ b/src/EnergyPlus/ConvectionCoefficients.cc @@ -2615,7 +2615,7 @@ namespace ConvectionCoefficients { Real64 ZoneVolFlowRate = CalcZoneSystemVolFlowRate(ZoneNum); // Calculate ACH - return ZoneVolFlowRate / ZoneVolume * SecInHour; + return ZoneVolFlowRate / ZoneVolume * DataGlobalConstants::SecInHour(); } } @@ -2832,7 +2832,7 @@ namespace ConvectionCoefficients { ACH = 0.0; } else { // Calculate ACH - ACH = ZoneMassFlowRate / AirDensity / ZoneVolume * SecInHour; + ACH = ZoneMassFlowRate / AirDensity / ZoneVolume * DataGlobalConstants::SecInHour(); // Limit ACH to range of correlation ACH = min(ACH, MaxACH); ACH = max(ACH, 0.0); @@ -6076,7 +6076,7 @@ namespace ConvectionCoefficients { if (Zone(ZoneNum).IsControlled) { ZoneNode = Zone(ZoneNum).SystemZoneNodeNumber; AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, Node(ZoneNode).Temp, PsyWFnTdpPb(Node(ZoneNode).Temp, OutBaroPress)); - AirChangeRate = (Node(ZoneNode).MassFlowRate * SecInHour) / (AirDensity * Zone(ZoneNum).Volume); + AirChangeRate = (Node(ZoneNode).MassFlowRate * DataGlobalConstants::SecInHour()) / (AirDensity * Zone(ZoneNum).Volume); if (ZoneEquipConfig(ZoneNum).EquipListIndex > 0) { for (EquipNum = 1; EquipNum <= ZoneEquipList(ZoneEquipConfig(ZoneNum).EquipListIndex).NumOfEquipTypes; ++EquipNum) { if (allocated(ZoneEquipList(ZoneEquipConfig(ZoneNum).EquipListIndex).EquipData(EquipNum).OutletNodeNums)) { diff --git a/src/EnergyPlus/CoolTower.cc b/src/EnergyPlus/CoolTower.cc index da871adb542..f55f4713880 100644 --- a/src/EnergyPlus/CoolTower.cc +++ b/src/EnergyPlus/CoolTower.cc @@ -723,7 +723,7 @@ namespace CoolTower { int CoolTowerNum; Real64 TSMult; - TSMult = TimeStepSys * SecInHour; + TSMult = TimeStepSys * DataGlobalConstants::SecInHour(); for (CoolTowerNum = 1; CoolTowerNum <= state.dataCoolTower->NumCoolTowers; ++CoolTowerNum) { diff --git a/src/EnergyPlus/DXCoils.cc b/src/EnergyPlus/DXCoils.cc index 4e4ef93518c..1bbc9abdc19 100644 --- a/src/EnergyPlus/DXCoils.cc +++ b/src/EnergyPlus/DXCoils.cc @@ -13314,7 +13314,7 @@ namespace DXCoils { } } - ReportingConstant = TimeStepSys * SecInHour; + ReportingConstant = TimeStepSys * DataGlobalConstants::SecInHour(); { auto const SELECT_CASE_var(DXCoil(DXCoilNum).DXCoilType_Num); diff --git a/src/EnergyPlus/DataGlobalConstants.hh b/src/EnergyPlus/DataGlobalConstants.hh index 52ccb825bd2..aa74b446996 100644 --- a/src/EnergyPlus/DataGlobalConstants.hh +++ b/src/EnergyPlus/DataGlobalConstants.hh @@ -253,18 +253,24 @@ namespace DataGlobalConstants { DesignDay = 1, RunPeriodDesign = 2, RunPeriodWeather = 3, - HVACSizeDesignDay = 4, // a regular design day run during HVAC Sizing Simulation - HVACSizeRunPeriodDesign = 5, // a weather period design day run during HVAC Sizing Simulation - ReadAllWeatherData = 6 // a weather period for reading all weather data prior to the simulation + HVACSizeDesignDay = 4, // a regular design day run during HVAC Sizing Simulation + HVACSizeRunPeriodDesign = 5, // a weather period design day run during HVAC Sizing Simulation + ReadAllWeatherData = 6 // a weather period for reading all weather data prior to the simulation }; Real64 constexpr MaxEXPArg () { return 709.78; } // maximum exponent in EXP() function Real64 constexpr Pi () { return 3.14159265358979324; } // Pi 3.1415926535897932384626435 Real64 constexpr PiOvr2 () { return Pi() / 2.0; } // Pi/2 - Real64 constexpr TwoPi () { return 2.0 * Pi(); } // 2*Pi 6.2831853071795864769252868 + Real64 constexpr TwoPi () { return 2.0 * Pi(); } // 2*Pi 6.2831853071795864769252868r Real64 constexpr GravityConstant () { return 9.807; } Real64 constexpr DegToRadians () { return Pi() / 180.0; } // Conversion for Degrees to Radians Real64 constexpr RadToDeg () { return 180.0 / Pi(); } // Conversion for Radians to Degrees + Real64 constexpr SecInHour () { return 3600.0; } // Conversion for hours to seconds + Real64 constexpr HoursInDay () { return 24.0; } // Number of Hours in Day + Real64 constexpr SecsInDay () { return SecInHour() * HoursInDay(); } // Number of seconds in Day + Real64 constexpr BigNumber () { return std::numeric_limits< Real64 >::max(); } // Max Number real used for initializations + Real64 constexpr rTinyValue () { return std::numeric_limits< Real64 >::epsilon(); } // Tiny value to replace use of TINY(x) + std::string::size_type constexpr MaxNameLength () { return 100; } // Maximum Name Length in Characters -- should be the same as MaxAlphaArgLength in InputProcessor module int AssignResourceTypeNum(std::string const &ResourceTypeChar); std::string GetResourceTypeChar(int ResourceTypeNum); diff --git a/src/EnergyPlus/DataGlobals.cc b/src/EnergyPlus/DataGlobals.cc index dd6f06a09f3..e5f9267fdfd 100644 --- a/src/EnergyPlus/DataGlobals.cc +++ b/src/EnergyPlus/DataGlobals.cc @@ -72,14 +72,6 @@ namespace DataGlobals { // This data-only module is a repository for all variables which are considered // to be "global" in nature in EnergyPlus. - Real64 const SecInHour(3600.0); // Conversion for hours to seconds - Real64 const HoursInDay(24.0); // Number of Hours in Day - Real64 const SecsInDay(SecInHour *HoursInDay); // Number of seconds in Day - Real64 const BigNumber(HUGE_(1.0)); // Max Number real used for initializations - Real64 const rTinyValue(EPSILON(1.0)); // Tiny value to replace use of TINY(x) - std::string::size_type const MaxNameLength(100); // Maximum Name Length in Characters -- should be the same - // as MaxAlphaArgLength in InputProcessor module - Real64 const KelvinConv(273.15); // Conversion factor for C to K and K to C Real64 const InitConvTemp(5.05); // [deg C], standard init vol to mass flow conversion temp Real64 const AutoCalculate(-99999.0); // automatically calculate some fields. diff --git a/src/EnergyPlus/DataGlobals.hh b/src/EnergyPlus/DataGlobals.hh index 03fc66f972b..9f58573bd52 100644 --- a/src/EnergyPlus/DataGlobals.hh +++ b/src/EnergyPlus/DataGlobals.hh @@ -70,14 +70,6 @@ namespace DataGlobals { // -only module should be available to other modules and routines. // Thus, all variables in this module must be PUBLIC. - extern Real64 const SecInHour; // Conversion for hours to seconds - extern Real64 const HoursInDay; // Number of Hours in Day - extern Real64 const SecsInDay; // Number of seconds in Day - extern Real64 const BigNumber; // Max Number real used for initializations - extern Real64 const rTinyValue; // Tiny value to replace use of TINY(x) - extern std::string::size_type const MaxNameLength; // Maximum Name Length in Characters -- should be the same - // as MaxAlphaArgLength in InputProcessor module - extern Real64 const KelvinConv; // Conversion factor for C to K and K to C extern Real64 const InitConvTemp; // [deg C], standard init vol to mass flow conversion temp extern Real64 const AutoCalculate; // automatically calculate some fields. diff --git a/src/EnergyPlus/DataHVACGlobals.hh b/src/EnergyPlus/DataHVACGlobals.hh index 4a5b8be4360..6dda6bdf5b2 100644 --- a/src/EnergyPlus/DataHVACGlobals.hh +++ b/src/EnergyPlus/DataHVACGlobals.hh @@ -415,7 +415,6 @@ namespace DataHVACGlobals { struct ComponentSetPtData { // Members - // CHARACTER(len=MaxNameLength) :: EquipOperListName std::string EquipmentType; std::string EquipmentName; int NodeNumIn; diff --git a/src/EnergyPlus/DaylightingDevices.cc b/src/EnergyPlus/DaylightingDevices.cc index 3abbf9150e8..ef803afde5d 100644 --- a/src/EnergyPlus/DaylightingDevices.cc +++ b/src/EnergyPlus/DaylightingDevices.cc @@ -491,11 +491,8 @@ namespace DaylightingDevices { using General::SafeDivide; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - // unused1208 CHARACTER(len=MaxNameLength), & - // DIMENSION(20) :: Alphas ! Alpha items for object static bool ErrorsFound(false); // Set to true if errors in input, fatal at end of routine int IOStatus; // Used in GetObjectItem - // unused1208 REAL(r64), DIMENSION(9) :: Numbers ! Numeric items for object int NumAlphas; // Number of Alphas for each GetObjectItem call int NumNumbers; // Number of Numbers for each GetObjectItem call int PipeNum; // TDD pipe object number diff --git a/src/EnergyPlus/DemandManager.cc b/src/EnergyPlus/DemandManager.cc index 9a330e024ac..8f072246e91 100644 --- a/src/EnergyPlus/DemandManager.cc +++ b/src/EnergyPlus/DemandManager.cc @@ -90,8 +90,6 @@ namespace DemandManager { // Using/Aliasing using DataGlobals::NumOfTimeStepInHour; using DataGlobals::ScheduleAlwaysOn; - using DataGlobals::SecInHour; - // Data // MODULE PARAMETER DEFINITIONS: int const ManagerTypeExtLights(1); @@ -285,7 +283,6 @@ namespace DemandManager { // METHODOLOGY EMPLOYED: // Using/Aliasing - using DataGlobals::SecInHour; using DataGlobals::TimeStepZoneSec; using DataHVACGlobals::TimeStepSys; using ScheduleManager::GetCurrentScheduleValue; @@ -305,7 +302,7 @@ namespace DemandManager { DemandManagerList(ListNum).DemandLimit = DemandManagerList(ListNum).ScheduledLimit * DemandManagerList(ListNum).SafetyFraction; DemandManagerList(ListNum).MeterDemand = GetInstantMeterValue(DemandManagerList(ListNum).Meter, OutputProcessor::TimeStepType::TimeStepZone) / TimeStepZoneSec + - GetInstantMeterValue(DemandManagerList(ListNum).Meter, OutputProcessor::TimeStepType::TimeStepSystem) / (TimeStepSys * SecInHour); + GetInstantMeterValue(DemandManagerList(ListNum).Meter, OutputProcessor::TimeStepType::TimeStepSystem) / (TimeStepSys * DataGlobalConstants::SecInHour()); // Calculate average demand over the averaging window including the current timestep meter demand AverageDemand = DemandManagerList(ListNum).AverageDemand + diff --git a/src/EnergyPlus/DesiccantDehumidifiers.cc b/src/EnergyPlus/DesiccantDehumidifiers.cc index 2a4d4e60bcf..fc1f8622609 100644 --- a/src/EnergyPlus/DesiccantDehumidifiers.cc +++ b/src/EnergyPlus/DesiccantDehumidifiers.cc @@ -3185,7 +3185,7 @@ namespace DesiccantDehumidifiers { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: Real64 ReportingConstant; - ReportingConstant = TimeStepSys * SecInHour; + ReportingConstant = TimeStepSys * DataGlobalConstants::SecInHour(); { auto const SELECT_CASE_var(DesicDehum(DesicDehumNum).DehumTypeCode); diff --git a/src/EnergyPlus/DisplacementVentMgr.cc b/src/EnergyPlus/DisplacementVentMgr.cc index c5e08dd4685..20d48526274 100644 --- a/src/EnergyPlus/DisplacementVentMgr.cc +++ b/src/EnergyPlus/DisplacementVentMgr.cc @@ -863,13 +863,13 @@ namespace DisplacementVentMgr { AIRRATFloor(ZoneNum) = Zone(ZoneNum).Volume * min(HeightTransition(ZoneNum), HeightFloorSubzoneTop) / CeilingHeight * Zone(ZoneNum).ZoneVolCapMultpSens * PsyRhoAirFnPbTdbW(OutBaroPress, MATFloor(ZoneNum), ZoneAirHumRat(ZoneNum)) * - PsyCpAirFnW(ZoneAirHumRat(ZoneNum)) / (TimeStepSys * SecInHour); + PsyCpAirFnW(ZoneAirHumRat(ZoneNum)) / (TimeStepSys * DataGlobalConstants::SecInHour()); AIRRATOC(ZoneNum) = Zone(ZoneNum).Volume * (HeightTransition(ZoneNum) - min(HeightTransition(ZoneNum), 0.2)) / CeilingHeight * Zone(ZoneNum).ZoneVolCapMultpSens * PsyRhoAirFnPbTdbW(OutBaroPress, MATOC(ZoneNum), ZoneAirHumRat(ZoneNum)) * - PsyCpAirFnW(ZoneAirHumRat(ZoneNum)) / (TimeStepSys * SecInHour); + PsyCpAirFnW(ZoneAirHumRat(ZoneNum)) / (TimeStepSys * DataGlobalConstants::SecInHour()); AIRRATMX(ZoneNum) = Zone(ZoneNum).Volume * (CeilingHeight - HeightTransition(ZoneNum)) / CeilingHeight * Zone(ZoneNum).ZoneVolCapMultpSens * PsyRhoAirFnPbTdbW(OutBaroPress, MATMX(ZoneNum), ZoneAirHumRat(ZoneNum)) * - PsyCpAirFnW(ZoneAirHumRat(ZoneNum)) / (TimeStepSys * SecInHour); + PsyCpAirFnW(ZoneAirHumRat(ZoneNum)) / (TimeStepSys * DataGlobalConstants::SecInHour()); if (UseZoneTimeStepHistory) { ZTM3Floor(ZoneNum) = XM3TFloor(ZoneNum); diff --git a/src/EnergyPlus/DualDuct.hh b/src/EnergyPlus/DualDuct.hh index 5b3d2664ae1..24819f37151 100644 --- a/src/EnergyPlus/DualDuct.hh +++ b/src/EnergyPlus/DualDuct.hh @@ -136,7 +136,6 @@ namespace DualDuct { { // Members std::string Name; // Name of the Damper - // CHARACTER(len=MaxNameLength) :: DamperType = ' ' ! Type of Damper ie. VAV, Mixing, Inducing, etc. int DamperType; // Type of Damper ie. VAV, Mixing, Inducing, etc. std::string Schedule; // Damper Operation Schedule int SchedPtr; // Pointer to the correct schedule diff --git a/src/EnergyPlus/EarthTube.cc b/src/EnergyPlus/EarthTube.cc index 4d6a9c7ba42..4a75f27e03c 100644 --- a/src/EnergyPlus/EarthTube.cc +++ b/src/EnergyPlus/EarthTube.cc @@ -710,7 +710,7 @@ namespace EarthTube { Real64 CpAir; Real64 ReportingConstant; // reporting constant for this module - ReportingConstant = TimeStepSys * SecInHour; + ReportingConstant = TimeStepSys * DataGlobalConstants::SecInHour(); for (ZoneLoop = 1; ZoneLoop <= NumOfZones; ++ZoneLoop) { // Start of zone loads report variable update loop ... diff --git a/src/EnergyPlus/EconomicTariff.cc b/src/EnergyPlus/EconomicTariff.cc index 576bc4123d8..ba3fe13a929 100644 --- a/src/EnergyPlus/EconomicTariff.cc +++ b/src/EnergyPlus/EconomicTariff.cc @@ -389,8 +389,6 @@ namespace EconomicTariff { int jObj; // loop index for objects int NumAlphas; // Number of elements in the alpha array int NumNums; // Number of elements in the numeric array - // CHARACTER(len=MaxNameLength),DIMENSION(100) :: AlphaArray !character string data - // REAL(r64), DIMENSION(100) :: NumArray !numeric data int IOStat; // IO Status when calling get input subroutine int found; bool isNotNumeric; @@ -859,8 +857,6 @@ namespace EconomicTariff { int iInObj; // loop index variable for reading in objects int NumAlphas; // Number of elements in the alpha array int NumNums; // Number of elements in the numeric array - // CHARACTER(len=MaxNameLength),DIMENSION(100) :: cAlphaArgs !character string data - // REAL(r64), DIMENSION(100) :: rNumericArgs !numeric data int IOStat; // IO Status when calling get input subroutine bool isNotNumeric; int jFld; @@ -943,8 +939,6 @@ namespace EconomicTariff { int iInObj; // loop index variable for reading in objects int NumAlphas; // Number of elements in the alpha array int NumNums; // Number of elements in the numeric array - // CHARACTER(len=MaxNameLength),DIMENSION(100) :: cAlphaArgs !character string data - // REAL(r64), DIMENSION(100) :: rNumericArgs !numeric data int IOStat; // IO Status when calling get input subroutine bool isNotNumeric; int jFld; @@ -1016,8 +1010,6 @@ namespace EconomicTariff { int iInObj; // loop index variable for reading in objects int NumAlphas; // Number of elements in the alpha array int NumNums; // Number of elements in the numeric array - // CHARACTER(len=MaxNameLength),DIMENSION(100) :: cAlphaArgs !character string data - // REAL(r64), DIMENSION(100) :: rNumericArgs !numeric data int IOStat; // IO Status when calling get input subroutine bool isNotNumeric; int jBlk; // loop index for blocks @@ -1121,8 +1113,6 @@ namespace EconomicTariff { int iInObj; // loop index variable for reading in objects int NumAlphas; // Number of elements in the alpha array int NumNums; // Number of elements in the numeric array - // CHARACTER(len=MaxNameLength),DIMENSION(100) :: cAlphaArgs !character string data - // REAL(r64), DIMENSION(100) :: rNumericArgs !numeric data int IOStat; // IO Status when calling get input subroutine bool isNotNumeric; int jFld; @@ -1192,8 +1182,6 @@ namespace EconomicTariff { int iInObj; // loop index variable for reading in objects int NumAlphas; // Number of elements in the alpha array int NumNums; // Number of elements in the numeric array - // CHARACTER(len=MaxNameLength),DIMENSION(100) :: cAlphaArgs !character string data - // REAL(r64), DIMENSION(100) :: rNumericArgs !numeric data int IOStat; // IO Status when calling get input subroutine int jVal; int variablePt; @@ -1269,8 +1257,6 @@ namespace EconomicTariff { int iInObj; // loop index variable for reading in objects int NumAlphas; // Number of elements in the alpha array int NumNums; // Number of elements in the numeric array - // CHARACTER(len=MaxNameLength),DIMENSION(100) :: cAlphaArgs !character string data - // REAL(r64), DIMENSION(100) :: rNumericArgs !numeric data int IOStat; // IO Status when calling get input subroutine int jLine; int jFld; @@ -2734,7 +2720,6 @@ namespace EconomicTariff { // calculation. using DataEnvironment::Month; - using DataGlobals::SecInHour; using DataGlobals::TimeStepZoneSec; using ScheduleManager::GetCurrentScheduleValue; @@ -2765,7 +2750,7 @@ namespace EconomicTariff { tariff(iTariff).collectEnergy += curInstantValue; tariff(iTariff).collectTime += TimeStepZoneSec; // added *SecInHour when adding RTP support August 2008 - if (tariff(iTariff).collectTime >= tariff(iTariff).demWinTime * SecInHour) { + if (tariff(iTariff).collectTime >= tariff(iTariff).demWinTime * DataGlobalConstants::SecInHour()) { // get current value that has been converted into desired units curDemand = tariff(iTariff).demandConv * tariff(iTariff).collectEnergy / tariff(iTariff).collectTime; curEnergy = tariff(iTariff).energyConv * tariff(iTariff).collectEnergy; diff --git a/src/EnergyPlus/ElectricBaseboardRadiator.cc b/src/EnergyPlus/ElectricBaseboardRadiator.cc index bedd0ed8735..af022eb10e8 100644 --- a/src/EnergyPlus/ElectricBaseboardRadiator.cc +++ b/src/EnergyPlus/ElectricBaseboardRadiator.cc @@ -1111,11 +1111,11 @@ namespace ElectricBaseboardRadiator { // Using/Aliasing using DataHVACGlobals::TimeStepSys; - ElecBaseboard(BaseboardNum).ElecUseLoad = ElecBaseboard(BaseboardNum).ElecUseRate * TimeStepSys * SecInHour; - ElecBaseboard(BaseboardNum).TotEnergy = ElecBaseboard(BaseboardNum).TotPower * TimeStepSys * SecInHour; - ElecBaseboard(BaseboardNum).Energy = ElecBaseboard(BaseboardNum).Power * TimeStepSys * SecInHour; - ElecBaseboard(BaseboardNum).ConvEnergy = ElecBaseboard(BaseboardNum).ConvPower * TimeStepSys * SecInHour; - ElecBaseboard(BaseboardNum).RadEnergy = ElecBaseboard(BaseboardNum).RadPower * TimeStepSys * SecInHour; + ElecBaseboard(BaseboardNum).ElecUseLoad = ElecBaseboard(BaseboardNum).ElecUseRate * TimeStepSys * DataGlobalConstants::SecInHour(); + ElecBaseboard(BaseboardNum).TotEnergy = ElecBaseboard(BaseboardNum).TotPower * TimeStepSys * DataGlobalConstants::SecInHour(); + ElecBaseboard(BaseboardNum).Energy = ElecBaseboard(BaseboardNum).Power * TimeStepSys * DataGlobalConstants::SecInHour(); + ElecBaseboard(BaseboardNum).ConvEnergy = ElecBaseboard(BaseboardNum).ConvPower * TimeStepSys * DataGlobalConstants::SecInHour(); + ElecBaseboard(BaseboardNum).RadEnergy = ElecBaseboard(BaseboardNum).RadPower * TimeStepSys * DataGlobalConstants::SecInHour(); } Real64 SumHATsurf(int const ZoneNum) // Zone number diff --git a/src/EnergyPlus/ElectricPowerServiceManager.cc b/src/EnergyPlus/ElectricPowerServiceManager.cc index 92fef7924d2..aa20fd84a0e 100644 --- a/src/EnergyPlus/ElectricPowerServiceManager.cc +++ b/src/EnergyPlus/ElectricPowerServiceManager.cc @@ -132,14 +132,14 @@ void ElectricPowerServiceManager::manageElectricPowerService(EnergyPlusData &sta // retrieve data from meters for demand and production totalBldgElecDemand_ = GetInstantMeterValue(elecFacilityIndex_, OutputProcessor::TimeStepType::TimeStepZone) / DataGlobals::TimeStepZoneSec; - totalHVACElecDemand_ = GetInstantMeterValue(elecFacilityIndex_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + totalHVACElecDemand_ = GetInstantMeterValue(elecFacilityIndex_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); totalElectricDemand_ = totalBldgElecDemand_ + totalHVACElecDemand_; - elecProducedPVRate_ = GetInstantMeterValue(elecProducedPVIndex_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); - elecProducedWTRate_ = GetInstantMeterValue(elecProducedWTIndex_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); - elecProducedStorageRate_ = GetInstantMeterValue(elecProducedStorageIndex_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); - elecProducedCoGenRate_ = GetInstantMeterValue(elecProducedCoGenIndex_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + elecProducedPVRate_ = GetInstantMeterValue(elecProducedPVIndex_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); + elecProducedWTRate_ = GetInstantMeterValue(elecProducedWTIndex_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); + elecProducedStorageRate_ = GetInstantMeterValue(elecProducedStorageIndex_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); + elecProducedCoGenRate_ = GetInstantMeterValue(elecProducedCoGenIndex_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); elecProducedPowerConversionRate_ = - GetInstantMeterValue(elecProducedPowerConversionIndex_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + GetInstantMeterValue(elecProducedPowerConversionIndex_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); wholeBldgRemainingLoad_ = totalElectricDemand_; @@ -427,17 +427,17 @@ void ElectricPowerServiceManager::updateWholeBuildingRecords() // main panel balancing. totalBldgElecDemand_ = GetInstantMeterValue(elecFacilityIndex_, OutputProcessor::TimeStepType::TimeStepZone) / DataGlobals::TimeStepZoneSec; - totalHVACElecDemand_ = GetInstantMeterValue(elecFacilityIndex_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + totalHVACElecDemand_ = GetInstantMeterValue(elecFacilityIndex_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); totalElectricDemand_ = totalBldgElecDemand_ + totalHVACElecDemand_; - elecProducedPVRate_ = GetInstantMeterValue(elecProducedPVIndex_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); - elecProducedWTRate_ = GetInstantMeterValue(elecProducedWTIndex_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); - elecProducedStorageRate_ = GetInstantMeterValue(elecProducedStorageIndex_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); - elecProducedCoGenRate_ = GetInstantMeterValue(elecProducedCoGenIndex_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + elecProducedPVRate_ = GetInstantMeterValue(elecProducedPVIndex_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); + elecProducedWTRate_ = GetInstantMeterValue(elecProducedWTIndex_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); + elecProducedStorageRate_ = GetInstantMeterValue(elecProducedStorageIndex_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); + elecProducedCoGenRate_ = GetInstantMeterValue(elecProducedCoGenIndex_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); elecProducedPowerConversionRate_ = - GetInstantMeterValue(elecProducedPowerConversionIndex_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + GetInstantMeterValue(elecProducedPowerConversionIndex_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); electProdRate_ = elecProducedCoGenRate_ + elecProducedPVRate_ + elecProducedWTRate_ + elecProducedStorageRate_ + elecProducedPowerConversionRate_; - electricityProd_ = electProdRate_ * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; // whole building + electricityProd_ = electProdRate_ * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); // whole building // Report the Total Electric Power Purchased [W], If negative then there is extra power to be sold or stored. electPurchRate_ = totalElectricDemand_ - electProdRate_; @@ -446,19 +446,19 @@ void ElectricPowerServiceManager::updateWholeBuildingRecords() if (electPurchRate_ < 0.0) electPurchRate_ = 0.0; // don't want negative purchased... // Report the Total Electric Energy Purchased [J] - electricityPurch_ = electPurchRate_ * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + electricityPurch_ = electPurchRate_ * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); // report the total electric surplus.... electSurplusRate_ = electProdRate_ - totalElectricDemand_; if (std::abs(electSurplusRate_) < 0.0001) electSurplusRate_ = 0.0; if (electSurplusRate_ < 0.0) electSurplusRate_ = 0.0; // don't want negative surplus - electricitySurplus_ = electSurplusRate_ * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + electricitySurplus_ = electSurplusRate_ * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); // report the net electricity , + is purchased, - is surplus electricityNetRate_ = totalElectricDemand_ - electProdRate_; - electricityNet_ = electricityNetRate_ * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + electricityNet_ = electricityNetRate_ * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); } void ElectricPowerServiceManager::reportPVandWindCapacity() @@ -1274,7 +1274,7 @@ void ElectPowerLoadCenter::dispatchGenerators(EnergyPlusData &state, bool const // electrical demand from a meter, it can also be a user-defined Custom Meter // and PV is ignored. customMeterDemand = GetInstantMeterValue(demandMeterPtr_, OutputProcessor::TimeStepType::TimeStepZone) / DataGlobals::TimeStepZoneSec + - GetInstantMeterValue(demandMeterPtr_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + GetInstantMeterValue(demandMeterPtr_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); remainingLoad = customMeterDemand; loadCenterElectricLoad = remainingLoad; @@ -1463,7 +1463,7 @@ void ElectPowerLoadCenter::dispatchGenerators(EnergyPlusData &state, bool const genElectricProd = 0.0; for (auto &g : elecGenCntrlObj) { genElectProdRate += g->electProdRate; - g->electricityProd = g->electProdRate * (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + g->electricityProd = g->electProdRate * (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); genElectricProd += g->electricityProd; } } @@ -1511,7 +1511,7 @@ void ElectPowerLoadCenter::dispatchStorage(EnergyPlusData &state, Real64 const o case StorageOpScheme::meterDemandStoreExcessOnSite: { // Get meter rate subpanelFeedInRequest = GetInstantMeterValue(trackStorageOpMeterIndex_, OutputProcessor::TimeStepType::TimeStepZone) / DataGlobals::TimeStepZoneSec + - GetInstantMeterValue(trackStorageOpMeterIndex_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + GetInstantMeterValue(trackStorageOpMeterIndex_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); subpanelDrawRequest = 0.0; break; } @@ -2635,17 +2635,17 @@ void DCtoACInverter::calcEfficiency(EnergyPlusData &state) void DCtoACInverter::simulate(EnergyPlusData &state, Real64 const powerIntoInverter) { dCPowerIn_ = powerIntoInverter; - dCEnergyIn_ = dCPowerIn_ * (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + dCEnergyIn_ = dCPowerIn_ * (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); // check availability schedule if (ScheduleManager::GetCurrentScheduleValue(availSchedPtr_) > 0.0) { // now calculate Inverter based on model type calcEfficiency(state); aCPowerOut_ = efficiency_ * dCPowerIn_; - aCEnergyOut_ = aCPowerOut_ * (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + aCEnergyOut_ = aCPowerOut_ * (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); if (aCPowerOut_ == 0.0) { - ancillACuseEnergy_ = standbyPower_ * (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + ancillACuseEnergy_ = standbyPower_ * (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); ancillACuseRate_ = standbyPower_; } else { ancillACuseRate_ = 0.0; @@ -2660,10 +2660,10 @@ void DCtoACInverter::simulate(EnergyPlusData &state, Real64 const powerIntoInver } // update report variables conversionLossPower_ = dCPowerIn_ - aCPowerOut_; - conversionLossEnergy_ = conversionLossPower_ * (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + conversionLossEnergy_ = conversionLossPower_ * (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); conversionLossEnergyDecrement_ = -1.0 * conversionLossEnergy_; thermLossRate_ = dCPowerIn_ - aCPowerOut_ + ancillACuseRate_; - thermLossEnergy_ = thermLossRate_ * (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + thermLossEnergy_ = thermLossRate_ * (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); qdotConvZone_ = thermLossRate_ * (1.0 - zoneRadFract_); qdotRadZone_ = thermLossRate_ * zoneRadFract_; } @@ -2891,7 +2891,7 @@ void ACtoDCConverter::simulate(EnergyPlusData &state, Real64 const powerOutFromC dCPowerOut_ = aCPowerIn_ * efficiency_; if (dCPowerOut_ == 0.0) { - ancillACuseEnergy_ = standbyPower_ * (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + ancillACuseEnergy_ = standbyPower_ * (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); ancillACuseRate_ = standbyPower_; } else { ancillACuseRate_ = 0.0; @@ -2906,13 +2906,13 @@ void ACtoDCConverter::simulate(EnergyPlusData &state, Real64 const powerOutFromC } // update and report - aCEnergyIn_ = aCPowerIn_ * (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); - dCEnergyOut_ = dCPowerOut_ * (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + aCEnergyIn_ = aCPowerIn_ * (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); + dCEnergyOut_ = dCPowerOut_ * (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); conversionLossPower_ = aCPowerIn_ - dCPowerOut_; - conversionLossEnergy_ = conversionLossPower_ * (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + conversionLossEnergy_ = conversionLossPower_ * (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); conversionLossEnergyDecrement_ = -1.0 * conversionLossEnergy_; thermLossRate_ = aCPowerIn_ - dCPowerOut_ + ancillACuseRate_; - thermLossEnergy_ = thermLossRate_ * (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + thermLossEnergy_ = thermLossRate_ * (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); qdotConvZone_ = thermLossRate_ * (1.0 - zoneRadFract_); qdotRadZone_ = thermLossRate_ * zoneRadFract_; } @@ -3405,10 +3405,10 @@ void ElectricStorage::simulateSimpleBucketModel(Real64 &powerCharge, } // now check to see if charge would exceed capacity, and modify to just fill physical storage cap - if ((lastTimeStepStateOfCharge_ + powerCharge * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour * energeticEfficCharge_) >= + if ((lastTimeStepStateOfCharge_ + powerCharge * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour() * energeticEfficCharge_) >= (maxEnergyCapacity_ * controlSOCMaxFracLimit)) { powerCharge = ((maxEnergyCapacity_ * controlSOCMaxFracLimit) - lastTimeStepStateOfCharge_) / - (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour * energeticEfficCharge_); + (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour() * energeticEfficCharge_); } } // charging @@ -3423,10 +3423,10 @@ void ElectricStorage::simulateSimpleBucketModel(Real64 &powerCharge, powerDischarge = maxPowerDraw_; } // now check if will empty this timestep, power draw is amplified by energetic effic - if ((lastTimeStepStateOfCharge_ - powerDischarge * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour / energeticEfficDischarge_) <= + if ((lastTimeStepStateOfCharge_ - powerDischarge * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour() / energeticEfficDischarge_) <= (maxEnergyCapacity_ * controlSOCMinFracLimit)) { powerDischarge = (lastTimeStepStateOfCharge_ - (maxEnergyCapacity_ * controlSOCMinFracLimit)) * energeticEfficDischarge_ / - (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); } } @@ -3439,25 +3439,25 @@ void ElectricStorage::simulateSimpleBucketModel(Real64 &powerCharge, pelIntoStorage_ = powerCharge; pelFromStorage_ = 0.0; thisTimeStepStateOfCharge_ = - lastTimeStepStateOfCharge_ + powerCharge * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour * energeticEfficCharge_; + lastTimeStepStateOfCharge_ + powerCharge * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour() * energeticEfficCharge_; } if (discharging) { pelIntoStorage_ = 0.0; pelFromStorage_ = powerDischarge; thisTimeStepStateOfCharge_ = - lastTimeStepStateOfCharge_ - powerDischarge * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour / energeticEfficDischarge_; + lastTimeStepStateOfCharge_ - powerDischarge * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour() / energeticEfficDischarge_; thisTimeStepStateOfCharge_ = max(thisTimeStepStateOfCharge_, 0.0); } // updates and reports electEnergyinStorage_ = thisTimeStepStateOfCharge_; //[J] storedPower_ = pelIntoStorage_; - storedEnergy_ = pelIntoStorage_ * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + storedEnergy_ = pelIntoStorage_ * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); decrementedEnergyStored_ = -1.0 * storedEnergy_; drawnPower_ = pelFromStorage_; - drawnEnergy_ = pelFromStorage_ * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + drawnEnergy_ = pelFromStorage_ * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); thermLossRate_ = max(storedPower_ * (1.0 - energeticEfficCharge_), drawnPower_ * (1.0 - energeticEfficDischarge_)); - thermLossEnergy_ = thermLossRate_ * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + thermLossEnergy_ = thermLossRate_ * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); if (zoneNum_ > 0) { // set values for zone heat gains qdotConvZone_ = (1.0 - zoneRadFract_) * thermLossRate_; @@ -3649,7 +3649,7 @@ void ElectricStorage::simulateKineticBatteryModel(EnergyPlusData &state, if (TotalSOC > q0) { storageMode_ = 2; storedPower_ = -1.0 * Volt * I0 * numBattery_; // Issue #5303, fix sign issue - storedEnergy_ = -1.0 * Volt * I0 * numBattery_ * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + storedEnergy_ = -1.0 * Volt * I0 * numBattery_ * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); decrementedEnergyStored_ = -1.0 * storedEnergy_; drawnPower_ = 0.0; drawnEnergy_ = 0.0; @@ -3660,7 +3660,7 @@ void ElectricStorage::simulateKineticBatteryModel(EnergyPlusData &state, storedEnergy_ = 0.0; decrementedEnergyStored_ = 0.0; drawnPower_ = Volt * I0 * numBattery_; - drawnEnergy_ = Volt * I0 * numBattery_ * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + drawnEnergy_ = Volt * I0 * numBattery_ * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); } else { storageMode_ = 0; @@ -3676,7 +3676,7 @@ void ElectricStorage::simulateKineticBatteryModel(EnergyPlusData &state, batteryCurrent_ = I0 * parallelNum_; batteryVoltage_ = Volt * seriesNum_; thermLossRate_ = internalR_ * pow_2(I0) * numBattery_; - thermLossEnergy_ = internalR_ * pow_2(I0) * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour * numBattery_; + thermLossEnergy_ = internalR_ * pow_2(I0) * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour() * numBattery_; if (zoneNum_ > 0) { // set values for zone heat gains qdotConvZone_ = ((1.0 - zoneRadFract_) * thermLossRate_) * numBattery_; @@ -4184,7 +4184,7 @@ void ElectricTransformer::manageTransformers(Real64 const surplusPowerOutFromLoa if (DataGlobals::MetersHaveBeenInitialized) { elecLoad += GetInstantMeterValue(wiredMeterPtrs_[meterNum], OutputProcessor::TimeStepType::TimeStepZone) / DataGlobals::TimeStepZoneSec + - GetInstantMeterValue(wiredMeterPtrs_[meterNum], OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + GetInstantMeterValue(wiredMeterPtrs_[meterNum], OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); // PastElecLoad store the metered value in the previous time step. This value will be used to check whether // a transformer is overloaded or not. pastElecLoad += GetCurrentMeterValue(wiredMeterPtrs_[meterNum]) / DataGlobals::TimeStepZoneSec; @@ -4274,14 +4274,14 @@ void ElectricTransformer::manageTransformers(Real64 const surplusPowerOutFromLoa // are considered in utility cost. If transformer losses are not considered in utility cost, 0 is assigned // to the variable "%ElecUseUtility". if (considerLosses_) { - elecUseMeteredUtilityLosses_ = totalLossRate_ * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + elecUseMeteredUtilityLosses_ = totalLossRate_ * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); } else { elecUseMeteredUtilityLosses_ = 0.0; } // Transformer has two modes.If it works in one mode, the variable for meter output in the other mode // is assigned 0 - totalLossEnergy_ = totalLossRate_ * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + totalLossEnergy_ = totalLossRate_ * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); break; } @@ -4292,7 +4292,7 @@ void ElectricTransformer::manageTransformers(Real64 const surplusPowerOutFromLoa if (powerOut_ < 0) powerOut_ = 0.0; - powerConversionMeteredLosses_ = -1.0 * totalLossRate_ * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + powerConversionMeteredLosses_ = -1.0 * totalLossRate_ * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); // Transformer has two modes.If it works in one mode, the variable for meter output in the other mode // is assigned 0 @@ -4311,16 +4311,16 @@ void ElectricTransformer::manageTransformers(Real64 const surplusPowerOutFromLoa } else { efficiency_ = powerOut_ / powerIn_; } - noLoadLossEnergy_ = noLoadLossRate_ * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - loadLossEnergy_ = loadLossRate_ * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + noLoadLossEnergy_ = noLoadLossRate_ * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + loadLossEnergy_ = loadLossRate_ * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); - energyIn_ = powerIn_ * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - energyOut_ = powerOut_ * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + energyIn_ = powerIn_ * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + energyOut_ = powerOut_ * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); // Thermal loss rate may not be equal to Total loss rate. This is the case when surplus power is less than the // calculated total loss rate for a cogeneration transformer. That is why "PowerIn - PowerOut" is used below. thermalLossRate_ = powerIn_ - powerOut_; - thermalLossEnergy_ = thermalLossRate_ * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + thermalLossEnergy_ = thermalLossRate_ * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); if (zoneNum_ > 0) { // set values for zone heat gains qdotConvZone_ = (1.0 - zoneRadFrac_) * thermalLossRate_; diff --git a/src/EnergyPlus/EvaporativeCoolers.cc b/src/EnergyPlus/EvaporativeCoolers.cc index 30a6e29141d..236aecd2b6e 100644 --- a/src/EnergyPlus/EvaporativeCoolers.cc +++ b/src/EnergyPlus/EvaporativeCoolers.cc @@ -124,9 +124,7 @@ namespace EvaporativeCoolers { using DataGlobals::BeginDayFlag; using DataGlobals::BeginEnvrnFlag; using DataGlobals::DisplayExtraWarnings; - using DataGlobals::MaxNameLength; using DataGlobals::ScheduleAlwaysOn; - using DataGlobals::SecInHour; using DataGlobals::SysSizingCalc; using namespace DataLoopNode; using DataEnvironment::OutBaroPress; @@ -3565,11 +3563,11 @@ namespace EvaporativeCoolers { // na // report the Evap Cooler energy from this component EvapCond(EvapCoolNum).EvapCoolerPower = EvapCond(EvapCoolNum).EvapCoolerPower; - EvapCond(EvapCoolNum).EvapCoolerEnergy = EvapCond(EvapCoolNum).EvapCoolerPower * TimeStepSys * SecInHour; + EvapCond(EvapCoolNum).EvapCoolerEnergy = EvapCond(EvapCoolNum).EvapCoolerPower * TimeStepSys * DataGlobalConstants::SecInHour(); // Report Water comsumption in cubic meters per timestep - EvapCond(EvapCoolNum).EvapWaterConsump = EvapCond(EvapCoolNum).EvapWaterConsumpRate * TimeStepSys * SecInHour; - EvapCond(EvapCoolNum).EvapWaterStarvMakup = EvapCond(EvapCoolNum).EvapWaterStarvMakupRate * TimeStepSys * SecInHour; + EvapCond(EvapCoolNum).EvapWaterConsump = EvapCond(EvapCoolNum).EvapWaterConsumpRate * TimeStepSys * DataGlobalConstants::SecInHour(); + EvapCond(EvapCoolNum).EvapWaterStarvMakup = EvapCond(EvapCoolNum).EvapWaterStarvMakupRate * TimeStepSys * DataGlobalConstants::SecInHour(); } //*************** @@ -5012,13 +5010,13 @@ namespace EvaporativeCoolers { QSensUnitOut = AirMassFlow * (PsyHFnTdbW(Node(UnitOutletNodeNum).Temp, MinHumRat) - PsyHFnTdbW(Node(ZoneNodeNum).Temp, MinHumRat)); ZoneEvapUnit(UnitNum).UnitTotalCoolingRate = std::abs(min(0.0, QTotUnitOut)); - ZoneEvapUnit(UnitNum).UnitTotalCoolingEnergy = ZoneEvapUnit(UnitNum).UnitTotalCoolingRate * TimeStepSys * SecInHour; + ZoneEvapUnit(UnitNum).UnitTotalCoolingEnergy = ZoneEvapUnit(UnitNum).UnitTotalCoolingRate * TimeStepSys * DataGlobalConstants::SecInHour(); ZoneEvapUnit(UnitNum).UnitSensibleCoolingRate = std::abs(min(0.0, QSensUnitOut)); - ZoneEvapUnit(UnitNum).UnitSensibleCoolingEnergy = ZoneEvapUnit(UnitNum).UnitSensibleCoolingRate * TimeStepSys * SecInHour; + ZoneEvapUnit(UnitNum).UnitSensibleCoolingEnergy = ZoneEvapUnit(UnitNum).UnitSensibleCoolingRate * TimeStepSys * DataGlobalConstants::SecInHour(); ZoneEvapUnit(UnitNum).UnitLatentHeatingRate = std::abs(max(0.0, (QTotUnitOut - QSensUnitOut))); - ZoneEvapUnit(UnitNum).UnitLatentHeatingEnergy = ZoneEvapUnit(UnitNum).UnitLatentHeatingRate * TimeStepSys * SecInHour; + ZoneEvapUnit(UnitNum).UnitLatentHeatingEnergy = ZoneEvapUnit(UnitNum).UnitLatentHeatingRate * TimeStepSys * DataGlobalConstants::SecInHour(); ZoneEvapUnit(UnitNum).UnitLatentCoolingRate = std::abs(min(0.0, (QTotUnitOut - QSensUnitOut))); - ZoneEvapUnit(UnitNum).UnitLatentCoolingEnergy = ZoneEvapUnit(UnitNum).UnitLatentCoolingRate * TimeStepSys * SecInHour; + ZoneEvapUnit(UnitNum).UnitLatentCoolingEnergy = ZoneEvapUnit(UnitNum).UnitLatentCoolingRate * TimeStepSys * DataGlobalConstants::SecInHour(); ZoneEvapUnit(UnitNum).UnitFanSpeedRatio = ZoneEvapUnit(UnitNum).FanSpeedRatio; } diff --git a/src/EnergyPlus/EvaporativeFluidCoolers.cc b/src/EnergyPlus/EvaporativeFluidCoolers.cc index 7c20fac5db7..71cfefba85c 100644 --- a/src/EnergyPlus/EvaporativeFluidCoolers.cc +++ b/src/EnergyPlus/EvaporativeFluidCoolers.cc @@ -2443,12 +2443,12 @@ namespace EvaporativeFluidCoolers { // total water usage // update report variables - this->EvaporationVol = this->EvaporationVdot * (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); - this->DriftVol = this->DriftVdot * (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); - this->BlowdownVol = this->BlowdownVdot * (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); - this->MakeUpVol = this->MakeUpVdot * (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); - this->TankSupplyVol = this->TankSupplyVdot * (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); - this->StarvedMakeUpVol = this->StarvedMakeUpVdot * (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + this->EvaporationVol = this->EvaporationVdot * (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); + this->DriftVol = this->DriftVdot * (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); + this->BlowdownVol = this->BlowdownVdot * (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); + this->MakeUpVol = this->MakeUpVdot * (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); + this->TankSupplyVol = this->TankSupplyVdot * (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); + this->StarvedMakeUpVol = this->StarvedMakeUpVdot * (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); } void EvapFluidCoolerSpecs::UpdateEvapFluidCooler() @@ -2546,7 +2546,7 @@ namespace EvaporativeFluidCoolers { Real64 ReportingConstant; - ReportingConstant = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + ReportingConstant = DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); if (!RunFlag) { this->fluidCoolerInletWaterTemp = DataLoopNode::Node(this->WaterInletNode).Temp; diff --git a/src/EnergyPlus/ExternalInterface.cc b/src/EnergyPlus/ExternalInterface.cc index b7156621c44..00d7c3f0506 100644 --- a/src/EnergyPlus/ExternalInterface.cc +++ b/src/EnergyPlus/ExternalInterface.cc @@ -575,7 +575,7 @@ namespace ExternalInterface { StopExternalInterfaceIfError(); // make a single length here for all strings to be passed to getepvariables - size_t lenXmlStr(maxVar * DataGlobals::MaxNameLength); // Length of strings being passed to getepvariables + size_t lenXmlStr(maxVar * DataGlobalConstants::MaxNameLength()); // Length of strings being passed to getepvariables // initialize all the strings to this length with blanks xmlStrOut = std::string(lenXmlStr, ' '); diff --git a/src/EnergyPlus/FanCoilUnits.cc b/src/EnergyPlus/FanCoilUnits.cc index 11ad4e1570d..d7576951bfb 100644 --- a/src/EnergyPlus/FanCoilUnits.cc +++ b/src/EnergyPlus/FanCoilUnits.cc @@ -136,7 +136,6 @@ namespace FanCoilUnits { using DataGlobals::BeginDayFlag; using DataGlobals::BeginEnvrnFlag; using DataGlobals::DisplayExtraWarnings; - using DataGlobals::SecInHour; using DataGlobals::SysSizingCalc; using DataHVACGlobals::ATMixer_InletSide; using DataHVACGlobals::ATMixer_SupplySide; @@ -4668,7 +4667,7 @@ namespace FanCoilUnits { Real64 ReportingConstant; // FLOW - ReportingConstant = TimeStepSys * SecInHour; + ReportingConstant = TimeStepSys * DataGlobalConstants::SecInHour(); FanCoil(FanCoilNum).HeatEnergy = FanCoil(FanCoilNum).HeatPower * ReportingConstant; FanCoil(FanCoilNum).SensCoolEnergy = FanCoil(FanCoilNum).SensCoolPower * ReportingConstant; FanCoil(FanCoilNum).TotCoolEnergy = FanCoil(FanCoilNum).TotCoolPower * ReportingConstant; diff --git a/src/EnergyPlus/Fans.cc b/src/EnergyPlus/Fans.cc index 5ebbad5acc4..8a307eec003 100644 --- a/src/EnergyPlus/Fans.cc +++ b/src/EnergyPlus/Fans.cc @@ -2603,7 +2603,6 @@ namespace Fans { // na // Using/Aliasing - using DataGlobals::SecInHour; using DataHVACGlobals::TimeStepSys; // Locals @@ -2621,7 +2620,7 @@ namespace Fans { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: // na - Fan(FanNum).FanEnergy = Fan(FanNum).FanPower * TimeStepSys * SecInHour; + Fan(FanNum).FanEnergy = Fan(FanNum).FanPower * TimeStepSys * DataGlobalConstants::SecInHour(); Fan(FanNum).DeltaTemp = Fan(FanNum).OutletAirTemp - Fan(FanNum).InletAirTemp; if (Fan(FanNum).FanType_Num == FanType_SimpleOnOff) { diff --git a/src/EnergyPlus/FluidCoolers.cc b/src/EnergyPlus/FluidCoolers.cc index 2b7fbc7ee7d..0b999f2e248 100644 --- a/src/EnergyPlus/FluidCoolers.cc +++ b/src/EnergyPlus/FluidCoolers.cc @@ -1838,7 +1838,7 @@ namespace FluidCoolers { // PURPOSE OF THIS SUBROUTINE: // This subroutine updates the report variables for the fluid cooler. - Real64 ReportingConstant = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + Real64 ReportingConstant = DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); auto &waterInletNode = this->WaterInletNodeNum; if (!RunFlag) { this->InletWaterTemp = DataLoopNode::Node(waterInletNode).Temp; diff --git a/src/EnergyPlus/FuelCellElectricGenerator.cc b/src/EnergyPlus/FuelCellElectricGenerator.cc index 30d9fb0d9c2..a939bad68c5 100644 --- a/src/EnergyPlus/FuelCellElectricGenerator.cc +++ b/src/EnergyPlus/FuelCellElectricGenerator.cc @@ -289,11 +289,11 @@ namespace FuelCellElectricGenerator { FuelCell(thisFuelCell).FCPM.ThreshRunHours = NumArray(7); FuelCell(thisFuelCell).FCPM.UpTranLimit = NumArray(8); FuelCell(thisFuelCell).FCPM.DownTranLimit = NumArray(9); - FuelCell(thisFuelCell).FCPM.StartUpTime = NumArray(10) / DataGlobals::SecInHour; // convert to hours from seconds + FuelCell(thisFuelCell).FCPM.StartUpTime = NumArray(10) / DataGlobalConstants::SecInHour(); // convert to hours from seconds FuelCell(thisFuelCell).FCPM.StartUpFuel = NumArray(11); FuelCell(thisFuelCell).FCPM.StartUpElectConsum = NumArray(12); FuelCell(thisFuelCell).FCPM.StartUpElectProd = NumArray(13); - FuelCell(thisFuelCell).FCPM.ShutDownTime = NumArray(14) / DataGlobals::SecInHour; // convert to hours from seconds + FuelCell(thisFuelCell).FCPM.ShutDownTime = NumArray(14) / DataGlobalConstants::SecInHour(); // convert to hours from seconds FuelCell(thisFuelCell).FCPM.ShutDownFuel = NumArray(15); FuelCell(thisFuelCell).FCPM.ShutDownElectConsum = NumArray(16); FuelCell(thisFuelCell).FCPM.ANC0 = NumArray(17); @@ -1379,7 +1379,7 @@ namespace FuelCellElectricGenerator { this->FCPM.FractionalDayofLastShutDown = double(DataGlobals::DayOfSim) + (int(DataGlobals::CurrentTime) + (DataHVACGlobals::SysTimeElapsed + (DataGlobals::CurrentTime - int(DataGlobals::CurrentTime)))) / - DataGlobals::HoursInDay; + DataGlobalConstants::HoursInDay(); this->FCPM.HasBeenOn = false; if (this->FCPM.ShutDownTime > 0.0) this->FCPM.DuringShutDown = true; @@ -1399,7 +1399,7 @@ namespace FuelCellElectricGenerator { this->FCPM.FractionalDayofLastStartUp = double(DataGlobals::DayOfSim) + (int(DataGlobals::CurrentTime) + (DataHVACGlobals::SysTimeElapsed + (DataGlobals::CurrentTime - int(DataGlobals::CurrentTime)))) / - DataGlobals::HoursInDay; + DataGlobalConstants::HoursInDay(); this->FCPM.HasBeenOn = true; ++this->FCPM.NumCycles; // increment cycling counter @@ -1949,20 +1949,20 @@ namespace FuelCellElectricGenerator { // now add energy to storage from charging if ((this->ElecStorage.LastTimeStepStateOfCharge + - tmpPcharge * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour * this->ElecStorage.EnergeticEfficCharge) < + tmpPcharge * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour() * this->ElecStorage.EnergeticEfficCharge) < this->ElecStorage.NominalEnergyCapacity) { this->ElecStorage.ThisTimeStepStateOfCharge = this->ElecStorage.LastTimeStepStateOfCharge + - tmpPcharge * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour * this->ElecStorage.EnergeticEfficCharge; + tmpPcharge * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour() * this->ElecStorage.EnergeticEfficCharge; } else { // would over charge this time step tmpPcharge = (this->ElecStorage.NominalEnergyCapacity - this->ElecStorage.LastTimeStepStateOfCharge) / - (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour * this->ElecStorage.EnergeticEfficCharge); + (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour() * this->ElecStorage.EnergeticEfficCharge); Constrained = true; this->ElecStorage.ThisTimeStepStateOfCharge = this->ElecStorage.LastTimeStepStateOfCharge + - tmpPcharge * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour * this->ElecStorage.EnergeticEfficCharge; + tmpPcharge * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour() * this->ElecStorage.EnergeticEfficCharge; } // losses go into QairIntake @@ -1999,17 +1999,17 @@ namespace FuelCellElectricGenerator { // now take energy from storage by drawing (amplified by energetic effic) if ((this->ElecStorage.LastTimeStepStateOfCharge - - tmpPdraw * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour / this->ElecStorage.EnergeticEfficDischarge) > 0.0) { + tmpPdraw * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour() / this->ElecStorage.EnergeticEfficDischarge) > 0.0) { this->ElecStorage.ThisTimeStepStateOfCharge = this->ElecStorage.LastTimeStepStateOfCharge - - tmpPdraw * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour / this->ElecStorage.EnergeticEfficDischarge; + tmpPdraw * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour() / this->ElecStorage.EnergeticEfficDischarge; } else { // would over drain storage this timestep so reduce tmpPdraw tmpPdraw = this->ElecStorage.LastTimeStepStateOfCharge * this->ElecStorage.EnergeticEfficDischarge / - (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); this->ElecStorage.ThisTimeStepStateOfCharge = this->ElecStorage.LastTimeStepStateOfCharge - - tmpPdraw * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour / this->ElecStorage.EnergeticEfficDischarge; + tmpPdraw * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour() / this->ElecStorage.EnergeticEfficDischarge; Constrained = true; } @@ -2771,13 +2771,13 @@ namespace FuelCellElectricGenerator { Real64 CurrentFractionalDay = double(DataGlobals::DayOfSim) + (int(DataGlobals::CurrentTime) + (DataHVACGlobals::SysTimeElapsed + (DataGlobals::CurrentTime - int(DataGlobals::CurrentTime)))) / - DataGlobals::HoursInDay; + DataGlobalConstants::HoursInDay(); // Check if in start up and if it still should be if (this->FCPM.DuringStartUp) { // calculate time for end of start up period - Real64 EndingFractionalDay = this->FCPM.FractionalDayofLastStartUp + this->FCPM.StartUpTime / DataGlobals::HoursInDay; + Real64 EndingFractionalDay = this->FCPM.FractionalDayofLastStartUp + this->FCPM.StartUpTime / DataGlobalConstants::HoursInDay(); if (CurrentFractionalDay > EndingFractionalDay) { // start up period is now over @@ -2789,7 +2789,7 @@ namespace FuelCellElectricGenerator { if (this->FCPM.DuringShutDown) { // calculate time for end of shut down period - Real64 EndingFractionalDay = this->FCPM.FractionalDayofLastShutDown + this->FCPM.ShutDownTime / DataGlobals::HoursInDay; + Real64 EndingFractionalDay = this->FCPM.FractionalDayofLastShutDown + this->FCPM.ShutDownTime / DataGlobalConstants::HoursInDay(); if (CurrentFractionalDay > EndingFractionalDay) { // start up period is now over @@ -2802,7 +2802,7 @@ namespace FuelCellElectricGenerator { // unit is neither starting or stopping and the only constraints would come from transient limits if (Pel > this->FCPM.PelLastTimeStep) { // powering up // working variable for max allowed by transient constraint - Real64 MaxPel = this->FCPM.PelLastTimeStep + this->FCPM.UpTranLimit * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + Real64 MaxPel = this->FCPM.PelLastTimeStep + this->FCPM.UpTranLimit * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); if (MaxPel < Pel) { Pel = MaxPel; Constrained = true; @@ -2811,7 +2811,7 @@ namespace FuelCellElectricGenerator { } } else if (Pel < this->FCPM.PelLastTimeStep) { // powering down // working variable for min allowed by transient constraint - Real64 MinPel = this->FCPM.PelLastTimeStep - this->FCPM.DownTranLimit * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + Real64 MinPel = this->FCPM.PelLastTimeStep - this->FCPM.DownTranLimit * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); if (Pel < MinPel) { Pel = MinPel; Constrained = true; @@ -3421,7 +3421,7 @@ namespace FuelCellElectricGenerator { { this->Report.ACPowerGen = this->ACPowerGen; // electrical power produced [W] - this->Report.ACEnergyGen = this->ACPowerGen * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; // energy produced (J) + this->Report.ACEnergyGen = this->ACPowerGen * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); // energy produced (J) this->Report.QdotExhaust = 0.0; // reporting: exhaust gas heat recovered (W) this->Report.TotalHeatEnergyRec = 0.0; // reporting: total heat recovered (J) this->Report.ExhaustEnergyRec = 0.0; // reporting: exhaust gas heat recovered (J) @@ -3440,7 +3440,7 @@ namespace FuelCellElectricGenerator { this->Report.NdotAir = this->FCPM.NdotAir; // air flow in kmol/sec this->Report.TotAirInEnthalphy = this->FCPM.TotAirInEnthalphy; // State point 4 this->Report.BlowerPower = this->AirSup.PairCompEl; // electrical power used by air supply blower - this->Report.BlowerEnergy = this->AirSup.PairCompEl * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; // electrical energy + this->Report.BlowerEnergy = this->AirSup.PairCompEl * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); // electrical energy this->Report.BlowerSkinLoss = this->AirSup.QskinLoss; // heat rate of losses by blower this->Report.TfuelInlet = DataGenerators::FuelSupply(this->FuelSupNum).TfuelIntoCompress; // State point 2 @@ -3450,16 +3450,16 @@ namespace FuelCellElectricGenerator { this->Report.FuelCompressPower = DataGenerators::FuelSupply(this->FuelSupNum).PfuelCompEl; // electrical power used by fuel supply compressor [W] this->Report.FuelCompressEnergy = - DataGenerators::FuelSupply(this->FuelSupNum).PfuelCompEl * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; // elect energy + DataGenerators::FuelSupply(this->FuelSupNum).PfuelCompEl * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); // elect energy this->Report.FuelCompressSkinLoss = DataGenerators::FuelSupply(this->FuelSupNum).QskinLoss; // heat rate of losses.by fuel supply compressor [W] this->Report.FuelEnergyLHV = this->FCPM.NdotFuel * DataGenerators::FuelSupply(this->FuelSupNum).LHV * 1000000.0 * - DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; // reporting: Fuel Energy used (J) + DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); // reporting: Fuel Energy used (J) this->Report.FuelEnergyUseRateLHV = this->FCPM.NdotFuel * DataGenerators::FuelSupply(this->FuelSupNum).LHV * 1000000.0; // reporting: Fuel Energy used (W) this->Report.FuelEnergyHHV = this->FCPM.NdotFuel * DataGenerators::FuelSupply(this->FuelSupNum).HHV * DataGenerators::FuelSupply(this->FuelSupNum).KmolPerSecToKgPerSec * DataHVACGlobals::TimeStepSys * - DataGlobals::SecInHour; + DataGlobalConstants::SecInHour(); this->Report.FuelEnergyUseRateHHV = this->FCPM.NdotFuel * DataGenerators::FuelSupply(this->FuelSupNum).HHV * DataGenerators::FuelSupply(this->FuelSupNum).KmolPerSecToKgPerSec; @@ -3470,7 +3470,7 @@ namespace FuelCellElectricGenerator { this->Report.TwaterIntoFCPM = this->WaterSup.TwaterIntoFCPM; this->Report.NdotWater = this->FCPM.NdotLiqwater; // water flow in kmol/sec (reformer water) this->Report.WaterPumpPower = this->WaterSup.PwaterCompEl; - this->Report.WaterPumpEnergy = this->WaterSup.PwaterCompEl * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; // electrical energy + this->Report.WaterPumpEnergy = this->WaterSup.PwaterCompEl * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); // electrical energy this->Report.WaterIntoFCPMEnthalpy = this->FCPM.WaterInEnthalpy; this->Report.TprodGas = this->FCPM.TprodGasLeavingFCPM; // temperature at State point 7 @@ -3483,7 +3483,7 @@ namespace FuelCellElectricGenerator { this->Report.NdotProdO2 = this->FCPM.ConstitMolalFract(3) * this->FCPM.NdotProdGas; this->Report.qHX = this->ExhaustHX.qHX; - this->Report.HXenergy = this->ExhaustHX.qHX * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->Report.HXenergy = this->ExhaustHX.qHX * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); this->Report.THXexh = this->ExhaustHX.THXexh; this->Report.WaterVaporFractExh = this->ExhaustHX.WaterVaporFractExh; this->Report.CondensateRate = this->ExhaustHX.CondensateRate; @@ -3492,19 +3492,19 @@ namespace FuelCellElectricGenerator { this->Report.RegulaFalsiIterations = this->FCPM.RegulaFalsiIter; // number of iterations in Tproduct gas solving this->Report.ACancillariesPower = this->FCPM.PelancillariesAC; - this->Report.ACancillariesEnergy = this->FCPM.PelancillariesAC * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->Report.ACancillariesEnergy = this->FCPM.PelancillariesAC * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); this->Report.PCUlosses = this->Inverter.PCUlosses; // inverter losses this->Report.DCPowerGen = this->FCPM.Pel; // DC power out of FCPM. this->Report.DCPowerEff = this->FCPM.Eel; // FCPM efficiency Eel. this->Report.ElectEnergyinStorage = this->ElecStorage.ThisTimeStepStateOfCharge; this->Report.StoredPower = this->ElecStorage.PelIntoStorage; - this->Report.StoredEnergy = this->ElecStorage.PelIntoStorage * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->Report.StoredEnergy = this->ElecStorage.PelIntoStorage * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); this->Report.DrawnPower = this->ElecStorage.PelFromStorage; - this->Report.DrawnEnergy = this->ElecStorage.PelFromStorage * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->Report.DrawnEnergy = this->ElecStorage.PelFromStorage * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); this->Report.SkinLossPower = this->QconvZone + this->QradZone; - this->Report.SkinLossEnergy = (this->QconvZone + this->QradZone) * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->Report.SkinLossEnergy = (this->QconvZone + this->QradZone) * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); this->Report.SkinLossConvect = this->QconvZone; this->Report.SkinLossRadiat = this->QradZone; } diff --git a/src/EnergyPlus/General.cc b/src/EnergyPlus/General.cc index 45654feef26..e0aba46d88d 100644 --- a/src/EnergyPlus/General.cc +++ b/src/EnergyPlus/General.cc @@ -2878,7 +2878,6 @@ namespace General { // Using/Aliasing using DataGlobals::CurrentTime; - using DataGlobals::SecInHour; using DataGlobals::TimeStepZone; using DataHVACGlobals::SysTimeElapsed; using DataHVACGlobals::TimeStepSys; @@ -2907,7 +2906,7 @@ namespace General { // Maybe later TimeStepZone, TimeStepSys and SysTimeElapsed could also be specified // as real. CurrentHVACTime = (CurrentTime - TimeStepZone) + SysTimeElapsed + TimeStepSys; - GetCurrentHVACTime = CurrentHVACTime * SecInHour; + GetCurrentHVACTime = CurrentHVACTime * DataGlobalConstants::SecInHour(); return GetCurrentHVACTime; } @@ -2931,7 +2930,6 @@ namespace General { // Using/Aliasing using DataGlobals::CurrentTime; - using DataGlobals::SecInHour; using DataGlobals::TimeStepZone; using DataHVACGlobals::SysTimeElapsed; @@ -2957,7 +2955,7 @@ namespace General { // This is the correct formula that does not use MinutesPerSystemTimeStep, which would // erronously truncate all sub-minute system time steps down to the closest full minute. PreviousHVACTime = (CurrentTime - TimeStepZone) + SysTimeElapsed; - GetPreviousHVACTime = PreviousHVACTime * SecInHour; + GetPreviousHVACTime = PreviousHVACTime * DataGlobalConstants::SecInHour(); return GetPreviousHVACTime; } @@ -3223,8 +3221,6 @@ namespace General { static std::string LineRptOption1; static std::string VarDictOption1; static std::string VarDictOption2; - // LOGICAL,SAVE :: SchRpt = .FALSE. - // CHARACTER(len=MaxNameLength) :: SchRptOption if (GetReportInput) { @@ -3573,8 +3569,6 @@ namespace General { // na // Using/Aliasing - using DataGlobals::MaxNameLength; - // Argument array dimensioning // Locals @@ -3596,13 +3590,13 @@ namespace General { std::string::size_type const ItemLength = len(ZoneName) + ItemNameLength; ResultName = ZoneName + ' ' + ItemName; bool TooLong = false; - if (ItemLength > MaxNameLength) { + if (ItemLength > DataGlobalConstants::MaxNameLength()) { ShowWarningError(calledFrom + CurrentObject + " Combination of ZoneList and Object Name generate a name too long."); ShowContinueError("Object Name=\"" + ItemName + "\"."); ShowContinueError("ZoneList/Zone Name=\"" + ZoneName + "\"."); - ShowContinueError("Item length=[" + RoundSigDigits(int(ItemLength)) + "] > Maximum Length=[" + RoundSigDigits(MaxNameLength) + + ShowContinueError("Item length=[" + RoundSigDigits(int(ItemLength)) + "] > Maximum Length=[" + RoundSigDigits(DataGlobalConstants::MaxNameLength()) + "]. You may need to shorten the names."); - ShowContinueError("Shortening the Object Name by [" + RoundSigDigits(int(MaxZoneNameLength + 1 + ItemNameLength - MaxNameLength)) + + ShowContinueError("Shortening the Object Name by [" + RoundSigDigits(int(MaxZoneNameLength + 1 + ItemNameLength - DataGlobalConstants::MaxNameLength())) + "] characters will assure uniqueness for this ZoneList."); ShowContinueError("name that will be used (may be needed in reporting)=\"" + ResultName + "\"."); TooLong = true; diff --git a/src/EnergyPlus/GeneratorDynamicsManager.cc b/src/EnergyPlus/GeneratorDynamicsManager.cc index e823f26be51..71ea46630e9 100644 --- a/src/EnergyPlus/GeneratorDynamicsManager.cc +++ b/src/EnergyPlus/GeneratorDynamicsManager.cc @@ -92,9 +92,6 @@ namespace GeneratorDynamicsManager { using namespace DataGenerators; using DataGlobals::CurrentTime; using DataGlobals::DayOfSim; - using DataGlobals::HoursInDay; - using DataGlobals::SecInHour; - void SetupGeneratorControlStateManager(int const GenNum) // index of generator to setup { // SUBROUTINE INFORMATION: @@ -130,7 +127,7 @@ namespace GeneratorDynamicsManager { GeneratorDynamics(GenNum).MandatoryFullCoolDown = MicroCHPElectricGenerator::MicroCHP(GenNum).A42Model.MandatoryFullCoolDown; GeneratorDynamics(GenNum).WarmRestartOkay = MicroCHPElectricGenerator::MicroCHP(GenNum).A42Model.WarmRestartOkay; GeneratorDynamics(GenNum).WarmUpDelay = MicroCHPElectricGenerator::MicroCHP(GenNum).A42Model.WarmUpDelay; - GeneratorDynamics(GenNum).CoolDownDelay = MicroCHPElectricGenerator::MicroCHP(GenNum).A42Model.CoolDownDelay / SecInHour; // seconds to hours + GeneratorDynamics(GenNum).CoolDownDelay = MicroCHPElectricGenerator::MicroCHP(GenNum).A42Model.CoolDownDelay / DataGlobalConstants::SecInHour(); // seconds to hours GeneratorDynamics(GenNum).PcoolDown = MicroCHPElectricGenerator::MicroCHP(GenNum).A42Model.PcoolDown; GeneratorDynamics(GenNum).Pstandby = MicroCHPElectricGenerator::MicroCHP(GenNum).A42Model.Pstandby; GeneratorDynamics(GenNum).MCeng = MicroCHPElectricGenerator::MicroCHP(GenNum).A42Model.MCeng; @@ -139,7 +136,7 @@ namespace GeneratorDynamicsManager { GeneratorDynamics(GenNum).TnomEngOp = MicroCHPElectricGenerator::MicroCHP(GenNum).A42Model.TnomEngOp; GeneratorDynamics(GenNum).kp = MicroCHPElectricGenerator::MicroCHP(GenNum).A42Model.kp; GeneratorDynamics(GenNum).AvailabilitySchedID = MicroCHPElectricGenerator::MicroCHP(GenNum).AvailabilitySchedID; - GeneratorDynamics(GenNum).StartUpTimeDelay = MicroCHPElectricGenerator::MicroCHP(GenNum).A42Model.WarmUpDelay / SecInHour; // seconds to hours + GeneratorDynamics(GenNum).StartUpTimeDelay = MicroCHPElectricGenerator::MicroCHP(GenNum).A42Model.WarmUpDelay / DataGlobalConstants::SecInHour(); // seconds to hours GeneratorDynamics(GenNum).ElectEffNom = MicroCHPElectricGenerator::MicroCHP(GenNum).A42Model.ElecEff; GeneratorDynamics(GenNum).ThermEffNom = MicroCHPElectricGenerator::MicroCHP(GenNum).A42Model.ThermEff; @@ -348,7 +345,7 @@ namespace GeneratorDynamicsManager { // generator just started so set start time GeneratorDynamics(DynaCntrlNum).FractionalDayofLastStartUp = double(DayOfSim) + - (int(CurrentTime) + (SysTimeElapsed + (CurrentTime - int(CurrentTime) - TimeStepSys))) / HoursInDay; + (int(CurrentTime) + (SysTimeElapsed + (CurrentTime - int(CurrentTime) - TimeStepSys))) / DataGlobalConstants::HoursInDay(); } else { // warm up period is less than a single system time step newOpMode = OpModeNormal; @@ -386,7 +383,7 @@ namespace GeneratorDynamicsManager { newOpMode = OpModeCoolDown; // need to reset time of last shut down here GeneratorDynamics(DynaCntrlNum).FractionalDayofLastShutDown = - double(DayOfSim) + (int(CurrentTime) + (SysTimeElapsed + (CurrentTime - int(CurrentTime)))) / HoursInDay; + double(DayOfSim) + (int(CurrentTime) + (SysTimeElapsed + (CurrentTime - int(CurrentTime)))) / DataGlobalConstants::HoursInDay(); } else { newOpMode = OpModeOff; } @@ -400,7 +397,7 @@ namespace GeneratorDynamicsManager { newOpMode = OpModeCoolDown; // need to reset time of last shut down here GeneratorDynamics(DynaCntrlNum).FractionalDayofLastShutDown = - double(DayOfSim) + (int(CurrentTime) + (SysTimeElapsed + (CurrentTime - int(CurrentTime)))) / HoursInDay; + double(DayOfSim) + (int(CurrentTime) + (SysTimeElapsed + (CurrentTime - int(CurrentTime)))) / DataGlobalConstants::HoursInDay(); } else { newOpMode = OpModeStandby; @@ -414,13 +411,13 @@ namespace GeneratorDynamicsManager { // compare current time to when warm up is over // calculate time for end of warmup period CurrentFractionalDay = - double(DayOfSim) + (int(CurrentTime) + (SysTimeElapsed + (CurrentTime - int(CurrentTime)))) / HoursInDay; + double(DayOfSim) + (int(CurrentTime) + (SysTimeElapsed + (CurrentTime - int(CurrentTime)))) / DataGlobalConstants::HoursInDay(); EndingFractionalDay = GeneratorDynamics(DynaCntrlNum).FractionalDayofLastStartUp + - GeneratorDynamics(DynaCntrlNum).StartUpTimeDelay / HoursInDay; + GeneratorDynamics(DynaCntrlNum).StartUpTimeDelay / DataGlobalConstants::HoursInDay(); if ((std::abs(CurrentFractionalDay - EndingFractionalDay) < 0.000001) || (CurrentFractionalDay > EndingFractionalDay)) { newOpMode = OpModeNormal; PLRStartUp = true; - LastSystemTimeStepFractionalDay = CurrentFractionalDay - (TimeStepSys / HoursInDay); + LastSystemTimeStepFractionalDay = CurrentFractionalDay - (TimeStepSys / DataGlobalConstants::HoursInDay()); PLRforSubtimestepStartUp = ((CurrentFractionalDay - EndingFractionalDay) / (CurrentFractionalDay - LastSystemTimeStepFractionalDay)); } else { @@ -465,7 +462,7 @@ namespace GeneratorDynamicsManager { newOpMode = OpModeCoolDown; // also, generator just shut down so record shut down time GeneratorDynamics(DynaCntrlNum).FractionalDayofLastShutDown = - double(DayOfSim) + (int(CurrentTime) + (SysTimeElapsed + (CurrentTime - int(CurrentTime)))) / HoursInDay; + double(DayOfSim) + (int(CurrentTime) + (SysTimeElapsed + (CurrentTime - int(CurrentTime)))) / DataGlobalConstants::HoursInDay(); } else { // cool down period is less than a single system time step if (SchedVal != 0.0) { newOpMode = OpModeStandby; @@ -477,7 +474,7 @@ namespace GeneratorDynamicsManager { // also, generator just shut down so record shut down time GeneratorDynamics(DynaCntrlNum).FractionalDayofLastShutDown = - double(DayOfSim) + (int(CurrentTime) + (SysTimeElapsed + (CurrentTime - int(CurrentTime)))) / HoursInDay; + double(DayOfSim) + (int(CurrentTime) + (SysTimeElapsed + (CurrentTime - int(CurrentTime)))) / DataGlobalConstants::HoursInDay(); } } else if ((SchedVal != 0.0) && (RunFlag)) { @@ -492,15 +489,15 @@ namespace GeneratorDynamicsManager { if (GeneratorDynamics(DynaCntrlNum).CoolDownDelay > 0.0) { // calculate time for end of cool down period CurrentFractionalDay = - double(DayOfSim) + (int(CurrentTime) + (SysTimeElapsed + (CurrentTime - int(CurrentTime)))) / HoursInDay; + double(DayOfSim) + (int(CurrentTime) + (SysTimeElapsed + (CurrentTime - int(CurrentTime)))) / DataGlobalConstants::HoursInDay(); EndingFractionalDay = GeneratorDynamics(DynaCntrlNum).FractionalDayofLastShutDown + - GeneratorDynamics(DynaCntrlNum).CoolDownDelay / HoursInDay - (TimeStepSys / HoursInDay); + GeneratorDynamics(DynaCntrlNum).CoolDownDelay / DataGlobalConstants::HoursInDay() - (TimeStepSys / DataGlobalConstants::HoursInDay()); if ((std::abs(CurrentFractionalDay - EndingFractionalDay) < 0.000001) || (CurrentFractionalDay > EndingFractionalDay)) { // CurrentFractionalDay == EndingFractionalDay newOpMode = OpModeOff; PLRShutDown = true; - LastSystemTimeStepFractionalDay = CurrentFractionalDay - (TimeStepSys / HoursInDay); - PLRforSubtimestepShutDown = (EndingFractionalDay - LastSystemTimeStepFractionalDay) * HoursInDay / TimeStepSys; + LastSystemTimeStepFractionalDay = CurrentFractionalDay - (TimeStepSys / DataGlobalConstants::HoursInDay()); + PLRforSubtimestepShutDown = (EndingFractionalDay - LastSystemTimeStepFractionalDay) * DataGlobalConstants::HoursInDay() / TimeStepSys; } else { // CurrentFractionalDay > EndingFractionalDay newOpMode = OpModeCoolDown; } @@ -512,15 +509,15 @@ namespace GeneratorDynamicsManager { if (GeneratorDynamics(DynaCntrlNum).CoolDownDelay > 0.0) { // calculate time for end of cool down period CurrentFractionalDay = - double(DayOfSim) + (int(CurrentTime) + (SysTimeElapsed + (CurrentTime - int(CurrentTime)))) / HoursInDay; + double(DayOfSim) + (int(CurrentTime) + (SysTimeElapsed + (CurrentTime - int(CurrentTime)))) / DataGlobalConstants::HoursInDay(); EndingFractionalDay = GeneratorDynamics(DynaCntrlNum).FractionalDayofLastShutDown + - GeneratorDynamics(DynaCntrlNum).CoolDownDelay / HoursInDay - (TimeStepSys / HoursInDay); + GeneratorDynamics(DynaCntrlNum).CoolDownDelay / DataGlobalConstants::HoursInDay() - (TimeStepSys / DataGlobalConstants::HoursInDay()); if ((std::abs(CurrentFractionalDay - EndingFractionalDay) < 0.000001) || (CurrentFractionalDay > EndingFractionalDay)) { // CurrentFractionalDay == EndingFractionalDay newOpMode = OpModeStandby; PLRShutDown = true; - LastSystemTimeStepFractionalDay = CurrentFractionalDay - (TimeStepSys / HoursInDay); - PLRforSubtimestepShutDown = (EndingFractionalDay - LastSystemTimeStepFractionalDay) * HoursInDay / TimeStepSys; + LastSystemTimeStepFractionalDay = CurrentFractionalDay - (TimeStepSys / DataGlobalConstants::HoursInDay()); + PLRforSubtimestepShutDown = (EndingFractionalDay - LastSystemTimeStepFractionalDay) * DataGlobalConstants::HoursInDay() / TimeStepSys; } else { // CurrentFractionalDay < EndingFractionalDay newOpMode = OpModeCoolDown; } @@ -535,9 +532,9 @@ namespace GeneratorDynamicsManager { if (GeneratorDynamics(DynaCntrlNum).CoolDownDelay > 0.0) { // calculate time for end of cool down period CurrentFractionalDay = - double(DayOfSim) + (int(CurrentTime) + (SysTimeElapsed + (CurrentTime - int(CurrentTime)))) / HoursInDay; + double(DayOfSim) + (int(CurrentTime) + (SysTimeElapsed + (CurrentTime - int(CurrentTime)))) / DataGlobalConstants::HoursInDay(); EndingFractionalDay = GeneratorDynamics(DynaCntrlNum).FractionalDayofLastShutDown + - GeneratorDynamics(DynaCntrlNum).CoolDownDelay / HoursInDay - (TimeStepSys / HoursInDay); + GeneratorDynamics(DynaCntrlNum).CoolDownDelay / DataGlobalConstants::HoursInDay() - (TimeStepSys / DataGlobalConstants::HoursInDay()); if ((std::abs(CurrentFractionalDay - EndingFractionalDay) < 0.000001) || (CurrentFractionalDay < EndingFractionalDay)) { // CurrentFractionalDay == EndingFractionalDay @@ -545,8 +542,8 @@ namespace GeneratorDynamicsManager { } else { // CurrentFractionalDay > EndingFractionalDay // could go to warm up or normal now PLRShutDown = true; - LastSystemTimeStepFractionalDay = CurrentFractionalDay - (TimeStepSys / HoursInDay); - PLRforSubtimestepShutDown = (EndingFractionalDay - LastSystemTimeStepFractionalDay) * HoursInDay / TimeStepSys; + LastSystemTimeStepFractionalDay = CurrentFractionalDay - (TimeStepSys / DataGlobalConstants::HoursInDay()); + PLRforSubtimestepShutDown = (EndingFractionalDay - LastSystemTimeStepFractionalDay) * DataGlobalConstants::HoursInDay() / TimeStepSys; if (GeneratorDynamics(DynaCntrlNum).StartUpTimeDelay == 0.0) { newOpMode = OpModeNormal; // possible PLR on start up. @@ -567,7 +564,7 @@ namespace GeneratorDynamicsManager { // generator just started so set start time GeneratorDynamics(DynaCntrlNum).FractionalDayofLastStartUp = double(DayOfSim) + - (int(CurrentTime) + (SysTimeElapsed + (CurrentTime - int(CurrentTime) - TimeStepSys))) / HoursInDay; + (int(CurrentTime) + (SysTimeElapsed + (CurrentTime - int(CurrentTime) - TimeStepSys))) / DataGlobalConstants::HoursInDay(); } } } @@ -583,15 +580,15 @@ namespace GeneratorDynamicsManager { } else if (GeneratorDynamics(DynaCntrlNum).StartUpTimeDelay > 0.0) { CurrentFractionalDay = - double(DayOfSim) + (int(CurrentTime) + (SysTimeElapsed + (CurrentTime - int(CurrentTime)))) / HoursInDay; + double(DayOfSim) + (int(CurrentTime) + (SysTimeElapsed + (CurrentTime - int(CurrentTime)))) / DataGlobalConstants::HoursInDay(); EndingFractionalDay = GeneratorDynamics(DynaCntrlNum).FractionalDayofLastShutDown + - GeneratorDynamics(DynaCntrlNum).CoolDownDelay / HoursInDay; + GeneratorDynamics(DynaCntrlNum).CoolDownDelay / DataGlobalConstants::HoursInDay(); if ((std::abs(CurrentFractionalDay - EndingFractionalDay) < 0.000001) || (CurrentFractionalDay > EndingFractionalDay)) { // CurrentFractionalDay == EndingFractionalDay newOpMode = OpModeNormal; // possible PLR on start up. PLRStartUp = true; - LastSystemTimeStepFractionalDay = CurrentFractionalDay - (TimeStepSys / HoursInDay); + LastSystemTimeStepFractionalDay = CurrentFractionalDay - (TimeStepSys / DataGlobalConstants::HoursInDay()); PLRforSubtimestepStartUp = ((CurrentFractionalDay - EndingFractionalDay) / (CurrentFractionalDay - LastSystemTimeStepFractionalDay)); } else { @@ -600,7 +597,7 @@ namespace GeneratorDynamicsManager { // generator just started so set start time GeneratorDynamics(DynaCntrlNum).FractionalDayofLastStartUp = double(DayOfSim) + - (int(CurrentTime) + (SysTimeElapsed + (CurrentTime - int(CurrentTime) - TimeStepSys))) / HoursInDay; + (int(CurrentTime) + (SysTimeElapsed + (CurrentTime - int(CurrentTime) - TimeStepSys))) / DataGlobalConstants::HoursInDay(); } } } @@ -636,12 +633,12 @@ namespace GeneratorDynamicsManager { Pel *= PLRforSubtimestepStartUp; // unit may have constraints from transient limits or operating ranges. if (Pel > GeneratorDynamics(DynaCntrlNum).PelLastTimeStep) { // powering up - MaxPel = GeneratorDynamics(DynaCntrlNum).PelLastTimeStep + GeneratorDynamics(DynaCntrlNum).UpTranLimit * TimeStepSys * SecInHour; + MaxPel = GeneratorDynamics(DynaCntrlNum).PelLastTimeStep + GeneratorDynamics(DynaCntrlNum).UpTranLimit * TimeStepSys * DataGlobalConstants::SecInHour(); if (MaxPel < Pel) { Pel = MaxPel; } } else if (Pel < GeneratorDynamics(DynaCntrlNum).PelLastTimeStep) { // powering down - MinPel = GeneratorDynamics(DynaCntrlNum).PelLastTimeStep - GeneratorDynamics(DynaCntrlNum).DownTranLimit * TimeStepSys * SecInHour; + MinPel = GeneratorDynamics(DynaCntrlNum).PelLastTimeStep - GeneratorDynamics(DynaCntrlNum).DownTranLimit * TimeStepSys * DataGlobalConstants::SecInHour(); if (Pel < MinPel) { Pel = MinPel; } @@ -684,54 +681,54 @@ namespace GeneratorDynamicsManager { if (SELECT_CASE_var1 == OpModeOff) { if (PLRforSubtimestepShutDown == 0.0) { - MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.OffModeTime = TimeStepSys * SecInHour; + MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.OffModeTime = TimeStepSys * DataGlobalConstants::SecInHour(); } else if ((PLRforSubtimestepShutDown > 0.0) && (PLRforSubtimestepShutDown < 1.0)) { - MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.CoolDownModeTime = TimeStepSys * SecInHour * (PLRforSubtimestepShutDown); - MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.OffModeTime = TimeStepSys * SecInHour * (1.0 - PLRforSubtimestepShutDown); + MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.CoolDownModeTime = TimeStepSys * DataGlobalConstants::SecInHour() * (PLRforSubtimestepShutDown); + MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.OffModeTime = TimeStepSys * DataGlobalConstants::SecInHour() * (1.0 - PLRforSubtimestepShutDown); } else { - MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.OffModeTime = TimeStepSys * SecInHour; + MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.OffModeTime = TimeStepSys * DataGlobalConstants::SecInHour(); } } else if (SELECT_CASE_var1 == OpModeStandby) { if (PLRforSubtimestepShutDown == 0.0) { - MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.StandyByModeTime = TimeStepSys * SecInHour; + MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.StandyByModeTime = TimeStepSys * DataGlobalConstants::SecInHour(); } else if ((PLRforSubtimestepShutDown > 0.0) && (PLRforSubtimestepShutDown < 1.0)) { - MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.CoolDownModeTime = TimeStepSys * SecInHour * (PLRforSubtimestepShutDown); - MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.StandyByModeTime = TimeStepSys * SecInHour * (1.0 - PLRforSubtimestepShutDown); + MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.CoolDownModeTime = TimeStepSys * DataGlobalConstants::SecInHour() * (PLRforSubtimestepShutDown); + MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.StandyByModeTime = TimeStepSys * DataGlobalConstants::SecInHour() * (1.0 - PLRforSubtimestepShutDown); } else { - MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.StandyByModeTime = TimeStepSys * SecInHour; + MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.StandyByModeTime = TimeStepSys * DataGlobalConstants::SecInHour(); } } else if (SELECT_CASE_var1 == OpModeWarmUp) { if (PLRforSubtimestepShutDown == 0.0) { - MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.WarmUpModeTime = TimeStepSys * SecInHour; + MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.WarmUpModeTime = TimeStepSys * DataGlobalConstants::SecInHour(); } else if ((PLRforSubtimestepShutDown > 0.0) && (PLRforSubtimestepShutDown < 1.0)) { - MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.CoolDownModeTime = TimeStepSys * SecInHour * (PLRforSubtimestepShutDown); - MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.WarmUpModeTime = TimeStepSys * SecInHour * (1.0 - PLRforSubtimestepShutDown); + MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.CoolDownModeTime = TimeStepSys * DataGlobalConstants::SecInHour() * (PLRforSubtimestepShutDown); + MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.WarmUpModeTime = TimeStepSys * DataGlobalConstants::SecInHour() * (1.0 - PLRforSubtimestepShutDown); } else { - MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.WarmUpModeTime = TimeStepSys * SecInHour; + MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.WarmUpModeTime = TimeStepSys * DataGlobalConstants::SecInHour(); } } else if (SELECT_CASE_var1 == OpModeNormal) { if (PLRforSubtimestepStartUp == 0.0) { - MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.WarmUpModeTime = TimeStepSys * SecInHour; + MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.WarmUpModeTime = TimeStepSys * DataGlobalConstants::SecInHour(); } else if ((PLRforSubtimestepStartUp > 0.0) && (PLRforSubtimestepStartUp < 1.0)) { - MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.WarmUpModeTime = TimeStepSys * SecInHour * (1.0 - PLRforSubtimestepStartUp); - MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.NormalModeTime = TimeStepSys * SecInHour * (PLRforSubtimestepStartUp); + MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.WarmUpModeTime = TimeStepSys * DataGlobalConstants::SecInHour() * (1.0 - PLRforSubtimestepStartUp); + MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.NormalModeTime = TimeStepSys * DataGlobalConstants::SecInHour() * (PLRforSubtimestepStartUp); } else { if (PLRforSubtimestepShutDown == 0.0) { - MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.NormalModeTime = TimeStepSys * SecInHour; + MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.NormalModeTime = TimeStepSys * DataGlobalConstants::SecInHour(); } else if ((PLRforSubtimestepShutDown > 0.0) && (PLRforSubtimestepShutDown < 1.0)) { - MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.CoolDownModeTime = TimeStepSys * SecInHour * (PLRforSubtimestepShutDown); - MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.NormalModeTime = TimeStepSys * SecInHour * (1.0 - PLRforSubtimestepShutDown); + MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.CoolDownModeTime = TimeStepSys * DataGlobalConstants::SecInHour() * (PLRforSubtimestepShutDown); + MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.NormalModeTime = TimeStepSys * DataGlobalConstants::SecInHour() * (1.0 - PLRforSubtimestepShutDown); } else { - MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.NormalModeTime = TimeStepSys * SecInHour; + MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.NormalModeTime = TimeStepSys * DataGlobalConstants::SecInHour(); } } } else if (SELECT_CASE_var1 == OpModeCoolDown) { - MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.CoolDownModeTime = TimeStepSys * SecInHour; + MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.CoolDownModeTime = TimeStepSys * DataGlobalConstants::SecInHour(); } } @@ -811,7 +808,7 @@ namespace GeneratorDynamicsManager { if (FuelFlowRequest > GeneratorDynamics(DynaCntrlNum).FuelMdotLastTimestep) { // fuel flow is up MaxMdot = - GeneratorDynamics(DynaCntrlNum).FuelMdotLastTimestep + GeneratorDynamics(DynaCntrlNum).UpTranLimitFuel * TimeStepSys * SecInHour; + GeneratorDynamics(DynaCntrlNum).FuelMdotLastTimestep + GeneratorDynamics(DynaCntrlNum).UpTranLimitFuel * TimeStepSys * DataGlobalConstants::SecInHour(); if (MaxMdot < FuelFlowRequest) { MdotFuel = MaxMdot; ConstrainedIncreasingMdot = true; @@ -819,7 +816,7 @@ namespace GeneratorDynamicsManager { } else if (FuelFlowRequest < GeneratorDynamics(DynaCntrlNum).FuelMdotLastTimestep) { // fuel flow is down MinMdot = - GeneratorDynamics(DynaCntrlNum).FuelMdotLastTimestep - GeneratorDynamics(DynaCntrlNum).DownTranLimitFuel * TimeStepSys * SecInHour; + GeneratorDynamics(DynaCntrlNum).FuelMdotLastTimestep - GeneratorDynamics(DynaCntrlNum).DownTranLimitFuel * TimeStepSys * DataGlobalConstants::SecInHour(); if (FuelFlowRequest < MinMdot) { MdotFuel = MinMdot; ConstrainedDecreasingMdot = true; diff --git a/src/EnergyPlus/GeneratorFuelSupply.cc b/src/EnergyPlus/GeneratorFuelSupply.cc index fe17c08a77f..40439cb4114 100644 --- a/src/EnergyPlus/GeneratorFuelSupply.cc +++ b/src/EnergyPlus/GeneratorFuelSupply.cc @@ -101,8 +101,6 @@ namespace GeneratorFuelSupply { // Using/Aliasing using namespace DataGenerators; - using DataGlobals::HoursInDay; - // // Data diff --git a/src/EnergyPlus/GroundHeatExchangers.cc b/src/EnergyPlus/GroundHeatExchangers.cc index 411acdc7ed4..e51c5e428f1 100644 --- a/src/EnergyPlus/GroundHeatExchangers.cc +++ b/src/EnergyPlus/GroundHeatExchangers.cc @@ -122,7 +122,6 @@ namespace GroundHeatExchangers { using DataGlobals::BeginTimeStepFlag; using DataGlobals::DayOfSim; using DataGlobals::HourOfDay; - using DataGlobals::SecInHour; using DataGlobals::TimeStep; using DataGlobals::TimeStepZone; using DataGlobals::WarmupFlag; @@ -607,8 +606,6 @@ namespace GroundHeatExchangers { { int const numDaysInYear(365); - using DataGlobals::HoursInDay; - using DataGlobals::SecInHour; // Minimum simulation time for which finite line source method is applicable Real64 const lntts_min_for_long_timestep = -8.5; @@ -625,7 +622,7 @@ namespace GroundHeatExchangers { // Determine how many g-function pairs to generate based on user defined maximum simulation time while (true) { Real64 maxPossibleSimTime = exp(tempLNTTS.back()) * t_s; - if (maxPossibleSimTime < myRespFactors->maxSimYears * numDaysInYear * HoursInDay * SecInHour) { + if (maxPossibleSimTime < myRespFactors->maxSimYears * numDaysInYear * DataGlobalConstants::HoursInDay() * DataGlobalConstants::SecInHour()) { tempLNTTS.push_back(tempLNTTS.back() + lnttsStepSize); } else { break; @@ -1688,7 +1685,7 @@ namespace GroundHeatExchangers { // PURPOSE OF THIS SUBROUTINE: // calculate annual time constant for ground conduction - timeSS = (pow_2(bhLength) / (9.0 * soil.diffusivity)) / SecInHour / 8760.0; + timeSS = (pow_2(bhLength) / (9.0 * soil.diffusivity)) / DataGlobalConstants::SecInHour() / 8760.0; timeSSFactor = timeSS * 8760.0; } @@ -3329,7 +3326,7 @@ namespace GroundHeatExchangers { Real64 fluidDensity; bool errFlag; - Real64 currTime = ((DayOfSim - 1) * 24 + (HourOfDay - 1) + (TimeStep - 1) * TimeStepZone + SysTimeElapsed) * SecInHour; + Real64 currTime = ((DayOfSim - 1) * 24 + (HourOfDay - 1) + (TimeStep - 1) * TimeStepZone + SysTimeElapsed) * DataGlobalConstants::SecInHour(); // Init more variables if (myFlag) { @@ -3438,7 +3435,7 @@ namespace GroundHeatExchangers { bool errFlag; Real64 CurTime; - CurTime = ((DayOfSim - 1) * 24 + (HourOfDay - 1) + (TimeStep - 1) * TimeStepZone + SysTimeElapsed) * SecInHour; + CurTime = ((DayOfSim - 1) * 24 + (HourOfDay - 1) + (TimeStep - 1) * TimeStepZone + SysTimeElapsed) * DataGlobalConstants::SecInHour(); // Init more variables if (myFlag) { diff --git a/src/EnergyPlus/GroundTemperatureModeling/FiniteDifferenceGroundTemperatureModel.cc b/src/EnergyPlus/GroundTemperatureModeling/FiniteDifferenceGroundTemperatureModel.cc index a2110c7b6c5..7102d7c666b 100644 --- a/src/EnergyPlus/GroundTemperatureModeling/FiniteDifferenceGroundTemperatureModel.cc +++ b/src/EnergyPlus/GroundTemperatureModeling/FiniteDifferenceGroundTemperatureModel.cc @@ -69,7 +69,6 @@ namespace EnergyPlus { -using DataGlobals::SecsInDay; int simDay = 0; int numIterYears = 0; int const maxYearsToIterate = 10; @@ -470,7 +469,7 @@ void FiniteDiffGroundTempsModel::performSimulation(EnergyPlusData &state) // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - timeStepInSeconds = SecsInDay; + timeStepInSeconds = DataGlobalConstants::SecsInDay(); bool convergedFinal = false; initDomain(state); @@ -831,7 +830,6 @@ void FiniteDiffGroundTempsModel::initDomain(EnergyPlusData &state) // Average ground temp initialized to average annual air temperature // USE STATEMENTS: - using DataGlobals::SecsInDay; using namespace GroundTemperatureManager; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -844,7 +842,7 @@ void FiniteDiffGroundTempsModel::initDomain(EnergyPlusData &state) tempModel->aveGroundTemp = annualAveAirTemp; tempModel->aveGroundTempAmplitude = (maxDailyAirTemp - minDailyAirTemp) / 4.0; // Rough estimate here. Ground temps will not swing as far as the air temp. - tempModel->phaseShiftInSecs = dayOfMinDailyAirTemp * SecsInDay; + tempModel->phaseShiftInSecs = dayOfMinDailyAirTemp * DataGlobalConstants::SecsInDay(); tempModel->groundThermalDiffisivity = baseConductivity / (baseDensity * baseSpecificHeat); // Intialize temperatures and volume @@ -1080,13 +1078,11 @@ Real64 FiniteDiffGroundTempsModel::getGroundTempAtTimeInSeconds(EnergyPlusData & // Retrieves ground tempeature when input time is in seconds // Using - using DataGlobals::SecsInDay; - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: depth = _depth; - simTimeInDays = seconds / SecsInDay; + simTimeInDays = seconds / DataGlobalConstants::SecsInDay(); if (simTimeInDays > state.dataWeatherManager->NumDaysInYear) { simTimeInDays = remainder(simTimeInDays, state.dataWeatherManager->NumDaysInYear); diff --git a/src/EnergyPlus/GroundTemperatureModeling/KusudaAchenbachGroundTemperatureModel.cc b/src/EnergyPlus/GroundTemperatureModeling/KusudaAchenbachGroundTemperatureModel.cc index 5b7d52c1885..e8f78f29b9a 100644 --- a/src/EnergyPlus/GroundTemperatureModeling/KusudaAchenbachGroundTemperatureModel.cc +++ b/src/EnergyPlus/GroundTemperatureModeling/KusudaAchenbachGroundTemperatureModel.cc @@ -76,7 +76,6 @@ std::shared_ptr KusudaGroundTempsModel::KusudaGTMFactory // Reads input and creates instance of Kusuda ground temps model // USE STATEMENTS: - using DataGlobals::SecsInDay; using namespace DataIPShortCuts; using namespace GroundTemperatureManager; @@ -111,7 +110,7 @@ std::shared_ptr KusudaGroundTempsModel::KusudaGTMFactory // Use Kusuda Parameters thisModel->aveGroundTemp = rNumericArgs(4); thisModel->aveGroundTempAmplitude = rNumericArgs(5); - thisModel->phaseShiftInSecs = rNumericArgs(6) * SecsInDay; + thisModel->phaseShiftInSecs = rNumericArgs(6) * DataGlobalConstants::SecsInDay(); } else { // Use data from Site:GroundTemperature:Shallow to generate parameters @@ -153,7 +152,7 @@ std::shared_ptr KusudaGroundTempsModel::KusudaGTMFactory // Assign to KA Model thisModel->aveGroundTemp = averageGroundTemp; thisModel->aveGroundTempAmplitude = amplitudeOfGroundTemp; - thisModel->phaseShiftInSecs = phaseShiftOfMinGroundTempDays * SecsInDay; + thisModel->phaseShiftInSecs = phaseShiftOfMinGroundTempDays * DataGlobalConstants::SecsInDay(); } found = true; @@ -186,15 +185,13 @@ Real64 KusudaGroundTempsModel::getGroundTemp(EnergyPlusData& state) // Kusuda and Achenbach correlation is used // Using/Aliasing - using DataGlobals::SecsInDay; - // FUNCTION LOCAL VARIABLE DECLARATIONS: Real64 term1; Real64 term2; Real64 secsInYear; Real64 retVal; - secsInYear = SecsInDay * state.dataWeatherManager->NumDaysInYear; + secsInYear = DataGlobalConstants::SecsInDay() * state.dataWeatherManager->NumDaysInYear; term1 = -depth * std::sqrt(DataGlobalConstants::Pi() / (secsInYear * groundThermalDiffisivity)); term2 = (2 * DataGlobalConstants::Pi() / secsInYear) * (simTimeInSeconds - phaseShiftInSecs - (depth / 2) * std::sqrt(secsInYear / (DataGlobalConstants::Pi() * groundThermalDiffisivity))); @@ -218,10 +215,8 @@ Real64 KusudaGroundTempsModel::getGroundTempAtTimeInSeconds(EnergyPlusData& stat // Returns the ground temperature when input time is in seconds // Using/Aliasing - using DataGlobals::SecsInDay; - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 secondsInYear = state.dataWeatherManager->NumDaysInYear * SecsInDay; + Real64 secondsInYear = state.dataWeatherManager->NumDaysInYear * DataGlobalConstants::SecsInDay(); depth = _depth; @@ -246,14 +241,12 @@ Real64 KusudaGroundTempsModel::getGroundTempAtTimeInMonths(EnergyPlusData& state // RE-ENGINEERED na // Using/Aliasing - using DataGlobals::SecsInDay; - // PURPOSE OF THIS SUBROUTINE: // Returns the ground temperature when input time is in months // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 const aveSecondsInMonth = (state.dataWeatherManager->NumDaysInYear / 12) * SecsInDay; - Real64 const secondsPerYear = state.dataWeatherManager->NumDaysInYear * SecsInDay; + Real64 const aveSecondsInMonth = (state.dataWeatherManager->NumDaysInYear / 12) * DataGlobalConstants::SecsInDay(); + Real64 const secondsPerYear = state.dataWeatherManager->NumDaysInYear * DataGlobalConstants::SecsInDay(); depth = _depth; diff --git a/src/EnergyPlus/GroundTemperatureModeling/SiteBuildingSurfaceGroundTemperatures.cc b/src/EnergyPlus/GroundTemperatureModeling/SiteBuildingSurfaceGroundTemperatures.cc index a2e16b9ac8e..15500324817 100644 --- a/src/EnergyPlus/GroundTemperatureModeling/SiteBuildingSurfaceGroundTemperatures.cc +++ b/src/EnergyPlus/GroundTemperatureModeling/SiteBuildingSurfaceGroundTemperatures.cc @@ -169,10 +169,8 @@ Real64 SiteBuildingSurfaceGroundTemps::getGroundTempAtTimeInSeconds(EnergyPlusDa // Returns the ground temperature when input time is in seconds // USE STATEMENTS: - using DataGlobals::SecsInDay; - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 secPerMonth = state.dataWeatherManager->NumDaysInYear * SecsInDay / 12; + Real64 secPerMonth = state.dataWeatherManager->NumDaysInYear * DataGlobalConstants::SecsInDay() / 12; // Convert secs to months int month = ceil(_seconds / secPerMonth); diff --git a/src/EnergyPlus/GroundTemperatureModeling/SiteDeepGroundTemperatures.cc b/src/EnergyPlus/GroundTemperatureModeling/SiteDeepGroundTemperatures.cc index 2cf29428b7c..7c30f61db4b 100644 --- a/src/EnergyPlus/GroundTemperatureModeling/SiteDeepGroundTemperatures.cc +++ b/src/EnergyPlus/GroundTemperatureModeling/SiteDeepGroundTemperatures.cc @@ -162,10 +162,8 @@ Real64 SiteDeepGroundTemps::getGroundTempAtTimeInSeconds(EnergyPlusData &state, // Returns the ground temperature when input time is in seconds // USE STATEMENTS: - using DataGlobals::SecsInDay; - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 secPerMonth = state.dataWeatherManager->NumDaysInYear * SecsInDay / 12; + Real64 secPerMonth = state.dataWeatherManager->NumDaysInYear * DataGlobalConstants::SecsInDay() / 12; // Convert secs to months int month = ceil(_seconds / secPerMonth); diff --git a/src/EnergyPlus/GroundTemperatureModeling/SiteFCFactorMethodGroundTemperatures.cc b/src/EnergyPlus/GroundTemperatureModeling/SiteFCFactorMethodGroundTemperatures.cc index c18909e8d05..0d261e3c426 100644 --- a/src/EnergyPlus/GroundTemperatureModeling/SiteFCFactorMethodGroundTemperatures.cc +++ b/src/EnergyPlus/GroundTemperatureModeling/SiteFCFactorMethodGroundTemperatures.cc @@ -181,10 +181,8 @@ Real64 SiteFCFactorMethodGroundTemps::getGroundTempAtTimeInSeconds(EnergyPlusDat // Returns the ground temperature when input time is in seconds // USE STATEMENTS: - using DataGlobals::SecsInDay; - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 secPerMonth = state.dataWeatherManager->NumDaysInYear * SecsInDay / 12; + Real64 secPerMonth = state.dataWeatherManager->NumDaysInYear * DataGlobalConstants::SecsInDay() / 12; // Convert secs to months int month = ceil(_seconds / secPerMonth); diff --git a/src/EnergyPlus/GroundTemperatureModeling/SiteShallowGroundTemperatures.cc b/src/EnergyPlus/GroundTemperatureModeling/SiteShallowGroundTemperatures.cc index d2ac8e76dfc..7306e6c5655 100644 --- a/src/EnergyPlus/GroundTemperatureModeling/SiteShallowGroundTemperatures.cc +++ b/src/EnergyPlus/GroundTemperatureModeling/SiteShallowGroundTemperatures.cc @@ -161,10 +161,8 @@ Real64 SiteShallowGroundTemps::getGroundTempAtTimeInSeconds(EnergyPlusData& stat // Returns the ground temperature when input time is in seconds // USE STATEMENTS: - using DataGlobals::SecsInDay; - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 secPerMonth = state.dataWeatherManager->NumDaysInYear * SecsInDay / 12; + Real64 secPerMonth = state.dataWeatherManager->NumDaysInYear * DataGlobalConstants::SecsInDay() / 12; // Convert secs to months int month = ceil(_seconds / secPerMonth); diff --git a/src/EnergyPlus/GroundTemperatureModeling/XingGroundTemperatureModel.cc b/src/EnergyPlus/GroundTemperatureModeling/XingGroundTemperatureModel.cc index 1d4a4f8d726..e5364d85ef5 100644 --- a/src/EnergyPlus/GroundTemperatureModeling/XingGroundTemperatureModel.cc +++ b/src/EnergyPlus/GroundTemperatureModeling/XingGroundTemperatureModel.cc @@ -219,13 +219,11 @@ Real64 XingGroundTempsModel::getGroundTempAtTimeInSeconds(EnergyPlusData &state, // Returns ground temperature when time is in seconds // USE STATEMENTS: - using DataGlobals::SecsInDay; - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: depth = _depth; - simTimeInDays = seconds / SecsInDay; + simTimeInDays = seconds / DataGlobalConstants::SecsInDay(); if (simTimeInDays > state.dataWeatherManager->NumDaysInYear) { simTimeInDays = remainder(simTimeInDays, state.dataWeatherManager->NumDaysInYear); diff --git a/src/EnergyPlus/HVACCooledBeam.cc b/src/EnergyPlus/HVACCooledBeam.cc index bea1e9e9023..a67b3f59561 100644 --- a/src/EnergyPlus/HVACCooledBeam.cc +++ b/src/EnergyPlus/HVACCooledBeam.cc @@ -112,7 +112,6 @@ namespace HVACCooledBeam { using DataGlobals::BeginEnvrnFlag; using DataGlobals::NumOfZones; using DataGlobals::ScheduleAlwaysOn; - using DataGlobals::SecInHour; using DataGlobals::SysSizingCalc; using namespace ScheduleManager; using DataHVACGlobals::SmallAirVolFlow; @@ -1376,7 +1375,7 @@ namespace HVACCooledBeam { Real64 ReportingConstant; - ReportingConstant = TimeStepSys * SecInHour; + ReportingConstant = TimeStepSys * DataGlobalConstants::SecInHour(); // report the WaterCoil energy from this component CoolBeam(CBNum).BeamCoolingEnergy = CoolBeam(CBNum).BeamCoolingRate * ReportingConstant; CoolBeam(CBNum).SupAirCoolingEnergy = CoolBeam(CBNum).SupAirCoolingRate * ReportingConstant; diff --git a/src/EnergyPlus/HVACFan.cc b/src/EnergyPlus/HVACFan.cc index 5155484f48d..d5833a75506 100644 --- a/src/EnergyPlus/HVACFan.cc +++ b/src/EnergyPlus/HVACFan.cc @@ -1082,7 +1082,7 @@ namespace HVACFan { void FanSystem::report() { - m_fanEnergy = m_fanPower * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + m_fanEnergy = m_fanPower * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); m_deltaTemp = m_outletAirTemp - m_inletAirTemp; } diff --git a/src/EnergyPlus/HVACFourPipeBeam.cc b/src/EnergyPlus/HVACFourPipeBeam.cc index 145062acdb8..0f4b7039a31 100644 --- a/src/EnergyPlus/HVACFourPipeBeam.cc +++ b/src/EnergyPlus/HVACFourPipeBeam.cc @@ -1482,7 +1482,7 @@ namespace FourPipeBeam { Real64 ReportingConstant; - ReportingConstant = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + ReportingConstant = DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); if (this->beamCoolingPresent) { this->beamCoolingRate = std::abs(this->qDotBeamCooling); // report var has positive sign convention diff --git a/src/EnergyPlus/HVACInterfaceManager.cc b/src/EnergyPlus/HVACInterfaceManager.cc index 5ad37b49ed0..9cb71a9c296 100644 --- a/src/EnergyPlus/HVACInterfaceManager.cc +++ b/src/EnergyPlus/HVACInterfaceManager.cc @@ -603,7 +603,6 @@ namespace HVACInterfaceManager { // Using/Aliasing using DataGlobals::HourOfDay; - using DataGlobals::SecInHour; using DataGlobals::TimeStep; using DataGlobals::TimeStepZone; using DataHVACGlobals::SysTimeElapsed; @@ -672,7 +671,7 @@ namespace HVACInterfaceManager { // tank conditions each call. // Analytical solution for ODE, formulated for both final tank temp and average tank temp. - TimeStepSeconds = TimeStepSys * SecInHour; + TimeStepSeconds = TimeStepSys * DataGlobalConstants::SecInHour(); MassFlowRate = Node(TankInletNode).MassFlowRate; PumpHeat = PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).TotalPumpHeat; ThisTankMass = FracTotLoopMass * PlantLoop(LoopNum).Mass; @@ -767,7 +766,6 @@ namespace HVACInterfaceManager { // Using/Aliasing using DataGlobals::HourOfDay; - using DataGlobals::SecInHour; using DataGlobals::TimeStep; using DataGlobals::TimeStepZone; using DataHVACGlobals::SysTimeElapsed; @@ -851,7 +849,7 @@ namespace HVACInterfaceManager { // no common pipe case. // calculation is separated because for common pipe, a different split for mass fraction is applied // The pump heat source is swapped around here compared to no common pipe (so pump heat sort stays on its own side). - TimeStepSeconds = TimeStepSys * SecInHour; + TimeStepSeconds = TimeStepSys * DataGlobalConstants::SecInHour(); MassFlowRate = Node(TankInletNode).MassFlowRate; PumpHeat = PlantLoop(LoopNum).LoopSide(TankInletLoopSide).TotalPumpHeat; ThisTankMass = FracTotLoopMass * PlantLoop(LoopNum).Mass; diff --git a/src/EnergyPlus/HVACManager.cc b/src/EnergyPlus/HVACManager.cc index ea1b8a0a962..1256a0055b9 100644 --- a/src/EnergyPlus/HVACManager.cc +++ b/src/EnergyPlus/HVACManager.cc @@ -148,7 +148,6 @@ namespace HVACManager { using DataGlobals::MetersHaveBeenInitialized; using DataGlobals::NumOfZones; using DataGlobals::RunOptCondEntTemp; - using DataGlobals::SecInHour; using DataGlobals::SysSizingCalc; using DataGlobals::TimeStep; using DataGlobals::TimeStepZone; @@ -2378,7 +2377,6 @@ namespace HVACManager { using DataEnvironment::OutBaroPress; using DataEnvironment::OutHumRat; using DataEnvironment::StdRhoAir; - using DataGlobals::SecInHour; using DataHeatBalance::AirBalanceQuadrature; using DataHeatBalance::CrossMixing; using DataHeatBalance::Mixing; @@ -2516,13 +2514,13 @@ namespace HVACManager { if (MAT(ZoneLoop) > Zone(ZoneLoop).OutDryBulbTemp) { ZnAirRpt(ZoneLoop).InfilHeatLoss = - 0.001 * MCPI(ZoneLoop) * (MAT(ZoneLoop) - Zone(ZoneLoop).OutDryBulbTemp) * TimeStepSys * SecInHour * 1000.0 * ADSCorrectionFactor; + 0.001 * MCPI(ZoneLoop) * (MAT(ZoneLoop) - Zone(ZoneLoop).OutDryBulbTemp) * TimeStepSys * DataGlobalConstants::SecInHour() * 1000.0 * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).InfilHeatGain = 0.0; } else if (MAT(ZoneLoop) <= Zone(ZoneLoop).OutDryBulbTemp) { ZnAirRpt(ZoneLoop).InfilHeatGain = - 0.001 * MCPI(ZoneLoop) * (Zone(ZoneLoop).OutDryBulbTemp - MAT(ZoneLoop)) * TimeStepSys * SecInHour * 1000.0 * ADSCorrectionFactor; + 0.001 * MCPI(ZoneLoop) * (Zone(ZoneLoop).OutDryBulbTemp - MAT(ZoneLoop)) * TimeStepSys * DataGlobalConstants::SecInHour() * 1000.0 * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).InfilHeatLoss = 0.0; } // Report infiltration latent gains and losses @@ -2531,13 +2529,13 @@ namespace HVACManager { if (ZoneAirHumRat(ZoneLoop) > OutHumRat) { ZnAirRpt(ZoneLoop).InfilLatentLoss = 0.001 * MCPI(ZoneLoop) / CpAir * (ZoneAirHumRat(ZoneLoop) - OutHumRat) * H2OHtOfVap * - TimeStepSys * SecInHour * 1000.0 * ADSCorrectionFactor; + TimeStepSys * DataGlobalConstants::SecInHour() * 1000.0 * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).InfilLatentGain = 0.0; } else if (ZoneAirHumRat(ZoneLoop) <= OutHumRat) { ZnAirRpt(ZoneLoop).InfilLatentGain = 0.001 * MCPI(ZoneLoop) / CpAir * (OutHumRat - ZoneAirHumRat(ZoneLoop)) * H2OHtOfVap * - TimeStepSys * SecInHour * 1000.0 * ADSCorrectionFactor; + TimeStepSys * DataGlobalConstants::SecInHour() * 1000.0 * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).InfilLatentLoss = 0.0; } // Total infiltration losses and gains @@ -2553,25 +2551,25 @@ namespace HVACManager { // first calculate mass flows using outside air heat capacity for consistency with input to heat balance CpAir = PsyCpAirFnW(OutHumRat); - ZnAirRpt(ZoneLoop).InfilMass = (MCPI(ZoneLoop) / CpAir) * TimeStepSys * SecInHour * ADSCorrectionFactor; + ZnAirRpt(ZoneLoop).InfilMass = (MCPI(ZoneLoop) / CpAir) * TimeStepSys * DataGlobalConstants::SecInHour() * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).InfilMdot = (MCPI(ZoneLoop) / CpAir) * ADSCorrectionFactor; - ZnAirRpt(ZoneLoop).VentilMass = (MCPV(ZoneLoop) / CpAir) * TimeStepSys * SecInHour * ADSCorrectionFactor; + ZnAirRpt(ZoneLoop).VentilMass = (MCPV(ZoneLoop) / CpAir) * TimeStepSys * DataGlobalConstants::SecInHour() * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).VentilMdot = (MCPV(ZoneLoop) / CpAir) * ADSCorrectionFactor; // CR7751 second, calculate using indoor conditions for density property AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, MAT(ZoneLoop), ZoneAirHumRatAvg(ZoneLoop), RoutineName3); - ZnAirRpt(ZoneLoop).InfilVolumeCurDensity = (MCPI(ZoneLoop) / CpAir / AirDensity) * TimeStepSys * SecInHour * ADSCorrectionFactor; + ZnAirRpt(ZoneLoop).InfilVolumeCurDensity = (MCPI(ZoneLoop) / CpAir / AirDensity) * TimeStepSys * DataGlobalConstants::SecInHour() * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).InfilAirChangeRate = ZnAirRpt(ZoneLoop).InfilVolumeCurDensity / (TimeStepSys * Zone(ZoneLoop).Volume); ZnAirRpt(ZoneLoop).InfilVdotCurDensity = (MCPI(ZoneLoop) / CpAir / AirDensity) * ADSCorrectionFactor; - ZnAirRpt(ZoneLoop).VentilVolumeCurDensity = (MCPV(ZoneLoop) / CpAir / AirDensity) * TimeStepSys * SecInHour * ADSCorrectionFactor; + ZnAirRpt(ZoneLoop).VentilVolumeCurDensity = (MCPV(ZoneLoop) / CpAir / AirDensity) * TimeStepSys * DataGlobalConstants::SecInHour() * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).VentilAirChangeRate = ZnAirRpt(ZoneLoop).VentilVolumeCurDensity / (TimeStepSys * Zone(ZoneLoop).Volume); ZnAirRpt(ZoneLoop).VentilVdotCurDensity = (MCPV(ZoneLoop) / CpAir / AirDensity) * ADSCorrectionFactor; // CR7751 third, calculate using standard dry air at nominal elevation AirDensity = StdRhoAir; - ZnAirRpt(ZoneLoop).InfilVolumeStdDensity = (MCPI(ZoneLoop) / CpAir / AirDensity) * TimeStepSys * SecInHour * ADSCorrectionFactor; + ZnAirRpt(ZoneLoop).InfilVolumeStdDensity = (MCPI(ZoneLoop) / CpAir / AirDensity) * TimeStepSys * DataGlobalConstants::SecInHour() * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).InfilVdotStdDensity = (MCPI(ZoneLoop) / CpAir / AirDensity) * ADSCorrectionFactor; - ZnAirRpt(ZoneLoop).VentilVolumeStdDensity = (MCPV(ZoneLoop) / CpAir / AirDensity) * TimeStepSys * SecInHour * ADSCorrectionFactor; + ZnAirRpt(ZoneLoop).VentilVolumeStdDensity = (MCPV(ZoneLoop) / CpAir / AirDensity) * TimeStepSys * DataGlobalConstants::SecInHour() * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).VentilVdotStdDensity = (MCPV(ZoneLoop) / CpAir / AirDensity) * ADSCorrectionFactor; // ZnAirRpt(ZoneLoop)%VentilFanElec = 0.0 @@ -2585,7 +2583,7 @@ namespace HVACManager { for (VentNum = 1; VentNum <= TotVentilation; ++VentNum) { if (Ventilation(VentNum).ZonePtr == ZoneLoop) { // moved into CalcAirFlowSimple - // ZnAirRpt(ZoneLoop)%VentilFanElec = ZnAirRpt(ZoneLoop)%VentilFanElec+Ventilation(VentNum)%FanPower*TimeStepSys*SecInHour + // ZnAirRpt(ZoneLoop)%VentilFanElec = ZnAirRpt(ZoneLoop)%VentilFanElec+Ventilation(VentNum)%FanPower*TimeStepSys*DataGlobalConstants::SecInHour() // & // *ADSCorrectionFactor if (ADSCorrectionFactor > 0) { @@ -2598,10 +2596,10 @@ namespace HVACManager { // Break the ventilation load into heat gain and loss components if (MAT(ZoneLoop) > Ventilation(VentNum).AirTemp) { ZnAirRpt(ZoneLoop).VentilHeatLoss += - VentMCP(VentNum) * (MAT(ZoneLoop) - Ventilation(VentNum).AirTemp) * TimeStepSys * SecInHour * ADSCorrectionFactor; + VentMCP(VentNum) * (MAT(ZoneLoop) - Ventilation(VentNum).AirTemp) * TimeStepSys * DataGlobalConstants::SecInHour() * ADSCorrectionFactor; } else if (MAT(ZoneLoop) <= Ventilation(VentNum).AirTemp) { ZnAirRpt(ZoneLoop).VentilHeatGain += - VentMCP(VentNum) * (Ventilation(VentNum).AirTemp - MAT(ZoneLoop)) * TimeStepSys * SecInHour * ADSCorrectionFactor; + VentMCP(VentNum) * (Ventilation(VentNum).AirTemp - MAT(ZoneLoop)) * TimeStepSys * DataGlobalConstants::SecInHour() * ADSCorrectionFactor; } ++VentZoneNum; @@ -2611,11 +2609,11 @@ namespace HVACManager { H2OHtOfVap = PsyHgAirFnWTdb(ZoneAirHumRat(ZoneLoop), MAT(ZoneLoop)); if (ZoneAirHumRat(ZoneLoop) > OutHumRat) { ZnAirRpt(ZoneLoop).VentilLatentLoss = 0.001 * MCPV(ZoneLoop) / CpAir * (ZoneAirHumRat(ZoneLoop) - OutHumRat) * H2OHtOfVap * - TimeStepSys * SecInHour * 1000.0 * ADSCorrectionFactor; + TimeStepSys * DataGlobalConstants::SecInHour() * 1000.0 * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).VentilLatentGain = 0.0; } else if (ZoneAirHumRat(ZoneLoop) <= OutHumRat) { ZnAirRpt(ZoneLoop).VentilLatentGain = 0.001 * MCPV(ZoneLoop) / CpAir * (OutHumRat - ZoneAirHumRat(ZoneLoop)) * H2OHtOfVap * - TimeStepSys * SecInHour * 1000.0 * ADSCorrectionFactor; + TimeStepSys * DataGlobalConstants::SecInHour() * 1000.0 * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).VentilLatentLoss = 0.0; } // Total ventilation losses and gains @@ -2660,9 +2658,9 @@ namespace HVACManager { (ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(Mixing(MixNum).FromZone)) / 2.0, BlankString); CpAir = PsyCpAirFnW((ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(Mixing(MixNum).FromZone)) / 2.0); - ZnAirRpt(ZoneLoop).MixVolume += Mixing(MixNum).DesiredAirFlowRate * TimeStepSys * SecInHour * ADSCorrectionFactor; + ZnAirRpt(ZoneLoop).MixVolume += Mixing(MixNum).DesiredAirFlowRate * TimeStepSys * DataGlobalConstants::SecInHour() * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).MixVdotCurDensity += Mixing(MixNum).DesiredAirFlowRate * ADSCorrectionFactor; - ZnAirRpt(ZoneLoop).MixMass += Mixing(MixNum).DesiredAirFlowRate * AirDensity * TimeStepSys * SecInHour * ADSCorrectionFactor; + ZnAirRpt(ZoneLoop).MixMass += Mixing(MixNum).DesiredAirFlowRate * AirDensity * TimeStepSys * DataGlobalConstants::SecInHour() * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).MixMdot += Mixing(MixNum).DesiredAirFlowRate * AirDensity * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).MixVdotStdDensity += Mixing(MixNum).DesiredAirFlowRate * (AirDensity / StdRhoAir) * ADSCorrectionFactor; MixSenLoad(ZoneLoop) += Mixing(MixNum).DesiredAirFlowRate * AirDensity * CpAir * (MAT(ZoneLoop) - MAT(Mixing(MixNum).FromZone)); @@ -2685,9 +2683,9 @@ namespace HVACManager { (ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(CrossMixing(MixNum).FromZone)) / 2.0, BlankString); CpAir = PsyCpAirFnW((ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(CrossMixing(MixNum).FromZone)) / 2.0); - ZnAirRpt(ZoneLoop).MixVolume += CrossMixing(MixNum).DesiredAirFlowRate * TimeStepSys * SecInHour * ADSCorrectionFactor; + ZnAirRpt(ZoneLoop).MixVolume += CrossMixing(MixNum).DesiredAirFlowRate * TimeStepSys * DataGlobalConstants::SecInHour() * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).MixVdotCurDensity += CrossMixing(MixNum).DesiredAirFlowRate * ADSCorrectionFactor; - ZnAirRpt(ZoneLoop).MixMass += CrossMixing(MixNum).DesiredAirFlowRate * AirDensity * TimeStepSys * SecInHour * ADSCorrectionFactor; + ZnAirRpt(ZoneLoop).MixMass += CrossMixing(MixNum).DesiredAirFlowRate * AirDensity * TimeStepSys * DataGlobalConstants::SecInHour() * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).MixMdot += CrossMixing(MixNum).DesiredAirFlowRate * AirDensity * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).MixVdotStdDensity += CrossMixing(MixNum).DesiredAirFlowRate * (AirDensity / StdRhoAir) * ADSCorrectionFactor; MixSenLoad(ZoneLoop) += @@ -2705,9 +2703,9 @@ namespace HVACManager { (ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(CrossMixing(MixNum).ZonePtr)) / 2.0, BlankString); CpAir = PsyCpAirFnW((ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(CrossMixing(MixNum).ZonePtr)) / 2.0); - ZnAirRpt(ZoneLoop).MixVolume += CrossMixing(MixNum).DesiredAirFlowRate * TimeStepSys * SecInHour * ADSCorrectionFactor; + ZnAirRpt(ZoneLoop).MixVolume += CrossMixing(MixNum).DesiredAirFlowRate * TimeStepSys * DataGlobalConstants::SecInHour() * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).MixVdotCurDensity += CrossMixing(MixNum).DesiredAirFlowRate * ADSCorrectionFactor; - ZnAirRpt(ZoneLoop).MixMass += CrossMixing(MixNum).DesiredAirFlowRate * AirDensity * TimeStepSys * SecInHour * ADSCorrectionFactor; + ZnAirRpt(ZoneLoop).MixMass += CrossMixing(MixNum).DesiredAirFlowRate * AirDensity * TimeStepSys * DataGlobalConstants::SecInHour() * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).MixMdot += CrossMixing(MixNum).DesiredAirFlowRate * AirDensity * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).MixVdotStdDensity += CrossMixing(MixNum).DesiredAirFlowRate * (AirDensity / StdRhoAir) * ADSCorrectionFactor; MixSenLoad(ZoneLoop) += @@ -2739,10 +2737,10 @@ namespace HVACManager { H2OHtOfVap = PsyHgAirFnWTdb((ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(ZoneB)) / 2.0, (MAT(ZoneLoop) + MAT(ZoneB)) / 2.0); ZnAirRpt(ZoneLoop).MixVolume += - RefDoorMixing(ZoneLoop).VolRefDoorFlowRate(j) * TimeStepSys * SecInHour * ADSCorrectionFactor; + RefDoorMixing(ZoneLoop).VolRefDoorFlowRate(j) * TimeStepSys * DataGlobalConstants::SecInHour() * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).MixVdotCurDensity += RefDoorMixing(ZoneLoop).VolRefDoorFlowRate(j) * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).MixMass += - RefDoorMixing(ZoneLoop).VolRefDoorFlowRate(j) * AirDensity * TimeStepSys * SecInHour * ADSCorrectionFactor; + RefDoorMixing(ZoneLoop).VolRefDoorFlowRate(j) * AirDensity * TimeStepSys * DataGlobalConstants::SecInHour() * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).MixMdot += RefDoorMixing(ZoneLoop).VolRefDoorFlowRate(j) * AirDensity * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).MixVdotStdDensity += RefDoorMixing(ZoneLoop).VolRefDoorFlowRate(j) * (AirDensity / StdRhoAir) * ADSCorrectionFactor; @@ -2768,10 +2766,10 @@ namespace HVACManager { H2OHtOfVap = PsyHgAirFnWTdb((ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(ZoneA)) / 2.0, (MAT(ZoneLoop) + MAT(ZoneA)) / 2.0); ZnAirRpt(ZoneLoop).MixVolume += - RefDoorMixing(ZoneA).VolRefDoorFlowRate(j) * TimeStepSys * SecInHour * ADSCorrectionFactor; + RefDoorMixing(ZoneA).VolRefDoorFlowRate(j) * TimeStepSys * DataGlobalConstants::SecInHour() * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).MixVdotCurDensity += RefDoorMixing(ZoneA).VolRefDoorFlowRate(j) * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).MixMass += - RefDoorMixing(ZoneA).VolRefDoorFlowRate(j) * AirDensity * TimeStepSys * SecInHour * ADSCorrectionFactor; + RefDoorMixing(ZoneA).VolRefDoorFlowRate(j) * AirDensity * TimeStepSys * DataGlobalConstants::SecInHour() * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).MixMdot += RefDoorMixing(ZoneA).VolRefDoorFlowRate(j) * AirDensity * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).MixVdotStdDensity += RefDoorMixing(ZoneA).VolRefDoorFlowRate(j) * (AirDensity / StdRhoAir) * ADSCorrectionFactor; @@ -2790,20 +2788,20 @@ namespace HVACManager { // MixingLoad(ZoneLoop) = MCPM(ZoneLoop)*MAT(ZoneLoop) - MixSenLoad(ZoneLoop) if (MixSenLoad(ZoneLoop) > 0.0) { - ZnAirRpt(ZoneLoop).MixHeatLoss = MixSenLoad(ZoneLoop) * TimeStepSys * SecInHour * ADSCorrectionFactor; + ZnAirRpt(ZoneLoop).MixHeatLoss = MixSenLoad(ZoneLoop) * TimeStepSys * DataGlobalConstants::SecInHour() * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).MixHeatGain = 0.0; } else { ZnAirRpt(ZoneLoop).MixHeatLoss = 0.0; - ZnAirRpt(ZoneLoop).MixHeatGain = -MixSenLoad(ZoneLoop) * TimeStepSys * SecInHour * ADSCorrectionFactor; + ZnAirRpt(ZoneLoop).MixHeatGain = -MixSenLoad(ZoneLoop) * TimeStepSys * DataGlobalConstants::SecInHour() * ADSCorrectionFactor; } // Report mixing latent loads // MixingLoad(ZoneLoop) = MixLatLoad(ZoneLoop) if (MixLatLoad(ZoneLoop) > 0.0) { - ZnAirRpt(ZoneLoop).MixLatentLoss = MixLatLoad(ZoneLoop) * TimeStepSys * SecInHour * ADSCorrectionFactor; + ZnAirRpt(ZoneLoop).MixLatentLoss = MixLatLoad(ZoneLoop) * TimeStepSys * DataGlobalConstants::SecInHour() * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).MixLatentGain = 0.0; } else { ZnAirRpt(ZoneLoop).MixLatentLoss = 0.0; - ZnAirRpt(ZoneLoop).MixLatentGain = -MixLatLoad(ZoneLoop) * TimeStepSys * SecInHour * ADSCorrectionFactor; + ZnAirRpt(ZoneLoop).MixLatentGain = -MixLatLoad(ZoneLoop) * TimeStepSys * DataGlobalConstants::SecInHour() * ADSCorrectionFactor; } // Total Mixing losses and gains TotalLoad = @@ -2821,21 +2819,21 @@ namespace HVACManager { if (ZoneAirBalance(j).BalanceMethod == AirBalanceQuadrature && ZoneLoop == ZoneAirBalance(j).ZonePtr) { if (MAT(ZoneLoop) > Zone(ZoneLoop).OutDryBulbTemp) { ZnAirRpt(ZoneLoop).OABalanceHeatLoss = - MDotCPOA(ZoneLoop) * (MAT(ZoneLoop) - Zone(ZoneLoop).OutDryBulbTemp) * TimeStepSys * SecInHour * ADSCorrectionFactor; + MDotCPOA(ZoneLoop) * (MAT(ZoneLoop) - Zone(ZoneLoop).OutDryBulbTemp) * TimeStepSys * DataGlobalConstants::SecInHour() * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).OABalanceHeatGain = 0.0; } else { ZnAirRpt(ZoneLoop).OABalanceHeatLoss = 0.0; ZnAirRpt(ZoneLoop).OABalanceHeatGain = - -MDotCPOA(ZoneLoop) * (MAT(ZoneLoop) - Zone(ZoneLoop).OutDryBulbTemp) * TimeStepSys * SecInHour * ADSCorrectionFactor; + -MDotCPOA(ZoneLoop) * (MAT(ZoneLoop) - Zone(ZoneLoop).OutDryBulbTemp) * TimeStepSys * DataGlobalConstants::SecInHour() * ADSCorrectionFactor; } H2OHtOfVap = PsyHgAirFnWTdb(OutHumRat, Zone(ZoneLoop).OutDryBulbTemp); if (ZoneAirHumRat(ZoneLoop) > OutHumRat) { ZnAirRpt(ZoneLoop).OABalanceLatentLoss = 0.001 * MDotOA(ZoneLoop) * (ZoneAirHumRat(ZoneLoop) - OutHumRat) * H2OHtOfVap * - TimeStepSys * SecInHour * 1000.0 * ADSCorrectionFactor; + TimeStepSys * DataGlobalConstants::SecInHour() * 1000.0 * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).OABalanceLatentGain = 0.0; } else if (ZoneAirHumRat(ZoneLoop) <= OutHumRat) { ZnAirRpt(ZoneLoop).OABalanceLatentGain = 0.001 * MDotOA(ZoneLoop) * (OutHumRat - ZoneAirHumRat(ZoneLoop)) * H2OHtOfVap * - TimeStepSys * SecInHour * 1000.0 * ADSCorrectionFactor; + TimeStepSys * DataGlobalConstants::SecInHour() * 1000.0 * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).OABalanceLatentLoss = 0.0; } // Total ventilation losses and gains @@ -2848,14 +2846,14 @@ namespace HVACManager { ZnAirRpt(ZoneLoop).OABalanceTotalGain = 0.0; ZnAirRpt(ZoneLoop).OABalanceTotalLoss = -TotalLoad * ADSCorrectionFactor; } - ZnAirRpt(ZoneLoop).OABalanceMass = (MDotOA(ZoneLoop)) * TimeStepSys * SecInHour * ADSCorrectionFactor; + ZnAirRpt(ZoneLoop).OABalanceMass = (MDotOA(ZoneLoop)) * TimeStepSys * DataGlobalConstants::SecInHour() * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).OABalanceMdot = (MDotOA(ZoneLoop)) * ADSCorrectionFactor; AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, MAT(ZoneLoop), ZoneAirHumRatAvg(ZoneLoop), BlankString); - ZnAirRpt(ZoneLoop).OABalanceVolumeCurDensity = (MDotOA(ZoneLoop) / AirDensity) * TimeStepSys * SecInHour * ADSCorrectionFactor; + ZnAirRpt(ZoneLoop).OABalanceVolumeCurDensity = (MDotOA(ZoneLoop) / AirDensity) * TimeStepSys * DataGlobalConstants::SecInHour() * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).OABalanceAirChangeRate = ZnAirRpt(ZoneLoop).OABalanceVolumeCurDensity / (TimeStepSys * Zone(ZoneLoop).Volume); ZnAirRpt(ZoneLoop).OABalanceVdotCurDensity = (MDotOA(ZoneLoop) / AirDensity) * ADSCorrectionFactor; AirDensity = StdRhoAir; - ZnAirRpt(ZoneLoop).OABalanceVolumeStdDensity = (MDotOA(ZoneLoop) / AirDensity) * TimeStepSys * SecInHour * ADSCorrectionFactor; + ZnAirRpt(ZoneLoop).OABalanceVolumeStdDensity = (MDotOA(ZoneLoop) / AirDensity) * TimeStepSys * DataGlobalConstants::SecInHour() * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).OABalanceVdotStdDensity = (MDotOA(ZoneLoop) / AirDensity) * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).OABalanceFanElec = ZnAirRpt(ZoneLoop).VentilFanElec; } @@ -2867,15 +2865,15 @@ namespace HVACManager { if (!ZoneEquipConfig(ZoneLoop).IsControlled) { for (int j = 1; j <= ZoneEquipConfig(ZoneLoop).NumInletNodes; ++j) { ZnAirRpt(ZoneLoop).SysInletMass += - Node(ZoneEquipConfig(ZoneLoop).InletNode(j)).MassFlowRate * TimeStepSys * SecInHour * ADSCorrectionFactor; + Node(ZoneEquipConfig(ZoneLoop).InletNode(j)).MassFlowRate * TimeStepSys * DataGlobalConstants::SecInHour() * ADSCorrectionFactor; } for (int j = 1; j <= ZoneEquipConfig(ZoneLoop).NumExhaustNodes; ++j) { ZnAirRpt(ZoneLoop).SysOutletMass += - Node(ZoneEquipConfig(ZoneLoop).ExhaustNode(j)).MassFlowRate * TimeStepSys * SecInHour * ADSCorrectionFactor; + Node(ZoneEquipConfig(ZoneLoop).ExhaustNode(j)).MassFlowRate * TimeStepSys * DataGlobalConstants::SecInHour() * ADSCorrectionFactor; } for (int j = 1; j <= ZoneEquipConfig(ZoneLoop).NumReturnNodes; ++j) { ZnAirRpt(ZoneLoop).SysOutletMass += - Node(ZoneEquipConfig(ZoneLoop).ReturnNode(j)).MassFlowRate * TimeStepSys * SecInHour * ADSCorrectionFactor; + Node(ZoneEquipConfig(ZoneLoop).ReturnNode(j)).MassFlowRate * TimeStepSys * DataGlobalConstants::SecInHour() * ADSCorrectionFactor; } } @@ -2883,13 +2881,13 @@ namespace HVACManager { ZnAirRpt(ZoneLoop).OABalanceMass + ZnAirRpt(ZoneLoop).SysInletMass - ZnAirRpt(ZoneLoop).SysOutletMass; // kg ZnAirRpt(ZoneLoop).ExfilSensiLoss = - ZnAirRpt(ZoneLoop).ExfilMass / (TimeStepSys * SecInHour) * (MAT(ZoneLoop) - Zone(ZoneLoop).OutDryBulbTemp) * CpAir; // W + ZnAirRpt(ZoneLoop).ExfilMass / (TimeStepSys * DataGlobalConstants::SecInHour()) * (MAT(ZoneLoop) - Zone(ZoneLoop).OutDryBulbTemp) * CpAir; // W ZnAirRpt(ZoneLoop).ExfilLatentLoss = - ZnAirRpt(ZoneLoop).ExfilMass / (TimeStepSys * SecInHour) * (ZoneAirHumRat(ZoneLoop) - OutHumRat) * H2OHtOfVap; + ZnAirRpt(ZoneLoop).ExfilMass / (TimeStepSys * DataGlobalConstants::SecInHour()) * (ZoneAirHumRat(ZoneLoop) - OutHumRat) * H2OHtOfVap; ZnAirRpt(ZoneLoop).ExfilTotalLoss = ZnAirRpt(ZoneLoop).ExfilLatentLoss + ZnAirRpt(ZoneLoop).ExfilSensiLoss; - ZoneTotalExfiltrationHeatLoss += ZnAirRpt(ZoneLoop).ExfilTotalLoss * TimeStepSys * SecInHour; - ZoneTotalExhaustHeatLoss += ZnAirRpt(ZoneLoop).ExhTotalLoss * TimeStepSys * SecInHour; + ZoneTotalExfiltrationHeatLoss += ZnAirRpt(ZoneLoop).ExfilTotalLoss * TimeStepSys * DataGlobalConstants::SecInHour(); + ZoneTotalExhaustHeatLoss += ZnAirRpt(ZoneLoop).ExhTotalLoss * TimeStepSys * DataGlobalConstants::SecInHour(); } } diff --git a/src/EnergyPlus/HVACMultiSpeedHeatPump.cc b/src/EnergyPlus/HVACMultiSpeedHeatPump.cc index a7ce310fb38..5da3bc5da35 100644 --- a/src/EnergyPlus/HVACMultiSpeedHeatPump.cc +++ b/src/EnergyPlus/HVACMultiSpeedHeatPump.cc @@ -4079,7 +4079,7 @@ namespace HVACMultiSpeedHeatPump { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: Real64 ReportingConstant; - ReportingConstant = TimeStepSys * SecInHour; + ReportingConstant = TimeStepSys * DataGlobalConstants::SecInHour(); MSHeatPumpReport(MSHeatPumpNum).ElecPowerConsumption = MSHeatPump(MSHeatPumpNum).ElecPower * ReportingConstant; // + & MSHeatPumpReport(MSHeatPumpNum).HeatRecoveryEnergy = MSHeatPump(MSHeatPumpNum).HeatRecoveryRate * ReportingConstant; diff --git a/src/EnergyPlus/HVACStandAloneERV.cc b/src/EnergyPlus/HVACStandAloneERV.cc index 0d5ff2b0050..d5194ad72ff 100644 --- a/src/EnergyPlus/HVACStandAloneERV.cc +++ b/src/EnergyPlus/HVACStandAloneERV.cc @@ -114,7 +114,6 @@ namespace HVACStandAloneERV { using DataGlobals::DisplayExtraWarnings; using DataGlobals::NumOfZones; using DataGlobals::ScheduleAlwaysOn; - using DataGlobals::SecInHour; using DataGlobals::SysSizingCalc; using DataGlobals::WarmupFlag; using namespace DataHVACGlobals; @@ -1831,7 +1830,7 @@ namespace HVACStandAloneERV { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: Real64 ReportingConstant; - ReportingConstant = TimeStepSys * SecInHour; + ReportingConstant = TimeStepSys * DataGlobalConstants::SecInHour(); StandAloneERV(StandAloneERVNum).ElecUseEnergy = StandAloneERV(StandAloneERVNum).ElecUseRate * ReportingConstant; StandAloneERV(StandAloneERVNum).SensCoolingEnergy = StandAloneERV(StandAloneERVNum).SensCoolingRate * ReportingConstant; StandAloneERV(StandAloneERVNum).LatCoolingEnergy = StandAloneERV(StandAloneERVNum).LatCoolingRate * ReportingConstant; diff --git a/src/EnergyPlus/HVACUnitaryBypassVAV.cc b/src/EnergyPlus/HVACUnitaryBypassVAV.cc index 1f0e286106d..ebb2ae99524 100644 --- a/src/EnergyPlus/HVACUnitaryBypassVAV.cc +++ b/src/EnergyPlus/HVACUnitaryBypassVAV.cc @@ -3966,7 +3966,7 @@ namespace HVACUnitaryBypassVAV { // PURPOSE OF THIS SUBROUTINE: // Fills some of the report variables for the changeover-bypass VAV system - Real64 ReportingConstant = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + Real64 ReportingConstant = DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); CBVAV(CBVAVNum).TotCoolEnergy = CBVAV(CBVAVNum).TotCoolEnergyRate * ReportingConstant; CBVAV(CBVAVNum).TotHeatEnergy = CBVAV(CBVAVNum).TotHeatEnergyRate * ReportingConstant; diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index ce06c9cb85b..26bda42249e 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -8839,7 +8839,7 @@ namespace HVACVariableRefrigerantFlow { IndexToTUInTUList = VRFTU(VRFTUNum).IndexToTUInTUList; HRHeatRequestFlag = TerminalUnitList(TUListIndex).HRHeatRequest(IndexToTUInTUList); HRCoolRequestFlag = TerminalUnitList(TUListIndex).HRCoolRequest(IndexToTUInTUList); - ReportingConstant = DataHVACGlobals::TimeStepSys * SecInHour; + ReportingConstant = DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); // account for terminal unit parasitic On/Off power use // account for heat recovery first since these flags will be FALSE otherwise, each TU may have different operating mode @@ -8986,7 +8986,7 @@ namespace HVACVariableRefrigerantFlow { Real64 ReportingConstant; // - conversion constant for energy - ReportingConstant = DataHVACGlobals::TimeStepSys * SecInHour; + ReportingConstant = DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); // calculate VRF condenser power/energy use VRF(VRFCond).CoolElecConsumption = VRF(VRFCond).ElecCoolingPower * ReportingConstant; diff --git a/src/EnergyPlus/HWBaseboardRadiator.cc b/src/EnergyPlus/HWBaseboardRadiator.cc index 6a43c236441..67354adc4e1 100644 --- a/src/EnergyPlus/HWBaseboardRadiator.cc +++ b/src/EnergyPlus/HWBaseboardRadiator.cc @@ -1686,10 +1686,10 @@ namespace HWBaseboardRadiator { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - HWBaseboard(BaseboardNum).TotEnergy = HWBaseboard(BaseboardNum).TotPower * TimeStepSys * SecInHour; - HWBaseboard(BaseboardNum).Energy = HWBaseboard(BaseboardNum).Power * TimeStepSys * SecInHour; - HWBaseboard(BaseboardNum).ConvEnergy = HWBaseboard(BaseboardNum).ConvPower * TimeStepSys * SecInHour; - HWBaseboard(BaseboardNum).RadEnergy = HWBaseboard(BaseboardNum).RadPower * TimeStepSys * SecInHour; + HWBaseboard(BaseboardNum).TotEnergy = HWBaseboard(BaseboardNum).TotPower * TimeStepSys * DataGlobalConstants::SecInHour(); + HWBaseboard(BaseboardNum).Energy = HWBaseboard(BaseboardNum).Power * TimeStepSys * DataGlobalConstants::SecInHour(); + HWBaseboard(BaseboardNum).ConvEnergy = HWBaseboard(BaseboardNum).ConvPower * TimeStepSys * DataGlobalConstants::SecInHour(); + HWBaseboard(BaseboardNum).RadEnergy = HWBaseboard(BaseboardNum).RadPower * TimeStepSys * DataGlobalConstants::SecInHour(); } Real64 SumHATsurf(int const ZoneNum) // Zone number diff --git a/src/EnergyPlus/HeatBalFiniteDiffManager.cc b/src/EnergyPlus/HeatBalFiniteDiffManager.cc index fb668ca9ce7..eeb6b539f0c 100644 --- a/src/EnergyPlus/HeatBalFiniteDiffManager.cc +++ b/src/EnergyPlus/HeatBalFiniteDiffManager.cc @@ -102,7 +102,6 @@ namespace HeatBalFiniteDiffManager { using DataGlobals::HourOfDay; using DataGlobals::KelvinConv; using DataGlobals::NumOfTimeStepInHour; - using DataGlobals::SecInHour; using DataGlobals::TimeStep; using DataGlobals::TimeStepZoneSec; using DataGlobals::WarmupFlag; @@ -679,7 +678,7 @@ namespace HeatBalFiniteDiffManager { fracTimeStepZone_Hour = 1.0 / double(NumOfTimeStepInHour); for (index = 1; index <= 20; ++index) { - Delt = (fracTimeStepZone_Hour * SecInHour) / index; // TimeStepZone = Zone time step in fractional hours + Delt = (fracTimeStepZone_Hour * DataGlobalConstants::SecInHour()) / index; // TimeStepZone = Zone time step in fractional hours if (Delt <= 200) break; } @@ -1269,7 +1268,7 @@ namespace HeatBalFiniteDiffManager { ThisNum, state.dataConstruction->Construct(ThisNum).TotLayers, int(ConstructFD(ThisNum).TotNodes + 1), - ConstructFD(ThisNum).DeltaTime / SecInHour); + ConstructFD(ThisNum).DeltaTime / DataGlobalConstants::SecInHour()); for (Layer = 1; Layer <= state.dataConstruction->Construct(ThisNum).TotLayers; ++Layer) { static constexpr auto Format_701(" Material CondFD Summary,{},{:.4R},{},{:.8R},{:.8R},{:.8R}\n"); diff --git a/src/EnergyPlus/HeatBalanceAirManager.cc b/src/EnergyPlus/HeatBalanceAirManager.cc index 73cf78077b0..58bce271680 100644 --- a/src/EnergyPlus/HeatBalanceAirManager.cc +++ b/src/EnergyPlus/HeatBalanceAirManager.cc @@ -979,7 +979,7 @@ namespace HeatBalanceAirManager { } else if (SELECT_CASE_var == "AIRCHANGES/HOUR") { if (Infiltration(Loop).ZonePtr != 0) { if (rNumericArgs(4) >= 0.0) { - Infiltration(Loop).DesignLevel = rNumericArgs(4) * Zone(Infiltration(Loop).ZonePtr).Volume / SecInHour; + Infiltration(Loop).DesignLevel = rNumericArgs(4) * Zone(Infiltration(Loop).ZonePtr).Volume / DataGlobalConstants::SecInHour(); if (Zone(Infiltration(Loop).ZonePtr).Volume <= 0.0) { ShowWarningError(RoutineName + cCurrentModuleObject + "=\"" + Infiltration(Loop).Name + "\", " + cAlphaFieldNames(4) + " specifies " + cNumericFieldNames(4) + @@ -1446,7 +1446,7 @@ namespace HeatBalanceAirManager { } else if (SELECT_CASE_var == "AIRCHANGES/HOUR") { if (Ventilation(Loop).ZonePtr != 0) { if (rNumericArgs(4) >= 0.0) { - Ventilation(Loop).DesignLevel = rNumericArgs(4) * Zone(Ventilation(Loop).ZonePtr).Volume / SecInHour; + Ventilation(Loop).DesignLevel = rNumericArgs(4) * Zone(Ventilation(Loop).ZonePtr).Volume / DataGlobalConstants::SecInHour(); if (Zone(Ventilation(Loop).ZonePtr).Volume <= 0.0) { ShowWarningError(RoutineName + cCurrentModuleObject + "=\"" + Ventilation(Loop).Name + "\", " + cAlphaFieldNames(4) + " specifies " + cNumericFieldNames(4) + @@ -2406,7 +2406,7 @@ namespace HeatBalanceAirManager { } else if (SELECT_CASE_var == "AIRCHANGES/HOUR") { if (Mixing(Loop).ZonePtr != 0) { if (rNumericArgs(4) >= 0.0) { - Mixing(Loop).DesignLevel = rNumericArgs(4) * Zone(Mixing(Loop).ZonePtr).Volume / SecInHour; + Mixing(Loop).DesignLevel = rNumericArgs(4) * Zone(Mixing(Loop).ZonePtr).Volume / DataGlobalConstants::SecInHour(); if (Zone(Mixing(Loop).ZonePtr).Volume <= 0.0) { ShowWarningError(RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", " + cAlphaFieldNames(4) + " specifies " + cNumericFieldNames(4) + ", but Zone Volume = 0. 0 Mixing will result."); @@ -2851,7 +2851,7 @@ namespace HeatBalanceAirManager { else if (SELECT_CASE_var == "AIRCHANGES/HOUR") { if (CrossMixing(Loop).ZonePtr != 0) { if (rNumericArgs(4) >= 0.0) { - CrossMixing(Loop).DesignLevel = rNumericArgs(4) * Zone(CrossMixing(Loop).ZonePtr).Volume / SecInHour; + CrossMixing(Loop).DesignLevel = rNumericArgs(4) * Zone(CrossMixing(Loop).ZonePtr).Volume / DataGlobalConstants::SecInHour(); if (Zone(CrossMixing(Loop).ZonePtr).Volume <= 0.0) { ShowWarningError(RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", " + cAlphaFieldNames(4) + " specifies " + cNumericFieldNames(4) + ", but Zone Volume = 0. 0 Cross Mixing will result."); @@ -3558,7 +3558,7 @@ namespace HeatBalanceAirManager { divide_and_print_if_greater_than_zero(Zone(ZoneNum).FloorArea, Infiltration(Loop).DesignLevel); divide_and_print_if_greater_than_zero(Zone(ZoneNum).ExteriorTotalSurfArea, Infiltration(Loop).DesignLevel); - divide_and_print_if_greater_than_zero(Zone(ZoneNum).Volume, Infiltration(Loop).DesignLevel * SecInHour); + divide_and_print_if_greater_than_zero(Zone(ZoneNum).Volume, Infiltration(Loop).DesignLevel * DataGlobalConstants::SecInHour()); print(state.files.eio, "{:.3R},", Infiltration(Loop).ConstantTermCoef); print(state.files.eio, "{:.3R},", Infiltration(Loop).TemperatureTermCoef); @@ -3599,7 +3599,7 @@ namespace HeatBalanceAirManager { divide_and_print_if_greater_than_zero(Zone(ZoneNum).FloorArea, Ventilation(Loop).DesignLevel); divide_and_print_if_greater_than_zero(Zone(ZoneNum).TotOccupants, Ventilation(Loop).DesignLevel); - divide_and_print_if_greater_than_zero(Zone(ZoneNum).Volume, Ventilation(Loop).DesignLevel * SecInHour); + divide_and_print_if_greater_than_zero(Zone(ZoneNum).Volume, Ventilation(Loop).DesignLevel * DataGlobalConstants::SecInHour()); if (Ventilation(Loop).FanType == ExhaustVentilation) { print(state.files.eio, "Exhaust,"); @@ -3666,7 +3666,7 @@ namespace HeatBalanceAirManager { print(state.files.eio, "{:.3R},", Mixing(Loop).DesignLevel); divide_and_print_if_greater_than_zero(Zone(ZoneNum).FloorArea, Mixing(Loop).DesignLevel); divide_and_print_if_greater_than_zero(Zone(ZoneNum).TotOccupants, Mixing(Loop).DesignLevel); - divide_and_print_if_greater_than_zero(Zone(ZoneNum).Volume, Mixing(Loop).DesignLevel * SecInHour); + divide_and_print_if_greater_than_zero(Zone(ZoneNum).Volume, Mixing(Loop).DesignLevel * DataGlobalConstants::SecInHour()); print(state.files.eio, "{},", Zone(Mixing(Loop).FromZone).Name); print(state.files.eio, "{:.2R}\n", Mixing(Loop).DeltaTemperature); @@ -3700,7 +3700,7 @@ namespace HeatBalanceAirManager { divide_and_print_if_greater_than_zero(Zone(ZoneNum).FloorArea, CrossMixing(Loop).DesignLevel); divide_and_print_if_greater_than_zero(Zone(ZoneNum).TotOccupants, CrossMixing(Loop).DesignLevel); - divide_and_print_if_greater_than_zero(Zone(ZoneNum).Volume, CrossMixing(Loop).DesignLevel * SecInHour); + divide_and_print_if_greater_than_zero(Zone(ZoneNum).Volume, CrossMixing(Loop).DesignLevel * DataGlobalConstants::SecInHour()); print(state.files.eio, "{},", Zone(CrossMixing(Loop).FromZone).Name); print(state.files.eio, "{:.2R}\n", CrossMixing(Loop).DeltaTemperature); diff --git a/src/EnergyPlus/HeatBalanceIntRadExchange.cc b/src/EnergyPlus/HeatBalanceIntRadExchange.cc index 3235e40909d..f84f434ddb5 100644 --- a/src/EnergyPlus/HeatBalanceIntRadExchange.cc +++ b/src/EnergyPlus/HeatBalanceIntRadExchange.cc @@ -1136,7 +1136,6 @@ namespace HeatBalanceIntRadExchange { int index; int inx1; int inx2; - // unused CHARACTER(len=MaxNameLength), ALLOCATABLE, DIMENSION(:) :: ZoneSurfaceNames NoUserInputF = true; UserFZoneIndex = inputProcessor->getObjectItemNum(state, "ZoneProperty:UserViewFactors", ZoneName); diff --git a/src/EnergyPlus/HeatBalanceManager.cc b/src/EnergyPlus/HeatBalanceManager.cc index 1b5700d1913..e2efdb9858f 100644 --- a/src/EnergyPlus/HeatBalanceManager.cc +++ b/src/EnergyPlus/HeatBalanceManager.cc @@ -4711,8 +4711,6 @@ namespace HeatBalanceManager { // na // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - // CHARACTER(len=MaxNameLength), DIMENSION(MaxZonesInList + 1) :: Alphas - // REAL(r64), DIMENSION(8) :: Numbers int NumAlphas; int NumNumbers; int IOStatus; @@ -5088,8 +5086,6 @@ namespace HeatBalanceManager { // na // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - // CHARACTER(len=MaxNameLength), DIMENSION(MaxZonesInList + 1) :: Alphas - // REAL(r64), DIMENSION(8) :: Numbers Zone(ZoneLoop).Name = cAlphaArgs(1); if (NumNumbers >= 1) Zone(ZoneLoop).RelNorth = rNumericArgs(1); diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index 7750f2b8a47..76a9e013e78 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -8315,7 +8315,6 @@ namespace HeatBalanceSurfaceManager { using DataEnvironment::OutBaroPress; using DataEnvironment::SkyTemp; using DataEnvironment::SunIsUp; - using DataGlobals::SecInHour; using DataSurfaces::ExtVentedCavity; using DataSurfaces::OSCM; using DataSurfaces::Surface; @@ -8402,7 +8401,7 @@ namespace HeatBalanceSurfaceManager { ExtVentedCavity(CavNum).HrPlen = HrPlen; ExtVentedCavity(CavNum).HcPlen = HcPlen; ExtVentedCavity(CavNum).PassiveACH = - (MdotVent / RhoAir) * (1.0 / (ExtVentedCavity(CavNum).ProjArea * ExtVentedCavity(CavNum).PlenGapThick)) * SecInHour; + (MdotVent / RhoAir) * (1.0 / (ExtVentedCavity(CavNum).ProjArea * ExtVentedCavity(CavNum).PlenGapThick)) * DataGlobalConstants::SecInHour(); ExtVentedCavity(CavNum).PassiveMdotVent = MdotVent; ExtVentedCavity(CavNum).PassiveMdotWind = VdotWind * RhoAir; ExtVentedCavity(CavNum).PassiveMdotTherm = VdotThermal * RhoAir; diff --git a/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.cc b/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.cc index 3c8b0aa2e4a..877df05cbc4 100644 --- a/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.cc +++ b/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.cc @@ -95,7 +95,6 @@ namespace HeatPumpWaterToWaterCOOLING { using DataGlobals::BeginSimFlag; using DataGlobals::DayOfSim; using DataGlobals::HourOfDay; - using DataGlobals::SecInHour; using DataGlobals::TimeStep; using DataGlobals::TimeStepZone; using DataGlobals::WarmupFlag; @@ -960,7 +959,7 @@ namespace HeatPumpWaterToWaterCOOLING { // set node flow rates; for these load based models // assume that the sufficient Source Side flow rate available - Real64 const ReportingConstant = DataHVACGlobals::TimeStepSys * SecInHour; + Real64 const ReportingConstant = DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); this->Energy = this->Power * ReportingConstant; this->QSourceEnergy = QSource * ReportingConstant; diff --git a/src/EnergyPlus/HeatPumpWaterToWaterHEATING.cc b/src/EnergyPlus/HeatPumpWaterToWaterHEATING.cc index 3b5a05d0f14..3d75ce0d10d 100644 --- a/src/EnergyPlus/HeatPumpWaterToWaterHEATING.cc +++ b/src/EnergyPlus/HeatPumpWaterToWaterHEATING.cc @@ -95,7 +95,6 @@ namespace HeatPumpWaterToWaterHEATING { using DataGlobals::DayOfSim; using DataGlobals::HourOfDay; using DataGlobals::KelvinConv; - using DataGlobals::SecInHour; using DataGlobals::TimeStep; using DataGlobals::TimeStepZone; using DataGlobals::WarmupFlag; @@ -896,7 +895,7 @@ namespace HeatPumpWaterToWaterHEATING { // set node flow rates; for these load based models // assume that the sufficient Source Side flow rate available - Real64 const ReportingConstant = DataHVACGlobals::TimeStepSys * SecInHour; + Real64 const ReportingConstant = DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); this->Energy = this->Power * ReportingConstant; this->QSourceEnergy = QSource * ReportingConstant; diff --git a/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc b/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc index f9365960391..1a13d7f037b 100644 --- a/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc +++ b/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc @@ -109,7 +109,6 @@ namespace HeatPumpWaterToWaterSimple { using DataGlobals::DayOfSim; using DataGlobals::HourOfDay; using DataGlobals::KelvinConv; - using DataGlobals::SecInHour; using DataGlobals::TimeStep; using DataGlobals::TimeStepZone; using DataGlobals::WarmupFlag; @@ -1784,7 +1783,7 @@ namespace HeatPumpWaterToWaterSimple { LoadSideOutletTemp = LoadSideInletTemp - QLoad / (LoadSideMassFlowRate * CpLoadSide); SourceSideOutletTemp = SourceSideInletTemp + QSource / (SourceSideMassFlowRate * CpSourceSide); - ReportingConstant = TimeStepSys * SecInHour; + ReportingConstant = TimeStepSys * DataGlobalConstants::SecInHour(); this->reportPower = Power; this->reportEnergy = Power * ReportingConstant; @@ -1963,7 +1962,7 @@ namespace HeatPumpWaterToWaterSimple { LoadSideOutletTemp = LoadSideInletTemp + QLoad / (LoadSideMassFlowRate * CpLoadSide); SourceSideOutletTemp = SourceSideInletTemp - QSource / (SourceSideMassFlowRate * CpSourceSide); - ReportingConstant = TimeStepSys * SecInHour; + ReportingConstant = TimeStepSys * DataGlobalConstants::SecInHour(); this->reportPower = Power; this->reportEnergy = Power * ReportingConstant; diff --git a/src/EnergyPlus/HeatRecovery.cc b/src/EnergyPlus/HeatRecovery.cc index 81daed56c63..4cf3367ace4 100644 --- a/src/EnergyPlus/HeatRecovery.cc +++ b/src/EnergyPlus/HeatRecovery.cc @@ -116,7 +116,6 @@ namespace HeatRecovery { using DataGlobals::BeginEnvrnFlag; using DataGlobals::DisplayExtraWarnings; using DataGlobals::ScheduleAlwaysOn; - using DataGlobals::SecInHour; using DataGlobals::SysSizingCalc; using DataGlobals::WarmupFlag; using namespace DataLoopNode; @@ -3296,7 +3295,7 @@ namespace HeatRecovery { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: Real64 ReportingConstant; - ReportingConstant = TimeStepSys * SecInHour; + ReportingConstant = TimeStepSys * DataGlobalConstants::SecInHour(); ExchCond(ExNum).ElecUseEnergy = ExchCond(ExNum).ElecUseRate * ReportingConstant; ExchCond(ExNum).SensHeatingEnergy = ExchCond(ExNum).SensHeatingRate * ReportingConstant; ExchCond(ExNum).LatHeatingEnergy = ExchCond(ExNum).LatHeatingRate * ReportingConstant; diff --git a/src/EnergyPlus/HeatingCoils.cc b/src/EnergyPlus/HeatingCoils.cc index 8392dac0f3e..0f29c493416 100644 --- a/src/EnergyPlus/HeatingCoils.cc +++ b/src/EnergyPlus/HeatingCoils.cc @@ -2894,7 +2894,7 @@ namespace HeatingCoils { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: Real64 ReportingConstant; - ReportingConstant = TimeStepSys * SecInHour; + ReportingConstant = TimeStepSys * DataGlobalConstants::SecInHour(); // report the HeatingCoil energy from this component HeatingCoil(CoilNum).HeatingCoilRate = HeatingCoil(CoilNum).HeatingCoilLoad; HeatingCoil(CoilNum).HeatingCoilLoad *= ReportingConstant; diff --git a/src/EnergyPlus/HighTempRadiantSystem.cc b/src/EnergyPlus/HighTempRadiantSystem.cc index d2cb0528dee..7bf013d6faf 100644 --- a/src/EnergyPlus/HighTempRadiantSystem.cc +++ b/src/EnergyPlus/HighTempRadiantSystem.cc @@ -1436,7 +1436,6 @@ namespace HighTempRadiantSystem { // na // Using/Aliasing - using DataGlobals::SecInHour; using DataHVACGlobals::TimeStepSys; using DataSurfaces::Surface; @@ -1457,19 +1456,19 @@ namespace HighTempRadiantSystem { // FLOW: if (HighTempRadSys(RadSysNum).HeaterType == Gas) { HighTempRadSys(RadSysNum).GasPower = QHTRadSource(RadSysNum) / HighTempRadSys(RadSysNum).CombustionEffic; - HighTempRadSys(RadSysNum).GasEnergy = HighTempRadSys(RadSysNum).GasPower * TimeStepSys * SecInHour; + HighTempRadSys(RadSysNum).GasEnergy = HighTempRadSys(RadSysNum).GasPower * TimeStepSys * DataGlobalConstants::SecInHour(); HighTempRadSys(RadSysNum).ElecPower = 0.0; HighTempRadSys(RadSysNum).ElecEnergy = 0.0; } else if (HighTempRadSys(RadSysNum).HeaterType == Electric) { HighTempRadSys(RadSysNum).GasPower = 0.0; HighTempRadSys(RadSysNum).GasEnergy = 0.0; HighTempRadSys(RadSysNum).ElecPower = QHTRadSource(RadSysNum); - HighTempRadSys(RadSysNum).ElecEnergy = HighTempRadSys(RadSysNum).ElecPower * TimeStepSys * SecInHour; + HighTempRadSys(RadSysNum).ElecEnergy = HighTempRadSys(RadSysNum).ElecPower * TimeStepSys * DataGlobalConstants::SecInHour(); } else { ShowWarningError("Someone forgot to add a high temperature radiant heater type to the reporting subroutine"); } HighTempRadSys(RadSysNum).HeatPower = QHTRadSource(RadSysNum); - HighTempRadSys(RadSysNum).HeatEnergy = HighTempRadSys(RadSysNum).HeatPower * TimeStepSys * SecInHour; + HighTempRadSys(RadSysNum).HeatEnergy = HighTempRadSys(RadSysNum).HeatPower * TimeStepSys * DataGlobalConstants::SecInHour(); } Real64 SumHATsurf(int const ZoneNum) // Zone number diff --git a/src/EnergyPlus/Humidifiers.cc b/src/EnergyPlus/Humidifiers.cc index d680013c426..8c90c8725e9 100644 --- a/src/EnergyPlus/Humidifiers.cc +++ b/src/EnergyPlus/Humidifiers.cc @@ -106,7 +106,6 @@ namespace Humidifiers { using DataGlobals::BeginEnvrnFlag; using DataGlobals::DisplayExtraWarnings; using DataGlobals::ScheduleAlwaysOn; - using DataGlobals::SecInHour; using DataGlobals::SysSizingCalc; using namespace DataLoopNode; using DataEnvironment::OutBaroPress; @@ -1307,7 +1306,6 @@ namespace Humidifiers { // Using/Aliasing using DataGlobals::BeginTimeStepFlag; - using DataGlobals::SecInHour; using DataHVACGlobals::TimeStepSys; using DataWater::WaterStorage; @@ -1341,9 +1339,9 @@ namespace Humidifiers { TankSupplyVdot = AvailTankVdot; } - TankSupplyVol = TankSupplyVdot * (TimeStepSys * SecInHour); + TankSupplyVol = TankSupplyVdot * (TimeStepSys * DataGlobalConstants::SecInHour()); StarvedSupplyVdot = StarvedVdot; - StarvedSupplyVol = StarvedVdot * (TimeStepSys * SecInHour); + StarvedSupplyVol = StarvedVdot * (TimeStepSys * DataGlobalConstants::SecInHour()); } } @@ -1440,10 +1438,10 @@ namespace Humidifiers { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: // na - ElecUseEnergy = ElecUseRate * TimeStepSys * SecInHour; - WaterCons = WaterConsRate * TimeStepSys * SecInHour; - GasUseEnergy = GasUseRate * TimeStepSys * SecInHour; - AuxElecUseEnergy = AuxElecUseRate * TimeStepSys * SecInHour; + ElecUseEnergy = ElecUseRate * TimeStepSys * DataGlobalConstants::SecInHour(); + WaterCons = WaterConsRate * TimeStepSys * DataGlobalConstants::SecInHour(); + GasUseEnergy = GasUseRate * TimeStepSys * DataGlobalConstants::SecInHour(); + AuxElecUseEnergy = AuxElecUseRate * TimeStepSys * DataGlobalConstants::SecInHour(); } int GetAirInletNodeNum(EnergyPlusData &state, diff --git a/src/EnergyPlus/Humidifiers.hh b/src/EnergyPlus/Humidifiers.hh index 59b4aff3caf..0e2257b3d13 100644 --- a/src/EnergyPlus/Humidifiers.hh +++ b/src/EnergyPlus/Humidifiers.hh @@ -97,7 +97,6 @@ namespace Humidifiers { public: // Members std::string Name; // unique name of component - // CHARACTER(len=MaxNameLength) :: HumType =' ' ! Type of humidifier int HumType_Code; // Pointer to Humidifier in list of humidifiers int EquipIndex; // Pointer to Humidifier in list of humidifiers std::string Sched; // name of availability schedule diff --git a/src/EnergyPlus/HybridEvapCoolingModel.cc b/src/EnergyPlus/HybridEvapCoolingModel.cc index 800bcfa03da..1a5a327f31e 100644 --- a/src/EnergyPlus/HybridEvapCoolingModel.cc +++ b/src/EnergyPlus/HybridEvapCoolingModel.cc @@ -92,7 +92,6 @@ namespace HybridEvapCoolingModel { // USE STATEMENTS: // Use statements for data only modules // Using/Aliasing - using DataGlobals::SecInHour; using DataHVACGlobals::LimitNumSysSteps; using DataHVACGlobals::NumOfSysTimeSteps; using DataHVACGlobals::NumOfSysTimeStepsLastZoneTimeStep; @@ -1794,11 +1793,11 @@ namespace HybridEvapCoolingModel { Real64 LambdaRa = Psychrometrics::PsyHfgAirFnWTdb(0, InletTemp); RequestedHumdificationMass = OutputRequiredToHumidify; RequestedHumdificationLoad = OutputRequiredToHumidify * LambdaRa; // [W]; - RequestedHumdificationEnergy = OutputRequiredToHumidify * LambdaRa * TimeStepSys * SecInHour; // [j] + RequestedHumdificationEnergy = OutputRequiredToHumidify * LambdaRa * TimeStepSys * DataGlobalConstants::SecInHour(); // [j] RequestedDeHumdificationMass = OutputRequiredToDehumidify; RequestedDeHumdificationLoad = OutputRequiredToDehumidify * LambdaRa; // [W]; - RequestedDeHumdificationEnergy = OutputRequiredToDehumidify * LambdaRa * TimeStepSys * SecInHour; // [j] + RequestedDeHumdificationEnergy = OutputRequiredToDehumidify * LambdaRa * TimeStepSys * DataGlobalConstants::SecInHour(); // [j] MinOA_Msa = DesignMinVR; // as mass flow kg/s @@ -1935,19 +1934,19 @@ namespace HybridEvapCoolingModel { if (QTotZoneOut > 0) // zone cooling is positive, else remain zero { UnitTotalCoolingRate = std::abs(QTotZoneOut); // Watts - UnitTotalCoolingEnergy = UnitTotalCoolingRate * TimeStepSys * SecInHour; // J + UnitTotalCoolingEnergy = UnitTotalCoolingRate * TimeStepSys * DataGlobalConstants::SecInHour(); // J } else { UnitTotalHeatingRate = std::abs(QTotZoneOut); // Watts - UnitTotalHeatingEnergy = UnitTotalHeatingRate * TimeStepSys * SecInHour; // J + UnitTotalHeatingEnergy = UnitTotalHeatingRate * TimeStepSys * DataGlobalConstants::SecInHour(); // J } if (QSensZoneOut > 0) // zone cooling is positive, else remain zero { UnitSensibleCoolingRate = std::abs(QSensZoneOut); // Watts - UnitSensibleCoolingEnergy = UnitSensibleCoolingRate * TimeStepSys * SecInHour; // J + UnitSensibleCoolingEnergy = UnitSensibleCoolingRate * TimeStepSys * DataGlobalConstants::SecInHour(); // J } else { UnitSensibleHeatingRate = std::abs(QSensZoneOut); // Watts - UnitSensibleHeatingEnergy = UnitSensibleHeatingRate * TimeStepSys * SecInHour; // J + UnitSensibleHeatingEnergy = UnitSensibleHeatingRate * TimeStepSys * DataGlobalConstants::SecInHour(); // J } if ((UnitTotalCoolingRate - UnitSensibleCoolingRate) > 0) { @@ -1963,19 +1962,19 @@ namespace HybridEvapCoolingModel { if (QTotSystemOut > 0) // system cooling { SystemTotalCoolingRate = std::abs(QTotSystemOut); - SystemTotalCoolingEnergy = SystemTotalCoolingRate * TimeStepSys * SecInHour; + SystemTotalCoolingEnergy = SystemTotalCoolingRate * TimeStepSys * DataGlobalConstants::SecInHour(); } else { SystemTotalHeatingRate = std::abs(QTotSystemOut); - SystemTotalHeatingEnergy = SystemTotalHeatingRate * TimeStepSys * SecInHour; + SystemTotalHeatingEnergy = SystemTotalHeatingRate * TimeStepSys * DataGlobalConstants::SecInHour(); } if (QSensSystemOut > 0) // system sensible cooling { SystemSensibleCoolingRate = std::abs(QSensSystemOut); - SystemSensibleCoolingEnergy = SystemSensibleCoolingRate * TimeStepSys * SecInHour; + SystemSensibleCoolingEnergy = SystemSensibleCoolingRate * TimeStepSys * DataGlobalConstants::SecInHour(); } else { SystemSensibleHeatingRate = std::abs(QSensSystemOut); - SystemSensibleHeatingEnergy = SystemSensibleHeatingRate * TimeStepSys * SecInHour; + SystemSensibleHeatingEnergy = SystemSensibleHeatingRate * TimeStepSys * DataGlobalConstants::SecInHour(); } if ((SystemTotalCoolingRate - SystemSensibleCoolingRate) > 0) { SystemLatentCoolingRate = SystemTotalCoolingRate - SystemSensibleCoolingRate; @@ -2000,17 +1999,17 @@ namespace HybridEvapCoolingModel { // set timestep outputs calculated considering different runtime fractions. SupplyFanElectricPower = CalculateTimeStepAverage(SYSTEMOUTPUTS::OSUPPLY_FAN_POWER); // Watts - SupplyFanElectricEnergy = SupplyFanElectricPower * TimeStepSys * SecInHour; + SupplyFanElectricEnergy = SupplyFanElectricPower * TimeStepSys * DataGlobalConstants::SecInHour(); SecondaryFuelConsumptionRate = CalculateTimeStepAverage(SYSTEMOUTPUTS::OSECOND_FUEL_USE); - SecondaryFuelConsumption = SecondaryFuelConsumptionRate * TimeStepSys * SecInHour; + SecondaryFuelConsumption = SecondaryFuelConsumptionRate * TimeStepSys * DataGlobalConstants::SecInHour(); ThirdFuelConsumptionRate = CalculateTimeStepAverage(SYSTEMOUTPUTS::OTHIRD_FUEL_USE); - ThirdFuelConsumption = ThirdFuelConsumptionRate * TimeStepSys * SecInHour; + ThirdFuelConsumption = ThirdFuelConsumptionRate * TimeStepSys * DataGlobalConstants::SecInHour(); WaterConsumptionRate = CalculateTimeStepAverage(SYSTEMOUTPUTS::OWATER_USE); - WaterConsumption = WaterConsumptionRate * TimeStepSys * SecInHour; + WaterConsumption = WaterConsumptionRate * TimeStepSys * DataGlobalConstants::SecInHour(); ExternalStaticPressure = CalculateTimeStepAverage(SYSTEMOUTPUTS::OEXTERNAL_STATIC_PRESSURE); FinalElectricalPower = CalculateTimeStepAverage(SYSTEMOUTPUTS::SYSTEM_FUEL_USE); - FinalElectricalEnergy = FinalElectricalPower * TimeStepSys * SecInHour; + FinalElectricalEnergy = FinalElectricalPower * TimeStepSys * DataGlobalConstants::SecInHour(); } } // namespace HybridEvapCoolingModel diff --git a/src/EnergyPlus/ICEngineElectricGenerator.cc b/src/EnergyPlus/ICEngineElectricGenerator.cc index 66986640bde..e55b1b91793 100644 --- a/src/EnergyPlus/ICEngineElectricGenerator.cc +++ b/src/EnergyPlus/ICEngineElectricGenerator.cc @@ -617,19 +617,19 @@ namespace ICEngineElectricGenerator { // Calculate Energy // Generator output (J) - Real64 ElectricEnergyGen = elecPowerGenerated * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + Real64 ElectricEnergyGen = elecPowerGenerated * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); // IC ENGINE fuel use (J) - Real64 FuelEnergyUsed = fuelEnergyUseRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + Real64 FuelEnergyUsed = fuelEnergyUseRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); // water jacket heat recovered (J) - Real64 jacketEnergyRec = QJacketRec * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + Real64 jacketEnergyRec = QJacketRec * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); // lube oil cooler heat recovered (J) - Real64 lubeOilEnergyRec = QLubeOilRec * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + Real64 lubeOilEnergyRec = QLubeOilRec * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); // exhaust gas heat recovered (J) - Real64 exhaustEnergyRec = QExhaustRec * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + Real64 exhaustEnergyRec = QExhaustRec * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); this->ElecPowerGenerated = elecPowerGenerated; this->ElecEnergyGenerated = ElectricEnergyGen; this->QJacketRecovered = QJacketRec; diff --git a/src/EnergyPlus/IceThermalStorage.cc b/src/EnergyPlus/IceThermalStorage.cc index 16c3f11033f..24eef0d114b 100644 --- a/src/EnergyPlus/IceThermalStorage.cc +++ b/src/EnergyPlus/IceThermalStorage.cc @@ -866,7 +866,7 @@ namespace IceThermalStorage { // Get and Verify ITS nominal Capacity (user input is in GJ, internal value is in W-hr) // Convert GJ to J by multiplying by 10^9 // Convert J to W-hr by dividing by number of seconds in an hour (3600) - DetailedIceStorage(iceNum).NomCapacity = DataIPShortCuts::rNumericArgs(1) * (1.e+09) / (DataGlobals::SecInHour); + DetailedIceStorage(iceNum).NomCapacity = DataIPShortCuts::rNumericArgs(1) * (1.e+09) / (DataGlobalConstants::SecInHour()); if (DataIPShortCuts::rNumericArgs(1) <= 0.0) { ShowSevereError("Invalid " + DataIPShortCuts::cNumericFieldNames(1) + '=' + @@ -1472,7 +1472,7 @@ namespace IceThermalStorage { this->Urate = Uact; this->ITSCoolingRate = -Qice; - this->ITSCoolingEnergy = this->ITSCoolingRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->ITSCoolingEnergy = this->ITSCoolingRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); } //****************************************************************************** @@ -1616,7 +1616,7 @@ namespace IceThermalStorage { this->Urate = Uact; // Calculate ITSCoolingEnergy [J] this->ITSCoolingRate = -Qice; - this->ITSCoolingEnergy = this->ITSCoolingRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->ITSCoolingEnergy = this->ITSCoolingRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); } void SimpleIceStorageData::CalcQiceDischageMax(Real64 &QiceMin) @@ -1905,7 +1905,7 @@ namespace IceThermalStorage { if (this->InletTemp < this->OutletTemp) { // Charging Mode this->ChargingRate = this->CompLoad; - this->ChargingEnergy = this->CompLoad * (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + this->ChargingEnergy = this->CompLoad * (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); this->IceFracChange = this->CompLoad * DataHVACGlobals::TimeStepSys / this->NomCapacity; this->DischargingRate = 0.0; this->DischargingEnergy = 0.0; @@ -1915,7 +1915,7 @@ namespace IceThermalStorage { } else { // (DetailedIceStorage(IceNum)%InletTemp < DetailedIceStorage(IceNum)%OutletTemp) Discharging Mode this->DischargingRate = this->CompLoad; - this->DischargingEnergy = this->CompLoad * (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + this->DischargingEnergy = this->CompLoad * (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); this->IceFracChange = -this->CompLoad * DataHVACGlobals::TimeStepSys / this->NomCapacity; this->ChargingRate = 0.0; this->ChargingEnergy = 0.0; diff --git a/src/EnergyPlus/InputProcessing/InputProcessor.cc b/src/EnergyPlus/InputProcessing/InputProcessor.cc index 2da2948f081..c4b417ed0f4 100644 --- a/src/EnergyPlus/InputProcessing/InputProcessor.cc +++ b/src/EnergyPlus/InputProcessing/InputProcessor.cc @@ -1612,7 +1612,7 @@ void InputProcessor::preProcessorCheck(EnergyPlusData &state, bool &PreP_Fatal) " audit trail or error file for possible reasons."); } while (CountM <= NumAlphas) { - if (len(DataIPShortCuts::cAlphaArgs(CountM)) == DataGlobals::MaxNameLength) { + if (len(DataIPShortCuts::cAlphaArgs(CountM)) == DataGlobalConstants::MaxNameLength()) { ShowContinueError(DataIPShortCuts::cAlphaArgs(CountM) + DataIPShortCuts::cAlphaArgs(CountM + 1)); CountM += 2; } else { diff --git a/src/EnergyPlus/IntegratedHeatPump.cc b/src/EnergyPlus/IntegratedHeatPump.cc index 8f1b1b0b611..0a790ecf895 100644 --- a/src/EnergyPlus/IntegratedHeatPump.cc +++ b/src/EnergyPlus/IntegratedHeatPump.cc @@ -2161,7 +2161,7 @@ namespace IntegratedHeatPump { break; } - ReportingConstant = TimeStepSys * SecInHour; + ReportingConstant = TimeStepSys * DataGlobalConstants::SecInHour(); IntegratedHeatPumps(DXCoilNum).Energy = IntegratedHeatPumps(DXCoilNum).TotalPower * ReportingConstant; // total electric energy consumption // [J] @@ -2267,7 +2267,7 @@ namespace IntegratedHeatPump { WHHeatTimeSav = IntegratedHeatPumps(DXCoilNum).SHDWHRunTime; if (IHPOperationMode::SCDWHMode == IntegratedHeatPumps(DXCoilNum).CurMode) { WHHeatVolSave = IntegratedHeatPumps(DXCoilNum).WaterFlowAccumVol + Node(IntegratedHeatPumps(DXCoilNum).WaterTankoutNod).MassFlowRate / - 983.0 * TimeStepSys * SecInHour; // 983 - water density at 60 C + 983.0 * TimeStepSys * DataGlobalConstants::SecInHour(); // 983 - water density at 60 C } else { WHHeatVolSave = 0.0; } @@ -2314,7 +2314,7 @@ namespace IntegratedHeatPump { { IntegratedHeatPumps(DXCoilNum).CurMode = IHPOperationMode::DWHMode; } else if (SensLoad > SmallLoad) { - IntegratedHeatPumps(DXCoilNum).SHDWHRunTime = WHHeatTimeSav + TimeStepSys * SecInHour; + IntegratedHeatPumps(DXCoilNum).SHDWHRunTime = WHHeatTimeSav + TimeStepSys * DataGlobalConstants::SecInHour(); if (WHHeatTimeSav > IntegratedHeatPumps(DXCoilNum).TimeLimitSHDWH) { IntegratedHeatPumps(DXCoilNum).CurMode = IHPOperationMode::SHDWHElecHeatOnMode; diff --git a/src/EnergyPlus/LowTempRadiantSystem.cc b/src/EnergyPlus/LowTempRadiantSystem.cc index 24bad79b6db..a627f2a4faa 100644 --- a/src/EnergyPlus/LowTempRadiantSystem.cc +++ b/src/EnergyPlus/LowTempRadiantSystem.cc @@ -2344,7 +2344,7 @@ namespace LowTempRadiantSystem { // So, the day should be the previous day, the hour should bethe last hour of the // day, and the time step should be the last time step. this->lastDayOfSim = DataGlobals::DayOfSim - 1; - this->lastHourOfDay = int(DataGlobals::HoursInDay); + this->lastHourOfDay = int(DataGlobalConstants::HoursInDay()); this->lastTimeStep = DataGlobals::NumOfTimeStepInHour; } else if (DataGlobals::BeginHourFlag) { // It's not the beginning of the day but it is the beginning of an hour other than @@ -4891,12 +4891,12 @@ namespace LowTempRadiantSystem { Real64 ConstantFlowRadiantSystemData::calculateCurrentDailyAverageODB(EnergyPlusData& state) { Real64 sum = 0.0; - for (int hourNumber = 1; hourNumber <= DataGlobals::HoursInDay; ++hourNumber) { + for (int hourNumber = 1; hourNumber <= DataGlobalConstants::HoursInDay(); ++hourNumber) { for (int timeStepNumber = 1; timeStepNumber <= DataGlobals::NumOfTimeStepInHour; ++timeStepNumber) { sum += state.dataWeatherManager->TodayOutDryBulbTemp(timeStepNumber, hourNumber); } } - return sum / double(DataGlobals::HoursInDay * DataGlobals::NumOfTimeStepInHour); + return sum / double(DataGlobalConstants::HoursInDay() * DataGlobals::NumOfTimeStepInHour); } void ElectricRadiantSystemData::calculateLowTemperatureRadiantSystem(EnergyPlusData &state, @@ -5611,7 +5611,6 @@ namespace LowTempRadiantSystem { { // Using/Aliasing - using DataGlobals::SecInHour; using DataHeatBalance::Zone; using DataHVACGlobals::TimeStepSys; using DataLoopNode::Node; @@ -5644,11 +5643,11 @@ namespace LowTempRadiantSystem { this->WaterOutletTemp = this->WaterInletTemp; } - this->HeatEnergy = this->HeatPower * TimeStepSys * SecInHour; - this->CoolEnergy = this->CoolPower * TimeStepSys * SecInHour; + this->HeatEnergy = this->HeatPower * TimeStepSys * DataGlobalConstants::SecInHour(); + this->CoolEnergy = this->CoolPower * TimeStepSys * DataGlobalConstants::SecInHour(); if (this->CondCausedShutDown) { - this->CondCausedTimeOff = TimeStepSys * SecInHour; + this->CondCausedTimeOff = TimeStepSys * DataGlobalConstants::SecInHour(); } else { this->CondCausedTimeOff = 0.0; } @@ -5658,7 +5657,6 @@ namespace LowTempRadiantSystem { { // Using/Aliasing - using DataGlobals::SecInHour; using DataHeatBalance::Zone; using DataHVACGlobals::TimeStepSys; using DataLoopNode::Node; @@ -5717,13 +5715,13 @@ namespace LowTempRadiantSystem { this->PumpHeattoFluid = 0.0; } - this->HeatEnergy = this->HeatPower * TimeStepSys * SecInHour; - this->CoolEnergy = this->CoolPower * TimeStepSys * SecInHour; - this->PumpEnergy = this->PumpPower * TimeStepSys * SecInHour; - this->PumpHeattoFluidEnergy = this->PumpHeattoFluid * TimeStepSys * SecInHour; + this->HeatEnergy = this->HeatPower * TimeStepSys * DataGlobalConstants::SecInHour(); + this->CoolEnergy = this->CoolPower * TimeStepSys * DataGlobalConstants::SecInHour(); + this->PumpEnergy = this->PumpPower * TimeStepSys * DataGlobalConstants::SecInHour(); + this->PumpHeattoFluidEnergy = this->PumpHeattoFluid * TimeStepSys * DataGlobalConstants::SecInHour(); if (this->CondCausedShutDown) { - this->CondCausedTimeOff = TimeStepSys * SecInHour; + this->CondCausedTimeOff = TimeStepSys * DataGlobalConstants::SecInHour(); } else { this->CondCausedTimeOff = 0.0; } @@ -5733,7 +5731,6 @@ namespace LowTempRadiantSystem { { // Using/Aliasing - using DataGlobals::SecInHour; using DataHeatBalance::Zone; using DataHVACGlobals::TimeStepSys; @@ -5746,7 +5743,7 @@ namespace LowTempRadiantSystem { totalRadSysPower *= double(Zone(this->ZonePtr).Multiplier * Zone(this->ZonePtr).ListMultiplier); this->ElecPower = totalRadSysPower; - this->ElecEnergy = this->ElecPower * TimeStepSys * SecInHour; + this->ElecEnergy = this->ElecPower * TimeStepSys * DataGlobalConstants::SecInHour(); this->HeatPower = this->ElecPower; this->HeatEnergy = this->ElecEnergy; } diff --git a/src/EnergyPlus/MicroCHPElectricGenerator.cc b/src/EnergyPlus/MicroCHPElectricGenerator.cc index 648a1c37f8b..92c7a18c88a 100644 --- a/src/EnergyPlus/MicroCHPElectricGenerator.cc +++ b/src/EnergyPlus/MicroCHPElectricGenerator.cc @@ -1098,7 +1098,7 @@ namespace MicroCHPElectricGenerator { Qgenss = ThermEff * Qgross; // W } - Real64 dt = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + Real64 dt = DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); Teng = FuncDetermineEngineTemp( TcwOut, this->A42Model.MCeng, this->A42Model.UAhx, this->A42Model.UAskin, thisAmbientTemp, Qgenss, this->A42Model.TengLast, dt); @@ -1341,7 +1341,7 @@ namespace MicroCHPElectricGenerator { static std::string const RoutineName("UpdateMicroCHPGeneratorRecords"); this->A42Model.ACPowerGen = this->A42Model.Pnet; // electrical power produced [W] - this->A42Model.ACEnergyGen = this->A42Model.Pnet * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; // energy produced (J) + this->A42Model.ACEnergyGen = this->A42Model.Pnet * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); // energy produced (J) this->A42Model.QdotHX = this->A42Model.UAhx * (this->A42Model.Teng - this->A42Model.TcwOut); // heat recovered rate (W) Real64 Cp = FluidProperties::GetSpecificHeatGlycol( @@ -1349,7 +1349,7 @@ namespace MicroCHPElectricGenerator { this->A42Model.QdotHR = this->PlantMassFlowRate * Cp * (this->A42Model.TcwOut - this->A42Model.TcwIn); this->A42Model.TotalHeatEnergyRec = - this->A42Model.QdotHR * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; // heat recovered energy (J) + this->A42Model.QdotHR * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); // heat recovered energy (J) this->A42Model.HeatRecInletTemp = this->A42Model.TcwIn; // Heat Recovery Loop Inlet Temperature (C) this->A42Model.HeatRecOutletTemp = this->A42Model.TcwOut; // Heat Recovery Loop Outlet Temperature (C) @@ -1357,24 +1357,24 @@ namespace MicroCHPElectricGenerator { this->A42Model.FuelCompressPower = DataGenerators::FuelSupply(this->FuelSupplyID).PfuelCompEl; // electrical power used by fuel supply compressor [W] this->A42Model.FuelCompressEnergy = - DataGenerators::FuelSupply(this->FuelSupplyID).PfuelCompEl * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; // elect energy + DataGenerators::FuelSupply(this->FuelSupplyID).PfuelCompEl * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); // elect energy this->A42Model.FuelCompressSkinLoss = DataGenerators::FuelSupply(this->FuelSupplyID).QskinLoss; // heat rate of losses.by fuel supply compressor [W] this->A42Model.FuelEnergyHHV = this->A42Model.NdotFuel * DataGenerators::FuelSupply(this->FuelSupplyID).HHV * DataGenerators::FuelSupply(this->FuelSupplyID).KmolPerSecToKgPerSec * DataHVACGlobals::TimeStepSys * - DataGlobals::SecInHour; + DataGlobalConstants::SecInHour(); // reporting: Fuel Energy used (W) this->A42Model.FuelEnergyUseRateHHV = this->A42Model.NdotFuel * DataGenerators::FuelSupply(this->FuelSupplyID).HHV * DataGenerators::FuelSupply(this->FuelSupplyID).KmolPerSecToKgPerSec; // reporting: Fuel Energy used (J) this->A42Model.FuelEnergyLHV = this->A42Model.NdotFuel * DataGenerators::FuelSupply(this->FuelSupplyID).LHV * 1000000.0 * - DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); // reporting: Fuel Energy used (W) this->A42Model.FuelEnergyUseRateLHV = this->A42Model.NdotFuel * DataGenerators::FuelSupply(this->FuelSupplyID).LHV * 1000000.0; this->A42Model.SkinLossPower = this->A42Model.QdotConvZone + this->A42Model.QdotRadZone; this->A42Model.SkinLossEnergy = - (this->A42Model.QdotConvZone + this->A42Model.QdotRadZone) * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + (this->A42Model.QdotConvZone + this->A42Model.QdotRadZone) * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); this->A42Model.SkinLossConvect = this->A42Model.QdotConvZone; this->A42Model.SkinLossRadiat = this->A42Model.QdotRadZone; diff --git a/src/EnergyPlus/MicroturbineElectricGenerator.cc b/src/EnergyPlus/MicroturbineElectricGenerator.cc index 3654d8bfe10..b25ccc20174 100644 --- a/src/EnergyPlus/MicroturbineElectricGenerator.cc +++ b/src/EnergyPlus/MicroturbineElectricGenerator.cc @@ -1749,9 +1749,9 @@ namespace MicroturbineElectricGenerator { DataLoopNode::Node(this->CombustionAirInletNodeNum).MassFlowRateMinAvail; } - this->EnergyGen = this->ElecPowerGenerated * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - this->ExhaustEnergyRec = this->QHeatRecovered * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - this->FuelEnergyHHV = this->FuelEnergyUseRateHHV * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->EnergyGen = this->ElecPowerGenerated * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + this->ExhaustEnergyRec = this->QHeatRecovered * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + this->FuelEnergyHHV = this->FuelEnergyUseRateHHV * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); if (this->FuelEnergyUseRateLHV > 0.0) { this->ElectricEfficiencyLHV = this->ElecPowerGenerated / this->FuelEnergyUseRateLHV; this->ThermalEfficiencyLHV = this->QHeatRecovered / this->FuelEnergyUseRateLHV; @@ -1759,8 +1759,8 @@ namespace MicroturbineElectricGenerator { this->ElectricEfficiencyLHV = 0.0; this->ThermalEfficiencyLHV = 0.0; } - this->AncillaryEnergy = this->AncillaryPowerRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - this->StandbyEnergy = this->StandbyPowerRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->AncillaryEnergy = this->AncillaryPowerRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + this->StandbyEnergy = this->StandbyPowerRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); } } // namespace MicroturbineElectricGenerator diff --git a/src/EnergyPlus/OutdoorAirUnit.cc b/src/EnergyPlus/OutdoorAirUnit.cc index 76e52e810a3..96b6c3a2924 100644 --- a/src/EnergyPlus/OutdoorAirUnit.cc +++ b/src/EnergyPlus/OutdoorAirUnit.cc @@ -2690,7 +2690,6 @@ CurrentModuleObjects(CO_OAEqList), ComponentListName); // na // Using/Aliasing - using DataGlobals::SecInHour; using DataHeatBalance::Zone; using DataHVACGlobals::TimeStepSys; using DataLoopNode::Node; @@ -2711,14 +2710,14 @@ CurrentModuleObjects(CO_OAEqList), ComponentListName); // FLOW: - OutAirUnit(OAUnitNum).TotHeatingEnergy = OutAirUnit(OAUnitNum).TotHeatingRate * TimeStepSys * SecInHour; - OutAirUnit(OAUnitNum).SensHeatingEnergy = OutAirUnit(OAUnitNum).SensHeatingRate * TimeStepSys * SecInHour; - OutAirUnit(OAUnitNum).LatHeatingEnergy = OutAirUnit(OAUnitNum).LatHeatingRate * TimeStepSys * SecInHour; - OutAirUnit(OAUnitNum).SensCoolingEnergy = OutAirUnit(OAUnitNum).SensCoolingRate * TimeStepSys * SecInHour; - OutAirUnit(OAUnitNum).LatCoolingEnergy = OutAirUnit(OAUnitNum).LatCoolingRate * TimeStepSys * SecInHour; - OutAirUnit(OAUnitNum).TotCoolingEnergy = OutAirUnit(OAUnitNum).TotCoolingRate * TimeStepSys * SecInHour; + OutAirUnit(OAUnitNum).TotHeatingEnergy = OutAirUnit(OAUnitNum).TotHeatingRate * TimeStepSys * DataGlobalConstants::SecInHour(); + OutAirUnit(OAUnitNum).SensHeatingEnergy = OutAirUnit(OAUnitNum).SensHeatingRate * TimeStepSys * DataGlobalConstants::SecInHour(); + OutAirUnit(OAUnitNum).LatHeatingEnergy = OutAirUnit(OAUnitNum).LatHeatingRate * TimeStepSys * DataGlobalConstants::SecInHour(); + OutAirUnit(OAUnitNum).SensCoolingEnergy = OutAirUnit(OAUnitNum).SensCoolingRate * TimeStepSys * DataGlobalConstants::SecInHour(); + OutAirUnit(OAUnitNum).LatCoolingEnergy = OutAirUnit(OAUnitNum).LatCoolingRate * TimeStepSys * DataGlobalConstants::SecInHour(); + OutAirUnit(OAUnitNum).TotCoolingEnergy = OutAirUnit(OAUnitNum).TotCoolingRate * TimeStepSys * DataGlobalConstants::SecInHour(); OutAirUnit(OAUnitNum).AirMassFlow = OutAirUnit(OAUnitNum).OutAirMassFlow; - OutAirUnit(OAUnitNum).ElecFanEnergy = OutAirUnit(OAUnitNum).ElecFanRate * TimeStepSys * SecInHour; + OutAirUnit(OAUnitNum).ElecFanEnergy = OutAirUnit(OAUnitNum).ElecFanRate * TimeStepSys * DataGlobalConstants::SecInHour(); if (OutAirUnit(OAUnitNum).FirstPass) { // reset sizing flags so other zone equipment can size normally if (!DataGlobals::SysSizingCalc) { diff --git a/src/EnergyPlus/OutputProcessor.cc b/src/EnergyPlus/OutputProcessor.cc index a8f2826f366..d1d1059b42f 100644 --- a/src/EnergyPlus/OutputProcessor.cc +++ b/src/EnergyPlus/OutputProcessor.cc @@ -122,7 +122,6 @@ namespace OutputProcessor { using DataEnvironment::Year; using DataGlobals::DayOfSim; using DataGlobals::HourOfDay; - using DataGlobals::MaxNameLength; using DataGlobals::MinutesPerTimeStep; using DataGlobals::StdOutputRecordCount; using namespace DataGlobalConstants; diff --git a/src/EnergyPlus/OutputReportPredefined.hh b/src/EnergyPlus/OutputReportPredefined.hh index 427c7c5c42b..b28ced3a4fb 100644 --- a/src/EnergyPlus/OutputReportPredefined.hh +++ b/src/EnergyPlus/OutputReportPredefined.hh @@ -1043,8 +1043,6 @@ namespace OutputReportPredefined { struct ShadowRelateType { // Members - // CHARACTER(len=MaxNameLength) :: castSurf = '' - // CHARACTER(len=MaxNameLength) :: recSurf = '' int castSurf; int recSurf; int recKind; diff --git a/src/EnergyPlus/OutputReportTabular.cc b/src/EnergyPlus/OutputReportTabular.cc index 35b4f992761..c398e74ec83 100644 --- a/src/EnergyPlus/OutputReportTabular.cc +++ b/src/EnergyPlus/OutputReportTabular.cc @@ -169,14 +169,12 @@ namespace OutputReportTabular { // |--> MonthlyTable --> MonthlyColumns // Using/Aliasing - using DataGlobals::BigNumber; using DataGlobals::CurrentTime; using DataGlobals::DisplayExtraWarnings; using DataGlobals::DoOutputReporting; using DataGlobals::DoWeathSim; using DataGlobals::HourOfDay; using DataGlobals::NumOfZones; - using DataGlobals::SecInHour; using DataGlobals::TimeStep; using DataGlobals::TimeStepZone; using DataGlobals::TimeStepZoneSec; @@ -1098,8 +1096,6 @@ namespace OutputReportTabular { OutputProcessor::StoreType AvgSumVar; OutputProcessor::TimeStepType StepTypeVar; OutputProcessor::Unit UnitsVar(OutputProcessor::Unit::None); // Units enum - // CHARACTER(len=MaxNameLength), DIMENSION(:), ALLOCATABLE :: NamesOfKeys ! Specific key name - // INTEGER, DIMENSION(:) , ALLOCATABLE :: IndexesForKeyVar ! Array index Array1D_string UniqueKeyNames; int UniqueKeyCount; int iKey; @@ -4013,7 +4009,7 @@ namespace OutputReportTabular { elapsedTime = TimeStepZone; } if (OutputTableBinned(iInObj).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable - curValue /= (elapsedTime * SecInHour); + curValue /= (elapsedTime * DataGlobalConstants::SecInHour()); } // round the value to the number of signficant digits used in the final output report if (curIntervalSize < 1) { @@ -4203,7 +4199,7 @@ namespace OutputReportTabular { // per MJW when a summed variable is used divide it by the length of the time step if (MonthlyColumns(curCol).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepSystem) { - curValue /= (TimeStepSys * SecInHour); + curValue /= (TimeStepSys * DataGlobalConstants::SecInHour()); } else { curValue /= TimeStepZoneSec; } @@ -4220,7 +4216,7 @@ namespace OutputReportTabular { // per MJW when a summed variable is used divide it by the length of the time step if (MonthlyColumns(curCol).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepSystem) { - curValue /= (TimeStepSys * SecInHour); + curValue /= (TimeStepSys * DataGlobalConstants::SecInHour()); } else { curValue /= TimeStepZoneSec; } @@ -4317,7 +4313,7 @@ namespace OutputReportTabular { // When a summed variable is used divide it by the length of the time step if (MonthlyColumns(scanColumn).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepSystem) { - scanValue /= (TimeStepSys * SecInHour); + scanValue /= (TimeStepSys * DataGlobalConstants::SecInHour()); } else { scanValue /= TimeStepZoneSec; } @@ -4361,7 +4357,7 @@ namespace OutputReportTabular { } else if (SELECT_CASE_var == aggTypeMaximumDuringHoursShown) { if (MonthlyColumns(scanColumn).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepSystem) { - scanValue /= (TimeStepSys * SecInHour); + scanValue /= (TimeStepSys * DataGlobalConstants::SecInHour()); } else { scanValue /= TimeStepZoneSec; } @@ -4373,7 +4369,7 @@ namespace OutputReportTabular { } else if (SELECT_CASE_var == aggTypeMinimumDuringHoursShown) { if (MonthlyColumns(scanColumn).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepSystem) { - scanValue /= (TimeStepSys * SecInHour); + scanValue /= (TimeStepSys * DataGlobalConstants::SecInHour()); } else { scanValue /= TimeStepZoneSec; } @@ -4910,7 +4906,7 @@ namespace OutputReportTabular { static Real64 H2OHtOfVap_HVAC = Psychrometrics::PsyHgAirFnWTdb(DataEnvironment::OutHumRat, DataEnvironment::OutDryBulbTemp); static Real64 RhoWater = Psychrometrics::RhoH2O(DataEnvironment::OutDryBulbTemp); - Real64 TimeStepSysSec = TimeStepSys * SecInHour; + Real64 TimeStepSysSec = TimeStepSys * DataGlobalConstants::SecInHour(); SysTotalHVACReliefHeatLoss = 0; SysTotalHVACRejectHeatLoss = 0; @@ -5224,16 +5220,16 @@ namespace OutputReportTabular { Real64 ZoneEqHeatorCool = ZnAirRpt(iZone).SumMCpDTsystem + ZnAirRpt(iZone).SumNonAirSystem * mult - ATUHeat(iZone) - ATUCool(iZone); if (ZoneEqHeatorCool > 0.0) { - ZonePreDefRep(iZone).SHGSAnZoneEqHt += ZoneEqHeatorCool * TimeStepSys * SecInHour; + ZonePreDefRep(iZone).SHGSAnZoneEqHt += ZoneEqHeatorCool * TimeStepSys * DataGlobalConstants::SecInHour(); } else { - ZonePreDefRep(iZone).SHGSAnZoneEqCl += ZoneEqHeatorCool * TimeStepSys * SecInHour; + ZonePreDefRep(iZone).SHGSAnZoneEqCl += ZoneEqHeatorCool * TimeStepSys * DataGlobalConstants::SecInHour(); } // Interzone Air Transfer Heat Addition // Interzone Air Transfer Heat Removal if (ZnAirRpt(iZone).SumMCpDTzones > 0.0) { - ZonePreDefRep(iZone).SHGSAnIzaAdd += ZnAirRpt(iZone).SumMCpDTzones * mult * TimeStepSys * SecInHour; + ZonePreDefRep(iZone).SHGSAnIzaAdd += ZnAirRpt(iZone).SumMCpDTzones * mult * TimeStepSys * DataGlobalConstants::SecInHour(); } else { - ZonePreDefRep(iZone).SHGSAnIzaRem += ZnAirRpt(iZone).SumMCpDTzones * mult * TimeStepSys * SecInHour; + ZonePreDefRep(iZone).SHGSAnIzaRem += ZnAirRpt(iZone).SumMCpDTzones * mult * TimeStepSys * DataGlobalConstants::SecInHour(); } // Window Heat Addition // Window Heat Removal @@ -5242,9 +5238,9 @@ namespace OutputReportTabular { // Infiltration Heat Addition // Infiltration Heat Removal if (ZnAirRpt(iZone).SumMCpDtInfil > 0.0) { - ZonePreDefRep(iZone).SHGSAnInfilAdd += ZnAirRpt(iZone).SumMCpDtInfil * mult * TimeStepSys * SecInHour; + ZonePreDefRep(iZone).SHGSAnInfilAdd += ZnAirRpt(iZone).SumMCpDtInfil * mult * TimeStepSys * DataGlobalConstants::SecInHour(); } else { - ZonePreDefRep(iZone).SHGSAnInfilRem += ZnAirRpt(iZone).SumMCpDtInfil * mult * TimeStepSys * SecInHour; + ZonePreDefRep(iZone).SHGSAnInfilRem += ZnAirRpt(iZone).SumMCpDtInfil * mult * TimeStepSys * DataGlobalConstants::SecInHour(); } // Equipment Sensible Heat Addition // Equipment Sensible Heat Removal @@ -6489,7 +6485,7 @@ namespace OutputReportTabular { } // full load hours per week if ((Lights(iLight).DesignLevel * gatherElapsedTimeBEPS) > 0) { - HrsPerWeek = 24 * 7 * Lights(iLight).SumConsumption / (Lights(iLight).DesignLevel * gatherElapsedTimeBEPS * SecInHour); + HrsPerWeek = 24 * 7 * Lights(iLight).SumConsumption / (Lights(iLight).DesignLevel * gatherElapsedTimeBEPS * DataGlobalConstants::SecInHour()); PreDefTableEntry(pdchInLtFullLoadHrs, Lights(iLight).Name, HrsPerWeek); } PreDefTableEntry(pdchInLtConsump, Lights(iLight).Name, Lights(iLight).SumConsumption * mult / 1000000000.0); @@ -6513,7 +6509,7 @@ namespace OutputReportTabular { // full load hours per week if ((state.dataExteriorEnergyUse->ExteriorLights(iLight).DesignLevel * gatherElapsedTimeBEPS) > 0) { HrsPerWeek = - 24 * 7 * state.dataExteriorEnergyUse->ExteriorLights(iLight).SumConsumption / (state.dataExteriorEnergyUse->ExteriorLights(iLight).DesignLevel * gatherElapsedTimeBEPS * SecInHour); + 24 * 7 * state.dataExteriorEnergyUse->ExteriorLights(iLight).SumConsumption / (state.dataExteriorEnergyUse->ExteriorLights(iLight).DesignLevel * gatherElapsedTimeBEPS * DataGlobalConstants::SecInHour()); PreDefTableEntry(pdchExLtFullLoadHrs, state.dataExteriorEnergyUse->ExteriorLights(iLight).Name, HrsPerWeek); } PreDefTableEntry(pdchExLtConsump, state.dataExteriorEnergyUse->ExteriorLights(iLight).Name, state.dataExteriorEnergyUse->ExteriorLights(iLight).SumConsumption / 1000000000.0); @@ -7243,7 +7239,6 @@ namespace OutputReportTabular { Real64 aboveTotal; Real64 belowTotal; Real64 tableTotal; - // CHARACTER(len=MaxNameLength):: repNameWithUnits ! For time bin reports, varible name with units std::string repNameWithUnitsandscheduleName; Real64 repStDev; // standard deviation Real64 repMean; @@ -11922,10 +11917,8 @@ namespace OutputReportTabular { Array1D_int columnWidth(1); Array1D_string rowHead; Array2D_string tableBody; - // CHARACTER(len=MaxNameLength),ALLOCATABLE, DIMENSION(:) :: unique Array1D_int unique; int numUnique; - // CHARACTER(len=MaxNameLength) :: curRecSurf int curRecSurf; std::string listOfSurf; int iShadRel; @@ -12670,14 +12663,14 @@ namespace OutputReportTabular { TimeStepInDay = (HourOfDay - 1) * NumOfTimeStepInHour + TimeStep; for (iZone = 1; iZone <= NumOfZones; ++iZone) { infilInstantSeq(CurOverallSimDay, TimeStepInDay, iZone) = - ((ZnAirRpt(iZone).InfilHeatGain - ZnAirRpt(iZone).InfilHeatLoss) / (TimeStepSys * SecInHour)); // zone infiltration + ((ZnAirRpt(iZone).InfilHeatGain - ZnAirRpt(iZone).InfilHeatLoss) / (TimeStepSys * DataGlobalConstants::SecInHour())); // zone infiltration if (AirflowNetwork::SimulateAirflowNetwork > AirflowNetwork::AirflowNetworkControlSimple) { infilInstantSeq(CurOverallSimDay, TimeStepInDay, iZone) += (AirflowNetwork::AirflowNetworkReportData(iZone).MultiZoneInfiSenGainW - AirflowNetwork::AirflowNetworkReportData(iZone).MultiZoneInfiSenLossW); // air flow network } infilLatentSeq(CurOverallSimDay, TimeStepInDay, iZone) = - ((ZnAirRpt(iZone).InfilLatentGain - ZnAirRpt(iZone).InfilLatentLoss) / (TimeStepSys * SecInHour)); // zone infiltration + ((ZnAirRpt(iZone).InfilLatentGain - ZnAirRpt(iZone).InfilLatentLoss) / (TimeStepSys * DataGlobalConstants::SecInHour())); // zone infiltration if (AirflowNetwork::SimulateAirflowNetwork > AirflowNetwork::AirflowNetworkControlSimple) { infilLatentSeq(CurOverallSimDay, TimeStepInDay, iZone) += (AirflowNetwork::AirflowNetworkReportData(iZone).MultiZoneInfiLatGainW - @@ -12685,14 +12678,14 @@ namespace OutputReportTabular { } zoneVentInstantSeq(CurOverallSimDay, TimeStepInDay, iZone) = - ((ZnAirRpt(iZone).VentilHeatGain - ZnAirRpt(iZone).VentilHeatLoss) / (TimeStepSys * SecInHour)); // zone ventilation + ((ZnAirRpt(iZone).VentilHeatGain - ZnAirRpt(iZone).VentilHeatLoss) / (TimeStepSys * DataGlobalConstants::SecInHour())); // zone ventilation if (AirflowNetwork::SimulateAirflowNetwork > AirflowNetwork::AirflowNetworkControlSimple) { zoneVentInstantSeq(CurOverallSimDay, TimeStepInDay, iZone) += (AirflowNetwork::AirflowNetworkReportData(iZone).MultiZoneVentSenGainW - AirflowNetwork::AirflowNetworkReportData(iZone).MultiZoneVentSenLossW); // air flow network } zoneVentLatentSeq(CurOverallSimDay, TimeStepInDay, iZone) = - ((ZnAirRpt(iZone).VentilLatentGain - ZnAirRpt(iZone).VentilLatentLoss) / (TimeStepSys * SecInHour)); // zone ventilation + ((ZnAirRpt(iZone).VentilLatentGain - ZnAirRpt(iZone).VentilLatentLoss) / (TimeStepSys * DataGlobalConstants::SecInHour())); // zone ventilation if (AirflowNetwork::SimulateAirflowNetwork > AirflowNetwork::AirflowNetworkControlSimple) { zoneVentInstantSeq(CurOverallSimDay, TimeStepInDay, iZone) += (AirflowNetwork::AirflowNetworkReportData(iZone).MultiZoneVentLatGainW - @@ -12700,14 +12693,14 @@ namespace OutputReportTabular { } interZoneMixInstantSeq(CurOverallSimDay, TimeStepInDay, iZone) = - ((ZnAirRpt(iZone).MixHeatGain - ZnAirRpt(iZone).MixHeatLoss) / (TimeStepSys * SecInHour)); // zone mixing + ((ZnAirRpt(iZone).MixHeatGain - ZnAirRpt(iZone).MixHeatLoss) / (TimeStepSys * DataGlobalConstants::SecInHour())); // zone mixing if (AirflowNetwork::SimulateAirflowNetwork > AirflowNetwork::AirflowNetworkControlSimple) { interZoneMixInstantSeq(CurOverallSimDay, TimeStepInDay, iZone) += (AirflowNetwork::AirflowNetworkReportData(iZone).MultiZoneMixSenGainW - AirflowNetwork::AirflowNetworkReportData(iZone).MultiZoneMixSenLossW); // air flow network } interZoneMixLatentSeq(CurOverallSimDay, TimeStepInDay, iZone) = - ((ZnAirRpt(iZone).MixLatentGain - ZnAirRpt(iZone).MixLatentLoss) / (TimeStepSys * SecInHour)); // zone mixing + ((ZnAirRpt(iZone).MixLatentGain - ZnAirRpt(iZone).MixLatentLoss) / (TimeStepSys * DataGlobalConstants::SecInHour())); // zone mixing if (AirflowNetwork::SimulateAirflowNetwork > AirflowNetwork::AirflowNetworkControlSimple) { interZoneMixLatentSeq(CurOverallSimDay, TimeStepInDay, iZone) += (AirflowNetwork::AirflowNetworkReportData(iZone).MultiZoneMixLatGainW - diff --git a/src/EnergyPlus/OutputReportTabularAnnual.cc b/src/EnergyPlus/OutputReportTabularAnnual.cc index 6aaffc07bd4..efb4d6e0513 100644 --- a/src/EnergyPlus/OutputReportTabularAnnual.cc +++ b/src/EnergyPlus/OutputReportTabularAnnual.cc @@ -616,7 +616,7 @@ namespace OutputReportTabularAnnual { { Real64 secondsInTimeStep; if (kindOfTimeStep == OutputProcessor::TimeStepType::TimeStepZone) { - secondsInTimeStep = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + secondsInTimeStep = DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); } else { secondsInTimeStep = DataGlobals::TimeStepZoneSec; } diff --git a/src/EnergyPlus/OutsideEnergySources.cc b/src/EnergyPlus/OutsideEnergySources.cc index f82ebab8baf..0bd8f162850 100644 --- a/src/EnergyPlus/OutsideEnergySources.cc +++ b/src/EnergyPlus/OutsideEnergySources.cc @@ -527,7 +527,7 @@ namespace OutsideEnergySources { int const OutletNode = this->OutletNodeNum; DataLoopNode::Node(OutletNode).Temp = this->OutletTemp; this->EnergyRate = std::abs(MyLoad); - this->EnergyTransfer = this->EnergyRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->EnergyTransfer = this->EnergyRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); } } // namespace OutsideEnergySources diff --git a/src/EnergyPlus/PVWatts.cc b/src/EnergyPlus/PVWatts.cc index 55c395af23e..751e173ede6 100644 --- a/src/EnergyPlus/PVWatts.cc +++ b/src/EnergyPlus/PVWatts.cc @@ -374,14 +374,13 @@ namespace PVWatts { void PVWattsGenerator::calc(EnergyPlusData& state) { using DataGlobals::HourOfDay; - using DataGlobals::SecInHour; using DataGlobals::TimeStep; using DataGlobals::TimeStepZone; using DataHVACGlobals::TimeStepSys; // We only run this once for each zone time step. if (!DataGlobals::BeginTimeStepFlag) { - m_outputDCEnergy = m_outputDCPower * TimeStepSys * SecInHour; + m_outputDCEnergy = m_outputDCPower * TimeStepSys * DataGlobalConstants::SecInHour(); return; } @@ -422,7 +421,7 @@ namespace PVWatts { m_cellTemperature = pwr_st.pvt; m_planeOfArrayIrradiance = pwr_st.poa; m_outputDCPower = pwr_st.dc; - m_outputDCEnergy = m_outputDCPower * TimeStepSys * SecInHour; + m_outputDCEnergy = m_outputDCPower * TimeStepSys * DataGlobalConstants::SecInHour(); } void PVWattsGenerator::getResults(Real64 &GeneratorPower, Real64 &GeneratorEnergy, Real64 &ThermalPower, Real64 &ThermalEnergy) diff --git a/src/EnergyPlus/PackagedTerminalHeatPump.cc b/src/EnergyPlus/PackagedTerminalHeatPump.cc index 4fd8e55ea9d..059adbd38f1 100644 --- a/src/EnergyPlus/PackagedTerminalHeatPump.cc +++ b/src/EnergyPlus/PackagedTerminalHeatPump.cc @@ -145,7 +145,6 @@ namespace PackagedTerminalHeatPump { using DataGlobals::DisplayExtraWarnings; using DataGlobals::NumOfZones; using DataGlobals::ScheduleAlwaysOn; - using DataGlobals::SecInHour; using DataGlobals::SysSizingCalc; using namespace DataHVACGlobals; using DXCoils::DXCoilPartLoadRatio; @@ -6861,7 +6860,7 @@ namespace PackagedTerminalHeatPump { // FLOW - ReportingConstant = TimeStepSys * SecInHour; + ReportingConstant = TimeStepSys * DataGlobalConstants::SecInHour(); PTUnit(PTUnitNum).TotCoolEnergy = PTUnit(PTUnitNum).TotCoolEnergyRate * ReportingConstant; PTUnit(PTUnitNum).TotHeatEnergy = PTUnit(PTUnitNum).TotHeatEnergyRate * ReportingConstant; PTUnit(PTUnitNum).SensCoolEnergy = PTUnit(PTUnitNum).SensCoolEnergyRate * ReportingConstant; diff --git a/src/EnergyPlus/PackagedThermalStorageCoil.cc b/src/EnergyPlus/PackagedThermalStorageCoil.cc index 05135c9d3c1..25593d88c7d 100644 --- a/src/EnergyPlus/PackagedThermalStorageCoil.cc +++ b/src/EnergyPlus/PackagedThermalStorageCoil.cc @@ -2110,7 +2110,6 @@ namespace PackagedThermalStorageCoil { using DataEnvironment::StdRhoAir; using namespace OutputReportPredefined; using CurveManager::CurveValue; - using DataGlobals::SecInHour; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; @@ -2335,11 +2334,11 @@ namespace PackagedThermalStorageCoil { state, TESCoil(TESCoilNum).StorageFluidName, DataGlobals::CWInitConvTemp, TESCoil(TESCoilNum).StorageFluidIndex, calcTESWaterStorageTank); if (TESCoil(TESCoilNum).DischargeOnlyRatedDischargeCap > 0.0 && TESCoil(TESCoilNum).DischargeOnlyModeAvailable) { TESCoil(TESCoilNum).FluidStorageVolume = - (TESCoil(TESCoilNum).DischargeOnlyRatedDischargeCap * TESCoil(TESCoilNum).StorageCapacitySizingFactor * SecInHour) / + (TESCoil(TESCoilNum).DischargeOnlyRatedDischargeCap * TESCoil(TESCoilNum).StorageCapacitySizingFactor * DataGlobalConstants::SecInHour()) / (rho * Cp * deltaT); } else { TESCoil(TESCoilNum).FluidStorageVolume = - (TESCoil(TESCoilNum).CoolingOnlyRatedTotCap * TESCoil(TESCoilNum).StorageCapacitySizingFactor * SecInHour) / (rho * Cp * deltaT); + (TESCoil(TESCoilNum).CoolingOnlyRatedTotCap * TESCoil(TESCoilNum).StorageCapacitySizingFactor * DataGlobalConstants::SecInHour()) / (rho * Cp * deltaT); } BaseSizer::reportSizerOutput("Coil:Cooling:DX:SingleSpeed:ThermalStorage", TESCoil(TESCoilNum).Name, @@ -2350,10 +2349,10 @@ namespace PackagedThermalStorageCoil { if (TESCoil(TESCoilNum).DischargeOnlyRatedDischargeCap > 0.0 && TESCoil(TESCoilNum).DischargeOnlyModeAvailable) { TESCoil(TESCoilNum).IceStorageCapacity = - TESCoil(TESCoilNum).DischargeOnlyRatedDischargeCap * TESCoil(TESCoilNum).StorageCapacitySizingFactor * SecInHour; + TESCoil(TESCoilNum).DischargeOnlyRatedDischargeCap * TESCoil(TESCoilNum).StorageCapacitySizingFactor * DataGlobalConstants::SecInHour(); } else { TESCoil(TESCoilNum).IceStorageCapacity = - TESCoil(TESCoilNum).CoolingOnlyRatedTotCap * TESCoil(TESCoilNum).StorageCapacitySizingFactor * SecInHour; + TESCoil(TESCoilNum).CoolingOnlyRatedTotCap * TESCoil(TESCoilNum).StorageCapacitySizingFactor * DataGlobalConstants::SecInHour(); } BaseSizer::reportSizerOutput("Coil:Cooling:DX:SingleSpeed:ThermalStorage", TESCoil(TESCoilNum).Name, @@ -2426,7 +2425,7 @@ namespace PackagedThermalStorageCoil { } TESCoil(TESCoilNum).ElecCoolingPower = StandbyAncillaryPower; - TESCoil(TESCoilNum).ElecCoolingEnergy = StandbyAncillaryPower * TimeStepSys * SecInHour; + TESCoil(TESCoilNum).ElecCoolingEnergy = StandbyAncillaryPower * TimeStepSys * DataGlobalConstants::SecInHour(); Node(TESCoil(TESCoilNum).EvapAirOutletNodeNum).Temp = Node(TESCoil(TESCoilNum).EvapAirInletNodeNum).Temp; Node(TESCoil(TESCoilNum).EvapAirOutletNodeNum).HumRat = Node(TESCoil(TESCoilNum).EvapAirInletNodeNum).HumRat; @@ -2712,25 +2711,25 @@ namespace PackagedThermalStorageCoil { Node(TESCoil(TESCoilNum).CondAirOutletNodeNum).Enthalpy = CondOutletEnthalpy; TESCoil(TESCoilNum).ElecCoolingPower = ElecCoolingPower + TESCoil(TESCoilNum).AncillaryControlsPower; - TESCoil(TESCoilNum).ElecCoolingEnergy = TESCoil(TESCoilNum).ElecCoolingPower * TimeStepSys * SecInHour; + TESCoil(TESCoilNum).ElecCoolingEnergy = TESCoil(TESCoilNum).ElecCoolingPower * TimeStepSys * DataGlobalConstants::SecInHour(); TESCoil(TESCoilNum).RuntimeFraction = RuntimeFraction; TESCoil(TESCoilNum).CondenserRuntimeFraction = RuntimeFraction; TESCoil(TESCoilNum).EvapTotCoolingRate = TotCap * RuntimeFraction; // double check this - TESCoil(TESCoilNum).EvapTotCoolingEnergy = TotCap * RuntimeFraction * TimeStepSys * SecInHour; + TESCoil(TESCoilNum).EvapTotCoolingEnergy = TotCap * RuntimeFraction * TimeStepSys * DataGlobalConstants::SecInHour(); MinAirHumRat = min(Node(TESCoil(TESCoilNum).EvapAirOutletNodeNum).HumRat, Node(TESCoil(TESCoilNum).EvapAirInletNodeNum).HumRat); TESCoil(TESCoilNum).EvapSensCoolingRate = EvapAirMassFlow * (PsyHFnTdbW(EvapInletDryBulb, MinAirHumRat) - PsyHFnTdbW(EvapOutletAirTemp, MinAirHumRat)); if (TESCoil(TESCoilNum).EvapSensCoolingRate > TESCoil(TESCoilNum).EvapTotCoolingRate) { TESCoil(TESCoilNum).EvapSensCoolingRate = TESCoil(TESCoilNum).EvapTotCoolingRate; } - TESCoil(TESCoilNum).EvapSensCoolingEnergy = TESCoil(TESCoilNum).EvapSensCoolingRate * TimeStepSys * SecInHour; + TESCoil(TESCoilNum).EvapSensCoolingEnergy = TESCoil(TESCoilNum).EvapSensCoolingRate * TimeStepSys * DataGlobalConstants::SecInHour(); TESCoil(TESCoilNum).EvapLatCoolingRate = TESCoil(TESCoilNum).EvapTotCoolingRate - TESCoil(TESCoilNum).EvapSensCoolingRate; - TESCoil(TESCoilNum).EvapLatCoolingEnergy = TESCoil(TESCoilNum).EvapLatCoolingRate * TimeStepSys * SecInHour; + TESCoil(TESCoilNum).EvapLatCoolingEnergy = TESCoil(TESCoilNum).EvapLatCoolingRate * TimeStepSys * DataGlobalConstants::SecInHour(); } else { // coil is off; just pass through conditions TESCoil(TESCoilNum).ElecCoolingPower = TESCoil(TESCoilNum).AncillaryControlsPower; - TESCoil(TESCoilNum).ElecCoolingEnergy = TESCoil(TESCoilNum).ElecCoolingPower * TimeStepSys * SecInHour; + TESCoil(TESCoilNum).ElecCoolingEnergy = TESCoil(TESCoilNum).ElecCoolingPower * TimeStepSys * DataGlobalConstants::SecInHour(); TESCoil(TESCoilNum).RuntimeFraction = 0.0; TESCoil(TESCoilNum).CondenserRuntimeFraction = 0.0; Node(TESCoil(TESCoilNum).EvapAirOutletNodeNum).Temp = Node(TESCoil(TESCoilNum).EvapAirInletNodeNum).Temp; @@ -2922,7 +2921,7 @@ namespace PackagedThermalStorageCoil { TankMass = rho * TESCoil(TESCoilNum).FluidStorageVolume; CpTank = GetSpecificHeatGlycol(state, TESCoil(TESCoilNum).StorageFluidName, sTES, TESCoil(TESCoilNum).StorageFluidIndex, RoutineName); // simple linear approximation of DT/Dt term in McpDT/Dt - QdotChargeLimit = TankMass * CpTank * (sTES - TESCoil(TESCoilNum).MinimumFluidTankTempLimit) / (TimeStepSys * SecInHour); + QdotChargeLimit = TankMass * CpTank * (sTES - TESCoil(TESCoilNum).MinimumFluidTankTempLimit) / (TimeStepSys * DataGlobalConstants::SecInHour()); } else { TESCanBeCharged = false; } @@ -2931,7 +2930,7 @@ namespace PackagedThermalStorageCoil { if (sTES < 1.0) { TESCanBeCharged = true; // find charge limit to reach limit - QdotChargeLimit = (1.0 - sTES) * TESCoil(TESCoilNum).IceStorageCapacity / (TimeStepSys * SecInHour); + QdotChargeLimit = (1.0 - sTES) * TESCoil(TESCoilNum).IceStorageCapacity / (TimeStepSys * DataGlobalConstants::SecInHour()); } else { TESCanBeCharged = false; } @@ -3093,7 +3092,7 @@ namespace PackagedThermalStorageCoil { Node(TESCoil(TESCoilNum).CondAirOutletNodeNum).Enthalpy = CondOutletEnthalpy; TESCoil(TESCoilNum).ElecCoolingPower = EvapElecCoolingPower + ChargeElectricCoolingPower + TESCoil(TESCoilNum).AncillaryControlsPower; - TESCoil(TESCoilNum).ElecCoolingEnergy = TESCoil(TESCoilNum).ElecCoolingPower * TimeStepSys * SecInHour; + TESCoil(TESCoilNum).ElecCoolingEnergy = TESCoil(TESCoilNum).ElecCoolingPower * TimeStepSys * DataGlobalConstants::SecInHour(); TESCoil(TESCoilNum).RuntimeFraction = EvapRuntimeFraction; if (ChargeRuntimeFraction > 0.0) { @@ -3103,16 +3102,16 @@ namespace PackagedThermalStorageCoil { } TESCoil(TESCoilNum).EvapTotCoolingRate = EvapTotCap * EvapRuntimeFraction; // double check this - TESCoil(TESCoilNum).EvapTotCoolingEnergy = EvapTotCap * EvapRuntimeFraction * TimeStepSys * SecInHour; + TESCoil(TESCoilNum).EvapTotCoolingEnergy = EvapTotCap * EvapRuntimeFraction * TimeStepSys * DataGlobalConstants::SecInHour(); MinAirHumRat = min(Node(TESCoil(TESCoilNum).EvapAirOutletNodeNum).HumRat, Node(TESCoil(TESCoilNum).EvapAirInletNodeNum).HumRat); TESCoil(TESCoilNum).EvapSensCoolingRate = EvapAirMassFlow * (PsyHFnTdbW(EvapInletDryBulb, MinAirHumRat) - PsyHFnTdbW(EvapOutletAirTemp, MinAirHumRat)); if (TESCoil(TESCoilNum).EvapSensCoolingRate > TESCoil(TESCoilNum).EvapTotCoolingRate) { TESCoil(TESCoilNum).EvapSensCoolingRate = TESCoil(TESCoilNum).EvapTotCoolingRate; } - TESCoil(TESCoilNum).EvapSensCoolingEnergy = TESCoil(TESCoilNum).EvapSensCoolingRate * TimeStepSys * SecInHour; + TESCoil(TESCoilNum).EvapSensCoolingEnergy = TESCoil(TESCoilNum).EvapSensCoolingRate * TimeStepSys * DataGlobalConstants::SecInHour(); TESCoil(TESCoilNum).EvapLatCoolingRate = TESCoil(TESCoilNum).EvapTotCoolingRate - TESCoil(TESCoilNum).EvapSensCoolingRate; - TESCoil(TESCoilNum).EvapLatCoolingEnergy = TESCoil(TESCoilNum).EvapLatCoolingRate * TimeStepSys * SecInHour; + TESCoil(TESCoilNum).EvapLatCoolingEnergy = TESCoil(TESCoilNum).EvapLatCoolingRate * TimeStepSys * DataGlobalConstants::SecInHour(); } else { // Evap off, but may still charge if (TESCanBeCharged) { // coil is running to charge but not to cool at evaporator @@ -3145,7 +3144,7 @@ namespace PackagedThermalStorageCoil { } TESCoil(TESCoilNum).ElecCoolingPower = ChargeElectricCoolingPower + TESCoil(TESCoilNum).AncillaryControlsPower; - TESCoil(TESCoilNum).ElecCoolingEnergy = TESCoil(TESCoilNum).ElecCoolingPower * TimeStepSys * SecInHour; + TESCoil(TESCoilNum).ElecCoolingEnergy = TESCoil(TESCoilNum).ElecCoolingPower * TimeStepSys * DataGlobalConstants::SecInHour(); TESCoil(TESCoilNum).RuntimeFraction = 0.0; Node(TESCoil(TESCoilNum).EvapAirOutletNodeNum).Temp = Node(TESCoil(TESCoilNum).EvapAirInletNodeNum).Temp; @@ -3187,7 +3186,7 @@ namespace PackagedThermalStorageCoil { } TESCoil(TESCoilNum).QdotTES = -TotChargeCap; - TESCoil(TESCoilNum).Q_TES = TESCoil(TESCoilNum).QdotTES * TimeStepSys * SecInHour; + TESCoil(TESCoilNum).Q_TES = TESCoil(TESCoilNum).QdotTES * TimeStepSys * DataGlobalConstants::SecInHour(); UpdateTEStorage(state, TESCoilNum); @@ -3354,7 +3353,7 @@ namespace PackagedThermalStorageCoil { TankMass = rho * TESCoil(TESCoilNum).FluidStorageVolume; CpTank = GetSpecificHeatGlycol(state, TESCoil(TESCoilNum).StorageFluidName, sTES, TESCoil(TESCoilNum).StorageFluidIndex, RoutineName); // simple linear approximation of DT/Dt term in McpDT/Dt - QdotDischargeLimit = TankMass * CpTank * (TESCoil(TESCoilNum).MaximumFluidTankTempLimit - sTES) / (TimeStepSys * SecInHour); + QdotDischargeLimit = TankMass * CpTank * (TESCoil(TESCoilNum).MaximumFluidTankTempLimit - sTES) / (TimeStepSys * DataGlobalConstants::SecInHour()); } else { TESHasSomeCharge = false; } @@ -3363,7 +3362,7 @@ namespace PackagedThermalStorageCoil { if (sTES > 0.0) { TESHasSomeCharge = true; // discharge limit - QdotDischargeLimit = (sTES)*TESCoil(TESCoilNum).IceStorageCapacity / (TimeStepSys * SecInHour); + QdotDischargeLimit = (sTES)*TESCoil(TESCoilNum).IceStorageCapacity / (TimeStepSys * DataGlobalConstants::SecInHour()); } else { TESHasSomeCharge = false; } @@ -3531,27 +3530,27 @@ namespace PackagedThermalStorageCoil { Node(TESCoil(TESCoilNum).CondAirOutletNodeNum).Enthalpy = CondOutletEnthalpy; TESCoil(TESCoilNum).ElecCoolingPower = EvapElecCoolingPower + DischargeElectricCoolingPower + TESCoil(TESCoilNum).AncillaryControlsPower; - TESCoil(TESCoilNum).ElecCoolingEnergy = TESCoil(TESCoilNum).ElecCoolingPower * TimeStepSys * SecInHour; + TESCoil(TESCoilNum).ElecCoolingEnergy = TESCoil(TESCoilNum).ElecCoolingPower * TimeStepSys * DataGlobalConstants::SecInHour(); TESCoil(TESCoilNum).RuntimeFraction = (EvapTotCap * EvapRuntimeFraction + TotDischargeCap * DischargeRuntimeFraction) / (EvapTotCap + TotDischargeCap); TESCoil(TESCoilNum).EvapTotCoolingRate = EvapTotCap * EvapRuntimeFraction + TotDischargeCap * DischargeRuntimeFraction; - TESCoil(TESCoilNum).EvapTotCoolingEnergy = TESCoil(TESCoilNum).EvapTotCoolingRate * TimeStepSys * SecInHour; + TESCoil(TESCoilNum).EvapTotCoolingEnergy = TESCoil(TESCoilNum).EvapTotCoolingRate * TimeStepSys * DataGlobalConstants::SecInHour(); MinAirHumRat = min(Node(TESCoil(TESCoilNum).EvapAirOutletNodeNum).HumRat, Node(TESCoil(TESCoilNum).EvapAirInletNodeNum).HumRat); TESCoil(TESCoilNum).EvapSensCoolingRate = EvapAirMassFlow * (PsyHFnTdbW(EvapInletDryBulb, MinAirHumRat) - PsyHFnTdbW(EvapOutletAirTemp, MinAirHumRat)); if (TESCoil(TESCoilNum).EvapSensCoolingRate > TESCoil(TESCoilNum).EvapTotCoolingRate) { TESCoil(TESCoilNum).EvapSensCoolingRate = TESCoil(TESCoilNum).EvapTotCoolingRate; } - TESCoil(TESCoilNum).EvapSensCoolingEnergy = TESCoil(TESCoilNum).EvapSensCoolingRate * TimeStepSys * SecInHour; + TESCoil(TESCoilNum).EvapSensCoolingEnergy = TESCoil(TESCoilNum).EvapSensCoolingRate * TimeStepSys * DataGlobalConstants::SecInHour(); TESCoil(TESCoilNum).EvapLatCoolingRate = TESCoil(TESCoilNum).EvapTotCoolingRate - TESCoil(TESCoilNum).EvapSensCoolingRate; - TESCoil(TESCoilNum).EvapLatCoolingEnergy = TESCoil(TESCoilNum).EvapLatCoolingRate * TimeStepSys * SecInHour; + TESCoil(TESCoilNum).EvapLatCoolingEnergy = TESCoil(TESCoilNum).EvapLatCoolingRate * TimeStepSys * DataGlobalConstants::SecInHour(); } else { // coil is off; just pass through conditions TESCoil(TESCoilNum).QdotTES = 0.0; TESCoil(TESCoilNum).ElecCoolingPower = TESCoil(TESCoilNum).AncillaryControlsPower; - TESCoil(TESCoilNum).ElecCoolingEnergy = TESCoil(TESCoilNum).ElecCoolingPower * TimeStepSys * SecInHour; + TESCoil(TESCoilNum).ElecCoolingEnergy = TESCoil(TESCoilNum).ElecCoolingPower * TimeStepSys * DataGlobalConstants::SecInHour(); TESCoil(TESCoilNum).RuntimeFraction = 0.0; TESCoil(TESCoilNum).RuntimeFraction = 0.0; @@ -3578,7 +3577,7 @@ namespace PackagedThermalStorageCoil { PsyHFnTdbW(Node(TESCoil(TESCoilNum).CondAirOutletNodeNum).Temp, Node(TESCoil(TESCoilNum).CondAirOutletNodeNum).HumRat); TESCoil(TESCoilNum).CondInletTemp = Node(TESCoil(TESCoilNum).CondAirInletNodeNum).Temp; } - TESCoil(TESCoilNum).Q_TES = TESCoil(TESCoilNum).QdotTES * TimeStepSys * SecInHour; + TESCoil(TESCoilNum).Q_TES = TESCoil(TESCoilNum).QdotTES * TimeStepSys * DataGlobalConstants::SecInHour(); UpdateTEStorage(state, TESCoilNum); UpdateColdWeatherProtection(TESCoilNum); @@ -3698,7 +3697,7 @@ namespace PackagedThermalStorageCoil { TankMass = rho * TESCoil(TESCoilNum).FluidStorageVolume; CpTank = GetSpecificHeatGlycol(state, TESCoil(TESCoilNum).StorageFluidName, sTES, TESCoil(TESCoilNum).StorageFluidIndex, RoutineName); // simple linear approximation of DT/Dt term in McpDT/Dt - QdotChargeLimit = TankMass * CpTank * (sTES - TESCoil(TESCoilNum).MinimumFluidTankTempLimit) / (TimeStepSys * SecInHour); + QdotChargeLimit = TankMass * CpTank * (sTES - TESCoil(TESCoilNum).MinimumFluidTankTempLimit) / (TimeStepSys * DataGlobalConstants::SecInHour()); } else { TESCanBeCharged = false; } @@ -3707,7 +3706,7 @@ namespace PackagedThermalStorageCoil { if (sTES < 1.0) { TESCanBeCharged = true; // find charge limit to reach limit - QdotChargeLimit = (1.0 - sTES) * TESCoil(TESCoilNum).IceStorageCapacity / (TimeStepSys * SecInHour); + QdotChargeLimit = (1.0 - sTES) * TESCoil(TESCoilNum).IceStorageCapacity / (TimeStepSys * DataGlobalConstants::SecInHour()); } else { TESCanBeCharged = false; } @@ -3739,13 +3738,13 @@ namespace PackagedThermalStorageCoil { Node(TESCoil(TESCoilNum).CondAirOutletNodeNum).Enthalpy = CondOutletEnthalpy; TESCoil(TESCoilNum).ElecCoolingPower = ElecCoolingPower + TESCoil(TESCoilNum).AncillaryControlsPower; - TESCoil(TESCoilNum).ElecCoolingEnergy = TESCoil(TESCoilNum).ElecCoolingPower * TimeStepSys * SecInHour; + TESCoil(TESCoilNum).ElecCoolingEnergy = TESCoil(TESCoilNum).ElecCoolingPower * TimeStepSys * DataGlobalConstants::SecInHour(); TESCoil(TESCoilNum).QdotTES = -TotCap; // negative for cooling } else { // not running TESCoil(TESCoilNum).ElecCoolingPower = TESCoil(TESCoilNum).AncillaryControlsPower; - TESCoil(TESCoilNum).ElecCoolingEnergy = TESCoil(TESCoilNum).ElecCoolingPower * TimeStepSys * SecInHour; + TESCoil(TESCoilNum).ElecCoolingEnergy = TESCoil(TESCoilNum).ElecCoolingPower * TimeStepSys * DataGlobalConstants::SecInHour(); TESCoil(TESCoilNum).RuntimeFraction = 0.0; TESCoil(TESCoilNum).QdotTES = 0.0; Node(TESCoil(TESCoilNum).CondAirOutletNodeNum).Temp = Node(TESCoil(TESCoilNum).CondAirInletNodeNum).Temp; @@ -3755,7 +3754,7 @@ namespace PackagedThermalStorageCoil { Node(TESCoil(TESCoilNum).CondAirOutletNodeNum).Enthalpy = PsyHFnTdbW(Node(TESCoil(TESCoilNum).CondAirOutletNodeNum).Temp, Node(TESCoil(TESCoilNum).CondAirOutletNodeNum).HumRat); } - TESCoil(TESCoilNum).Q_TES = TESCoil(TESCoilNum).QdotTES * TimeStepSys * SecInHour; + TESCoil(TESCoilNum).Q_TES = TESCoil(TESCoilNum).QdotTES * TimeStepSys * DataGlobalConstants::SecInHour(); TESCoil(TESCoilNum).EvapTotCoolingRate = 0.0; TESCoil(TESCoilNum).EvapTotCoolingEnergy = 0.0; @@ -3881,7 +3880,7 @@ namespace PackagedThermalStorageCoil { TankMass = rho * TESCoil(TESCoilNum).FluidStorageVolume; CpTank = GetSpecificHeatGlycol(state, TESCoil(TESCoilNum).StorageFluidName, sTES, TESCoil(TESCoilNum).StorageFluidIndex, StorageTankName); // simple linear approximation of DT/Dt term in McpDT/Dt - QdotDischargeLimit = TankMass * CpTank * (TESCoil(TESCoilNum).MaximumFluidTankTempLimit - sTES) / (TimeStepSys * SecInHour); + QdotDischargeLimit = TankMass * CpTank * (TESCoil(TESCoilNum).MaximumFluidTankTempLimit - sTES) / (TimeStepSys * DataGlobalConstants::SecInHour()); } else { TESHasSomeCharge = false; } @@ -3890,7 +3889,7 @@ namespace PackagedThermalStorageCoil { if (sTES > 0.0) { TESHasSomeCharge = true; // discharge limit - QdotDischargeLimit = (sTES)*TESCoil(TESCoilNum).IceStorageCapacity / (TimeStepSys * SecInHour); + QdotDischargeLimit = (sTES)*TESCoil(TESCoilNum).IceStorageCapacity / (TimeStepSys * DataGlobalConstants::SecInHour()); } else { TESHasSomeCharge = false; } @@ -4020,19 +4019,19 @@ namespace PackagedThermalStorageCoil { Node(TESCoil(TESCoilNum).EvapAirOutletNodeNum).MassFlowRateMinAvail = Node(TESCoil(TESCoilNum).EvapAirInletNodeNum).MassFlowRateMinAvail; Node(TESCoil(TESCoilNum).EvapAirOutletNodeNum).MassFlowRateMaxAvail = Node(TESCoil(TESCoilNum).EvapAirInletNodeNum).MassFlowRateMaxAvail; TESCoil(TESCoilNum).ElecCoolingPower = ElecCoolingPower + TESCoil(TESCoilNum).AncillaryControlsPower; - TESCoil(TESCoilNum).ElecCoolingEnergy = TESCoil(TESCoilNum).ElecCoolingPower * TimeStepSys * SecInHour; + TESCoil(TESCoilNum).ElecCoolingEnergy = TESCoil(TESCoilNum).ElecCoolingPower * TimeStepSys * DataGlobalConstants::SecInHour(); TESCoil(TESCoilNum).RuntimeFraction = RuntimeFraction; TESCoil(TESCoilNum).EvapTotCoolingRate = TotCap * RuntimeFraction; // double check this - TESCoil(TESCoilNum).EvapTotCoolingEnergy = TotCap * RuntimeFraction * TimeStepSys * SecInHour; + TESCoil(TESCoilNum).EvapTotCoolingEnergy = TotCap * RuntimeFraction * TimeStepSys * DataGlobalConstants::SecInHour(); MinAirHumRat = min(Node(TESCoil(TESCoilNum).EvapAirOutletNodeNum).HumRat, Node(TESCoil(TESCoilNum).EvapAirInletNodeNum).HumRat); TESCoil(TESCoilNum).EvapSensCoolingRate = EvapAirMassFlow * (PsyHFnTdbW(EvapInletDryBulb, MinAirHumRat) - PsyHFnTdbW(EvapOutletAirTemp, MinAirHumRat)); if (TESCoil(TESCoilNum).EvapSensCoolingRate > TESCoil(TESCoilNum).EvapTotCoolingRate) { TESCoil(TESCoilNum).EvapSensCoolingRate = TESCoil(TESCoilNum).EvapTotCoolingRate; } - TESCoil(TESCoilNum).EvapSensCoolingEnergy = TESCoil(TESCoilNum).EvapSensCoolingRate * TimeStepSys * SecInHour; + TESCoil(TESCoilNum).EvapSensCoolingEnergy = TESCoil(TESCoilNum).EvapSensCoolingRate * TimeStepSys * DataGlobalConstants::SecInHour(); TESCoil(TESCoilNum).EvapLatCoolingRate = TESCoil(TESCoilNum).EvapTotCoolingRate - TESCoil(TESCoilNum).EvapSensCoolingRate; - TESCoil(TESCoilNum).EvapLatCoolingEnergy = TESCoil(TESCoilNum).EvapLatCoolingRate * TimeStepSys * SecInHour; + TESCoil(TESCoilNum).EvapLatCoolingEnergy = TESCoil(TESCoilNum).EvapLatCoolingRate * TimeStepSys * DataGlobalConstants::SecInHour(); TESCoil(TESCoilNum).QdotTES = TotCap * RuntimeFraction + ElecCoolingPower; // all heat rejection into storage @@ -4040,7 +4039,7 @@ namespace PackagedThermalStorageCoil { TESCoil(TESCoilNum).QdotTES = 0.0; TESCoil(TESCoilNum).ElecCoolingPower = TESCoil(TESCoilNum).AncillaryControlsPower; - TESCoil(TESCoilNum).ElecCoolingEnergy = TESCoil(TESCoilNum).ElecCoolingPower * TimeStepSys * SecInHour; + TESCoil(TESCoilNum).ElecCoolingEnergy = TESCoil(TESCoilNum).ElecCoolingPower * TimeStepSys * DataGlobalConstants::SecInHour(); TESCoil(TESCoilNum).RuntimeFraction = 0.0; TESCoil(TESCoilNum).RuntimeFraction = 0.0; @@ -4068,7 +4067,7 @@ namespace PackagedThermalStorageCoil { Node(TESCoil(TESCoilNum).CondAirOutletNodeNum).Enthalpy = PsyHFnTdbW(Node(TESCoil(TESCoilNum).CondAirOutletNodeNum).Temp, Node(TESCoil(TESCoilNum).CondAirOutletNodeNum).HumRat); TESCoil(TESCoilNum).CondInletTemp = Node(TESCoil(TESCoilNum).CondAirInletNodeNum).Temp; - TESCoil(TESCoilNum).Q_TES = TESCoil(TESCoilNum).QdotTES * TimeStepSys * SecInHour; + TESCoil(TESCoilNum).Q_TES = TESCoil(TESCoilNum).QdotTES * TimeStepSys * DataGlobalConstants::SecInHour(); UpdateTEStorage(state, TESCoilNum); UpdateColdWeatherProtection(TESCoilNum); @@ -4581,7 +4580,7 @@ namespace PackagedThermalStorageCoil { Real64 QdotTES; // heat exchange directly into tank from charging system [W] Real64 NewOutletTemp; // calculated new tankoutlet temp (C) - SecInTimeStep = TimeStepSys * SecInHour; + SecInTimeStep = TimeStepSys * DataGlobalConstants::SecInHour(); TimeRemaining = SecInTimeStep; TimeElapsed = HourOfDay + TimeStep * TimeStepZone + SysTimeElapsed; @@ -4630,7 +4629,7 @@ namespace PackagedThermalStorageCoil { TESCoil(TESCoilNum).QdotPlant = Node(TESCoil(TESCoilNum).TESPlantInletNodeNum).MassFlowRate * CpPlantConnection * TESCoil(TESCoilNum).TESPlantEffectiveness * (UseInletTemp - NewTankTemp); - TESCoil(TESCoilNum).Q_Plant = TESCoil(TESCoilNum).QdotPlant * TimeStepSys * SecInHour; + TESCoil(TESCoilNum).Q_Plant = TESCoil(TESCoilNum).QdotPlant * TimeStepSys * DataGlobalConstants::SecInHour(); // now get correct outlet temp with actual massflow (not modified by effectiveness) if (Node(TESCoil(TESCoilNum).TESPlantInletNodeNum).MassFlowRate > MassFlowTolerance) { NewOutletTemp = @@ -4654,7 +4653,7 @@ namespace PackagedThermalStorageCoil { QdotTES, TimeRemaining); TESCoil(TESCoilNum).QdotAmbient = (LossCoeff * (AmbientTemp * TimeRemaining - deltaTsum)) / SecInTimeStep; - TESCoil(TESCoilNum).Q_Ambient = TESCoil(TESCoilNum).QdotAmbient * TimeStepSys * SecInHour; + TESCoil(TESCoilNum).Q_Ambient = TESCoil(TESCoilNum).QdotAmbient * TimeStepSys * DataGlobalConstants::SecInHour(); } void CalcTESIceStorageTank(EnergyPlusData &state, int const TESCoilNum) @@ -4721,7 +4720,7 @@ namespace PackagedThermalStorageCoil { TESCoil(TESCoilNum).QdotPlant = Node(TESCoil(TESCoilNum).TESPlantInletNodeNum).MassFlowRate * Cp * TESCoil(TESCoilNum).TESPlantEffectiveness * (Node(TESCoil(TESCoilNum).TESPlantInletNodeNum).Temp - FreezingTemp); - TESCoil(TESCoilNum).Q_Plant = TESCoil(TESCoilNum).QdotPlant * TimeStepSys * SecInHour; + TESCoil(TESCoilNum).Q_Plant = TESCoil(TESCoilNum).QdotPlant * TimeStepSys * DataGlobalConstants::SecInHour(); // now get correct outlet temp with actual massflow (not modified by effectiveness) if (Node(TESCoil(TESCoilNum).TESPlantInletNodeNum).MassFlowRate > MassFlowTolerance) { NewOutletTemp = Node(TESCoil(TESCoilNum).TESPlantInletNodeNum).Temp + @@ -4738,17 +4737,17 @@ namespace PackagedThermalStorageCoil { // update ambient heat transfer TESCoil(TESCoilNum).QdotAmbient = TESCoil(TESCoilNum).StorageUA * (Node(TESCoil(TESCoilNum).StorageAmbientNodeNum).Temp - FreezingTemp); - TESCoil(TESCoilNum).Q_Ambient = TESCoil(TESCoilNum).QdotAmbient * TimeStepSys * SecInHour; + TESCoil(TESCoilNum).Q_Ambient = TESCoil(TESCoilNum).QdotAmbient * TimeStepSys * DataGlobalConstants::SecInHour(); QdotIce = TESCoil(TESCoilNum).QdotPlant + TESCoil(TESCoilNum).QdotAmbient + TESCoil(TESCoilNum).QdotTES; if (QdotIce < 0.0) { // charging ice level TESCoil(TESCoilNum).IceFracRemain = TESCoil(TESCoilNum).IceFracRemainLastTimestep + - std::abs(QdotIce) / (TESCoil(TESCoilNum).IceStorageCapacity / (TimeStepSys * SecInHour)); + std::abs(QdotIce) / (TESCoil(TESCoilNum).IceStorageCapacity / (TimeStepSys * DataGlobalConstants::SecInHour())); if (TESCoil(TESCoilNum).IceFracRemain > 1.0) TESCoil(TESCoilNum).IceFracRemain = 1.0; } else { // not charging,but discharging TESCoil(TESCoilNum).IceFracRemain = - TESCoil(TESCoilNum).IceFracRemainLastTimestep - QdotIce / (TESCoil(TESCoilNum).IceStorageCapacity / (TimeStepSys * SecInHour)); + TESCoil(TESCoilNum).IceFracRemainLastTimestep - QdotIce / (TESCoil(TESCoilNum).IceStorageCapacity / (TimeStepSys * DataGlobalConstants::SecInHour())); if (TESCoil(TESCoilNum).IceFracRemain < 0.0) TESCoil(TESCoilNum).IceFracRemain = 0.0; } } @@ -4796,7 +4795,7 @@ namespace PackagedThermalStorageCoil { } else { TESCoil(TESCoilNum).ElectColdWeatherPower = 0.0; } - TESCoil(TESCoilNum).ElectColdWeatherEnergy = TESCoil(TESCoilNum).ElectColdWeatherPower * TimeStepSys * SecInHour; + TESCoil(TESCoilNum).ElectColdWeatherEnergy = TESCoil(TESCoilNum).ElectColdWeatherPower * TimeStepSys * DataGlobalConstants::SecInHour(); } void UpdateEvaporativeCondenserBasinHeater(int const TESCoilNum) @@ -4839,7 +4838,7 @@ namespace PackagedThermalStorageCoil { TESCoil(TESCoilNum).BasinHeaterSetpointTemp, TESCoil(TESCoilNum).ElectEvapCondBasinHeaterPower); - TESCoil(TESCoilNum).ElectEvapCondBasinHeaterEnergy = TESCoil(TESCoilNum).ElectEvapCondBasinHeaterPower * TimeStepSys * SecInHour; + TESCoil(TESCoilNum).ElectEvapCondBasinHeaterEnergy = TESCoil(TESCoilNum).ElectEvapCondBasinHeaterPower * TimeStepSys * DataGlobalConstants::SecInHour(); } void UpdateEvaporativeCondenserWaterUse(int const TESCoilNum, Real64 const HumRatAfterEvap, int const InletNodeNum) @@ -4900,10 +4899,10 @@ namespace PackagedThermalStorageCoil { } } - TESCoil(TESCoilNum).EvapWaterConsump = TESCoil(TESCoilNum).EvapWaterConsumpRate * TimeStepSys * SecInHour; - TESCoil(TESCoilNum).EvapWaterStarvMakup = TESCoil(TESCoilNum).EvapWaterStarvMakupRate * TimeStepSys * SecInHour; + TESCoil(TESCoilNum).EvapWaterConsump = TESCoil(TESCoilNum).EvapWaterConsumpRate * TimeStepSys * DataGlobalConstants::SecInHour(); + TESCoil(TESCoilNum).EvapWaterStarvMakup = TESCoil(TESCoilNum).EvapWaterStarvMakupRate * TimeStepSys * DataGlobalConstants::SecInHour(); TESCoil(TESCoilNum).EvapCondPumpElecPower = TESCoil(TESCoilNum).EvapCondPumpElecNomPower * TESCoil(TESCoilNum).CondenserRuntimeFraction; - TESCoil(TESCoilNum).EvapCondPumpElecConsumption = TESCoil(TESCoilNum).EvapCondPumpElecPower * TimeStepSys * SecInHour; + TESCoil(TESCoilNum).EvapCondPumpElecConsumption = TESCoil(TESCoilNum).EvapCondPumpElecPower * TimeStepSys * DataGlobalConstants::SecInHour(); } void diff --git a/src/EnergyPlus/PhotovoltaicThermalCollectors.cc b/src/EnergyPlus/PhotovoltaicThermalCollectors.cc index 8c081b6cb94..c20bb7a3815 100644 --- a/src/EnergyPlus/PhotovoltaicThermalCollectors.cc +++ b/src/EnergyPlus/PhotovoltaicThermalCollectors.cc @@ -948,7 +948,7 @@ namespace PhotovoltaicThermalCollectors { this->Report.ThermEfficiency = Eff; this->Report.ThermHeatGain = PotentialHeatGain; this->Report.ThermPower = this->Report.ThermHeatGain; - this->Report.ThermEnergy = this->Report.ThermPower * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->Report.ThermEnergy = this->Report.ThermPower * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); this->Report.ThermHeatLoss = 0.0; this->Report.TinletWorkFluid = Tinlet; this->Report.MdotWorkFluid = mdot; @@ -1014,7 +1014,7 @@ namespace PhotovoltaicThermalCollectors { this->Report.ThermHeatLoss = mdot * CpInlet * (Tinlet - this->Report.ToutletWorkFluid); this->Report.ThermHeatGain = 0.0; this->Report.ThermPower = -1.0 * this->Report.ThermHeatLoss; - this->Report.ThermEnergy = this->Report.ThermPower * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->Report.ThermEnergy = this->Report.ThermPower * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); this->Report.ThermEfficiency = 0.0; this->Simple.LastCollectorTemp = Tcollector; this->Report.BypassStatus = BypassFraction; diff --git a/src/EnergyPlus/Photovoltaics.cc b/src/EnergyPlus/Photovoltaics.cc index 91682fc1525..1351605c8f4 100644 --- a/src/EnergyPlus/Photovoltaics.cc +++ b/src/EnergyPlus/Photovoltaics.cc @@ -121,7 +121,6 @@ namespace Photovoltaics { using DataGlobals::BeginSimFlag; using DataGlobals::EndEnvrnFlag; using DataGlobals::KelvinConv; - using DataGlobals::SecInHour; using DataHVACGlobals::TimeStepSys; // Data @@ -822,7 +821,6 @@ namespace Photovoltaics { // USE STATEMENTS: // Using/Aliasing - using DataGlobals::SecInHour; using DataHeatBalance::QRadSWOutIncident; using DataHVACGlobals::TimeStepSys; using DataSurfaces::Surface; @@ -877,7 +875,7 @@ namespace Photovoltaics { PVarray(thisPV).SurfaceSink = PVarray(thisPV).Report.DCPower; // array energy, power * timestep - PVarray(thisPV).Report.DCEnergy = PVarray(thisPV).Report.DCPower * (TimeStepSys * SecInHour); + PVarray(thisPV).Report.DCEnergy = PVarray(thisPV).Report.DCPower * (TimeStepSys * DataGlobalConstants::SecInHour()); PVarray(thisPV).Report.ArrayEfficiency = Eff; } else { // not enough incident solar, zero things out @@ -909,7 +907,7 @@ namespace Photovoltaics { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int thisZone; // working index for zones - PVarray(PVnum).Report.DCEnergy = PVarray(PVnum).Report.DCPower * (TimeStepSys * SecInHour); + PVarray(PVnum).Report.DCEnergy = PVarray(PVnum).Report.DCPower * (TimeStepSys * DataGlobalConstants::SecInHour()); // add check for multiplier. if surface is attached to a zone that is on a multiplier // then PV production should be multiplied out as well @@ -1223,7 +1221,6 @@ namespace Photovoltaics { // Using/Aliasing using DataGlobals::BeginEnvrnFlag; using DataGlobals::HourOfDay; - using DataGlobals::SecInHour; using DataGlobals::TimeStep; using DataGlobals::TimeStepZone; using DataHeatBalance::QRadSWOutIncident; @@ -1308,7 +1305,6 @@ namespace Photovoltaics { // Using/Aliasing using DataGlobals::MinutesPerTimeStep; - using DataGlobals::SecInHour; using DataSurfaces::Surface; // USE DataPhotovoltaics, ONLY:CellTemp,LastCellTemp using DataHeatBalance::Zone; diff --git a/src/EnergyPlus/PipeHeatTransfer.cc b/src/EnergyPlus/PipeHeatTransfer.cc index b89c438080a..475ce43d35e 100644 --- a/src/EnergyPlus/PipeHeatTransfer.cc +++ b/src/EnergyPlus/PipeHeatTransfer.cc @@ -256,7 +256,6 @@ namespace PipeHeatTransfer { // needed to define and simulate the surface. // Using/Aliasing - using DataGlobals::SecInHour; using DataHeatBalance::IntGainTypeOf_PipeIndoor; using DataHeatBalance::Zone; using namespace DataIPShortCuts; // Data for field names, blank numerics @@ -270,7 +269,7 @@ namespace PipeHeatTransfer { // SUBROUTINE PARAMETER DEFINITIONS: int const NumPipeSections(20); int const NumberOfDepthNodes(8); // Number of nodes in the cartesian grid-Should be an even # for now - Real64 const SecondsInHour(SecInHour); + Real64 const SecondsInHour(DataGlobalConstants::SecInHour()); Real64 const HoursInDay(24.0); // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -631,7 +630,7 @@ namespace PipeHeatTransfer { PipeHT(Item).PipeDepth = PipeHT(Item).SoilDepth + PipeHT(Item).PipeID / 2.0; PipeHT(Item).DomainDepth = PipeHT(Item).PipeDepth * 2.0; PipeHT(Item).SoilDiffusivity = PipeHT(Item).SoilConductivity / (PipeHT(Item).SoilDensity * PipeHT(Item).SoilCp); - PipeHT(Item).SoilDiffusivityPerDay = PipeHT(Item).SoilDiffusivity * SecondsInHour * HoursInDay; + PipeHT(Item).SoilDiffusivityPerDay = PipeHT(Item).SoilDiffusivity * SecondsInHour * DataGlobalConstants::HoursInDay(); // Mesh the cartesian domain PipeHT(Item).NumDepthNodes = NumberOfDepthNodes; @@ -851,7 +850,6 @@ namespace PipeHeatTransfer { using DataGlobals::BeginSimFlag; using DataGlobals::DayOfSim; using DataGlobals::HourOfDay; - using DataGlobals::SecInHour; using DataGlobals::TimeStep; using DataGlobals::TimeStepZone; using DataHeatBalFanSys::MAT; // average (mean) zone air temperature [C] @@ -941,7 +939,7 @@ namespace PipeHeatTransfer { if (!BeginEnvrnFlag) this->BeginSimEnvrn = true; // time step in seconds - nsvDeltaTime = TimeStepSys * SecInHour; + nsvDeltaTime = TimeStepSys * DataGlobalConstants::SecInHour(); nsvNumInnerTimeSteps = int(nsvDeltaTime / InnerDeltaTime); // previous temps are updated if necessary at start of timestep rather than end @@ -1281,7 +1279,6 @@ namespace PipeHeatTransfer { using DataEnvironment::WindSpeed; using DataGlobals::HourOfDay; using DataGlobals::KelvinConv; - using DataGlobals::rTinyValue; using DataGlobals::TimeStep; using DataLoopNode::Node; @@ -1366,7 +1363,7 @@ namespace PipeHeatTransfer { ConvCoef = this->OutdoorConvCoef; // thermal radiation coefficient using surf temp from past time step - if (std::abs(PastNodeTempAbs - SkyTempAbs) > rTinyValue) { + if (std::abs(PastNodeTempAbs - SkyTempAbs) > DataGlobalConstants::rTinyValue()) { RadCoef = StefBoltzmann * TopThermAbs * (pow_4(PastNodeTempAbs) - pow_4(SkyTempAbs)) / (PastNodeTempAbs - SkyTempAbs); } else { RadCoef = 0.0; @@ -1931,9 +1928,7 @@ namespace PipeHeatTransfer { // REFERENCES: See Module Level Description // Using/Aliasing - using DataGlobals::SecsInDay; - - Real64 curSimTime = DayOfSim * SecsInDay; + Real64 curSimTime = DayOfSim * DataGlobalConstants::SecsInDay(); Real64 TBND; TBND = this->groundTempModel->getGroundTempAtTimeInSeconds(state, z, curSimTime); diff --git a/src/EnergyPlus/PlantCentralGSHP.cc b/src/EnergyPlus/PlantCentralGSHP.cc index 7754e9e5246..afd01763594 100644 --- a/src/EnergyPlus/PlantCentralGSHP.cc +++ b/src/EnergyPlus/PlantCentralGSHP.cc @@ -3341,7 +3341,7 @@ namespace PlantCentralGSHP { Real64 SecInTimeStep; // Number of seconds per HVAC system time step, to convert from W (J/s) to J int ChillerHeaterNum; // Chiller heater number - SecInTimeStep = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + SecInTimeStep = DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); for (ChillerHeaterNum = 1; ChillerHeaterNum <= this->ChillerHeaterNums; ++ChillerHeaterNum) { this->ChillerHeater(ChillerHeaterNum).Report.ChillerFalseLoad = @@ -3367,7 +3367,7 @@ namespace PlantCentralGSHP { // DATE WRITTEN: Feb 2013 // Number of seconds per HVAC system time step, to convert from W (J/s) to J - Real64 SecInTimeStep = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + Real64 SecInTimeStep = DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); for (int ChillerHeaterNum = 1; ChillerHeaterNum <= this->ChillerHeaterNums; ++ChillerHeaterNum) { this->ChillerHeater(ChillerHeaterNum).Report.ChillerFalseLoad = diff --git a/src/EnergyPlus/PlantChillers.cc b/src/EnergyPlus/PlantChillers.cc index ca0e180cc16..f49043b23cb 100644 --- a/src/EnergyPlus/PlantChillers.cc +++ b/src/EnergyPlus/PlantChillers.cc @@ -271,14 +271,14 @@ namespace PlantChillers { // since it is not used elsewhere for connection // for transition purposes, add this node if not there. if (DataIPShortCuts::lAlphaFieldBlanks(5)) { - if (len(DataIPShortCuts::cAlphaArgs(1)) < DataGlobals::MaxNameLength - 21) { // protect against long name leading to > 100 chars + if (len(DataIPShortCuts::cAlphaArgs(1)) < DataGlobalConstants::MaxNameLength() - 21) { // protect against long name leading to > 100 chars DataIPShortCuts::cAlphaArgs(5) = DataIPShortCuts::cAlphaArgs(1) + " CONDENSER INLET NODE"; } else { DataIPShortCuts::cAlphaArgs(5) = DataIPShortCuts::cAlphaArgs(1).substr(0, 79) + " CONDENSER INLET NODE"; } } if (DataIPShortCuts::lAlphaFieldBlanks(6)) { - if (len(DataIPShortCuts::cAlphaArgs(1)) < DataGlobals::MaxNameLength - 22) { // protect against long name leading to > 100 chars + if (len(DataIPShortCuts::cAlphaArgs(1)) < DataGlobalConstants::MaxNameLength() - 22) { // protect against long name leading to > 100 chars DataIPShortCuts::cAlphaArgs(6) = DataIPShortCuts::cAlphaArgs(1) + " CONDENSER OUTLET NODE"; } else { DataIPShortCuts::cAlphaArgs(6) = DataIPShortCuts::cAlphaArgs(1).substr(0, 78) + " CONDENSER OUTLET NODE"; @@ -1833,9 +1833,9 @@ namespace PlantChillers { } // Calculate Energy - this->CondenserEnergy = this->QCondenser * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - this->Energy = this->Power * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - this->EvaporatorEnergy = this->QEvaporator * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->CondenserEnergy = this->QCondenser * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + this->Energy = this->Power * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + this->EvaporatorEnergy = this->QEvaporator * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); // check for problems (deal with observed negative energy results) if (this->Energy < 0.0) { // there is a serious problem @@ -1954,7 +1954,7 @@ namespace PlantChillers { } this->QHeatRecovery = this->QHeatRecovered; - this->EnergyHeatRecovery = this->QHeatRecovered * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->EnergyHeatRecovery = this->QHeatRecovered * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); DataLoopNode::Node(this->HeatRecOutletNodeNum).Temp = this->HeatRecOutletTemp; this->HeatRecMdot = DataLoopNode::Node(this->HeatRecInletNodeNum).MassFlowRate; this->ChillerCondAvgTemp = this->AvgCondSinkTemp; @@ -1966,7 +1966,7 @@ namespace PlantChillers { // AUTHOR: Dan Fisher / Brandon Anderson // DATE WRITTEN: September 2000 - Real64 const ReportingConstant = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + Real64 const ReportingConstant = DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); if (MyLoad >= 0.0 || !RunFlag) { // Chiller not running so pass inlet states to outlet states // set node temperatures @@ -2186,14 +2186,14 @@ namespace PlantChillers { // If the condenser inlet is blank for air cooled and evap cooled condensers then supply a generic name // since it is not used elsewhere for connection if (DataIPShortCuts::lAlphaFieldBlanks(5)) { - if (len(DataIPShortCuts::cAlphaArgs(1)) < DataGlobals::MaxNameLength - 21) { // protect against long name leading to > 100 chars + if (len(DataIPShortCuts::cAlphaArgs(1)) < DataGlobalConstants::MaxNameLength() - 21) { // protect against long name leading to > 100 chars DataIPShortCuts::cAlphaArgs(5) = DataIPShortCuts::cAlphaArgs(1) + " CONDENSER INLET NODE"; } else { DataIPShortCuts::cAlphaArgs(5) = DataIPShortCuts::cAlphaArgs(1).substr(0, 79) + " CONDENSER INLET NODE"; } } if (DataIPShortCuts::lAlphaFieldBlanks(6)) { - if (len(DataIPShortCuts::cAlphaArgs(1)) < DataGlobals::MaxNameLength - 22) { // protect against long name leading to > 100 chars + if (len(DataIPShortCuts::cAlphaArgs(1)) < DataGlobalConstants::MaxNameLength() - 22) { // protect against long name leading to > 100 chars DataIPShortCuts::cAlphaArgs(6) = DataIPShortCuts::cAlphaArgs(1) + " CONDENSER OUTLET NODE"; } else { DataIPShortCuts::cAlphaArgs(6) = DataIPShortCuts::cAlphaArgs(1).substr(0, 78) + " CONDENSER OUTLET NODE"; @@ -3797,14 +3797,14 @@ namespace PlantChillers { } // Calculate Energy - this->CondenserEnergy = this->QCondenser * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - this->Energy = this->Power * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - this->EvaporatorEnergy = this->QEvaporator * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->CondenserEnergy = this->QCondenser * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + this->Energy = this->Power * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + this->EvaporatorEnergy = this->QEvaporator * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); this->FuelEnergyUseRate = EngineDrivenFuelEnergy; - this->FuelEnergy = this->FuelEnergyUseRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - this->JacketEnergyRec = this->QJacketRecovered * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - this->LubeOilEnergyRec = this->QLubeOilRecovered * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - this->ExhaustEnergyRec = this->QExhaustRecovered * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->FuelEnergy = this->FuelEnergyUseRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + this->JacketEnergyRec = this->QJacketRecovered * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + this->LubeOilEnergyRec = this->QLubeOilRecovered * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + this->ExhaustEnergyRec = this->QExhaustRecovered * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); this->QTotalHeatRecovered = this->QExhaustRecovered + this->QLubeOilRecovered + this->QJacketRecovered; this->TotalHeatEnergyRec = this->ExhaustEnergyRec + this->LubeOilEnergyRec + this->JacketEnergyRec; this->FuelEnergyUseRate = std::abs(this->FuelEnergyUseRate); @@ -3904,7 +3904,7 @@ namespace PlantChillers { // AUTHOR: Dan Fisher / Brandon Anderson // DATE WRITTEN: September 2000 - Real64 const ReportingConstant = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + Real64 const ReportingConstant = DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); if (MyLoad >= 0.0 || !RunFlag) { // Chiller not running // set node temperatures @@ -4121,14 +4121,14 @@ namespace PlantChillers { // If the condenser inlet is blank for air cooled and evap cooled condensers then supply a generic name // since it is not used elsewhere for connection if (DataIPShortCuts::lAlphaFieldBlanks(5)) { - if (len(DataIPShortCuts::cAlphaArgs(1)) < DataGlobals::MaxNameLength - 21) { // protect against long name leading to > 100 chars + if (len(DataIPShortCuts::cAlphaArgs(1)) < DataGlobalConstants::MaxNameLength() - 21) { // protect against long name leading to > 100 chars DataIPShortCuts::cAlphaArgs(5) = DataIPShortCuts::cAlphaArgs(1) + " CONDENSER INLET NODE"; } else { DataIPShortCuts::cAlphaArgs(5) = DataIPShortCuts::cAlphaArgs(1).substr(0, 79) + " CONDENSER INLET NODE"; } } if (DataIPShortCuts::lAlphaFieldBlanks(6)) { - if (len(DataIPShortCuts::cAlphaArgs(1)) < DataGlobals::MaxNameLength - 22) { // protect against long name leading to > 100 chars + if (len(DataIPShortCuts::cAlphaArgs(1)) < DataGlobalConstants::MaxNameLength() - 22) { // protect against long name leading to > 100 chars DataIPShortCuts::cAlphaArgs(6) = DataIPShortCuts::cAlphaArgs(1) + " CONDENSER OUTLET NODE"; } else { DataIPShortCuts::cAlphaArgs(6) = DataIPShortCuts::cAlphaArgs(1).substr(0, 78) + " CONDENSER OUTLET NODE"; @@ -5709,14 +5709,14 @@ namespace PlantChillers { this->HeatRecOutletTemp = HeatRecOutTemp; this->HeatRecMdot = heatRecMdot; - this->HeatRecLubeEnergy = this->HeatRecLubeRate * (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + this->HeatRecLubeEnergy = this->HeatRecLubeRate * (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); this->FuelEnergyIn = std::abs(fuelEnergyIn); this->FuelMassUsedRate = std::abs(fuelEnergyIn) / (this->FuelHeatingValue * KJtoJ); // Calculate Energy - this->CondenserEnergy = this->QCondenser * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - this->Energy = this->Power * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - this->EvaporatorEnergy = this->QEvaporator * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->CondenserEnergy = this->QCondenser * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + this->Energy = this->Power * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + this->EvaporatorEnergy = this->QEvaporator * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); // check for problems BG 9/12/06 (deal with observed negative energy results) if (this->Energy < 0.0) { // there is a serious problem @@ -5756,7 +5756,7 @@ namespace PlantChillers { // AUTHOR: Dan Fisher / Brandon Anderson // DATE WRITTEN: September 2000 - Real64 const ReportingConstant = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + Real64 const ReportingConstant = DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); if (MyLoad >= 0.0 || !RunFlag) { // Chiller not running so pass inlet states to outlet states // set node temperatures @@ -5809,8 +5809,8 @@ namespace PlantChillers { this->EvapOutletTemp = DataLoopNode::Node(this->EvapOutletNodeNum).Temp; this->FuelEnergyUsedRate = this->FuelEnergyIn; - this->FuelEnergyUsed = this->FuelEnergyUsedRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - this->FuelMassUsed = this->FuelMassUsedRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->FuelEnergyUsed = this->FuelEnergyUsedRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + this->FuelMassUsed = this->FuelMassUsedRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); if (this->FuelEnergyUsedRate != 0.0) { this->FuelCOP = this->QEvaporator / this->FuelEnergyUsedRate; } else { @@ -5996,14 +5996,14 @@ namespace PlantChillers { // If the condenser inlet is blank for air cooled and evap cooled condensers then supply a generic name // since it is not used elsewhere for connection if (DataIPShortCuts::lAlphaFieldBlanks(4)) { - if (len(DataIPShortCuts::cAlphaArgs(1)) < DataGlobals::MaxNameLength - 21) { // protect against long name leading to > 100 chars + if (len(DataIPShortCuts::cAlphaArgs(1)) < DataGlobalConstants::MaxNameLength() - 21) { // protect against long name leading to > 100 chars DataIPShortCuts::cAlphaArgs(4) = DataIPShortCuts::cAlphaArgs(1) + " CONDENSER INLET NODE"; } else { DataIPShortCuts::cAlphaArgs(4) = DataIPShortCuts::cAlphaArgs(1).substr(0, 79) + " CONDENSER INLET NODE"; } } if (DataIPShortCuts::lAlphaFieldBlanks(5)) { - if (len(DataIPShortCuts::cAlphaArgs(1)) < DataGlobals::MaxNameLength - 22) { // protect against long name leading to > 100 chars + if (len(DataIPShortCuts::cAlphaArgs(1)) < DataGlobalConstants::MaxNameLength() - 22) { // protect against long name leading to > 100 chars DataIPShortCuts::cAlphaArgs(5) = DataIPShortCuts::cAlphaArgs(1) + " CONDENSER OUTLET NODE"; } else { DataIPShortCuts::cAlphaArgs(5) = DataIPShortCuts::cAlphaArgs(1).substr(0, 78) + " CONDENSER OUTLET NODE"; @@ -7116,9 +7116,9 @@ namespace PlantChillers { } // Calculate Energy - this->CondenserEnergy = this->QCondenser * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - this->Energy = this->Power * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - this->EvaporatorEnergy = this->QEvaporator * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->CondenserEnergy = this->QCondenser * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + this->Energy = this->Power * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + this->EvaporatorEnergy = this->QEvaporator * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); // check for problems BG 9/12/06 (deal with observed negative energy results) if (this->Energy < 0.0) { // there is a serious problem @@ -7148,7 +7148,7 @@ namespace PlantChillers { // AUTHOR: Dan Fisher // DATE WRITTEN: October 1998 - Real64 ReportingConstant = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + Real64 ReportingConstant = DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); if (MyLoad >= 0.0 || !RunFlag) { // Chiller not running so pass inlet states to outlet states this->Power = 0.0; diff --git a/src/EnergyPlus/PlantComponentTemperatureSources.cc b/src/EnergyPlus/PlantComponentTemperatureSources.cc index 3d1c87e033b..909b5783813 100644 --- a/src/EnergyPlus/PlantComponentTemperatureSources.cc +++ b/src/EnergyPlus/PlantComponentTemperatureSources.cc @@ -385,7 +385,7 @@ namespace PlantComponentTemperatureSources { DataPlant::PlantLoop(this->Location.loopNum).FluidIndex, RoutineName); this->HeatRate = this->MassFlowRate * Cp * (this->OutletTemp - this->InletTemp); - this->HeatEnergy = this->HeatRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->HeatEnergy = this->HeatRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); } else { this->OutletTemp = this->BoundaryTemp; this->HeatRate = 0.0; @@ -412,9 +412,9 @@ namespace PlantComponentTemperatureSources { void WaterSourceSpecs::getDesignCapacities(EnergyPlusData &EP_UNUSED(state), const EnergyPlus::PlantLocation &, Real64 &MaxLoad, Real64 &MinLoad, Real64 &OptLoad) { - MaxLoad = DataGlobals::BigNumber; + MaxLoad = DataGlobalConstants::BigNumber(); MinLoad = 0.0; - OptLoad = DataGlobals::BigNumber; + OptLoad = DataGlobalConstants::BigNumber(); } void WaterSourceSpecs::getSizingFactor(Real64 &_SizFac) diff --git a/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc b/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc index 5cf6763b828..3b2dca6d109 100644 --- a/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc +++ b/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc @@ -2092,7 +2092,7 @@ namespace PlantHeatExchangerFluidToFluid { DataLoopNode::Node(this->DemandSideLoop.outletNodeNum).Temp = this->DemandSideLoop.OutletTemp; DataLoopNode::Node(this->SupplySideLoop.outletNodeNum).Temp = this->SupplySideLoop.OutletTemp; - this->HeatTransferEnergy = this->HeatTransferRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->HeatTransferEnergy = this->HeatTransferRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); if ((std::abs(this->HeatTransferRate) > DataHVACGlobals::SmallLoad) && (this->DemandSideLoop.InletMassFlowRate > 0.0) && (this->SupplySideLoop.InletMassFlowRate > 0.0)) { diff --git a/src/EnergyPlus/PlantLoadProfile.cc b/src/EnergyPlus/PlantLoadProfile.cc index e4f7307bf89..780323ec5d6 100644 --- a/src/EnergyPlus/PlantLoadProfile.cc +++ b/src/EnergyPlus/PlantLoadProfile.cc @@ -329,14 +329,13 @@ namespace PlantLoadProfile { // Standard EnergyPlus methodology. // Using/Aliasing - using DataGlobals::SecInHour; using DataHVACGlobals::TimeStepSys; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: // FLOW: - this->Energy = this->Power * TimeStepSys * SecInHour; + this->Energy = this->Power * TimeStepSys * DataGlobalConstants::SecInHour(); if (this->Energy >= 0.0) { this->HeatingEnergy = this->Energy; @@ -378,8 +377,6 @@ namespace PlantLoadProfile { int NumAlphas; // Number of Alphas for each GetObjectItem call int NumNumbers; // Number of Numbers for each GetObjectItem call int ProfileNum; // PLANT LOAD PROFILE (PlantProfile) object number - // CHARACTER(len=MaxNameLength) :: FoundBranchName - // INTEGER :: BranchControlType // FLOW: cCurrentModuleObject = "LoadProfile:Plant"; diff --git a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc index b744262cbb9..ea0b809cce8 100644 --- a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc +++ b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc @@ -296,7 +296,7 @@ namespace EIRPlantLoopHeatPumps { void EIRPlantLoopHeatPump::doPhysics(EnergyPlusData &state, Real64 currentLoad) { - Real64 const reportingInterval = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + Real64 const reportingInterval = DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); // ideally the plant is going to ensure that we don't have a runflag=true when the load is invalid, but // I'm not sure we can count on that so we will do one check here to make sure we don't calculate things badly diff --git a/src/EnergyPlus/PlantPipingSystemsManager.cc b/src/EnergyPlus/PlantPipingSystemsManager.cc index 72df2bb18e1..763ffb08660 100644 --- a/src/EnergyPlus/PlantPipingSystemsManager.cc +++ b/src/EnergyPlus/PlantPipingSystemsManager.cc @@ -225,10 +225,10 @@ namespace EnergyPlus { // The time init should be done here before we DoOneTimeInits because the DoOneTimeInits // includes a ground temperature initialization, which is based on the Cur%CurSimTimeSeconds variable // which would be carried over from the previous environment - thisDomain.Cur.CurSimTimeStepSize = DataGlobals::TimeStepZone * DataGlobals::SecInHour; + thisDomain.Cur.CurSimTimeStepSize = DataGlobals::TimeStepZone * DataGlobalConstants::SecInHour(); thisDomain.Cur.CurSimTimeSeconds = ((DataGlobals::DayOfSim - 1) * 24 + (DataGlobals::HourOfDay - 1) + (DataGlobals::TimeStep - 1) * DataGlobals::TimeStepZone + - DataHVACGlobals::SysTimeElapsed) * DataGlobals::SecInHour; + DataHVACGlobals::SysTimeElapsed) * DataGlobalConstants::SecInHour(); // There are also some inits that are "close to one time" inits...( one-time in standalone, each envrn in E+ ) if ((DataGlobals::BeginSimFlag && thisDomain.BeginSimInit) || @@ -2186,7 +2186,7 @@ namespace EnergyPlus { // The time init should be done here before we DoOneTimeInits because the DoOneTimeInits // includes a ground temperature initialization, which is based on the Cur%CurSimTimeSeconds variable // which would be carried over from the previous environment - this->Cur.CurSimTimeStepSize = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->Cur.CurSimTimeStepSize = DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); this->Cur.CurSimTimeSeconds = (DataGlobals::DayOfSim - 1) * 24 + (DataGlobals::HourOfDay - 1) + (DataGlobals::TimeStep - 1) * DataGlobals::TimeStepZone + DataHVACGlobals::SysTimeElapsed; @@ -4454,13 +4454,13 @@ namespace EnergyPlus { Latitude_Radians = DataGlobalConstants::Pi() / 180.0 * Latitude_Degrees; // The day of year at this point in the simulation - DayOfYear = int(this->Cur.CurSimTimeSeconds / DataGlobals::SecsInDay); + DayOfYear = int(this->Cur.CurSimTimeSeconds / DataGlobalConstants::SecsInDay()); // The number of seconds into the current day - CurSecondsIntoToday = int(mod(this->Cur.CurSimTimeSeconds, DataGlobals::SecsInDay)); + CurSecondsIntoToday = int(mod(this->Cur.CurSimTimeSeconds, DataGlobalConstants::SecsInDay())); // The number of hours into today - HourOfDay = int(CurSecondsIntoToday / DataGlobals::SecInHour); + HourOfDay = int(CurSecondsIntoToday / DataGlobalConstants::SecInHour()); // For convenience convert to Kelvin once CurAirTempK = this->Cur.CurAirTemp + 273.15; diff --git a/src/EnergyPlus/PondGroundHeatExchanger.cc b/src/EnergyPlus/PondGroundHeatExchanger.cc index a6faeb75eb1..c061acd6606 100644 --- a/src/EnergyPlus/PondGroundHeatExchanger.cc +++ b/src/EnergyPlus/PondGroundHeatExchanger.cc @@ -519,17 +519,17 @@ namespace PondGroundHeatExchanger { Real64 Flux = this->CalcTotalFLux(state, this->PondTemp); Real64 PondTempStar = - this->PastBulkTemperature + 0.5 * DataGlobals::SecInHour * DataHVACGlobals::TimeStepSys * Flux / (SpecificHeat * PondMass); + this->PastBulkTemperature + 0.5 * DataGlobalConstants::SecInHour() * DataHVACGlobals::TimeStepSys * Flux / (SpecificHeat * PondMass); Real64 FluxStar = this->CalcTotalFLux(state, PondTempStar); Real64 PondTempStarStar = - this->PastBulkTemperature + 0.5 * DataGlobals::SecInHour * DataHVACGlobals::TimeStepSys * FluxStar / (SpecificHeat * PondMass); + this->PastBulkTemperature + 0.5 * DataGlobalConstants::SecInHour() * DataHVACGlobals::TimeStepSys * FluxStar / (SpecificHeat * PondMass); Real64 FluxStarStar = this->CalcTotalFLux(state, PondTempStarStar); Real64 PondTempStarStarStar = - this->PastBulkTemperature + DataGlobals::SecInHour * DataHVACGlobals::TimeStepSys * FluxStarStar / (SpecificHeat * PondMass); + this->PastBulkTemperature + DataGlobalConstants::SecInHour() * DataHVACGlobals::TimeStepSys * FluxStarStar / (SpecificHeat * PondMass); - this->PondTemp = this->PastBulkTemperature + DataGlobals::SecInHour * DataHVACGlobals::TimeStepSys * + this->PondTemp = this->PastBulkTemperature + DataGlobalConstants::SecInHour() * DataHVACGlobals::TimeStepSys * (Flux + 2.0 * FluxStar + 2.0 * FluxStarStar + this->CalcTotalFLux(state, PondTempStarStarStar)) / (6.0 * SpecificHeat * PondMass); } @@ -889,7 +889,7 @@ namespace PondGroundHeatExchanger { // compute pond heat transfer Real64 effectiveness = this->CalcEffectiveness(state, this->InletTemp, this->PondTemp, this->MassFlowRate); this->HeatTransferRate = this->MassFlowRate * CpFluid * effectiveness * (this->InletTemp - this->PondTemp); - this->Energy = this->HeatTransferRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->Energy = this->HeatTransferRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); // keep track of the bulk temperature this->BulkTemperature = this->PondTemp; diff --git a/src/EnergyPlus/PoweredInductionUnits.cc b/src/EnergyPlus/PoweredInductionUnits.cc index 976337a1bce..01f8f3aa16f 100644 --- a/src/EnergyPlus/PoweredInductionUnits.cc +++ b/src/EnergyPlus/PoweredInductionUnits.cc @@ -117,7 +117,6 @@ namespace PoweredInductionUnits { using DataGlobals::DisplayExtraWarnings; using DataGlobals::NumOfZones; using DataGlobals::ScheduleAlwaysOn; - using DataGlobals::SecInHour; using DataGlobals::SysSizingCalc; using DataHVACGlobals::PlenumInducedMassFlow; using DataHVACGlobals::SingleCoolingSetPoint; @@ -2119,8 +2118,8 @@ namespace PoweredInductionUnits { // FLOW - PIU(PIUNum).HeatingEnergy = PIU(PIUNum).HeatingRate * TimeStepSys * SecInHour; - PIU(PIUNum).SensCoolEnergy = PIU(PIUNum).SensCoolRate * TimeStepSys * SecInHour; + PIU(PIUNum).HeatingEnergy = PIU(PIUNum).HeatingRate * TimeStepSys * DataGlobalConstants::SecInHour(); + PIU(PIUNum).SensCoolEnergy = PIU(PIUNum).SensCoolRate * TimeStepSys * DataGlobalConstants::SecInHour(); // set zone OA Volume flow rate PIU(PIUNum).CalcOutdoorAirVolumeFlowRate(state); diff --git a/src/EnergyPlus/Pumps.cc b/src/EnergyPlus/Pumps.cc index bfc6333f8f1..4d7b9573159 100644 --- a/src/EnergyPlus/Pumps.cc +++ b/src/EnergyPlus/Pumps.cc @@ -104,7 +104,6 @@ namespace Pumps { // Using/Aliasing using DataGlobals::AnyEnergyManagementSystemInModel; using DataGlobals::BeginEnvrnFlag; - using DataGlobals::SecInHour; using DataHVACGlobals::CycleOn; using DataHVACGlobals::ForceOff; using DataHVACGlobals::NumCondLoops; @@ -2278,16 +2277,16 @@ namespace Pumps { PumpEquipReport(PumpNum).PumpHeattoFluid = PumpHeattoFluid; PumpEquipReport(PumpNum).OutletTemp = Node(OutletNode).Temp; PumpEquip(PumpNum).Power = Power; - PumpEquip(PumpNum).Energy = PumpEquip(PumpNum).Power * TimeStepSys * SecInHour; + PumpEquip(PumpNum).Energy = PumpEquip(PumpNum).Power * TimeStepSys * DataGlobalConstants::SecInHour(); PumpEquipReport(PumpNum).ShaftPower = ShaftPower; - PumpEquipReport(PumpNum).PumpHeattoFluidEnergy = PumpHeattoFluid * TimeStepSys * SecInHour; + PumpEquipReport(PumpNum).PumpHeattoFluidEnergy = PumpHeattoFluid * TimeStepSys * DataGlobalConstants::SecInHour(); if (PumpType == Pump_ConSpeed || PumpType == Pump_VarSpeed || PumpType == Pump_Cond) { PumpEquipReport(PumpNum).NumPumpsOperating = 1; } else if (PumpType == PumpBank_ConSpeed || PumpType == PumpBank_VarSpeed) { PumpEquipReport(PumpNum).NumPumpsOperating = NumPumpsRunning; } PumpEquipReport(PumpNum).ZoneTotalGainRate = Power - PumpHeattoFluid; - PumpEquipReport(PumpNum).ZoneTotalGainEnergy = PumpEquipReport(PumpNum).ZoneTotalGainRate * TimeStepSys * SecInHour; + PumpEquipReport(PumpNum).ZoneTotalGainEnergy = PumpEquipReport(PumpNum).ZoneTotalGainRate * TimeStepSys * DataGlobalConstants::SecInHour(); PumpEquipReport(PumpNum).ZoneConvGainRate = (1 - PumpEquip(PumpNum).SkinLossRadFraction) * PumpEquipReport(PumpNum).ZoneTotalGainRate; PumpEquipReport(PumpNum).ZoneRadGainRate = PumpEquip(PumpNum).SkinLossRadFraction * PumpEquipReport(PumpNum).ZoneTotalGainRate; } diff --git a/src/EnergyPlus/PurchasedAirManager.cc b/src/EnergyPlus/PurchasedAirManager.cc index 917db8c14df..2ff52656872 100644 --- a/src/EnergyPlus/PurchasedAirManager.cc +++ b/src/EnergyPlus/PurchasedAirManager.cc @@ -540,7 +540,7 @@ namespace PurchasedAirManager { if (PurchAir(PurchAirNum).OutdoorAir) { if (lAlphaFieldBlanks(13)) { // If there is outdoor air and outdoor air inlet node is blank, then create one - if (len(cAlphaArgs(1)) < MaxNameLength - 23) { // protect against long name leading to > 100 chars + if (len(cAlphaArgs(1)) < DataGlobalConstants::MaxNameLength() - 23) { // protect against long name leading to > 100 chars cAlphaArgs(13) = cAlphaArgs(1) + " OUTDOOR AIR INLET NODE"; } else { cAlphaArgs(13) = cAlphaArgs(1).substr(0, 75) + " OUTDOOR AIR INLET NODE"; @@ -3119,7 +3119,7 @@ namespace PurchasedAirManager { PurchAir(PurchAirNum).HtRecTotHeatRate = PurchAir(PurchAirNum).HtRecSenHeatRate + PurchAir(PurchAirNum).HtRecLatHeatRate; PurchAir(PurchAirNum).HtRecTotCoolRate = PurchAir(PurchAirNum).HtRecSenCoolRate + PurchAir(PurchAirNum).HtRecLatCoolRate; - ReportingConstant = TimeStepSys * SecInHour; + ReportingConstant = TimeStepSys * DataGlobalConstants::SecInHour(); PurchAir(PurchAirNum).SenHeatEnergy = PurchAir(PurchAirNum).SenHeatRate * ReportingConstant; PurchAir(PurchAirNum).SenCoolEnergy = PurchAir(PurchAirNum).SenCoolRate * ReportingConstant; diff --git a/src/EnergyPlus/RefrigeratedCase.cc b/src/EnergyPlus/RefrigeratedCase.cc index a8e19e5fda9..fd79ff1378f 100644 --- a/src/EnergyPlus/RefrigeratedCase.cc +++ b/src/EnergyPlus/RefrigeratedCase.cc @@ -9658,24 +9658,24 @@ namespace RefrigeratedCase { if (UseSysTimeStep) LocalTimeStep = DataHVACGlobals::TimeStepSys; this->RackCompressorPower = TotalCompressorPower; - this->RackElecConsumption = TotalCompressorPower * LocalTimeStep * DataGlobals::SecInHour; + this->RackElecConsumption = TotalCompressorPower * LocalTimeStep * DataGlobalConstants::SecInHour(); this->ActualCondenserFanPower = TotalCondenserFanPower; - this->CondenserFanConsumption = TotalCondenserFanPower * LocalTimeStep * DataGlobals::SecInHour; + this->CondenserFanConsumption = TotalCondenserFanPower * LocalTimeStep * DataGlobalConstants::SecInHour(); this->RackCapacity = TotalRackDeliveredCapacity; - this->RackCoolingEnergy = TotalRackDeliveredCapacity * LocalTimeStep * DataGlobals::SecInHour; + this->RackCoolingEnergy = TotalRackDeliveredCapacity * LocalTimeStep * DataGlobalConstants::SecInHour(); this->RackCompressorCOP = CompressorCOPactual; this->SensHVACCreditHeatRate = RackSenCreditToHVAC; - this->SensHVACCreditHeat = RackSenCreditToHVAC * LocalTimeStep * DataGlobals::SecInHour; + this->SensHVACCreditHeat = RackSenCreditToHVAC * LocalTimeStep * DataGlobalConstants::SecInHour(); this->SensZoneCreditHeatRate = RackSenCreditToZone; - this->SensZoneCreditHeat = RackSenCreditToZone * LocalTimeStep * DataGlobals::SecInHour; + this->SensZoneCreditHeat = RackSenCreditToZone * LocalTimeStep * DataGlobalConstants::SecInHour(); this->EvapWaterConsumpRate = TotalEvapWaterUseRate; - this->EvapWaterConsumption = TotalEvapWaterUseRate * LocalTimeStep * DataGlobals::SecInHour; + this->EvapWaterConsumption = TotalEvapWaterUseRate * LocalTimeStep * DataGlobalConstants::SecInHour(); this->ActualEvapPumpPower = TotalCondenserPumpPower; - this->EvapPumpConsumption = TotalCondenserPumpPower * LocalTimeStep * DataGlobals::SecInHour; + this->EvapPumpConsumption = TotalCondenserPumpPower * LocalTimeStep * DataGlobalConstants::SecInHour(); this->BasinHeaterPower = TotalBasinHeatPower; - this->BasinHeaterConsumption = TotalBasinHeatPower * LocalTimeStep * DataGlobals::SecInHour; + this->BasinHeaterConsumption = TotalBasinHeatPower * LocalTimeStep * DataGlobalConstants::SecInHour(); this->CondLoad = TotalCondenserHeat; - this->CondEnergy = TotalCondenserHeat * LocalTimeStep * DataGlobals::SecInHour; + this->CondEnergy = TotalCondenserHeat * LocalTimeStep * DataGlobalConstants::SecInHour(); // Set total rack heat rejection used for heat reclaim. Do not allow heat reclaim on stand alone (indoor) display cases. if (this->HeatRejectionLocation == LocationZone) { DataHeatBalance::HeatReclaimRefrigeratedRack(RackNum).AvailCapacity = 0.0; @@ -9953,7 +9953,7 @@ namespace RefrigeratedCase { // Reduce defrost heat load on case by amount of ice melted during time step // However, don't reduce the defrost capacity applied - DefrostLoad_Actual = DefrostCap_Actual - FrostMeltedKg * IceMeltEnthalpy / DataGlobals::TimeStepZone / DataGlobals::SecInHour; + DefrostLoad_Actual = DefrostCap_Actual - FrostMeltedKg * IceMeltEnthalpy / DataGlobals::TimeStepZone / DataGlobalConstants::SecInHour(); if (!DataGlobals::WarmupFlag) { // avoid reverse dd test problems // keep running total of defrost energy above that needed to melt frost for use in evaluating @@ -9982,7 +9982,7 @@ namespace RefrigeratedCase { Real64 TotalLoad_Actual = SensibleLoadTotal + LatentLoad + DefrostLoad_Actual; // Rate needed to serve all stored energy during single time step (W) - Real64 StoredEnergyRate = this->StoredEnergy / DataGlobals::TimeStepZone / DataGlobals::SecInHour; + Real64 StoredEnergyRate = this->StoredEnergy / DataGlobals::TimeStepZone / DataGlobalConstants::SecInHour(); Real64 LoadRequested = TotalLoad_Actual + StoredEnergyRate; // prorate available cooling capacity for portion of time off due to drip down. @@ -10892,9 +10892,9 @@ namespace RefrigeratedCase { // Report variables System(SysNum).TotTransferLoad = System(SysNum).SumMechSCLoad - System(SysNum).SumMechSCBenefit + System(SysNum).SumSecondaryLoopLoad + System(SysNum).SumCascadeLoad; - System(SysNum).TotTransferEnergy = System(SysNum).TotTransferLoad * LocalTimeStep * DataGlobals::SecInHour; - System(SysNum).PipeHeatEnergy = System(SysNum).PipeHeatLoad * LocalTimeStep * DataGlobals::SecInHour; - System(SysNum).TotalCoolingEnergy = System(SysNum).TotalCoolingLoad * LocalTimeStep * DataGlobals::SecInHour; + System(SysNum).TotTransferEnergy = System(SysNum).TotTransferLoad * LocalTimeStep * DataGlobalConstants::SecInHour(); + System(SysNum).PipeHeatEnergy = System(SysNum).PipeHeatLoad * LocalTimeStep * DataGlobalConstants::SecInHour(); + System(SysNum).TotalCoolingEnergy = System(SysNum).TotalCoolingLoad * LocalTimeStep * DataGlobalConstants::SecInHour(); } //(((.NOT. UseSysTimeStep).AND.(.NOT. System(SysNum)%CoilFlag)).OR.((UseSysTimeStep).AND.(System(SysNum)%CoilFlag))).and.not //DataGlobals::WarmupFlag } // SysNum = 1,NumRefrigSystems @@ -10910,7 +10910,7 @@ namespace RefrigeratedCase { if (WarehouseCoil(CoilID).ZoneNum != ZoneNum) continue; CoilSysCredit(ZoneNum).SenCreditToZoneRate -= WarehouseCoil(CoilID).SensCreditRate; CoilSysCredit(ZoneNum).SenCreditToZoneEnergy = - CoilSysCredit(ZoneNum).SenCreditToZoneRate * LocalTimeStep * DataGlobals::SecInHour; + CoilSysCredit(ZoneNum).SenCreditToZoneRate * LocalTimeStep * DataGlobalConstants::SecInHour(); CoilSysCredit(ZoneNum).LatKgPerS_ToZoneRate -= WarehouseCoil(CoilID).LatKgPerS_ToZone; CoilSysCredit(ZoneNum).LatCreditToZoneRate -= WarehouseCoil(CoilID).LatCreditRate; CoilSysCredit(ZoneNum).LatCreditToZoneEnergy -= WarehouseCoil(CoilID).LatCreditEnergy; @@ -11132,9 +11132,9 @@ namespace RefrigeratedCase { // Report variables TransSystem(SysNum).PipeHeatEnergy = - (TransSystem(SysNum).PipeHeatLoadMT + TransSystem(SysNum).PipeHeatLoadLT) * LocalTimeStep * DataGlobals::SecInHour; + (TransSystem(SysNum).PipeHeatLoadMT + TransSystem(SysNum).PipeHeatLoadLT) * LocalTimeStep * DataGlobalConstants::SecInHour(); TransSystem(SysNum).TotalCoolingEnergy = - (TransSystem(SysNum).TotalCoolingLoadMT + TransSystem(SysNum).TotalCoolingLoadMT) * LocalTimeStep * DataGlobals::SecInHour; + (TransSystem(SysNum).TotalCoolingLoadMT + TransSystem(SysNum).TotalCoolingLoadMT) * LocalTimeStep * DataGlobalConstants::SecInHour(); } //(.NOT. UseSysTimeStep).AND. (.not. DataGlobals::WarmupFlag) } // SysNum = 1,NumTransRefrigSystems @@ -11640,15 +11640,15 @@ namespace RefrigeratedCase { } // Condenser type = water, (evap or air), or cascade condenser.ActualFanPower = ActualFanPower; - condenser.FanElecEnergy = ActualFanPower * LocalTimeStep * DataGlobals::SecInHour; + condenser.FanElecEnergy = ActualFanPower * LocalTimeStep * DataGlobalConstants::SecInHour(); condenser.EvapWaterConsumpRate = TotalEvapWaterUseRate; - condenser.EvapWaterConsumption = TotalEvapWaterUseRate * LocalTimeStep * DataGlobals::SecInHour; + condenser.EvapWaterConsumption = TotalEvapWaterUseRate * LocalTimeStep * DataGlobalConstants::SecInHour(); condenser.ActualEvapPumpPower = TotalCondenserPumpPower; - condenser.EvapPumpConsumption = TotalCondenserPumpPower * LocalTimeStep * DataGlobals::SecInHour; + condenser.EvapPumpConsumption = TotalCondenserPumpPower * LocalTimeStep * DataGlobalConstants::SecInHour(); condenser.BasinHeaterPower = TotalBasinHeatPower; - condenser.BasinHeaterConsumption = TotalBasinHeatPower * LocalTimeStep * DataGlobals::SecInHour; + condenser.BasinHeaterConsumption = TotalBasinHeatPower * LocalTimeStep * DataGlobalConstants::SecInHour(); condenser.CondLoad = TotalCondenserHeat; - condenser.CondEnergy = TotalCondenserHeat * LocalTimeStep * DataGlobals::SecInHour; + condenser.CondEnergy = TotalCondenserHeat * LocalTimeStep * DataGlobalConstants::SecInHour(); condenser.CondCreditWarnIndex1 = CondCreditWarnIndex1; condenser.CondCreditWarnIndex2 = CondCreditWarnIndex2; condenser.CondCreditWarnIndex3 = CondCreditWarnIndex3; @@ -11656,11 +11656,11 @@ namespace RefrigeratedCase { condenser.CondCreditWarnIndex5 = CondCreditWarnIndex5; condenser.CondCreditWarnIndex6 = CondCreditWarnIndex6; condenser.CondCreditWarnIndex7 = CondCreditWarnIndex7; - condenser.ExternalEnergyRecovered = condenser.ExternalHeatRecoveredLoad * LocalTimeStep * DataGlobals::SecInHour; - condenser.InternalEnergyRecovered = condenser.InternalHeatRecoveredLoad * LocalTimeStep * DataGlobals::SecInHour; - condenser.TotalHeatRecoveredEnergy = condenser.TotalHeatRecoveredLoad * LocalTimeStep * DataGlobals::SecInHour; + condenser.ExternalEnergyRecovered = condenser.ExternalHeatRecoveredLoad * LocalTimeStep * DataGlobalConstants::SecInHour(); + condenser.InternalEnergyRecovered = condenser.InternalHeatRecoveredLoad * LocalTimeStep * DataGlobalConstants::SecInHour(); + condenser.TotalHeatRecoveredEnergy = condenser.TotalHeatRecoveredLoad * LocalTimeStep * DataGlobalConstants::SecInHour(); this->NetHeatRejectLoad = TotalCondenserHeat * TotalLoadFromThisSystem / TotalLoadFromSystems; - this->NetHeatRejectEnergy = this->NetHeatRejectLoad * LocalTimeStep * DataGlobals::SecInHour; + this->NetHeatRejectEnergy = this->NetHeatRejectLoad * LocalTimeStep * DataGlobalConstants::SecInHour(); // set water system demand request (if needed) if (condenser.EvapWaterSupplyMode == WaterSupplyFromTank) { @@ -11831,14 +11831,14 @@ namespace RefrigeratedCase { } // fan speed control type GasCooler(GasCoolerID).ActualFanPower = ActualFanPower; - GasCooler(GasCoolerID).FanElecEnergy = ActualFanPower * LocalTimeStep * DataGlobals::SecInHour; + GasCooler(GasCoolerID).FanElecEnergy = ActualFanPower * LocalTimeStep * DataGlobalConstants::SecInHour(); GasCooler(GasCoolerID).GasCoolerLoad = TotalGasCoolerHeat; - GasCooler(GasCoolerID).GasCoolerEnergy = TotalGasCoolerHeat * LocalTimeStep * DataGlobals::SecInHour; + GasCooler(GasCoolerID).GasCoolerEnergy = TotalGasCoolerHeat * LocalTimeStep * DataGlobalConstants::SecInHour(); GasCooler(GasCoolerID).GasCoolerCreditWarnIndex = GasCoolerCreditWarnIndex; - GasCooler(GasCoolerID).InternalEnergyRecovered = GasCooler(GasCoolerID).InternalHeatRecoveredLoad * LocalTimeStep * DataGlobals::SecInHour; - GasCooler(GasCoolerID).TotalHeatRecoveredEnergy = GasCooler(GasCoolerID).TotalHeatRecoveredLoad * LocalTimeStep * DataGlobals::SecInHour; + GasCooler(GasCoolerID).InternalEnergyRecovered = GasCooler(GasCoolerID).InternalHeatRecoveredLoad * LocalTimeStep * DataGlobalConstants::SecInHour(); + GasCooler(GasCoolerID).TotalHeatRecoveredEnergy = GasCooler(GasCoolerID).TotalHeatRecoveredLoad * LocalTimeStep * DataGlobalConstants::SecInHour(); this->NetHeatRejectLoad = TotalGasCoolerHeat * TotalLoadFromThisSystem / TotalLoadFromSystems; - this->NetHeatRejectEnergy = this->NetHeatRejectLoad * LocalTimeStep * DataGlobals::SecInHour; + this->NetHeatRejectEnergy = this->NetHeatRejectLoad * LocalTimeStep * DataGlobalConstants::SecInHour(); } void RefrigSystemData::CalculateCompressors(EnergyPlusData &state) @@ -11899,7 +11899,7 @@ namespace RefrigeratedCase { Real64 LocalTimeStep = DataGlobals::TimeStepZone; if (UseSysTimeStep) LocalTimeStep = DataHVACGlobals::TimeStepSys; - Real64 const LocalTimeStepSec(LocalTimeStep * DataGlobals::SecInHour); + Real64 const LocalTimeStepSec(LocalTimeStep * DataGlobalConstants::SecInHour()); int CondID = this->CondenserNum(1); auto const &Condenser1(Condenser(CondID)); @@ -12282,12 +12282,12 @@ namespace RefrigeratedCase { Real64 AccumLoadLT; NeededCapacityLT = 0.0; if (this->TransSysType == 2) { - AccumLoadLT = max(0.0, (this->UnmetEnergyLT / LocalTimeStep / DataGlobals::SecInHour)); + AccumLoadLT = max(0.0, (this->UnmetEnergyLT / LocalTimeStep / DataGlobalConstants::SecInHour())); NeededCapacityLT = this->TotalSystemLoadLT + AccumLoadLT + this->PipeHeatLoadLT; } // (TransSystem(SysNum)%TransSysType == 2) // Load due to previously unmet medium temperature compressor loads (transcritical system) - Real64 AccumLoadMT = max(0.0, (this->UnmetEnergyMT / LocalTimeStep / DataGlobals::SecInHour)); + Real64 AccumLoadMT = max(0.0, (this->UnmetEnergyMT / LocalTimeStep / DataGlobalConstants::SecInHour())); NeededCapacityMT = this->TotalSystemLoadMT + AccumLoadMT + this->PipeHeatLoadMT; // Determine refrigerant properties at receiver @@ -12367,8 +12367,8 @@ namespace RefrigeratedCase { Compressor(CompID).Capacity = CapacityCorrectionLT * CurveManager::CurveValue(state, Compressor(CompID).CapacityCurvePtr, TsatforPsucLT, TsatforPdisLT); Compressor(CompID).MassFlow = Compressor(CompID).Capacity / TotalEnthalpyChangeActualLT; - Compressor(CompID).ElecConsumption = Compressor(CompID).Power * LocalTimeStep * DataGlobals::SecInHour; - Compressor(CompID).CoolingEnergy = Compressor(CompID).Capacity * LocalTimeStep * DataGlobals::SecInHour; + Compressor(CompID).ElecConsumption = Compressor(CompID).Power * LocalTimeStep * DataGlobalConstants::SecInHour(); + Compressor(CompID).CoolingEnergy = Compressor(CompID).Capacity * LocalTimeStep * DataGlobalConstants::SecInHour(); Compressor(CompID).LoadFactor = 1.0; if ((this->TotCompCapacityLP + Compressor(CompID).Capacity) >= NeededCapacityLT) { LFLastComp = (NeededCapacityLT - this->TotCompCapacityLP) / Compressor(CompID).Capacity; @@ -12378,8 +12378,8 @@ namespace RefrigeratedCase { this->TotCompCapacityLP += Compressor(CompID).Capacity; this->RefMassFlowCompsLP += Compressor(CompID).MassFlow; this->TotCompPowerLP += Compressor(CompID).Power; - Compressor(CompID).ElecConsumption = Compressor(CompID).Power * LocalTimeStep * DataGlobals::SecInHour; - Compressor(CompID).CoolingEnergy = Compressor(CompID).Capacity * LocalTimeStep * DataGlobals::SecInHour; + Compressor(CompID).ElecConsumption = Compressor(CompID).Power * LocalTimeStep * DataGlobalConstants::SecInHour(); + Compressor(CompID).CoolingEnergy = Compressor(CompID).Capacity * LocalTimeStep * DataGlobalConstants::SecInHour(); Compressor(CompID).LoadFactor = LFLastComp; break; } else { @@ -12561,8 +12561,8 @@ namespace RefrigeratedCase { // Mass flow through HP compressors is HP compressor refrigerating capacity divided by MT load, LT load and LP compressor power Compressor(CompID).MassFlow = TotalRefMassFlow * Compressor(CompID).Capacity / (NeededCapacityMT + NeededCapacityLT + this->TotCompPowerLP); - Compressor(CompID).ElecConsumption = Compressor(CompID).Power * LocalTimeStep * DataGlobals::SecInHour; - Compressor(CompID).CoolingEnergy = Compressor(CompID).Capacity * LocalTimeStep * DataGlobals::SecInHour; + Compressor(CompID).ElecConsumption = Compressor(CompID).Power * LocalTimeStep * DataGlobalConstants::SecInHour(); + Compressor(CompID).CoolingEnergy = Compressor(CompID).Capacity * LocalTimeStep * DataGlobalConstants::SecInHour(); Compressor(CompID).LoadFactor = 1.0; // calculate load factor for last compressor added // assumes either cycling or part load eff = full load eff for last compressor @@ -12574,8 +12574,8 @@ namespace RefrigeratedCase { this->TotCompCapacityHP += Compressor(CompID).Capacity; this->RefMassFlowCompsHP += Compressor(CompID).MassFlow; this->TotCompPowerHP += Compressor(CompID).Power; - Compressor(CompID).ElecConsumption = Compressor(CompID).Power * LocalTimeStep * DataGlobals::SecInHour; - Compressor(CompID).CoolingEnergy = Compressor(CompID).Capacity * LocalTimeStep * DataGlobals::SecInHour; + Compressor(CompID).ElecConsumption = Compressor(CompID).Power * LocalTimeStep * DataGlobalConstants::SecInHour(); + Compressor(CompID).CoolingEnergy = Compressor(CompID).Capacity * LocalTimeStep * DataGlobalConstants::SecInHour(); Compressor(CompID).LoadFactor = LFLastComp; break; } else { @@ -12590,8 +12590,8 @@ namespace RefrigeratedCase { this->RefMassFlowComps = this->RefMassFlowCompsLP + this->RefMassFlowCompsHP; this->TotCompCapacity = this->TotCompCapacityHP + this->TotCompCapacityLP; this->AverageCompressorCOP = (this->TotCompCapacityHP - this->TotCompPowerLP) / (this->TotCompPowerLP + this->TotCompPowerHP); - this->TotCompElecConsump = (this->TotCompPowerLP + this->TotCompPowerHP) * LocalTimeStep * DataGlobals::SecInHour; - this->TotCompCoolingEnergy = (this->TotCompCapacityLP + this->TotCompCapacityHP) * LocalTimeStep * DataGlobals::SecInHour; + this->TotCompElecConsump = (this->TotCompPowerLP + this->TotCompPowerHP) * LocalTimeStep * DataGlobalConstants::SecInHour(); + this->TotCompCoolingEnergy = (this->TotCompCapacityLP + this->TotCompCapacityHP) * LocalTimeStep * DataGlobalConstants::SecInHour(); } void RefrigSystemData::CalculateSubcoolers(EnergyPlusData &state) @@ -12679,7 +12679,7 @@ namespace RefrigeratedCase { int SysProvideID = Subcooler(SubcoolerID).MechSourceSysID; System(SysProvideID).MechSCLoad(SubcoolerID) = mechSCLoad; Subcooler(SubcoolerID).MechSCTransLoad = mechSCLoad; - Subcooler(SubcoolerID).MechSCTransEnergy = mechSCLoad * LocalTimeStep * DataGlobals::SecInHour; + Subcooler(SubcoolerID).MechSCTransEnergy = mechSCLoad * LocalTimeStep * DataGlobalConstants::SecInHour(); // Reset inlet temperature for any LSHX that follows this mech subcooler TLiqInActualLocal = ControlTLiqOut; this->TCompIn = this->TEvapNeeded + CaseSuperheat; @@ -12694,7 +12694,7 @@ namespace RefrigeratedCase { this->TCompIn = TVapInActual + SubcoolerSupHeat; this->HCaseIn -= SubcoolLoad / this->RefMassFlowtoLoads; this->LSHXTrans = SubcoolLoad; - this->LSHXTransEnergy = SubcoolLoad * LocalTimeStep * DataGlobals::SecInHour; + this->LSHXTransEnergy = SubcoolLoad * LocalTimeStep * DataGlobalConstants::SecInHour(); } } @@ -13733,7 +13733,7 @@ namespace RefrigeratedCase { // Reduce defrost heat load on walkin by amount of ice melted during time step Real64 FrostChangekg = min(AvailDefrostEnergy / IceMeltEnthalpy, StartFrostKg); if (FrostChangekg < StartFrostKg) { - DefrostLoad -= FrostChangekg * IceMeltEnthalpy / DataGlobals::TimeStepZone / DataGlobals::SecInHour; + DefrostLoad -= FrostChangekg * IceMeltEnthalpy / DataGlobals::TimeStepZone / DataGlobalConstants::SecInHour(); if (!DataGlobals::WarmupFlag) this->KgFrost = StartFrostKg - FrostChangekg; // DefrostSchedule not changed } else { // all frost melted during time step, so need to terminate defrost @@ -13758,7 +13758,7 @@ namespace RefrigeratedCase { } else { // Not temperature control type Real64 FrostChangekg = min(DefrostEnergy / IceMeltEnthalpy, StartFrostKg); // Reduce defrost heat load on walkin by amount of ice melted during time step - DefrostLoad -= FrostChangekg * IceMeltEnthalpy / DataGlobals::TimeStepZone / DataGlobals::SecInHour; + DefrostLoad -= FrostChangekg * IceMeltEnthalpy / DataGlobals::TimeStepZone / DataGlobalConstants::SecInHour(); if (!DataGlobals::WarmupFlag) this->KgFrost = StartFrostKg - FrostChangekg; // DefrostSchedule not changed } // Temperature termination control type @@ -13796,7 +13796,7 @@ namespace RefrigeratedCase { // run full out until the temperature is brought back down. // Rate needed to serve all stored energy during single time step (W) - Real64 StoredEnergyRate = this->StoredEnergy / DataGlobals::TimeStepZone / DataGlobals::SecInHour; + Real64 StoredEnergyRate = this->StoredEnergy / DataGlobals::TimeStepZone / DataGlobalConstants::SecInHour(); Real64 LoadRequested = LoadTotal + StoredEnergyRate; // Load necessary to meet current and all stored energy needs (W) Real64 LatentCapApplied; // Walk In latent capacity at specific operating conditions @@ -14083,7 +14083,7 @@ namespace RefrigeratedCase { // (e.g. as it may be following defrost cycles on cases or walk-ins served by secondary loop) // save the unmet/stored load to be met in succeeding time steps. if (this->NumCoils == 0) { - StoredEnergyRate = max(0.0, (this->UnmetEnergy / DataGlobals::TimeStepZone / DataGlobals::SecInHour)); + StoredEnergyRate = max(0.0, (this->UnmetEnergy / DataGlobals::TimeStepZone / DataGlobalConstants::SecInHour())); // Load necessary to meet current and all stored energy needs (W) Real64 LoadRequested = TotalLoad + StoredEnergyRate; if (this->MaxLoad > LoadRequested) { @@ -14115,16 +14115,16 @@ namespace RefrigeratedCase { // Bug TotalCoolingLoad not set but used below } // no air coils on secondary loop this->PumpPowerTotal = TotalPumpPower; - this->PumpElecEnergyTotal = TotalPumpPower * LocalTimeStep * DataGlobals::SecInHour; + this->PumpElecEnergyTotal = TotalPumpPower * LocalTimeStep * DataGlobalConstants::SecInHour(); this->TotalRefrigLoad = RefrigerationLoad; - this->TotalRefrigEnergy = RefrigerationLoad * LocalTimeStep * DataGlobals::SecInHour; - this->TotalCoolingEnergy = TotalCoolingLoad * LocalTimeStep * DataGlobals::SecInHour; + this->TotalRefrigEnergy = RefrigerationLoad * LocalTimeStep * DataGlobalConstants::SecInHour(); + this->TotalCoolingEnergy = TotalCoolingLoad * LocalTimeStep * DataGlobalConstants::SecInHour(); this->FlowVolActual = VolFlowRate; this->HotDefrostCondCredit = TotalHotDefrostCondCredit; this->DistPipeHeatGain = distPipeHeatGain; - this->DistPipeHeatGainEnergy = distPipeHeatGain * LocalTimeStep * DataGlobals::SecInHour; + this->DistPipeHeatGainEnergy = distPipeHeatGain * LocalTimeStep * DataGlobalConstants::SecInHour(); this->ReceiverHeatGain = receiverHeatGain; - this->ReceiverHeatGainEnergy = receiverHeatGain * LocalTimeStep * DataGlobals::SecInHour; + this->ReceiverHeatGainEnergy = receiverHeatGain * LocalTimeStep * DataGlobalConstants::SecInHour(); } void SumZoneImpacts() @@ -14393,7 +14393,7 @@ namespace RefrigeratedCase { System(SystemID).InsuffCapWarn); DeRateFactor = AvailableTotalLoad / InitialTotalLoad; - Real64 const time_step_sec(DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + Real64 const time_step_sec(DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); for (int CoilIndex = 1; CoilIndex <= NumCoils; ++CoilIndex) { int CoilID = System(SystemID).CoilNum(CoilIndex); auto &warehouse_coil(WarehouseCoil(CoilID)); @@ -14708,7 +14708,7 @@ namespace RefrigeratedCase { // FROST: keep track of frost build up on evaporator coil // avoid accumulation during warm-up to avoid reverse dd test problem if (!DataGlobals::WarmupFlag) { - FrostChangekg = (WaterRemovRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + FrostChangekg = (WaterRemovRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); this->KgFrost += FrostChangekg; } @@ -14726,7 +14726,7 @@ namespace RefrigeratedCase { // a certain temperature (such as when there's no load and no ice) if ((DefrostSchedule > 0.0) && (this->DefrostType != DefrostNone) && (this->DefrostType != DefrostOffCycle)) { DefrostLoad = DefrostCap * DefrostSchedule; // Part of the defrost that is a heat load on the zone (W) - Real64 DefrostEnergy = DefrostLoad * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; // Joules + Real64 DefrostEnergy = DefrostLoad * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); // Joules Real64 StartFrostKg = this->KgFrost; // frost load at start of time step (kg of ice) if (this->DefrostControlType == DefrostContTempTerm) { @@ -14753,7 +14753,7 @@ namespace RefrigeratedCase { // Reduce defrost heat load on walkin by amount of ice melted during time step FrostChangekg = min(AvailDefrostEnergy / IceMeltEnthalpy, StartFrostKg); if (FrostChangekg < StartFrostKg) { - DefrostLoad -= FrostChangekg * IceMeltEnthalpy / DataHVACGlobals::TimeStepSys / DataGlobals::SecInHour; + DefrostLoad -= FrostChangekg * IceMeltEnthalpy / DataHVACGlobals::TimeStepSys / DataGlobalConstants::SecInHour(); if (!DataGlobals::WarmupFlag) this->KgFrost = StartFrostKg - FrostChangekg; // DefrostSchedule not changed because ice not all melted, temp term not triggered } else { // all frost melted during time step, so need to terminate defrost @@ -14762,11 +14762,11 @@ namespace RefrigeratedCase { Real64 DefrostEnergyNeeded = (IceSensHeatNeeded + (FrostChangekg * IceMeltEnthalpy)) / this->DefEnergyFraction; // Joules - energy needed including E unavail to melt ice DefrostSchedule = - min(DefrostSchedule, (DefrostEnergyNeeded / (DefrostCap * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour))); + min(DefrostSchedule, (DefrostEnergyNeeded / (DefrostCap * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()))); // reduce heat load on warehouse by energy put into ice melting // Defrost load that actually goes to melting ice (W) Real64 DefrostRateNeeded = - (IceSensHeatNeeded + (FrostChangekg * IceMeltEnthalpy)) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + (IceSensHeatNeeded + (FrostChangekg * IceMeltEnthalpy)) / (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); DefrostLoad = max(0.0, (DefrostSchedule * DefrostCap - DefrostRateNeeded)); this->IceTemp = this->TEvapDesign; } // frost melted during time step less than amount of ice at start @@ -14783,7 +14783,7 @@ namespace RefrigeratedCase { // Reduce defrost heat load on the zone by amount of ice melted during time step // But DefrostSchedule not changed FrostChangekg = max(0.0, min((DefrostEnergy / IceMeltEnthalpy), StartFrostKg)); - DefrostLoad -= FrostChangekg * IceMeltEnthalpy / DataHVACGlobals::TimeStepSys / DataGlobals::SecInHour; + DefrostLoad -= FrostChangekg * IceMeltEnthalpy / DataHVACGlobals::TimeStepSys / DataGlobalConstants::SecInHour(); if (!DataGlobals::WarmupFlag) this->KgFrost = StartFrostKg - FrostChangekg; } // Temperature termination vs. time-clock control type @@ -14797,7 +14797,7 @@ namespace RefrigeratedCase { // ReportWarehouseCoil(CoilID) this->ThermalDefrostPower = DefrostLoad; if (this->DefrostType == DefrostElec) { - this->ElecDefrostConsumption = DefrostCap * DefrostSchedule * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->ElecDefrostConsumption = DefrostCap * DefrostSchedule * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); this->ElecDefrostPower = DefrostCap * DefrostSchedule; } else { this->ElecDefrostConsumption = 0.0; @@ -14809,22 +14809,22 @@ namespace RefrigeratedCase { // LatentLoadServed is positive for latent heat removed from zone // SensLoadFromZone positive for heat REMOVED from zone, switch when do credit to zone this->SensCreditRate = SensLoadFromZone; - this->SensCreditEnergy = SensLoadFromZone * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->SensCreditEnergy = SensLoadFromZone * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); this->LatCreditRate = latLoadServed; - this->LatCreditEnergy = latLoadServed * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->LatCreditEnergy = latLoadServed * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); this->LatKgPerS_ToZone = WaterRemovRate; this->TotalCoolingLoad = CoilCapTotal; - this->TotalCoolingEnergy = CoilCapTotal * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->TotalCoolingEnergy = CoilCapTotal * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); this->SensCoolingEnergyRate = SensLoadGross; - this->SensCoolingEnergy = SensLoadGross * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->SensCoolingEnergy = SensLoadGross * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); this->SensHeatRatio = SHR; this->ElecFanPower = FanPowerActual; - this->ElecFanConsumption = FanPowerActual * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->ElecFanConsumption = FanPowerActual * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); this->ElecHeaterPower = HeaterLoad; - this->ElecHeaterConsumption = HeaterLoad * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->ElecHeaterConsumption = HeaterLoad * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); this->TotalElecPower = FanPowerActual + HeaterLoad + this->ElecDefrostPower; - this->TotalElecConsumption = this->TotalElecPower * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->TotalElecConsumption = this->TotalElecPower * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); if (this->SensCreditRate >= 0.0) { this->ReportSensCoolCreditRate = this->SensCreditRate; @@ -14833,8 +14833,8 @@ namespace RefrigeratedCase { this->ReportSensCoolCreditRate = 0.0; this->ReportHeatingCreditRate = -this->SensCreditRate; } - this->ReportSensCoolCreditEnergy = this->ReportSensCoolCreditRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - this->ReportHeatingCreditEnergy = this->ReportHeatingCreditRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->ReportSensCoolCreditEnergy = this->ReportSensCoolCreditRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + this->ReportHeatingCreditEnergy = this->ReportHeatingCreditRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); this->ReportTotalCoolCreditRate = this->ReportSensCoolCreditRate + this->LatCreditRate; this->ReportTotalCoolCreditEnergy = this->ReportSensCoolCreditEnergy + this->LatCreditEnergy; diff --git a/src/EnergyPlus/RefrigeratedCase.hh b/src/EnergyPlus/RefrigeratedCase.hh index 38ea955797a..bff917be31f 100644 --- a/src/EnergyPlus/RefrigeratedCase.hh +++ b/src/EnergyPlus/RefrigeratedCase.hh @@ -1429,7 +1429,6 @@ namespace RefrigeratedCase { { // Members std::string Name; // Name of Chiller Set - // CHARACTER(len=MaxNameLength), ALLOCATABLE, DIMENSION(:) :: CoilName ! Name of Individual Chiller in set std::string ZoneName; // Name of zone where chiller set is located Array1D_int CoilNum; // ID number of Individual Chiller in set int ChillerSetID; // ID number for this set of chillers (all serving one zone, diff --git a/src/EnergyPlus/ResultsFramework.cc b/src/EnergyPlus/ResultsFramework.cc index 7719e477069..bf34c9bd68b 100644 --- a/src/EnergyPlus/ResultsFramework.cc +++ b/src/EnergyPlus/ResultsFramework.cc @@ -78,7 +78,6 @@ namespace ResultsFramework { using namespace OutputProcessor; using DataGlobals::DisplayExtraWarnings; using DataGlobals::InitConvTemp; - using DataGlobals::SecInHour; using OutputProcessor::RealVariableType; using OutputProcessor::RealVariables; diff --git a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc index 6467419c149..00c9ac9e274 100644 --- a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc +++ b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc @@ -115,7 +115,6 @@ namespace RoomAirModelAirflowNetwork { // Using/Aliasing using namespace DataPrecisionGlobals; - using DataGlobals::MaxNameLength; using DataGlobals::NumOfZones; using namespace DataRoomAirModel; using namespace DataHeatBalSurface; @@ -656,7 +655,6 @@ namespace RoomAirModelAirflowNetwork { // Using/Aliasing using DataEnvironment::OutBaroPress; - using DataGlobals::SecInHour; using DataHeatBalFanSys::MAT; using DataHeatBalFanSys::ZoneAirHumRat; using DataHVACGlobals::TimeStepSys; @@ -711,7 +709,7 @@ namespace RoomAirModelAirflowNetwork { TempDepCoef = ThisRAFNNode.SumHA + ThisRAFNNode.SumLinkMCp + ThisRAFNNode.SumSysMCp; TempIndCoef = ThisRAFNNode.SumIntSensibleGain + ThisRAFNNode.SumHATsurf - ThisRAFNNode.SumHATref + ThisRAFNNode.SumLinkMCpT + ThisRAFNNode.SumSysMCpT + ThisRAFNNode.NonAirSystemResponse + ThisRAFNNode.SysDepZoneLoadsLagged; - AirCap = ThisRAFNNode.AirVolume * Zone(ZoneNum).ZoneVolCapMultpSens * ThisRAFNNode.RhoAir * ThisRAFNNode.CpAir / (TimeStepSys * SecInHour); + AirCap = ThisRAFNNode.AirVolume * Zone(ZoneNum).ZoneVolCapMultpSens * ThisRAFNNode.RhoAir * ThisRAFNNode.CpAir / (TimeStepSys * DataGlobalConstants::SecInHour()); if (ZoneAirSolutionAlgo == UseAnalyticalSolution) { if (TempDepCoef == 0.0) { // B=0 @@ -732,7 +730,7 @@ namespace RoomAirModelAirflowNetwork { H2OHtOfVap = PsyHgAirFnWTdb(ThisRAFNNode.HumRat, ThisRAFNNode.AirTemp); A = ThisRAFNNode.SumLinkM + ThisRAFNNode.SumHmARa + ThisRAFNNode.SumSysM; B = (ThisRAFNNode.SumIntLatentGain / H2OHtOfVap) + ThisRAFNNode.SumSysMW + ThisRAFNNode.SumLinkMW + ThisRAFNNode.SumHmARaW; - C = ThisRAFNNode.RhoAir * ThisRAFNNode.AirVolume * Zone(ZoneNum).ZoneVolCapMultpMoist / (SecInHour * TimeStepSys); + C = ThisRAFNNode.RhoAir * ThisRAFNNode.AirVolume * Zone(ZoneNum).ZoneVolCapMultpMoist / (DataGlobalConstants::SecInHour() * TimeStepSys); // Exact solution if (ZoneAirSolutionAlgo == UseAnalyticalSolution) { @@ -861,7 +859,6 @@ namespace RoomAirModelAirflowNetwork { // USE STATEMENTS: using DataDefineEquip::AirDistUnit; using DataGlobals::NumOfZones; - using DataGlobals::SecInHour; using DataGlobals::TimeStepZone; using DataHeatBalance::Zone; using DataHeatBalFanSys::MAT; @@ -1090,13 +1087,13 @@ namespace RoomAirModelAirflowNetwork { SurfWinHeatTransfer(SurfNum) += SurfWinRetHeatGainToZoneAir(SurfNum); if (SurfWinHeatGain(SurfNum) >= 0.0) { SurfWinHeatGainRep(SurfNum) = SurfWinHeatGain(SurfNum); - SurfWinHeatGainRepEnergy(SurfNum) = SurfWinHeatGainRep(SurfNum) * TimeStepZone * SecInHour; + SurfWinHeatGainRepEnergy(SurfNum) = SurfWinHeatGainRep(SurfNum) * TimeStepZone * DataGlobalConstants::SecInHour(); } else { SurfWinHeatLossRep(SurfNum) = - SurfWinHeatGain(SurfNum); - SurfWinHeatLossRepEnergy(SurfNum) = SurfWinHeatLossRep(SurfNum) * TimeStepZone * SecInHour; + SurfWinHeatLossRepEnergy(SurfNum) = SurfWinHeatLossRep(SurfNum) * TimeStepZone * DataGlobalConstants::SecInHour(); } SurfWinHeatTransfer(SurfNum) = SurfWinHeatGain(SurfNum); - SurfWinHeatTransferRepEnergy(SurfNum) = SurfWinHeatGain(SurfNum) * TimeStepZone * SecInHour; + SurfWinHeatTransferRepEnergy(SurfNum) = SurfWinHeatGain(SurfNum) * TimeStepZone * DataGlobalConstants::SecInHour(); } } diff --git a/src/EnergyPlus/RoomAirModelManager.cc b/src/EnergyPlus/RoomAirModelManager.cc index 2b8744fe6f0..d7bb95db658 100644 --- a/src/EnergyPlus/RoomAirModelManager.cc +++ b/src/EnergyPlus/RoomAirModelManager.cc @@ -110,7 +110,7 @@ namespace RoomAirModelManager { // Using/Aliasing using namespace DataPrecisionGlobals; - using namespace DataGlobals; // , ONLY : MaxNameLength + using namespace DataGlobals; using namespace DataRoomAirModel; using General::RoundSigDigits; diff --git a/src/EnergyPlus/RuntimeLanguageProcessor.cc b/src/EnergyPlus/RuntimeLanguageProcessor.cc index 7c09c8234a4..b9ee43252c3 100644 --- a/src/EnergyPlus/RuntimeLanguageProcessor.cc +++ b/src/EnergyPlus/RuntimeLanguageProcessor.cc @@ -523,8 +523,6 @@ namespace RuntimeLanguageProcessor { Array1D_bool ReadyForElse(IfDepthAllowed); Array1D_bool ReadyForEndif(IfDepthAllowed); - // CHARACTER(len=2*MaxNameLength), DIMENSION(:), ALLOCATABLE :: DummyError - // FLOW: LineNum = 1; NestedIfDepth = 0; @@ -2639,8 +2637,6 @@ namespace RuntimeLanguageProcessor { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int GlobalNum; int StackNum; - // unused0909 INTEGER :: NumPrograms - // unused0909 INTEGER :: NumFunctions int ErrorNum; int NumAlphas; // Number of elements in the alpha array int NumNums; // Number of elements in the numeric array @@ -2648,8 +2644,6 @@ namespace RuntimeLanguageProcessor { bool ErrorsFound(false); int VariableNum(0); // temporary int RuntimeReportVarNum; - // unused0909 INTEGER :: Pos - // unused0909 CHARACTER(len=MaxNameLength) :: VariableName bool Found; static std::string FreqString; // temporary static std::string VarTypeString; // temporary diff --git a/src/EnergyPlus/SimulationManager.cc b/src/EnergyPlus/SimulationManager.cc index 230de4cbcb5..52f589a8364 100644 --- a/src/EnergyPlus/SimulationManager.cc +++ b/src/EnergyPlus/SimulationManager.cc @@ -993,7 +993,7 @@ namespace SimulationManager { TimeStepZone = 1.0 / double(NumOfTimeStepInHour); MinutesPerTimeStep = TimeStepZone * 60; - TimeStepZoneSec = TimeStepZone * SecInHour; + TimeStepZoneSec = TimeStepZone * DataGlobalConstants::SecInHour(); CurrentModuleObject = "ConvergenceLimits"; Num = inputProcessor->getNumObjectsFound(CurrentModuleObject); @@ -1327,7 +1327,7 @@ namespace SimulationManager { DataGlobals::NumOfTimeStepInHour = 1; DataGlobals::TimeStepZone = 1.0 / double(DataGlobals::NumOfTimeStepInHour); DataGlobals::MinutesPerTimeStep = DataGlobals::TimeStepZone * 60; - DataGlobals::TimeStepZoneSec = DataGlobals::TimeStepZone * SecInHour; + DataGlobals::TimeStepZoneSec = DataGlobals::TimeStepZone * DataGlobalConstants::SecInHour(); } if (overrideZoneAirHeatBalAlg) { ShowWarningError( diff --git a/src/EnergyPlus/SolarCollectors.cc b/src/EnergyPlus/SolarCollectors.cc index d4c13cc464c..a06cf7aabff 100644 --- a/src/EnergyPlus/SolarCollectors.cc +++ b/src/EnergyPlus/SolarCollectors.cc @@ -1262,7 +1262,7 @@ namespace SolarCollectors { int SurfNum = this->Surface; int ParamNum = this->Parameters; - Real64 SecInTimeStep = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + Real64 SecInTimeStep = DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); Real64 TempWater = this->SavedTempOfWater; Real64 TempAbsPlate = this->SavedTempOfAbsPlate; Real64 TempOutdoorAir = DataSurfaces::Surface(SurfNum).OutDryBulbTemp; @@ -2010,7 +2010,7 @@ namespace SolarCollectors { // PURPOSE OF THIS SUBROUTINE: // Calculates report variables. - Real64 TimeStepInSecond = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + Real64 TimeStepInSecond = DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); this->Energy = this->Power * TimeStepInSecond; this->HeatEnergy = this->HeatRate * TimeStepInSecond; diff --git a/src/EnergyPlus/SteamBaseboardRadiator.cc b/src/EnergyPlus/SteamBaseboardRadiator.cc index 2da24d903bc..b74f6778e16 100644 --- a/src/EnergyPlus/SteamBaseboardRadiator.cc +++ b/src/EnergyPlus/SteamBaseboardRadiator.cc @@ -1472,10 +1472,10 @@ namespace SteamBaseboardRadiator { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - SteamBaseboard(BaseboardNum).TotEnergy = SteamBaseboard(BaseboardNum).TotPower * TimeStepSys * SecInHour; - SteamBaseboard(BaseboardNum).Energy = SteamBaseboard(BaseboardNum).Power * TimeStepSys * SecInHour; - SteamBaseboard(BaseboardNum).ConvEnergy = SteamBaseboard(BaseboardNum).ConvPower * TimeStepSys * SecInHour; - SteamBaseboard(BaseboardNum).RadEnergy = SteamBaseboard(BaseboardNum).RadPower * TimeStepSys * SecInHour; + SteamBaseboard(BaseboardNum).TotEnergy = SteamBaseboard(BaseboardNum).TotPower * TimeStepSys * DataGlobalConstants::SecInHour(); + SteamBaseboard(BaseboardNum).Energy = SteamBaseboard(BaseboardNum).Power * TimeStepSys * DataGlobalConstants::SecInHour(); + SteamBaseboard(BaseboardNum).ConvEnergy = SteamBaseboard(BaseboardNum).ConvPower * TimeStepSys * DataGlobalConstants::SecInHour(); + SteamBaseboard(BaseboardNum).RadEnergy = SteamBaseboard(BaseboardNum).RadPower * TimeStepSys * DataGlobalConstants::SecInHour(); } Real64 SumHATsurf(int const ZoneNum) // Zone number diff --git a/src/EnergyPlus/SteamCoils.cc b/src/EnergyPlus/SteamCoils.cc index 3bfc4eaad6c..9f01c5654d9 100644 --- a/src/EnergyPlus/SteamCoils.cc +++ b/src/EnergyPlus/SteamCoils.cc @@ -1595,7 +1595,7 @@ namespace SteamCoils { // na // Report the SteamCoil energy from this component - SteamCoil(CoilNum).TotSteamHeatingCoilEnergy = SteamCoil(CoilNum).TotSteamHeatingCoilRate * TimeStepSys * SecInHour; + SteamCoil(CoilNum).TotSteamHeatingCoilEnergy = SteamCoil(CoilNum).TotSteamHeatingCoilRate * TimeStepSys * DataGlobalConstants::SecInHour(); } // End of Reporting subroutines for the SteamCoil Module diff --git a/src/EnergyPlus/SurfaceGeometry.cc b/src/EnergyPlus/SurfaceGeometry.cc index 1ed22db7b18..1b2b7e288c9 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -13090,7 +13090,7 @@ namespace SurfaceGeometry { DataHeatBalance::AirBoundaryMixingZone2.push_back(zoneNum2); DataHeatBalance::AirBoundaryMixingSched.push_back(state.dataConstruction->Construct(surf.Construction).AirBoundaryMixingSched); Real64 mixingVol = state.dataConstruction->Construct(surf.Construction).AirBoundaryACH * min(Zone(zoneNum1).Volume, Zone(zoneNum2).Volume) / - DataGlobals::SecInHour; + DataGlobalConstants::SecInHour(); DataHeatBalance::AirBoundaryMixingVol.push_back(mixingVol); } } diff --git a/src/EnergyPlus/SurfaceGroundHeatExchanger.cc b/src/EnergyPlus/SurfaceGroundHeatExchanger.cc index 9dc6c62246f..e89a3d6ab5f 100644 --- a/src/EnergyPlus/SurfaceGroundHeatExchanger.cc +++ b/src/EnergyPlus/SurfaceGroundHeatExchanger.cc @@ -1453,7 +1453,6 @@ namespace SurfaceGroundHeatExchanger { // This subroutine simply produces output for Surface ground heat exchangers // Using/Aliasing - using DataGlobals::SecInHour; using DataHVACGlobals::TimeStepSys; using DataLoopNode::Node; @@ -1465,12 +1464,12 @@ namespace SurfaceGroundHeatExchanger { // update other variables from module variables this->HeatTransferRate = SourceFlux * this->SurfaceArea; this->SurfHeatTransferRate = this->SurfaceArea * (TopSurfFlux + BtmSurfFlux); - this->Energy = SourceFlux * this->SurfaceArea * TimeStepSys * SecInHour; + this->Energy = SourceFlux * this->SurfaceArea * TimeStepSys * DataGlobalConstants::SecInHour(); this->TopSurfaceTemp = TopSurfTemp; this->BtmSurfaceTemp = BtmSurfTemp; this->TopSurfaceFlux = TopSurfFlux; this->BtmSurfaceFlux = BtmSurfFlux; - this->SurfEnergy = SurfaceArea * (TopSurfFlux + BtmSurfFlux) * TimeStepSys * SecInHour; + this->SurfEnergy = SurfaceArea * (TopSurfFlux + BtmSurfFlux) * TimeStepSys * DataGlobalConstants::SecInHour(); } } // namespace SurfaceGroundHeatExchanger diff --git a/src/EnergyPlus/SwimmingPool.cc b/src/EnergyPlus/SwimmingPool.cc index cbffb4de207..214fff00aa0 100644 --- a/src/EnergyPlus/SwimmingPool.cc +++ b/src/EnergyPlus/SwimmingPool.cc @@ -859,7 +859,7 @@ namespace SwimmingPool { // Now calculate the requested mass flow rate from the plant loop to achieve the proper pool temperature // old equation using surface heat balance form: MassFlowRate = CpDeltaTi * ( CondTerms + ConvTerm + SWtotal + LWtotal + PeopleGain + // PoolMassTerm + MUWTerm + EvapEnergyLossPerArea ); - Real64 MassFlowRate = (this->WaterMass / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour)) * + Real64 MassFlowRate = (this->WaterMass / (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour())) * ((TInSurf - TH22) / (TLoopInletTemp - TInSurf)); // Target mass flow rate to achieve the proper setpoint temperature if (MassFlowRate > this->WaterMassFlowRateMax) { MassFlowRate = this->WaterMassFlowRateMax; @@ -1106,10 +1106,10 @@ namespace SwimmingPool { Pool(PoolNum).RadConvertToConvectRep = Pool(PoolNum).RadConvertToConvect * DataSurfaces::Surface(SurfNum).Area; // Finally calculate the summed up report variables - Pool(PoolNum).MiscEquipEnergy = Pool(PoolNum).MiscEquipPower * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - Pool(PoolNum).HeatEnergy = Pool(PoolNum).HeatPower * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - Pool(PoolNum).MakeUpWaterMass = Pool(PoolNum).MakeUpWaterMassFlowRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - Pool(PoolNum).EvapEnergyLoss = Pool(PoolNum).EvapHeatLossRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + Pool(PoolNum).MiscEquipEnergy = Pool(PoolNum).MiscEquipPower * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + Pool(PoolNum).HeatEnergy = Pool(PoolNum).HeatPower * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + Pool(PoolNum).MakeUpWaterMass = Pool(PoolNum).MakeUpWaterMassFlowRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + Pool(PoolNum).EvapEnergyLoss = Pool(PoolNum).EvapHeatLossRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); Pool(PoolNum).MakeUpWaterVolFlowRate = MakeUpWaterVolFlowFunct(Pool(PoolNum).MakeUpWaterMassFlowRate, Density); Pool(PoolNum).MakeUpWaterVol = MakeUpWaterVolFunct(Pool(PoolNum).MakeUpWaterMass, Density); diff --git a/src/EnergyPlus/SystemAvailabilityManager.cc b/src/EnergyPlus/SystemAvailabilityManager.cc index 04845ba45c2..0af28418c4d 100644 --- a/src/EnergyPlus/SystemAvailabilityManager.cc +++ b/src/EnergyPlus/SystemAvailabilityManager.cc @@ -751,7 +751,7 @@ namespace SystemAvailabilityManager { NCycSysAvailMgrData(SysAvailNum).Name = cAlphaArgs(1); NCycSysAvailMgrData(SysAvailNum).MgrType = SysAvailMgr_NightCycle; NCycSysAvailMgrData(SysAvailNum).TempTolRange = rNumericArgs(1); - CyclingTimeSteps = nint((rNumericArgs(2) / SecInHour) * double(NumOfTimeStepInHour)); + CyclingTimeSteps = nint((rNumericArgs(2) / DataGlobalConstants::SecInHour()) * double(NumOfTimeStepInHour)); CyclingTimeSteps = max(1, CyclingTimeSteps); NCycSysAvailMgrData(SysAvailNum).CyclingTimeSteps = CyclingTimeSteps; NCycSysAvailMgrData(SysAvailNum).SchedPtr = GetScheduleIndex(state, cAlphaArgs(2)); diff --git a/src/EnergyPlus/SystemReports.cc b/src/EnergyPlus/SystemReports.cc index c8f89a12308..7414fbeefcb 100644 --- a/src/EnergyPlus/SystemReports.cc +++ b/src/EnergyPlus/SystemReports.cc @@ -3606,7 +3606,7 @@ namespace SystemReports { if (InletNodeNum <= 0 || OutletNodeNum <= 0) continue; CompLoad = Node(OutletNodeNum).MassFlowRate * (PsyHFnTdbW(Node(InletNodeNum).Temp, Node(InletNodeNum).HumRat) - PsyHFnTdbW(Node(OutletNodeNum).Temp, Node(OutletNodeNum).HumRat)); - CompLoad *= TimeStepSys * SecInHour; + CompLoad *= TimeStepSys * DataGlobalConstants::SecInHour(); CompEnergyUse = 0.0; EnergyType = iRT_None; CompLoadFlag = true; @@ -3627,7 +3627,7 @@ namespace SystemReports { if (InletNodeNum <= 0 || OutletNodeNum <= 0) continue; CompLoad = Node(OutletNodeNum).MassFlowRate * (PsyHFnTdbW(Node(InletNodeNum).Temp, Node(InletNodeNum).HumRat) - PsyHFnTdbW(Node(OutletNodeNum).Temp, Node(OutletNodeNum).HumRat)); - CompLoad *= TimeStepSys * SecInHour; + CompLoad *= TimeStepSys * DataGlobalConstants::SecInHour(); CompEnergyUse = 0.0; EnergyType = iRT_None; CompLoadFlag = true; @@ -3648,7 +3648,7 @@ namespace SystemReports { if (InletNodeNum <= 0 || OutletNodeNum <= 0) continue; CompLoad = Node(OutletNodeNum).MassFlowRate * (PsyHFnTdbW(Node(InletNodeNum).Temp, Node(InletNodeNum).HumRat) - PsyHFnTdbW(Node(OutletNodeNum).Temp, Node(OutletNodeNum).HumRat)); - CompLoad *= TimeStepSys * SecInHour; + CompLoad *= TimeStepSys * DataGlobalConstants::SecInHour(); CompEnergyUse = 0.0; EnergyType = iRT_None; CompLoadFlag = true; @@ -3735,7 +3735,7 @@ namespace SystemReports { CompLoad -= (PsyHFnTdbW(Node(OutletNodeNum).Temp, Node(OutletNodeNum).HumRat) * Node(OutletNodeNum).MassFlowRate); } } - CompLoad *= TimeStepSys * SecInHour; + CompLoad *= TimeStepSys * DataGlobalConstants::SecInHour(); CompEnergyUse = 0.0; EnergyType = iRT_None; CompLoadFlag = true; @@ -3754,7 +3754,7 @@ namespace SystemReports { if (InletNodeNum <= 0 || OutletNodeNum <= 0) continue; CompLoad = Node(InletNodeNum).MassFlowRate * (PsyHFnTdbW(Node(InletNodeNum).Temp, Node(InletNodeNum).HumRat) - PsyHFnTdbW(Node(OutletNodeNum).Temp, Node(OutletNodeNum).HumRat)); - CompLoad *= TimeStepSys * SecInHour; + CompLoad *= TimeStepSys * DataGlobalConstants::SecInHour(); CompEnergyUse = 0.0; EnergyType = iRT_None; CompLoadFlag = true; @@ -3773,7 +3773,7 @@ namespace SystemReports { if (InletNodeNum <= 0 || OutletNodeNum <= 0) continue; CompLoad = Node(InletNodeNum).MassFlowRate * (PsyHFnTdbW(Node(InletNodeNum).Temp, Node(InletNodeNum).HumRat) - PsyHFnTdbW(Node(OutletNodeNum).Temp, Node(OutletNodeNum).HumRat)); - CompLoad *= TimeStepSys * SecInHour; + CompLoad *= TimeStepSys * DataGlobalConstants::SecInHour(); CompEnergyUse = 0.0; EnergyType = iRT_None; CompLoadFlag = true; @@ -4530,7 +4530,7 @@ namespace SystemReports { ZFAUEnthMixedAir = PsyHFnTdbW(Node(MixedAirNode).Temp, Node(MixedAirNode).HumRat); ZFAUEnthReturnAir = PsyHFnTdbW(Node(ReturnAirNode).Temp, Node(ReturnAirNode).HumRat); // Calculate the zone ventilation load for this supply air path (i.e. zone inlet) - ZFAUZoneVentLoad += (ZFAUFlowRate) * (ZFAUEnthMixedAir - ZFAUEnthReturnAir) * TimeStepSys * SecInHour; //*KJperJ + ZFAUZoneVentLoad += (ZFAUFlowRate) * (ZFAUEnthMixedAir - ZFAUEnthReturnAir) * TimeStepSys * DataGlobalConstants::SecInHour(); //*KJperJ } else { ZFAUZoneVentLoad += 0.0; } @@ -4548,7 +4548,7 @@ namespace SystemReports { ZFAUEnthMixedAir = PsyHFnTdbW(Node(MixedAirNode).Temp, Node(MixedAirNode).HumRat); ZFAUEnthReturnAir = PsyHFnTdbW(Node(ReturnAirNode).Temp, Node(ReturnAirNode).HumRat); // Calculate the zone ventilation load for this supply air path (i.e. zone inlet) - ZFAUZoneVentLoad += (ZFAUFlowRate) * (ZFAUEnthMixedAir - ZFAUEnthReturnAir) * TimeStepSys * SecInHour; //*KJperJ + ZFAUZoneVentLoad += (ZFAUFlowRate) * (ZFAUEnthMixedAir - ZFAUEnthReturnAir) * TimeStepSys * DataGlobalConstants::SecInHour(); //*KJperJ } else { ZFAUZoneVentLoad += 0.0; } @@ -4573,7 +4573,7 @@ namespace SystemReports { ZFAUEnthMixedAir = PsyHFnTdbW(Node(MixedAirNode).Temp, Node(MixedAirNode).HumRat); ZFAUEnthReturnAir = PsyHFnTdbW(Node(ReturnAirNode).Temp, Node(ReturnAirNode).HumRat); // Calculate the zone ventilation load for this supply air path (i.e. zone inlet) - ZFAUZoneVentLoad += (ZFAUFlowRate) * (ZFAUEnthMixedAir - ZFAUEnthReturnAir) * TimeStepSys * SecInHour; //*KJperJ + ZFAUZoneVentLoad += (ZFAUFlowRate) * (ZFAUEnthMixedAir - ZFAUEnthReturnAir) * TimeStepSys * DataGlobalConstants::SecInHour(); //*KJperJ } else { ZFAUZoneVentLoad += 0.0; } @@ -4593,7 +4593,7 @@ namespace SystemReports { ZFAUEnthMixedAir = PsyHFnTdbW(Node(MixedAirNode).Temp, Node(MixedAirNode).HumRat); ZFAUEnthReturnAir = PsyHFnTdbW(Node(ReturnAirNode).Temp, Node(ReturnAirNode).HumRat); // Calculate the zone ventilation load for this supply air path (i.e. zone inlet) - ZFAUZoneVentLoad += (ZFAUFlowRate) * (ZFAUEnthMixedAir - ZFAUEnthReturnAir) * TimeStepSys * SecInHour; //*KJperJ + ZFAUZoneVentLoad += (ZFAUFlowRate) * (ZFAUEnthMixedAir - ZFAUEnthReturnAir) * TimeStepSys * DataGlobalConstants::SecInHour(); //*KJperJ } else { ZFAUZoneVentLoad += 0.0; } @@ -4614,7 +4614,7 @@ namespace SystemReports { ZFAUEnthMixedAir = PsyHFnTdbW(Node(MixedAirNode).Temp, Node(MixedAirNode).HumRat); ZFAUEnthReturnAir = PsyHFnTdbW(Node(ReturnAirNode).Temp, Node(ReturnAirNode).HumRat); // Calculate the zone ventilation load for this supply air path (i.e. zone inlet) - ZFAUZoneVentLoad += (ZFAUFlowRate) * (ZFAUEnthMixedAir - ZFAUEnthReturnAir) * TimeStepSys * SecInHour; //*KJperJ + ZFAUZoneVentLoad += (ZFAUFlowRate) * (ZFAUEnthMixedAir - ZFAUEnthReturnAir) * TimeStepSys * DataGlobalConstants::SecInHour(); //*KJperJ } else { ZFAUZoneVentLoad += 0.0; } @@ -4635,7 +4635,7 @@ namespace SystemReports { ZFAUEnthMixedAir = PsyHFnTdbW(ZFAUTempMixedAir, ZFAUHumRatMixedAir); ZFAUEnthReturnAir = PsyHFnTdbW(Node(ReturnAirNode).Temp, Node(ReturnAirNode).HumRat); // Calculate the zone ventilation load for this supply air path (i.e. zone inlet) - ZFAUZoneVentLoad += (ZFAUFlowRate) * (ZFAUEnthMixedAir - ZFAUEnthReturnAir) * TimeStepSys * SecInHour; //*KJperJ + ZFAUZoneVentLoad += (ZFAUFlowRate) * (ZFAUEnthMixedAir - ZFAUEnthReturnAir) * TimeStepSys * DataGlobalConstants::SecInHour(); //*KJperJ } else { ZFAUZoneVentLoad += 0.0; } @@ -4655,7 +4655,7 @@ namespace SystemReports { ZFAUEnthMixedAir = PsyHFnTdbW(Node(MixedAirNode).Temp, Node(MixedAirNode).HumRat); ZFAUEnthReturnAir = PsyHFnTdbW(Node(ReturnAirNode).Temp, Node(ReturnAirNode).HumRat); // Calculate the zone ventilation load for this supply air path (i.e. zone inlet) - ZFAUZoneVentLoad += (ZFAUFlowRate) * (ZFAUEnthMixedAir - ZFAUEnthReturnAir) * TimeStepSys * SecInHour; //*KJperJ + ZFAUZoneVentLoad += (ZFAUFlowRate) * (ZFAUEnthMixedAir - ZFAUEnthReturnAir) * TimeStepSys * DataGlobalConstants::SecInHour(); //*KJperJ } else { ZFAUZoneVentLoad += 0.0; } @@ -4680,7 +4680,7 @@ namespace SystemReports { ZFAUEnthReturnAir = PsyHFnTdbW(Node(ReturnAirNode).Temp, Node(ReturnAirNode).HumRat); ZFAUEnthOutdoorAir = PsyHFnTdbW(Node(OutAirNode).Temp, Node(OutAirNode).HumRat); // Calculate the zone ventilation load for this supply air path (i.e. zone inlet) - ZFAUZoneVentLoad += (ZFAUFlowRate) * (ZFAUEnthOutdoorAir - ZFAUEnthReturnAir) * TimeStepSys * SecInHour; //*KJperJ + ZFAUZoneVentLoad += (ZFAUFlowRate) * (ZFAUEnthOutdoorAir - ZFAUEnthReturnAir) * TimeStepSys * DataGlobalConstants::SecInHour(); //*KJperJ } else { ZFAUZoneVentLoad += 0.0; } @@ -4704,7 +4704,7 @@ namespace SystemReports { ZFAUEnthOutdoorAir = PsyHFnTdbW(Node(OutAirNode).Temp, Node(OutAirNode).HumRat); // Calculate the zone ventilation load for this supply air path (i.e. zone inlet) - ZFAUZoneVentLoad += (ZFAUFlowRate) * (ZFAUEnthOutdoorAir - ZFAUEnthReturnAir) * TimeStepSys * SecInHour; //*KJperJ + ZFAUZoneVentLoad += (ZFAUFlowRate) * (ZFAUEnthOutdoorAir - ZFAUEnthReturnAir) * TimeStepSys * DataGlobalConstants::SecInHour(); //*KJperJ } else { ZFAUZoneVentLoad += 0.0; } @@ -4800,7 +4800,7 @@ namespace SystemReports { } // Calculate the zone ventilation load for this supply air path (i.e. zone inlet) AirSysZoneVentLoad = - (ADUCoolFlowrate + ADUHeatFlowrate) * (AirSysEnthMixedAir - AirSysEnthReturnAir) * TimeStepSys * SecInHour; //*KJperJ + (ADUCoolFlowrate + ADUHeatFlowrate) * (AirSysEnthMixedAir - AirSysEnthReturnAir) * TimeStepSys * DataGlobalConstants::SecInHour(); //*KJperJ } ZAirSysZoneVentLoad += AirSysZoneVentLoad; ZAirSysOutAirFlow += AirSysOutAirFlow; @@ -4810,16 +4810,16 @@ namespace SystemReports { OutAirFlow = ZAirSysOutAirFlow + ZFAUOutAirFlow; // assign report variables ZoneOAMassFlow(CtrlZoneNum) = OutAirFlow; - ZoneOAMass(CtrlZoneNum) = ZoneOAMassFlow(CtrlZoneNum) * TimeStepSys * SecInHour; + ZoneOAMass(CtrlZoneNum) = ZoneOAMassFlow(CtrlZoneNum) * TimeStepSys * DataGlobalConstants::SecInHour(); // determine volumetric values from mass flow using standard density (adjusted for elevation) ZoneOAVolFlowStdRho(CtrlZoneNum) = ZoneOAMassFlow(CtrlZoneNum) / StdRhoAir; - ZoneOAVolStdRho(CtrlZoneNum) = ZoneOAVolFlowStdRho(CtrlZoneNum) * TimeStepSys * SecInHour; + ZoneOAVolStdRho(CtrlZoneNum) = ZoneOAVolFlowStdRho(CtrlZoneNum) * TimeStepSys * DataGlobalConstants::SecInHour(); // determine volumetric values from mass flow using current air density for zone (adjusted for elevation) currentZoneAirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, MAT(ActualZoneNum), ZoneAirHumRatAvg(ActualZoneNum)); if (currentZoneAirDensity > 0.0) ZoneOAVolFlowCrntRho(CtrlZoneNum) = ZoneOAMassFlow(CtrlZoneNum) / currentZoneAirDensity; - ZoneOAVolCrntRho(CtrlZoneNum) = ZoneOAVolFlowCrntRho(CtrlZoneNum) * TimeStepSys * SecInHour; + ZoneOAVolCrntRho(CtrlZoneNum) = ZoneOAVolFlowCrntRho(CtrlZoneNum) * TimeStepSys * DataGlobalConstants::SecInHour(); if (ZoneVolume > 0.0) ZoneMechACH(CtrlZoneNum) = (ZoneOAVolCrntRho(CtrlZoneNum) / TimeStepSys) / ZoneVolume; // store data for predefined tabular report on outside air diff --git a/src/EnergyPlus/ThermalChimney.cc b/src/EnergyPlus/ThermalChimney.cc index 611ad2e0ffb..84e2b69f14a 100644 --- a/src/EnergyPlus/ThermalChimney.cc +++ b/src/EnergyPlus/ThermalChimney.cc @@ -213,8 +213,6 @@ namespace ThermalChimney { Real64 const FlowFractionTolerance(0.0001); // Smallest deviation from unity for the sum of all fractions // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - // CHARACTER(len=MaxNameLength), DIMENSION(23) :: AlphaName - // REAL(r64) , DIMENSION(63) :: IHGNumbers int NumAlpha; int NumNumber; Real64 AllRatiosSummed; @@ -224,13 +222,6 @@ namespace ThermalChimney { int Loop; int Loop1; - // ALLOCATE(MCPTThermChim(NumOfZones)) - // MCPTThermChim=0.0 - // ALLOCATE(MCPThermChim(NumOfZones)) - // MCPThermChim=0.0 - // ALLOCATE(ThermChimAMFL(NumOfZones)) - // ThermChimAMFL=0.0 - // Following used for reporting ZnRptThermChim.allocate(NumOfZones); @@ -957,7 +948,7 @@ namespace ThermalChimney { Real64 CpAir; Real64 TSMult; - TSMult = TimeStepSys * SecInHour; + TSMult = TimeStepSys * DataGlobalConstants::SecInHour(); for (ZoneLoop = 1; ZoneLoop <= NumOfZones; ++ZoneLoop) { // Start of zone loads report variable update loop ... diff --git a/src/EnergyPlus/TranspiredCollector.cc b/src/EnergyPlus/TranspiredCollector.cc index 5387e1651c5..ed698a47d44 100644 --- a/src/EnergyPlus/TranspiredCollector.cc +++ b/src/EnergyPlus/TranspiredCollector.cc @@ -113,7 +113,6 @@ namespace TranspiredCollector { // Using/Aliasing using DataGlobals::KelvinConv; - using DataGlobals::SecInHour; using DataHeatBalance::QRadSWOutIncident; using DataVectorTypes::Vector; @@ -983,8 +982,6 @@ namespace TranspiredCollector { Real64 TaHX; // leaving air temperature from heat exchanger (entering plenum) Real64 Taplen; // Air temperature in plen and outlet node. Real64 SensHeatingRate; // Rate at which the system is heating outdoor air - // INTEGER, SAVE :: VsucErrCount=0 ! warning message counter - // CHARACTER(len=MaxNameLength) :: VsucErrString ! warning message counter string Real64 AlessHoles; // Area for Kutscher's relation // Active UTSC calculation @@ -1198,7 +1195,7 @@ namespace TranspiredCollector { UTSC(UTSCNum).SupOutEnth = PsyHFnTdbW(UTSC(UTSCNum).SupOutTemp, UTSC(UTSCNum).SupOutHumRat); UTSC(UTSCNum).SupOutMassFlow = Mdot; UTSC(UTSCNum).SensHeatingRate = SensHeatingRate; - UTSC(UTSCNum).SensHeatingEnergy = SensHeatingRate * TimeStepSys * SecInHour; + UTSC(UTSCNum).SensHeatingEnergy = SensHeatingRate * TimeStepSys * DataGlobalConstants::SecInHour(); UTSC(UTSCNum).PassiveACH = 0.0; UTSC(UTSCNum).PassiveMdotVent = 0.0; UTSC(UTSCNum).PassiveMdotWind = 0.0; @@ -1329,7 +1326,7 @@ namespace TranspiredCollector { UTSC(UTSCNum).SupOutMassFlow = 0.0; UTSC(UTSCNum).SensHeatingRate = 0.0; UTSC(UTSCNum).SensHeatingEnergy = 0.0; - UTSC(UTSCNum).PassiveACH = (MdotVent / RhoAir) * (1.0 / (UTSC(UTSCNum).ProjArea * UTSC(UTSCNum).PlenGapThick)) * SecInHour; + UTSC(UTSCNum).PassiveACH = (MdotVent / RhoAir) * (1.0 / (UTSC(UTSCNum).ProjArea * UTSC(UTSCNum).PlenGapThick)) * DataGlobalConstants::SecInHour(); UTSC(UTSCNum).PassiveMdotVent = MdotVent; UTSC(UTSCNum).PassiveMdotWind = VdotWind * RhoAir; UTSC(UTSCNum).PassiveMdotTherm = VdotThermal * RhoAir; diff --git a/src/EnergyPlus/UFADManager.cc b/src/EnergyPlus/UFADManager.cc index 8677e8b99c2..a7b2844b586 100644 --- a/src/EnergyPlus/UFADManager.cc +++ b/src/EnergyPlus/UFADManager.cc @@ -1233,10 +1233,10 @@ namespace UFADManager { GainsFrac = max(0.6, min(GainsFrac, 1.0)); AIRRATOC(ZoneNum) = Zone(ZoneNum).Volume * (HeightTransition(ZoneNum) - min(HeightTransition(ZoneNum), 0.2)) / CeilingHeight * Zone(ZoneNum).ZoneVolCapMultpSens * PsyRhoAirFnPbTdbW(OutBaroPress, MATOC(ZoneNum), ZoneAirHumRat(ZoneNum)) * - PsyCpAirFnW(ZoneAirHumRat(ZoneNum)) / (TimeStepSys * SecInHour); + PsyCpAirFnW(ZoneAirHumRat(ZoneNum)) / (TimeStepSys * DataGlobalConstants::SecInHour()); AIRRATMX(ZoneNum) = Zone(ZoneNum).Volume * (CeilingHeight - HeightTransition(ZoneNum)) / CeilingHeight * Zone(ZoneNum).ZoneVolCapMultpSens * PsyRhoAirFnPbTdbW(OutBaroPress, MATMX(ZoneNum), ZoneAirHumRat(ZoneNum)) * - PsyCpAirFnW(ZoneAirHumRat(ZoneNum)) / (TimeStepSys * SecInHour); + PsyCpAirFnW(ZoneAirHumRat(ZoneNum)) / (TimeStepSys * DataGlobalConstants::SecInHour()); if (UseZoneTimeStepHistory) { ZTM3OC(ZoneNum) = XM3TOC(ZoneNum); @@ -1745,10 +1745,10 @@ namespace UFADManager { } AIRRATOC(ZoneNum) = Zone(ZoneNum).Volume * (HeightTransition(ZoneNum) - min(HeightTransition(ZoneNum), 0.2)) / CeilingHeight * Zone(ZoneNum).ZoneVolCapMultpSens * PsyRhoAirFnPbTdbW(OutBaroPress, MATOC(ZoneNum), ZoneAirHumRat(ZoneNum)) * - PsyCpAirFnW(ZoneAirHumRat(ZoneNum)) / (TimeStepSys * SecInHour); + PsyCpAirFnW(ZoneAirHumRat(ZoneNum)) / (TimeStepSys * DataGlobalConstants::SecInHour()); AIRRATMX(ZoneNum) = Zone(ZoneNum).Volume * (CeilingHeight - HeightTransition(ZoneNum)) / CeilingHeight * Zone(ZoneNum).ZoneVolCapMultpSens * PsyRhoAirFnPbTdbW(OutBaroPress, MATMX(ZoneNum), ZoneAirHumRat(ZoneNum)) * - PsyCpAirFnW(ZoneAirHumRat(ZoneNum)) / (TimeStepSys * SecInHour); + PsyCpAirFnW(ZoneAirHumRat(ZoneNum)) / (TimeStepSys * DataGlobalConstants::SecInHour()); if (UseZoneTimeStepHistory) { ZTM3OC(ZoneNum) = XM3TOC(ZoneNum); diff --git a/src/EnergyPlus/UnitHeater.cc b/src/EnergyPlus/UnitHeater.cc index 4a1b314a7e3..e6a66e7bff2 100644 --- a/src/EnergyPlus/UnitHeater.cc +++ b/src/EnergyPlus/UnitHeater.cc @@ -1963,7 +1963,6 @@ namespace UnitHeater { // na // Using/Aliasing - using DataGlobals::SecInHour; using DataHVACGlobals::TimeStepSys; // Locals @@ -1982,8 +1981,8 @@ namespace UnitHeater { // na // FLOW: - UnitHeat(UnitHeatNum).HeatEnergy = UnitHeat(UnitHeatNum).HeatPower * TimeStepSys * SecInHour; - UnitHeat(UnitHeatNum).ElecEnergy = UnitHeat(UnitHeatNum).ElecPower * TimeStepSys * SecInHour; + UnitHeat(UnitHeatNum).HeatEnergy = UnitHeat(UnitHeatNum).HeatPower * TimeStepSys * DataGlobalConstants::SecInHour(); + UnitHeat(UnitHeatNum).ElecEnergy = UnitHeat(UnitHeatNum).ElecPower * TimeStepSys * DataGlobalConstants::SecInHour(); if (UnitHeat(UnitHeatNum).FirstPass) { // reset sizing flags so other zone equipment can size normally if (!DataGlobals::SysSizingCalc) { diff --git a/src/EnergyPlus/UnitVentilator.cc b/src/EnergyPlus/UnitVentilator.cc index 21137af0878..c6088c5f72b 100644 --- a/src/EnergyPlus/UnitVentilator.cc +++ b/src/EnergyPlus/UnitVentilator.cc @@ -3812,7 +3812,6 @@ namespace UnitVentilator { // na // Using/Aliasing - using DataGlobals::SecInHour; using DataHVACGlobals::TimeStepSys; // Locals @@ -3831,10 +3830,10 @@ namespace UnitVentilator { // na // FLOW: - UnitVent(UnitVentNum).HeatEnergy = UnitVent(UnitVentNum).HeatPower * TimeStepSys * SecInHour; - UnitVent(UnitVentNum).SensCoolEnergy = UnitVent(UnitVentNum).SensCoolPower * TimeStepSys * SecInHour; - UnitVent(UnitVentNum).TotCoolEnergy = UnitVent(UnitVentNum).TotCoolPower * TimeStepSys * SecInHour; - UnitVent(UnitVentNum).ElecEnergy = UnitVent(UnitVentNum).ElecPower * TimeStepSys * SecInHour; + UnitVent(UnitVentNum).HeatEnergy = UnitVent(UnitVentNum).HeatPower * TimeStepSys * DataGlobalConstants::SecInHour(); + UnitVent(UnitVentNum).SensCoolEnergy = UnitVent(UnitVentNum).SensCoolPower * TimeStepSys * DataGlobalConstants::SecInHour(); + UnitVent(UnitVentNum).TotCoolEnergy = UnitVent(UnitVentNum).TotCoolPower * TimeStepSys * DataGlobalConstants::SecInHour(); + UnitVent(UnitVentNum).ElecEnergy = UnitVent(UnitVentNum).ElecPower * TimeStepSys * DataGlobalConstants::SecInHour(); if (UnitVent(UnitVentNum).FirstPass) { // reset sizing flags so other zone equipment can size normally if (!DataGlobals::SysSizingCalc) { diff --git a/src/EnergyPlus/UnitarySystem.cc b/src/EnergyPlus/UnitarySystem.cc index c74f6ca03b8..ef5b82c2f7c 100644 --- a/src/EnergyPlus/UnitarySystem.cc +++ b/src/EnergyPlus/UnitarySystem.cc @@ -13923,7 +13923,7 @@ namespace UnitarySystems { // PURPOSE OF THIS SUBROUTINE: // This subroutine updates the report variable for the coils. - Real64 ReportingConstant = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + Real64 ReportingConstant = DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); Real64 SensibleOutput = 0.0; // sensible output rate, {W} Real64 LatentOutput = 0.0; // latent output rate, {W} @@ -14169,7 +14169,7 @@ namespace UnitarySystems { // SUBROUTINE PARAMETER DEFINITIONS: static std::string const routineName("UnitarySystemHeatRecovery"); - Real64 ReportingConstant = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + Real64 ReportingConstant = DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); int HeatRecInNode = this->m_HeatRecoveryInletNodeNum; int HeatRecOutNode = this->m_HeatRecoveryOutletNodeNum; diff --git a/src/EnergyPlus/VariableSpeedCoils.cc b/src/EnergyPlus/VariableSpeedCoils.cc index 93414338594..0af893ba8b5 100644 --- a/src/EnergyPlus/VariableSpeedCoils.cc +++ b/src/EnergyPlus/VariableSpeedCoils.cc @@ -5463,7 +5463,7 @@ namespace VariableSpeedCoils { // Add power to global variable so power can be summed by parent object DXElecCoolingPower = state.dataVariableSpeedCoils->Winput; - ReportingConstant = TimeStepSys * SecInHour; + ReportingConstant = TimeStepSys * DataGlobalConstants::SecInHour(); // Update heat pump data structure state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Power = state.dataVariableSpeedCoils->Winput; state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QLoadTotal = state.dataVariableSpeedCoils->QLoadTotal; @@ -6007,7 +6007,7 @@ namespace VariableSpeedCoils { // Add power to global variable so power can be summed by parent object DXElecCoolingPower = state.dataVariableSpeedCoils->Winput; - ReportingConstant = TimeStepSys * SecInHour; + ReportingConstant = TimeStepSys * DataGlobalConstants::SecInHour(); // Update heat pump data structure state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).HPWHCondPumpElecNomPower * RuntimeFrac; // water heating pump power state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Power = state.dataVariableSpeedCoils->Winput; @@ -6481,7 +6481,7 @@ namespace VariableSpeedCoils { // Add power to global variable so power can be summed by parent object DXElecHeatingPower = state.dataVariableSpeedCoils->Winput; - ReportingConstant = TimeStepSys * SecInHour; + ReportingConstant = TimeStepSys * DataGlobalConstants::SecInHour(); // Update heat pump data structure state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Power = state.dataVariableSpeedCoils->Winput; state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QLoadTotal = state.dataVariableSpeedCoils->QLoadTotal; @@ -7149,7 +7149,7 @@ namespace VariableSpeedCoils { Node(WaterOutletNode).Enthalpy = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletWaterEnthalpy; } - ReportingConstant = TimeStepSys * SecInHour; + ReportingConstant = TimeStepSys * DataGlobalConstants::SecInHour(); state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Energy = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Power * ReportingConstant; state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergyLoadTotal = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QLoadTotal * ReportingConstant; state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EnergySensible = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).QSensible * ReportingConstant; diff --git a/src/EnergyPlus/VentilatedSlab.cc b/src/EnergyPlus/VentilatedSlab.cc index 8eaffcb0504..10573c9e3c1 100644 --- a/src/EnergyPlus/VentilatedSlab.cc +++ b/src/EnergyPlus/VentilatedSlab.cc @@ -4516,7 +4516,6 @@ namespace VentilatedSlab { // Standard EnergyPlus methodology. // Using/Aliasing - using DataGlobals::SecInHour; using DataHeatBalance::Zone; using DataHVACGlobals::TimeStepSys; using DataLoopNode::Node; @@ -4549,15 +4548,15 @@ namespace VentilatedSlab { state.dataVentilatedSlab->VentSlab(Item).RadCoolingPower = -TotalVentSlabRadPower; } - state.dataVentilatedSlab->VentSlab(Item).RadHeatingEnergy = state.dataVentilatedSlab->VentSlab(Item).RadHeatingPower * TimeStepSys * SecInHour; - state.dataVentilatedSlab->VentSlab(Item).RadCoolingEnergy = state.dataVentilatedSlab->VentSlab(Item).RadCoolingPower * TimeStepSys * SecInHour; + state.dataVentilatedSlab->VentSlab(Item).RadHeatingEnergy = state.dataVentilatedSlab->VentSlab(Item).RadHeatingPower * TimeStepSys * DataGlobalConstants::SecInHour(); + state.dataVentilatedSlab->VentSlab(Item).RadCoolingEnergy = state.dataVentilatedSlab->VentSlab(Item).RadCoolingPower * TimeStepSys * DataGlobalConstants::SecInHour(); // Coil Part - state.dataVentilatedSlab->VentSlab(Item).HeatCoilEnergy = state.dataVentilatedSlab->VentSlab(Item).HeatCoilPower * TimeStepSys * SecInHour; - state.dataVentilatedSlab->VentSlab(Item).SensCoolCoilEnergy = state.dataVentilatedSlab->VentSlab(Item).SensCoolCoilPower * TimeStepSys * SecInHour; - state.dataVentilatedSlab->VentSlab(Item).LateCoolCoilEnergy = state.dataVentilatedSlab->VentSlab(Item).LateCoolCoilPower * TimeStepSys * SecInHour; - state.dataVentilatedSlab->VentSlab(Item).TotCoolCoilEnergy = state.dataVentilatedSlab->VentSlab(Item).TotCoolCoilPower * TimeStepSys * SecInHour; - state.dataVentilatedSlab->VentSlab(Item).ElecFanEnergy = state.dataVentilatedSlab->VentSlab(Item).ElecFanPower * TimeStepSys * SecInHour; + state.dataVentilatedSlab->VentSlab(Item).HeatCoilEnergy = state.dataVentilatedSlab->VentSlab(Item).HeatCoilPower * TimeStepSys * DataGlobalConstants::SecInHour(); + state.dataVentilatedSlab->VentSlab(Item).SensCoolCoilEnergy = state.dataVentilatedSlab->VentSlab(Item).SensCoolCoilPower * TimeStepSys * DataGlobalConstants::SecInHour(); + state.dataVentilatedSlab->VentSlab(Item).LateCoolCoilEnergy = state.dataVentilatedSlab->VentSlab(Item).LateCoolCoilPower * TimeStepSys * DataGlobalConstants::SecInHour(); + state.dataVentilatedSlab->VentSlab(Item).TotCoolCoilEnergy = state.dataVentilatedSlab->VentSlab(Item).TotCoolCoilPower * TimeStepSys * DataGlobalConstants::SecInHour(); + state.dataVentilatedSlab->VentSlab(Item).ElecFanEnergy = state.dataVentilatedSlab->VentSlab(Item).ElecFanPower * TimeStepSys * DataGlobalConstants::SecInHour(); if ((state.dataVentilatedSlab->VentSlab(Item).SysConfg == state.dataVentilatedSlab->SlabOnly) || (state.dataVentilatedSlab->VentSlab(Item).SysConfg == state.dataVentilatedSlab->SeriesSlabs)) { state.dataVentilatedSlab->VentSlab(Item).SlabInTemp = Node(state.dataVentilatedSlab->VentSlab(Item).RadInNode).Temp; diff --git a/src/EnergyPlus/WaterCoils.cc b/src/EnergyPlus/WaterCoils.cc index a132b9c24be..02f1d1c468f 100644 --- a/src/EnergyPlus/WaterCoils.cc +++ b/src/EnergyPlus/WaterCoils.cc @@ -4795,7 +4795,7 @@ namespace WaterCoils { } } } - ReportingConstant = TimeStepSys * SecInHour; + ReportingConstant = TimeStepSys * DataGlobalConstants::SecInHour(); // report the WaterCoil energy from this component state.dataWaterCoils->WaterCoil(CoilNum).TotWaterHeatingCoilEnergy = state.dataWaterCoils->WaterCoil(CoilNum).TotWaterHeatingCoilRate * ReportingConstant; state.dataWaterCoils->WaterCoil(CoilNum).TotWaterCoolingCoilEnergy = state.dataWaterCoils->WaterCoil(CoilNum).TotWaterCoolingCoilRate * ReportingConstant; diff --git a/src/EnergyPlus/WaterManager.cc b/src/EnergyPlus/WaterManager.cc index 3bc1d72df72..4db394177bd 100644 --- a/src/EnergyPlus/WaterManager.cc +++ b/src/EnergyPlus/WaterManager.cc @@ -80,7 +80,6 @@ namespace WaterManager { // MODIFIED DJS to add ecoroof irrigation Jan 2007 // RE-ENGINEERED na - using DataGlobals::BigNumber; using namespace DataWater; // SUBROUTINE SPECIFICATIONS FOR MODULE WaterManager: @@ -296,18 +295,18 @@ namespace WaterManager { WaterStorage(Item).MaxCapacity = rNumericArgs(1); if (WaterStorage(Item).MaxCapacity == 0.0) { // default - WaterStorage(Item).MaxCapacity = BigNumber; + WaterStorage(Item).MaxCapacity = DataGlobalConstants::BigNumber(); } WaterStorage(Item).InitialVolume = rNumericArgs(2); WaterStorage(Item).MaxInFlowRate = rNumericArgs(3); if (WaterStorage(Item).MaxInFlowRate == 0.0) { // default - WaterStorage(Item).MaxInFlowRate = BigNumber; + WaterStorage(Item).MaxInFlowRate = DataGlobalConstants::BigNumber(); } WaterStorage(Item).MaxOutFlowRate = rNumericArgs(4); if (WaterStorage(Item).MaxOutFlowRate == 0.0) { // default - WaterStorage(Item).MaxOutFlowRate = BigNumber; + WaterStorage(Item).MaxOutFlowRate = DataGlobalConstants::BigNumber(); } WaterStorage(Item).OverflowTankName = cAlphaArgs(3); // setup later @@ -933,7 +932,6 @@ namespace WaterManager { // USE STATEMENTS: // na // Using/Aliasing - using DataGlobals::SecInHour; using DataHVACGlobals::TimeStepSys; using ScheduleManager::GetCurrentScheduleValue; @@ -961,8 +959,8 @@ namespace WaterManager { } else { ScaleFactor = 0.0; } - RainFall.CurrentRate = schedRate * ScaleFactor / SecInHour; // convert to m/s - RainFall.CurrentAmount = RainFall.CurrentRate * (TimeStepSys * SecInHour); + RainFall.CurrentRate = schedRate * ScaleFactor / DataGlobalConstants::SecInHour(); // convert to m/s + RainFall.CurrentAmount = RainFall.CurrentRate * (TimeStepSys * DataGlobalConstants::SecInHour()); } } @@ -987,7 +985,6 @@ namespace WaterManager { // USE STATEMENTS: // na // Using/Aliasing - using DataGlobals::SecInHour; using DataHVACGlobals::TimeStepSys; using ScheduleManager::GetCurrentScheduleValue; @@ -1012,11 +1009,11 @@ namespace WaterManager { if (Irrigation.ModeID == IrrSchedDesign) { schedRate = GetCurrentScheduleValue(Irrigation.IrrSchedID); // m/hr - Irrigation.ScheduledAmount = schedRate * (TimeStepSys * SecInHour) / SecInHour; // convert to m/timestep + Irrigation.ScheduledAmount = schedRate * (TimeStepSys * DataGlobalConstants::SecInHour()) / DataGlobalConstants::SecInHour(); // convert to m/timestep } else if (Irrigation.ModeID == IrrSmartSched) { schedRate = GetCurrentScheduleValue(Irrigation.IrrSchedID); // m/hr - Irrigation.ScheduledAmount = schedRate * (TimeStepSys * SecInHour) / SecInHour; // convert to m/timestep + Irrigation.ScheduledAmount = schedRate * (TimeStepSys * DataGlobalConstants::SecInHour()) / DataGlobalConstants::SecInHour(); // convert to m/timestep } } @@ -1078,7 +1075,6 @@ namespace WaterManager { // Using/Aliasing using DataGlobals::BeginTimeStepFlag; - using DataGlobals::SecInHour; using DataHVACGlobals::TimeStepSys; using ScheduleManager::GetCurrentScheduleValue; @@ -1133,8 +1129,8 @@ namespace WaterManager { sum(WaterStorage(TankNum).VdotAvailSupply * WaterStorage(TankNum).TwaterSupply) / sum(WaterStorage(TankNum).VdotAvailSupply); TotVdotSupplyAvail = WaterStorage(TankNum).MaxInFlowRate; } - TotVolSupplyAvail = TotVdotSupplyAvail * TimeStepSys * SecInHour; - overflowVol = overflowVdot * TimeStepSys * SecInHour; + TotVolSupplyAvail = TotVdotSupplyAvail * TimeStepSys * DataGlobalConstants::SecInHour(); + overflowVol = overflowVdot * TimeStepSys * DataGlobalConstants::SecInHour(); underflowVdot = 0.0; if (WaterStorage(TankNum).NumWaterDemands > 0) { @@ -1142,17 +1138,17 @@ namespace WaterManager { } else { OrigVdotDemandRequest = 0.0; } - OrigVolDemandRequest = OrigVdotDemandRequest * TimeStepSys * SecInHour; + OrigVolDemandRequest = OrigVdotDemandRequest * TimeStepSys * DataGlobalConstants::SecInHour(); TotVdotDemandAvail = OrigVdotDemandRequest; // initialize to satisfied then modify if needed if (TotVdotDemandAvail > WaterStorage(TankNum).MaxOutFlowRate) { // pipe/filter rate constraints on outlet underflowVdot = OrigVdotDemandRequest - WaterStorage(TankNum).MaxOutFlowRate; TotVdotDemandAvail = WaterStorage(TankNum).MaxOutFlowRate; } - TotVolDemandAvail = TotVdotDemandAvail * (TimeStepSys * SecInHour); + TotVolDemandAvail = TotVdotDemandAvail * (TimeStepSys * DataGlobalConstants::SecInHour()); NetVdotAdd = TotVdotSupplyAvail - TotVdotDemandAvail; - NetVolAdd = NetVdotAdd * (TimeStepSys * SecInHour); + NetVolAdd = NetVdotAdd * (TimeStepSys * DataGlobalConstants::SecInHour()); VolumePredict = WaterStorage(TankNum).LastTimeStepVolume + NetVolAdd; @@ -1164,7 +1160,7 @@ namespace WaterManager { overflowTwater = (overflowTwater * overflowVol + OverFillVolume * WaterStorage(TankNum).Twater) / (overflowVol + OverFillVolume); overflowVol += OverFillVolume; NetVolAdd -= OverFillVolume; - NetVdotAdd = NetVolAdd / (TimeStepSys * SecInHour); + NetVdotAdd = NetVolAdd / (TimeStepSys * DataGlobalConstants::SecInHour()); VolumePredict = WaterStorage(TankNum).MaxCapacity; } @@ -1173,10 +1169,10 @@ namespace WaterManager { AvailVolume = WaterStorage(TankNum).LastTimeStepVolume + TotVolSupplyAvail; AvailVolume = max(0.0, AvailVolume); TotVolDemandAvail = AvailVolume; - TotVdotDemandAvail = AvailVolume / (TimeStepSys * SecInHour); + TotVdotDemandAvail = AvailVolume / (TimeStepSys * DataGlobalConstants::SecInHour()); underflowVdot = OrigVdotDemandRequest - TotVdotDemandAvail; NetVdotAdd = TotVdotSupplyAvail - TotVdotDemandAvail; - NetVolAdd = NetVdotAdd * (TimeStepSys * SecInHour); + NetVolAdd = NetVdotAdd * (TimeStepSys * DataGlobalConstants::SecInHour()); VolumePredict = 0.0; } @@ -1201,18 +1197,18 @@ namespace WaterManager { // set mains draws for float on (all the way to Float off) if (WaterStorage(TankNum).ControlSupplyType == MainsFloatValve) { - WaterStorage(TankNum).MainsDrawVdot = FillVolRequest / (TimeStepSys * SecInHour); + WaterStorage(TankNum).MainsDrawVdot = FillVolRequest / (TimeStepSys * DataGlobalConstants::SecInHour()); NetVolAdd = FillVolRequest; } // set demand request in supplying tank if needed if ((WaterStorage(TankNum).ControlSupplyType == OtherTankFloatValve) || (WaterStorage(TankNum).ControlSupplyType == TankMainsBackup)) { WaterStorage(WaterStorage(TankNum).SupplyTankID).VdotRequestDemand(WaterStorage(TankNum).SupplyTankDemandARRID) = - FillVolRequest / (TimeStepSys * SecInHour); + FillVolRequest / (TimeStepSys * DataGlobalConstants::SecInHour()); } // set demand request in groundwater well if needed if ((WaterStorage(TankNum).ControlSupplyType == WellFloatValve) || (WaterStorage(TankNum).ControlSupplyType == WellFloatMainsBackup)) { - GroundwaterWell(WaterStorage(TankNum).GroundWellID).VdotRequest = FillVolRequest / (TimeStepSys * SecInHour); + GroundwaterWell(WaterStorage(TankNum).GroundWellID).VdotRequest = FillVolRequest / (TimeStepSys * DataGlobalConstants::SecInHour()); } } @@ -1220,17 +1216,17 @@ namespace WaterManager { if ((VolumePredict) < WaterStorage(TankNum).BackupMainsCapacity) { // turn on supply if ((WaterStorage(TankNum).ControlSupplyType == WellFloatMainsBackup) || (WaterStorage(TankNum).ControlSupplyType == TankMainsBackup)) { FillVolRequest = WaterStorage(TankNum).ValveOffCapacity - VolumePredict; - WaterStorage(TankNum).MainsDrawVdot = FillVolRequest / (TimeStepSys * SecInHour); + WaterStorage(TankNum).MainsDrawVdot = FillVolRequest / (TimeStepSys * DataGlobalConstants::SecInHour()); NetVolAdd = FillVolRequest; } } WaterStorage(TankNum).ThisTimeStepVolume = WaterStorage(TankNum).LastTimeStepVolume + NetVolAdd; - WaterStorage(TankNum).VdotOverflow = overflowVol / (TimeStepSys * SecInHour); + WaterStorage(TankNum).VdotOverflow = overflowVol / (TimeStepSys * DataGlobalConstants::SecInHour()); WaterStorage(TankNum).VolOverflow = overflowVol; WaterStorage(TankNum).TwaterOverflow = overflowTwater; - WaterStorage(TankNum).NetVdot = NetVolAdd / (TimeStepSys * SecInHour); - WaterStorage(TankNum).MainsDrawVol = WaterStorage(TankNum).MainsDrawVdot * (TimeStepSys * SecInHour); + WaterStorage(TankNum).NetVdot = NetVolAdd / (TimeStepSys * DataGlobalConstants::SecInHour()); + WaterStorage(TankNum).MainsDrawVol = WaterStorage(TankNum).MainsDrawVdot * (TimeStepSys * DataGlobalConstants::SecInHour()); WaterStorage(TankNum).VdotToTank = TotVdotSupplyAvail; WaterStorage(TankNum).VdotFromTank = TotVdotDemandAvail; @@ -1495,7 +1491,6 @@ namespace WaterManager { // na // Using/Aliasing using DataEnvironment::OutWetBulbTempAt; - using DataGlobals::SecInHour; using DataHVACGlobals::TimeStepSys; using ScheduleManager::GetCurrentScheduleValue; @@ -1552,7 +1547,7 @@ namespace WaterManager { OutWetBulbTempAt(RainCollector(RainColNum).MeanHeight); RainCollector(RainColNum).VdotAvail = VdotAvail; - RainCollector(RainColNum).VolCollected = VdotAvail * TimeStepSys * SecInHour; + RainCollector(RainColNum).VolCollected = VdotAvail * TimeStepSys * DataGlobalConstants::SecInHour(); } } @@ -1579,7 +1574,6 @@ namespace WaterManager { // Using/Aliasing using DataEnvironment::GroundTemp_Deep; using DataGlobals::BeginTimeStepFlag; - using DataGlobals::SecInHour; using DataHVACGlobals::TimeStepSys; // Locals @@ -1629,9 +1623,9 @@ namespace WaterManager { } GroundwaterWell(WellNum).VdotDelivered = VdotDelivered; - GroundwaterWell(WellNum).VolDelivered = VdotDelivered * TimeStepSys * SecInHour; + GroundwaterWell(WellNum).VolDelivered = VdotDelivered * TimeStepSys * DataGlobalConstants::SecInHour(); GroundwaterWell(WellNum).PumpPower = PumpPower; - GroundwaterWell(WellNum).PumpEnergy = PumpPower * TimeStepSys * SecInHour; + GroundwaterWell(WellNum).PumpEnergy = PumpPower * TimeStepSys * DataGlobalConstants::SecInHour(); } void UpdateWaterManager(EnergyPlusData &state) diff --git a/src/EnergyPlus/WaterThermalTanks.cc b/src/EnergyPlus/WaterThermalTanks.cc index a240f64cd24..5dcfac49cfa 100644 --- a/src/EnergyPlus/WaterThermalTanks.cc +++ b/src/EnergyPlus/WaterThermalTanks.cc @@ -6189,7 +6189,7 @@ namespace WaterThermalTanks { Cp = FluidProperties::GetSpecificHeatGlycol(state, fluidNameWater, TankTemp_loc, waterIndex, RoutineName); } - Real64 SecInTimeStep = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + Real64 SecInTimeStep = DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); Real64 TimeRemaining = SecInTimeStep; int CycleOnCount_loc = 0; int MaxCycles = SecInTimeStep; @@ -7014,7 +7014,7 @@ namespace WaterThermalTanks { const Real64 TimeElapsed_loc = DataGlobals::HourOfDay + DataGlobals::TimeStep * DataGlobals::TimeStepZone + DataHVACGlobals::SysTimeElapsed; // Seconds in one DataGlobals::TimeStep (s) - const Real64 SecInTimeStep = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + const Real64 SecInTimeStep = DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); // Advance tank simulation to the next system DataGlobals::TimeStep, if applicable if (this->TimeElapsed != TimeElapsed_loc) { @@ -7853,7 +7853,7 @@ namespace WaterThermalTanks { } // validsourcetype DesupHtr.OffCycParaFuelRate = DesupHtr.OffCycParaLoad; - DesupHtr.OffCycParaFuelEnergy = DesupHtr.OffCycParaFuelRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + DesupHtr.OffCycParaFuelEnergy = DesupHtr.OffCycParaFuelRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); // check that water heater tank cut-in temp is greater than desuperheater cut-in temp Real64 desupHtrSetPointTemp = DesupHtr.SetPointTemp; @@ -8215,14 +8215,14 @@ namespace WaterThermalTanks { DesupHtr.HeaterRate = 0.0; } - DesupHtr.HeaterEnergy = DesupHtr.HeaterRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + DesupHtr.HeaterEnergy = DesupHtr.HeaterRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); DesupHtr.DesuperheaterPLR = partLoadRatio; DesupHtr.OnCycParaFuelRate = DesupHtr.OnCycParaLoad * partLoadRatio; - DesupHtr.OnCycParaFuelEnergy = DesupHtr.OnCycParaFuelRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + DesupHtr.OnCycParaFuelEnergy = DesupHtr.OnCycParaFuelRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); DesupHtr.OffCycParaFuelRate = DesupHtr.OffCycParaLoad * (1 - partLoadRatio); - DesupHtr.OffCycParaFuelEnergy = DesupHtr.OffCycParaFuelRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + DesupHtr.OffCycParaFuelEnergy = DesupHtr.OffCycParaFuelRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); DesupHtr.PumpPower = DesupHtr.PumpElecPower * (partLoadRatio); - DesupHtr.PumpEnergy = DesupHtr.PumpPower * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + DesupHtr.PumpEnergy = DesupHtr.PumpPower * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); // Update used waste heat (just in case multiple users of waste heat use same source) if (DesupHtr.ValidSourceType) { @@ -8506,7 +8506,7 @@ namespace WaterThermalTanks { // If HPWH compressor is available and unit is off for another reason, off-cycle parasitics are calculated if (AvailSchedule != 0) { HeatPump.OffCycParaFuelRate = HeatPump.OffCycParaLoad * (1.0 - state.dataWaterThermalTanks->hpPartLoadRatio); - HeatPump.OffCycParaFuelEnergy = HeatPump.OffCycParaFuelRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + HeatPump.OffCycParaFuelEnergy = HeatPump.OffCycParaFuelRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); } // Warn if HPWH compressor cut-in temperature is less than the water heater tank's set point temp @@ -9435,9 +9435,9 @@ namespace WaterThermalTanks { HeatPump.HeatingPLR = state.dataWaterThermalTanks->hpPartLoadRatio; HeatPump.OnCycParaFuelRate = HeatPump.OnCycParaLoad * state.dataWaterThermalTanks->hpPartLoadRatio; - HeatPump.OnCycParaFuelEnergy = HeatPump.OnCycParaFuelRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + HeatPump.OnCycParaFuelEnergy = HeatPump.OnCycParaFuelRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); HeatPump.OffCycParaFuelRate = HeatPump.OffCycParaLoad * (1.0 - state.dataWaterThermalTanks->hpPartLoadRatio); - HeatPump.OffCycParaFuelEnergy = HeatPump.OffCycParaFuelRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + HeatPump.OffCycParaFuelEnergy = HeatPump.OffCycParaFuelRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); if (HeatPump.TankTypeNum == DataPlant::TypeOf_WtrHeaterMixed) { HeatPump.ControlTempAvg = this->TankTempAvg; HeatPump.ControlTempFinal = this->TankTemp; @@ -10470,7 +10470,7 @@ namespace WaterThermalTanks { } tmpMaxCapacity = SumPeopleAllZones * this->Sizing.RecoveryCapacityPerPerson * (Tfinish - Tstart) * - (1.0 / DataGlobals::SecInHour) * rho * Cp; // m3/hr/person | delta T in K | 1 hr/ 3600 s | kg/m3 | J/Kg/k + (1.0 / DataGlobalConstants::SecInHour()) * rho * Cp; // m3/hr/person | delta T in K | 1 hr/ 3600 s | kg/m3 | J/Kg/k } if (this->VolumeWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { @@ -10512,7 +10512,7 @@ namespace WaterThermalTanks { Cp = FluidProperties::GetSpecificHeatGlycol(state, fluidNameWater, ((Tfinish + Tstart) / 2.0), waterIndex, RoutineName); } tmpMaxCapacity = SumFloorAreaAllZones * this->Sizing.RecoveryCapacityPerArea * (Tfinish - Tstart) * - (1.0 / DataGlobals::SecInHour) * rho * Cp; // m2 | m3/hr/m2 | delta T in K | 1 hr/ 3600 s | kg/m3 | J/Kg/k + (1.0 / DataGlobalConstants::SecInHour()) * rho * Cp; // m2 | m3/hr/m2 | delta T in K | 1 hr/ 3600 s | kg/m3 | J/Kg/k } if (this->VolumeWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { this->Volume = tmpTankVolume; @@ -10553,7 +10553,7 @@ namespace WaterThermalTanks { Cp = FluidProperties::GetSpecificHeatGlycol(state, fluidNameWater, ((Tfinish + Tstart) / 2.0), waterIndex, RoutineName); } tmpMaxCapacity = this->Sizing.NumberOfUnits * this->Sizing.RecoveryCapacityPerUnit * (Tfinish - Tstart) * - (1.0 / DataGlobals::SecInHour) * rho * Cp; // m3/hr/ea | delta T in K | 1 hr/ 3600 s | kg/m3 | J/Kg/k + (1.0 / DataGlobalConstants::SecInHour()) * rho * Cp; // m3/hr/ea | delta T in K | 1 hr/ 3600 s | kg/m3 | J/Kg/k } if (this->VolumeWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { @@ -10632,7 +10632,7 @@ namespace WaterThermalTanks { if (SELECT_CASE_var == SizeEnum::PeakDraw) { if (this->VolumeWasAutoSized) - tmpTankVolume = this->Sizing.TankDrawTime * this->UseDesignVolFlowRate * DataGlobals::SecInHour; // hours | m3/s | (3600 s/1 hour) + tmpTankVolume = this->Sizing.TankDrawTime * this->UseDesignVolFlowRate * DataGlobalConstants::SecInHour(); // hours | m3/s | (3600 s/1 hour) if (this->VolumeWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { this->Volume = tmpTankVolume; if (DataPlant::PlantFinalSizesOkayToReport) { @@ -10660,7 +10660,7 @@ namespace WaterThermalTanks { Cp = FluidProperties::GetSpecificHeatGlycol(state, fluidNameWater, ((Tfinish + Tstart) / 2.0), waterIndex, RoutineName); } tmpMaxCapacity = (this->Volume * rho * Cp * (Tfinish - Tstart)) / - (this->Sizing.RecoveryTime * DataGlobals::SecInHour); // m3 | kg/m3 | J/Kg/K | K | seconds + (this->Sizing.RecoveryTime * DataGlobalConstants::SecInHour()); // m3 | kg/m3 | J/Kg/K | K | seconds } else { ShowFatalError("SizeTankForSupplySide: Tank=\"" + this->Name + "\", requested sizing for max capacity but entered Recovery Time is zero."); @@ -10777,18 +10777,18 @@ namespace WaterThermalTanks { Real64 eff = this->UseEffectiveness; if ((Tpdesign >= 58.0) && (!this->IsChilledWaterTank)) { if (DataPlant::PlantFirstSizesOkayToFinalize) { - this->UseDesignVolFlowRate = -1.0 * (TankVolume / (tankRecoverhours * DataGlobals::SecInHour * eff)) * + this->UseDesignVolFlowRate = -1.0 * (TankVolume / (tankRecoverhours * DataGlobalConstants::SecInHour() * eff)) * std::log((Tpdesign - Tfinish) / (Tpdesign - Tstart)); } else { - tmpUseDesignVolFlowRate = -1.0 * (TankVolume / (tankRecoverhours * DataGlobals::SecInHour * eff)) * + tmpUseDesignVolFlowRate = -1.0 * (TankVolume / (tankRecoverhours * DataGlobalConstants::SecInHour() * eff)) * std::log((Tpdesign - Tfinish) / (Tpdesign - Tstart)); } } else if ((Tpdesign <= 8.0) && (this->IsChilledWaterTank)) { if (DataPlant::PlantFirstSizesOkayToFinalize) { - this->UseDesignVolFlowRate = -1.0 * (TankVolume / (tankRecoverhours * DataGlobals::SecInHour * eff)) * + this->UseDesignVolFlowRate = -1.0 * (TankVolume / (tankRecoverhours * DataGlobalConstants::SecInHour() * eff)) * std::log((Tpdesign - Tfinish) / (Tpdesign - Tstart)); } else { - tmpUseDesignVolFlowRate = -1.0 * (TankVolume / (tankRecoverhours * DataGlobals::SecInHour * eff)) * + tmpUseDesignVolFlowRate = -1.0 * (TankVolume / (tankRecoverhours * DataGlobalConstants::SecInHour() * eff)) * std::log((Tpdesign - Tfinish) / (Tpdesign - Tstart)); } } else { @@ -10860,18 +10860,18 @@ namespace WaterThermalTanks { if ((Tpdesign >= 58.0) && (!this->IsChilledWaterTank)) { if (DataPlant::PlantFirstSizesOkayToFinalize) { - this->SourceDesignVolFlowRate = -1.0 * (TankVolume / (tankRecoverhours * DataGlobals::SecInHour * eff)) * + this->SourceDesignVolFlowRate = -1.0 * (TankVolume / (tankRecoverhours * DataGlobalConstants::SecInHour() * eff)) * std::log((Tpdesign - Tfinish) / (Tpdesign - Tstart)); } else { - tmpSourceDesignVolFlowRate = -1.0 * (TankVolume / (tankRecoverhours * DataGlobals::SecInHour * eff)) * + tmpSourceDesignVolFlowRate = -1.0 * (TankVolume / (tankRecoverhours * DataGlobalConstants::SecInHour() * eff)) * std::log((Tpdesign - Tfinish) / (Tpdesign - Tstart)); } } else if ((Tpdesign <= 8.0) && (this->IsChilledWaterTank)) { if (DataPlant::PlantFirstSizesOkayToFinalize) { - this->SourceDesignVolFlowRate = -1.0 * (TankVolume / (tankRecoverhours * DataGlobals::SecInHour * eff)) * + this->SourceDesignVolFlowRate = -1.0 * (TankVolume / (tankRecoverhours * DataGlobalConstants::SecInHour() * eff)) * std::log((Tpdesign - Tfinish) / (Tpdesign - Tstart)); } else { - tmpSourceDesignVolFlowRate = -1.0 * (TankVolume / (tankRecoverhours * DataGlobals::SecInHour * eff)) * + tmpSourceDesignVolFlowRate = -1.0 * (TankVolume / (tankRecoverhours * DataGlobalConstants::SecInHour() * eff)) * std::log((Tpdesign - Tfinish) / (Tpdesign - Tstart)); } } else { @@ -10972,7 +10972,7 @@ namespace WaterThermalTanks { Real64 DrawDesignVolFlowRate = ScheduleManager::GetScheduleMaxValue(this->FlowRateSchedule) * this->MassFlowRateMax / rho; if (this->VolumeWasAutoSized) { - tmpTankVolume = this->Sizing.TankDrawTime * DrawDesignVolFlowRate * DataGlobals::SecInHour; // hours | m3/s | (3600 s/1 hour) + tmpTankVolume = this->Sizing.TankDrawTime * DrawDesignVolFlowRate * DataGlobalConstants::SecInHour(); // hours | m3/s | (3600 s/1 hour) this->Volume = tmpTankVolume; BaseSizer::reportSizerOutput(this->Type, this->Name, "Tank Volume [m3]", this->Volume); } @@ -10982,7 +10982,7 @@ namespace WaterThermalTanks { Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, fluidNameWater, ((Tfinish + Tstart) / 2.0), waterIndex, RoutineName); tmpMaxCapacity = (this->Volume * rho * Cp * (Tfinish - Tstart)) / - (this->Sizing.RecoveryTime * DataGlobals::SecInHour); // m3 | kg/m3 | J/Kg/K | K | seconds + (this->Sizing.RecoveryTime * DataGlobalConstants::SecInHour()); // m3 | kg/m3 | J/Kg/K | K | seconds } else { ShowFatalError("SizeStandAloneWaterHeater: Tank=\"" + this->Name + "\", requested sizing for max capacity but entered Recovery Time is zero."); @@ -11142,7 +11142,7 @@ namespace WaterThermalTanks { Real64 rho = FluidProperties::GetDensityGlycol(state, fluidNameWater, ((Tfinish + Tstart) / 2.0), waterIndex, RoutineName); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, fluidNameWater, ((Tfinish + Tstart) / 2.0), waterIndex, RoutineName); tmpMaxCapacity = SumPeopleAllZones * this->Sizing.RecoveryCapacityPerPerson * (Tfinish - Tstart) * - (1.0 / DataGlobals::SecInHour) * rho * Cp; // m3/hr/person | delta T in K | 1 hr/ 3600 s | kg/m3 | J/Kg/k + (1.0 / DataGlobalConstants::SecInHour()) * rho * Cp; // m3/hr/person | delta T in K | 1 hr/ 3600 s | kg/m3 | J/Kg/k } if (this->VolumeWasAutoSized) { @@ -11165,7 +11165,7 @@ namespace WaterThermalTanks { Real64 rho = FluidProperties::GetDensityGlycol(state, fluidNameWater, ((Tfinish + Tstart) / 2.0), waterIndex, RoutineName); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, fluidNameWater, ((Tfinish + Tstart) / 2.0), waterIndex, RoutineName); tmpMaxCapacity = SumFloorAreaAllZones * this->Sizing.RecoveryCapacityPerArea * (Tfinish - Tstart) * - (1.0 / DataGlobals::SecInHour) * rho * Cp; // m2 | m3/hr/m2 | delta T in K | 1 hr/ 3600 s | kg/m3 | J/Kg/k + (1.0 / DataGlobalConstants::SecInHour()) * rho * Cp; // m2 | m3/hr/m2 | delta T in K | 1 hr/ 3600 s | kg/m3 | J/Kg/k } if (this->VolumeWasAutoSized) { this->Volume = tmpTankVolume; @@ -11183,7 +11183,7 @@ namespace WaterThermalTanks { Real64 rho = FluidProperties::GetDensityGlycol(state, fluidNameWater, ((Tfinish + Tstart) / 2.0), waterIndex, RoutineName); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, fluidNameWater, ((Tfinish + Tstart) / 2.0), waterIndex, RoutineName); tmpMaxCapacity = this->Sizing.NumberOfUnits * this->Sizing.RecoveryCapacityPerUnit * (Tfinish - Tstart) * - (1.0 / DataGlobals::SecInHour) * rho * Cp; // m3/hr/ea | delta T in K | 1 hr/ 3600 s | kg/m3 | J/Kg/k + (1.0 / DataGlobalConstants::SecInHour()) * rho * Cp; // m3/hr/ea | delta T in K | 1 hr/ 3600 s | kg/m3 | J/Kg/k } if (this->VolumeWasAutoSized) { @@ -11251,7 +11251,7 @@ namespace WaterThermalTanks { // MODIFIED na // RE-ENGINEERED Feb 2004, PGE - Real64 SecInTimeStep = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + Real64 SecInTimeStep = DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); this->UnmetEnergy = this->UnmetRate * SecInTimeStep; this->LossEnergy = this->LossRate * SecInTimeStep; @@ -11317,7 +11317,7 @@ namespace WaterThermalTanks { Real64 TotalDrawMass = 0.243402 * Psychrometrics::RhoH2O(DataGlobals::InitConvTemp); // 64.3 gal * rho Real64 DrawMass = TotalDrawMass / 6.0; // 6 equal draws - Real64 SecInTimeStep = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + Real64 SecInTimeStep = DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); Real64 DrawMassFlowRate = DrawMass / SecInTimeStep; Real64 FuelEnergy_loc = 0.0; FirstTimeFlag = true; diff --git a/src/EnergyPlus/WaterToAirHeatPump.cc b/src/EnergyPlus/WaterToAirHeatPump.cc index b4738d38f0b..2406d54d2fd 100644 --- a/src/EnergyPlus/WaterToAirHeatPump.cc +++ b/src/EnergyPlus/WaterToAirHeatPump.cc @@ -320,7 +320,7 @@ namespace WaterToAirHeatPump { state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoadSideTotalUACoeff = NumArray(7); state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoadSideOutsideUACoeff = NumArray(8); - if ((state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoadSideOutsideUACoeff < rTinyValue) || (state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoadSideTotalUACoeff < rTinyValue)) { + if ((state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoadSideOutsideUACoeff < DataGlobalConstants::rTinyValue()) || (state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoadSideTotalUACoeff < DataGlobalConstants::rTinyValue())) { ShowSevereError("Input problem for " + CurrentModuleObject + '=' + state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).Name); ShowContinueError(" One or both load side UA values entered are below tolerance, likely zero or blank."); ShowContinueError(" Verify inputs, as the parameter syntax for this object went through a change with"); @@ -467,7 +467,7 @@ namespace WaterToAirHeatPump { AlphArray(7), ErrorsFound, CurrentModuleObject, AlphArray(1), NodeType_Air, NodeConnectionType_Outlet, 1, ObjectIsNotParent); state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoadSideTotalUACoeff = NumArray(5); - if (state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoadSideTotalUACoeff < rTinyValue) { + if (state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoadSideTotalUACoeff < DataGlobalConstants::rTinyValue()) { ShowSevereError("Input problem for " + CurrentModuleObject + '=' + state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).Name); ShowContinueError(" Load side UA value is less than tolerance, likely zero or blank."); ShowContinueError(" Verify inputs, as the parameter syntax for this object went through a change with"); @@ -849,7 +849,7 @@ namespace WaterToAirHeatPump { _); if (PlantLoop(state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoopNum).FluidName == "WATER") { - if (state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).SourceSideUACoeff < rTinyValue) { + if (state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).SourceSideUACoeff < DataGlobalConstants::rTinyValue()) { ShowSevereError("Input problem for water to air heat pump, \"" + state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).Name + "\"."); ShowContinueError(" Source side UA value is less than tolerance, likely zero or blank."); ShowContinueError(" Verify inputs, as the parameter syntax for this object went through a change with"); @@ -857,7 +857,7 @@ namespace WaterToAirHeatPump { errFlag = true; } } else { - if ((state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).SourceSideHTR1 < rTinyValue) || (state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).SourceSideHTR2 < rTinyValue)) { + if ((state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).SourceSideHTR1 < DataGlobalConstants::rTinyValue()) || (state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).SourceSideHTR2 < DataGlobalConstants::rTinyValue())) { ShowSevereError("Input problem for water to air heat pump, \"" + state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).Name + "\"."); ShowContinueError(" A source side heat transfer resistance value is less than tolerance, likely zero or blank."); ShowContinueError(" Verify inputs, as the parameter syntax for this object went through a change with"); @@ -2191,7 +2191,7 @@ namespace WaterToAirHeatPump { int WaterOutletNode; Real64 ReportingConstant; - ReportingConstant = TimeStepSys * SecInHour; + ReportingConstant = TimeStepSys * DataGlobalConstants::SecInHour(); // state.dataWaterToAirHeatPump->WatertoAirHP(HPNum)%SimFlag=.FALSE. if (!state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).SimFlag) { // Heatpump is off; just pass through conditions diff --git a/src/EnergyPlus/WaterToAirHeatPumpSimple.cc b/src/EnergyPlus/WaterToAirHeatPumpSimple.cc index dbcc7635758..628017ce626 100644 --- a/src/EnergyPlus/WaterToAirHeatPumpSimple.cc +++ b/src/EnergyPlus/WaterToAirHeatPumpSimple.cc @@ -2333,7 +2333,7 @@ namespace WaterToAirHeatPumpSimple { // Add power to global variable so power can be summed by parent object DXElecCoolingPower = state.dataWaterToAirHeatPumpSimple->Winput; - ReportingConstant = TimeStepSys * SecInHour; + ReportingConstant = TimeStepSys * DataGlobalConstants::SecInHour(); DataHeatBalance::HeatReclaimDataBase &HeatReclaim = HeatReclaimSimple_WAHPCoil(HPNum); HeatReclaim.WaterHeatingDesuperheaterReclaimedHeatTotal = 0.0; if (allocated(HeatReclaim.WaterHeatingDesuperheaterReclaimedHeat)) { @@ -2575,7 +2575,7 @@ namespace WaterToAirHeatPumpSimple { // Add power to global variable so power can be summed by parent object DXElecHeatingPower = state.dataWaterToAirHeatPumpSimple->Winput; - ReportingConstant = TimeStepSys * SecInHour; + ReportingConstant = TimeStepSys * DataGlobalConstants::SecInHour(); // Update heat pump data structure state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).Power = state.dataWaterToAirHeatPumpSimple->Winput; state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).QLoadTotal = state.dataWaterToAirHeatPumpSimple->QLoadTotal; @@ -2722,7 +2722,7 @@ namespace WaterToAirHeatPumpSimple { Node(WaterOutletNode).Temp = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).OutletWaterTemp; Node(WaterOutletNode).Enthalpy = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).OutletWaterEnthalpy; - ReportingConstant = TimeStepSys * SecInHour; + ReportingConstant = TimeStepSys * DataGlobalConstants::SecInHour(); state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).Energy = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).Power * ReportingConstant; state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).EnergyLoadTotal = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).QLoadTotal * ReportingConstant; state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).EnergySensible = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).QSensible * ReportingConstant; diff --git a/src/EnergyPlus/WaterUse.cc b/src/EnergyPlus/WaterUse.cc index 0201fdccd72..2b171a856c5 100644 --- a/src/EnergyPlus/WaterUse.cc +++ b/src/EnergyPlus/WaterUse.cc @@ -925,7 +925,7 @@ namespace WaterUse { } else { this->SensibleRate = ScheduleManager::GetCurrentScheduleValue(this->SensibleFracSchedule) * this->TotalMassFlowRate * Psychrometrics::CPHW(DataGlobals::InitConvTemp) * (this->MixedTemp - DataHeatBalFanSys::MAT(this->Zone)); - this->SensibleEnergy = this->SensibleRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->SensibleEnergy = this->SensibleRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); } if (this->LatentFracSchedule == 0) { @@ -938,14 +938,14 @@ namespace WaterUse { Real64 RhoAirDry = Psychrometrics::PsyRhoAirFnPbTdbW(DataEnvironment::OutBaroPress, DataHeatBalFanSys::MAT(this->Zone), 0.0); Real64 ZoneMassMax = (ZoneHumRatSat - ZoneHumRat) * RhoAirDry * DataHeatBalance::Zone(this->Zone).Volume; // Max water that can be evaporated to zone - Real64 FlowMassMax = this->TotalMassFlowRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; // Max water in flow + Real64 FlowMassMax = this->TotalMassFlowRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); // Max water in flow Real64 MoistureMassMax = min(ZoneMassMax, FlowMassMax); this->MoistureMass = ScheduleManager::GetCurrentScheduleValue(this->LatentFracSchedule) * MoistureMassMax; - this->MoistureRate = this->MoistureMass / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + this->MoistureRate = this->MoistureMass / (DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour()); this->LatentRate = this->MoistureRate * Psychrometrics::PsyHfgAirFnWTdb(ZoneHumRat, DataHeatBalFanSys::MAT(this->Zone)); - this->LatentEnergy = this->LatentRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->LatentEnergy = this->LatentRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); } this->DrainMassFlowRate = this->TotalMassFlowRate - this->MoistureRate; @@ -1309,9 +1309,9 @@ namespace WaterUse { thisWEq.HotVolFlowRate = thisWEq.HotMassFlowRate / Psychrometrics::RhoH2O(DataGlobals::InitConvTemp); thisWEq.TotalVolFlowRate = thisWEq.ColdVolFlowRate + thisWEq.HotVolFlowRate; - thisWEq.ColdVolume = thisWEq.ColdVolFlowRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - thisWEq.HotVolume = thisWEq.HotVolFlowRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - thisWEq.TotalVolume = thisWEq.TotalVolFlowRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + thisWEq.ColdVolume = thisWEq.ColdVolFlowRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + thisWEq.HotVolume = thisWEq.HotVolFlowRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + thisWEq.TotalVolume = thisWEq.TotalVolFlowRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); if (thisWEq.Connections == 0) { thisWEq.Power = thisWEq.HotMassFlowRate * Psychrometrics::CPHW(DataGlobals::InitConvTemp) * (thisWEq.HotTemp - thisWEq.ColdTemp); @@ -1320,7 +1320,7 @@ namespace WaterUse { (thisWEq.HotTemp - state.dataWaterUse->WaterConnections(thisWEq.Connections).ReturnTemp); } - thisWEq.Energy = thisWEq.Power * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + thisWEq.Energy = thisWEq.Power * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); } } @@ -1344,9 +1344,9 @@ namespace WaterUse { thisWEq.ColdVolFlowRate = thisWEq.ColdMassFlowRate / Psychrometrics::RhoH2O(DataGlobals::InitConvTemp); thisWEq.HotVolFlowRate = thisWEq.HotMassFlowRate / Psychrometrics::RhoH2O(DataGlobals::InitConvTemp); thisWEq.TotalVolFlowRate = thisWEq.ColdVolFlowRate + thisWEq.HotVolFlowRate; - thisWEq.ColdVolume = thisWEq.ColdVolFlowRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - thisWEq.HotVolume = thisWEq.HotVolFlowRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - thisWEq.TotalVolume = thisWEq.TotalVolFlowRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + thisWEq.ColdVolume = thisWEq.ColdVolFlowRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + thisWEq.HotVolume = thisWEq.HotVolFlowRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + thisWEq.TotalVolume = thisWEq.TotalVolFlowRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); if (thisWEq.Connections == 0) { thisWEq.Power = thisWEq.HotMassFlowRate * Psychrometrics::CPHW(DataGlobals::InitConvTemp) * (thisWEq.HotTemp - thisWEq.ColdTemp); @@ -1355,18 +1355,18 @@ namespace WaterUse { (thisWEq.HotTemp - state.dataWaterUse->WaterConnections(thisWEq.Connections).ReturnTemp); } - thisWEq.Energy = thisWEq.Power * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + thisWEq.Energy = thisWEq.Power * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); } this->ColdVolFlowRate = this->ColdMassFlowRate / Psychrometrics::RhoH2O(DataGlobals::InitConvTemp); this->HotVolFlowRate = this->HotMassFlowRate / Psychrometrics::RhoH2O(DataGlobals::InitConvTemp); this->TotalVolFlowRate = this->ColdVolFlowRate + this->HotVolFlowRate; - this->ColdVolume = this->ColdVolFlowRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - this->HotVolume = this->HotVolFlowRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - this->TotalVolume = this->TotalVolFlowRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->ColdVolume = this->ColdVolFlowRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + this->HotVolume = this->HotVolFlowRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + this->TotalVolume = this->TotalVolFlowRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); this->Power = this->HotMassFlowRate * Psychrometrics::CPHW(DataGlobals::InitConvTemp) * (this->HotTemp - this->ReturnTemp); - this->Energy = this->Power * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - this->RecoveryEnergy = this->RecoveryRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->Energy = this->Power * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); + this->RecoveryEnergy = this->RecoveryRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); } void CalcWaterUseZoneGains(EnergyPlusData &state) diff --git a/src/EnergyPlus/WindTurbine.cc b/src/EnergyPlus/WindTurbine.cc index 217e39b527c..26dbd1e8522 100644 --- a/src/EnergyPlus/WindTurbine.cc +++ b/src/EnergyPlus/WindTurbine.cc @@ -96,8 +96,6 @@ namespace WindTurbine { // using namespace DataGenerators; using DataGlobals::BeginEnvrnFlag; using DataGlobals::ScheduleAlwaysOn; - using DataGlobals::SecInHour; - static std::string const BlankString; void SimWindTurbine(EnergyPlusData &state, @@ -980,7 +978,7 @@ namespace WindTurbine { using DataHVACGlobals::TimeStepSys; - state.dataWindTurbine->WindTurbineSys(WindTurbineNum).Energy = state.dataWindTurbine->WindTurbineSys(WindTurbineNum).Power * TimeStepSys * SecInHour; + state.dataWindTurbine->WindTurbineSys(WindTurbineNum).Energy = state.dataWindTurbine->WindTurbineSys(WindTurbineNum).Power * TimeStepSys * DataGlobalConstants::SecInHour(); } //***************************************************************************************** diff --git a/src/EnergyPlus/WindowAC.cc b/src/EnergyPlus/WindowAC.cc index ad782a4c1f0..c1ee6478ed6 100644 --- a/src/EnergyPlus/WindowAC.cc +++ b/src/EnergyPlus/WindowAC.cc @@ -119,7 +119,6 @@ namespace WindowAC { using DataGlobals::BeginDayFlag; using DataGlobals::BeginEnvrnFlag; using DataGlobals::DisplayExtraWarnings; - using DataGlobals::SecInHour; using DataGlobals::SysSizingCalc; using DataHVACGlobals::BlowThru; using DataHVACGlobals::CoilDX_CoolingHXAssisted; @@ -1262,7 +1261,7 @@ namespace WindowAC { Real64 ReportingConstant; - ReportingConstant = TimeStepSys * SecInHour; + ReportingConstant = TimeStepSys * DataGlobalConstants::SecInHour(); state.dataWindowAC->WindAC(WindACNum).SensCoolEnergy = state.dataWindowAC->WindAC(WindACNum).SensCoolEnergyRate * ReportingConstant; state.dataWindowAC->WindAC(WindACNum).TotCoolEnergy = state.dataWindowAC->WindAC(WindACNum).TotCoolEnergyRate * ReportingConstant; diff --git a/src/EnergyPlus/WindowAC.hh b/src/EnergyPlus/WindowAC.hh index 0f6038da60b..4b9c1c60393 100644 --- a/src/EnergyPlus/WindowAC.hh +++ b/src/EnergyPlus/WindowAC.hh @@ -68,7 +68,6 @@ namespace WindowAC { // Members // input data std::string Name; // name of unit - // CHARACTER(len=MaxNameLength) :: UnitType =' ' ! type of unit int UnitType; // type of unit std::string Sched; // availability schedule int SchedPtr; // index to schedule diff --git a/src/EnergyPlus/WindowComplexManager.cc b/src/EnergyPlus/WindowComplexManager.cc index 81db7b61d72..b622408ec20 100644 --- a/src/EnergyPlus/WindowComplexManager.cc +++ b/src/EnergyPlus/WindowComplexManager.cc @@ -101,7 +101,6 @@ namespace WindowComplexManager { using DataGlobals::KelvinConv; using DataGlobals::NumOfTimeStepInHour; using DataGlobals::NumOfZones; - using DataGlobals::rTinyValue; using DataGlobals::TimeStepZoneSec; using namespace DataSurfaces; // , ONLY: TotSurfaces,TotWindows,Surface,SurfaceWindow !update this later using DataEnvironment::CloudFraction; @@ -2441,7 +2440,7 @@ namespace WindowComplexManager { assert(false); } } - if (std::abs(Cost) < rTinyValue) Cost = 0.0; + if (std::abs(Cost) < DataGlobalConstants::rTinyValue()) Cost = 0.0; if (Cost < 0.0) Theta = DataGlobalConstants::Pi() - Theta; // This signals ray out of hemisphere } diff --git a/src/EnergyPlus/WindowManager.cc b/src/EnergyPlus/WindowManager.cc index 6fefab7b9f8..6999f421fba 100644 --- a/src/EnergyPlus/WindowManager.cc +++ b/src/EnergyPlus/WindowManager.cc @@ -4296,7 +4296,7 @@ namespace WindowManager { vv(imax) = vv(j); } indx(j) = imax; - if (ajac(j, j) == 0.0) ajac(j, j) = rTinyValue; + if (ajac(j, j) == 0.0) ajac(j, j) = DataGlobalConstants::rTinyValue(); if (j != n) { dum = 1.0 / ajac(j, j); for (i = j + 1; i <= n; ++i) { @@ -8439,7 +8439,7 @@ namespace WindowManager { INDX(j) = imax; if (j != N) { - if (A(j, j) == 0.0) A(j, j) = rTinyValue; + if (A(j, j) == 0.0) A(j, j) = DataGlobalConstants::rTinyValue(); dum = 1.0 / A(j, j); for (i = j + 1; i <= N; ++i) { @@ -8448,7 +8448,7 @@ namespace WindowManager { } } - if (A(N, N) == 0.0) A(N, N) = rTinyValue; + if (A(N, N) == 0.0) A(N, N) = DataGlobalConstants::rTinyValue(); } //***************************************************************************************** diff --git a/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc b/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc index 3954cb7846a..6ba31959797 100644 --- a/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc +++ b/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc @@ -90,7 +90,6 @@ namespace ZoneAirLoopEquipmentManager { using DataGlobals::BeginHourFlag; using DataGlobals::BeginTimeStepFlag; using DataGlobals::NumOfZones; - using DataGlobals::SecInHour; using DataHVACGlobals::FirstTimeStepSysFlag; using namespace DataDefineEquip; diff --git a/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc b/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc index 5a141d8c364..6950abaefd2 100644 --- a/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc +++ b/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc @@ -1836,7 +1836,7 @@ namespace ZoneContaminantPredictorCorrector { // to determine system added/subtracted moisture. CO2Gain = ZoneCO2Gain(ZoneNum) * RhoAir * 1.0e6; - SysTimeStepInSeconds = SecInHour * TimeStepSys; + SysTimeStepInSeconds = DataGlobalConstants::SecInHour() * TimeStepSys; // Calculate the coefficients for the 3rd Order derivative for final // zone CO2. The A, B, C coefficients are analogous to the CO2 balance. @@ -1943,7 +1943,7 @@ namespace ZoneContaminantPredictorCorrector { // to determine system added/subtracted moisture. GCGain = ZoneGCGain(ZoneNum) * RhoAir * 1.0e6; - SysTimeStepInSeconds = SecInHour * TimeStepSys; + SysTimeStepInSeconds = DataGlobalConstants::SecInHour() * TimeStepSys; // Calculate the coefficients for the 3rd Order derivative for final // zone GC. The A, B, C coefficients are analogous to the GC balance. @@ -2162,7 +2162,7 @@ namespace ZoneContaminantPredictorCorrector { Real64 UpperBound(0.0); // Upper bound of number of people Real64 SysTimeStepInSeconds(0.0); - SysTimeStepInSeconds = SecInHour * TimeStepSys; + SysTimeStepInSeconds = DataGlobalConstants::SecInHour() * TimeStepSys; Zone(ZoneNum).ZoneMeasuredCO2Concentration = GetCurrentScheduleValue(HybridModelZone(ZoneNum).ZoneMeasuredCO2ConcentrationSchedulePtr); @@ -2208,8 +2208,8 @@ namespace ZoneContaminantPredictorCorrector { } // Add threshold for air change rate - ACH_inf = max(0.0, min(10.0, M_inf / (CpAir * AirDensity / SecInHour * Zone(ZoneNum).Volume))); - M_inf = ACH_inf * Zone(ZoneNum).Volume * AirDensity / SecInHour; + ACH_inf = max(0.0, min(10.0, M_inf / (CpAir * AirDensity / DataGlobalConstants::SecInHour() * Zone(ZoneNum).Volume))); + M_inf = ACH_inf * Zone(ZoneNum).Volume * AirDensity / DataGlobalConstants::SecInHour(); Zone(ZoneNum).MCPIHM = M_inf; Zone(ZoneNum).InfilOAAirChangeRateHM = ACH_inf; } @@ -2512,7 +2512,7 @@ namespace ZoneContaminantPredictorCorrector { ZoneMassFlowRate += Node(state.dataZonePlenum->ZoneSupPlenCond(ZoneSupPlenumNum).InletNode).MassFlowRate / ZoneMult; } - SysTimeStepInSeconds = SecInHour * TimeStepSys; + SysTimeStepInSeconds = DataGlobalConstants::SecInHour() * TimeStepSys; // Calculate the coefficients for the 3rd order derivative for final // zone humidity ratio. The A, B, C coefficients are analogous to the diff --git a/src/EnergyPlus/ZoneDehumidifier.cc b/src/EnergyPlus/ZoneDehumidifier.cc index 717f494494b..d00eaa50713 100644 --- a/src/EnergyPlus/ZoneDehumidifier.cc +++ b/src/EnergyPlus/ZoneDehumidifier.cc @@ -115,7 +115,6 @@ namespace ZoneDehumidifier { using DataEnvironment::StdBaroPress; using DataGlobals::BeginEnvrnFlag; using DataGlobals::ScheduleAlwaysOn; - using DataGlobals::SecInHour; using General::TrimSigDigits; using namespace ScheduleManager; @@ -797,7 +796,7 @@ namespace ZoneDehumidifier { WaterRemovalVolRate = WaterRemovalRateFactor * state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumNum).RatedWaterRemoval; WaterRemovalMassRate = - WaterRemovalVolRate / (24.0 * SecInHour * 1000.0) * + WaterRemovalVolRate / (24.0 * DataGlobalConstants::SecInHour() * 1000.0) * RhoH2O(max((InletAirTemp - 11.0), 1.0)); //(L/d)/(24 hr/day *3600 sec/hr * 1000 L/m3) | Density of water, minimum temp = 1.0C if (WaterRemovalMassRate > 0.0) { @@ -1074,7 +1073,7 @@ namespace ZoneDehumidifier { Real64 OutletAirTemp; // Dry-bulb temperature of air leaving the dehumidifier (C) int AirInletNodeNum; // Node number corresponding to the air entering dehumidifier - ReportingConstant = TimeStepSys * SecInHour; + ReportingConstant = TimeStepSys * DataGlobalConstants::SecInHour(); state.dataZoneDehumidifier->ZoneDehumid(DehumidNum).SensHeatingEnergy = state.dataZoneDehumidifier->ZoneDehumid(DehumidNum).SensHeatingRate * ReportingConstant; state.dataZoneDehumidifier->ZoneDehumid(DehumidNum).WaterRemoved = state.dataZoneDehumidifier->ZoneDehumid(DehumidNum).WaterRemovalRate * ReportingConstant; diff --git a/src/EnergyPlus/ZoneEquipmentManager.cc b/src/EnergyPlus/ZoneEquipmentManager.cc index 7c073c4081d..b3f7c3d5e18 100644 --- a/src/EnergyPlus/ZoneEquipmentManager.cc +++ b/src/EnergyPlus/ZoneEquipmentManager.cc @@ -4606,7 +4606,6 @@ namespace ZoneEquipmentManager { using DataContaminantBalance::ZoneAirGC; using DataGlobals::HourOfDay; using DataGlobals::KickOffSimulation; - using DataGlobals::SecInHour; using DataHeatBalance::Ventilation; using DataHVACGlobals::CycleOn; using DataHVACGlobals::CycleOnZoneFansOnly; @@ -4919,12 +4918,12 @@ namespace ZoneEquipmentManager { if (!KickOffSimulation) { if (!(ZoneEquipAvail(NZ) == CycleOn || ZoneEquipAvail(NZ) == CycleOnZoneFansOnly) || !AirflowNetwork::AirflowNetworkZoneFlag(NZ)) - ZnAirRpt(NZ).VentilFanElec += Ventilation(j).FanPower * TimeStepSys * SecInHour; + ZnAirRpt(NZ).VentilFanElec += Ventilation(j).FanPower * TimeStepSys * DataGlobalConstants::SecInHour(); } else if (!AirflowNetwork::AirflowNetworkZoneFlag(NZ)) { - ZnAirRpt(NZ).VentilFanElec += Ventilation(j).FanPower * TimeStepSys * SecInHour; + ZnAirRpt(NZ).VentilFanElec += Ventilation(j).FanPower * TimeStepSys * DataGlobalConstants::SecInHour(); } } else { - ZnAirRpt(NZ).VentilFanElec += Ventilation(j).FanPower * TimeStepSys * SecInHour; + ZnAirRpt(NZ).VentilFanElec += Ventilation(j).FanPower * TimeStepSys * DataGlobalConstants::SecInHour(); } } // Intake fans will add some heat to the air, raising the temperature for an intake fan... diff --git a/src/EnergyPlus/ZoneTempPredictorCorrector.cc b/src/EnergyPlus/ZoneTempPredictorCorrector.cc index 04cb42674d2..d8d29e6ad32 100644 --- a/src/EnergyPlus/ZoneTempPredictorCorrector.cc +++ b/src/EnergyPlus/ZoneTempPredictorCorrector.cc @@ -3570,7 +3570,7 @@ namespace ZoneTempPredictorCorrector { AIRRAT(ZoneNum) = Zone(ZoneNum).Volume * Zone(ZoneNum).ZoneVolCapMultpSens * PsyRhoAirFnPbTdbW(OutBaroPress, MAT(ZoneNum), ZoneAirHumRat(ZoneNum)) * PsyCpAirFnW(ZoneAirHumRat(ZoneNum)) / - (TimeStepSys * SecInHour); + (TimeStepSys * DataGlobalConstants::SecInHour()); AirCap = AIRRAT(ZoneNum); RAFNFrac = 0.0; @@ -3614,7 +3614,7 @@ namespace ZoneTempPredictorCorrector { RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).SysDepZoneLoadsLagged; AirCap = RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).AirVolume * Zone(ZoneNum).ZoneVolCapMultpSens * RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).RhoAir * - RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).CpAir / (TimeStepSys * SecInHour); + RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).CpAir / (TimeStepSys * DataGlobalConstants::SecInHour()); AIRRAT(ZoneNum) = AirCap; TempHistoryTerm = AirCap * (3.0 * ZTM1(ZoneNum) - (3.0 / 2.0) * ZTM2(ZoneNum) + (1.0 / 3.0) * ZTM3(ZoneNum)); state.dataZoneTempPredictorCorrector->TempDepZnLd(ZoneNum) = (11.0 / 6.0) * AirCap + TempDepCoef; @@ -4509,7 +4509,7 @@ namespace ZoneTempPredictorCorrector { // to determine system added/subtracted moisture. LatentGain = ZoneLatentGain(ZoneNum) + SumLatentHTRadSys(ZoneNum) + SumLatentPool(ZoneNum); - SysTimeStepInSeconds = SecInHour * TimeStepSys; + SysTimeStepInSeconds = DataGlobalConstants::SecInHour() * TimeStepSys; // Calculate the coefficients for the 3rd Order derivative for final // zone humidity ratio. The A, B, C coefficients are analogous to the heat balance. @@ -4560,7 +4560,7 @@ namespace ZoneTempPredictorCorrector { B = (RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).SumIntLatentGain / H2OHtOfVap) + RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).SumLinkMW + RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).SumHmARaW; C = RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).RhoAir * RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).AirVolume * - Zone(ZoneNum).ZoneVolCapMultpMoist / (SecInHour * TimeStepSys); + Zone(ZoneNum).ZoneVolCapMultpMoist / (DataGlobalConstants::SecInHour() * TimeStepSys); } // Use a 3rd Order derivative to predict zone moisture addition or removal and @@ -4883,7 +4883,7 @@ namespace ZoneTempPredictorCorrector { AIRRAT(ZoneNum) = Zone(ZoneNum).Volume * Zone(ZoneNum).ZoneVolCapMultpSens * PsyRhoAirFnPbTdbW(OutBaroPress, MAT(ZoneNum), ZoneAirHumRat(ZoneNum), RoutineName) * - PsyCpAirFnW(ZoneAirHumRat(ZoneNum)) / (TimeStepSys * SecInHour); + PsyCpAirFnW(ZoneAirHumRat(ZoneNum)) / (TimeStepSys * DataGlobalConstants::SecInHour()); AirCap = AIRRAT(ZoneNum); @@ -5048,8 +5048,8 @@ namespace ZoneTempPredictorCorrector { // Determine sensible load heating/cooling rate and energy SNLoadHeatRate(ZoneNum) = max(SNLoad, 0.0); SNLoadCoolRate(ZoneNum) = std::abs(min(SNLoad, 0.0)); - SNLoadHeatEnergy(ZoneNum) = max(SNLoad, 0.0) * TimeStepSys * SecInHour; - SNLoadCoolEnergy(ZoneNum) = std::abs(min(SNLoad, 0.0) * TimeStepSys * SecInHour); + SNLoadHeatEnergy(ZoneNum) = max(SNLoad, 0.0) * TimeStepSys * DataGlobalConstants::SecInHour(); + SNLoadCoolEnergy(ZoneNum) = std::abs(min(SNLoad, 0.0) * TimeStepSys * DataGlobalConstants::SecInHour()); // Final humidity calcs CorrectZoneHumRat(state, ZoneNum); @@ -5495,7 +5495,7 @@ namespace ZoneTempPredictorCorrector { LatentGainExceptPeople = ZoneLatentGainExceptPeople(ZoneNum) + SumLatentHTRadSys(ZoneNum) + SumLatentPool(ZoneNum); } - SysTimeStepInSeconds = SecInHour * TimeStepSys; + SysTimeStepInSeconds = DataGlobalConstants::SecInHour() * TimeStepSys; // Calculate the coefficients for the 3rd order derivative for final // zone humidity ratio. The A, B, C coefficients are analogous to the @@ -5780,8 +5780,8 @@ namespace ZoneTempPredictorCorrector { } else { M_inf = (BB + CC * DD - ((11.0 / 6.0) * CC + AA) * Zone(ZoneNum).ZoneMeasuredTemperature) / (CpAir * delta_T); } - ACH_inf = max(0.0, min(10.0, (M_inf / AirDensity) / Zone(ZoneNum).Volume * SecInHour)); - M_inf = (ACH_inf / SecInHour) * Zone(ZoneNum).Volume * AirDensity; + ACH_inf = max(0.0, min(10.0, (M_inf / AirDensity) / Zone(ZoneNum).Volume * DataGlobalConstants::SecInHour())); + M_inf = (ACH_inf / DataGlobalConstants::SecInHour()) * Zone(ZoneNum).Volume * AirDensity; // Overwrite variable with inverse solution Zone(ZoneNum).MCPIHM = M_inf; @@ -5826,7 +5826,7 @@ namespace ZoneTempPredictorCorrector { MultpHM = AirCapHM / (Zone(ZoneNum).Volume * PsyRhoAirFnPbTdbW(OutBaroPress, ZT(ZoneNum), ZoneAirHumRat(ZoneNum)) * PsyCpAirFnW(ZoneAirHumRat(ZoneNum))) * - (TimeStepZone * SecInHour); // Inverse equation + (TimeStepZone * DataGlobalConstants::SecInHour()); // Inverse equation if ((MultpHM < 1.0) || (MultpHM > 30.0)) { // Temperature capacity multiplier greater than // 1 and less than 30 MultpHM = 1.0; // Default value 1.0 @@ -5969,7 +5969,7 @@ namespace ZoneTempPredictorCorrector { Real64 M_inf(0.0); Real64 ACH_inf(0.0); Real64 SysTimeStepInSeconds(0.0); - SysTimeStepInSeconds = SecInHour * TimeStepSys; + SysTimeStepInSeconds = DataGlobalConstants::SecInHour() * TimeStepSys; // Get measured zone humidity ratio Zone(ZoneNum).ZoneMeasuredHumidityRatio = GetCurrentScheduleValue(HybridModelZone(ZoneNum).ZoneMeasuredHumidityRatioSchedulePtr); @@ -6016,8 +6016,8 @@ namespace ZoneTempPredictorCorrector { } // Add threshold for air change rate - ACH_inf = max(0.0, min(10.0, (M_inf / AirDensity) / Zone(ZoneNum).Volume * SecInHour)); - M_inf = (ACH_inf / SecInHour) * Zone(ZoneNum).Volume * AirDensity; + ACH_inf = max(0.0, min(10.0, (M_inf / AirDensity) / Zone(ZoneNum).Volume * DataGlobalConstants::SecInHour())); + M_inf = (ACH_inf / DataGlobalConstants::SecInHour()) * Zone(ZoneNum).Volume * AirDensity; Zone(ZoneNum).MCPIHM = M_inf; Zone(ZoneNum).InfilOAAirChangeRateHM = ACH_inf; } @@ -6522,8 +6522,8 @@ namespace ZoneTempPredictorCorrector { CalcZoneSensibleOutput(MassFlowRate, NodeTemp, MAT(ZoneNum), ZoneAirHumRat(ZoneNum), ADUHeatAddRate); AirDistUnit(ADUNum).HeatRate = max(0.0, ADUHeatAddRate); AirDistUnit(ADUNum).CoolRate = std::abs(min(0.0, ADUHeatAddRate)); - AirDistUnit(ADUNum).HeatGain = AirDistUnit(ADUNum).HeatRate * TimeStepSys * SecInHour; - AirDistUnit(ADUNum).CoolGain = AirDistUnit(ADUNum).CoolRate * TimeStepSys * SecInHour; + AirDistUnit(ADUNum).HeatGain = AirDistUnit(ADUNum).HeatRate * TimeStepSys * DataGlobalConstants::SecInHour(); + AirDistUnit(ADUNum).CoolGain = AirDistUnit(ADUNum).CoolRate * TimeStepSys * DataGlobalConstants::SecInHour(); } } // NodeNum @@ -6676,7 +6676,7 @@ namespace ZoneTempPredictorCorrector { auto const SELECT_CASE_var(ZoneAirSolutionAlgo); if (SELECT_CASE_var == Use3rdOrder) { CzdTdt = RhoAir * CpAir * Zone(ZoneNum).Volume * Zone(ZoneNum).ZoneVolCapMultpSens * (MAT(ZoneNum) - ZTM1(ZoneNum)) / - (TimeStepSys * SecInHour); + (TimeStepSys * DataGlobalConstants::SecInHour()); // Exact solution } else if (SELECT_CASE_var == UseAnalyticalSolution) { CzdTdt = TempIndCoef - TempDepCoef * MAT(ZoneNum); diff --git a/tst/EnergyPlus/unit/EconomicTariff.unit.cc b/tst/EnergyPlus/unit/EconomicTariff.unit.cc index bb4692c515f..1053bb3a9a2 100644 --- a/tst/EnergyPlus/unit/EconomicTariff.unit.cc +++ b/tst/EnergyPlus/unit/EconomicTariff.unit.cc @@ -586,7 +586,7 @@ TEST_F(EnergyPlusFixture, EconomicTariff_GatherForEconomics) DataGlobals::NumOfTimeStepInHour = 4; // must initialize this to get schedules initialized DataGlobals::MinutesPerTimeStep = 15; // must initialize this to get schedules initialized DataGlobals::TimeStepZone = 0.25; - DataGlobals::TimeStepZoneSec = DataGlobals::TimeStepZone * DataGlobals::SecInHour; + DataGlobals::TimeStepZoneSec = DataGlobals::TimeStepZone * DataGlobalConstants::SecInHour(); ScheduleManager::ProcessScheduleInput(state); // read schedules ExteriorEnergyUse::ManageExteriorEnergyUse(state); diff --git a/tst/EnergyPlus/unit/ExteriorEnergyUse.unit.cc b/tst/EnergyPlus/unit/ExteriorEnergyUse.unit.cc index 7bf2bb7ee67..22adf281a71 100644 --- a/tst/EnergyPlus/unit/ExteriorEnergyUse.unit.cc +++ b/tst/EnergyPlus/unit/ExteriorEnergyUse.unit.cc @@ -71,7 +71,7 @@ TEST_F(EnergyPlusFixture, ExteriorEquipmentTest_Test1) state.dataExteriorEnergyUse->NumExteriorLights = 0; state.dataExteriorEnergyUse->NumExteriorEqs = 2; TimeStepZone = 0.25; - TimeStepZoneSec = TimeStepZone * SecInHour; + TimeStepZoneSec = TimeStepZone * DataGlobalConstants::SecInHour(); state.dataExteriorEnergyUse->ExteriorEquipment.allocate(state.dataExteriorEnergyUse->NumExteriorEqs); state.dataExteriorEnergyUse->ExteriorEquipment(1).DesignLevel = 1000.0; state.dataExteriorEnergyUse->ExteriorEquipment(2).DesignLevel = 0.0; diff --git a/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc b/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc index 7c33880e884..be0a4a78cd8 100644 --- a/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc +++ b/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc @@ -2420,9 +2420,9 @@ TEST_F(LowTempRadiantSystemTest, calculateRunningMeanAverageTemperatureTest) auto &thisCFloSys (CFloRadSys(1)); NumOfTimeStepInHour = 1; - state.dataWeatherManager->TodayOutDryBulbTemp.allocate(NumOfTimeStepInHour, DataGlobals::HoursInDay); + state.dataWeatherManager->TodayOutDryBulbTemp.allocate(NumOfTimeStepInHour, DataGlobalConstants::HoursInDay()); state.dataWeatherManager->TodayOutDryBulbTemp = 0.0; - for (int hourNumber = 1; hourNumber <= DataGlobals::HoursInDay; ++hourNumber) { + for (int hourNumber = 1; hourNumber <= DataGlobalConstants::HoursInDay(); ++hourNumber) { state.dataWeatherManager->TodayOutDryBulbTemp(NumOfTimeStepInHour,hourNumber) = double(hourNumber); } @@ -2518,7 +2518,7 @@ TEST_F(LowTempRadiantSystemTest, updateOperatingModeHistoryTest) thisRadSys.updateOperatingModeHistory(); expectedResult = 1; EXPECT_EQ(thisRadSys.lastDayOfSim, expectedResult); - expectedResult = DataGlobals::HoursInDay; + expectedResult = DataGlobalConstants::HoursInDay(); EXPECT_EQ(thisRadSys.lastHourOfDay, expectedResult); expectedResult = DataGlobals::NumOfTimeStepInHour; EXPECT_EQ(thisRadSys.lastTimeStep, expectedResult); diff --git a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc index acd63ff1630..f0aec31510f 100644 --- a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc +++ b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc @@ -3740,7 +3740,7 @@ TEST_F(EnergyPlusFixture, OutputReportTabular_GatherHeatEmissionReport) state.dataCondenserLoopTowers->towers(1).Qactual = 1.0; state.dataCondenserLoopTowers->towers(1).FanEnergy = 50.0; - Real64 TimeStepSysSec = DataHVACGlobals::TimeStepSys * SecInHour; + Real64 TimeStepSysSec = DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); Real64 reliefEnergy = 2.0 * TimeStepSysSec; Real64 condenserReject = 1.0 * TimeStepSysSec + 50.0; @@ -8334,8 +8334,8 @@ TEST_F(EnergyPlusFixture, OutputReportTabular_GatherHeatGainReport) GatherHeatGainReport(state, OutputProcessor::TimeStepType::TimeStepSystem); - EXPECT_EQ(1.0*(EnergyPlus::DataHVACGlobals::TimeStepSys)*SecInHour, DataHeatBalance::ZonePreDefRep(1).SHGSAnZoneEqHt); - EXPECT_EQ(0.0*(EnergyPlus::DataHVACGlobals::TimeStepSys)*SecInHour, DataHeatBalance::ZonePreDefRep(1).SHGSAnZoneEqCl); + EXPECT_EQ(1.0*(EnergyPlus::DataHVACGlobals::TimeStepSys)*DataGlobalConstants::SecInHour(), DataHeatBalance::ZonePreDefRep(1).SHGSAnZoneEqHt); + EXPECT_EQ(0.0*(EnergyPlus::DataHVACGlobals::TimeStepSys)*DataGlobalConstants::SecInHour(), DataHeatBalance::ZonePreDefRep(1).SHGSAnZoneEqCl); EXPECT_EQ(1000.0, DataHeatBalance::ZonePreDefRep(1).SHGSAnHvacATUHt); EXPECT_EQ(-2000.0, DataHeatBalance::ZonePreDefRep(1).SHGSAnHvacATUCl); } diff --git a/tst/EnergyPlus/unit/ScheduleManager.unit.cc b/tst/EnergyPlus/unit/ScheduleManager.unit.cc index 3cbbc580e58..5912607292a 100644 --- a/tst/EnergyPlus/unit/ScheduleManager.unit.cc +++ b/tst/EnergyPlus/unit/ScheduleManager.unit.cc @@ -779,7 +779,7 @@ TEST_F(EnergyPlusFixture, Schedule_GetCurrentScheduleValue_DST) DataGlobals::NumOfTimeStepInHour = 4; // must initialize this to get schedules initialized DataGlobals::MinutesPerTimeStep = 15; // must initialize this to get schedules initialized DataGlobals::TimeStepZone = 0.25; - DataGlobals::TimeStepZoneSec = DataGlobals::TimeStepZone * DataGlobals::SecInHour; + DataGlobals::TimeStepZoneSec = DataGlobals::TimeStepZone * DataGlobalConstants::SecInHour(); ScheduleManager::ProcessScheduleInput(state); // read schedules @@ -828,7 +828,7 @@ TEST_F(EnergyPlusFixture, Schedule_GetCurrentScheduleValue_DST_SouthernHemispher DataGlobals::NumOfTimeStepInHour = 4; // must initialize this to get schedules initialized DataGlobals::MinutesPerTimeStep = 15; // must initialize this to get schedules initialized DataGlobals::TimeStepZone = 0.25; - DataGlobals::TimeStepZoneSec = DataGlobals::TimeStepZone * DataGlobals::SecInHour; + DataGlobals::TimeStepZoneSec = DataGlobals::TimeStepZone * DataGlobalConstants::SecInHour(); ScheduleManager::ProcessScheduleInput(state); // read schedules @@ -925,7 +925,7 @@ TEST_F(EnergyPlusFixture, Schedule_GetCurrentScheduleValue_DST_RampUp_Leap) { DataGlobals::NumOfTimeStepInHour = NumOfTimeStepInHour; // must initialize this to get schedules initialized DataGlobals::MinutesPerTimeStep = 15; // must initialize this to get schedules initialized DataGlobals::TimeStepZone = 0.25; - DataGlobals::TimeStepZoneSec = DataGlobals::TimeStepZone * DataGlobals::SecInHour; + DataGlobals::TimeStepZoneSec = DataGlobals::TimeStepZone * DataGlobalConstants::SecInHour(); DataEnvironment::Month = 12; DataEnvironment::DayOfMonth = 31; @@ -1134,7 +1134,7 @@ TEST_F(EnergyPlusFixture, Schedule_GetCurrentScheduleValue_DST_RampUp_NoLeap) { DataGlobals::NumOfTimeStepInHour = NumOfTimeStepInHour; // must initialize this to get schedules initialized DataGlobals::MinutesPerTimeStep = 15; // must initialize this to get schedules initialized DataGlobals::TimeStepZone = 0.25; - DataGlobals::TimeStepZoneSec = DataGlobals::TimeStepZone * DataGlobals::SecInHour; + DataGlobals::TimeStepZoneSec = DataGlobals::TimeStepZone * DataGlobalConstants::SecInHour(); DataEnvironment::Month = 12; DataEnvironment::DayOfMonth = 31; diff --git a/tst/EnergyPlus/unit/WaterManager.unit.cc b/tst/EnergyPlus/unit/WaterManager.unit.cc index db73f8e2767..40e88f4a333 100644 --- a/tst/EnergyPlus/unit/WaterManager.unit.cc +++ b/tst/EnergyPlus/unit/WaterManager.unit.cc @@ -83,7 +83,7 @@ TEST_F(EnergyPlusFixture, WaterManager_NormalAnnualPrecipitation) WaterManager::UpdatePrecipitation(); Real64 ExpectedNomAnnualRain = 0.80771; - Real64 ExpectedCurrentRate = 1.0 * (0.75 / 0.80771) / DataGlobals::SecInHour; + Real64 ExpectedCurrentRate = 1.0 * (0.75 / 0.80771) / DataGlobalConstants::SecInHour(); Real64 NomAnnualRain = DataWater::RainFall.NomAnnualRain; EXPECT_NEAR(NomAnnualRain, ExpectedNomAnnualRain, 0.000001); diff --git a/tst/EnergyPlus/unit/WaterThermalTanks.unit.cc b/tst/EnergyPlus/unit/WaterThermalTanks.unit.cc index 4d8699772ed..00bb003f9f4 100644 --- a/tst/EnergyPlus/unit/WaterThermalTanks.unit.cc +++ b/tst/EnergyPlus/unit/WaterThermalTanks.unit.cc @@ -2024,7 +2024,7 @@ TEST_F(EnergyPlusFixture, StratifiedTankCalc) for (int i = 0; i < Tank.Nodes - 1; ++i) { EXPECT_GE(NodeTemps[i], NodeTemps[i + 1]); } - const Real64 SecInTimeStep = TimeStepSys * DataGlobals::SecInHour; + const Real64 SecInTimeStep = TimeStepSys * DataGlobalConstants::SecInHour(); int DummyIndex = 1; Real64 TankNodeEnergy = 0; for (int i = 0; i < Tank.Nodes; ++i) { @@ -2064,7 +2064,6 @@ TEST_F(EnergyPlusFixture, StratifiedTankCalc) TEST_F(EnergyPlusFixture, StratifiedTankSourceFlowRateCalc) { using DataGlobals::HourOfDay; - using DataGlobals::SecInHour; using DataGlobals::TimeStep; using DataGlobals::TimeStepZone; using DataHVACGlobals::SysTimeElapsed; @@ -2186,7 +2185,7 @@ TEST_F(EnergyPlusFixture, StratifiedTankSourceFlowRateCalc) EnergySum += node.Mass * Cp * (node.Temp - 60.0); } Real64 Esource = Tank.SourceEffectiveness * Tank.SourceMassFlowRate * Cp * - (Tank.SourceInletTemp - Tank.Node(Tank.SourceOutletStratNode).TempAvg) * TimeStepSys * SecInHour; + (Tank.SourceInletTemp - Tank.Node(Tank.SourceOutletStratNode).TempAvg) * TimeStepSys * DataGlobalConstants::SecInHour(); EXPECT_NEAR(Esource, EnergySum, EnergySum * 0.001); } @@ -3121,7 +3120,6 @@ TEST_F(EnergyPlusFixture, Desuperheater_Multispeed_Coil_Test) TEST_F(EnergyPlusFixture, MixedTankAlternateSchedule) { using DataGlobals::HourOfDay; - using DataGlobals::SecInHour; using DataGlobals::TimeStep; using DataGlobals::TimeStepZone; using DataHVACGlobals::SysTimeElapsed; From 0ceaa6fa2a60ba020c7b5785482a04ad1f5bdb50 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Fri, 9 Oct 2020 13:25:22 -0600 Subject: [PATCH 06/15] moving constants to DataGlobalConstants --- src/EnergyPlus/AirLoopHVACDOAS.cc | 6 +- .../include/AirflowNetwork/Properties.hpp | 2 +- src/EnergyPlus/AirflowNetwork/src/Solver.cpp | 9 +- .../AirflowNetworkBalanceManager.cc | 20 ++-- .../CoolingWaterDesAirOutletTempSizing.cc | 4 +- .../Autosizing/CoolingWaterflowSizing.cc | 12 +-- .../HeatingWaterDesCoilLoadUsedForUASizing.cc | 12 +-- .../Autosizing/HeatingWaterflowSizing.cc | 12 +-- .../Autosizing/WaterHeatingCapacitySizing.cc | 8 +- src/EnergyPlus/BaseboardRadiator.cc | 10 +- src/EnergyPlus/Boilers.cc | 6 +- src/EnergyPlus/CTElectricGenerator.cc | 2 +- src/EnergyPlus/ChilledCeilingPanelSimple.cc | 4 +- src/EnergyPlus/ChillerAbsorption.cc | 16 +-- src/EnergyPlus/ChillerElectricEIR.cc | 12 +-- src/EnergyPlus/ChillerExhaustAbsorption.cc | 16 +-- src/EnergyPlus/ChillerGasAbsorption.cc | 16 +-- src/EnergyPlus/ChillerIndirectAbsorption.cc | 16 +-- src/EnergyPlus/ChillerReformulatedEIR.cc | 10 +- src/EnergyPlus/CondenserLoopTowers.cc | 16 +-- src/EnergyPlus/ConvectionCoefficients.cc | 30 +++--- src/EnergyPlus/DXCoils.cc | 10 +- src/EnergyPlus/DataContaminantBalance.cc | 1 - src/EnergyPlus/DataEnvironment.cc | 6 +- src/EnergyPlus/DataGlobalConstants.hh | 9 ++ src/EnergyPlus/DataGlobals.cc | 12 --- src/EnergyPlus/DataGlobals.hh | 16 --- src/EnergyPlus/DataHeatBalance.cc | 1 - src/EnergyPlus/DataHeatBalance.hh | 5 +- src/EnergyPlus/DataSurfaces.cc | 2 +- src/EnergyPlus/DesiccantDehumidifiers.cc | 4 +- src/EnergyPlus/EcoRoofManager.cc | 42 ++++---- src/EnergyPlus/EvaporativeFluidCoolers.cc | 20 ++-- src/EnergyPlus/FanCoilUnits.cc | 8 +- src/EnergyPlus/Fans.cc | 4 +- src/EnergyPlus/FluidCoolers.cc | 14 +-- src/EnergyPlus/FuelCellElectricGenerator.cc | 34 +++--- src/EnergyPlus/Furnaces.cc | 8 +- src/EnergyPlus/GeneralRoutines.cc | 11 +- src/EnergyPlus/HVACControllers.cc | 2 +- src/EnergyPlus/HVACCooledBeam.cc | 15 ++- src/EnergyPlus/HVACFourPipeBeam.cc | 8 +- src/EnergyPlus/HVACMultiSpeedHeatPump.cc | 12 +-- src/EnergyPlus/HVACSingleDuctInduc.cc | 8 +- src/EnergyPlus/HVACSizingSimulationManager.cc | 4 +- src/EnergyPlus/HVACUnitaryBypassVAV.cc | 4 +- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 9 +- src/EnergyPlus/HWBaseboardRadiator.cc | 8 +- src/EnergyPlus/HeatBalFiniteDiffManager.cc | 1 - src/EnergyPlus/HeatBalanceAirManager.cc | 4 +- src/EnergyPlus/HeatBalanceHAMTManager.cc | 4 +- src/EnergyPlus/HeatBalanceIntRadExchange.cc | 10 +- src/EnergyPlus/HeatBalanceKivaManager.cc | 46 ++++---- src/EnergyPlus/HeatBalanceSurfaceManager.cc | 22 ++-- src/EnergyPlus/HeatPumpWaterToWaterCOOLING.cc | 4 +- src/EnergyPlus/HeatPumpWaterToWaterHEATING.cc | 5 +- src/EnergyPlus/HeatPumpWaterToWaterSimple.cc | 37 ++++--- src/EnergyPlus/Humidifiers.cc | 8 +- src/EnergyPlus/ICEngineElectricGenerator.cc | 2 +- src/EnergyPlus/InternalHeatGains.cc | 6 +- src/EnergyPlus/LowTempRadiantSystem.cc | 24 ++--- .../MicroturbineElectricGenerator.cc | 2 +- src/EnergyPlus/MoistureBalanceEMPDManager.cc | 14 +-- src/EnergyPlus/NodeInputManager.cc | 4 +- src/EnergyPlus/OutdoorAirUnit.cc | 8 +- src/EnergyPlus/OutputProcessor.cc | 27 +---- src/EnergyPlus/OutputReportTabular.cc | 86 +++++++-------- src/EnergyPlus/OutsideEnergySources.cc | 4 +- src/EnergyPlus/PackagedTerminalHeatPump.cc | 8 +- src/EnergyPlus/PackagedThermalStorageCoil.cc | 24 ++--- .../PhotovoltaicThermalCollectors.cc | 2 +- src/EnergyPlus/Photovoltaics.cc | 32 +++--- src/EnergyPlus/PipeHeatTransfer.cc | 6 +- src/EnergyPlus/Plant/PlantManager.cc | 8 +- src/EnergyPlus/PlantCentralGSHP.cc | 12 +-- src/EnergyPlus/PlantChillers.cc | 38 +++---- .../PlantComponentTemperatureSources.cc | 2 +- .../PlantHeatExchangerFluidToFluid.cc | 12 +-- src/EnergyPlus/PlantLoadProfile.cc | 2 +- src/EnergyPlus/PlantLoopHeatPumpEIR.cc | 12 +-- src/EnergyPlus/PlantPipingSystemsManager.cc | 2 +- src/EnergyPlus/PondGroundHeatExchanger.cc | 4 +- src/EnergyPlus/PoweredInductionUnits.cc | 6 +- src/EnergyPlus/Psychrometrics.cc | 4 +- src/EnergyPlus/Psychrometrics.hh | 20 ++-- src/EnergyPlus/Pumps.cc | 14 +-- src/EnergyPlus/RefrigeratedCase.cc | 12 +-- src/EnergyPlus/ReportCoilSelection.cc | 8 +- src/EnergyPlus/ResultsFramework.cc | 1 - src/EnergyPlus/SingleDuct.cc | 15 ++- src/EnergyPlus/SolarCollectors.cc | 34 +++--- src/EnergyPlus/SurfaceGeometry.cc | 22 ++-- src/EnergyPlus/SurfaceGroundHeatExchanger.cc | 9 +- src/EnergyPlus/TARCOGArgs.cc | 9 +- src/EnergyPlus/TARCOGCommon.cc | 5 +- src/EnergyPlus/TARCOGGasses90.cc | 10 +- src/EnergyPlus/TARCOGOutput.cc | 42 ++++---- src/EnergyPlus/TarcogShading.cc | 6 +- src/EnergyPlus/ThermalChimney.cc | 8 +- src/EnergyPlus/ThermalComfort.cc | 13 +-- src/EnergyPlus/ThermalEN673Calc.cc | 4 +- src/EnergyPlus/ThermalISO15099Calc.cc | 40 +++---- src/EnergyPlus/TranspiredCollector.cc | 8 +- src/EnergyPlus/UFADManager.cc | 56 +++++----- src/EnergyPlus/UnitHeater.cc | 6 +- src/EnergyPlus/UnitVentilator.cc | 6 +- src/EnergyPlus/UnitarySystem.cc | 18 ++-- src/EnergyPlus/VariableSpeedCoils.cc | 12 +-- src/EnergyPlus/VentilatedSlab.cc | 12 +-- src/EnergyPlus/WaterCoils.cc | 6 +- src/EnergyPlus/WaterThermalTanks.cc | 76 ++++++------- src/EnergyPlus/WaterToAirHeatPump.cc | 4 +- src/EnergyPlus/WaterToAirHeatPumpSimple.cc | 4 +- src/EnergyPlus/WaterToAirHeatPumpSimple.hh | 2 +- src/EnergyPlus/WaterUse.cc | 50 ++++----- src/EnergyPlus/WeatherManager.cc | 18 ++-- src/EnergyPlus/WindowComplexManager.cc | 40 ++++--- src/EnergyPlus/WindowEquivalentLayer.cc | 100 +++++++++--------- src/EnergyPlus/WindowManager.cc | 10 +- src/EnergyPlus/WindowManager.hh | 2 +- .../WindowManagerExteriorThermal.cc | 16 +-- src/EnergyPlus/ZoneEquipmentManager.cc | 4 +- .../unit/ChillerElectricEIR.unit.cc | 2 +- .../unit/HVACVariableRefrigerantFlow.unit.cc | 2 +- .../unit/HeatBalanceKivaManager.unit.cc | 8 +- .../unit/HeatBalanceSurfaceManager.unit.cc | 14 ++- .../unit/MoistureBalanceEMPD.unit.cc | 3 +- tst/EnergyPlus/unit/OutdoorAirUnit.unit.cc | 12 +-- .../unit/OutputReportTabular.unit.cc | 8 +- tst/EnergyPlus/unit/PlantCentralGSHP.unit.cc | 6 +- tst/EnergyPlus/unit/ThermalComfort.unit.cc | 2 +- tst/EnergyPlus/unit/UnitHeater.unit.cc | 4 +- tst/EnergyPlus/unit/WaterCoils.unit.cc | 24 ++--- tst/EnergyPlus/unit/WindowManager.unit.cc | 6 +- 134 files changed, 860 insertions(+), 961 deletions(-) diff --git a/src/EnergyPlus/AirLoopHVACDOAS.cc b/src/EnergyPlus/AirLoopHVACDOAS.cc index 96b54a0cdf9..32cc4b9d1b0 100644 --- a/src/EnergyPlus/AirLoopHVACDOAS.cc +++ b/src/EnergyPlus/AirLoopHVACDOAS.cc @@ -814,7 +814,7 @@ namespace AirLoopHVACDOAS { Real64 CoilMaxVolFlowRate = WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", CompName, ErrorsFound); rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->HWLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(this->HWLoopNum).FluidIndex, RoutineName); PlantUtilities::InitComponentNodes(0.0, @@ -831,7 +831,7 @@ namespace AirLoopHVACDOAS { Real64 CoilMaxVolFlowRate = WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Cooling:Water", CompName, ErrorsFound); rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); PlantUtilities::InitComponentNodes(0.0, @@ -848,7 +848,7 @@ namespace AirLoopHVACDOAS { Real64 CoilMaxVolFlowRate = WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Cooling:Water:DetailedGeometry", CompName, ErrorsFound); rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); PlantUtilities::InitComponentNodes(0.0, diff --git a/src/EnergyPlus/AirflowNetwork/include/AirflowNetwork/Properties.hpp b/src/EnergyPlus/AirflowNetwork/include/AirflowNetwork/Properties.hpp index 1385fac3e3f..cc313cb1625 100644 --- a/src/EnergyPlus/AirflowNetwork/include/AirflowNetwork/Properties.hpp +++ b/src/EnergyPlus/AirflowNetwork/include/AirflowNetwork/Properties.hpp @@ -64,7 +64,7 @@ #ifndef TOKELVIN #include "../../../DataGlobals.hh" -#define TOKELVIN(T) (T + DataGlobals::KelvinConv) +#define TOKELVIN(T) (T + DataGlobalConstants::KelvinConv()) #else // Need a fallback #endif diff --git a/src/EnergyPlus/AirflowNetwork/src/Solver.cpp b/src/EnergyPlus/AirflowNetwork/src/Solver.cpp index d8843a0bd1b..1555accff00 100644 --- a/src/EnergyPlus/AirflowNetwork/src/Solver.cpp +++ b/src/EnergyPlus/AirflowNetwork/src/Solver.cpp @@ -100,7 +100,6 @@ namespace AirflowNetwork { using DataEnvironment::OutDryBulbTemp; using DataEnvironment::OutHumRat; using DataEnvironment::StdBaroPress; - using DataGlobals::KelvinConv; using DataSurfaces::Surface; //std::vector properties; @@ -1110,11 +1109,11 @@ namespace AirflowNetwork { if (LFLAG) { // Initialization by linear relation. if (PDROP >= 0.0) { - RhoCor = (propN.temperature + KelvinConv) / (Tave + KelvinConv); + RhoCor = (propN.temperature + DataGlobalConstants::KelvinConv()) / (Tave + DataGlobalConstants::KelvinConv()); Ctl = std::pow(RhozNorm / propN.density / RhoCor, expn - 1.0) * std::pow(VisczNorm / VisAve, 2.0 * expn - 1.0); DF[0] = coef * propN.density / propN.viscosity * Ctl; } else { - RhoCor = (propM.temperature + KelvinConv) / (Tave + KelvinConv); + RhoCor = (propM.temperature + DataGlobalConstants::KelvinConv()) / (Tave + DataGlobalConstants::KelvinConv()); Ctl = std::pow(RhozNorm / propM.density / RhoCor, expn - 1.0) * std::pow(VisczNorm / VisAve, 2.0 * expn - 1.0); DF[0] = coef * propM.density / propM.viscosity * Ctl; } @@ -1124,7 +1123,7 @@ namespace AirflowNetwork { if (PDROP >= 0.0) { // Flow in positive direction. // Laminar flow. - RhoCor = (propN.temperature + KelvinConv) / (Tave + KelvinConv); + RhoCor = (propN.temperature + DataGlobalConstants::KelvinConv()) / (Tave + DataGlobalConstants::KelvinConv()); Ctl = std::pow(RhozNorm / propN.density / RhoCor, expn - 1.0) * std::pow(VisczNorm / VisAve, 2.0 * expn - 1.0); CDM = coef * propN.density / propN.viscosity * Ctl; FL = CDM * PDROP; @@ -1137,7 +1136,7 @@ namespace AirflowNetwork { } else { // Flow in negative direction. // Laminar flow. - RhoCor = (propM.temperature + KelvinConv) / (Tave + KelvinConv); + RhoCor = (propM.temperature + DataGlobalConstants::KelvinConv()) / (Tave + DataGlobalConstants::KelvinConv()); Ctl = std::pow(RhozNorm / propM.density / RhoCor, 2.0 * expn - 1.0) * std::pow(VisczNorm / VisAve, 2.0 * expn - 1.0); CDM = coef * propM.density / propM.viscosity * Ctl; FL = CDM * PDROP; diff --git a/src/EnergyPlus/AirflowNetworkBalanceManager.cc b/src/EnergyPlus/AirflowNetworkBalanceManager.cc index db54adc6b34..b83541bcaa7 100644 --- a/src/EnergyPlus/AirflowNetworkBalanceManager.cc +++ b/src/EnergyPlus/AirflowNetworkBalanceManager.cc @@ -6598,8 +6598,6 @@ namespace AirflowNetworkBalanceManager { // ASTM C1340 using DataEnvironment::WindSpeed; - using DataGlobals::KelvinConv; - Real64 k = airThermConductivity(Ts); Real64 hOut_final = 0; @@ -6609,7 +6607,7 @@ namespace AirflowNetworkBalanceManager { // Free convection Real64 Pr = airPrandtl((Ts + Tamb) / 2, Wamb, Pamb); Real64 KinVisc = airKinematicVisc((Ts + Tamb) / 2, Wamb, Pamb); - Real64 Beta = 2.0 / ((Tamb + KelvinConv) + (Ts + KelvinConv)); + Real64 Beta = 2.0 / ((Tamb + DataGlobalConstants::KelvinConv()) + (Ts + DataGlobalConstants::KelvinConv())); Real64 Gr = DataGlobalConstants::GravityConstant() * Beta * std::abs(Ts - Tamb) * pow_3(Dh) / pow_2(KinVisc); Real64 Ra = Gr * Pr; Real64 Nu_free(0); @@ -6681,8 +6679,6 @@ namespace AirflowNetworkBalanceManager { // USE STATEMENTS: using DataEnvironment::OutBaroPress; using DataEnvironment::OutHumRat; - using DataGlobals::KelvinConv; - using DataGlobals::StefanBoltzmann; using DataHeatBalFanSys::QRadSurfAFNDuct; using DataHeatBalSurface::TH; using DataHVACGlobals::TimeStepSys; @@ -6771,10 +6767,10 @@ namespace AirflowNetworkBalanceManager { Real64 UThermal(10); // Initialize. This will get updated. Real64 UThermal_iter = 0; Real64 Tsurr = Tamb; - Real64 Tsurr_K = Tsurr + KelvinConv; + Real64 Tsurr_K = Tsurr + DataGlobalConstants::KelvinConv(); Real64 Tin = AirflowNetworkNodeSimu(LF).TZ; Real64 TDuctSurf = (Tamb + Tin) / 2.0; - Real64 TDuctSurf_K = TDuctSurf + KelvinConv; + Real64 TDuctSurf_K = TDuctSurf + DataGlobalConstants::KelvinConv(); Real64 DuctSurfArea = DisSysCompDuctData(TypeNum).L * DisSysCompDuctData(TypeNum).hydraulicDiameter * DataGlobalConstants::Pi(); // If user defined view factors not present, calculate air-to-air heat transfer @@ -6866,7 +6862,7 @@ namespace AirflowNetworkBalanceManager { int ZoneSurfNum = VFObj.LinkageSurfaceData(j).SurfaceNum; Real64 TSurfj = TH(1, 1, ZoneSurfNum); - Real64 TSurfj_K = TSurfj + KelvinConv; + Real64 TSurfj_K = TSurfj + DataGlobalConstants::KelvinConv(); Real64 ZoneSurfEmissivity = state.dataConstruction->Construct(Surface(ZoneSurfNum).Construction).InsideAbsorpThermal; Real64 ZoneSurfArea = Surface(ZoneSurfNum).Area; @@ -6880,7 +6876,7 @@ namespace AirflowNetworkBalanceManager { Real64 ZoneSurfResistance = (1 - ZoneSurfEmissivity) / (ZoneSurfArea * ZoneSurfEmissivity); VFObj.LinkageSurfaceData(j).SurfaceResistanceFactor = - StefanBoltzmann / (DuctSurfResistance + SpaceResistance + ZoneSurfResistance); + DataGlobalConstants::StefanBoltzmann() / (DuctSurfResistance + SpaceResistance + ZoneSurfResistance); Real64 hrj = VFObj.LinkageSurfaceData(j).SurfaceResistanceFactor * (TDuctSurf_K + TSurfj_K) * (pow_2(TDuctSurf_K) + pow_2(TSurfj_K)) / DuctSurfArea; @@ -6890,7 +6886,7 @@ namespace AirflowNetworkBalanceManager { } Tsurr = (hOut * Tamb + hrjTj_sum) / (hOut + hrj_sum); // Surroundings temperature [C] - Tsurr_K = Tsurr + KelvinConv; + Tsurr_K = Tsurr + DataGlobalConstants::KelvinConv(); Real64 RThermTotal = RThermConvIn + RThermConduct + 1 / (hOut + hrj_sum); UThermal = pow(RThermTotal, -1); @@ -6899,13 +6895,13 @@ namespace AirflowNetworkBalanceManager { Tin_ave = Tsurr + (Tin - Tsurr) * (1 / NTU) * (1 - exp(-NTU)); TDuctSurf = Tin_ave - UThermal * (RThermConvIn + RThermConduct) * (Tin_ave - Tsurr); - TDuctSurf_K = TDuctSurf + KelvinConv; + TDuctSurf_K = TDuctSurf + DataGlobalConstants::KelvinConv(); } for (int j = 1; j <= VFObj.LinkageSurfaceData.u(); ++j) { int ZoneSurfNum = VFObj.LinkageSurfaceData(j).SurfaceNum; Real64 TSurfj = TH(1, 1, ZoneSurfNum); - Real64 TSurfj_K = TSurfj + KelvinConv; + Real64 TSurfj_K = TSurfj + DataGlobalConstants::KelvinConv(); VFObj.LinkageSurfaceData(j).SurfaceRadLoad = VFObj.LinkageSurfaceData(j).SurfaceResistanceFactor * (pow_4(TDuctSurf_K) - pow_4(TSurfj_K)); // Radiant load for this surface [W] int SurfNum = VFObj.LinkageSurfaceData(j).SurfaceNum; diff --git a/src/EnergyPlus/Autosizing/CoolingWaterDesAirOutletTempSizing.cc b/src/EnergyPlus/Autosizing/CoolingWaterDesAirOutletTempSizing.cc index dc5a45ed694..fe8ea00d7e6 100644 --- a/src/EnergyPlus/Autosizing/CoolingWaterDesAirOutletTempSizing.cc +++ b/src/EnergyPlus/Autosizing/CoolingWaterDesAirOutletTempSizing.cc @@ -68,12 +68,12 @@ Real64 CoolingWaterDesAirOutletTempSizer::size(EnergyPlusData &state, Real64 _or if (this->termUnitIU) { Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->dataWaterLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->dataWaterLoopNum).FluidIndex, this->callingRoutine); Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->dataWaterLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->dataWaterLoopNum).FluidIndex, this->callingRoutine); Real64 DesCoilLoad = this->dataWaterFlowUsedForSizing * this->dataWaterCoilSizCoolDeltaT * Cp * rho; diff --git a/src/EnergyPlus/Autosizing/CoolingWaterflowSizing.cc b/src/EnergyPlus/Autosizing/CoolingWaterflowSizing.cc index ed14cf4d13e..2e1fcade21e 100644 --- a/src/EnergyPlus/Autosizing/CoolingWaterflowSizing.cc +++ b/src/EnergyPlus/Autosizing/CoolingWaterflowSizing.cc @@ -90,12 +90,12 @@ Real64 CoolingWaterflowSizer::size(EnergyPlusData &state, Real64 _originalValue, this->dataWaterCoilSizCoolDeltaT > 0.0) { Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->dataWaterLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->dataWaterLoopNum).FluidIndex, this->callingRoutine); Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->dataWaterLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->dataWaterLoopNum).FluidIndex, this->callingRoutine); this->autoSizedValue = DesCoilLoad / (CoilDesWaterDeltaT * Cp * rho); @@ -122,12 +122,12 @@ Real64 CoolingWaterflowSizer::size(EnergyPlusData &state, Real64 _originalValue, if (this->dataWaterLoopNum > 0 && this->dataWaterLoopNum <= (int)DataPlant::PlantLoop.size() && CoilDesWaterDeltaT > 0.0) { Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->dataWaterLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->dataWaterLoopNum).FluidIndex, this->callingRoutine); Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->dataWaterLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->dataWaterLoopNum).FluidIndex, this->callingRoutine); this->autoSizedValue = this->dataCapacityUsedForSizing / (CoilDesWaterDeltaT * Cp * rho); @@ -168,8 +168,8 @@ Real64 CoolingWaterflowSizer::size(EnergyPlusData &state, Real64 _originalValue, coilSelectionReportObj->setCoilEntWaterTemp(this->compName, this->compType, this->dataDesInletWaterTemp); coilSelectionReportObj->setCoilLvgWaterTemp(this->compName, this->compType, this->dataDesInletWaterTemp + CoilDesWaterDeltaT); } else { - coilSelectionReportObj->setCoilEntWaterTemp(this->compName, this->compType, DataGlobals::CWInitConvTemp); - coilSelectionReportObj->setCoilLvgWaterTemp(this->compName, this->compType, DataGlobals::CWInitConvTemp + CoilDesWaterDeltaT); + coilSelectionReportObj->setCoilEntWaterTemp(this->compName, this->compType, DataGlobalConstants::CWInitConvTemp()); + coilSelectionReportObj->setCoilLvgWaterTemp(this->compName, this->compType, DataGlobalConstants::CWInitConvTemp() + CoilDesWaterDeltaT); } } return this->autoSizedValue; diff --git a/src/EnergyPlus/Autosizing/HeatingWaterDesCoilLoadUsedForUASizing.cc b/src/EnergyPlus/Autosizing/HeatingWaterDesCoilLoadUsedForUASizing.cc index a19825514f0..d25e59d55e9 100644 --- a/src/EnergyPlus/Autosizing/HeatingWaterDesCoilLoadUsedForUASizing.cc +++ b/src/EnergyPlus/Autosizing/HeatingWaterDesCoilLoadUsedForUASizing.cc @@ -71,12 +71,12 @@ Real64 HeatingWaterDesCoilLoadUsedForUASizer::size(EnergyPlusData &state, Real64 if (this->termUnitSingDuct && (this->curTermUnitSizingNum > 0)) { Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->dataWaterLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(this->dataWaterLoopNum).FluidIndex, this->callingRoutine); Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->dataWaterLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(this->dataWaterLoopNum).FluidIndex, this->callingRoutine); this->autoSizedValue = this->dataWaterFlowUsedForSizing * this->dataWaterCoilSizHeatDeltaT * Cp * rho; @@ -84,12 +84,12 @@ Real64 HeatingWaterDesCoilLoadUsedForUASizer::size(EnergyPlusData &state, Real64 } else if ((this->termUnitPIU || this->termUnitIU) && (this->curTermUnitSizingNum > 0)) { Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->dataWaterLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(this->dataWaterLoopNum).FluidIndex, this->callingRoutine); Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->dataWaterLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(this->dataWaterLoopNum).FluidIndex, this->callingRoutine); this->autoSizedValue = this->dataWaterFlowUsedForSizing * this->dataWaterCoilSizHeatDeltaT * Cp * rho * @@ -97,12 +97,12 @@ Real64 HeatingWaterDesCoilLoadUsedForUASizer::size(EnergyPlusData &state, Real64 } else if (this->zoneEqFanCoil || this->zoneEqUnitHeater) { Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->dataWaterLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(this->dataWaterLoopNum).FluidIndex, this->callingRoutine); Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->dataWaterLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(this->dataWaterLoopNum).FluidIndex, this->callingRoutine); this->autoSizedValue = this->dataWaterFlowUsedForSizing * this->dataWaterCoilSizHeatDeltaT * Cp * rho; diff --git a/src/EnergyPlus/Autosizing/HeatingWaterflowSizing.cc b/src/EnergyPlus/Autosizing/HeatingWaterflowSizing.cc index d12acef334b..6f704b4d2e9 100644 --- a/src/EnergyPlus/Autosizing/HeatingWaterflowSizing.cc +++ b/src/EnergyPlus/Autosizing/HeatingWaterflowSizing.cc @@ -95,12 +95,12 @@ Real64 HeatingWaterflowSizer::size(EnergyPlusData &state, Real64 _originalValue, this->dataWaterCoilSizHeatDeltaT > 0.0) { Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->dataWaterLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(this->dataWaterLoopNum).FluidIndex, this->callingRoutine); Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->dataWaterLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(this->dataWaterLoopNum).FluidIndex, this->callingRoutine); this->autoSizedValue = DesCoilLoad / (this->dataWaterCoilSizHeatDeltaT * Cp * rho); @@ -125,12 +125,12 @@ Real64 HeatingWaterflowSizer::size(EnergyPlusData &state, Real64 _originalValue, this->dataWaterCoilSizHeatDeltaT > 0.0) { Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->dataWaterLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(this->dataWaterLoopNum).FluidIndex, this->callingRoutine); Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->dataWaterLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(this->dataWaterLoopNum).FluidIndex, this->callingRoutine); this->autoSizedValue = this->dataCapacityUsedForSizing / (this->dataWaterCoilSizHeatDeltaT * Cp * rho); @@ -157,11 +157,11 @@ Real64 HeatingWaterflowSizer::size(EnergyPlusData &state, Real64 _originalValue, if (this->isCoilReportObject) { coilSelectionReportObj->setCoilWaterFlowPltSizNum( state, this->compName, this->compType, this->autoSizedValue, this->wasAutoSized, this->dataPltSizHeatNum, this->dataWaterLoopNum); - coilSelectionReportObj->setCoilEntWaterTemp(this->compName, this->compType, DataGlobals::HWInitConvTemp); + coilSelectionReportObj->setCoilEntWaterTemp(this->compName, this->compType, DataGlobalConstants::HWInitConvTemp()); if (this->plantSizData.size() > 0 && this->dataPltSizHeatNum > 0) { coilSelectionReportObj->setCoilWaterDeltaT(this->compName, this->compType, this->plantSizData(this->dataPltSizHeatNum).DeltaT); coilSelectionReportObj->setCoilLvgWaterTemp( - this->compName, this->compType, DataGlobals::HWInitConvTemp - this->plantSizData(this->dataPltSizHeatNum).DeltaT); + this->compName, this->compType, DataGlobalConstants::HWInitConvTemp() - this->plantSizData(this->dataPltSizHeatNum).DeltaT); } } return this->autoSizedValue; diff --git a/src/EnergyPlus/Autosizing/WaterHeatingCapacitySizing.cc b/src/EnergyPlus/Autosizing/WaterHeatingCapacitySizing.cc index 7bf80aa8f52..820409f6acf 100644 --- a/src/EnergyPlus/Autosizing/WaterHeatingCapacitySizing.cc +++ b/src/EnergyPlus/Autosizing/WaterHeatingCapacitySizing.cc @@ -74,12 +74,12 @@ Real64 WaterHeatingCapacitySizer::size(EnergyPlusData &state, Real64 _originalVa DesMassFlow = this->termUnitSizing(this->curTermUnitSizingNum).MaxHWVolFlow; Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->dataWaterLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(this->dataWaterLoopNum).FluidIndex, this->callingRoutine); Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->dataWaterLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(this->dataWaterLoopNum).FluidIndex, this->callingRoutine); NominalCapacityDes = DesMassFlow * this->dataWaterCoilSizHeatDeltaT * Cp * rho; @@ -87,12 +87,12 @@ Real64 WaterHeatingCapacitySizer::size(EnergyPlusData &state, Real64 _originalVa DesMassFlow = this->zoneEqSizing(this->curZoneEqNum).MaxHWVolFlow; Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->dataWaterLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(this->dataWaterLoopNum).FluidIndex, this->callingRoutine); Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->dataWaterLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(this->dataWaterLoopNum).FluidIndex, this->callingRoutine); NominalCapacityDes = DesMassFlow * this->dataWaterCoilSizHeatDeltaT * Cp * rho; diff --git a/src/EnergyPlus/BaseboardRadiator.cc b/src/EnergyPlus/BaseboardRadiator.cc index e74093c4b08..527e87adb18 100644 --- a/src/EnergyPlus/BaseboardRadiator.cc +++ b/src/EnergyPlus/BaseboardRadiator.cc @@ -576,7 +576,7 @@ namespace BaseboardRadiator { WaterInletNode = baseboard->Baseboard(BaseboardNum).WaterInletNode; rho = GetDensityGlycol(state, PlantLoop(baseboard->Baseboard(BaseboardNum).LoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(baseboard->Baseboard(BaseboardNum).LoopNum).FluidIndex, RoutineName); baseboard->Baseboard(BaseboardNum).WaterMassFlowRateMax = rho * baseboard->Baseboard(BaseboardNum).WaterVolFlowRateMax; @@ -588,7 +588,7 @@ namespace BaseboardRadiator { baseboard->Baseboard(BaseboardNum).LoopSideNum, baseboard->Baseboard(BaseboardNum).BranchNum, baseboard->Baseboard(BaseboardNum).CompNum); - Node(WaterInletNode).Temp = DataGlobals::HWInitConvTemp; + Node(WaterInletNode).Temp = DataGlobalConstants::HWInitConvTemp(); Cp = GetSpecificHeatGlycol(state, PlantLoop(baseboard->Baseboard(BaseboardNum).LoopNum).FluidName, Node(WaterInletNode).Temp, @@ -752,12 +752,12 @@ namespace BaseboardRadiator { if (DesCoilLoad >= SmallLoad) { Cp = GetSpecificHeatGlycol(state, PlantLoop(baseboard->Baseboard(BaseboardNum).LoopNum).FluidName, - HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(baseboard->Baseboard(BaseboardNum).LoopNum).FluidIndex, RoutineName); rho = GetDensityGlycol(state, PlantLoop(baseboard->Baseboard(BaseboardNum).LoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(baseboard->Baseboard(BaseboardNum).LoopNum).FluidIndex, RoutineName); WaterVolFlowRateMaxDes = DesCoilLoad / (PlantSizData(PltSizHeatNum).DeltaT * Cp * rho); @@ -820,7 +820,7 @@ namespace BaseboardRadiator { WaterInletNode = baseboard->Baseboard(BaseboardNum).WaterInletNode; rho = GetDensityGlycol(state, PlantLoop(baseboard->Baseboard(BaseboardNum).LoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(baseboard->Baseboard(BaseboardNum).LoopNum).FluidIndex, RoutineName); Node(WaterInletNode).MassFlowRate = rho * baseboard->Baseboard(BaseboardNum).WaterVolFlowRateMax; diff --git a/src/EnergyPlus/Boilers.cc b/src/EnergyPlus/Boilers.cc index a9d25a44c19..644fc37885c 100644 --- a/src/EnergyPlus/Boilers.cc +++ b/src/EnergyPlus/Boilers.cc @@ -460,7 +460,7 @@ namespace Boilers { // if ( ! PlantFirstSizeCompleted ) SizeBoiler( BoilerNum ); Real64 const rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->LoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(this->LoopNum).FluidIndex, RoutineName); this->DesMassFlowRate = this->VolFlowRate * rho; @@ -561,12 +561,12 @@ namespace Boilers { Real64 const rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->LoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(this->LoopNum).FluidIndex, RoutineName); Real64 const Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->LoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(this->LoopNum).FluidIndex, RoutineName); tmpNomCap = Cp * rho * this->SizFac * DataSizing::PlantSizData(PltSizNum).DeltaT * DataSizing::PlantSizData(PltSizNum).DesVolFlowRate; diff --git a/src/EnergyPlus/CTElectricGenerator.cc b/src/EnergyPlus/CTElectricGenerator.cc index 2abfbcfa50e..047e39ae9d0 100644 --- a/src/EnergyPlus/CTElectricGenerator.cc +++ b/src/EnergyPlus/CTElectricGenerator.cc @@ -700,7 +700,7 @@ namespace CTElectricGenerator { // size mass flow rate Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->HRLoopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->HRLoopNum).FluidIndex, RoutineName); diff --git a/src/EnergyPlus/ChilledCeilingPanelSimple.cc b/src/EnergyPlus/ChilledCeilingPanelSimple.cc index 485a37340ac..a2dec5188a4 100644 --- a/src/EnergyPlus/ChilledCeilingPanelSimple.cc +++ b/src/EnergyPlus/ChilledCeilingPanelSimple.cc @@ -793,7 +793,7 @@ namespace CoolingPanelSimple { // set design mass flow rates if (ThisCP.WaterInletNode > 0) { rho = GetDensityGlycol( - state, PlantLoop(ThisCP.LoopNum).FluidName, DataGlobals::CWInitConvTemp, PlantLoop(ThisCP.LoopNum).FluidIndex, RoutineName); + state, PlantLoop(ThisCP.LoopNum).FluidName, DataGlobalConstants::CWInitConvTemp(), PlantLoop(ThisCP.LoopNum).FluidIndex, RoutineName); ThisCP.WaterMassFlowRateMax = rho * ThisCP.WaterVolFlowRateMax; InitComponentNodes(0.0, ThisCP.WaterMassFlowRateMax, @@ -811,7 +811,7 @@ namespace CoolingPanelSimple { if (BeginEnvrnFlag && MyEnvrnFlag(CoolingPanelNum)) { // Initialize - rho = GetDensityGlycol(state, PlantLoop(ThisCP.LoopNum).FluidName, InitConvTemp, PlantLoop(ThisCP.LoopNum).FluidIndex, RoutineName); + rho = GetDensityGlycol(state, PlantLoop(ThisCP.LoopNum).FluidName, DataGlobalConstants::InitConvTemp(), PlantLoop(ThisCP.LoopNum).FluidIndex, RoutineName); ThisCP.WaterMassFlowRateMax = rho * ThisCP.WaterVolFlowRateMax; diff --git a/src/EnergyPlus/ChillerAbsorption.cc b/src/EnergyPlus/ChillerAbsorption.cc index d8e0ece619e..adc63b43736 100644 --- a/src/EnergyPlus/ChillerAbsorption.cc +++ b/src/EnergyPlus/ChillerAbsorption.cc @@ -719,7 +719,7 @@ namespace ChillerAbsorption { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); @@ -736,7 +736,7 @@ namespace ChillerAbsorption { rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CDLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); @@ -757,7 +757,7 @@ namespace ChillerAbsorption { if (this->GenHeatSourceType == DataLoopNode::NodeType_Water) { rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->GenLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(this->GenLoopNum).FluidIndex, RoutineName); @@ -926,13 +926,13 @@ namespace ChillerAbsorption { Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); tmpNomCap = Cp * rho * DataSizing::PlantSizData(PltSizNum).DeltaT * DataSizing::PlantSizData(PltSizNum).DesVolFlowRate * this->SizFac; @@ -1099,7 +1099,7 @@ namespace ChillerAbsorption { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CDLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); tmpCondVolFlowRate = @@ -1319,12 +1319,12 @@ namespace ChillerAbsorption { if (DataPlant::PlantFirstSizesOkayToFinalize) { Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->GenLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(this->GenLoopNum).FluidIndex, RoutineName); Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->GenLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(this->GenLoopNum).FluidIndex, RoutineName); diff --git a/src/EnergyPlus/ChillerElectricEIR.cc b/src/EnergyPlus/ChillerElectricEIR.cc index 8cee53b7a2c..76a056ba4d1 100644 --- a/src/EnergyPlus/ChillerElectricEIR.cc +++ b/src/EnergyPlus/ChillerElectricEIR.cc @@ -1051,7 +1051,7 @@ namespace ChillerElectricEIR { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); @@ -1103,7 +1103,7 @@ namespace ChillerElectricEIR { if (this->HeatRecActive) { rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->HRLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->HRLoopNum).FluidIndex, RoutineName); this->DesignHeatRecMassFlowRate = rho * this->DesignHeatRecVolFlowRate; @@ -1310,13 +1310,13 @@ namespace ChillerElectricEIR { if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); tmpNomCap = Cp * rho * DataSizing::PlantSizData(PltSizNum).DeltaT * tmpEvapVolFlowRate; @@ -1374,7 +1374,7 @@ namespace ChillerElectricEIR { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CDLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, @@ -2170,7 +2170,7 @@ namespace ChillerElectricEIR { } if (this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { - Real64 const RhoWater = Psychrometrics::RhoH2O(DataGlobals::InitConvTemp); + Real64 const RhoWater = Psychrometrics::RhoH2O(DataGlobalConstants::InitConvTemp()); // CondMassFlowRate is already multiplied by PLR, convert to water use rate this->EvapWaterConsumpRate = ((this->CondOutletHumRat - DataLoopNode::Node(this->CondInletNodeNum).HumRat) * this->CondMassFlowRate) / RhoWater; diff --git a/src/EnergyPlus/ChillerExhaustAbsorption.cc b/src/EnergyPlus/ChillerExhaustAbsorption.cc index d81ff048664..d209dfd694b 100644 --- a/src/EnergyPlus/ChillerExhaustAbsorption.cc +++ b/src/EnergyPlus/ChillerExhaustAbsorption.cc @@ -794,11 +794,11 @@ namespace ChillerExhaustAbsorption { if (this->CDLoopNum > 0) { rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CDLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); } else { - rho = Psychrometrics::RhoH2O(DataGlobals::InitConvTemp); + rho = Psychrometrics::RhoH2O(DataGlobalConstants::InitConvTemp()); } this->DesCondMassFlowRate = rho * this->CondVolFlowRate; @@ -815,11 +815,11 @@ namespace ChillerExhaustAbsorption { if (this->HWLoopNum > 0) { rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->HWLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(this->HWLoopNum).FluidIndex, RoutineName); } else { - rho = Psychrometrics::RhoH2O(DataGlobals::InitConvTemp); + rho = Psychrometrics::RhoH2O(DataGlobalConstants::InitConvTemp()); } this->DesHeatMassFlowRate = rho * this->HeatVolFlowRate; // init available hot water flow rate @@ -835,11 +835,11 @@ namespace ChillerExhaustAbsorption { if (this->CWLoopNum > 0) { rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); } else { - rho = Psychrometrics::RhoH2O(DataGlobals::InitConvTemp); + rho = Psychrometrics::RhoH2O(DataGlobalConstants::InitConvTemp()); } this->DesEvapMassFlowRate = rho * this->EvapVolFlowRate; // init available hot water flow rate @@ -940,12 +940,12 @@ namespace ChillerExhaustAbsorption { if (DataSizing::PlantSizData(PltSizCoolNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); tmpNomCap = diff --git a/src/EnergyPlus/ChillerGasAbsorption.cc b/src/EnergyPlus/ChillerGasAbsorption.cc index 3e37e10c437..1aef67686c7 100644 --- a/src/EnergyPlus/ChillerGasAbsorption.cc +++ b/src/EnergyPlus/ChillerGasAbsorption.cc @@ -788,11 +788,11 @@ namespace ChillerGasAbsorption { if (this->CDLoopNum > 0) { rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CDLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); } else { - rho = Psychrometrics::RhoH2O(DataGlobals::InitConvTemp); + rho = Psychrometrics::RhoH2O(DataGlobalConstants::InitConvTemp()); } this->DesCondMassFlowRate = rho * this->CondVolFlowRate; @@ -809,11 +809,11 @@ namespace ChillerGasAbsorption { if (this->HWLoopNum > 0) { rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->HWLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(this->HWLoopNum).FluidIndex, RoutineName); } else { - rho = Psychrometrics::RhoH2O(DataGlobals::InitConvTemp); + rho = Psychrometrics::RhoH2O(DataGlobalConstants::InitConvTemp()); } this->DesHeatMassFlowRate = rho * this->HeatVolFlowRate; // init available hot water flow rate @@ -829,11 +829,11 @@ namespace ChillerGasAbsorption { if (this->CWLoopNum > 0) { rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); } else { - rho = Psychrometrics::RhoH2O(DataGlobals::InitConvTemp); + rho = Psychrometrics::RhoH2O(DataGlobalConstants::InitConvTemp()); } this->DesEvapMassFlowRate = rho * this->EvapVolFlowRate; // init available hot water flow rate @@ -933,12 +933,12 @@ namespace ChillerGasAbsorption { if (DataSizing::PlantSizData(PltSizCoolNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); tmpNomCap = diff --git a/src/EnergyPlus/ChillerIndirectAbsorption.cc b/src/EnergyPlus/ChillerIndirectAbsorption.cc index c7a3e310ba0..9a225c0cfb4 100644 --- a/src/EnergyPlus/ChillerIndirectAbsorption.cc +++ b/src/EnergyPlus/ChillerIndirectAbsorption.cc @@ -813,7 +813,7 @@ namespace ChillerIndirectAbsorption { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); @@ -830,7 +830,7 @@ namespace ChillerIndirectAbsorption { rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CDLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); @@ -853,7 +853,7 @@ namespace ChillerIndirectAbsorption { rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->GenLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(this->GenLoopNum).FluidIndex, RoutineName); this->GenMassFlowRateMax = rho * this->GeneratorVolFlowRate; @@ -1010,13 +1010,13 @@ namespace ChillerIndirectAbsorption { Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); tmpNomCap = Cp * rho * DataSizing::PlantSizData(PltSizNum).DeltaT * DataSizing::PlantSizData(PltSizNum).DesVolFlowRate * this->SizFac; @@ -1193,13 +1193,13 @@ namespace ChillerIndirectAbsorption { Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->CDLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CDLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); tmpCondVolFlowRate = @@ -1454,7 +1454,7 @@ namespace ChillerIndirectAbsorption { } else if (this->GenHeatSourceType == DataLoopNode::NodeType_Water) { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->GenLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(this->GenLoopNum).FluidIndex, RoutineName); Real64 CpWater = FluidProperties::GetSpecificHeatGlycol(state, diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc index a889c611aab..e6c8a14401c 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.cc +++ b/src/EnergyPlus/ChillerReformulatedEIR.cc @@ -858,7 +858,7 @@ namespace ChillerReformulatedEIR { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); @@ -908,7 +908,7 @@ namespace ChillerReformulatedEIR { if (this->HeatRecActive) { rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->HRLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(this->HRLoopNum).FluidIndex, RoutineName); this->DesignHeatRecMassFlowRate = rho * this->DesignHeatRecVolFlowRate; @@ -1098,12 +1098,12 @@ namespace ChillerReformulatedEIR { } Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); Real64 RefCapFT = CurveManager::CurveValue(state, this->ChillerCapFTIndex, SizingEvapOutletTemp, SizingCondOutletTemp); @@ -1163,7 +1163,7 @@ namespace ChillerReformulatedEIR { if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow && tmpNomCap > 0.0) { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CDLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, diff --git a/src/EnergyPlus/CondenserLoopTowers.cc b/src/EnergyPlus/CondenserLoopTowers.cc index 1470b5b27d8..00443e0b030 100644 --- a/src/EnergyPlus/CondenserLoopTowers.cc +++ b/src/EnergyPlus/CondenserLoopTowers.cc @@ -1870,7 +1870,7 @@ namespace CondenserLoopTowers { Real64 const rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->LoopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->LoopNum).FluidIndex, RoutineName); @@ -2372,7 +2372,7 @@ namespace CondenserLoopTowers { if (DataSizing::PlantSizData(PltSizCondNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { Real64 const rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->LoopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->LoopNum).FluidIndex, RoutineName); Real64 const Cp = FluidProperties::GetSpecificHeatGlycol(state, @@ -2444,7 +2444,7 @@ namespace CondenserLoopTowers { if (DataSizing::PlantSizData(PltSizCondNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { Real64 const rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->LoopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->LoopNum).FluidIndex, RoutineName); Real64 const Cp = FluidProperties::GetSpecificHeatGlycol(state, @@ -2525,7 +2525,7 @@ namespace CondenserLoopTowers { Real64 const rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->LoopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->LoopNum).FluidIndex, RoutineName); Real64 const Cp = FluidProperties::GetSpecificHeatGlycol(state, @@ -3424,14 +3424,14 @@ namespace CondenserLoopTowers { } else { // probably no plant sizing object Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->LoopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->LoopNum).FluidIndex, RoutineName); this->WaterTemp = DesTowerInletWaterTemp; // 35.0; // design condition } rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->LoopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->LoopNum).FluidIndex, RoutineName); @@ -3689,7 +3689,7 @@ namespace CondenserLoopTowers { if (DataPlant::PlantFirstSizesOkayToFinalize) { rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->LoopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->LoopNum).FluidIndex, RoutineName); Cp = FluidProperties::GetSpecificHeatGlycol(state, @@ -5236,7 +5236,7 @@ namespace CondenserLoopTowers { DeltaTwb = std::abs(OutletAirWetBulb - InletAirWetBulb); // Add KelvinConv to denominator below convert OutletAirWetBulbLast to Kelvin to avoid divide by zero. // Wet bulb error units are delta K/K - WetBulbError = std::abs((OutletAirWetBulb - OutletAirWetBulbLast) / (OutletAirWetBulbLast + DataGlobals::KelvinConv)); + WetBulbError = std::abs((OutletAirWetBulb - OutletAirWetBulbLast) / (OutletAirWetBulbLast + DataGlobalConstants::KelvinConv())); } if (QactualLocal >= 0.0) { diff --git a/src/EnergyPlus/ConvectionCoefficients.cc b/src/EnergyPlus/ConvectionCoefficients.cc index e4ff59e6271..c1ad3174bfc 100644 --- a/src/EnergyPlus/ConvectionCoefficients.cc +++ b/src/EnergyPlus/ConvectionCoefficients.cc @@ -383,18 +383,18 @@ namespace ConvectionCoefficients { state.dataConvectionCoefficient->GetUserSuppliedConvectionCoeffs = false; } - TAir = Surface(SurfNum).OutDryBulbTemp + KelvinConv; - TSurf = TempExt + KelvinConv; + TAir = Surface(SurfNum).OutDryBulbTemp + DataGlobalConstants::KelvinConv(); + TSurf = TempExt + DataGlobalConstants::KelvinConv(); TSky = SkyTempKelvin; TGround = TAir; if (Surface(SurfNum).HasSurroundingSurfProperties) { SrdSurfsNum = Surface(SurfNum).SurroundingSurfacesNum; if (SurroundingSurfsProperty(SrdSurfsNum).SkyTempSchNum != 0) { - TSky = GetCurrentScheduleValue(SurroundingSurfsProperty(SrdSurfsNum).SkyTempSchNum) + KelvinConv; + TSky = GetCurrentScheduleValue(SurroundingSurfsProperty(SrdSurfsNum).SkyTempSchNum) + DataGlobalConstants::KelvinConv(); } if (SurroundingSurfsProperty(SrdSurfsNum).GroundTempSchNum != 0) { - TGround = GetCurrentScheduleValue(SurroundingSurfsProperty(SrdSurfsNum).GroundTempSchNum) + KelvinConv; + TGround = GetCurrentScheduleValue(SurroundingSurfsProperty(SrdSurfsNum).GroundTempSchNum) + DataGlobalConstants::KelvinConv(); } } @@ -602,7 +602,7 @@ namespace ConvectionCoefficients { } else { // Compute sky radiation coefficient HSky = - StefanBoltzmann * AbsExt * Surface(SurfNum).ViewFactorSkyIR * AirSkyRadSplit(SurfNum) * (pow_4(TSurf) - pow_4(TSky)) / (TSurf - TSky); + DataGlobalConstants::StefanBoltzmann() * AbsExt * Surface(SurfNum).ViewFactorSkyIR * AirSkyRadSplit(SurfNum) * (pow_4(TSurf) - pow_4(TSky)) / (TSurf - TSky); } if (TSurf == TAir || algoNum == ASHRAESimple) { @@ -610,10 +610,10 @@ namespace ConvectionCoefficients { HAir = 0.0; } else { // Compute ground radiation coefficient - HGround = StefanBoltzmann * AbsExt * Surface(SurfNum).ViewFactorGroundIR * (pow_4(TSurf) - pow_4(TGround)) / (TSurf - TGround); + HGround = DataGlobalConstants::StefanBoltzmann() * AbsExt * Surface(SurfNum).ViewFactorGroundIR * (pow_4(TSurf) - pow_4(TGround)) / (TSurf - TGround); // Compute air radiation coefficient - HAir = StefanBoltzmann * AbsExt * Surface(SurfNum).ViewFactorSkyIR * (1.0 - AirSkyRadSplit(SurfNum)) * (pow_4(TSurf) - pow_4(TAir)) / + HAir = DataGlobalConstants::StefanBoltzmann() * AbsExt * Surface(SurfNum).ViewFactorSkyIR * (1.0 - AirSkyRadSplit(SurfNum)) * (pow_4(TSurf) - pow_4(TAir)) / (TSurf - TAir); } } @@ -2970,11 +2970,11 @@ namespace ConvectionCoefficients { // make sure inside surface is hot, outside is cold // NOTE: this is not ideal. could have circumstances that reverse this? if (SurfaceTemperatures(Surf1) > SurfaceTemperatures(Surf2)) { - Tsi = SurfaceTemperatures(Surf1) + KelvinConv; - Tso = SurfaceTemperatures(Surf2) + KelvinConv; + Tsi = SurfaceTemperatures(Surf1) + DataGlobalConstants::KelvinConv(); + Tso = SurfaceTemperatures(Surf2) + DataGlobalConstants::KelvinConv(); } else { - Tso = SurfaceTemperatures(Surf1) + KelvinConv; - Tsi = SurfaceTemperatures(Surf2) + KelvinConv; + Tso = SurfaceTemperatures(Surf1) + DataGlobalConstants::KelvinConv(); + Tsi = SurfaceTemperatures(Surf2) + DataGlobalConstants::KelvinConv(); } beta = 2.0 / (Tso + Tsi); @@ -4563,7 +4563,7 @@ namespace ConvectionCoefficients { HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { return CalcFohannoPolidoriVerticalWall(Tsurf - Tamb, Surface(SurfNum).IntConvZoneWallHeight, - Tsurf - KelvinConv, // Kiva already uses Kelvin, but algorithm expects C + Tsurf - DataGlobalConstants::KelvinConv(), // Kiva already uses Kelvin, but algorithm expects C -QdotConvInRepPerArea(SurfNum)); }; } else { @@ -5279,7 +5279,7 @@ namespace ConvectionCoefficients { // Grashof for zone air based on largest delta T between surfaces and zone height Tmin = minval(TH(2, 1, {Zone(ZoneNum).SurfaceFirst, Zone(ZoneNum).SurfaceLast})); Tmax = maxval(TH(2, 1, {Zone(ZoneNum).SurfaceFirst, Zone(ZoneNum).SurfaceLast})); - GrH = (g * (Tmax - Tmin) * pow_3(Zone(ZoneNum).CeilingHeight)) / ((MAT(ZoneNum) + KelvinConv) * pow_2(v)); + GrH = (g * (Tmax - Tmin) * pow_3(Zone(ZoneNum).CeilingHeight)) / ((MAT(ZoneNum) + DataGlobalConstants::KelvinConv()) * pow_2(v)); // Reynolds number = Vdot supply / v * cube root of zone volume (Goldstein and Noveselac 2010) if (Node(ZoneNode).MassFlowRate > 0.0) { @@ -7309,7 +7309,7 @@ namespace ConvectionCoefficients { Real64 RaH(0.0); Real64 BetaFilm(0.0); - BetaFilm = 1.0 / (KelvinConv + SurfTemp + 0.5 * DeltaTemp); // TODO check sign on DeltaTemp + BetaFilm = 1.0 / (DataGlobalConstants::KelvinConv() + SurfTemp + 0.5 * DeltaTemp); // TODO check sign on DeltaTemp RaH = (g * BetaFilm * QdotConv * pow_4(Height) * Pr) / (k * pow_2(v)); if (RaH <= 6.3e09) { @@ -8112,7 +8112,7 @@ namespace ConvectionCoefficients { Ln = std::sqrt(RoofArea); } DeltaTemp = SurfTemp - AirTemp; - BetaFilm = 1.0 / (KelvinConv + SurfTemp + 0.5 * DeltaTemp); + BetaFilm = 1.0 / (DataGlobalConstants::KelvinConv() + SurfTemp + 0.5 * DeltaTemp); AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, AirTemp, OutHumRat); GrLn = g * pow_2(AirDensity) * pow_3(Ln) * std::abs(DeltaTemp) * BetaFilm / pow_2(v); diff --git a/src/EnergyPlus/DXCoils.cc b/src/EnergyPlus/DXCoils.cc index 1bbc9abdc19..9d88020d636 100644 --- a/src/EnergyPlus/DXCoils.cc +++ b/src/EnergyPlus/DXCoils.cc @@ -3021,7 +3021,7 @@ namespace DXCoils { } DXCoil(DXCoilNum).RatedAirVolFlowRate(1) = Numbers(7); - if (DXCoil(DXCoilNum).RatedAirVolFlowRate(1) != AutoCalculate) { + if (DXCoil(DXCoilNum).RatedAirVolFlowRate(1) != DataGlobalConstants::AutoCalculate()) { if (DXCoil(DXCoilNum).RatedAirVolFlowRate(1) <= 0.0) { ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("..." + cNumericFields(7) + " must be > 0.0. entered value=[" + TrimSigDigits(Numbers(7), 3) + "]."); @@ -3031,7 +3031,7 @@ namespace DXCoils { DXCoil(DXCoilNum).RatedHPWHCondWaterFlow = Numbers(8); // move to init - if (DXCoil(DXCoilNum).RatedHPWHCondWaterFlow != AutoCalculate) { + if (DXCoil(DXCoilNum).RatedHPWHCondWaterFlow != DataGlobalConstants::AutoCalculate()) { if (DXCoil(DXCoilNum).RatedHPWHCondWaterFlow <= 0.0) { ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("..." + cNumericFields(8) + " must be > 0.0 entered value=[" + TrimSigDigits(Numbers(8), 3) + "]."); @@ -3467,7 +3467,7 @@ namespace DXCoils { } DXCoil(DXCoilNum).RatedAirVolFlowRate(1) = Numbers(7); - if (DXCoil(DXCoilNum).RatedAirVolFlowRate(1) != AutoCalculate) { + if (DXCoil(DXCoilNum).RatedAirVolFlowRate(1) != DataGlobalConstants::AutoCalculate()) { if (DXCoil(DXCoilNum).RatedAirVolFlowRate(1) <= 0.0) { ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + DXCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("..." + cNumericFields(7) + " must be > 0.0. entered value=[" + TrimSigDigits(Numbers(7), 3) + "]."); @@ -6776,7 +6776,7 @@ namespace DXCoils { Mode = DehumidModeNum * 2 + CapacityStageNum; if (DXCoil(DXCoilNum).DXCoilType_Num == CoilDX_HeatPumpWaterHeaterPumped || DXCoil(DXCoilNum).DXCoilType_Num == CoilDX_HeatPumpWaterHeaterWrapped) { - if (DXCoil(DXCoilNum).RatedAirVolFlowRate(1) == AutoCalculate) { + if (DXCoil(DXCoilNum).RatedAirVolFlowRate(1) == DataGlobalConstants::AutoCalculate()) { // report autocalculated sizing PrintFlag = true; CompName = DXCoil(DXCoilNum).Name; @@ -6794,7 +6794,7 @@ namespace DXCoils { PrintFlag = false; } - if (DXCoil(DXCoilNum).RatedHPWHCondWaterFlow == AutoCalculate) { + if (DXCoil(DXCoilNum).RatedHPWHCondWaterFlow == DataGlobalConstants::AutoCalculate()) { // report autocalculated sizing PrintFlag = true; CompName = DXCoil(DXCoilNum).Name; diff --git a/src/EnergyPlus/DataContaminantBalance.cc b/src/EnergyPlus/DataContaminantBalance.cc index fe53798ef50..d84900f7b16 100644 --- a/src/EnergyPlus/DataContaminantBalance.cc +++ b/src/EnergyPlus/DataContaminantBalance.cc @@ -66,7 +66,6 @@ namespace DataContaminantBalance { // Using/Aliasing using namespace DataPrecisionGlobals; - using DataGlobals::AutoCalculate; using DataSurfaces::MaxSlatAngs; // Data diff --git a/src/EnergyPlus/DataEnvironment.cc b/src/EnergyPlus/DataEnvironment.cc index 0c6cf0d3638..6d4eec92df0 100644 --- a/src/EnergyPlus/DataEnvironment.cc +++ b/src/EnergyPlus/DataEnvironment.cc @@ -82,8 +82,6 @@ namespace DataEnvironment { // Using/Aliasing using namespace DataPrecisionGlobals; - using DataGlobals::KelvinConv; - // Data // -only module should be available to other modules and routines. // Thus, all variables in this module must be PUBLIC. @@ -308,7 +306,7 @@ namespace DataEnvironment { SkyClearness = Real64(); SkyBrightness = Real64(); TotalCloudCover = 0.0; - OpaqueCloudCover = 0.0; + OpaqueCloudCover = 0.0; StdBaroPress = 101325.0; StdRhoAir = Real64(); TimeZoneNumber = Real64(); @@ -575,7 +573,7 @@ namespace DataEnvironment { // FUNCTION LOCAL VARIABLE DECLARATIONS: Real64 BaseTemp; // Base temperature at Z - BaseTemp = OutDryBulbTempAt(Z) + KelvinConv; + BaseTemp = OutDryBulbTempAt(Z) + DataGlobalConstants::KelvinConv(); if (Z <= 0.0) { LocalAirPressure = 0.0; diff --git a/src/EnergyPlus/DataGlobalConstants.hh b/src/EnergyPlus/DataGlobalConstants.hh index aa74b446996..36d17d36af6 100644 --- a/src/EnergyPlus/DataGlobalConstants.hh +++ b/src/EnergyPlus/DataGlobalConstants.hh @@ -271,6 +271,15 @@ namespace DataGlobalConstants { Real64 constexpr BigNumber () { return std::numeric_limits< Real64 >::max(); } // Max Number real used for initializations Real64 constexpr rTinyValue () { return std::numeric_limits< Real64 >::epsilon(); } // Tiny value to replace use of TINY(x) std::string::size_type constexpr MaxNameLength () { return 100; } // Maximum Name Length in Characters -- should be the same as MaxAlphaArgLength in InputProcessor module + Real64 constexpr KelvinConv () { return 273.15; } // Conversion factor for C to K and K to C + Real64 constexpr InitConvTemp () { return 5.05; } // [deg C], standard init vol to mass flow conversion temp + Real64 constexpr AutoCalculate () { return -99999.0; } // automatically calculate some fields. + Real64 constexpr CWInitConvTemp () { return 5.05; } // [deg C], standard init chilled water vol to mass flow conversion temp + Real64 constexpr HWInitConvTemp () { return 60.0; } // [deg C], standard init hot water vol to mass flow conversion temp + Real64 constexpr SteamInitConvTemp () { return 100.0; } // [deg C], standard init steam vol to mass flow conversion temp + Real64 constexpr StefanBoltzmann () { return 5.6697E-8; } // Stefan-Boltzmann constant in W/(m2*K4) + Real64 constexpr UniversalGasConst () { return 8314.462175; } // (J/mol*K) + Real64 constexpr convertJtoGJ () { return 1.0E-9; } // Conversion factor for J to GJ int AssignResourceTypeNum(std::string const &ResourceTypeChar); std::string GetResourceTypeChar(int ResourceTypeNum); diff --git a/src/EnergyPlus/DataGlobals.cc b/src/EnergyPlus/DataGlobals.cc index e5f9267fdfd..915405ffb46 100644 --- a/src/EnergyPlus/DataGlobals.cc +++ b/src/EnergyPlus/DataGlobals.cc @@ -72,18 +72,6 @@ namespace DataGlobals { // This data-only module is a repository for all variables which are considered // to be "global" in nature in EnergyPlus. - Real64 const KelvinConv(273.15); // Conversion factor for C to K and K to C - Real64 const InitConvTemp(5.05); // [deg C], standard init vol to mass flow conversion temp - Real64 const AutoCalculate(-99999.0); // automatically calculate some fields. - Real64 const CWInitConvTemp(5.05); // [deg C], standard init chilled water vol to mass flow conversion temp - Real64 const HWInitConvTemp(60.0); // [deg C], standard init hot water vol to mass flow conversion temp - Real64 const SteamInitConvTemp(100.0); // [deg C], standard init steam vol to mass flow conversion temp - - Real64 const StefanBoltzmann(5.6697E-8); // Stefan-Boltzmann constant in W/(m2*K4) - Real64 const UniversalGasConst(8314.462175); // (J/mol*K) - - Real64 const convertJtoGJ(1.0E-9); // Conversion factor for J to GJ - // Parameters for EMS Calling Points int const emsCallFromZoneSizing(1); // Identity where EMS called from int const emsCallFromSystemSizing(2); // Identity where EMS called from diff --git a/src/EnergyPlus/DataGlobals.hh b/src/EnergyPlus/DataGlobals.hh index 9f58573bd52..3b33a17bf2e 100644 --- a/src/EnergyPlus/DataGlobals.hh +++ b/src/EnergyPlus/DataGlobals.hh @@ -66,22 +66,6 @@ struct EnergyPlusData; namespace DataGlobals { - // Data - // -only module should be available to other modules and routines. - // Thus, all variables in this module must be PUBLIC. - - extern Real64 const KelvinConv; // Conversion factor for C to K and K to C - extern Real64 const InitConvTemp; // [deg C], standard init vol to mass flow conversion temp - extern Real64 const AutoCalculate; // automatically calculate some fields. - extern Real64 const CWInitConvTemp; // [deg C], standard init chilled water vol to mass flow conversion temp - extern Real64 const HWInitConvTemp; // [deg C], standard init hot water vol to mass flow conversion temp - extern Real64 const SteamInitConvTemp; // [deg C], standard init steam vol to mass flow conversion temp - - extern Real64 const StefanBoltzmann; // Stefan-Boltzmann constant in W/(m2*K4) - extern Real64 const UniversalGasConst; // (J/mol*K) - - extern Real64 const convertJtoGJ; // Conversion factor for J to GJ - // Parameters for EMS Calling Points extern int const emsCallFromZoneSizing; // Identity where EMS called from extern int const emsCallFromSystemSizing; // Identity where EMS called from diff --git a/src/EnergyPlus/DataHeatBalance.cc b/src/EnergyPlus/DataHeatBalance.cc index 70e85b380e5..bb6d240d51e 100644 --- a/src/EnergyPlus/DataHeatBalance.cc +++ b/src/EnergyPlus/DataHeatBalance.cc @@ -92,7 +92,6 @@ namespace DataHeatBalance { // SolarShading, etc. Modules. // Using/Aliasing - using DataGlobals::AutoCalculate; using DataSurfaces::MaxSlatAngs; using namespace DataVectorTypes; using DataBSDFWindow::BSDFLayerAbsorpStruct; diff --git a/src/EnergyPlus/DataHeatBalance.hh b/src/EnergyPlus/DataHeatBalance.hh index da7b7dee390..4b32e9c1895 100644 --- a/src/EnergyPlus/DataHeatBalance.hh +++ b/src/EnergyPlus/DataHeatBalance.hh @@ -79,7 +79,6 @@ namespace DataHeatBalance { using DataComplexFenestration::GapSupportPillar; using DataComplexFenestration::WindowComplexShade; using DataComplexFenestration::WindowThermalModelParams; - using DataGlobals::AutoCalculate; using DataSurfaces::MaxSlatAngs; using DataVectorTypes::Vector; @@ -787,8 +786,8 @@ namespace DataHeatBalance { // Default Constructor ZoneData() - : Multiplier(1), ListMultiplier(1), ListGroup(0), RelNorth(0.0), OriginX(0.0), OriginY(0.0), OriginZ(0.0), CeilingHeight(AutoCalculate), - Volume(AutoCalculate), OfType(1), UserEnteredFloorArea(AutoCalculate), FloorArea(0.0), CalcFloorArea(0.0), CeilingArea(0.0), + : Multiplier(1), ListMultiplier(1), ListGroup(0), RelNorth(0.0), OriginX(0.0), OriginY(0.0), OriginZ(0.0), CeilingHeight(DataGlobalConstants::AutoCalculate()), + Volume(DataGlobalConstants::AutoCalculate()), OfType(1), UserEnteredFloorArea(DataGlobalConstants::AutoCalculate()), FloorArea(0.0), CalcFloorArea(0.0), CeilingArea(0.0), HasFloor(false), HasRoof(false), HasInterZoneWindow(false), HasWindow(false), AirCapacity(0.0), ExtWindowArea(0.0), ExtGrossWallArea(0.0), ExtWindowArea_Multiplied(0.0), ExtGrossWallArea_Multiplied(0.0), ExtNetWallArea(0.0), TotalSurfArea(0.0), ExteriorTotalSurfArea(0.0), ExteriorTotalGroundSurfArea(0.0), ExtGrossGroundWallArea(0.0), ExtGrossGroundWallArea_Multiplied(0.0), diff --git a/src/EnergyPlus/DataSurfaces.cc b/src/EnergyPlus/DataSurfaces.cc index ac8659e4692..c743a18dfdc 100644 --- a/src/EnergyPlus/DataSurfaces.cc +++ b/src/EnergyPlus/DataSurfaces.cc @@ -961,7 +961,7 @@ namespace DataSurfaces { value = SurfWinIRfromParentZone(ExtBoundCond) + QHTRadSysSurf(ExtBoundCond) + QHWBaseboardSurf(ExtBoundCond) + QSteamBaseboardSurf(ExtBoundCond) + QElecBaseboardSurf(ExtBoundCond); } else { - Real64 tout = getOutsideAirTemperature(t_SurfNum) + KelvinConv; + Real64 tout = getOutsideAirTemperature(t_SurfNum) + DataGlobalConstants::KelvinConv(); value = state.dataWindowManager->sigma * pow_4(tout); value = ViewFactorSkyIR * (AirSkyRadSplit(t_SurfNum) * state.dataWindowManager->sigma * pow_4(SkyTempKelvin) + (1.0 - AirSkyRadSplit(t_SurfNum)) * value) + ViewFactorGroundIR * value; diff --git a/src/EnergyPlus/DesiccantDehumidifiers.cc b/src/EnergyPlus/DesiccantDehumidifiers.cc index fc1f8622609..ccb71b088a1 100644 --- a/src/EnergyPlus/DesiccantDehumidifiers.cc +++ b/src/EnergyPlus/DesiccantDehumidifiers.cc @@ -1789,7 +1789,7 @@ namespace DesiccantDehumidifiers { if (DesicDehum(DesicDehumNum).MaxCoilFluidFlow > 0.0) { FluidDensity = GetDensityGlycol(state, PlantLoop(DesicDehum(DesicDehumNum).LoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(DesicDehum(DesicDehumNum).LoopNum).FluidIndex, initCBVAV); DesicDehum(DesicDehumNum).MaxCoilFluidFlow *= FluidDensity; @@ -1914,7 +1914,7 @@ namespace DesiccantDehumidifiers { if (CoilMaxVolFlowRate != AutoSize) { FluidDensity = GetDensityGlycol(state, PlantLoop(DesicDehum(DesicDehumNum).LoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(DesicDehum(DesicDehumNum).LoopNum).FluidIndex, RoutineName); DesicDehum(DesicDehumNum).MaxCoilFluidFlow = CoilMaxVolFlowRate * FluidDensity; diff --git a/src/EnergyPlus/EcoRoofManager.cc b/src/EnergyPlus/EcoRoofManager.cc index 6435a1e2e64..23c009f8f43 100644 --- a/src/EnergyPlus/EcoRoofManager.cc +++ b/src/EnergyPlus/EcoRoofManager.cc @@ -465,8 +465,8 @@ namespace EcoRoofManager { Qsoilpart2 = state.dataConstruction->Construct(ConstrNum).CTFOutside(0) - F1temp * state.dataConstruction->Construct(ConstrNum).CTFCross(0); Pa = StdBaroPress; // standard atmospheric pressure (apparently in Pascals) - Tgk = Tg + KelvinConv; - Tak = Ta + KelvinConv; + Tgk = Tg + DataGlobalConstants::KelvinConv(); + Tak = Ta + DataGlobalConstants::KelvinConv(); sigmaf = 0.9 - 0.7 * std::exp(-0.75 * LAI); // Fractional veg cover based on (2) from FASST TR-04-25 // Formula for grasses modified to incorporate limits from @@ -481,9 +481,9 @@ namespace EcoRoofManager { // Air Temperature within the canopy is given as // (Deardorff (1987)). Kelvin. based of the previous temperatures - Tafk = (1.0 - sigmaf) * Tak + sigmaf * (0.3 * Tak + 0.6 * (Tif + KelvinConv) + 0.1 * Tgk); + Tafk = (1.0 - sigmaf) * Tak + sigmaf * (0.3 * Tak + 0.6 * (Tif + DataGlobalConstants::KelvinConv()) + 0.1 * Tgk); - Taf = Tafk - KelvinConv; // Air Temperature within canopy in Celcius (C). + Taf = Tafk - DataGlobalConstants::KelvinConv(); // Air Temperature within canopy in Celcius (C). Rhof = Pa / (Rair * Tafk); // Density of air at the leaf temperature Rhoaf = (Rhoa + Rhof) / 2.0; // Average of air density Zd = 0.701 * std::pow(Zf, 0.979); // Zero displacement height @@ -502,9 +502,9 @@ namespace EcoRoofManager { // These parameters were taken from "The Atm Boundary Layer", By J.R. Garratt // NOTE the Garratt eqn. (A21) gives esf in units of hPA so we have multiplied // the constant 6.112 by a factor of 100. - esf = 611.2 * std::exp(17.67 * Tif / (Tif + KelvinConv - 29.65)); + esf = 611.2 * std::exp(17.67 * Tif / (Tif + DataGlobalConstants::KelvinConv() - 29.65)); - // From Garratt - eqn. A21, p284. Note that Tif and Tif+KelvinConv usage is correct. + // From Garratt - eqn. A21, p284. Note that Tif and Tif+DataGlobalConstants::KelvinConv() usage is correct. // Saturation specific humidity at leaf temperature again based on previous temperatures qsf = 0.622 * esf / (Pa - 1.000 * esf); // "The Atm Boundary Layer", J.R Garrat for Saturation mixing ratio @@ -538,19 +538,19 @@ namespace EcoRoofManager { // Latent heat of vaporation at leaf surface temperature. The source of this // equation is Henderson-Sellers (1984) - Lef = 1.91846e6 * pow_2((Tif + KelvinConv) / (Tif + KelvinConv - 33.91)); + Lef = 1.91846e6 * pow_2((Tif + DataGlobalConstants::KelvinConv()) / (Tif + DataGlobalConstants::KelvinConv() - 33.91)); // Check to see if ice is sublimating or frost is forming. if (Tfold < 0.0) Lef = 2.838e6; // per FASST documentation p.15 after eqn. 37. // Derivative of Saturation vapor pressure, which is used in the calculation of // derivative of saturation specific humidity. - Desf = 611.2 * std::exp(17.67 * (Tf / (Tf + KelvinConv - 29.65))) * - (17.67 * Tf * (-1.0) * std::pow(Tf + KelvinConv - 29.65, -2) + 17.67 / (KelvinConv - 29.65 + Tf)); + Desf = 611.2 * std::exp(17.67 * (Tf / (Tf + DataGlobalConstants::KelvinConv() - 29.65))) * + (17.67 * Tf * (-1.0) * std::pow(Tf + DataGlobalConstants::KelvinConv() - 29.65, -2) + 17.67 / (DataGlobalConstants::KelvinConv() - 29.65 + Tf)); dqf = ((0.622 * Pa) / pow_2(Pa - esf)) * Desf; // Derivative of saturation specific humidity - esg = 611.2 * std::exp(17.67 * (Tg / ((Tg + KelvinConv) - 29.65))); // Pa saturation vapor pressure + esg = 611.2 * std::exp(17.67 * (Tg / ((Tg + DataGlobalConstants::KelvinConv()) - 29.65))); // Pa saturation vapor pressure // From Garratt - eqn. A21, p284. - // Note that Tg and Tg+KelvinConv usage is correct. + // Note that Tg and Tg+DataGlobalConstants::KelvinConv() usage is correct. qsg = 0.622 * esg / (Pa - esg); // Saturation mixing ratio at ground surface temperature. // Latent heat vaporization at the ground temperature @@ -558,8 +558,8 @@ namespace EcoRoofManager { // Check to see if ice is sublimating or frost is forming. if (Tgold < 0.0) Leg = 2.838e6; // per FASST documentation p.15 after eqn. 37. - Desg = 611.2 * std::exp(17.67 * (Tg / (Tg + KelvinConv - 29.65))) * - (17.67 * Tg * (-1.0) * std::pow(Tg + KelvinConv - 29.65, -2) + 17.67 / (KelvinConv - 29.65 + Tg)); + Desg = 611.2 * std::exp(17.67 * (Tg / (Tg + DataGlobalConstants::KelvinConv() - 29.65))) * + (17.67 * Tg * (-1.0) * std::pow(Tg + DataGlobalConstants::KelvinConv() - 29.65, -2) + 17.67 / (DataGlobalConstants::KelvinConv() - 29.65 + Tg)); dqg = (0.622 * Pa / pow_2(Pa - esg)) * Desg; // Final Ground Atmosphere Energy Balance @@ -630,13 +630,13 @@ namespace EcoRoofManager { // revisit this issue later. // Implement an iterative solution scheme to solve the simultaneous equations for Leaf and Soil temperature. // Prior experience suggests that no more than 3 iterations are likely needed - LeafTK = Tf + KelvinConv; - SoilTK = Tg + KelvinConv; + LeafTK = Tf + DataGlobalConstants::KelvinConv(); + SoilTK = Tg + DataGlobalConstants::KelvinConv(); for (EcoLoop = 1; EcoLoop <= 3; ++EcoLoop) { P1 = sigmaf * (RS * (1.0 - Alphaf) + epsilonf * Latm) - 3.0 * sigmaf * epsilonf * epsilong * Sigma * pow_4(SoilTK) / EpsilonOne - 3.0 * (-sigmaf * epsilonf * Sigma - sigmaf * epsilonf * epsilong * Sigma / EpsilonOne) * pow_4(LeafTK) + - sheatf * (1.0 - 0.7 * sigmaf) * (Ta + KelvinConv) + LAI * Rhoaf * Cf * Lef * Waf * rn * ((1.0 - 0.7 * sigmaf) / dOne) * qa + + sheatf * (1.0 - 0.7 * sigmaf) * (Ta + DataGlobalConstants::KelvinConv()) + LAI * Rhoaf * Cf * Lef * Waf * rn * ((1.0 - 0.7 * sigmaf) / dOne) * qa + LAI * Rhoaf * Cf * Lef * Waf * rn * (((0.6 * sigmaf * rn) / dOne) - 1.0) * (qsf - LeafTK * dqf) + LAI * Rhoaf * Cf * Lef * Waf * rn * ((0.1 * sigmaf * Mg) / dOne) * (qsg - SoilTK * dqg); P2 = 4.0 * (sigmaf * epsilonf * epsilong * Sigma) * pow_3(SoilTK) / EpsilonOne + 0.1 * sigmaf * sheatf + @@ -652,10 +652,10 @@ namespace EcoRoofManager { T1G = (1.0 - sigmaf) * (RS * (1.0 - Alphag) + epsilong * Latm) - (3.0 * (sigmaf * epsilonf * epsilong * Sigma) / EpsilonOne) * pow_4(LeafTK) - 3.0 * (-(1.0 - sigmaf) * epsilong * Sigma - sigmaf * epsilonf * epsilong * Sigma / EpsilonOne) * pow_4(SoilTK) + - sheatg * (1.0 - 0.7 * sigmaf) * (Ta + KelvinConv) + Rhoag * Ce * Leg * Waf * Mg * ((1.0 - 0.7 * sigmaf) / dOne) * qa + + sheatg * (1.0 - 0.7 * sigmaf) * (Ta + DataGlobalConstants::KelvinConv()) + Rhoag * Ce * Leg * Waf * Mg * ((1.0 - 0.7 * sigmaf) / dOne) * qa + Rhoag * Ce * Leg * Waf * Mg * (0.1 * sigmaf * Mg / dOne - Mg) * (qsg - SoilTK * dqg) + Rhoag * Ce * Leg * Waf * Mg * (0.6 * sigmaf * rn / dOne) * (qsf - LeafTK * dqf) + Qsoilpart1 + - Qsoilpart2 * (KelvinConv); // finished by T1G + Qsoilpart2 * (DataGlobalConstants::KelvinConv()); // finished by T1G T2G = 4.0 * (-(1.0 - sigmaf) * epsilong * Sigma - sigmaf * epsilonf * epsilong * Sigma / EpsilonOne) * pow_3(SoilTK) + (0.1 * sigmaf - 1.0) * sheatg + Rhoag * Ce * Leg * Waf * Mg * (0.1 * sigmaf * Mg / dOne - Mg) * dqg - Qsoilpart2; @@ -673,9 +673,9 @@ namespace EcoRoofManager { // difference scheme this loop structure should be removed. } // This loop does an iterative solution of the simultaneous equations - Qsoil = -1.0 * (Qsoilpart1 - Qsoilpart2 * (SoilTK - KelvinConv)); // This is heat flux INTO top of the soil - Tfold = LeafTK - KelvinConv; - Tgold = SoilTK - KelvinConv; + Qsoil = -1.0 * (Qsoilpart1 - Qsoilpart2 * (SoilTK - DataGlobalConstants::KelvinConv())); // This is heat flux INTO top of the soil + Tfold = LeafTK - DataGlobalConstants::KelvinConv(); + Tgold = SoilTK - DataGlobalConstants::KelvinConv(); } // if firstecosurface (if not we do NOT need to recalculate ecoroof energybalance as all ecoroof surfaces MUST be the same // this endif was moved here from the if statement regarding whether we are looking at the first ecoroof surface or not. diff --git a/src/EnergyPlus/EvaporativeFluidCoolers.cc b/src/EnergyPlus/EvaporativeFluidCoolers.cc index 71cfefba85c..2d3457466a1 100644 --- a/src/EnergyPlus/EvaporativeFluidCoolers.cc +++ b/src/EnergyPlus/EvaporativeFluidCoolers.cc @@ -1120,7 +1120,7 @@ namespace EvaporativeFluidCoolers { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->LoopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->LoopNum).FluidIndex, RoutineName); this->DesWaterMassFlowRate = this->DesignWaterFlowRate * rho; @@ -1263,7 +1263,7 @@ namespace EvaporativeFluidCoolers { if (PltSizCondNum > 0) { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->LoopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->LoopNum).FluidIndex, CalledFrom); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, @@ -1334,7 +1334,7 @@ namespace EvaporativeFluidCoolers { if (DataSizing::PlantSizData(PltSizCondNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->LoopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->LoopNum).FluidIndex, CalledFrom); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, @@ -1432,7 +1432,7 @@ namespace EvaporativeFluidCoolers { } Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->LoopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->LoopNum).FluidIndex, CalledFrom); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, @@ -1546,7 +1546,7 @@ namespace EvaporativeFluidCoolers { // predefined factor was 1.25 W heat rejection per W of delivered cooling, now a user input with 1.25 default Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->LoopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->LoopNum).FluidIndex, CalledFrom); Real64 Cp = FluidProperties::GetSpecificHeatGlycol( @@ -1613,7 +1613,7 @@ namespace EvaporativeFluidCoolers { if (this->DesignWaterFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->LoopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->LoopNum).FluidIndex, CalledFrom); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, @@ -1755,7 +1755,7 @@ namespace EvaporativeFluidCoolers { // predefined factor was 1.25 W heat rejection per W of delivered cooling, now user input with default 1.25 Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->LoopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->LoopNum).FluidIndex, CalledFrom); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, @@ -1808,7 +1808,7 @@ namespace EvaporativeFluidCoolers { if (this->DesignWaterFlowRate >= DataHVACGlobals::SmallWaterVolFlow && this->LowSpeedUserSpecifiedDesignCapacity > 0.0) { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->LoopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->LoopNum).FluidIndex, CalledFrom); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, @@ -2280,9 +2280,9 @@ namespace EvaporativeFluidCoolers { OutletAirWetBulb = InletAirWetBulb + qActual / AirCapacity; // Check error tolerance and exit if satisfied DeltaTwb = std::abs(OutletAirWetBulb - InletAirWetBulb); - // Add KelvinConv to denominator below convert OutletAirWetBulbLast to Kelvin to avoid divide by zero. + // Add DataGlobalConstants::KelvinConv() to denominator below convert OutletAirWetBulbLast to Kelvin to avoid divide by zero. // Wet bulb error units are delta K/K - WetBulbError = std::abs((OutletAirWetBulb - OutletAirWetBulbLast) / (OutletAirWetBulbLast + DataGlobals::KelvinConv)); + WetBulbError = std::abs((OutletAirWetBulb - OutletAirWetBulbLast) / (OutletAirWetBulbLast + DataGlobalConstants::KelvinConv())); } if (qActual >= 0.0) { diff --git a/src/EnergyPlus/FanCoilUnits.cc b/src/EnergyPlus/FanCoilUnits.cc index d7576951bfb..6e4be0a2dd1 100644 --- a/src/EnergyPlus/FanCoilUnits.cc +++ b/src/EnergyPlus/FanCoilUnits.cc @@ -1269,7 +1269,7 @@ namespace FanCoilUnits { if (FanCoil(FanCoilNum).HCoilType_Num == HCoil_Water) { rho = GetDensityGlycol(state, PlantLoop(FanCoil(FanCoilNum).HeatCoilLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(FanCoil(FanCoilNum).HeatCoilLoopNum).FluidIndex, RoutineName); FanCoil(FanCoilNum).MaxHeatCoilFluidFlow = rho * FanCoil(FanCoilNum).MaxHotWaterVolFlow; @@ -1278,7 +1278,7 @@ namespace FanCoilUnits { rho = GetDensityGlycol(state, PlantLoop(FanCoil(FanCoilNum).CoolCoilLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), PlantLoop(FanCoil(FanCoilNum).CoolCoilLoopNum).FluidIndex, RoutineName); FanCoil(FanCoilNum).MaxCoolCoilFluidFlow = rho * FanCoil(FanCoilNum).MaxColdWaterVolFlow; @@ -1886,12 +1886,12 @@ namespace FanCoilUnits { if (DesCoilLoad >= SmallLoad) { rho = GetDensityGlycol(state, PlantLoop(FanCoil(FanCoilNum).HeatCoilLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(FanCoil(FanCoilNum).HeatCoilLoopNum).FluidIndex, RoutineNameNoSpace); Cp = GetSpecificHeatGlycol(state, PlantLoop(FanCoil(FanCoilNum).HeatCoilLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(FanCoil(FanCoilNum).HeatCoilLoopNum).FluidIndex, RoutineNameNoSpace); diff --git a/src/EnergyPlus/Fans.cc b/src/EnergyPlus/Fans.cc index 8a307eec003..97ce2a11482 100644 --- a/src/EnergyPlus/Fans.cc +++ b/src/EnergyPlus/Fans.cc @@ -1272,7 +1272,7 @@ namespace Fans { // StdRhoAir=PsyRhoAirFnPbTdbW(StdBaroPress,20,0) // From PsychRoutines: // w=MAX(dw,1.0d-5) - // rhoair = pb/(287.d0*(tdb+KelvinConv)*(1.0d0+1.6077687d0*w)) + // rhoair = pb/(287.d0*(tdb+DataGlobalConstants::KelvinConv())*(1.0d0+1.6077687d0*w)) RhoAir = StdRhoAir; // Adjust max fan volumetric airflow using fan sizing factor @@ -2321,7 +2321,7 @@ namespace Fans { // StdRhoAir=PsyRhoAirFnPbTdbW(StdBaroPress,20,0) // From PsychRoutines: // w=MAX(dw,1.0d-5) - // rhoair = pb/(287.d0*(tdb+KelvinConv)*(1.0d0+1.6077687d0*w)) + // rhoair = pb/(287.d0*(tdb+DataGlobalConstants::KelvinConv())*(1.0d0+1.6077687d0*w)) RhoAir = Fan(FanNum).RhoAirStdInit; MassFlow = min(Fan(FanNum).InletAirMassFlowRate, Fan(FanNum).MaxAirMassFlowRate); diff --git a/src/EnergyPlus/FluidCoolers.cc b/src/EnergyPlus/FluidCoolers.cc index 0b999f2e248..bc94af4d18f 100644 --- a/src/EnergyPlus/FluidCoolers.cc +++ b/src/EnergyPlus/FluidCoolers.cc @@ -733,7 +733,7 @@ namespace FluidCoolers { Real64 const rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->LoopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->LoopNum).FluidIndex, RoutineName); this->DesWaterMassFlowRate = this->DesignWaterFlowRate * rho; @@ -871,7 +871,7 @@ namespace FluidCoolers { if (PltSizCondNum > 0) { rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->LoopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->LoopNum).FluidIndex, CalledFrom); Cp = FluidProperties::GetSpecificHeatGlycol(state, @@ -914,7 +914,7 @@ namespace FluidCoolers { } rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->LoopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->LoopNum).FluidIndex, CalledFrom); Cp = FluidProperties::GetSpecificHeatGlycol(state, @@ -987,7 +987,7 @@ namespace FluidCoolers { } rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->LoopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->LoopNum).FluidIndex, CalledFrom); Cp = FluidProperties::GetSpecificHeatGlycol(state, @@ -1052,7 +1052,7 @@ namespace FluidCoolers { } rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->LoopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->LoopNum).FluidIndex, CalledFrom); Cp = FluidProperties::GetSpecificHeatGlycol(state, @@ -1159,7 +1159,7 @@ namespace FluidCoolers { if (this->DesignWaterFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->LoopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->LoopNum).FluidIndex, CalledFrom); Cp = FluidProperties::GetSpecificHeatGlycol(state, @@ -1311,7 +1311,7 @@ namespace FluidCoolers { if (this->DesignWaterFlowRate >= DataHVACGlobals::SmallWaterVolFlow && this->FluidCoolerLowSpeedNomCap > 0.0) { rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->LoopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->LoopNum).FluidIndex, CalledFrom); Cp = FluidProperties::GetSpecificHeatGlycol(state, diff --git a/src/EnergyPlus/FuelCellElectricGenerator.cc b/src/EnergyPlus/FuelCellElectricGenerator.cc index a939bad68c5..09ff4a7202b 100644 --- a/src/EnergyPlus/FuelCellElectricGenerator.cc +++ b/src/EnergyPlus/FuelCellElectricGenerator.cc @@ -2119,8 +2119,8 @@ namespace FuelCellElectricGenerator { Real64 tempCp = 0.0; - Real64 const Tkel = (FluidTemp + DataGlobals::KelvinConv); // temp for NASA eq. in Kelvin - Real64 const Tsho = (FluidTemp + DataGlobals::KelvinConv) / 1000.0; // temp for Shomate eq in (Kelvin/1000) + Real64 const Tkel = (FluidTemp + DataGlobalConstants::KelvinConv()); // temp for NASA eq. in Kelvin + Real64 const Tsho = (FluidTemp + DataGlobalConstants::KelvinConv()) / 1000.0; // temp for Shomate eq in (Kelvin/1000) Real64 const pow_2_Tsho(pow_2(Tsho)); Real64 const pow_3_Tsho(pow_3(Tsho)); @@ -2192,8 +2192,8 @@ namespace FuelCellElectricGenerator { Real64 A5; // NASA poly coeff Real64 A6; // NASA poly coeff - Real64 const Tsho = (FluidTemp + DataGlobals::KelvinConv) / 1000.0; // temp for Shomate eq in (Kelvin/1000) - Real64 const Tkel = (FluidTemp + DataGlobals::KelvinConv); // temp for NASA eq. in Kelvin + Real64 const Tsho = (FluidTemp + DataGlobalConstants::KelvinConv()) / 1000.0; // temp for Shomate eq in (Kelvin/1000) + Real64 const Tkel = (FluidTemp + DataGlobalConstants::KelvinConv()); // temp for NASA eq. in Kelvin // loop through fuel constituents and sum up Cp @@ -2272,8 +2272,8 @@ namespace FuelCellElectricGenerator { Real64 A4; // NASA poly coeff Real64 A5; // NASA poly coeff - Real64 const Tsho = (FluidTemp + DataGlobals::KelvinConv) / 1000.0; // temp for Shomate eq in (Kelvin/1000) - Real64 const Tkel = (FluidTemp + DataGlobals::KelvinConv); // temp for NASA eq. in Kelvin + Real64 const Tsho = (FluidTemp + DataGlobalConstants::KelvinConv()) / 1000.0; // temp for Shomate eq in (Kelvin/1000) + Real64 const Tkel = (FluidTemp + DataGlobalConstants::KelvinConv()); // temp for NASA eq. in Kelvin // loop through fuel constituents and sum up Cp @@ -2349,8 +2349,8 @@ namespace FuelCellElectricGenerator { Real64 A5; // NASA poly coeff Real64 A6; // NASA poly coeff - Real64 const Tsho = (FluidTemp + DataGlobals::KelvinConv) / 1000.0; // temp for Shomate eq in (Kelvin/1000) - Real64 const Tkel = (FluidTemp + DataGlobals::KelvinConv); // temp for NASA eq. in Kelvin + Real64 const Tsho = (FluidTemp + DataGlobalConstants::KelvinConv()) / 1000.0; // temp for Shomate eq in (Kelvin/1000) + Real64 const Tkel = (FluidTemp + DataGlobalConstants::KelvinConv()); // temp for NASA eq. in Kelvin // loop through fuel constituents and sum up Cp @@ -2432,8 +2432,8 @@ namespace FuelCellElectricGenerator { Real64 A5; // NASA poly coeff Real64 A6; // NASA poly coeff - Real64 const Tsho = (FluidTemp + DataGlobals::KelvinConv) / 1000.0; // temp for Shomate eq in (Kelvin/1000) - Real64 const Tkel = (FluidTemp + DataGlobals::KelvinConv); // temp for NASA eq. in Kelvin + Real64 const Tsho = (FluidTemp + DataGlobalConstants::KelvinConv()) / 1000.0; // temp for Shomate eq in (Kelvin/1000) + Real64 const Tkel = (FluidTemp + DataGlobalConstants::KelvinConv()); // temp for NASA eq. in Kelvin // loop through fuel constituents and sum up Cp @@ -2501,8 +2501,8 @@ namespace FuelCellElectricGenerator { Real64 A4; // NASA poly coeff Real64 A5; // NASA poly coeff - Real64 const Tsho = (FluidTemp + DataGlobals::KelvinConv) / 1000.0; // temp for Shomate eq in (Kelvin/1000) - Real64 const Tkel = (FluidTemp + DataGlobals::KelvinConv); // temp for NASA eq. in Kelvin + Real64 const Tsho = (FluidTemp + DataGlobalConstants::KelvinConv()) / 1000.0; // temp for Shomate eq in (Kelvin/1000) + Real64 const Tkel = (FluidTemp + DataGlobalConstants::KelvinConv()); // temp for NASA eq. in Kelvin // loop through fuel constituents and sum up Cp @@ -2565,8 +2565,8 @@ namespace FuelCellElectricGenerator { Real64 A4; // NASA poly coeff Real64 A5; // NASA poly coeff - Real64 const Tsho = (FluidTemp + DataGlobals::KelvinConv) / 1000.0; // temp for Shomate eq in (Kelvin/1000) - Real64 const Tkel = (FluidTemp + DataGlobals::KelvinConv); // temp for NASA eq. in Kelvin + Real64 const Tsho = (FluidTemp + DataGlobalConstants::KelvinConv()) / 1000.0; // temp for Shomate eq in (Kelvin/1000) + Real64 const Tkel = (FluidTemp + DataGlobalConstants::KelvinConv()); // temp for NASA eq. in Kelvin // loop through fuel constituents and sum up Cp @@ -2632,7 +2632,7 @@ namespace FuelCellElectricGenerator { Real64 const D = -0.95914; // shomate coeff Real64 const E = 0.11725; // shomate coeff Real64 const F = -250.569; // shomate coeff - Real64 const Tsho = (FluidTemp + DataGlobals::KelvinConv) / 1000.0; // temp for Shomate eq in (Kelvin/1000) + Real64 const Tsho = (FluidTemp + DataGlobalConstants::KelvinConv()) / 1000.0; // temp for Shomate eq in (Kelvin/1000) HGasWater = A * Tsho + B * pow_2(Tsho) / 2.0 + C * pow_3(Tsho) / 3.0 + D * pow_4(Tsho) / 4.0 - E / Tsho + F; //- H } @@ -2662,7 +2662,7 @@ namespace FuelCellElectricGenerator { Real64 const E = 3.85533; // shomate coeff Real64 const F = -256.5478; // shomate coeff - Real64 const Tsho = (FluidTemp + DataGlobals::KelvinConv) / 1000.0; // temp for Shomate eq in (Kelvin/1000) + Real64 const Tsho = (FluidTemp + DataGlobalConstants::KelvinConv()) / 1000.0; // temp for Shomate eq in (Kelvin/1000) HLiqWater = A * Tsho + B * pow_2(Tsho) / 2.0 + C * pow_3(Tsho) / 3.0 + D * pow_4(Tsho) / 4.0 - E / Tsho + F; //- H } @@ -2686,7 +2686,7 @@ namespace FuelCellElectricGenerator { Real64 const C = -3196.413; // shomate coeff Real64 const D = 2474.455; // shomate coeff Real64 const E = 3.85533; // shomate coeff - Real64 const Tsho = (FluidTemp + DataGlobals::KelvinConv) / 1000.0; + Real64 const Tsho = (FluidTemp + DataGlobalConstants::KelvinConv()) / 1000.0; Cp = A + B * Tsho + C * pow_2(Tsho) + D * pow_3(Tsho) + E / pow_2(Tsho); } diff --git a/src/EnergyPlus/Furnaces.cc b/src/EnergyPlus/Furnaces.cc index b095b11d651..82461547b93 100644 --- a/src/EnergyPlus/Furnaces.cc +++ b/src/EnergyPlus/Furnaces.cc @@ -4991,7 +4991,7 @@ namespace Furnaces { if (Furnace(FurnaceNum).MaxHeatCoilFluidFlow > 0.0) { rho = GetDensityGlycol(state, PlantLoop(Furnace(FurnaceNum).LoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(Furnace(FurnaceNum).LoopNum).FluidIndex, RoutineName); Furnace(FurnaceNum).MaxHeatCoilFluidFlow *= rho; @@ -5063,7 +5063,7 @@ namespace Furnaces { if (Furnace(FurnaceNum).MaxSuppCoilFluidFlow > 0.0) { rho = GetDensityGlycol(state, PlantLoop(Furnace(FurnaceNum).LoopNumSupp).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(Furnace(FurnaceNum).LoopNumSupp).FluidIndex, RoutineName); Furnace(FurnaceNum).MaxSuppCoilFluidFlow *= rho; @@ -5136,7 +5136,7 @@ namespace Furnaces { CoilMaxVolFlowRate = GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", Furnace(FurnaceNum).HeatingCoilName, ErrorsFound); if (CoilMaxVolFlowRate != AutoSize) { rho = GetDensityGlycol(state, PlantLoop(Furnace(FurnaceNum).LoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(Furnace(FurnaceNum).LoopNum).FluidIndex, RoutineName); Furnace(FurnaceNum).MaxHeatCoilFluidFlow = CoilMaxVolFlowRate * rho; @@ -5177,7 +5177,7 @@ namespace Furnaces { if (CoilMaxVolFlowRate != AutoSize) { rho = GetDensityGlycol(state, PlantLoop(Furnace(FurnaceNum).LoopNumSupp).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(Furnace(FurnaceNum).LoopNumSupp).FluidIndex, RoutineName); Furnace(FurnaceNum).MaxSuppCoilFluidFlow = CoilMaxVolFlowRate * rho; diff --git a/src/EnergyPlus/GeneralRoutines.cc b/src/EnergyPlus/GeneralRoutines.cc index efb13820ca5..16495764e7d 100644 --- a/src/EnergyPlus/GeneralRoutines.cc +++ b/src/EnergyPlus/GeneralRoutines.cc @@ -1059,7 +1059,6 @@ void CalcPassiveExteriorBaffleGap(EnergyPlusData &state, Real64 const nu(15.66e-6); // kinematic viscosity (m**2/s) for air at 300 K (Mills 1999 Heat Transfer) Real64 const k(0.0267); // thermal conductivity (W/m K) for air at 300 K (Mills 1999 Heat Transfer) Real64 const Sigma(5.6697e-08); // Stefan-Boltzmann constant - Real64 const KelvinConv(273.15); // Conversion from Celsius to Kelvin static std::string const RoutineName("CalcPassiveExteriorBaffleGap"); // INTERFACE BLOCK SPECIFICATIONS: @@ -1155,8 +1154,8 @@ void CalcPassiveExteriorBaffleGap(EnergyPlusData &state, InitExteriorConvectionCoeff(state, SurfPtr, HMovInsul, Roughness, AbsExt, TmpTsBaf, HExtARR(ThisSurf), HSkyARR(ThisSurf), HGroundARR(ThisSurf), HAirARR(ThisSurf)); ConstrNum = Surface(SurfPtr).Construction; AbsThermSurf = dataMaterial.Material(state.dataConstruction->Construct(ConstrNum).LayerPoint(1)).AbsorpThermal; - TsoK = TH(1, 1, SurfPtr) + KelvinConv; - TsBaffK = TmpTsBaf + KelvinConv; + TsoK = TH(1, 1, SurfPtr) + DataGlobalConstants::KelvinConv(); + TsBaffK = TmpTsBaf + DataGlobalConstants::KelvinConv(); if (TsBaffK == TsoK) { // avoid divide by zero HPlenARR(ThisSurf) = 0.0; // no net heat transfer if same temperature } else { @@ -1219,7 +1218,7 @@ void CalcPassiveExteriorBaffleGap(EnergyPlusData &state, // Isc = sum( QRadSWOutIncident( SurfPtrARR ) * Surface( SurfPtrARR ).Area ) / A; //Autodesk:F2C++ Array subscript usage: Replaced by below Isc = sum_product_sub(QRadSWOutIncident, Surface, &SurfaceData::Area, SurfPtrARR) / A; // Autodesk:F2C++ Functions handle array subscript usage - TmeanK = 0.5 * (TmpTsBaf + Tso) + KelvinConv; + TmeanK = 0.5 * (TmpTsBaf + Tso) + DataGlobalConstants::KelvinConv(); Gr = g * pow_3(GapThick) * std::abs(Tso - TmpTsBaf) * pow_2(RhoAir) / (TmeanK * pow_2(nu)); @@ -1231,14 +1230,14 @@ void CalcPassiveExteriorBaffleGap(EnergyPlusData &state, VdotWind = Cv * (VentArea / 2.0) * Vwind; if (TaGap > Tamb) { - VdotThermal = Cd * (VentArea / 2.0) * std::sqrt(2.0 * g * HdeltaNPL * (TaGap - Tamb) / (TaGap + KelvinConv)); + VdotThermal = Cd * (VentArea / 2.0) * std::sqrt(2.0 * g * HdeltaNPL * (TaGap - Tamb) / (TaGap + DataGlobalConstants::KelvinConv())); } else if (TaGap == Tamb) { VdotThermal = 0.0; } else { if ((std::abs(Tilt) < 5.0) || (std::abs(Tilt - 180.0) < 5.0)) { VdotThermal = 0.0; // stable bouyancy situation } else { - VdotThermal = Cd * (VentArea / 2.0) * std::sqrt(2.0 * g * HdeltaNPL * (Tamb - TaGap) / (Tamb + KelvinConv)); + VdotThermal = Cd * (VentArea / 2.0) * std::sqrt(2.0 * g * HdeltaNPL * (Tamb - TaGap) / (Tamb + DataGlobalConstants::KelvinConv())); } } diff --git a/src/EnergyPlus/HVACControllers.cc b/src/EnergyPlus/HVACControllers.cc index c25e8a24ba8..93b7476d41d 100644 --- a/src/EnergyPlus/HVACControllers.cc +++ b/src/EnergyPlus/HVACControllers.cc @@ -1193,7 +1193,7 @@ namespace HVACControllers { rho = GetDensityGlycol(state, PlantLoop(ControllerProps(ControlNum).ActuatedNodePlantLoopNum).FluidName, - CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), PlantLoop(ControllerProps(ControlNum).ActuatedNodePlantLoopNum).FluidIndex, RoutineName); diff --git a/src/EnergyPlus/HVACCooledBeam.cc b/src/EnergyPlus/HVACCooledBeam.cc index a67b3f59561..a292b6d32be 100644 --- a/src/EnergyPlus/HVACCooledBeam.cc +++ b/src/EnergyPlus/HVACCooledBeam.cc @@ -590,7 +590,7 @@ namespace HVACCooledBeam { InWaterNode = CoolBeam(CBNum).CWInNode; OutWaterNode = CoolBeam(CBNum).CWOutNode; rho = GetDensityGlycol(state, PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidIndex, RoutineName); CoolBeam(CBNum).MaxCoolWaterMassFlow = rho * CoolBeam(CBNum).MaxCoolWaterVolFlow; @@ -695,7 +695,6 @@ namespace HVACCooledBeam { // Using/Aliasing using namespace DataSizing; - using DataGlobals::AutoCalculate; using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; @@ -736,7 +735,7 @@ namespace HVACCooledBeam { MyPlantSizingIndex("cooled beam unit", CoolBeam(CBNum).Name, CoolBeam(CBNum).CWInNode, CoolBeam(CBNum).CWOutNode, ErrorsFound); } - if (CoolBeam(CBNum).Kin == AutoCalculate) { + if (CoolBeam(CBNum).Kin == DataGlobalConstants::AutoCalculate()) { if (CoolBeam(CBNum).CBType_Num == Passive_Cooled_Beam) { CoolBeam(CBNum).Kin = 0.0; } else { @@ -785,13 +784,13 @@ namespace HVACCooledBeam { rho = GetDensityGlycol(state, PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidIndex, RoutineName); Cp = GetSpecificHeatGlycol(state, PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidIndex, RoutineName); @@ -820,7 +819,7 @@ namespace HVACCooledBeam { if (CoolBeam(CBNum).NumBeams == AutoSize) { rho = GetDensityGlycol(state, PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidIndex, RoutineName); @@ -838,13 +837,13 @@ namespace HVACCooledBeam { if (PltSizCoolNum > 0) { rho = GetDensityGlycol(state, PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidIndex, RoutineName); Cp = GetSpecificHeatGlycol(state, PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidIndex, RoutineName); DesCoilLoad = diff --git a/src/EnergyPlus/HVACFourPipeBeam.cc b/src/EnergyPlus/HVACFourPipeBeam.cc index 0f4b7039a31..0392642c8f5 100644 --- a/src/EnergyPlus/HVACFourPipeBeam.cc +++ b/src/EnergyPlus/HVACFourPipeBeam.cc @@ -957,7 +957,7 @@ namespace FourPipeBeam { if (this->beamCoolingPresent) { rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->cWLocation.loopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->cWLocation.loopNum).FluidIndex, routineName); this->mDotNormRatedCW = this->vDotNormRatedCW * rho; @@ -974,7 +974,7 @@ namespace FourPipeBeam { if (this->beamHeatingPresent) { rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->hWLocation.loopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(this->hWLocation.loopNum).FluidIndex, routineName); this->mDotNormRatedHW = this->vDotNormRatedHW * rho; @@ -1032,7 +1032,7 @@ namespace FourPipeBeam { this->vDotDesignCW = this->vDotNormRatedCW * this->totBeamLength; rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->cWLocation.loopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->cWLocation.loopNum).FluidIndex, routineName); this->mDotNormRatedCW = this->vDotNormRatedCW * rho; @@ -1052,7 +1052,7 @@ namespace FourPipeBeam { this->vDotDesignHW = this->vDotNormRatedHW * this->totBeamLength; rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->hWLocation.loopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(this->hWLocation.loopNum).FluidIndex, routineName); this->mDotNormRatedHW = this->vDotNormRatedHW * rho; diff --git a/src/EnergyPlus/HVACMultiSpeedHeatPump.cc b/src/EnergyPlus/HVACMultiSpeedHeatPump.cc index 5da3bc5da35..e6f4f190b22 100644 --- a/src/EnergyPlus/HVACMultiSpeedHeatPump.cc +++ b/src/EnergyPlus/HVACMultiSpeedHeatPump.cc @@ -1364,7 +1364,7 @@ namespace HVACMultiSpeedHeatPump { MSHeatPump(MSHPNum).DesignHeatRecFlowRate = Numbers(6); if (MSHeatPump(MSHPNum).DesignHeatRecFlowRate > 0.0) { MSHeatPump(MSHPNum).HeatRecActive = true; - MSHeatPump(MSHPNum).DesignHeatRecMassFlowRate = RhoH2O(DataGlobals::HWInitConvTemp) * MSHeatPump(MSHPNum).DesignHeatRecFlowRate; + MSHeatPump(MSHPNum).DesignHeatRecMassFlowRate = RhoH2O(DataGlobalConstants::HWInitConvTemp()) * MSHeatPump(MSHPNum).DesignHeatRecFlowRate; MSHeatPump(MSHPNum).HeatRecInletNodeNum = GetOnlySingleNode(state, Alphas(16), ErrorsFound, CurrentModuleObject, Alphas(1), NodeType_Water, NodeConnectionType_Inlet, 3, ObjectIsNotParent); if (MSHeatPump(MSHPNum).HeatRecInletNodeNum == 0) { @@ -1912,7 +1912,7 @@ namespace HVACMultiSpeedHeatPump { if (MSHeatPump(MSHeatPumpNum).MaxCoilFluidFlow > 0.0) { rho = GetDensityGlycol(state, PlantLoop(MSHeatPump(MSHeatPumpNum).LoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(MSHeatPump(MSHeatPumpNum).LoopNum).FluidIndex, RoutineName); MSHeatPump(MSHeatPumpNum).MaxCoilFluidFlow = @@ -1983,7 +1983,7 @@ namespace HVACMultiSpeedHeatPump { if (MSHeatPump(MSHeatPumpNum).MaxSuppCoilFluidFlow > 0.0) { rho = GetDensityGlycol(state, PlantLoop(MSHeatPump(MSHeatPumpNum).SuppLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(MSHeatPump(MSHeatPumpNum).SuppLoopNum).FluidIndex, RoutineName); MSHeatPump(MSHeatPumpNum).MaxSuppCoilFluidFlow = @@ -2138,7 +2138,7 @@ namespace HVACMultiSpeedHeatPump { rho = GetDensityGlycol(state, PlantLoop(MSHeatPump(MSHeatPumpNum).HRLoopNum).FluidName, - HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(MSHeatPump(MSHeatPumpNum).HRLoopNum).FluidIndex, RoutineName); @@ -2163,7 +2163,7 @@ namespace HVACMultiSpeedHeatPump { if (CoilMaxVolFlowRate != AutoSize) { rho = GetDensityGlycol(state, PlantLoop(MSHeatPump(MSHeatPumpNum).LoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(MSHeatPump(MSHeatPumpNum).LoopNum).FluidIndex, RoutineName); MSHeatPump(MSHeatPumpNum).MaxCoilFluidFlow = CoilMaxVolFlowRate * rho; @@ -2213,7 +2213,7 @@ namespace HVACMultiSpeedHeatPump { if (CoilMaxVolFlowRate != AutoSize) { rho = GetDensityGlycol(state, PlantLoop(MSHeatPump(MSHeatPumpNum).SuppLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(MSHeatPump(MSHeatPumpNum).SuppLoopNum).FluidIndex, RoutineName); MSHeatPump(MSHeatPumpNum).MaxSuppCoilFluidFlow = CoilMaxVolFlowRate * rho; diff --git a/src/EnergyPlus/HVACSingleDuctInduc.cc b/src/EnergyPlus/HVACSingleDuctInduc.cc index c8f85db7399..afa0f98c003 100644 --- a/src/EnergyPlus/HVACSingleDuctInduc.cc +++ b/src/EnergyPlus/HVACSingleDuctInduc.cc @@ -665,7 +665,7 @@ namespace HVACSingleDuctInduc { rho = GetDensityGlycol(state, PlantLoop(IndUnit(IUNum).HWLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(IndUnit(IUNum).HWLoopNum).FluidIndex, RoutineName); IndUnit(IUNum).MaxHotWaterFlow = rho * IndUnit(IUNum).MaxVolHotWaterFlow; @@ -690,7 +690,7 @@ namespace HVACSingleDuctInduc { if (ColdConNode > 0) { rho = GetDensityGlycol(state, PlantLoop(IndUnit(IUNum).CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), PlantLoop(IndUnit(IUNum).CWLoopNum).FluidIndex, RoutineName); IndUnit(IUNum).MaxColdWaterFlow = rho * IndUnit(IUNum).MaxVolColdWaterFlow; @@ -909,13 +909,13 @@ namespace HVACSingleDuctInduc { } IndUnit(IUNum).DesHeatingLoad = DesCoilLoad; Cp = GetSpecificHeatGlycol(state, PlantLoop(IndUnit(IUNum).HWLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(IndUnit(IUNum).HWLoopNum).FluidIndex, RoutineName); rho = GetDensityGlycol(state, PlantLoop(IndUnit(IUNum).HWLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(IndUnit(IUNum).HWLoopNum).FluidIndex, RoutineName); diff --git a/src/EnergyPlus/HVACSizingSimulationManager.cc b/src/EnergyPlus/HVACSizingSimulationManager.cc index bec24f499da..2a97c41a975 100644 --- a/src/EnergyPlus/HVACSizingSimulationManager.cc +++ b/src/EnergyPlus/HVACSizingSimulationManager.cc @@ -112,9 +112,9 @@ void HVACSizingSimulationManager::CreateNewCoincidentPlantAnalysisObject(EnergyP if (PlantLoopName == PlantLoop(i).Name) { // found it density = GetDensityGlycol( - state, PlantLoop(i).FluidName, DataGlobals::CWInitConvTemp, PlantLoop(i).FluidIndex, "createNewCoincidentPlantAnalysisObject"); + state, PlantLoop(i).FluidName, DataGlobalConstants::CWInitConvTemp(), PlantLoop(i).FluidIndex, "createNewCoincidentPlantAnalysisObject"); cp = GetSpecificHeatGlycol( - state, PlantLoop(i).FluidName, DataGlobals::CWInitConvTemp, PlantLoop(i).FluidIndex, "createNewCoincidentPlantAnalysisObject"); + state, PlantLoop(i).FluidName, DataGlobalConstants::CWInitConvTemp(), PlantLoop(i).FluidIndex, "createNewCoincidentPlantAnalysisObject"); plantCoincAnalyObjs.emplace_back(PlantLoopName, i, diff --git a/src/EnergyPlus/HVACUnitaryBypassVAV.cc b/src/EnergyPlus/HVACUnitaryBypassVAV.cc index ebb2ae99524..314be853727 100644 --- a/src/EnergyPlus/HVACUnitaryBypassVAV.cc +++ b/src/EnergyPlus/HVACUnitaryBypassVAV.cc @@ -1487,7 +1487,7 @@ namespace HVACUnitaryBypassVAV { if (CBVAV(CBVAVNum).MaxHeatCoilFluidFlow > 0.0) { Real64 FluidDensity = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(CBVAV(CBVAVNum).LoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(CBVAV(CBVAVNum).LoopNum).FluidIndex, RoutineName); CBVAV(CBVAVNum).MaxHeatCoilFluidFlow = @@ -1597,7 +1597,7 @@ namespace HVACUnitaryBypassVAV { if (CoilMaxVolFlowRate != DataSizing::AutoSize) { Real64 FluidDensity = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(CBVAV(CBVAVNum).LoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(CBVAV(CBVAVNum).LoopNum).FluidIndex, RoutineName); CBVAV(CBVAVNum).MaxHeatCoilFluidFlow = CoilMaxVolFlowRate * FluidDensity; diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index 26bda42249e..3db2e0bcd26 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -5231,7 +5231,7 @@ namespace HVACVariableRefrigerantFlow { if (VRFTU(VRFTUNum).SuppHeatCoilFluidMaxFlow > 0.0) { rho = GetDensityGlycol(state, PlantLoop(VRFTU(VRFTUNum).SuppHeatCoilLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(VRFTU(VRFTUNum).SuppHeatCoilLoopNum).FluidIndex, RoutineName); VRFTU(VRFTUNum).SuppHeatCoilFluidMaxFlow = VRFTU(VRFTUNum).SuppHeatCoilFluidMaxFlow * rho; @@ -5958,7 +5958,8 @@ namespace HVACVariableRefrigerantFlow { if (VRF(VRFCond).CondenserType == DataHVACGlobals::WaterCooled) { rho = GetDensityGlycol( - state, PlantLoop(VRF(VRFCond).SourceLoopNum).FluidName, CWInitConvTemp, PlantLoop(VRF(VRFCond).SourceLoopNum).FluidIndex, RoutineName); + state, PlantLoop(VRF(VRFCond).SourceLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp(), + PlantLoop(VRF(VRFCond).SourceLoopNum).FluidIndex, RoutineName); VRF(VRFCond).WaterCondenserDesignMassFlow = VRF(VRFCond).WaterCondVolFlowRate * rho; InitComponentNodes(0.0, @@ -5988,7 +5989,7 @@ namespace HVACVariableRefrigerantFlow { if (CoilMaxVolFlowRate != DataSizing::AutoSize) { rho = GetDensityGlycol(state, PlantLoop(VRFTU(VRFTUNum).SuppHeatCoilLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(VRFTU(VRFTUNum).SuppHeatCoilLoopNum).FluidIndex, RoutineName); VRFTU(VRFTUNum).SuppHeatCoilFluidMaxFlow = CoilMaxVolFlowRate * rho; @@ -8181,7 +8182,7 @@ namespace HVACVariableRefrigerantFlow { } rho = FluidProperties::GetDensityGlycol( - state, PlantLoop(this->SourceLoopNum).FluidName, CWInitConvTemp, PlantLoop(this->SourceLoopNum).FluidIndex, RoutineName); + state, PlantLoop(this->SourceLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp(), PlantLoop(this->SourceLoopNum).FluidIndex, RoutineName); this->WaterCondenserDesignMassFlow = this->WaterCondVolFlowRate * rho; PlantUtilities::InitComponentNodes(0.0, this->WaterCondenserDesignMassFlow, diff --git a/src/EnergyPlus/HWBaseboardRadiator.cc b/src/EnergyPlus/HWBaseboardRadiator.cc index 67354adc4e1..88c517714ec 100644 --- a/src/EnergyPlus/HWBaseboardRadiator.cc +++ b/src/EnergyPlus/HWBaseboardRadiator.cc @@ -856,7 +856,7 @@ namespace HWBaseboardRadiator { rho = GetDensityGlycol(state, PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidIndex, RoutineName); @@ -1089,12 +1089,12 @@ namespace HWBaseboardRadiator { if (DesCoilLoad >= SmallLoad) { Cp = GetSpecificHeatGlycol(state, PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidName, - HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidIndex, RoutineName); rho = GetDensityGlycol(state, PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidName, - HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidIndex, RoutineName); WaterVolFlowRateMaxDes = DesCoilLoad / (PlantSizData(PltSizHeatNum).DeltaT * Cp * rho); @@ -1142,7 +1142,7 @@ namespace HWBaseboardRadiator { DesCoilLoad = RatedCapacityDes; rho = GetDensityGlycol(state, PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidIndex, RoutineNameFull); WaterMassFlowRateStd = HWBaseboard(BaseboardNum).WaterVolFlowRateMax * rho; diff --git a/src/EnergyPlus/HeatBalFiniteDiffManager.cc b/src/EnergyPlus/HeatBalFiniteDiffManager.cc index eeb6b539f0c..89ebce7d407 100644 --- a/src/EnergyPlus/HeatBalFiniteDiffManager.cc +++ b/src/EnergyPlus/HeatBalFiniteDiffManager.cc @@ -100,7 +100,6 @@ namespace HeatBalFiniteDiffManager { using DataGlobals::DayOfSim; using DataGlobals::DisplayExtraWarnings; using DataGlobals::HourOfDay; - using DataGlobals::KelvinConv; using DataGlobals::NumOfTimeStepInHour; using DataGlobals::TimeStep; using DataGlobals::TimeStepZoneSec; diff --git a/src/EnergyPlus/HeatBalanceAirManager.cc b/src/EnergyPlus/HeatBalanceAirManager.cc index 58bce271680..5aabbc43b32 100644 --- a/src/EnergyPlus/HeatBalanceAirManager.cc +++ b/src/EnergyPlus/HeatBalanceAirManager.cc @@ -1971,7 +1971,7 @@ namespace HeatBalanceAirManager { } Ventilation(VentiCount).OpenEff = rNumericArgs(2); - if (Ventilation(VentiCount).OpenEff != AutoCalculate && + if (Ventilation(VentiCount).OpenEff != DataGlobalConstants::AutoCalculate() && (Ventilation(VentiCount).OpenEff < 0.0 || Ventilation(VentiCount).OpenEff > 1.0)) { ShowSevereError(RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(2) + " must be between 0 and 1."); @@ -1992,7 +1992,7 @@ namespace HeatBalanceAirManager { } Ventilation(VentiCount).DiscCoef = rNumericArgs(5); - if (Ventilation(VentiCount).DiscCoef != AutoCalculate && + if (Ventilation(VentiCount).DiscCoef != DataGlobalConstants::AutoCalculate() && (Ventilation(VentiCount).DiscCoef < 0.0 || Ventilation(VentiCount).DiscCoef > 1.0)) { ShowSevereError(RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(5) + " must be between 0 and 1."); diff --git a/src/EnergyPlus/HeatBalanceHAMTManager.cc b/src/EnergyPlus/HeatBalanceHAMTManager.cc index 55d092bcecd..71263a1b13f 100644 --- a/src/EnergyPlus/HeatBalanceHAMTManager.cc +++ b/src/EnergyPlus/HeatBalanceHAMTManager.cc @@ -1524,7 +1524,7 @@ namespace HeatBalanceHAMTManager { TempSurfInP = cells(Intcell(sid)).rhp1 * PsyPsatFnTemp(cells(Intcell(sid)).tempp1); - RhoVaporSurfIn(sid) = TempSurfInP / (461.52 * (MAT(Surface(sid).Zone) + KelvinConv)); + RhoVaporSurfIn(sid) = TempSurfInP / (461.52 * (MAT(Surface(sid).Zone) + DataGlobalConstants::KelvinConv())); } void UpdateHeatBalHAMT(int const sid) @@ -1754,7 +1754,7 @@ namespace HeatBalanceHAMTManager { // FUNCTION LOCAL VARIABLE DECLARATIONS: // na - WVDC = (2.e-7 * std::pow(Temperature + KelvinConv, 0.81)) / ambp; + WVDC = (2.e-7 * std::pow(Temperature + DataGlobalConstants::KelvinConv(), 0.81)) / ambp; return WVDC; } diff --git a/src/EnergyPlus/HeatBalanceIntRadExchange.cc b/src/EnergyPlus/HeatBalanceIntRadExchange.cc index f84f434ddb5..69ec0f3b617 100644 --- a/src/EnergyPlus/HeatBalanceIntRadExchange.cc +++ b/src/EnergyPlus/HeatBalanceIntRadExchange.cc @@ -344,7 +344,7 @@ namespace HeatBalanceIntRadExchange { // If the window is bare this TS and it is the first time through we use the previous TS glass // temperature whether or not the window was shaded in the previous TS. If the window was shaded // the previous time step this temperature is a better starting value than the shade temperature. - SurfaceTempRad[ZoneSurfNum] = surface_window.ThetaFace(2 * construct.TotGlassLayers) - KelvinConv; + SurfaceTempRad[ZoneSurfNum] = surface_window.ThetaFace(2 * construct.TotGlassLayers) - DataGlobalConstants::KelvinConv(); SurfaceEmiss[ZoneSurfNum] = construct.InsideAbsorpThermal; // For windows with an interior shade or blind an effective inside surface temp // and emiss is used here that is a weighted combination of shade/blind and glass temp and emiss. @@ -364,12 +364,12 @@ namespace HeatBalanceIntRadExchange { CarrollMRTNumerator += SurfaceTempRad[ZoneSurfNum]*zone_info.Fp[ZoneSurfNum]*zone_info.Area[ZoneSurfNum]; CarrollMRTDenominator += zone_info.Fp[ZoneSurfNum]*zone_info.Area[ZoneSurfNum]; } - SurfaceTempInKto4th[ZoneSurfNum] = pow_4(SurfaceTempRad[ZoneSurfNum] + KelvinConv); + SurfaceTempInKto4th[ZoneSurfNum] = pow_4(SurfaceTempRad[ZoneSurfNum] + DataGlobalConstants::KelvinConv()); } if (CarrollMethod) { if (CarrollMRTDenominator > 0.0) { - CarrollMRTInKTo4th = pow_4(CarrollMRTNumerator/CarrollMRTDenominator + KelvinConv); + CarrollMRTInKTo4th = pow_4(CarrollMRTNumerator/CarrollMRTDenominator + DataGlobalConstants::KelvinConv()); } else { // Likely only one surface in this enclosure CarrollMRTInKTo4th = 293.15; // arbitrary value, IR will be zero @@ -397,7 +397,7 @@ namespace HeatBalanceIntRadExchange { } } if (CarrollMRTDenominatorWin > 0.0) { - CarrollMRTInKTo4thWin = pow_4(CarrollMRTNumeratorWin / CarrollMRTDenominatorWin + KelvinConv); + CarrollMRTInKTo4thWin = pow_4(CarrollMRTNumeratorWin / CarrollMRTDenominatorWin + DataGlobalConstants::KelvinConv()); } SurfWinIRfromParentZone(RecSurfNum) += (zone_info.Fp[RecZoneSurfNum] * CarrollMRTInKTo4thWin) / SurfaceEmiss[RecZoneSurfNum]; } @@ -2010,7 +2010,7 @@ namespace HeatBalanceIntRadExchange { Array1D &Fp // VECTOR OF OPPENHEIM RESISTANCE VALUES ) { - Real64 SB = DataGlobals::StefanBoltzmann; + Real64 SB = DataGlobalConstants::StefanBoltzmann(); for (int iS = 0; iS < N; iS++) { Fp[iS] = SB*EMISS[iS]/(EMISS[iS]/FMRT[iS] + 1. - EMISS[iS]); // actually sigma * } diff --git a/src/EnergyPlus/HeatBalanceKivaManager.cc b/src/EnergyPlus/HeatBalanceKivaManager.cc index c56d55f7692..8043147d923 100644 --- a/src/EnergyPlus/HeatBalanceKivaManager.cc +++ b/src/EnergyPlus/HeatBalanceKivaManager.cc @@ -216,7 +216,7 @@ namespace HeatBalanceKivaManager { std::shared_ptr bcs = instance.bcs; - bcs->outdoorTemp = kivaWeather.dryBulb[index] * weightNow + kivaWeather.dryBulb[indexPrev] * (1.0 - weightNow) + DataGlobals::KelvinConv; + bcs->outdoorTemp = kivaWeather.dryBulb[index] * weightNow + kivaWeather.dryBulb[indexPrev] * (1.0 - weightNow) + DataGlobalConstants::KelvinConv(); bcs->localWindSpeed = (kivaWeather.windSpeed[index] * weightNow + kivaWeather.windSpeed[indexPrev] * (1.0 - weightNow)) * DataEnvironment::WeatherFileWindModCoeff * @@ -228,7 +228,7 @@ namespace HeatBalanceKivaManager { bcs->diffuseHorizontalFlux = 0.0; bcs->slabAbsRadiation = 0.0; bcs->wallAbsRadiation = 0.0; - bcs->deepGroundTemperature = kivaWeather.annualAverageDrybulbTemp + DataGlobals::KelvinConv; + bcs->deepGroundTemperature = kivaWeather.annualAverageDrybulbTemp + DataGlobalConstants::KelvinConv(); // Estimate indoor temperature static const Real64 defaultFlagTemp = -999; // default sets this below -999 at -9999 so uses value if entered @@ -238,11 +238,11 @@ namespace HeatBalanceKivaManager { Real64 Tin; if (zoneAssumedTemperature > defaultFlagTemp) { - Tin = zoneAssumedTemperature + DataGlobals::KelvinConv; + Tin = zoneAssumedTemperature + DataGlobalConstants::KelvinConv(); } else { switch (zoneControlType) { case KIVAZONE_UNCONTROLLED: { - Tin = assumedFloatingTemp + DataGlobals::KelvinConv; + Tin = assumedFloatingTemp + DataGlobalConstants::KelvinConv(); break; } case KIVAZONE_TEMPCONTROL: { @@ -252,7 +252,7 @@ namespace HeatBalanceKivaManager { if (controlType == 0) { // Uncontrolled - Tin = assumedFloatingTemp + DataGlobals::KelvinConv; + Tin = assumedFloatingTemp + DataGlobalConstants::KelvinConv(); } else if (controlType == DataHVACGlobals::SingleHeatingSetPoint) { @@ -260,7 +260,7 @@ namespace HeatBalanceKivaManager { int schTypeId = DataZoneControls::TempControlledZone(zoneControlNum).ControlTypeSchIndx(schNameId); int spSchId = state.dataZoneTempPredictorCorrector->SetPointSingleHeating(schTypeId).TempSchedIndex; Real64 setpoint = ScheduleManager::LookUpScheduleValue(state, spSchId, hour, timestep); - Tin = setpoint + DataGlobals::KelvinConv; + Tin = setpoint + DataGlobalConstants::KelvinConv(); } else if (controlType == DataHVACGlobals::SingleCoolingSetPoint) { @@ -268,7 +268,7 @@ namespace HeatBalanceKivaManager { int schTypeId = DataZoneControls::TempControlledZone(zoneControlNum).ControlTypeSchIndx(schNameId); int spSchId = state.dataZoneTempPredictorCorrector->SetPointSingleCooling(schTypeId).TempSchedIndex; Real64 setpoint = ScheduleManager::LookUpScheduleValue(state, spSchId, hour, timestep); - Tin = setpoint + DataGlobals::KelvinConv; + Tin = setpoint + DataGlobalConstants::KelvinConv(); } else if (controlType == DataHVACGlobals::SingleHeatCoolSetPoint) { @@ -276,7 +276,7 @@ namespace HeatBalanceKivaManager { int schTypeId = DataZoneControls::TempControlledZone(zoneControlNum).ControlTypeSchIndx(schNameId); int spSchId = state.dataZoneTempPredictorCorrector->SetPointSingleHeatCool(schTypeId).TempSchedIndex; Real64 setpoint = ScheduleManager::LookUpScheduleValue(state, spSchId, hour, timestep); - Tin = setpoint + DataGlobals::KelvinConv; + Tin = setpoint + DataGlobalConstants::KelvinConv(); } else if (controlType == DataHVACGlobals::DualSetPointWithDeadBand) { @@ -290,12 +290,12 @@ namespace HeatBalanceKivaManager { const Real64 coolBalanceTemp = 15.0; // (assumed) degC if (bcs->outdoorTemp < heatBalanceTemp) { - Tin = heatSetpoint + DataGlobals::KelvinConv; + Tin = heatSetpoint + DataGlobalConstants::KelvinConv(); } else if (bcs->outdoorTemp > coolBalanceTemp) { - Tin = coolSetpoint + DataGlobals::KelvinConv; + Tin = coolSetpoint + DataGlobalConstants::KelvinConv(); } else { Real64 weight = (coolBalanceTemp - bcs->outdoorTemp) / (coolBalanceTemp - heatBalanceTemp); - Tin = heatSetpoint * weight + coolSetpoint * (1.0 - weight) + DataGlobals::KelvinConv; + Tin = heatSetpoint * weight + coolSetpoint * (1.0 - weight) + DataGlobalConstants::KelvinConv(); } } else { @@ -308,7 +308,7 @@ namespace HeatBalanceKivaManager { } case KIVAZONE_COMFORTCONTROL: { - Tin = standardTemp + DataGlobals::KelvinConv; + Tin = standardTemp + DataGlobalConstants::KelvinConv(); break; } case KIVAZONE_STAGEDCONTROL: { @@ -320,18 +320,18 @@ namespace HeatBalanceKivaManager { const Real64 heatBalanceTemp = 10.0; // (assumed) degC const Real64 coolBalanceTemp = 15.0; // (assumed) degC if (bcs->outdoorTemp < heatBalanceTemp) { - Tin = heatSetpoint + DataGlobals::KelvinConv; + Tin = heatSetpoint + DataGlobalConstants::KelvinConv(); } else if (bcs->outdoorTemp > coolBalanceTemp) { - Tin = coolSetpoint + DataGlobals::KelvinConv; + Tin = coolSetpoint + DataGlobalConstants::KelvinConv(); } else { Real64 weight = (coolBalanceTemp - bcs->outdoorTemp) / (coolBalanceTemp - heatBalanceTemp); - Tin = heatSetpoint * weight + coolSetpoint * (1.0 - weight) + DataGlobals::KelvinConv; + Tin = heatSetpoint * weight + coolSetpoint * (1.0 - weight) + DataGlobalConstants::KelvinConv(); } break; } default: { // error? - Tin = assumedFloatingTemp + DataGlobals::KelvinConv; + Tin = assumedFloatingTemp + DataGlobalConstants::KelvinConv(); break; } } @@ -361,7 +361,7 @@ namespace HeatBalanceKivaManager { std::shared_ptr bcs = instance.bcs; - bcs->outdoorTemp = DataEnvironment::OutDryBulbTemp + DataGlobals::KelvinConv; + bcs->outdoorTemp = DataEnvironment::OutDryBulbTemp + DataGlobalConstants::KelvinConv(); bcs->localWindSpeed = DataEnvironment::WindSpeedAt(instance.ground->foundation.grade.roughness); bcs->windDirection = DataEnvironment::WindDir * DataGlobalConstants::DegToRadians(); bcs->solarAzimuth = std::atan2(DataEnvironment::SOLCOS(1), DataEnvironment::SOLCOS(2)); @@ -376,8 +376,8 @@ namespace HeatBalanceKivaManager { DataHeatBalFanSys::QCoolingPanelSurf(floorSurface) + DataHeatBalFanSys::QSteamBaseboardSurf(floorSurface) + DataHeatBalFanSys::QElecBaseboardSurf(floorSurface); // HVAC - bcs->slabConvectiveTemp = DataHeatBalance::TempEffBulkAir(floorSurface) + DataGlobals::KelvinConv; - bcs->slabRadiantTemp = ThermalComfort::CalcSurfaceWeightedMRT(state, zoneNum, floorSurface) + DataGlobals::KelvinConv; + bcs->slabConvectiveTemp = DataHeatBalance::TempEffBulkAir(floorSurface) + DataGlobalConstants::KelvinConv(); + bcs->slabRadiantTemp = ThermalComfort::CalcSurfaceWeightedMRT(state, zoneNum, floorSurface) + DataGlobalConstants::KelvinConv(); bcs->gradeForcedTerm = kmPtr->surfaceConvMap[floorSurface].f; bcs->gradeConvectionAlgorithm = kmPtr->surfaceConvMap[floorSurface].out; bcs->slabConvectionAlgorithm = kmPtr->surfaceConvMap[floorSurface].in; @@ -408,8 +408,8 @@ namespace HeatBalanceKivaManager { if (Atotal > 0.0) { bcs->wallAbsRadiation = QAtotal / Atotal; - bcs->wallRadiantTemp = TARadTotal / Atotal + DataGlobals::KelvinConv; - bcs->wallConvectiveTemp = TAConvTotal / Atotal + DataGlobals::KelvinConv; + bcs->wallRadiantTemp = TARadTotal / Atotal + DataGlobalConstants::KelvinConv(); + bcs->wallConvectiveTemp = TAConvTotal / Atotal + DataGlobalConstants::KelvinConv(); bcs->extWallForcedTerm = kmPtr->surfaceConvMap[wallSurfaces[0]].f; bcs->extWallConvectionAlgorithm = kmPtr->surfaceConvMap[wallSurfaces[0]].out; bcs->intWallConvectionAlgorithm = kmPtr->surfaceConvMap[wallSurfaces[0]].in; @@ -619,9 +619,9 @@ namespace HeatBalanceKivaManager { kivaWeather.windSpeed.push_back(WindSpeed); Real64 OSky = OpaqueSkyCover; - Real64 TDewK = min(DryBulb, DewPoint) + DataGlobals::KelvinConv; + Real64 TDewK = min(DryBulb, DewPoint) + DataGlobalConstants::KelvinConv(); Real64 ESky = - (0.787 + 0.764 * std::log(TDewK / DataGlobals::KelvinConv)) * (1.0 + 0.0224 * OSky - 0.0035 * pow_2(OSky) + 0.00028 * pow_3(OSky)); + (0.787 + 0.764 * std::log(TDewK / DataGlobalConstants::KelvinConv())) * (1.0 + 0.0224 * OSky - 0.0035 * pow_2(OSky) + 0.00028 * pow_3(OSky)); kivaWeather.skyEmissivity.push_back(ESky); diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index 76a9e013e78..0e97428c7d3 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -5148,7 +5148,7 @@ namespace HeatBalanceSurfaceManager { for (int ZoneNum = 1; ZoneNum <= NumOfZones; ++ZoneNum) { Real64 ZoneW = ZoneAirHumRatAvg(ZoneNum); Real64 ZoneT = ZTAV(ZoneNum); - Real64 TDewPointK = Psychrometrics::PsyTdpFnWPb(ZoneW, OutBaroPress) + KelvinConv; + Real64 TDewPointK = Psychrometrics::PsyTdpFnWPb(ZoneW, OutBaroPress) + DataGlobalConstants::KelvinConv(); Real64 e = 6.11 * std::exp(5417.7530 * ((1 / 273.16) - (1 / TDewPointK))); Real64 h = 5.0 / 9.0 * (e - 10.0); Real64 Humidex = ZoneT + h; @@ -6132,13 +6132,13 @@ namespace HeatBalanceSurfaceManager { if (Surface(SurfNum).HasSurroundingSurfProperties) { int SrdSurfsNum = Surface(SurfNum).SurroundingSurfacesNum; // Absolute temperature of the outside surface of an exterior surface - Real64 TSurf = TH(1, 1, SurfNum) + KelvinConv; + Real64 TSurf = TH(1, 1, SurfNum) + DataGlobalConstants::KelvinConv(); for (int SrdSurfNum = 1; SrdSurfNum <= SurroundingSurfsProperty(SrdSurfsNum).TotSurroundingSurface; SrdSurfNum++) { // View factor of a surrounding surface Real64 SrdSurfViewFac = SurroundingSurfsProperty(SrdSurfsNum).SurroundingSurfs(SrdSurfNum).ViewFactor; // Absolute temperature of a surrounding surface - Real64 SrdSurfTempAbs = GetCurrentScheduleValue(SurroundingSurfsProperty(SrdSurfsNum).SurroundingSurfs(SrdSurfNum).TempSchNum) + KelvinConv; - QRadLWOutSrdSurfs(SurfNum) += StefanBoltzmann * AbsThermSurf * SrdSurfViewFac * (pow_4(SrdSurfTempAbs) - pow_4(TSurf)); + Real64 SrdSurfTempAbs = GetCurrentScheduleValue(SurroundingSurfsProperty(SrdSurfsNum).SurroundingSurfs(SrdSurfNum).TempSchNum) + DataGlobalConstants::KelvinConv(); + QRadLWOutSrdSurfs(SurfNum) += DataGlobalConstants::StefanBoltzmann() * AbsThermSurf * SrdSurfViewFac * (pow_4(SrdSurfTempAbs) - pow_4(TSurf)); } } @@ -6492,7 +6492,7 @@ namespace HeatBalanceSurfaceManager { if (DataHeatBalance::AnyKiva) { for (auto &kivaSurf : SurfaceGeometry::kivaManager.surfaceMap) { - TempSurfIn(kivaSurf.first) = kivaSurf.second.results.Tavg - DataGlobals::KelvinConv; // TODO: Use average radiant temp? Trad? + TempSurfIn(kivaSurf.first) = kivaSurf.second.results.Tavg - DataGlobalConstants::KelvinConv(); // TODO: Use average radiant temp? Trad? } } @@ -6783,7 +6783,7 @@ namespace HeatBalanceSurfaceManager { } else if (surface.HeatTransferAlgorithm == HeatTransferModel_Kiva) { // Read Kiva results for each surface - TempSurfInTmp(SurfNum) = SurfaceGeometry::kivaManager.surfaceMap[SurfNum].results.Tconv - DataGlobals::KelvinConv; + TempSurfInTmp(SurfNum) = SurfaceGeometry::kivaManager.surfaceMap[SurfNum].results.Tconv - DataGlobalConstants::KelvinConv(); OpaqSurfInsFaceConductionFlux(SurfNum) = SurfaceGeometry::kivaManager.surfaceMap[SurfNum].results.qtot; OpaqSurfInsFaceConduction(SurfNum) = OpaqSurfInsFaceConductionFlux(SurfNum) * DataSurfaces::Surface(SurfNum).Area; @@ -6851,7 +6851,7 @@ namespace HeatBalanceSurfaceManager { // conduction from the outside surface | Coefficient for conduction (current // time) | Convection and damping term - Real64 const Sigma_Temp_4(DataGlobals::StefanBoltzmann * pow_4(TempSurfIn(SurfNum))); + Real64 const Sigma_Temp_4(DataGlobalConstants::StefanBoltzmann() * pow_4(TempSurfIn(SurfNum))); // Calculate window heat gain for TDD:DIFFUSER since this calculation is usually done in WindowManager SurfWinHeatGain(SurfNum) = @@ -7557,7 +7557,7 @@ namespace HeatBalanceSurfaceManager { // conduction from the outside surface | Coefficient for conduction (current // time) | Convection and damping term - Real64 const Sigma_Temp_4(DataGlobals::StefanBoltzmann * pow_4(TempSurfIn(surfNum))); + Real64 const Sigma_Temp_4(DataGlobalConstants::StefanBoltzmann() * pow_4(TempSurfIn(surfNum))); // Calculate window heat gain for TDD:DIFFUSER since this calculation is usually done in WindowManager SurfWinHeatGain(surfNum) = @@ -8249,9 +8249,9 @@ namespace HeatBalanceSurfaceManager { SrdSurfsNum = Surface(SurfNum).SurroundingSurfacesNum; for (SrdSurfNum = 1; SrdSurfNum <= SurroundingSurfsProperty(SrdSurfsNum).TotSurroundingSurface; SrdSurfNum++) { SrdSurfViewFac = SurroundingSurfsProperty(SrdSurfsNum).SurroundingSurfs(SrdSurfNum).ViewFactor; - SrdSurfTempAbs = GetCurrentScheduleValue(SurroundingSurfsProperty(SrdSurfsNum).SurroundingSurfs(SrdSurfNum).TempSchNum) + KelvinConv; - QRadLWOutSrdSurfsRep += StefanBoltzmann * dataMaterial.Material(state.dataConstruction->Construct(ConstrNum).LayerPoint(1)).AbsorpThermal * - SrdSurfViewFac * (pow_4(SrdSurfTempAbs) - pow_4(TH11 + KelvinConv)); + SrdSurfTempAbs = GetCurrentScheduleValue(SurroundingSurfsProperty(SrdSurfsNum).SurroundingSurfs(SrdSurfNum).TempSchNum) + DataGlobalConstants::KelvinConv(); + QRadLWOutSrdSurfsRep += DataGlobalConstants::StefanBoltzmann() * dataMaterial.Material(state.dataConstruction->Construct(ConstrNum).LayerPoint(1)).AbsorpThermal * + SrdSurfViewFac * (pow_4(SrdSurfTempAbs) - pow_4(TH11 + DataGlobalConstants::KelvinConv())); } } QdotRadOutRep(SurfNum) = Surface(SurfNum).Area * HExtSurf_fac + Surface(SurfNum).Area * QRadLWOutSrdSurfsRep; diff --git a/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.cc b/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.cc index 877df05cbc4..0fedd2a0a27 100644 --- a/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.cc +++ b/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.cc @@ -533,7 +533,7 @@ namespace HeatPumpWaterToWaterCOOLING { this->beginEnvironFlag = false; Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->LoadLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->LoadLoopNum).FluidIndex, RoutineName); this->LoadSideDesignMassFlow = this->LoadSideVolFlowRate * rho; @@ -549,7 +549,7 @@ namespace HeatPumpWaterToWaterCOOLING { rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->SourceLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->SourceLoopNum).FluidIndex, RoutineName); this->SourceSideDesignMassFlow = this->SourceSideVolFlowRate * rho; diff --git a/src/EnergyPlus/HeatPumpWaterToWaterHEATING.cc b/src/EnergyPlus/HeatPumpWaterToWaterHEATING.cc index 3d75ce0d10d..6a8e0470ba7 100644 --- a/src/EnergyPlus/HeatPumpWaterToWaterHEATING.cc +++ b/src/EnergyPlus/HeatPumpWaterToWaterHEATING.cc @@ -94,7 +94,6 @@ namespace HeatPumpWaterToWaterHEATING { using DataGlobals::BeginSimFlag; using DataGlobals::DayOfSim; using DataGlobals::HourOfDay; - using DataGlobals::KelvinConv; using DataGlobals::TimeStep; using DataGlobals::TimeStepZone; using DataGlobals::WarmupFlag; @@ -504,7 +503,7 @@ namespace HeatPumpWaterToWaterHEATING { this->beginEnvironFlag = false; Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->LoadLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->LoadLoopNum).FluidIndex, RoutineName); this->LoadSideDesignMassFlow = this->LoadSideVolFlowRate * rho; @@ -520,7 +519,7 @@ namespace HeatPumpWaterToWaterHEATING { rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->SourceLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->SourceLoopNum).FluidIndex, RoutineName); this->SourceSideDesignMassFlow = this->SourceSideVolFlowRate * rho; diff --git a/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc b/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc index 1a13d7f037b..91f368f3185 100644 --- a/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc +++ b/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc @@ -108,7 +108,6 @@ namespace HeatPumpWaterToWaterSimple { using DataGlobals::BeginSimFlag; using DataGlobals::DayOfSim; using DataGlobals::HourOfDay; - using DataGlobals::KelvinConv; using DataGlobals::TimeStep; using DataGlobals::TimeStepZone; using DataGlobals::WarmupFlag; @@ -773,17 +772,17 @@ namespace HeatPumpWaterToWaterSimple { if (this->WWHPPlantTypeOfNum == TypeOf_HPWaterEFHeating) { rho = GetDensityGlycol( - state, PlantLoop(this->LoadLoopNum).FluidName, DataGlobals::HWInitConvTemp, PlantLoop(this->LoadLoopNum).FluidIndex, RoutineName); + state, PlantLoop(this->LoadLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp(), PlantLoop(this->LoadLoopNum).FluidIndex, RoutineName); this->LoadSideDesignMassFlow = this->RatedLoadVolFlowHeat * rho; rho = GetDensityGlycol( - state, PlantLoop(this->SourceLoopNum).FluidName, DataGlobals::CWInitConvTemp, PlantLoop(this->SourceLoopNum).FluidIndex, RoutineName); + state, PlantLoop(this->SourceLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp(), PlantLoop(this->SourceLoopNum).FluidIndex, RoutineName); this->SourceSideDesignMassFlow = this->RatedSourceVolFlowHeat * rho; } else if (this->WWHPPlantTypeOfNum == TypeOf_HPWaterEFCooling) { rho = GetDensityGlycol( - state, PlantLoop(this->LoadLoopNum).FluidName, DataGlobals::CWInitConvTemp, PlantLoop(this->LoadLoopNum).FluidIndex, RoutineName); + state, PlantLoop(this->LoadLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp(), PlantLoop(this->LoadLoopNum).FluidIndex, RoutineName); this->LoadSideDesignMassFlow = this->RatedLoadVolFlowCool * rho; rho = GetDensityGlycol( - state, PlantLoop(this->SourceLoopNum).FluidName, DataGlobals::HWInitConvTemp, PlantLoop(this->SourceLoopNum).FluidIndex, RoutineName); + state, PlantLoop(this->SourceLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp(), PlantLoop(this->SourceLoopNum).FluidIndex, RoutineName); this->SourceSideDesignMassFlow = this->RatedSourceVolFlowCool * rho; } @@ -976,12 +975,12 @@ namespace HeatPumpWaterToWaterSimple { } Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->LoadLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->LoadLoopNum).FluidIndex, RoutineName); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->LoadLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->LoadLoopNum).FluidIndex, RoutineName); tmpCoolingCap = Cp * rho * DataSizing::PlantSizData(pltLoadSizNum).DeltaT * tmpLoadSideVolFlowRate; @@ -989,12 +988,12 @@ namespace HeatPumpWaterToWaterSimple { tmpLoadSideVolFlowRate = this->RatedLoadVolFlowHeat; Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->LoadLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->LoadLoopNum).FluidIndex, RoutineName); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->LoadLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->LoadLoopNum).FluidIndex, RoutineName); tmpCoolingCap = Cp * rho * DataSizing::PlantSizData(pltLoadSizNum).DeltaT * tmpLoadSideVolFlowRate; @@ -1151,12 +1150,12 @@ namespace HeatPumpWaterToWaterSimple { if (pltSourceSizNum > 0) { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->SourceLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->SourceLoopNum).FluidIndex, RoutineName); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->SourceLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->SourceLoopNum).FluidIndex, RoutineName); tmpSourceSideVolFlowRate = tmpCoolingCap * (1.0 + (1.0 / this->refCOP)) / (DataSizing::PlantSizData(pltSourceSizNum).DeltaT * Cp * rho); @@ -1314,12 +1313,12 @@ namespace HeatPumpWaterToWaterSimple { } Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->LoadLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(this->LoadLoopNum).FluidIndex, RoutineName); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->LoadLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(this->LoadLoopNum).FluidIndex, RoutineName); tmpHeatingCap = Cp * rho * DataSizing::PlantSizData(pltLoadSizNum).DeltaT * tmpLoadSideVolFlowRate; @@ -1327,12 +1326,12 @@ namespace HeatPumpWaterToWaterSimple { tmpLoadSideVolFlowRate = this->RatedLoadVolFlowCool; Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->LoadLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(this->LoadLoopNum).FluidIndex, RoutineName); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->LoadLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(this->LoadLoopNum).FluidIndex, RoutineName); tmpHeatingCap = Cp * rho * DataSizing::PlantSizData(pltLoadSizNum).DeltaT * tmpLoadSideVolFlowRate; @@ -1488,12 +1487,12 @@ namespace HeatPumpWaterToWaterSimple { if (pltSourceSizNum > 0) { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->SourceLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(this->SourceLoopNum).FluidIndex, RoutineName); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->SourceLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(this->SourceLoopNum).FluidIndex, RoutineName); tmpSourceSideVolFlowRate = tmpHeatingCap * (1.0 - (1.0 / this->refCOP)) / (DataSizing::PlantSizData(pltSourceSizNum).DeltaT * Cp * rho); @@ -1636,7 +1635,7 @@ namespace HeatPumpWaterToWaterSimple { using FluidProperties::GetSpecificHeatGlycol; // SUBROUTINE PARAMETER DEFINITIONS: - Real64 const CelsiustoKelvin(KelvinConv); // Conversion from Celsius to Kelvin + Real64 const CelsiustoKelvin(DataGlobalConstants::KelvinConv()); // Conversion from Celsius to Kelvin Real64 const Tref(283.15); // Reference Temperature for performance curves,10C [K] static std::string const RoutineName("CalcWatertoWaterHPCooling"); @@ -1818,7 +1817,7 @@ namespace HeatPumpWaterToWaterSimple { using FluidProperties::GetSpecificHeatGlycol; // SUBROUTINE PARAMETER DEFINITIONS: - Real64 const CelsiustoKelvin(KelvinConv); // Conversion from Celsius to Kelvin + Real64 const CelsiustoKelvin(DataGlobalConstants::KelvinConv()); // Conversion from Celsius to Kelvin Real64 const Tref(283.15); // Reference Temperature for performance curves,10C [K] static std::string const RoutineName("CalcWatertoWaterHPHeating"); diff --git a/src/EnergyPlus/Humidifiers.cc b/src/EnergyPlus/Humidifiers.cc index 8c90c8725e9..120c315a993 100644 --- a/src/EnergyPlus/Humidifiers.cc +++ b/src/EnergyPlus/Humidifiers.cc @@ -864,7 +864,7 @@ namespace Humidifiers { } if (!HardSizeNoDesRun) { - NomCapVolDes = MassFlowDes * (OutletHumRatDes - InletHumRatDes) / RhoH2O(DataGlobals::InitConvTemp); + NomCapVolDes = MassFlowDes * (OutletHumRatDes - InletHumRatDes) / RhoH2O(DataGlobalConstants::InitConvTemp()); if (NomCapVolDes < 0.0) NomCapVolDes = 0.0; // No humidity demand if (IsAutoSize) { @@ -894,7 +894,7 @@ namespace Humidifiers { } } - NomCap = RhoH2O(DataGlobals::InitConvTemp) * NomCapVol; + NomCap = RhoH2O(DataGlobalConstants::InitConvTemp()) * NomCapVol; RefrigerantIndex = FindRefrigerant(state, fluidNameSteam); WaterIndex = FindGlycol(state, fluidNameWater); SteamSatEnthalpy = GetSatEnthalpyRefrig(state, fluidNameSteam, TSteam, 1.0, RefrigerantIndex, CalledFrom); @@ -1086,7 +1086,7 @@ namespace Humidifiers { HumRatSatOut = 0.0; HumRatSatApp = 0.0; WaterInEnthalpy = 2676125.0; // At 100 C - WaterDens = RhoH2O(DataGlobals::InitConvTemp); + WaterDens = RhoH2O(DataGlobalConstants::InitConvTemp()); WaterAddNeededMax = min(WaterAddNeeded, NomCap); if (WaterAddNeededMax > 0.0) { // ma*W1 + mw = ma*W2 @@ -1201,7 +1201,7 @@ namespace Humidifiers { HumRatSatOut = 0.0; HumRatSatApp = 0.0; WaterInEnthalpy = 2676125.0; // At 100 C - WaterDens = RhoH2O(DataGlobals::InitConvTemp); + WaterDens = RhoH2O(DataGlobalConstants::InitConvTemp()); WaterAddNeededMax = min(WaterAddNeeded, NomCap); if (WaterAddNeededMax > 0.0) { // ma*W1 + mw = ma*W2 diff --git a/src/EnergyPlus/ICEngineElectricGenerator.cc b/src/EnergyPlus/ICEngineElectricGenerator.cc index e55b1b91793..9ba5f252a00 100644 --- a/src/EnergyPlus/ICEngineElectricGenerator.cc +++ b/src/EnergyPlus/ICEngineElectricGenerator.cc @@ -764,7 +764,7 @@ namespace ICEngineElectricGenerator { // size mass flow rate Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->HRLoopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->HRLoopNum).FluidIndex, RoutineName); diff --git a/src/EnergyPlus/InternalHeatGains.cc b/src/EnergyPlus/InternalHeatGains.cc index c214f5413e3..f3213361c1d 100644 --- a/src/EnergyPlus/InternalHeatGains.cc +++ b/src/EnergyPlus/InternalHeatGains.cc @@ -603,7 +603,7 @@ namespace InternalHeatGains { if (NumNumber >= 5 && !lNumericFieldBlanks(5)) { People(Loop).UserSpecSensFrac = IHGNumbers(5); } else { - People(Loop).UserSpecSensFrac = AutoCalculate; + People(Loop).UserSpecSensFrac = DataGlobalConstants::AutoCalculate(); } if (NumNumber == 6 && !lNumericFieldBlanks(6)) { @@ -4767,7 +4767,7 @@ namespace InternalHeatGains { print(state.files.eio, "{:.3R},", People(Loop).FractionRadiant); print(state.files.eio, "{:.3R},", People(Loop).FractionConvected); - if (People(Loop).UserSpecSensFrac == AutoCalculate) { + if (People(Loop).UserSpecSensFrac == DataGlobalConstants::AutoCalculate()) { print(state.files.eio, "AutoCalculate,"); } else { print(state.files.eio, "{:.3R},", People(Loop).UserSpecSensFrac); @@ -5291,7 +5291,7 @@ namespace InternalHeatGains { ActivityLevel_WperPerson = GetCurrentScheduleValue(People(Loop).ActivityLevelPtr); TotalPeopleGain = NumberOccupants * ActivityLevel_WperPerson; // if the user did not specify a sensible fraction, calculate the sensible heat gain - if (People(Loop).UserSpecSensFrac == AutoCalculate) { + if (People(Loop).UserSpecSensFrac == DataGlobalConstants::AutoCalculate()) { if (!(IsZoneDV(NZ) || IsZoneUI(NZ))) { SensiblePeopleGain = NumberOccupants * (C(1) + ActivityLevel_WperPerson * (C(2) + ActivityLevel_WperPerson * C(3)) + diff --git a/src/EnergyPlus/LowTempRadiantSystem.cc b/src/EnergyPlus/LowTempRadiantSystem.cc index a627f2a4faa..af55f9cd33c 100644 --- a/src/EnergyPlus/LowTempRadiantSystem.cc +++ b/src/EnergyPlus/LowTempRadiantSystem.cc @@ -1961,7 +1961,7 @@ namespace LowTempRadiantSystem { if (HydrRadSys(RadSysNum).HotWaterInNode > 0) { rho = GetDensityGlycol(state, PlantLoop(HydrRadSys(RadSysNum).HWLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(HydrRadSys(RadSysNum).HWLoopNum).FluidIndex, RoutineName); HydrRadSys(RadSysNum).WaterFlowMaxHeat = rho * HydrRadSys(RadSysNum).WaterVolFlowMaxHeat; @@ -1977,7 +1977,7 @@ namespace LowTempRadiantSystem { if (HydrRadSys(RadSysNum).ColdWaterInNode > 0) { rho = GetDensityGlycol(state, PlantLoop(HydrRadSys(RadSysNum).CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), PlantLoop(HydrRadSys(RadSysNum).CWLoopNum).FluidIndex, RoutineName); HydrRadSys(RadSysNum).WaterFlowMaxCool = rho * HydrRadSys(RadSysNum).WaterVolFlowMaxCool; @@ -2002,7 +2002,7 @@ namespace LowTempRadiantSystem { if (CFloRadSys(RadSysNum).HotWaterInNode > 0) { rho = GetDensityGlycol(state, PlantLoop(CFloRadSys(RadSysNum).HWLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(CFloRadSys(RadSysNum).HWLoopNum).FluidIndex, RoutineName); CFloRadSys(RadSysNum).HotDesignWaterMassFlowRate = rho * CFloRadSys(RadSysNum).WaterVolFlowMax; @@ -2018,7 +2018,7 @@ namespace LowTempRadiantSystem { if (CFloRadSys(RadSysNum).ColdWaterInNode > 0) { rho = GetDensityGlycol(state, PlantLoop(CFloRadSys(RadSysNum).CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), PlantLoop(CFloRadSys(RadSysNum).CWLoopNum).FluidIndex, RoutineName); CFloRadSys(RadSysNum).ColdDesignWaterMassFlowRate = rho * CFloRadSys(RadSysNum).WaterVolFlowMax; @@ -2680,12 +2680,12 @@ namespace LowTempRadiantSystem { if (DesCoilLoad >= SmallLoad) { rho = GetDensityGlycol(state, PlantLoop(HydrRadSys(RadSysNum).HWLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(HydrRadSys(RadSysNum).HWLoopNum).FluidIndex, RoutineName); Cp = GetSpecificHeatGlycol(state, PlantLoop(HydrRadSys(RadSysNum).HWLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(HydrRadSys(RadSysNum).HWLoopNum).FluidIndex, RoutineName); WaterVolFlowMaxHeatDes = DesCoilLoad / (PlantSizData(PltSizHeatNum).DeltaT * Cp * rho); @@ -2840,12 +2840,12 @@ namespace LowTempRadiantSystem { if (DesCoilLoad >= SmallLoad) { rho = GetDensityGlycol(state, PlantLoop(HydrRadSys(RadSysNum).CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), PlantLoop(HydrRadSys(RadSysNum).CWLoopNum).FluidIndex, RoutineName); Cp = GetSpecificHeatGlycol(state, PlantLoop(HydrRadSys(RadSysNum).CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), PlantLoop(HydrRadSys(RadSysNum).CWLoopNum).FluidIndex, RoutineName); WaterVolFlowMaxCoolDes = DesCoilLoad / (PlantSizData(PltSizCoolNum).DeltaT * Cp * rho); @@ -2990,12 +2990,12 @@ namespace LowTempRadiantSystem { if (FinalZoneSizing(CurZoneEqNum).NonAirSysDesHeatLoad >= SmallLoad) { rho = GetDensityGlycol(state, PlantLoop(CFloRadSys(RadSysNum).HWLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(CFloRadSys(RadSysNum).HWLoopNum).FluidIndex, "SizeLowTempRadiantSystem"); Cp = GetSpecificHeatGlycol(state, PlantLoop(CFloRadSys(RadSysNum).HWLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(CFloRadSys(RadSysNum).HWLoopNum).FluidIndex, "SizeLowTempRadiantSystem"); WaterVolFlowMaxHeatDes = @@ -3023,12 +3023,12 @@ namespace LowTempRadiantSystem { if (FinalZoneSizing(CurZoneEqNum).NonAirSysDesCoolLoad >= SmallLoad) { rho = GetDensityGlycol(state, PlantLoop(CFloRadSys(RadSysNum).CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), PlantLoop(CFloRadSys(RadSysNum).CWLoopNum).FluidIndex, "SizeLowTempRadiantSystem"); Cp = GetSpecificHeatGlycol(state, PlantLoop(CFloRadSys(RadSysNum).CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), PlantLoop(CFloRadSys(RadSysNum).CWLoopNum).FluidIndex, "SizeLowTempRadiantSystem"); WaterVolFlowMaxCoolDes = diff --git a/src/EnergyPlus/MicroturbineElectricGenerator.cc b/src/EnergyPlus/MicroturbineElectricGenerator.cc index b25ccc20174..5efcc587f51 100644 --- a/src/EnergyPlus/MicroturbineElectricGenerator.cc +++ b/src/EnergyPlus/MicroturbineElectricGenerator.cc @@ -941,7 +941,7 @@ namespace MicroturbineElectricGenerator { // size mass flow rate Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->HRLoopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->HRLoopNum).FluidIndex, RoutineName); diff --git a/src/EnergyPlus/MoistureBalanceEMPDManager.cc b/src/EnergyPlus/MoistureBalanceEMPDManager.cc index dc2ba8b084b..0fc4ce6333a 100644 --- a/src/EnergyPlus/MoistureBalanceEMPDManager.cc +++ b/src/EnergyPlus/MoistureBalanceEMPDManager.cc @@ -264,12 +264,12 @@ namespace MoistureBalanceEMPDManager { material.MoistBCoeff = MaterialProps(3); material.MoistCCoeff = MaterialProps(4); material.MoistDCoeff = MaterialProps(5); - if (lNumericFieldBlanks(6) || MaterialProps(6) == AutoCalculate) { + if (lNumericFieldBlanks(6) || MaterialProps(6) == DataGlobalConstants::AutoCalculate()) { material.EMPDSurfaceDepth = CalcDepthFromPeriod(24 * 3600, material); // 1 day } else { material.EMPDSurfaceDepth = MaterialProps(6); } - if (lNumericFieldBlanks(7) || MaterialProps(7) == AutoCalculate) { + if (lNumericFieldBlanks(7) || MaterialProps(7) == DataGlobalConstants::AutoCalculate()) { material.EMPDDeepDepth = CalcDepthFromPeriod(21 * 24 * 3600, material); // 3 weeks } else { material.EMPDDeepDepth = MaterialProps(7); @@ -558,25 +558,25 @@ namespace MoistureBalanceEMPDManager { Taver = TempSurfIn; // Calculate average vapor density [kg/m^3], and RH for use in material property calculations. RVaver = rv_surface_old; - RHaver = RVaver * 461.52 * (Taver + KelvinConv) * std::exp(-23.7093 + 4111.0 / (Taver + 237.7)); + RHaver = RVaver * 461.52 * (Taver + DataGlobalConstants::KelvinConv()) * std::exp(-23.7093 + 4111.0 / (Taver + 237.7)); // Calculate the saturated vapor pressure, surface vapor pressure and dewpoint. Used to check for condensation in HeatBalanceSurfaceManager PVsat = PsyPsatFnTemp(Taver, RoutineName); PVsurf = RHaver * std::exp(23.7093 - 4111.0 / (Taver + 237.7)); - TempSat = 4111.0 / (23.7093 - std::log(PVsurf)) + 35.45 - KelvinConv; + TempSat = 4111.0 / (23.7093 - std::log(PVsurf)) + 35.45 - DataGlobalConstants::KelvinConv(); // Convert vapor resistance factor (user input) to diffusivity. Evaluate at local surface temperature. // 2e-7*T^0.81/P = vapor diffusivity in air. [kg/m-s-Pa] // 461.52 = universal gas constant for water [J/kg-K] // EMPDdiffusivity = [m^2/s] - EMPDdiffusivity = (2.0e-7 * pow(Taver + KelvinConv, 0.81) / OutBaroPress) / material.EMPDmu * 461.52 * (Taver + KelvinConv); + EMPDdiffusivity = (2.0e-7 * pow(Taver + DataGlobalConstants::KelvinConv(), 0.81) / OutBaroPress) / material.EMPDmu * 461.52 * (Taver + DataGlobalConstants::KelvinConv()); // Calculate slope of moisture sorption curve at current RH. [kg/kg-RH] dU_dRH = material.MoistACoeff * material.MoistBCoeff * pow(RHaver, material.MoistBCoeff - 1) + material.MoistCCoeff * material.MoistDCoeff * pow(RHaver, material.MoistDCoeff - 1); // Convert vapor density and temperature of zone air to RH - RHZone = rho_vapor_air_in * 461.52 * (TempZone + KelvinConv) * std::exp(-23.7093 + 4111.0 / ((TempZone + KelvinConv) - 35.45)); + RHZone = rho_vapor_air_in * 461.52 * (TempZone + DataGlobalConstants::KelvinConv()) * std::exp(-23.7093 + 4111.0 / ((TempZone + DataGlobalConstants::KelvinConv()) - 35.45)); // Convert stored vapor density from previous timestep to RH. RH_deep_layer_old = PsyRhFnTdbRhov(Taver, rv_deep_old); @@ -588,7 +588,7 @@ namespace MoistureBalanceEMPDManager { Rcoating = 0; } else { Rcoating = material.EMPDCoatingThickness * material.EMPDmuCoating * OutBaroPress / - (2.0e-7 * pow(Taver + KelvinConv, 0.81) * 461.52 * (Taver + KelvinConv)); + (2.0e-7 * pow(Taver + DataGlobalConstants::KelvinConv(), 0.81) * 461.52 * (Taver + DataGlobalConstants::KelvinConv())); } // Calculate mass-transfer coefficient between zone air and center of surface layer. [m/s] diff --git a/src/EnergyPlus/NodeInputManager.cc b/src/EnergyPlus/NodeInputManager.cc index 94e64516376..f761b84109b 100644 --- a/src/EnergyPlus/NodeInputManager.cc +++ b/src/EnergyPlus/NodeInputManager.cc @@ -1166,7 +1166,7 @@ namespace NodeInputManager { if (CalcMoreNodeInfoMyOneTimeFlag) { RhoAirStdInit = StdRhoAir; - RhoWaterStdInit = RhoH2O(DataGlobals::InitConvTemp); + RhoWaterStdInit = RhoH2O(DataGlobalConstants::InitConvTemp()); NodeWetBulbRepReq.allocate(NumOfNodes); NodeWetBulbSchedPtr.allocate(NumOfNodes); NodeRelHumidityRepReq.allocate(NumOfNodes); @@ -1299,7 +1299,7 @@ namespace NodeInputManager { } else { Cp = GetSpecificHeatGlycol(state, nodeFluidNames[iNode - 1], Node(iNode).Temp, Node(iNode).FluidIndex, nodeReportingStrings[iNode - 1]); rhoStd = GetDensityGlycol( - state, nodeFluidNames[iNode - 1], DataGlobals::InitConvTemp, Node(iNode).FluidIndex, nodeReportingStrings[iNode - 1]); + state, nodeFluidNames[iNode - 1], DataGlobalConstants::InitConvTemp(), Node(iNode).FluidIndex, nodeReportingStrings[iNode - 1]); rho = GetDensityGlycol(state, nodeFluidNames[iNode - 1], Node(iNode).Temp, Node(iNode).FluidIndex, nodeReportingStrings[iNode - 1]); } diff --git a/src/EnergyPlus/OutdoorAirUnit.cc b/src/EnergyPlus/OutdoorAirUnit.cc index 96b6c3a2924..8e03ae8356c 100644 --- a/src/EnergyPlus/OutdoorAirUnit.cc +++ b/src/EnergyPlus/OutdoorAirUnit.cc @@ -1295,7 +1295,7 @@ CurrentModuleObjects(CO_OAEqList), ComponentListName); OutAirUnit(OAUnitNum).OAEquip(compLoop).MaxVolWaterFlow = WaterCoils::GetCoilMaxWaterFlowRate(state, OutAirUnit(OAUnitNum).OAEquip(compLoop).ComponentType, OutAirUnit(OAUnitNum).OAEquip(compLoop).ComponentName, errFlag); rho = GetDensityGlycol(state, PlantLoop(OutAirUnit(OAUnitNum).OAEquip(compLoop).LoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), PlantLoop(OutAirUnit(OAUnitNum).OAEquip(compLoop).LoopNum).FluidIndex, RoutineName); OutAirUnit(OAUnitNum).OAEquip(compLoop).MaxWaterMassFlow = rho * OutAirUnit(OAUnitNum).OAEquip(compLoop).MaxVolWaterFlow; @@ -1314,7 +1314,7 @@ CurrentModuleObjects(CO_OAEqList), ComponentListName); OutAirUnit(OAUnitNum).OAEquip(compLoop).MaxVolWaterFlow = WaterCoils::GetCoilMaxWaterFlowRate(state, OutAirUnit(OAUnitNum).OAEquip(compLoop).ComponentType, OutAirUnit(OAUnitNum).OAEquip(compLoop).ComponentName, errFlag); rho = GetDensityGlycol(state, PlantLoop(OutAirUnit(OAUnitNum).OAEquip(compLoop).LoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(OutAirUnit(OAUnitNum).OAEquip(compLoop).LoopNum).FluidIndex, RoutineName); OutAirUnit(OAUnitNum).OAEquip(compLoop).MaxWaterMassFlow = rho * OutAirUnit(OAUnitNum).OAEquip(compLoop).MaxVolWaterFlow; @@ -1332,7 +1332,7 @@ CurrentModuleObjects(CO_OAEqList), ComponentListName); OutAirUnit(OAUnitNum).OAEquip(compLoop).MaxVolWaterFlow = GetCoilMaxSteamFlowRate(state, OutAirUnit(OAUnitNum).OAEquip(compLoop).ComponentIndex, errFlag); Real64 rho = GetSatDensityRefrig(state, PlantLoop(OutAirUnit(OAUnitNum).OAEquip(compLoop).LoopNum).FluidName, - DataGlobals::SteamInitConvTemp, + DataGlobalConstants::SteamInitConvTemp(), 1.0, PlantLoop(OutAirUnit(OAUnitNum).OAEquip(compLoop).LoopNum).FluidIndex, RoutineName); @@ -1351,7 +1351,7 @@ CurrentModuleObjects(CO_OAEqList), ComponentListName); OutAirUnit(OAUnitNum).OAEquip(compLoop).MaxVolWaterFlow = WaterCoils::GetCoilMaxWaterFlowRate(state, OutAirUnit(OAUnitNum).OAEquip(compLoop).ComponentType, OutAirUnit(OAUnitNum).OAEquip(compLoop).ComponentName, errFlag); rho = GetDensityGlycol(state, PlantLoop(OutAirUnit(OAUnitNum).OAEquip(compLoop).LoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), PlantLoop(OutAirUnit(OAUnitNum).OAEquip(compLoop).LoopNum).FluidIndex, RoutineName); OutAirUnit(OAUnitNum).OAEquip(compLoop).MaxWaterMassFlow = rho * OutAirUnit(OAUnitNum).OAEquip(compLoop).MaxVolWaterFlow; diff --git a/src/EnergyPlus/OutputProcessor.cc b/src/EnergyPlus/OutputProcessor.cc index d1d1059b42f..229ba6bf5f3 100644 --- a/src/EnergyPlus/OutputProcessor.cc +++ b/src/EnergyPlus/OutputProcessor.cc @@ -3682,47 +3682,28 @@ namespace OutputProcessor { // for SM (Simulation period) meters, the value of the last calculation is stored // in the data structure. - // METHODOLOGY EMPLOYED: - // na - - // REFERENCES: - // na - // Using/Aliasing using namespace OutputReportPredefined; - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: - // na - - // SUBROUTINE PARAMETER DEFINITIONS: - Real64 const convertJtoGJ(1.0 / 1000000000.0); - - // INTERFACE BLOCK SPECIFICATIONS: - // na - - // DERIVED TYPE DEFINITIONS: - // na - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int Loop; // Loop Control for (Loop = 1; Loop <= NumEnergyMeters; ++Loop) { int const RT_forIPUnits(EnergyMeters(Loop).RT_forIPUnits); if (RT_forIPUnits == RT_IPUnits_Electricity) { - PreDefTableEntry(pdchEMelecannual, EnergyMeters(Loop).Name, EnergyMeters(Loop).FinYrSMValue * convertJtoGJ); + PreDefTableEntry(pdchEMelecannual, EnergyMeters(Loop).Name, EnergyMeters(Loop).FinYrSMValue * DataGlobalConstants::convertJtoGJ()); PreDefTableEntry(pdchEMelecminvalue, EnergyMeters(Loop).Name, EnergyMeters(Loop).FinYrSMMinVal / TimeStepZoneSec); PreDefTableEntry(pdchEMelecminvaluetime, EnergyMeters(Loop).Name, DateToStringWithMonth(EnergyMeters(Loop).FinYrSMMinValDate)); PreDefTableEntry(pdchEMelecmaxvalue, EnergyMeters(Loop).Name, EnergyMeters(Loop).FinYrSMMaxVal / TimeStepZoneSec); PreDefTableEntry(pdchEMelecmaxvaluetime, EnergyMeters(Loop).Name, DateToStringWithMonth(EnergyMeters(Loop).FinYrSMMaxValDate)); } else if (RT_forIPUnits == RT_IPUnits_Gas) { - PreDefTableEntry(pdchEMgasannual, EnergyMeters(Loop).Name, EnergyMeters(Loop).FinYrSMValue * convertJtoGJ); + PreDefTableEntry(pdchEMgasannual, EnergyMeters(Loop).Name, EnergyMeters(Loop).FinYrSMValue * DataGlobalConstants::convertJtoGJ()); PreDefTableEntry(pdchEMgasminvalue, EnergyMeters(Loop).Name, EnergyMeters(Loop).FinYrSMMinVal / TimeStepZoneSec); PreDefTableEntry(pdchEMgasminvaluetime, EnergyMeters(Loop).Name, DateToStringWithMonth(EnergyMeters(Loop).FinYrSMMinValDate)); PreDefTableEntry(pdchEMgasmaxvalue, EnergyMeters(Loop).Name, EnergyMeters(Loop).FinYrSMMaxVal / TimeStepZoneSec); PreDefTableEntry(pdchEMgasmaxvaluetime, EnergyMeters(Loop).Name, DateToStringWithMonth(EnergyMeters(Loop).FinYrSMMaxValDate)); } else if (RT_forIPUnits == RT_IPUnits_Cooling) { - PreDefTableEntry(pdchEMcoolannual, EnergyMeters(Loop).Name, EnergyMeters(Loop).FinYrSMValue * convertJtoGJ); + PreDefTableEntry(pdchEMcoolannual, EnergyMeters(Loop).Name, EnergyMeters(Loop).FinYrSMValue * DataGlobalConstants::convertJtoGJ()); PreDefTableEntry(pdchEMcoolminvalue, EnergyMeters(Loop).Name, EnergyMeters(Loop).FinYrSMMinVal / TimeStepZoneSec); PreDefTableEntry(pdchEMcoolminvaluetime, EnergyMeters(Loop).Name, DateToStringWithMonth(EnergyMeters(Loop).FinYrSMMinValDate)); PreDefTableEntry(pdchEMcoolmaxvalue, EnergyMeters(Loop).Name, EnergyMeters(Loop).FinYrSMMaxVal / TimeStepZoneSec); @@ -3752,7 +3733,7 @@ namespace OutputProcessor { PreDefTableEntry(pdchEMotherLmaxvalue, EnergyMeters(Loop).Name, EnergyMeters(Loop).FinYrSMMaxVal / TimeStepZoneSec, 3); PreDefTableEntry(pdchEMotherLmaxvaluetime, EnergyMeters(Loop).Name, DateToStringWithMonth(EnergyMeters(Loop).FinYrSMMaxValDate)); } else { - PreDefTableEntry(pdchEMotherJannual, EnergyMeters(Loop).Name, EnergyMeters(Loop).FinYrSMValue * convertJtoGJ); + PreDefTableEntry(pdchEMotherJannual, EnergyMeters(Loop).Name, EnergyMeters(Loop).FinYrSMValue * DataGlobalConstants::convertJtoGJ()); PreDefTableEntry(pdchEMotherJminvalue, EnergyMeters(Loop).Name, EnergyMeters(Loop).FinYrSMMinVal / TimeStepZoneSec); PreDefTableEntry(pdchEMotherJminvaluetime, EnergyMeters(Loop).Name, DateToStringWithMonth(EnergyMeters(Loop).FinYrSMMinValDate)); PreDefTableEntry(pdchEMotherJmaxvalue, EnergyMeters(Loop).Name, EnergyMeters(Loop).FinYrSMMaxVal / TimeStepZoneSec); diff --git a/src/EnergyPlus/OutputReportTabular.cc b/src/EnergyPlus/OutputReportTabular.cc index c398e74ec83..f11d4b0f9e4 100644 --- a/src/EnergyPlus/OutputReportTabular.cc +++ b/src/EnergyPlus/OutputReportTabular.cc @@ -4826,7 +4826,6 @@ namespace OutputReportTabular { // the output variables and data structures shown. // Using/Aliasing - using DataGlobals::convertJtoGJ; using DataHeatBalance::BuildingPreDefRep; using DataHeatBalance::ZoneTotalExfiltrationHeatLoss; @@ -4842,15 +4841,15 @@ namespace OutputReportTabular { // Only gather zone report at zone time steps if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepZone) { - BuildingPreDefRep.emiEnvelopConv += SumSurfaceHeatEmission * convertJtoGJ; + BuildingPreDefRep.emiEnvelopConv += SumSurfaceHeatEmission * DataGlobalConstants::convertJtoGJ(); return; } CalcHeatEmissionReport(state); - BuildingPreDefRep.emiZoneExfiltration += ZoneTotalExfiltrationHeatLoss * convertJtoGJ; - BuildingPreDefRep.emiZoneExhaust += ZoneTotalExhaustHeatLoss * convertJtoGJ; - BuildingPreDefRep.emiHVACRelief += SysTotalHVACReliefHeatLoss * convertJtoGJ; - BuildingPreDefRep.emiHVACReject += SysTotalHVACRejectHeatLoss * convertJtoGJ; + BuildingPreDefRep.emiZoneExfiltration += ZoneTotalExfiltrationHeatLoss * DataGlobalConstants::convertJtoGJ(); + BuildingPreDefRep.emiZoneExhaust += ZoneTotalExhaustHeatLoss * DataGlobalConstants::convertJtoGJ(); + BuildingPreDefRep.emiHVACRelief += SysTotalHVACReliefHeatLoss * DataGlobalConstants::convertJtoGJ(); + BuildingPreDefRep.emiHVACReject += SysTotalHVACRejectHeatLoss * DataGlobalConstants::convertJtoGJ(); BuildingPreDefRep.emiTotHeat = BuildingPreDefRep.emiEnvelopConv + BuildingPreDefRep.emiZoneExfiltration + BuildingPreDefRep.emiZoneExhaust + BuildingPreDefRep.emiHVACRelief + BuildingPreDefRep.emiHVACReject; @@ -4866,7 +4865,6 @@ namespace OutputReportTabular { // Using/Aliasing using DataEnvironment::WeatherFileLocationTitle; - using DataGlobals::convertJtoGJ; using DataHeatBalance::BuildingPreDefRep; using DataHeatBalance::NumRefrigCondensers; using DataHeatBalance::NumRefrigeratedRacks; @@ -6441,7 +6439,6 @@ namespace OutputReportTabular { int StartOfWeek; static Real64 HrsPerWeek(0.0); Real64 consumptionTotal; - Real64 convertJtoGJ; // sensible heat gain report totals static Real64 totalZoneEqHt(0.0); static Real64 totalZoneEqCl(0.0); @@ -6462,7 +6459,6 @@ namespace OutputReportTabular { static Real64 totalInfilRem(0.0); static Real64 totalOtherRem(0.0); - convertJtoGJ = 1.0 / 1000000000.0; StartOfWeek = RunPeriodStartDayOfWeek; if (StartOfWeek == 0) StartOfWeek = 2; // if the first day of the week has not been set yet, assume monday @@ -6626,24 +6622,24 @@ namespace OutputReportTabular { // annual // PreDefTableEntry( pdchSHGSAnHvacHt, Zone( iZone ).Name, ZonePreDefRep( iZone ).SHGSAnHvacHt * convertJtoGJ, 3 ); // PreDefTableEntry( pdchSHGSAnHvacCl, Zone( iZone ).Name, ZonePreDefRep( iZone ).SHGSAnHvacCl * convertJtoGJ, 3 ); - PreDefTableEntry(pdchSHGSAnZoneEqHt, Zone(iZone).Name, ZonePreDefRep(iZone).SHGSAnZoneEqHt * convertJtoGJ, 3); - PreDefTableEntry(pdchSHGSAnZoneEqCl, Zone(iZone).Name, ZonePreDefRep(iZone).SHGSAnZoneEqCl * convertJtoGJ, 3); - PreDefTableEntry(pdchSHGSAnHvacATUHt, Zone(iZone).Name, ZonePreDefRep(iZone).SHGSAnHvacATUHt * convertJtoGJ, 3); - PreDefTableEntry(pdchSHGSAnHvacATUCl, Zone(iZone).Name, ZonePreDefRep(iZone).SHGSAnHvacATUCl * convertJtoGJ, 3); - PreDefTableEntry(pdchSHGSAnSurfHt, Zone(iZone).Name, ZonePreDefRep(iZone).SHGSAnSurfHt * convertJtoGJ, 3); - PreDefTableEntry(pdchSHGSAnSurfCl, Zone(iZone).Name, ZonePreDefRep(iZone).SHGSAnSurfCl * convertJtoGJ, 3); - PreDefTableEntry(pdchSHGSAnPeoplAdd, Zone(iZone).Name, ZonePreDefRep(iZone).SHGSAnPeoplAdd * convertJtoGJ, 3); - PreDefTableEntry(pdchSHGSAnLiteAdd, Zone(iZone).Name, ZonePreDefRep(iZone).SHGSAnLiteAdd * convertJtoGJ, 3); - PreDefTableEntry(pdchSHGSAnEquipAdd, Zone(iZone).Name, ZonePreDefRep(iZone).SHGSAnEquipAdd * convertJtoGJ, 3); - PreDefTableEntry(pdchSHGSAnWindAdd, Zone(iZone).Name, ZonePreDefRep(iZone).SHGSAnWindAdd * convertJtoGJ, 3); - PreDefTableEntry(pdchSHGSAnIzaAdd, Zone(iZone).Name, ZonePreDefRep(iZone).SHGSAnIzaAdd * convertJtoGJ, 3); - PreDefTableEntry(pdchSHGSAnInfilAdd, Zone(iZone).Name, ZonePreDefRep(iZone).SHGSAnInfilAdd * convertJtoGJ, 3); - PreDefTableEntry(pdchSHGSAnOtherAdd, Zone(iZone).Name, ZonePreDefRep(iZone).SHGSAnOtherAdd * convertJtoGJ, 3); - PreDefTableEntry(pdchSHGSAnEquipRem, Zone(iZone).Name, ZonePreDefRep(iZone).SHGSAnEquipRem * convertJtoGJ, 3); - PreDefTableEntry(pdchSHGSAnWindRem, Zone(iZone).Name, ZonePreDefRep(iZone).SHGSAnWindRem * convertJtoGJ, 3); - PreDefTableEntry(pdchSHGSAnIzaRem, Zone(iZone).Name, ZonePreDefRep(iZone).SHGSAnIzaRem * convertJtoGJ, 3); - PreDefTableEntry(pdchSHGSAnInfilRem, Zone(iZone).Name, ZonePreDefRep(iZone).SHGSAnInfilRem * convertJtoGJ, 3); - PreDefTableEntry(pdchSHGSAnOtherRem, Zone(iZone).Name, ZonePreDefRep(iZone).SHGSAnOtherRem * convertJtoGJ, 3); + PreDefTableEntry(pdchSHGSAnZoneEqHt, Zone(iZone).Name, ZonePreDefRep(iZone).SHGSAnZoneEqHt * DataGlobalConstants::convertJtoGJ(), 3); + PreDefTableEntry(pdchSHGSAnZoneEqCl, Zone(iZone).Name, ZonePreDefRep(iZone).SHGSAnZoneEqCl * DataGlobalConstants::convertJtoGJ(), 3); + PreDefTableEntry(pdchSHGSAnHvacATUHt, Zone(iZone).Name, ZonePreDefRep(iZone).SHGSAnHvacATUHt * DataGlobalConstants::convertJtoGJ(), 3); + PreDefTableEntry(pdchSHGSAnHvacATUCl, Zone(iZone).Name, ZonePreDefRep(iZone).SHGSAnHvacATUCl * DataGlobalConstants::convertJtoGJ(), 3); + PreDefTableEntry(pdchSHGSAnSurfHt, Zone(iZone).Name, ZonePreDefRep(iZone).SHGSAnSurfHt * DataGlobalConstants::convertJtoGJ(), 3); + PreDefTableEntry(pdchSHGSAnSurfCl, Zone(iZone).Name, ZonePreDefRep(iZone).SHGSAnSurfCl * DataGlobalConstants::convertJtoGJ(), 3); + PreDefTableEntry(pdchSHGSAnPeoplAdd, Zone(iZone).Name, ZonePreDefRep(iZone).SHGSAnPeoplAdd * DataGlobalConstants::convertJtoGJ(), 3); + PreDefTableEntry(pdchSHGSAnLiteAdd, Zone(iZone).Name, ZonePreDefRep(iZone).SHGSAnLiteAdd * DataGlobalConstants::convertJtoGJ(), 3); + PreDefTableEntry(pdchSHGSAnEquipAdd, Zone(iZone).Name, ZonePreDefRep(iZone).SHGSAnEquipAdd * DataGlobalConstants::convertJtoGJ(), 3); + PreDefTableEntry(pdchSHGSAnWindAdd, Zone(iZone).Name, ZonePreDefRep(iZone).SHGSAnWindAdd * DataGlobalConstants::convertJtoGJ(), 3); + PreDefTableEntry(pdchSHGSAnIzaAdd, Zone(iZone).Name, ZonePreDefRep(iZone).SHGSAnIzaAdd * DataGlobalConstants::convertJtoGJ(), 3); + PreDefTableEntry(pdchSHGSAnInfilAdd, Zone(iZone).Name, ZonePreDefRep(iZone).SHGSAnInfilAdd * DataGlobalConstants::convertJtoGJ(), 3); + PreDefTableEntry(pdchSHGSAnOtherAdd, Zone(iZone).Name, ZonePreDefRep(iZone).SHGSAnOtherAdd * DataGlobalConstants::convertJtoGJ(), 3); + PreDefTableEntry(pdchSHGSAnEquipRem, Zone(iZone).Name, ZonePreDefRep(iZone).SHGSAnEquipRem * DataGlobalConstants::convertJtoGJ(), 3); + PreDefTableEntry(pdchSHGSAnWindRem, Zone(iZone).Name, ZonePreDefRep(iZone).SHGSAnWindRem * DataGlobalConstants::convertJtoGJ(), 3); + PreDefTableEntry(pdchSHGSAnIzaRem, Zone(iZone).Name, ZonePreDefRep(iZone).SHGSAnIzaRem * DataGlobalConstants::convertJtoGJ(), 3); + PreDefTableEntry(pdchSHGSAnInfilRem, Zone(iZone).Name, ZonePreDefRep(iZone).SHGSAnInfilRem * DataGlobalConstants::convertJtoGJ(), 3); + PreDefTableEntry(pdchSHGSAnOtherRem, Zone(iZone).Name, ZonePreDefRep(iZone).SHGSAnOtherRem * DataGlobalConstants::convertJtoGJ(), 3); // peak cooling PreDefTableEntry(pdchSHGSClTimePeak, Zone(iZone).Name, DateToString(ZonePreDefRep(iZone).clPtTimeStamp)); // PreDefTableEntry( pdchSHGSClHvacHt, Zone( iZone ).Name, ZonePreDefRep( iZone ).SHGSClHvacHt ); @@ -6712,24 +6708,24 @@ namespace OutputReportTabular { } // PreDefTableEntry( pdchSHGSAnHvacHt, "Total Facility", totalHvacHt * convertJtoGJ, 3 ); // PreDefTableEntry( pdchSHGSAnHvacCl, "Total Facility", totalHvacCl * convertJtoGJ, 3 ); - PreDefTableEntry(pdchSHGSAnZoneEqHt, "Total Facility", totalZoneEqHt * convertJtoGJ, 3); - PreDefTableEntry(pdchSHGSAnZoneEqCl, "Total Facility", totalZoneEqCl * convertJtoGJ, 3); - PreDefTableEntry(pdchSHGSAnHvacATUHt, "Total Facility", totalHvacATUHt * convertJtoGJ, 3); - PreDefTableEntry(pdchSHGSAnHvacATUCl, "Total Facility", totalHvacATUCl * convertJtoGJ, 3); - PreDefTableEntry(pdchSHGSAnSurfHt, "Total Facility", totalSurfHt * convertJtoGJ, 3); - PreDefTableEntry(pdchSHGSAnSurfCl, "Total Facility", totalSurfCl * convertJtoGJ, 3); - PreDefTableEntry(pdchSHGSAnPeoplAdd, "Total Facility", totalPeoplAdd * convertJtoGJ, 3); - PreDefTableEntry(pdchSHGSAnLiteAdd, "Total Facility", totalLiteAdd * convertJtoGJ, 3); - PreDefTableEntry(pdchSHGSAnEquipAdd, "Total Facility", totalEquipAdd * convertJtoGJ, 3); - PreDefTableEntry(pdchSHGSAnWindAdd, "Total Facility", totalWindAdd * convertJtoGJ, 3); - PreDefTableEntry(pdchSHGSAnIzaAdd, "Total Facility", totalIzaAdd * convertJtoGJ, 3); - PreDefTableEntry(pdchSHGSAnInfilAdd, "Total Facility", totalInfilAdd * convertJtoGJ, 3); - PreDefTableEntry(pdchSHGSAnOtherAdd, "Total Facility", totalOtherAdd * convertJtoGJ, 3); - PreDefTableEntry(pdchSHGSAnEquipRem, "Total Facility", totalEquipRem * convertJtoGJ, 3); - PreDefTableEntry(pdchSHGSAnWindRem, "Total Facility", totalWindRem * convertJtoGJ, 3); - PreDefTableEntry(pdchSHGSAnIzaRem, "Total Facility", totalIzaRem * convertJtoGJ, 3); - PreDefTableEntry(pdchSHGSAnInfilRem, "Total Facility", totalInfilRem * convertJtoGJ, 3); - PreDefTableEntry(pdchSHGSAnOtherRem, "Total Facility", totalOtherRem * convertJtoGJ, 3); + PreDefTableEntry(pdchSHGSAnZoneEqHt, "Total Facility", totalZoneEqHt * DataGlobalConstants::convertJtoGJ(), 3); + PreDefTableEntry(pdchSHGSAnZoneEqCl, "Total Facility", totalZoneEqCl * DataGlobalConstants::convertJtoGJ(), 3); + PreDefTableEntry(pdchSHGSAnHvacATUHt, "Total Facility", totalHvacATUHt * DataGlobalConstants::convertJtoGJ(), 3); + PreDefTableEntry(pdchSHGSAnHvacATUCl, "Total Facility", totalHvacATUCl * DataGlobalConstants::convertJtoGJ(), 3); + PreDefTableEntry(pdchSHGSAnSurfHt, "Total Facility", totalSurfHt * DataGlobalConstants::convertJtoGJ(), 3); + PreDefTableEntry(pdchSHGSAnSurfCl, "Total Facility", totalSurfCl * DataGlobalConstants::convertJtoGJ(), 3); + PreDefTableEntry(pdchSHGSAnPeoplAdd, "Total Facility", totalPeoplAdd * DataGlobalConstants::convertJtoGJ(), 3); + PreDefTableEntry(pdchSHGSAnLiteAdd, "Total Facility", totalLiteAdd * DataGlobalConstants::convertJtoGJ(), 3); + PreDefTableEntry(pdchSHGSAnEquipAdd, "Total Facility", totalEquipAdd * DataGlobalConstants::convertJtoGJ(), 3); + PreDefTableEntry(pdchSHGSAnWindAdd, "Total Facility", totalWindAdd * DataGlobalConstants::convertJtoGJ(), 3); + PreDefTableEntry(pdchSHGSAnIzaAdd, "Total Facility", totalIzaAdd * DataGlobalConstants::convertJtoGJ(), 3); + PreDefTableEntry(pdchSHGSAnInfilAdd, "Total Facility", totalInfilAdd * DataGlobalConstants::convertJtoGJ(), 3); + PreDefTableEntry(pdchSHGSAnOtherAdd, "Total Facility", totalOtherAdd * DataGlobalConstants::convertJtoGJ(), 3); + PreDefTableEntry(pdchSHGSAnEquipRem, "Total Facility", totalEquipRem * DataGlobalConstants::convertJtoGJ(), 3); + PreDefTableEntry(pdchSHGSAnWindRem, "Total Facility", totalWindRem * DataGlobalConstants::convertJtoGJ(), 3); + PreDefTableEntry(pdchSHGSAnIzaRem, "Total Facility", totalIzaRem * DataGlobalConstants::convertJtoGJ(), 3); + PreDefTableEntry(pdchSHGSAnInfilRem, "Total Facility", totalInfilRem * DataGlobalConstants::convertJtoGJ(), 3); + PreDefTableEntry(pdchSHGSAnOtherRem, "Total Facility", totalOtherRem * DataGlobalConstants::convertJtoGJ(), 3); // building level results for peak cooling PreDefTableEntry(pdchSHGSClTimePeak, "Total Facility", DateToString(BuildingPreDefRep.clPtTimeStamp)); // PreDefTableEntry( pdchSHGSClHvacHt, "Total Facility", BuildingPreDefRep.SHGSClHvacHt ); diff --git a/src/EnergyPlus/OutsideEnergySources.cc b/src/EnergyPlus/OutsideEnergySources.cc index 0bd8f162850..de762305b7c 100644 --- a/src/EnergyPlus/OutsideEnergySources.cc +++ b/src/EnergyPlus/OutsideEnergySources.cc @@ -418,12 +418,12 @@ namespace OutsideEnergySources { if (PltSizNum > 0) { Real64 const rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->LoopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->LoopNum).FluidIndex, "SizeDistrict" + typeName); Real64 const Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->LoopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->LoopNum).FluidIndex, "SizeDistrict" + typeName); Real64 const NomCapDes = Cp * rho * DataSizing::PlantSizData(PltSizNum).DeltaT * DataSizing::PlantSizData(PltSizNum).DesVolFlowRate; diff --git a/src/EnergyPlus/PackagedTerminalHeatPump.cc b/src/EnergyPlus/PackagedTerminalHeatPump.cc index 059adbd38f1..f7424331c73 100644 --- a/src/EnergyPlus/PackagedTerminalHeatPump.cc +++ b/src/EnergyPlus/PackagedTerminalHeatPump.cc @@ -3892,7 +3892,7 @@ namespace PackagedTerminalHeatPump { if (PTUnit(PTUnitNum).MaxHeatCoilFluidFlow > 0.0) { rho = GetDensityGlycol(state, PlantLoop(PTUnit(PTUnitNum).HeatCoilLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(PTUnit(PTUnitNum).HeatCoilLoopNum).FluidIndex, RoutineName); @@ -3965,7 +3965,7 @@ namespace PackagedTerminalHeatPump { if (PTUnit(PTUnitNum).MaxSuppCoilFluidFlow > 0.0) { rho = GetDensityGlycol(state, PlantLoop(PTUnit(PTUnitNum).SuppCoilLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(PTUnit(PTUnitNum).SuppCoilLoopNum).FluidIndex, RoutineName); PTUnit(PTUnitNum).MaxSuppCoilFluidFlow = @@ -4322,7 +4322,7 @@ namespace PackagedTerminalHeatPump { CoilMaxVolFlowRate = GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", PTUnit(PTUnitNum).ACHeatCoilName, ErrorsFound); if (CoilMaxVolFlowRate != AutoSize) { rho = GetDensityGlycol(state, PlantLoop(PTUnit(PTUnitNum).HeatCoilLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(PTUnit(PTUnitNum).HeatCoilLoopNum).FluidIndex, RoutineNameSpace); PTUnit(PTUnitNum).MaxHeatCoilFluidFlow = CoilMaxVolFlowRate * rho; @@ -4360,7 +4360,7 @@ namespace PackagedTerminalHeatPump { CoilMaxVolFlowRate = GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", PTUnit(PTUnitNum).SuppHeatCoilName, ErrorsFound); if (CoilMaxVolFlowRate != AutoSize) { rho = GetDensityGlycol(state, PlantLoop(PTUnit(PTUnitNum).SuppCoilLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(PTUnit(PTUnitNum).SuppCoilLoopNum).FluidIndex, RoutineNameSpace); PTUnit(PTUnitNum).MaxSuppCoilFluidFlow = CoilMaxVolFlowRate * rho; diff --git a/src/EnergyPlus/PackagedThermalStorageCoil.cc b/src/EnergyPlus/PackagedThermalStorageCoil.cc index 25593d88c7d..aa9d48f98a4 100644 --- a/src/EnergyPlus/PackagedThermalStorageCoil.cc +++ b/src/EnergyPlus/PackagedThermalStorageCoil.cc @@ -404,7 +404,7 @@ namespace PackagedThermalStorageCoil { } if ((TESCoil(item).StorageMedia == IceBased) && (!lNumericFieldBlanks(2))) { - if (rNumericArgs(2) == AutoCalculate) { + if (rNumericArgs(2) == DataGlobalConstants::AutoCalculate()) { TESCoil(item).IceStorageCapacity = rNumericArgs(2); } else { TESCoil(item).IceStorageCapacity = rNumericArgs(2) * 1.e+09; // input in giga joules, used as joules internally @@ -2164,7 +2164,7 @@ namespace PackagedThermalStorageCoil { TESCoil(TESCoilNum).RatedEvapAirMassFlowRate = StdRhoAir * TESCoil(TESCoilNum).RatedEvapAirVolFlowRate; - if (TESCoil(TESCoilNum).CondenserAirVolumeFlow == AutoCalculate) { + if (TESCoil(TESCoilNum).CondenserAirVolumeFlow == DataGlobalConstants::AutoCalculate()) { TESCoil(TESCoilNum).CondenserAirVolumeFlow = TESCoil(TESCoilNum).RatedEvapAirVolFlowRate * TESCoil(TESCoilNum).CondenserAirFlowSizingFactor; BaseSizer::reportSizerOutput("Coil:Cooling:DX:SingleSpeed:ThermalStorage", @@ -2270,7 +2270,7 @@ namespace PackagedThermalStorageCoil { TESCoil(TESCoilNum).CoolingOnlyRatedTotCap); } - if (TESCoil(TESCoilNum).CoolingAndChargeModeAvailable && (TESCoil(TESCoilNum).CoolingAndChargeRatedTotCap == AutoCalculate)) { + if (TESCoil(TESCoilNum).CoolingAndChargeModeAvailable && (TESCoil(TESCoilNum).CoolingAndChargeRatedTotCap == DataGlobalConstants::AutoCalculate())) { TESCoil(TESCoilNum).CoolingAndChargeRatedTotCap = TESCoil(TESCoilNum).CoolingOnlyRatedTotCap * TESCoil(TESCoilNum).CoolingAndChargeRatedTotCapSizingFactor; BaseSizer::reportSizerOutput("Coil:Cooling:DX:SingleSpeed:ThermalStorage", @@ -2279,7 +2279,7 @@ namespace PackagedThermalStorageCoil { TESCoil(TESCoilNum).CoolingAndChargeRatedTotCap); } - if (TESCoil(TESCoilNum).CoolingAndChargeModeAvailable && (TESCoil(TESCoilNum).CoolingAndChargeRatedChargeCap == AutoCalculate)) { + if (TESCoil(TESCoilNum).CoolingAndChargeModeAvailable && (TESCoil(TESCoilNum).CoolingAndChargeRatedChargeCap == DataGlobalConstants::AutoCalculate())) { TESCoil(TESCoilNum).CoolingAndChargeRatedChargeCap = TESCoil(TESCoilNum).CoolingOnlyRatedTotCap * TESCoil(TESCoilNum).CoolingAndChargeRatedChargeCapSizingFactor; BaseSizer::reportSizerOutput("Coil:Cooling:DX:SingleSpeed:ThermalStorage", @@ -2288,7 +2288,7 @@ namespace PackagedThermalStorageCoil { TESCoil(TESCoilNum).CoolingAndChargeRatedChargeCap); } - if (TESCoil(TESCoilNum).CoolingAndDischargeModeAvailable && (TESCoil(TESCoilNum).CoolingAndDischargeRatedTotCap == AutoCalculate)) { + if (TESCoil(TESCoilNum).CoolingAndDischargeModeAvailable && (TESCoil(TESCoilNum).CoolingAndDischargeRatedTotCap == DataGlobalConstants::AutoCalculate())) { TESCoil(TESCoilNum).CoolingAndDischargeRatedTotCap = TESCoil(TESCoilNum).CoolingOnlyRatedTotCap * TESCoil(TESCoilNum).CoolingAndDischargeRatedTotCapSizingFactor; BaseSizer::reportSizerOutput("Coil:Cooling:DX:SingleSpeed:ThermalStorage", @@ -2297,7 +2297,7 @@ namespace PackagedThermalStorageCoil { TESCoil(TESCoilNum).CoolingAndDischargeRatedTotCap); } - if (TESCoil(TESCoilNum).CoolingAndDischargeModeAvailable && (TESCoil(TESCoilNum).CoolingAndDischargeRatedDischargeCap == AutoCalculate)) { + if (TESCoil(TESCoilNum).CoolingAndDischargeModeAvailable && (TESCoil(TESCoilNum).CoolingAndDischargeRatedDischargeCap == DataGlobalConstants::AutoCalculate())) { TESCoil(TESCoilNum).CoolingAndDischargeRatedDischargeCap = TESCoil(TESCoilNum).CoolingOnlyRatedTotCap * TESCoil(TESCoilNum).CoolingAndDischargeRatedDischargeCapSizingFactor; BaseSizer::reportSizerOutput("Coil:Cooling:DX:SingleSpeed:ThermalStorage", @@ -2306,7 +2306,7 @@ namespace PackagedThermalStorageCoil { TESCoil(TESCoilNum).CoolingAndDischargeRatedDischargeCap); } - if (TESCoil(TESCoilNum).ChargeOnlyModeAvailable && (TESCoil(TESCoilNum).ChargeOnlyRatedCapacity == AutoCalculate)) { + if (TESCoil(TESCoilNum).ChargeOnlyModeAvailable && (TESCoil(TESCoilNum).ChargeOnlyRatedCapacity == DataGlobalConstants::AutoCalculate())) { TESCoil(TESCoilNum).ChargeOnlyRatedCapacity = TESCoil(TESCoilNum).CoolingOnlyRatedTotCap * TESCoil(TESCoilNum).ChargeOnlyRatedCapacitySizingFactor; BaseSizer::reportSizerOutput("Coil:Cooling:DX:SingleSpeed:ThermalStorage", @@ -2315,7 +2315,7 @@ namespace PackagedThermalStorageCoil { TESCoil(TESCoilNum).ChargeOnlyRatedCapacity); } - if (TESCoil(TESCoilNum).DischargeOnlyModeAvailable && (TESCoil(TESCoilNum).DischargeOnlyRatedDischargeCap == AutoCalculate)) { + if (TESCoil(TESCoilNum).DischargeOnlyModeAvailable && (TESCoil(TESCoilNum).DischargeOnlyRatedDischargeCap == DataGlobalConstants::AutoCalculate())) { TESCoil(TESCoilNum).DischargeOnlyRatedDischargeCap = TESCoil(TESCoilNum).CoolingOnlyRatedTotCap * TESCoil(TESCoilNum).DischargeOnlyRatedDischargeCapSizingFactor; BaseSizer::reportSizerOutput("Coil:Cooling:DX:SingleSpeed:ThermalStorage", @@ -2324,14 +2324,14 @@ namespace PackagedThermalStorageCoil { TESCoil(TESCoilNum).DischargeOnlyRatedDischargeCap); } - if ((TESCoil(TESCoilNum).StorageMedia == FluidBased) && (TESCoil(TESCoilNum).FluidStorageVolume == AutoCalculate)) { + if ((TESCoil(TESCoilNum).StorageMedia == FluidBased) && (TESCoil(TESCoilNum).FluidStorageVolume == DataGlobalConstants::AutoCalculate())) { // for fluid tanks, assume a 10C deltaT or diff between max and min, whichever is smaller deltaT = min(FluidTankSizingDeltaT, (TESCoil(TESCoilNum).MaximumFluidTankTempLimit - TESCoil(TESCoilNum).MinimumFluidTankTempLimit)); rho = GetDensityGlycol( - state, TESCoil(TESCoilNum).StorageFluidName, DataGlobals::CWInitConvTemp, TESCoil(TESCoilNum).StorageFluidIndex, calcTESWaterStorageTank); + state, TESCoil(TESCoilNum).StorageFluidName, DataGlobalConstants::CWInitConvTemp(), TESCoil(TESCoilNum).StorageFluidIndex, calcTESWaterStorageTank); Cp = GetSpecificHeatGlycol( - state, TESCoil(TESCoilNum).StorageFluidName, DataGlobals::CWInitConvTemp, TESCoil(TESCoilNum).StorageFluidIndex, calcTESWaterStorageTank); + state, TESCoil(TESCoilNum).StorageFluidName, DataGlobalConstants::CWInitConvTemp(), TESCoil(TESCoilNum).StorageFluidIndex, calcTESWaterStorageTank); if (TESCoil(TESCoilNum).DischargeOnlyRatedDischargeCap > 0.0 && TESCoil(TESCoilNum).DischargeOnlyModeAvailable) { TESCoil(TESCoilNum).FluidStorageVolume = (TESCoil(TESCoilNum).DischargeOnlyRatedDischargeCap * TESCoil(TESCoilNum).StorageCapacitySizingFactor * DataGlobalConstants::SecInHour()) / @@ -2345,7 +2345,7 @@ namespace PackagedThermalStorageCoil { "Fluid Storage Volume [m3]", TESCoil(TESCoilNum).FluidStorageVolume); } - if ((TESCoil(TESCoilNum).StorageMedia == IceBased) && (TESCoil(TESCoilNum).IceStorageCapacity == AutoCalculate)) { + if ((TESCoil(TESCoilNum).StorageMedia == IceBased) && (TESCoil(TESCoilNum).IceStorageCapacity == DataGlobalConstants::AutoCalculate())) { if (TESCoil(TESCoilNum).DischargeOnlyRatedDischargeCap > 0.0 && TESCoil(TESCoilNum).DischargeOnlyModeAvailable) { TESCoil(TESCoilNum).IceStorageCapacity = diff --git a/src/EnergyPlus/PhotovoltaicThermalCollectors.cc b/src/EnergyPlus/PhotovoltaicThermalCollectors.cc index c20bb7a3815..fff3c88a4ae 100644 --- a/src/EnergyPlus/PhotovoltaicThermalCollectors.cc +++ b/src/EnergyPlus/PhotovoltaicThermalCollectors.cc @@ -578,7 +578,7 @@ namespace PhotovoltaicThermalCollectors { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->WLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(this->WLoopNum).FluidIndex, RoutineName); diff --git a/src/EnergyPlus/Photovoltaics.cc b/src/EnergyPlus/Photovoltaics.cc index 1351605c8f4..c59630a3444 100644 --- a/src/EnergyPlus/Photovoltaics.cc +++ b/src/EnergyPlus/Photovoltaics.cc @@ -120,7 +120,6 @@ namespace Photovoltaics { using DataGlobals::BeginEnvrnFlag; using DataGlobals::BeginSimFlag; using DataGlobals::EndEnvrnFlag; - using DataGlobals::KelvinConv; using DataHVACGlobals::TimeStepSys; // Data @@ -297,7 +296,6 @@ namespace Photovoltaics { // Using/Aliasing using namespace DataIPShortCuts; - using DataGlobals::KelvinConv; using DataSurfaces::Surface; using namespace DataHeatBalance; using General::RoundSigDigits; @@ -569,14 +567,14 @@ namespace Photovoltaics { tmpTNRSYSModuleParams(ModNum).ShuntResistance = rNumericArgs(5); tmpTNRSYSModuleParams(ModNum).RefIsc = rNumericArgs(6); tmpTNRSYSModuleParams(ModNum).RefVoc = rNumericArgs(7); - tmpTNRSYSModuleParams(ModNum).RefTemperature = rNumericArgs(8) + KelvinConv; + tmpTNRSYSModuleParams(ModNum).RefTemperature = rNumericArgs(8) + DataGlobalConstants::KelvinConv(); tmpTNRSYSModuleParams(ModNum).RefInsolation = rNumericArgs(9); tmpTNRSYSModuleParams(ModNum).Imp = rNumericArgs(10); tmpTNRSYSModuleParams(ModNum).Vmp = rNumericArgs(11); tmpTNRSYSModuleParams(ModNum).TempCoefIsc = rNumericArgs(12); tmpTNRSYSModuleParams(ModNum).TempCoefVoc = rNumericArgs(13); - tmpTNRSYSModuleParams(ModNum).NOCTAmbTemp = rNumericArgs(14) + KelvinConv; - tmpTNRSYSModuleParams(ModNum).NOCTCellTemp = rNumericArgs(15) + KelvinConv; + tmpTNRSYSModuleParams(ModNum).NOCTAmbTemp = rNumericArgs(14) + DataGlobalConstants::KelvinConv(); + tmpTNRSYSModuleParams(ModNum).NOCTCellTemp = rNumericArgs(15) + DataGlobalConstants::KelvinConv(); tmpTNRSYSModuleParams(ModNum).NOCTInsolation = rNumericArgs(16); tmpTNRSYSModuleParams(ModNum).HeatLossCoef = rNumericArgs(17); tmpTNRSYSModuleParams(ModNum).HeatCapacity = rNumericArgs(18); @@ -1254,8 +1252,8 @@ namespace Photovoltaics { // Do the Begin Environment initializations if (BeginEnvrnFlag && MyEnvrnFlag(PVnum)) { - PVarray(PVnum).TRNSYSPVcalc.CellTempK = Surface(PVarray(PVnum).SurfacePtr).OutDryBulbTemp + KelvinConv; - PVarray(PVnum).TRNSYSPVcalc.LastCellTempK = Surface(PVarray(PVnum).SurfacePtr).OutDryBulbTemp + KelvinConv; + PVarray(PVnum).TRNSYSPVcalc.CellTempK = Surface(PVarray(PVnum).SurfacePtr).OutDryBulbTemp + DataGlobalConstants::KelvinConv(); + PVarray(PVnum).TRNSYSPVcalc.LastCellTempK = Surface(PVarray(PVnum).SurfacePtr).OutDryBulbTemp + DataGlobalConstants::KelvinConv(); MyEnvrnFlag(PVnum) = false; } @@ -1372,7 +1370,7 @@ namespace Photovoltaics { ShuntResistance = PVarray(PVnum).TRNSYSPVModule.ShuntResistance; // convert ambient temperature from C to K - Tambient = Surface(PVarray(PVnum).SurfacePtr).OutDryBulbTemp + KelvinConv; + Tambient = Surface(PVarray(PVnum).SurfacePtr).OutDryBulbTemp + DataGlobalConstants::KelvinConv(); if ((PVarray(PVnum).TRNSYSPVcalc.Insolation > MinInsolation) && (RunFlag)) { @@ -1406,13 +1404,13 @@ namespace Photovoltaics { (1.0 - std::exp(-PVarray(PVnum).TRNSYSPVModule.HeatLossCoef / PVarray(PVnum).TRNSYSPVModule.HeatCapacity * PVTimeStep)); } else if (SELECT_CASE_var == iSurfaceOutsideFaceCellIntegration) { - CellTemp = TempSurfOut(PVarray(PVnum).SurfacePtr) + KelvinConv; + CellTemp = TempSurfOut(PVarray(PVnum).SurfacePtr) + DataGlobalConstants::KelvinConv(); } else if (SELECT_CASE_var == iTranspiredCollectorCellIntegration) { GetUTSCTsColl(PVarray(PVnum).UTSCPtr, CellTemp); - CellTemp += KelvinConv; + CellTemp += DataGlobalConstants::KelvinConv(); } else if (SELECT_CASE_var == iExteriorVentedCavityCellIntegration) { GetExtVentedCavityTsColl(PVarray(PVnum).ExtVentCavPtr, CellTemp); - CellTemp += KelvinConv; + CellTemp += DataGlobalConstants::KelvinConv(); } else if (SELECT_CASE_var == iPVTSolarCollectorCellIntegration) { // get PVT model result for cell temp.. } @@ -1479,13 +1477,13 @@ namespace Photovoltaics { (PVarray(PVnum).TRNSYSPVcalc.LastCellTempK - Tambient) * std::exp(-PVarray(PVnum).TRNSYSPVModule.HeatLossCoef / PVarray(PVnum).TRNSYSPVModule.HeatCapacity * PVTimeStep); } else if (SELECT_CASE_var == iSurfaceOutsideFaceCellIntegration) { - CellTemp = TempSurfOut(PVarray(PVnum).SurfacePtr) + KelvinConv; + CellTemp = TempSurfOut(PVarray(PVnum).SurfacePtr) + DataGlobalConstants::KelvinConv(); } else if (SELECT_CASE_var == iTranspiredCollectorCellIntegration) { GetUTSCTsColl(PVarray(PVnum).UTSCPtr, CellTemp); - CellTemp += KelvinConv; + CellTemp += DataGlobalConstants::KelvinConv(); } else if (SELECT_CASE_var == iExteriorVentedCavityCellIntegration) { GetExtVentedCavityTsColl(PVarray(PVnum).ExtVentCavPtr, CellTemp); - CellTemp += KelvinConv; + CellTemp += DataGlobalConstants::KelvinConv(); } else if (SELECT_CASE_var == iPVTSolarCollectorCellIntegration) { // get PVT model result for cell temp.. //Bug CellTemp not set but used below } else { @@ -1503,7 +1501,7 @@ namespace Photovoltaics { } // convert cell temperature back to C - CellTempC = CellTemp - KelvinConv; + CellTempC = CellTemp - DataGlobalConstants::KelvinConv(); // calculate array based outputs (so far, the outputs are module based IA = PVarray(PVnum).NumSeriesNParall * IM; @@ -2577,7 +2575,7 @@ namespace Photovoltaics { if (Ee > 0.0) { // following is equation 8 in King et al. nov. 2003 - dTc = DiodeFactor * ((1.38066e-23 * (Tc + KelvinConv)) / 1.60218e-19); + dTc = DiodeFactor * ((1.38066e-23 * (Tc + DataGlobalConstants::KelvinConv())) / 1.60218e-19); BVmpEe = BVmp0 + mBVmp * (1.0 - Ee); @@ -2640,7 +2638,7 @@ namespace Photovoltaics { Real64 BVocEe; // working variable if (Ee > 0.0) { - dTc = DiodeFactor * ((1.38066e-23 * (Tc + KelvinConv)) / 1.60218e-19); + dTc = DiodeFactor * ((1.38066e-23 * (Tc + DataGlobalConstants::KelvinConv())) / 1.60218e-19); BVocEe = BVoc0 + mBVoc * (1.0 - Ee); SandiaVoc = Voc0 + NcellSer * dTc * std::log(Ee) + BVocEe * (Tc - 25.0); diff --git a/src/EnergyPlus/PipeHeatTransfer.cc b/src/EnergyPlus/PipeHeatTransfer.cc index 475ce43d35e..75a93943769 100644 --- a/src/EnergyPlus/PipeHeatTransfer.cc +++ b/src/EnergyPlus/PipeHeatTransfer.cc @@ -270,7 +270,6 @@ namespace PipeHeatTransfer { int const NumPipeSections(20); int const NumberOfDepthNodes(8); // Number of nodes in the cartesian grid-Should be an even # for now Real64 const SecondsInHour(DataGlobalConstants::SecInHour()); - Real64 const HoursInDay(24.0); // SUBROUTINE LOCAL VARIABLE DECLARATIONS: bool ErrorsFound(false); // Set to true if errors in input, @@ -1278,7 +1277,6 @@ namespace PipeHeatTransfer { using DataEnvironment::SOLCOS; using DataEnvironment::WindSpeed; using DataGlobals::HourOfDay; - using DataGlobals::KelvinConv; using DataGlobals::TimeStep; using DataLoopNode::Node; @@ -1348,8 +1346,8 @@ namespace PipeHeatTransfer { // If on soil boundary, load up local variables and perform calculations NodePast = this->T(WidthIndex, DepthIndex, LengthIndex, PreviousTimeIndex); - PastNodeTempAbs = NodePast + KelvinConv; - SkyTempAbs = SkyTemp + KelvinConv; + PastNodeTempAbs = NodePast + DataGlobalConstants::KelvinConv(); + SkyTempAbs = SkyTemp + DataGlobalConstants::KelvinConv(); TopRoughness = this->SoilRoughness; TopThermAbs = this->SoilThermAbs; TopSolarAbs = this->SoilSolarAbs; diff --git a/src/EnergyPlus/Plant/PlantManager.cc b/src/EnergyPlus/Plant/PlantManager.cc index 413fb57fcb1..6c77b16ed2d 100644 --- a/src/EnergyPlus/Plant/PlantManager.cc +++ b/src/EnergyPlus/Plant/PlantManager.cc @@ -455,8 +455,8 @@ namespace EnergyPlus { // correct loop temperature step. Loop data is read in supply side, but the volume is not used in // a calculation there. this_loop.Volume = Num(5); - if (lNumericFieldBlanks(5)) this_loop.Volume = AutoCalculate; - if (this_loop.Volume == AutoCalculate) { + if (lNumericFieldBlanks(5)) this_loop.Volume = DataGlobalConstants::AutoCalculate(); + if (this_loop.Volume == DataGlobalConstants::AutoCalculate()) { this_loop.VolumeWasAutoSized = true; } // circulation time used to autocalculate loop volume @@ -3204,7 +3204,7 @@ namespace EnergyPlus { // should now have plant volume, calculate plant volume's mass for fluid type if (PlantLoop(LoopNum).FluidType == NodeType_Water) { - FluidDensity = GetDensityGlycol(state, PlantLoop(LoopNum).FluidName, InitConvTemp, + FluidDensity = GetDensityGlycol(state, PlantLoop(LoopNum).FluidName, DataGlobalConstants::InitConvTemp(), PlantLoop(LoopNum).FluidIndex, RoutineName); } else if (PlantLoop(LoopNum).FluidType == NodeType_Steam) { FluidDensity = GetSatDensityRefrig(state, fluidNameSteam, 100.0, 1.0, PlantLoop(LoopNum).FluidIndex, @@ -3334,7 +3334,7 @@ namespace EnergyPlus { // should now have plant volume, calculate plant volume's mass for fluid type if (PlantLoop(LoopNum).FluidType == NodeType_Water) { - FluidDensity = GetDensityGlycol(state, PlantLoop(LoopNum).FluidName, InitConvTemp, + FluidDensity = GetDensityGlycol(state, PlantLoop(LoopNum).FluidName, DataGlobalConstants::InitConvTemp(), PlantLoop(LoopNum).FluidIndex, RoutineName); } else if (PlantLoop(LoopNum).FluidType == NodeType_Steam) { FluidDensity = GetSatDensityRefrig(state, fluidNameSteam, 100.0, 1.0, PlantLoop(LoopNum).FluidIndex, diff --git a/src/EnergyPlus/PlantCentralGSHP.cc b/src/EnergyPlus/PlantCentralGSHP.cc index afd01763594..78f3d52b40e 100644 --- a/src/EnergyPlus/PlantCentralGSHP.cc +++ b/src/EnergyPlus/PlantCentralGSHP.cc @@ -348,12 +348,12 @@ namespace PlantCentralGSHP { if (PltSizNum > 0) { if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow && tmpEvapVolFlowRate > 0.0) { Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); tmpNomCap = Cp * rho * DataSizing::PlantSizData(PltSizNum).DeltaT * tmpEvapVolFlowRate; @@ -442,7 +442,7 @@ namespace PlantCentralGSHP { if (PltSizCondNum > 0) { if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->GLHELoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->GLHELoopNum).FluidIndex, RoutineName); // TODO: JM 2018-12-06 I wonder why Cp isn't calculated at the same temp as rho... @@ -1569,7 +1569,7 @@ namespace PlantCentralGSHP { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); @@ -1814,7 +1814,7 @@ namespace PlantCentralGSHP { // Hot water temperature is known, but evaporator mass flow rates will be adjusted in the following "Do" loop Real64 InitDensity = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); Real64 EvapDensity = FluidProperties::GetDensityGlycol( @@ -2239,7 +2239,7 @@ namespace PlantCentralGSHP { // Hot water temperature is known, but condenser mass flow rates will be adjusted in the following "Do" loop Real64 InitDensity = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); Real64 EvapDensity = FluidProperties::GetDensityGlycol( diff --git a/src/EnergyPlus/PlantChillers.cc b/src/EnergyPlus/PlantChillers.cc index f49043b23cb..8ef33ed2984 100644 --- a/src/EnergyPlus/PlantChillers.cc +++ b/src/EnergyPlus/PlantChillers.cc @@ -848,7 +848,7 @@ namespace PlantChillers { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); @@ -869,7 +869,7 @@ namespace PlantChillers { rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CDLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); @@ -902,7 +902,7 @@ namespace PlantChillers { if (this->HeatRecActive) { rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->HRLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(this->HRLoopNum).FluidIndex, RoutineName); this->DesignHeatRecMassFlowRate = rho * this->DesignHeatRecVolFlowRate; @@ -1050,12 +1050,12 @@ namespace PlantChillers { if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); tmpNomCap = Cp * rho * DataSizing::PlantSizData(PltSizNum).DeltaT * DataSizing::PlantSizData(PltSizNum).DesVolFlowRate * this->SizFac; @@ -2789,7 +2789,7 @@ namespace PlantChillers { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); @@ -2811,7 +2811,7 @@ namespace PlantChillers { rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CDLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); @@ -2842,7 +2842,7 @@ namespace PlantChillers { if (this->HeatRecActive) { rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->HRLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(this->HRLoopNum).FluidIndex, RoutineName); this->DesignHeatRecMassFlowRate = rho * this->DesignHeatRecVolFlowRate; @@ -2949,12 +2949,12 @@ namespace PlantChillers { if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); tmpNomCap = Cp * rho * DataSizing::PlantSizData(PltSizNum).DeltaT * DataSizing::PlantSizData(PltSizNum).DesVolFlowRate * this->SizFac; @@ -4657,7 +4657,7 @@ namespace PlantChillers { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); @@ -4678,7 +4678,7 @@ namespace PlantChillers { rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CDLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); @@ -4709,7 +4709,7 @@ namespace PlantChillers { if (this->HeatRecActive) { rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->HRLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(this->HRLoopNum).FluidIndex, RoutineName); this->DesignHeatRecMassFlowRate = rho * this->DesignHeatRecVolFlowRate; @@ -4816,12 +4816,12 @@ namespace PlantChillers { if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); tmpNomCap = Cp * rho * DataSizing::PlantSizData(PltSizNum).DeltaT * DataSizing::PlantSizData(PltSizNum).DesVolFlowRate * this->SizFac; @@ -6341,7 +6341,7 @@ namespace PlantChillers { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); this->EvapMassFlowRateMax = this->EvapVolFlowRate * rho; @@ -6361,7 +6361,7 @@ namespace PlantChillers { rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CDLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); @@ -6470,12 +6470,12 @@ namespace PlantChillers { if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); tmpNomCap = Cp * rho * DataSizing::PlantSizData(PltSizNum).DeltaT * DataSizing::PlantSizData(PltSizNum).DesVolFlowRate * this->SizFac; diff --git a/src/EnergyPlus/PlantComponentTemperatureSources.cc b/src/EnergyPlus/PlantComponentTemperatureSources.cc index 909b5783813..a8bc54022c0 100644 --- a/src/EnergyPlus/PlantComponentTemperatureSources.cc +++ b/src/EnergyPlus/PlantComponentTemperatureSources.cc @@ -173,7 +173,7 @@ namespace PlantComponentTemperatureSources { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->Location.loopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->Location.loopNum).FluidIndex, RoutineName); this->MassFlowRateMax = this->DesVolFlowRate * rho; diff --git a/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc b/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc index 3b2dca6d109..bd5efc8e224 100644 --- a/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc +++ b/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc @@ -784,7 +784,7 @@ namespace PlantHeatExchangerFluidToFluid { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->DemandSideLoop.loopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->DemandSideLoop.loopNum).FluidIndex, RoutineNameNoColon); this->DemandSideLoop.MassFlowRateMax = rho * this->DemandSideLoop.DesignVolumeFlowRate; @@ -799,7 +799,7 @@ namespace PlantHeatExchangerFluidToFluid { rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->SupplySideLoop.loopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->SupplySideLoop.loopNum).FluidIndex, RoutineNameNoColon); this->SupplySideLoop.MassFlowRateMax = rho * this->SupplySideLoop.DesignVolumeFlowRate; @@ -940,13 +940,13 @@ namespace PlantHeatExchangerFluidToFluid { Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->SupplySideLoop.loopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->SupplySideLoop.loopNum).FluidIndex, RoutineName); Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->SupplySideLoop.loopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->SupplySideLoop.loopNum).FluidIndex, RoutineName); @@ -1025,13 +1025,13 @@ namespace PlantHeatExchangerFluidToFluid { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->SupplySideLoop.loopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->SupplySideLoop.loopNum).FluidIndex, RoutineName); Real64 SupSideMdot = this->SupplySideLoop.DesignVolumeFlowRate * rho; rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->DemandSideLoop.loopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->DemandSideLoop.loopNum).FluidIndex, RoutineName); Real64 DmdSideMdot = this->DemandSideLoop.DesignVolumeFlowRate * rho; diff --git a/src/EnergyPlus/PlantLoadProfile.cc b/src/EnergyPlus/PlantLoadProfile.cc index 780323ec5d6..6ae052c9611 100644 --- a/src/EnergyPlus/PlantLoadProfile.cc +++ b/src/EnergyPlus/PlantLoadProfile.cc @@ -236,7 +236,7 @@ namespace PlantLoadProfile { Node(OutletNode).Temp = 0.0; FluidDensityInit = - GetDensityGlycol(state, PlantLoop(this->WLoopNum).FluidName, DataGlobals::InitConvTemp, PlantLoop(this->WLoopNum).FluidIndex, RoutineName); + GetDensityGlycol(state, PlantLoop(this->WLoopNum).FluidName, DataGlobalConstants::InitConvTemp(), PlantLoop(this->WLoopNum).FluidIndex, RoutineName); Real64 MaxFlowMultiplier = GetScheduleMaxValue(this->FlowRateFracSchedule); diff --git a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc index ea0b809cce8..ebece3f985f 100644 --- a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc +++ b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc @@ -500,7 +500,7 @@ namespace EIRPlantLoopHeatPumps { if (DataGlobals::BeginEnvrnFlag && this->envrnInit && DataPlant::PlantFirstSizesOkayToFinalize) { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->loadSideLocation.loopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->loadSideLocation.loopNum).FluidIndex, routineName); this->loadSideDesignMassFlowRate = rho * this->loadSideDesignVolFlowRate; @@ -516,7 +516,7 @@ namespace EIRPlantLoopHeatPumps { if (this->waterSource) { rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->sourceSideLocation.loopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->sourceSideLocation.loopNum).FluidIndex, routineName); this->sourceSideDesignMassFlowRate = rho * this->sourceSideDesignVolFlowRate; @@ -575,9 +575,9 @@ namespace EIRPlantLoopHeatPumps { Real64 tmpLoadVolFlow = this->loadSideDesignVolFlowRate; std::string const typeName = DataPlant::ccSimPlantEquipTypes(this->plantTypeOfNum); - Real64 loadSideInitTemp = DataGlobals::CWInitConvTemp; + Real64 loadSideInitTemp = DataGlobalConstants::CWInitConvTemp(); if (this->plantTypeOfNum == DataPlant::TypeOf_HeatPumpEIRHeating) { - loadSideInitTemp = DataGlobals::HWInitConvTemp; + loadSideInitTemp = DataGlobalConstants::HWInitConvTemp(); } Real64 const rho = FluidProperties::GetDensityGlycol(state, @@ -755,9 +755,9 @@ namespace EIRPlantLoopHeatPumps { Real64 tmpSourceVolFlow; std::string const typeName = DataPlant::ccSimPlantEquipTypes(this->plantTypeOfNum); - Real64 sourceSideInitTemp = DataGlobals::HWInitConvTemp; + Real64 sourceSideInitTemp = DataGlobalConstants::HWInitConvTemp(); if (this->plantTypeOfNum == DataPlant::TypeOf_HeatPumpEIRHeating) { - sourceSideInitTemp = DataGlobals::CWInitConvTemp; + sourceSideInitTemp = DataGlobalConstants::CWInitConvTemp(); } Real64 const rhoSrc = FluidProperties::GetDensityGlycol(state, diff --git a/src/EnergyPlus/PlantPipingSystemsManager.cc b/src/EnergyPlus/PlantPipingSystemsManager.cc index 763ffb08660..503ecebf44c 100644 --- a/src/EnergyPlus/PlantPipingSystemsManager.cc +++ b/src/EnergyPlus/PlantPipingSystemsManager.cc @@ -2157,7 +2157,7 @@ namespace EnergyPlus { // Once we find ourselves on the plant loop, we can do other things Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(thisCircuit->LoopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(thisCircuit->LoopNum).FluidIndex, RoutineName); thisCircuit->DesignMassFlowRate = thisCircuit->DesignVolumeFlowRate * rho; diff --git a/src/EnergyPlus/PondGroundHeatExchanger.cc b/src/EnergyPlus/PondGroundHeatExchanger.cc index c061acd6606..217d6812651 100644 --- a/src/EnergyPlus/PondGroundHeatExchanger.cc +++ b/src/EnergyPlus/PondGroundHeatExchanger.cc @@ -596,8 +596,8 @@ namespace PondGroundHeatExchanger { } // absolute temperatures - Real64 SurfTempAbs = PondBulkTemp + DataGlobals::KelvinConv; // absolute value of surface temp - Real64 SkyTempAbs = DataEnvironment::SkyTemp + DataGlobals::KelvinConv; // absolute value of sky temp + Real64 SurfTempAbs = PondBulkTemp + DataGlobalConstants::KelvinConv(); // absolute value of surface temp + Real64 SkyTempAbs = DataEnvironment::SkyTemp + DataGlobalConstants::KelvinConv(); // absolute value of sky temp // ASHRAE simple convection coefficient model for external surfaces. Real64 ConvCoef = ConvectionCoefficients::CalcASHRAESimpExtConvectCoeff(DataHeatBalance::VeryRough, DataEnvironment::WindSpeedAt(PondHeight)); diff --git a/src/EnergyPlus/PoweredInductionUnits.cc b/src/EnergyPlus/PoweredInductionUnits.cc index 01f8f3aa16f..9574809e53f 100644 --- a/src/EnergyPlus/PoweredInductionUnits.cc +++ b/src/EnergyPlus/PoweredInductionUnits.cc @@ -866,7 +866,7 @@ namespace PoweredInductionUnits { // plant upgrade note? why no separate handling of steam coil? add it ? rho = GetDensityGlycol(state, PlantLoop(PIU(PIUNum).HWLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(PIU(PIUNum).HWLoopNum).FluidIndex, RoutineName); @@ -1339,12 +1339,12 @@ namespace PoweredInductionUnits { rho = GetDensityGlycol(state, PlantLoop(PIU(PIUNum).HWLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(PIU(PIUNum).HWLoopNum).FluidIndex, RoutineName); Cp = GetSpecificHeatGlycol(state, PlantLoop(PIU(PIUNum).HWLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(PIU(PIUNum).HWLoopNum).FluidIndex, RoutineName); diff --git a/src/EnergyPlus/Psychrometrics.cc b/src/EnergyPlus/Psychrometrics.cc index b72b1afd639..683c1424563 100644 --- a/src/EnergyPlus/Psychrometrics.cc +++ b/src/EnergyPlus/Psychrometrics.cc @@ -882,14 +882,14 @@ namespace Psychrometrics { #endif // Convert temperature from Centigrade to Kelvin. - Real64 const Tkel(T + KelvinConv); // Dry-bulb in REAL(r64) for function passing + Real64 const Tkel(T + DataGlobalConstants::KelvinConv()); // Dry-bulb in REAL(r64) for function passing // If below -100C,set value of Pressure corresponding to Saturation Temperature of -100C. if (Tkel < 173.15) { Pascal = 0.0017; // If below freezing, calculate saturation pressure over ice. - } else if (Tkel < KelvinConv) { // Tkel >= 173.15 + } else if (Tkel < DataGlobalConstants::KelvinConv()) { // Tkel >= 173.15 Real64 const C1(-5674.5359); // Coefficient for TKel < KelvinConvK Real64 const C2(6.3925247); // Coefficient for TKel < KelvinConvK Real64 const C3(-0.9677843e-2); // Coefficient for TKel < KelvinConvK diff --git a/src/EnergyPlus/Psychrometrics.hh b/src/EnergyPlus/Psychrometrics.hh index 33ae096ede9..da304c4cda9 100644 --- a/src/EnergyPlus/Psychrometrics.hh +++ b/src/EnergyPlus/Psychrometrics.hh @@ -269,7 +269,7 @@ namespace Psychrometrics { // Wylan & Sontag, Fundamentals of Classical Thermodynamics. // ASHRAE handbook 1985 Fundamentals, Ch. 6, eqn. (6),(26) - Real64 const rhoair(pb / (287.0 * (tdb + KelvinConv) * (1.0 + 1.6077687 * max(dw, 1.0e-5)))); + Real64 const rhoair(pb / (287.0 * (tdb + DataGlobalConstants::KelvinConv()) * (1.0 + 1.6077687 * max(dw, 1.0e-5)))); #ifdef EP_psych_errors if (rhoair < 0.0) PsyRhoAirFnPbTdbW_error(pb, tdb, dw, rhoair, CalledFrom); #endif @@ -283,7 +283,7 @@ namespace Psychrometrics { { // Faster version with humidity ratio already adjusted assert(dw >= 1.0e-5); - Real64 const rhoair(pb / (287.0 * (tdb + KelvinConv) * (1.0 + 1.6077687 * dw))); + Real64 const rhoair(pb / (287.0 * (tdb + DataGlobalConstants::KelvinConv()) * (1.0 + 1.6077687 * dw))); #ifdef EP_psych_errors if (rhoair < 0.0) PsyRhoAirFnPbTdbW_error(pb, tdb, dw, rhoair); #endif @@ -479,7 +479,7 @@ namespace Psychrometrics { // REFERENCES: // ASHRAE handbook 1993 Fundamentals, - return RH / (461.52 * (Tdb + KelvinConv)) * std::exp(23.7093 - 4111.0 / ((Tdb + KelvinConv) - 35.45)); // Vapor density in air + return RH / (461.52 * (Tdb + DataGlobalConstants::KelvinConv())) * std::exp(23.7093 - 4111.0 / ((Tdb + DataGlobalConstants::KelvinConv()) - 35.45)); // Vapor density in air } inline Real64 PsyRhovFnTdbWPb(Real64 const Tdb, // dry-bulb temperature {C} @@ -505,7 +505,7 @@ namespace Psychrometrics { // ASHRAE handbook 1993 Fundamentals, Real64 const W(max(dW, 1.0e-5)); // humidity ratio - return W * PB / (461.52 * (Tdb + KelvinConv) * (W + 0.62198)); + return W * PB / (461.52 * (Tdb + DataGlobalConstants::KelvinConv()) * (W + 0.62198)); } inline Real64 PsyRhovFnTdbWPb_fast(Real64 const Tdb, // dry-bulb temperature {C} @@ -515,7 +515,7 @@ namespace Psychrometrics { { // Faster version with humidity ratio already adjusted assert(dW >= 1.0e-5); - return dW * PB / (461.52 * (Tdb + KelvinConv) * (dW + 0.62198)); + return dW * PB / (461.52 * (Tdb + DataGlobalConstants::KelvinConv()) * (dW + 0.62198)); } #ifdef EP_psych_errors @@ -553,7 +553,7 @@ namespace Psychrometrics { ++NumTimesCalled(iPsyRhFnTdbRhovLBnd0C); #endif - Real64 const RHValue(Rhovapor > 0.0 ? Rhovapor * 461.52 * (Tdb + KelvinConv) * std::exp(-23.7093 + 4111.0 / ((Tdb + KelvinConv) - 35.45)) + Real64 const RHValue(Rhovapor > 0.0 ? Rhovapor * 461.52 * (Tdb + DataGlobalConstants::KelvinConv()) * std::exp(-23.7093 + 4111.0 / ((Tdb + DataGlobalConstants::KelvinConv()) - 35.45)) : 0.0); if ((RHValue < 0.0) || (RHValue > 1.0)) { @@ -819,7 +819,7 @@ namespace Psychrometrics { // Used values from Table 2, HOF 2005, Chapter 6, to verify that these values match (at saturation) // values from PsyRhFnTdbWPb - return (PsyPsatFnTemp(Tdb, CalledFrom) * RH) / (461.52 * (Tdb + KelvinConv)); // Vapor density in air + return (PsyPsatFnTemp(Tdb, CalledFrom) * RH) / (461.52 * (Tdb + DataGlobalConstants::KelvinConv())); // Vapor density in air } #ifdef EP_psych_errors @@ -862,7 +862,7 @@ namespace Psychrometrics { ++NumTimesCalled(iPsyRhFnTdbRhov); #endif - Real64 const RHValue(Rhovapor > 0.0 ? Rhovapor * 461.52 * (Tdb + KelvinConv) / PsyPsatFnTemp(Tdb, RoutineName) : 0.0); + Real64 const RHValue(Rhovapor > 0.0 ? Rhovapor * 461.52 * (Tdb + DataGlobalConstants::KelvinConv()) / PsyPsatFnTemp(Tdb, RoutineName) : 0.0); if ((RHValue < 0.0) || (RHValue > 1.0)) { #ifdef EP_psych_errors @@ -1303,8 +1303,8 @@ namespace Psychrometrics { // postive value is heating, negative value is cooling // When called across a component (from PsyDeltaHSenFnTdb2W2Tdb1W1 by CalcComponentSensibleLatentOutput): - // returns sensible enthalpy difference between state 1 (TDB1) and state 2 (TDB2) using the minimum - // humidity ratio from states 1 and 2. This enthalpy difference multiplied by supply air mass flow + // returns sensible enthalpy difference between state 1 (TDB1) and state 2 (TDB2) using the minimum + // humidity ratio from states 1 and 2. This enthalpy difference multiplied by supply air mass flow // rate yields the sensible heat transfer rate in Watts. // postive value is heating, negative value is cooling diff --git a/src/EnergyPlus/Pumps.cc b/src/EnergyPlus/Pumps.cc index 4d7b9573159..5ed61889a62 100644 --- a/src/EnergyPlus/Pumps.cc +++ b/src/EnergyPlus/Pumps.cc @@ -798,7 +798,7 @@ namespace Pumps { } else { // Calc Condensate Pump Water Volume Flow Rate SteamDensity = GetSatDensityRefrig(state, fluidNameSteam, StartTemp, 1.0, PumpEquip(PumpNum).FluidIndex, RoutineNameNoColon); - TempWaterDensity = GetDensityGlycol(state, fluidNameWater, DataGlobals::InitConvTemp, DummyWaterIndex, RoutineName); + TempWaterDensity = GetDensityGlycol(state, fluidNameWater, DataGlobalConstants::InitConvTemp(), DummyWaterIndex, RoutineName); PumpEquip(PumpNum).NomVolFlowRate = (PumpEquip(PumpNum).NomSteamVolFlowRate * SteamDensity) / TempWaterDensity; } @@ -1440,7 +1440,7 @@ namespace Pumps { if (PumpEquip(PumpNum).PumpInitFlag && BeginEnvrnFlag) { if (PumpEquip(PumpNum).PumpType == Pump_Cond) { - TempWaterDensity = GetDensityGlycol(state, fluidNameWater, DataGlobals::InitConvTemp, DummyWaterIndex, RoutineName); + TempWaterDensity = GetDensityGlycol(state, fluidNameWater, DataGlobalConstants::InitConvTemp(), DummyWaterIndex, RoutineName); SteamDensity = GetSatDensityRefrig(state, fluidNameSteam, StartTemp, 1.0, PumpEquip(PumpNum).FluidIndex, RoutineName); PumpEquip(PumpNum).NomVolFlowRate = (PumpEquip(PumpNum).NomSteamVolFlowRate * SteamDensity) / TempWaterDensity; @@ -1468,7 +1468,7 @@ namespace Pumps { } else { TempWaterDensity = GetDensityGlycol(state, PlantLoop(PumpEquip(PumpNum).LoopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), PlantLoop(PumpEquip(PumpNum).LoopNum).FluidIndex, RoutineName); mdotMax = PumpEquip(PumpNum).NomVolFlowRate * TempWaterDensity; @@ -2052,11 +2052,11 @@ namespace Pumps { if (PumpEquip(PumpNum).LoopNum > 0) { TempWaterDensity = GetDensityGlycol(state, PlantLoop(PumpEquip(PumpNum).LoopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), PlantLoop(PumpEquip(PumpNum).LoopNum).FluidIndex, RoutineName); } else { - TempWaterDensity = GetDensityGlycol(state, fluidNameWater, DataGlobals::InitConvTemp, DummyWaterIndex, RoutineName); + TempWaterDensity = GetDensityGlycol(state, fluidNameWater, DataGlobalConstants::InitConvTemp(), DummyWaterIndex, RoutineName); } // note: we assume pump impeller efficiency is 78% for autosizing @@ -2104,7 +2104,7 @@ namespace Pumps { if (!PlantLoop(PumpEquip(PumpNum).LoopNum).LoopSide(PumpEquip(PumpNum).LoopSideNum).BranchPumpsExist) { // size pump to full flow of plant loop if (PumpEquip(PumpNum).PumpType == Pump_Cond) { - TempWaterDensity = GetDensityGlycol(state, fluidNameWater, DataGlobals::InitConvTemp, DummyWaterIndex, RoutineName); + TempWaterDensity = GetDensityGlycol(state, fluidNameWater, DataGlobalConstants::InitConvTemp(), DummyWaterIndex, RoutineName); SteamDensity = GetSatDensityRefrig(state, fluidNameSteam, StartTemp, 1.0, PumpEquip(PumpNum).FluidIndex, RoutineNameSizePumps); PumpEquip(PumpNum).NomSteamVolFlowRate = PlantSizData(PlantSizNum).DesVolFlowRate * PumpSizFac; PumpEquip(PumpNum).NomVolFlowRate = PumpEquip(PumpNum).NomSteamVolFlowRate * SteamDensity / TempWaterDensity; @@ -2116,7 +2116,7 @@ namespace Pumps { DesVolFlowRatePerBranch = PlantSizData(PlantSizNum).DesVolFlowRate / PlantLoop(PumpEquip(PumpNum).LoopNum).LoopSide(PumpEquip(PumpNum).LoopSideNum).TotalPumps; if (PumpEquip(PumpNum).PumpType == Pump_Cond) { - TempWaterDensity = GetDensityGlycol(state, fluidNameWater, DataGlobals::InitConvTemp, DummyWaterIndex, RoutineName); + TempWaterDensity = GetDensityGlycol(state, fluidNameWater, DataGlobalConstants::InitConvTemp(), DummyWaterIndex, RoutineName); SteamDensity = GetSatDensityRefrig(state, fluidNameSteam, StartTemp, 1.0, PumpEquip(PumpNum).FluidIndex, RoutineNameSizePumps); PumpEquip(PumpNum).NomSteamVolFlowRate = DesVolFlowRatePerBranch * PumpSizFac; PumpEquip(PumpNum).NomVolFlowRate = PumpEquip(PumpNum).NomSteamVolFlowRate * SteamDensity / TempWaterDensity; diff --git a/src/EnergyPlus/RefrigeratedCase.cc b/src/EnergyPlus/RefrigeratedCase.cc index fd79ff1378f..4da8122269a 100644 --- a/src/EnergyPlus/RefrigeratedCase.cc +++ b/src/EnergyPlus/RefrigeratedCase.cc @@ -2846,7 +2846,7 @@ namespace RefrigeratedCase { RefrigRack(RackNum).CondenserAirFlowRate = Numbers(8); if (RefrigRack(RackNum).CondenserType == DataHeatBalance::RefrigCondenserTypeEvap && - RefrigRack(RackNum).CondenserAirFlowRate <= 0.0 && RefrigRack(RackNum).CondenserAirFlowRate != DataGlobals::AutoCalculate) { + RefrigRack(RackNum).CondenserAirFlowRate <= 0.0 && RefrigRack(RackNum).CondenserAirFlowRate != DataGlobalConstants::AutoCalculate()) { ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + RefrigRack(RackNum).Name + "\", " + cNumericFieldNames(8) + " cannot be less than or equal to zero."); ErrorsFound = true; @@ -2869,7 +2869,7 @@ namespace RefrigeratedCase { RefrigRack(RackNum).EvapPumpPower = Numbers(11); if (RefrigRack(RackNum).CondenserType == DataHeatBalance::RefrigCondenserTypeEvap && RefrigRack(RackNum).EvapPumpPower < 0.0 && - RefrigRack(RackNum).EvapPumpPower != DataGlobals::AutoCalculate) { + RefrigRack(RackNum).EvapPumpPower != DataGlobalConstants::AutoCalculate()) { ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + RefrigRack(RackNum).Name + "\", " + cNumericFieldNames(11) + " cannot be less than zero."); ErrorsFound = true; @@ -3054,12 +3054,12 @@ namespace RefrigeratedCase { // set condenser air flow and evap water pump power if autocalculated // autocalculate condenser evap water pump if needed if (RefrigRack(RackNum).CondenserType == DataHeatBalance::RefrigCondenserTypeEvap && - RefrigRack(RackNum).EvapPumpPower == DataGlobals::AutoCalculate) { + RefrigRack(RackNum).EvapPumpPower == DataGlobalConstants::AutoCalculate()) { RefrigRack(RackNum).EvapPumpPower = CondPumpRatePower * RefrigRack(RackNum).TotalRackLoad; } // autocalculate evap condenser air volume flow rate if needed if (RefrigRack(RackNum).CondenserType == DataHeatBalance::RefrigCondenserTypeEvap && - RefrigRack(RackNum).CondenserAirFlowRate == DataGlobals::AutoCalculate) { + RefrigRack(RackNum).CondenserAirFlowRate == DataGlobalConstants::AutoCalculate()) { RefrigRack(RackNum).CondenserAirFlowRate = AirVolRateEvapCond * RefrigRack(RackNum).TotalRackLoad; } @@ -5078,7 +5078,7 @@ namespace RefrigeratedCase { // Now do evaporative condenser auto sizing because it is a function of the system's cooling load if (Condenser(CondNum).CondenserType == DataHeatBalance::RefrigCondenserTypeEvap) { - if (Condenser(CondNum).RatedAirFlowRate == DataGlobals::AutoCalculate) { + if (Condenser(CondNum).RatedAirFlowRate == DataGlobalConstants::AutoCalculate()) { Condenser(CondNum).RatedAirFlowRate = AirVolRateEvapCond * Condenser(CondNum).RatedCapacity; } if (Condenser(CondNum).RatedAirFlowRate <= 0.0) { @@ -5086,7 +5086,7 @@ namespace RefrigeratedCase { "\", Evaporative Condenser Air Volume Flow Rate cannot be less than or equal to zero."); ErrorsFound = true; } - if (Condenser(CondNum).EvapPumpPower == DataGlobals::AutoCalculate) { + if (Condenser(CondNum).EvapPumpPower == DataGlobalConstants::AutoCalculate()) { Condenser(CondNum).EvapPumpPower = CondPumpRatePower * Condenser(CondNum).RatedCapacity; } if (Condenser(CondNum).EvapPumpPower < 0.0) { diff --git a/src/EnergyPlus/ReportCoilSelection.cc b/src/EnergyPlus/ReportCoilSelection.cc index fe4d118bd14..4a7d6dddc8b 100644 --- a/src/EnergyPlus/ReportCoilSelection.cc +++ b/src/EnergyPlus/ReportCoilSelection.cc @@ -733,13 +733,13 @@ void ReportCoilSelection::doFinalProcessingOfCoilData(EnergyPlusData &state) if (DataSizing::PlantSizData(c->pltSizNum).LoopType != DataSizing::SteamLoop) { c->rhoFluid = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(c->waterLoopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(c->waterLoopNum).FluidIndex, "ReportCoilSelection::doFinalProcessingOfCoilData"); c->cpFluid = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(c->waterLoopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(c->waterLoopNum).FluidIndex, "ReportCoilSelection::doFinalProcessingOfCoilData"); } else { // steam loop @@ -1022,13 +1022,13 @@ void ReportCoilSelection::setCoilWaterFlowPltSizNum(EnergyPlusData &state, if (DataSizing::PlantSizData(c->pltSizNum).LoopType != DataSizing::SteamLoop) { c->rhoFluid = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(c->waterLoopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(c->waterLoopNum).FluidIndex, "ReportCoilSelection::setCoilWaterFlow"); c->cpFluid = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(c->waterLoopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(c->waterLoopNum).FluidIndex, "ReportCoilSelection::setCoilWaterFlow"); } else { // steam loop diff --git a/src/EnergyPlus/ResultsFramework.cc b/src/EnergyPlus/ResultsFramework.cc index bf34c9bd68b..2a0f0c6232e 100644 --- a/src/EnergyPlus/ResultsFramework.cc +++ b/src/EnergyPlus/ResultsFramework.cc @@ -77,7 +77,6 @@ namespace ResultsFramework { using namespace OutputProcessor; using DataGlobals::DisplayExtraWarnings; - using DataGlobals::InitConvTemp; using OutputProcessor::RealVariableType; using OutputProcessor::RealVariables; diff --git a/src/EnergyPlus/SingleDuct.cc b/src/EnergyPlus/SingleDuct.cc index c0bf8454f5b..e05a5045856 100644 --- a/src/EnergyPlus/SingleDuct.cc +++ b/src/EnergyPlus/SingleDuct.cc @@ -679,7 +679,7 @@ namespace SingleDuct { } } } - if (Numbers(7) == AutoCalculate) { + if (Numbers(7) == DataGlobalConstants::AutoCalculate()) { sd_airterminal(SysNum).MaxAirVolFlowRateDuringReheat = Numbers(7); } else { sd_airterminal(SysNum).MaxAirVolFlowRateDuringReheat = Numbers(7) * sd_airterminal(SysNum).ZoneFloorArea; @@ -2238,7 +2238,7 @@ namespace SingleDuct { if (this->HWLoopNum > 0 && this->ReheatComp_Num != HCoilType_SteamAirHeating) { // protect early calls before plant is setup rho = GetDensityGlycol( - state, PlantLoop(this->HWLoopNum).FluidName, DataGlobals::HWInitConvTemp, PlantLoop(this->HWLoopNum).FluidIndex, RoutineName); + state, PlantLoop(this->HWLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp(), PlantLoop(this->HWLoopNum).FluidIndex, RoutineName); } else { rho = 1000.0; } @@ -2461,7 +2461,6 @@ namespace SingleDuct { // Obtains flow rates from the zone or system sizing arrays. // Using/Aliasing - using DataGlobals::AutoCalculate; using DataHeatBalance::Zone; using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; @@ -2816,7 +2815,7 @@ namespace SingleDuct { } else { MaxAirVolFractionDuringReheatDes = 0.0; } - if (this->MaxAirVolFlowRateDuringReheat == AutoCalculate && this->MaxAirVolFractionDuringReheat == AutoCalculate) { + if (this->MaxAirVolFlowRateDuringReheat == DataGlobalConstants::AutoCalculate() && this->MaxAirVolFractionDuringReheat == DataGlobalConstants::AutoCalculate()) { // if both inputs are autosize (the default) report both out and save in the Sys array. BaseSizer::reportSizerOutput( this->SysType, this->SysName, "Design Size Maximum Flow Fraction during Reheat []", MaxAirVolFractionDuringReheatDes); @@ -2828,7 +2827,7 @@ namespace SingleDuct { } this->MaxAirVolFlowRateDuringReheat = MaxAirVolFlowRateDuringReheatDes; this->MaxAirVolFractionDuringReheat = MaxAirVolFractionDuringReheatDes; - } else if (this->MaxAirVolFlowRateDuringReheat == AutoCalculate && this->MaxAirVolFractionDuringReheat != AutoCalculate) { + } else if (this->MaxAirVolFlowRateDuringReheat == DataGlobalConstants::AutoCalculate() && this->MaxAirVolFractionDuringReheat != DataGlobalConstants::AutoCalculate()) { // if max reheat flow fraction was input, set the max reheat flow design value correspondingly, report both out. // Check for optional caution message that user input value is not within 10% of the design value. MaxAirVolFlowRateDuringReheatDes = this->MaxAirVolFractionDuringReheat * this->MaxAirVolFlowRate; @@ -2859,7 +2858,7 @@ namespace SingleDuct { ShowContinueError("Verify that the value entered is intended and is consistent with other components."); } } - } else if (this->MaxAirVolFlowRateDuringReheat != AutoCalculate && this->MaxAirVolFractionDuringReheat == AutoCalculate) { + } else if (this->MaxAirVolFlowRateDuringReheat != DataGlobalConstants::AutoCalculate() && this->MaxAirVolFractionDuringReheat == DataGlobalConstants::AutoCalculate()) { // if max reheat flow was input set the design max reheat flow frac to the corresponding value, report both out, save the design value // of the flow frac in Sys. Check for optional caution message that user input value is not within 10% of the design value. if (this->MaxAirVolFlowRate > 0.0) { @@ -3073,12 +3072,12 @@ namespace SingleDuct { if (DesCoilLoad >= SmallLoad) { rho = GetDensityGlycol(state, PlantLoop(this->HWLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(this->HWLoopNum).FluidIndex, RoutineName); Cp = GetSpecificHeatGlycol(state, PlantLoop(this->HWLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(this->HWLoopNum).FluidIndex, RoutineName); diff --git a/src/EnergyPlus/SolarCollectors.cc b/src/EnergyPlus/SolarCollectors.cc index a06cf7aabff..13c713d5f2d 100644 --- a/src/EnergyPlus/SolarCollectors.cc +++ b/src/EnergyPlus/SolarCollectors.cc @@ -246,7 +246,7 @@ namespace SolarCollectors { } if (DataIPShortCuts::rNumericArgs(2) > 0.0) { - Parameters(ParametersNum).TestMassFlowRate = DataIPShortCuts::rNumericArgs(2) * Psychrometrics::RhoH2O(DataGlobals::InitConvTemp); + Parameters(ParametersNum).TestMassFlowRate = DataIPShortCuts::rNumericArgs(2) * Psychrometrics::RhoH2O(DataGlobalConstants::InitConvTemp()); } else { ShowSevereError(CurrentModuleParamObject + " = " + DataIPShortCuts::cAlphaArgs(1) + ": flow rate must be greater than zero for " + DataIPShortCuts::cNumericFieldNames(2)); @@ -828,7 +828,7 @@ namespace SolarCollectors { if (this->VolFlowRateMax > 0) { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->WLoopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->WLoopNum).FluidIndex, RoutineName); @@ -1680,8 +1680,8 @@ namespace SolarCollectors { auto const SELECT_CASE_var(NumCovers); if (SELECT_CASE_var == 1) { // calc linearized radiation coefficient - tempnom = DataGlobals::StefanBoltzmann * ((TempAbsPlate + DataGlobals::KelvinConv) + (TempOuterCover + DataGlobals::KelvinConv)) * - (pow_2(TempAbsPlate + DataGlobals::KelvinConv) + pow_2(TempOuterCover + DataGlobals::KelvinConv)); + tempnom = DataGlobalConstants::StefanBoltzmann() * ((TempAbsPlate + DataGlobalConstants::KelvinConv()) + (TempOuterCover + DataGlobalConstants::KelvinConv())) * + (pow_2(TempAbsPlate + DataGlobalConstants::KelvinConv()) + pow_2(TempOuterCover + DataGlobalConstants::KelvinConv())); tempdenom = 1.0 / EmissOfAbsPlate + 1.0 / EmissOfOuterCover - 1.0; hRadCoefA2C = tempnom / tempdenom; hRadCoefC2C = 0.0; @@ -1693,9 +1693,9 @@ namespace SolarCollectors { for (int CoverNum = 1; CoverNum <= NumCovers; ++CoverNum) { if (CoverNum == 1) { // calc linearized radiation coefficient - tempnom = DataGlobals::StefanBoltzmann * - ((TempAbsPlate + DataGlobals::KelvinConv) + (TempInnerCover + DataGlobals::KelvinConv)) * - (pow_2(TempAbsPlate + DataGlobals::KelvinConv) + pow_2(TempInnerCover + DataGlobals::KelvinConv)); + tempnom = DataGlobalConstants::StefanBoltzmann() * + ((TempAbsPlate + DataGlobalConstants::KelvinConv()) + (TempInnerCover + DataGlobalConstants::KelvinConv())) * + (pow_2(TempAbsPlate + DataGlobalConstants::KelvinConv()) + pow_2(TempInnerCover + DataGlobalConstants::KelvinConv())); tempdenom = 1.0 / EmissOfAbsPlate + 1.0 / EmissOfInnerCover - 1.0; hRadCoefA2C = tempnom / tempdenom; // Calc convection heat transfer coefficient: @@ -1703,9 +1703,9 @@ namespace SolarCollectors { TempAbsPlate, TempOuterCover, AirGapDepth, this->CosTilt, this->SinTilt); } else { // calculate the linearized radiation coeff. - tempnom = DataGlobals::StefanBoltzmann * - ((TempInnerCover + DataGlobals::KelvinConv) + (TempOuterCover + DataGlobals::KelvinConv)) * - (pow_2(TempInnerCover + DataGlobals::KelvinConv) + pow_2(TempOuterCover + DataGlobals::KelvinConv)); + tempnom = DataGlobalConstants::StefanBoltzmann() * + ((TempInnerCover + DataGlobalConstants::KelvinConv()) + (TempOuterCover + DataGlobalConstants::KelvinConv())) * + (pow_2(TempInnerCover + DataGlobalConstants::KelvinConv()) + pow_2(TempOuterCover + DataGlobalConstants::KelvinConv())); tempdenom = 1.0 / EmissOfInnerCover + 1.0 / EmissOfOuterCover - 1.0; hRadCoefC2C = tempnom / tempdenom; // Calc convection heat transfer coefficient: @@ -1720,9 +1720,9 @@ namespace SolarCollectors { hConvCoefC2O = 2.8 + 3.0 * DataSurfaces::Surface(SurfNum).WindSpeed; // Calc linearized radiation coefficient between outer cover and the surrounding: - tempnom = DataSurfaces::Surface(SurfNum).ViewFactorSky * EmissOfOuterCover * DataGlobals::StefanBoltzmann * - ((TempOuterCover + DataGlobals::KelvinConv) + DataEnvironment::SkyTempKelvin) * - (pow_2(TempOuterCover + DataGlobals::KelvinConv) + pow_2(DataEnvironment::SkyTempKelvin)); + tempnom = DataSurfaces::Surface(SurfNum).ViewFactorSky * EmissOfOuterCover * DataGlobalConstants::StefanBoltzmann() * + ((TempOuterCover + DataGlobalConstants::KelvinConv()) + DataEnvironment::SkyTempKelvin) * + (pow_2(TempOuterCover + DataGlobalConstants::KelvinConv()) + pow_2(DataEnvironment::SkyTempKelvin)); tempdenom = (TempOuterCover - TempOutdoorAir) / (TempOuterCover - DataEnvironment::SkyTemp); if (tempdenom < 0.0) { // use approximate linearized radiation coefficient @@ -1734,9 +1734,9 @@ namespace SolarCollectors { hRadCoefC2Sky = tempnom / tempdenom; } - tempnom = DataSurfaces::Surface(SurfNum).ViewFactorGround * EmissOfOuterCover * DataGlobals::StefanBoltzmann * - ((TempOuterCover + DataGlobals::KelvinConv) + DataEnvironment::GroundTempKelvin) * - (pow_2(TempOuterCover + DataGlobals::KelvinConv) + pow_2(DataEnvironment::GroundTempKelvin)); + tempnom = DataSurfaces::Surface(SurfNum).ViewFactorGround * EmissOfOuterCover * DataGlobalConstants::StefanBoltzmann() * + ((TempOuterCover + DataGlobalConstants::KelvinConv()) + DataEnvironment::GroundTempKelvin) * + (pow_2(TempOuterCover + DataGlobalConstants::KelvinConv()) + pow_2(DataEnvironment::GroundTempKelvin)); tempdenom = (TempOuterCover - TempOutdoorAir) / (TempOuterCover - DataEnvironment::GroundTemp); if (tempdenom < 0.0) { // use approximate linearized radiation coefficient @@ -1873,7 +1873,7 @@ namespace SolarCollectors { DensOfAir = Density(Index - 1) + InterpFrac * (Density(Index) - Density(Index - 1)); } - VolExpAir = 1.0 / (Tref + DataGlobals::KelvinConv); + VolExpAir = 1.0 / (Tref + DataGlobalConstants::KelvinConv()); // Rayleigh number Real64 RaNum = gravity * pow_2(DensOfAir) * VolExpAir * PrOfAir * DeltaT * pow_3(AirGap) / pow_2(VisDOfAir); diff --git a/src/EnergyPlus/SurfaceGeometry.cc b/src/EnergyPlus/SurfaceGeometry.cc index 1b2b7e288c9..fcb58c1e7db 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -2023,7 +2023,7 @@ namespace SurfaceGeometry { ErrCount = 0; for (int ZoneNum = 1; ZoneNum <= NumOfZones; ++ZoneNum) { Zone(ZoneNum).CalcFloorArea = Zone(ZoneNum).FloorArea; - if (Zone(ZoneNum).UserEnteredFloorArea != AutoCalculate) { + if (Zone(ZoneNum).UserEnteredFloorArea != DataGlobalConstants::AutoCalculate()) { // Check entered vs calculated if (Zone(ZoneNum).UserEnteredFloorArea > 0.0) { // User entered zone floor area, // produce message if not near calculated @@ -2809,7 +2809,7 @@ namespace SurfaceGeometry { ShadingTransmittanceVaries = true; } } - if (lNumericFieldBlanks(1) || rNumericArgs(1) == AutoCalculate) { + if (lNumericFieldBlanks(1) || rNumericArgs(1) == DataGlobalConstants::AutoCalculate()) { numSides = (NumNumbers - 1) / 3; SurfaceTmp(SurfNum).Sides = numSides; if (mod(NumNumbers - 1, 3) != 0) { @@ -3414,8 +3414,8 @@ namespace SurfaceGeometry { if (SurfaceTmp(SurfNum).Construction > 0) SurfaceTmp(SurfNum).ExtEcoRoof = state.dataConstruction->Construct(SurfaceTmp(SurfNum).Construction).TypeIsEcoRoof; SurfaceTmp(SurfNum).ViewFactorGround = rNumericArgs(1); - if (lNumericFieldBlanks(1)) SurfaceTmp(SurfNum).ViewFactorGround = AutoCalculate; - if (lNumericFieldBlanks(2) || rNumericArgs(2) == AutoCalculate) { + if (lNumericFieldBlanks(1)) SurfaceTmp(SurfNum).ViewFactorGround = DataGlobalConstants::AutoCalculate(); + if (lNumericFieldBlanks(2) || rNumericArgs(2) == DataGlobalConstants::AutoCalculate()) { numSides = (SurfaceNumProp - 2) / 3; SurfaceTmp(SurfNum).Sides = numSides; if (mod(SurfaceNumProp - 2, 3) != 0) { @@ -3710,7 +3710,7 @@ namespace SurfaceGeometry { } SurfaceTmp(SurfNum).ExtSolar = false; SurfaceTmp(SurfNum).ExtWind = false; - SurfaceTmp(SurfNum).ViewFactorGround = AutoCalculate; + SurfaceTmp(SurfNum).ViewFactorGround = DataGlobalConstants::AutoCalculate(); if (SurfaceTmp(SurfNum).ExtBoundCond == ExternalEnvironment) { SurfaceTmp(SurfNum).ExtSolar = true; @@ -4284,9 +4284,9 @@ namespace SurfaceGeometry { SurfaceTmp(SurfNum).ExtBoundCondName = SurfaceTmp(SurfNum).Name; } SurfaceTmp(SurfNum).ViewFactorGround = rNumericArgs(1); - if (lNumericFieldBlanks(1)) SurfaceTmp(SurfNum).ViewFactorGround = AutoCalculate; + if (lNumericFieldBlanks(1)) SurfaceTmp(SurfNum).ViewFactorGround = DataGlobalConstants::AutoCalculate(); - if (lNumericFieldBlanks(3) || rNumericArgs(3) == AutoCalculate) { + if (lNumericFieldBlanks(3) || rNumericArgs(3) == DataGlobalConstants::AutoCalculate()) { rNumericArgs(3) = (SurfaceNumProp - 3) / 3; SurfaceTmp(SurfNum).Sides = rNumericArgs(3); if (mod(SurfaceNumProp - 3, 3) != 0) { @@ -5421,7 +5421,7 @@ namespace SurfaceGeometry { ShadingTransmittanceVaries = true; } } - if (lNumericFieldBlanks(1) || rNumericArgs(1) == AutoCalculate) { + if (lNumericFieldBlanks(1) || rNumericArgs(1) == DataGlobalConstants::AutoCalculate()) { rNumericArgs(1) = (NumNumbers - 1) / 3; SurfaceTmp(SurfNum).Sides = rNumericArgs(1); if (mod(NumNumbers - 1, 3) != 0) { @@ -7795,7 +7795,7 @@ namespace SurfaceGeometry { SurfaceTmp(SurfNum).CosAzim = std::cos(SurfWorldAz * DataGlobalConstants::DegToRadians()); SurfaceTmp(SurfNum).SinTilt = std::sin(SurfTilt * DataGlobalConstants::DegToRadians()); SurfaceTmp(SurfNum).CosTilt = std::cos(SurfTilt * DataGlobalConstants::DegToRadians()); - if (SurfaceTmp(SurfNum).ViewFactorGround == AutoCalculate) { + if (SurfaceTmp(SurfNum).ViewFactorGround == DataGlobalConstants::AutoCalculate()) { SurfaceTmp(SurfNum).ViewFactorGround = 0.5 * (1.0 - SurfaceTmp(SurfNum).CosTilt); } // Outward normal unit vector (pointing away from room) @@ -9173,7 +9173,7 @@ namespace SurfaceGeometry { } alpF++; - if (lNumericFieldBlanks(numF) || rNumericArgs(numF) == AutoCalculate) { + if (lNumericFieldBlanks(numF) || rNumericArgs(numF) == DataGlobalConstants::AutoCalculate()) { kivaManager.settings.deepGroundDepth = 40.0; } else { kivaManager.settings.deepGroundDepth = rNumericArgs(numF); @@ -10268,7 +10268,7 @@ namespace SurfaceGeometry { } else if (areOppositeWallsSame(ZoneStruct, oppositeWallArea, distanceBetweenOppositeWalls)) { CalcVolume = oppositeWallArea * distanceBetweenOppositeWalls; volCalcMethod = zoneVolumeCalculationMethod::opWallAreaTimesDistance; - } else if (Zone(ZoneNum).Volume == AutoCalculate) { // no user entered zone volume + } else if (Zone(ZoneNum).Volume == DataGlobalConstants::AutoCalculate()) { // no user entered zone volume ShowSevereError("For zone: " + Zone(ZoneNum).Name + " it is not possible to calculate the volume from the surrounding surfaces so either provide the volume value or " "define all the surfaces to fully enclose the zone."); diff --git a/src/EnergyPlus/SurfaceGroundHeatExchanger.cc b/src/EnergyPlus/SurfaceGroundHeatExchanger.cc index e89a3d6ab5f..885e644017b 100644 --- a/src/EnergyPlus/SurfaceGroundHeatExchanger.cc +++ b/src/EnergyPlus/SurfaceGroundHeatExchanger.cc @@ -120,7 +120,6 @@ namespace SurfaceGroundHeatExchanger { // Use statements for data only modules // Using/Aliasing using namespace DataPrecisionGlobals; - using DataGlobals::KelvinConv; using namespace DataLoopNode; // Use statements for access to subroutines in other modules @@ -1288,8 +1287,8 @@ namespace SurfaceGroundHeatExchanger { // set previous surface temp OldSurfTemp = this->TtopHistory(1); // absolute temperatures - SurfTempAbs = OldSurfTemp + KelvinConv; - SkyTempAbs = ThisSkyTemp + KelvinConv; + SurfTempAbs = OldSurfTemp + DataGlobalConstants::KelvinConv(); + SkyTempAbs = ThisSkyTemp + DataGlobalConstants::KelvinConv(); // ASHRAE simple convection coefficient model for external surfaces. ConvCoef = CalcASHRAESimpExtConvectCoeff(this->TopRoughness, ThisWindSpeed); @@ -1341,8 +1340,8 @@ namespace SurfaceGroundHeatExchanger { // make a surface heat balance and solve for temperature OldSurfTemp = this->TbtmHistory(1); // absolute temperatures - SurfTempAbs = OldSurfTemp + KelvinConv; - ExtTempAbs = ThisDryBulb + KelvinConv; + SurfTempAbs = OldSurfTemp + DataGlobalConstants::KelvinConv(); + ExtTempAbs = ThisDryBulb + DataGlobalConstants::KelvinConv(); // ASHRAE simple convection coefficient model for external surfaces. ConvCoef = CalcASHRAESimpExtConvectCoeff(this->TopRoughness, ThisWindSpeed); diff --git a/src/EnergyPlus/TARCOGArgs.cc b/src/EnergyPlus/TARCOGArgs.cc index 983ee7287a3..e9a29de7686 100644 --- a/src/EnergyPlus/TARCOGArgs.cc +++ b/src/EnergyPlus/TARCOGArgs.cc @@ -83,7 +83,6 @@ namespace TARCOGArgs { // USE STATEMENTS: // Using/Aliasing - using DataGlobals::StefanBoltzmann; using namespace TARCOGCommon; using namespace TARCOGGassesParams; using namespace TARCOGOutput; @@ -692,10 +691,10 @@ namespace TARCOGArgs { auto const SELECT_CASE_var(isky); if (SELECT_CASE_var == 3) { Gout = outir; - trmout = root_4(Gout / StefanBoltzmann); + trmout = root_4(Gout / DataGlobalConstants::StefanBoltzmann()); } else if (SELECT_CASE_var == 2) { // effective clear sky emittance from swinbank (SPC142/ISO15099 equations 131, 132, ...) Rsky = 5.31e-13 * pow_6(tout); - esky = Rsky / (StefanBoltzmann * pow_4(tout)); // check esky const, also check what esky to use when tsky input... + esky = Rsky / (DataGlobalConstants::StefanBoltzmann() * pow_4(tout)); // check esky const, also check what esky to use when tsky input... } else if (SELECT_CASE_var == 1) { esky = pow_4(tsky) / pow_4(tout); } else if (SELECT_CASE_var == 0) { // for isky=0 it is assumed that actual values for esky and Tsky are specified @@ -721,7 +720,7 @@ namespace TARCOGArgs { trmout = tout * root_4(e0); } - Gout = StefanBoltzmann * pow_4(trmout); + Gout = DataGlobalConstants::StefanBoltzmann() * pow_4(trmout); } // if (isky.ne.3) then ebsky = Gout; @@ -739,7 +738,7 @@ namespace TARCOGArgs { trmin = tind; } - Gin = StefanBoltzmann * pow_4(trmin); + Gin = DataGlobalConstants::StefanBoltzmann() * pow_4(trmin); ebroom = Gin; // calculate ir reflectance: diff --git a/src/EnergyPlus/TARCOGCommon.cc b/src/EnergyPlus/TARCOGCommon.cc index af9aa8e4746..2f5e6ee305a 100644 --- a/src/EnergyPlus/TARCOGCommon.cc +++ b/src/EnergyPlus/TARCOGCommon.cc @@ -193,7 +193,6 @@ namespace TARCOGCommon { { // Using/Aliasing - using DataGlobals::StefanBoltzmann; using namespace TARCOGParams; // Locals @@ -236,7 +235,7 @@ namespace TARCOGCommon { } // second row - a(k, k + 1) = emis(front) * StefanBoltzmann * pow_3(theta(front)); + a(k, k + 1) = emis(front) * DataGlobalConstants::StefanBoltzmann() * pow_3(theta(front)); a(k + 1, k + 1) = -1.0; if (i != 1) { a(k - 2, k + 1) = rir(front); @@ -247,7 +246,7 @@ namespace TARCOGCommon { // third row a(k + 2, k + 2) = -1.0; - a(k + 3, k + 2) = emis(back) * StefanBoltzmann * pow_3(theta(back)); + a(k + 3, k + 2) = emis(back) * DataGlobalConstants::StefanBoltzmann() * pow_3(theta(back)); if (i != 1) { a(k - 2, k + 2) = tir(front); } diff --git a/src/EnergyPlus/TARCOGGasses90.cc b/src/EnergyPlus/TARCOGGasses90.cc index a7594586525..3d01d81c636 100644 --- a/src/EnergyPlus/TARCOGGasses90.cc +++ b/src/EnergyPlus/TARCOGGasses90.cc @@ -156,7 +156,7 @@ namespace TARCOGGasses90 { fvis(1) = xgvis(1, iprop(1)) + xgvis(2, iprop(1)) * tmean + xgvis(3, iprop(1)) * tmean_2; fcp(1) = xgcp(1, iprop(1)) + xgcp(2, iprop(1)) * tmean + xgcp(3, iprop(1)) * tmean_2; // Density using ideal gas law: rho=(presure*mol. weight)/(gas const*Tmean) - fdens(1) = pres * xwght(iprop(1)) / (UniversalGasConst * tmean); + fdens(1) = pres * xwght(iprop(1)) / (DataGlobalConstants::UniversalGasConst() * tmean); // Mollecular weights in kg/kmol if ((standard == EN673) || (standard == EN673Design)) { // fdens( 1 ) = xgrho( iprop( 1 ), 1 ) + xgrho( iprop( 1 ), 2 ) * tmean + xgrho( iprop( 1 ), 3 ) * pow_2( tmean ); //Autodesk:Uninit xgrho @@ -175,7 +175,7 @@ namespace TARCOGGasses90 { if (stdISO15099) { molmix = frct(1) * xwght(iprop(1)); // initialize equation 56 cpmixm = molmix * fcp(1); // initialize equation 58 - kprime(1) = 3.75 * UniversalGasConst / xwght(iprop(1)) * fvis(1); // equation 67 + kprime(1) = 3.75 * DataGlobalConstants::UniversalGasConst() / xwght(iprop(1)) * fvis(1); // equation 67 kdblprm(1) = fcon(1) - kprime(1); // equation 67 // initialize sumations for eqns 60-66: mukpdwn(1) = 1.0; @@ -200,7 +200,7 @@ namespace TARCOGGasses90 { if (stdISO15099) { molmix += frct(i) * xwght(iprop(i)); // equation 56 cpmixm += frct(i) * fcp(i) * xwght(iprop(i)); // equation 58-59 - kprime(i) = 3.75 * UniversalGasConst / xwght(iprop(i)) * fvis(i); // equation 67 + kprime(i) = 3.75 * DataGlobalConstants::UniversalGasConst() / xwght(iprop(i)) * fvis(i); // equation 67 kdblprm(i) = fcon(i) - kprime(i); // equation 68 mukpdwn(i) = 1.0; // initialize denominator of equation 60 kpdown(i) = 1.0; // initialize denominator of equation 63 @@ -248,7 +248,7 @@ namespace TARCOGGasses90 { } // calculate the density of the mixture assuming an ideal gas: - Real64 const rhomix = pres * molmix / (UniversalGasConst * tmean); // equation 57 + Real64 const rhomix = pres * molmix / (DataGlobalConstants::UniversalGasConst() * tmean); // equation 57 Real64 const kmix = kpmix + kdpmix; // equation 68-a // final mixture properties: @@ -296,7 +296,7 @@ namespace TARCOGGasses90 { return; } - B = alpha * (gama + 1) / (gama - 1) * std::sqrt(UniversalGasConst / (8 * DataGlobalConstants::Pi() * mwght * tmean)); + B = alpha * (gama + 1) / (gama - 1) * std::sqrt(DataGlobalConstants::UniversalGasConst() / (8 * DataGlobalConstants::Pi() * mwght * tmean)); cond = B * pressure; } diff --git a/src/EnergyPlus/TARCOGOutput.cc b/src/EnergyPlus/TARCOGOutput.cc index c5aa0f13eca..9df853d260e 100644 --- a/src/EnergyPlus/TARCOGOutput.cc +++ b/src/EnergyPlus/TARCOGOutput.cc @@ -161,8 +161,6 @@ namespace TARCOGOutput { { // Using/Aliasing - using DataGlobals::KelvinConv; - // Argument array dimensioning EP_SIZE_CHECK(ibc, 2); EP_SIZE_CHECK(LayerType, maxlay); @@ -326,9 +324,9 @@ namespace TARCOGOutput { print(InArgumentsFile, Format_1000); print(InArgumentsFile, "\n"); print(InArgumentsFile, Format_1005); - print(InArgumentsFile, Format_1010, tout, tout - KelvinConv); - print(InArgumentsFile, Format_1015, tind, tind - KelvinConv); - print(InArgumentsFile, Format_1020, trmin, trmin - KelvinConv); + print(InArgumentsFile, Format_1010, tout, tout - DataGlobalConstants::KelvinConv()); + print(InArgumentsFile, Format_1015, tind, tind - DataGlobalConstants::KelvinConv()); + print(InArgumentsFile, Format_1020, trmin, trmin - DataGlobalConstants::KelvinConv()); print(InArgumentsFile, Format_1030, wso); if (iwd == 0) print(InArgumentsFile, Format_1032); // windward if (iwd == 1) print(InArgumentsFile, Format_1033); // leeward @@ -336,7 +334,7 @@ namespace TARCOGOutput { print(InArgumentsFile, Format_1040, dir); print(InArgumentsFile, Format_1041, outir); print(InArgumentsFile, Format_1045, isky); - print(InArgumentsFile, Format_1050, tsky, tsky - KelvinConv); + print(InArgumentsFile, Format_1050, tsky, tsky - DataGlobalConstants::KelvinConv()); print(InArgumentsFile, Format_1055, esky); print(InArgumentsFile, Format_1060, fclr); print(InArgumentsFile, Format_1061, VacuumPressure); @@ -545,8 +543,6 @@ namespace TARCOGOutput { { // Using/Aliasing - using DataGlobals::KelvinConv; - // Argument array dimensioning EP_SIZE_CHECK(LayerType, maxlay); EP_SIZE_CHECK(nmix, maxlay1); @@ -595,8 +591,8 @@ namespace TARCOGOutput { print(InArgumentsFile, Format_1014); print(InArgumentsFile, "\n"); print(InArgumentsFile, Format_1055, esky); - print(InArgumentsFile, Format_1016, trmout, trmout - KelvinConv); - print(InArgumentsFile, Format_1020, trmin, trmin - KelvinConv); + print(InArgumentsFile, Format_1016, trmout, trmout - DataGlobalConstants::KelvinConv()); + print(InArgumentsFile, Format_1020, trmin, trmin - DataGlobalConstants::KelvinConv()); print(InArgumentsFile, Format_1019, ebsky); print(InArgumentsFile, Format_10191, ebroom); print(InArgumentsFile, Format_1017, Gout); @@ -685,8 +681,6 @@ namespace TARCOGOutput { { // Using/Aliasing - using DataGlobals::KelvinConv; - // Argument array dimensioning EP_SIZE_CHECK(q, maxlay3); EP_SIZE_CHECK(qv, maxlay1); @@ -779,7 +773,7 @@ namespace TARCOGOutput { print(OutArgumentsFile, "\n"); print(OutArgumentsFile, Format_2350); print(OutArgumentsFile, "\n"); - print(OutArgumentsFile, Format_2105, tamb, tamb - KelvinConv); + print(OutArgumentsFile, Format_2105, tamb, tamb - DataGlobalConstants::KelvinConv()); print(OutArgumentsFile, Format_2180, q(1)); // bi Write out layer properties: @@ -788,25 +782,25 @@ namespace TARCOGOutput { { auto const SELECT_CASE_var(LayerType(i)); if (SELECT_CASE_var == SPECULAR) { // Specular layer - print(OutArgumentsFile, Format_2110, 2 * i - 1, theta(2 * i - 1), theta(2 * i - 1) - KelvinConv); + print(OutArgumentsFile, Format_2110, 2 * i - 1, theta(2 * i - 1), theta(2 * i - 1) - DataGlobalConstants::KelvinConv()); print(OutArgumentsFile, Format_2190, i, q(2 * i)); - print(OutArgumentsFile, Format_2110, 2 * i, theta(2 * i), theta(2 * i) - KelvinConv); + print(OutArgumentsFile, Format_2110, 2 * i, theta(2 * i), theta(2 * i) - DataGlobalConstants::KelvinConv()); } else if (SELECT_CASE_var == VENETBLIND_HORIZ || SELECT_CASE_var == VENETBLIND_VERT) { // Venetian blind - print(OutArgumentsFile, Format_2111, 2 * i - 1, theta(2 * i - 1), theta(2 * i - 1) - KelvinConv); + print(OutArgumentsFile, Format_2111, 2 * i - 1, theta(2 * i - 1), theta(2 * i - 1) - DataGlobalConstants::KelvinConv()); print(OutArgumentsFile, Format_2195, i, q(2 * i), i, ShadeGapKeffConv(i)); - print(OutArgumentsFile, Format_2111, 2 * i, theta(2 * i), theta(2 * i) - KelvinConv); + print(OutArgumentsFile, Format_2111, 2 * i, theta(2 * i), theta(2 * i) - DataGlobalConstants::KelvinConv()); } else if (SELECT_CASE_var == WOVSHADE) { // Venetian blind - print(OutArgumentsFile, Format_2112, 2 * i - 1, theta(2 * i - 1), theta(2 * i - 1) - KelvinConv); + print(OutArgumentsFile, Format_2112, 2 * i - 1, theta(2 * i - 1), theta(2 * i - 1) - DataGlobalConstants::KelvinConv()); print(OutArgumentsFile, Format_2195, i, q(2 * i), i, ShadeGapKeffConv(i)); - print(OutArgumentsFile, Format_2112, 2 * i, theta(2 * i), theta(2 * i) - KelvinConv); + print(OutArgumentsFile, Format_2112, 2 * i, theta(2 * i), theta(2 * i) - DataGlobalConstants::KelvinConv()); } else if (SELECT_CASE_var == DIFFSHADE) { // Venetian blind - print(OutArgumentsFile, Format_2110, 2 * i - 1, theta(2 * i - 1), theta(2 * i - 1) - KelvinConv); + print(OutArgumentsFile, Format_2110, 2 * i - 1, theta(2 * i - 1), theta(2 * i - 1) - DataGlobalConstants::KelvinConv()); print(OutArgumentsFile, Format_2190, i, q(2 * i)); - print(OutArgumentsFile, Format_2110, 2 * i, theta(2 * i), theta(2 * i) - KelvinConv); + print(OutArgumentsFile, Format_2110, 2 * i, theta(2 * i), theta(2 * i) - DataGlobalConstants::KelvinConv()); } else { - print(OutArgumentsFile, Format_2110, 2 * i - 1, theta(2 * i - 1), theta(2 * i - 1) - KelvinConv); + print(OutArgumentsFile, Format_2110, 2 * i - 1, theta(2 * i - 1), theta(2 * i - 1) - DataGlobalConstants::KelvinConv()); print(OutArgumentsFile, Format_2199, i, q(2 * i)); - print(OutArgumentsFile, Format_2110, 2 * i, theta(2 * i), theta(2 * i) - KelvinConv); + print(OutArgumentsFile, Format_2110, 2 * i, theta(2 * i), theta(2 * i) - DataGlobalConstants::KelvinConv()); } } @@ -832,7 +826,7 @@ namespace TARCOGOutput { } } // i - layers - print(OutArgumentsFile, Format_2115, troom, troom - KelvinConv); + print(OutArgumentsFile, Format_2115, troom, troom - DataGlobalConstants::KelvinConv()); print(OutArgumentsFile, "\n"); diff --git a/src/EnergyPlus/TarcogShading.cc b/src/EnergyPlus/TarcogShading.cc index 0a63cbead67..543281f0404 100644 --- a/src/EnergyPlus/TarcogShading.cc +++ b/src/EnergyPlus/TarcogShading.cc @@ -610,7 +610,6 @@ namespace TarcogShading { //************************************************************************************************************** // Using/Aliasing - using DataGlobals::KelvinConv; // Argument array dimensioning EP_SIZE_CHECK(iprop1, maxgas); EP_SIZE_CHECK(frct1, maxgas); @@ -679,7 +678,7 @@ namespace TarcogShading { TGapOld1 = 0.0; TGapOld2 = 0.0; tilt = DataGlobalConstants::Pi() / 180 * (angle - 90); - T0 = 0.0 + KelvinConv; + T0 = 0.0 + DataGlobalConstants::KelvinConv(); A1eqin = 0.0; A2eqout = 0.0; A1eqout = 0.0; @@ -904,7 +903,6 @@ namespace TarcogShading { //************************************************************************************************************** // Using/Aliasing - using DataGlobals::KelvinConv; // Argument array dimensioning EP_SIZE_CHECK(iprop1, maxgas); EP_SIZE_CHECK(frct1, maxgas); @@ -950,7 +948,7 @@ namespace TarcogShading { bool converged; tilt = DataGlobalConstants::Pi() / 180.0 * (angle - 90.0); - T0 = 0.0 + KelvinConv; + T0 = 0.0 + DataGlobalConstants::KelvinConv(); GASSES90(T0, iprop1, frct1, press1, nmix1, xwght, xgcon, xgvis, xgcp, con0, visc0, dens0, cp0, pr0, 1, nperr, ErrorMessage); // call gasses90(Tenv, iprop1, frct1, press1, nmix1, xwght, xgcon, xgvis, xgcp, con1, visc1, dens1, cp1, pr1, 1, & diff --git a/src/EnergyPlus/ThermalChimney.cc b/src/EnergyPlus/ThermalChimney.cc index 84e2b69f14a..22170b25adf 100644 --- a/src/EnergyPlus/ThermalChimney.cc +++ b/src/EnergyPlus/ThermalChimney.cc @@ -718,7 +718,7 @@ namespace ThermalChimney { if (TempSurfIn(SurfNum) > TemporaryWallSurfTemp) { TemporaryWallSurfTemp = TempSurfIn(SurfNum); ConvTransCoeffWallFluid = HConvIn(SurfNum); - SurfTempAbsorberWall = TempSurfIn(SurfNum) + KelvinConv; + SurfTempAbsorberWall = TempSurfIn(SurfNum) + DataGlobalConstants::KelvinConv(); } } } @@ -732,7 +732,7 @@ namespace ThermalChimney { if (Surface(SurfNum).Width > TempmajorW) { TempmajorW = Surface(SurfNum).Width; ConvTransCoeffGlassFluid = HConvIn(SurfNum); - SurfTempGlassCover = TempSurfIn(SurfNum) + KelvinConv; + SurfTempGlassCover = TempSurfIn(SurfNum) + DataGlobalConstants::KelvinConv(); } } } @@ -757,7 +757,7 @@ namespace ThermalChimney { TCZoneNumCounter = ThermalChimneySys(Loop).ZonePtr(TCZoneNum); RoomAirTemp += ThermalChimneySys(Loop).RatioThermChimAirFlow(TCZoneNum) * MAT(TCZoneNumCounter); } - RoomAirTemp += KelvinConv; + RoomAirTemp += DataGlobalConstants::KelvinConv(); Process1 = 0.0; Process2 = 0.0; @@ -887,7 +887,7 @@ namespace ThermalChimney { if (ThermalChimneyReport(Loop).OverallTCMassFlow != (TCVolumeAirFlowRate * AirDensityThermalChim)) { ThermalChimneyReport(Loop).OverallTCMassFlow = ThermalChimneyReport(Loop).OverallTCVolumeFlow * AirDensityThermalChim; } - ThermalChimneyReport(Loop).OutletAirTempThermalChim = ThermChimSubTemp(NTC) - KelvinConv; + ThermalChimneyReport(Loop).OutletAirTempThermalChim = ThermChimSubTemp(NTC) - DataGlobalConstants::KelvinConv(); if (GetCurrentScheduleValue(ThermalChimneySys(Loop).SchedPtr) <= 0.0) { for (TCZoneNum = 1; TCZoneNum <= ThermalChimneySys(Loop).TotZoneToDistrib; ++TCZoneNum) { diff --git a/src/EnergyPlus/ThermalComfort.cc b/src/EnergyPlus/ThermalComfort.cc index 3583df8c16d..7e12761303d 100644 --- a/src/EnergyPlus/ThermalComfort.cc +++ b/src/EnergyPlus/ThermalComfort.cc @@ -141,7 +141,7 @@ namespace ThermalComfort { } // namespace // MODULE PARAMETER DEFINITIONS - Real64 const TAbsConv(KelvinConv); // Converter for absolute temperature + Real64 const TAbsConv(DataGlobalConstants::KelvinConv()); // Converter for absolute temperature Real64 const ActLevelConv(58.2); // Converter for activity level (1Met = 58.2 W/m2) Real64 const BodySurfArea(1.8); // Dubois body surface area of the human body (m2) Real64 const RadSurfEff(0.72); // Fraction of surface effective for radiation @@ -1979,9 +1979,6 @@ namespace ThermalComfort { // Locals Real64 SurfaceTemp; - // SUBROUTINE PARAMETER DEFINITIONS: - Real64 const KelvinConv(273.15); // Conversion from Celsius to Kelvin - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int SurfNum; Real64 SurfTempEmissAngleFacSummed; @@ -1995,13 +1992,13 @@ namespace ThermalComfort { auto &thisAngFacList(AngleFactorList(AngleFacNum)); for (SurfNum = 1; SurfNum <= thisAngFacList.TotAngleFacSurfaces; ++SurfNum) { - SurfaceTemp = TH(2, 1, thisAngFacList.SurfacePtr(SurfNum)) + KelvinConv; + SurfaceTemp = TH(2, 1, thisAngFacList.SurfacePtr(SurfNum)) + DataGlobalConstants::KelvinConv(); SurfEAF = state.dataConstruction->Construct(Surface(thisAngFacList.SurfacePtr(SurfNum)).Construction).InsideAbsorpThermal * thisAngFacList.AngleFactor(SurfNum); SurfTempEmissAngleFacSummed += SurfEAF * pow_4(SurfaceTemp); SumSurfaceEmissAngleFactor += SurfEAF; } - CalcAngleFactorMRT = root_4(SurfTempEmissAngleFacSummed / SumSurfaceEmissAngleFactor) - KelvinConv; + CalcAngleFactorMRT = root_4(SurfTempEmissAngleFacSummed / SumSurfaceEmissAngleFactor) - DataGlobalConstants::KelvinConv(); return CalcAngleFactorMRT; } @@ -2174,11 +2171,11 @@ namespace ThermalComfort { // If high temperature radiant heater present and on, then must account for this in MRT calculation if (QHTRadSysToPerson(ZoneNum) > 0.0 || QCoolingPanelToPerson(ZoneNum) > 0.0 || QHWBaseboardToPerson(ZoneNum) > 0.0 || QSteamBaseboardToPerson(ZoneNum) > 0.0 || QElecBaseboardToPerson(ZoneNum) > 0.0) { - RadTemp += KelvinConv; // Convert to Kelvin + RadTemp += DataGlobalConstants::KelvinConv(); // Convert to Kelvin RadTemp = root_4(pow_4(RadTemp) + ((QHTRadSysToPerson(ZoneNum) + QCoolingPanelToPerson(ZoneNum) + QHWBaseboardToPerson(ZoneNum) + QSteamBaseboardToPerson(ZoneNum) + QElecBaseboardToPerson(ZoneNum)) / AreaEff / StefanBoltzmannConst)); - RadTemp -= KelvinConv; // Convert back to Celsius + RadTemp -= DataGlobalConstants::KelvinConv(); // Convert back to Celsius } CalcRadTemp = RadTemp; diff --git a/src/EnergyPlus/ThermalEN673Calc.cc b/src/EnergyPlus/ThermalEN673Calc.cc index 4f9f35b57a9..117bbcc269c 100644 --- a/src/EnergyPlus/ThermalEN673Calc.cc +++ b/src/EnergyPlus/ThermalEN673Calc.cc @@ -260,8 +260,6 @@ namespace ThermalEN673Calc { std::string &ErrorMessage) { // Using - using DataGlobals::StefanBoltzmann; - // Argument array dimensioning EP_SIZE_CHECK(emis, maxlay2); EP_SIZE_CHECK(gap, MaxGap); @@ -424,7 +422,7 @@ namespace ThermalEN673Calc { } } for (i = 1; i <= nlayer - 1; ++i) { - hr(i) = 4.0 * StefanBoltzmann * std::pow(1.0 / emis(2 * i) + 1.0 / emis(2 * i + 1) - 1.0, -1.0) * pow_3(Tm); + hr(i) = 4.0 * DataGlobalConstants::StefanBoltzmann() * std::pow(1.0 / emis(2 * i) + 1.0 / emis(2 * i + 1) - 1.0, -1.0) * pow_3(Tm); hs(i) = hg(i) + hr(i); rs(2 * i + 1) = 1.0 / hs(i); // Thermal resistance of each gap sumRs += rs(2 * i + 1); diff --git a/src/EnergyPlus/ThermalISO15099Calc.cc b/src/EnergyPlus/ThermalISO15099Calc.cc index 8cda1128228..56bb2f2e2a2 100644 --- a/src/EnergyPlus/ThermalISO15099Calc.cc +++ b/src/EnergyPlus/ThermalISO15099Calc.cc @@ -1442,8 +1442,6 @@ namespace ThermalISO15099Calc { // index iteration step // Using - using DataGlobals::StefanBoltzmann; - // Locals // 0 - don't create debug output files // 1 - append results to existing debug output file @@ -2062,8 +2060,8 @@ namespace ThermalISO15099Calc { k = 2 * i - 1; Rf(i) = Radiation(k); Rb(i) = Radiation(k + 1); - Ebf(i) = StefanBoltzmann * pow_4(theta(k)); - Ebb(i) = StefanBoltzmann * pow_4(theta(k + 1)); + Ebf(i) = DataGlobalConstants::StefanBoltzmann() * pow_4(theta(k)); + Ebb(i) = DataGlobalConstants::StefanBoltzmann() * pow_4(theta(k + 1)); } // end if @@ -2078,7 +2076,7 @@ namespace ThermalISO15099Calc { qr_gap_in = Rf(nlayer) - Rb(nlayer - 1); if (IsShadingLayer(LayerType(1))) { - ShadeEmisRatioOut = qr_gap_out / (emis(3) * StefanBoltzmann * (pow_4(theta(3)) - pow_4(trmout))); + ShadeEmisRatioOut = qr_gap_out / (emis(3) * DataGlobalConstants::StefanBoltzmann() * (pow_4(theta(3)) - pow_4(trmout))); // qc_gap_out = qprim(3) - qr_gap_out // qcgapout2 = qcgas(1) // Hc_modified_out = (qc_gap_out / (theta(3) - tout)) @@ -2086,7 +2084,7 @@ namespace ThermalISO15099Calc { } if (IsShadingLayer(LayerType(nlayer))) { - ShadeEmisRatioIn = qr_gap_in / (emis(2 * nlayer - 2) * StefanBoltzmann * (pow_4(trmin) - pow_4(theta(2 * nlayer - 2)))); + ShadeEmisRatioIn = qr_gap_in / (emis(2 * nlayer - 2) * DataGlobalConstants::StefanBoltzmann() * (pow_4(trmin) - pow_4(theta(2 * nlayer - 2)))); qc_gap_in = q(2 * nlayer - 1) - qr_gap_in; hc_modified_in = (qc_gap_in / (tind - theta(2 * nlayer - 2))); ShadeHcModifiedIn = hc_modified_in; @@ -2139,8 +2137,6 @@ namespace ThermalISO15099Calc { // delta delta T per unit length // Using - using DataGlobals::StefanBoltzmann; - // Argument array dimensioning EP_SIZE_CHECK(gap, MaxGap); EP_SIZE_CHECK(thick, maxlay); @@ -2177,8 +2173,8 @@ namespace ThermalISO15099Calc { j = 2 * i; theta(j - 1) = tout + x(j - 1) * delta; theta(j) = tout + x(j) * delta; - Ebf(i) = StefanBoltzmann * pow_4(theta(j - 1)); - Ebb(i) = StefanBoltzmann * pow_4(theta(j)); + Ebf(i) = DataGlobalConstants::StefanBoltzmann() * pow_4(theta(j - 1)); + Ebb(i) = DataGlobalConstants::StefanBoltzmann() * pow_4(theta(j)); } for (i = 1; i <= nlayer + 1; ++i) { @@ -2205,8 +2201,6 @@ namespace ThermalISO15099Calc { //*********************************************************************** // Using - using DataGlobals::StefanBoltzmann; - // Argument array dimensioning EP_SIZE_CHECK(theta, maxlay2); EP_SIZE_CHECK(Tgap, maxlay1); @@ -2238,8 +2232,8 @@ namespace ThermalISO15099Calc { j = 2 * i; told(j) = theta(j); told(j - 1) = theta(j - 1); - theta(j - 1) = root_4(Ebf(i) / StefanBoltzmann); - theta(j) = root_4(Ebb(i) / StefanBoltzmann); + theta(j - 1) = root_4(Ebf(i) / DataGlobalConstants::StefanBoltzmann()); + theta(j) = root_4(Ebb(i) / DataGlobalConstants::StefanBoltzmann()); if (i != 1) { Tgap(i) = (theta(j - 1) + theta(j - 2)) / 2; } @@ -3350,8 +3344,6 @@ namespace ThermalISO15099Calc { { // Using/Aliasing - using DataGlobals::KelvinConv; - // Locals // character(len=*), intent(inout) :: ErrorMessage @@ -3383,10 +3375,10 @@ namespace ThermalISO15099Calc { print(files.TarcogIterationsFile, "*************************************************************************************************\n"); print(files.TarcogIterationsFile, "Iteration number: {:5}\n" , index); - print(files.TarcogIterationsFile, "Trmin = {:8.4F}\n" , trmin - KelvinConv); - print(files.TarcogIterationsFile, "Troom = {:12.6F}\n" , troom - KelvinConv); - print(files.TarcogIterationsFile, "Trmout = {:8.4F}\n" , trmout - KelvinConv); - print(files.TarcogIterationsFile, "Tamb = {:12.6F}\n" , tamb - KelvinConv); + print(files.TarcogIterationsFile, "Trmin = {:8.4F}\n" , trmin - DataGlobalConstants::KelvinConv()); + print(files.TarcogIterationsFile, "Troom = {:12.6F}\n" , troom - DataGlobalConstants::KelvinConv()); + print(files.TarcogIterationsFile, "Trmout = {:8.4F}\n" , trmout - DataGlobalConstants::KelvinConv()); + print(files.TarcogIterationsFile, "Tamb = {:12.6F}\n" , tamb - DataGlobalConstants::KelvinConv()); print(files.TarcogIterationsFile, "Ebsky = {:8.4F}\n" , ebsky); print(files.TarcogIterationsFile, "Ebroom = {:8.4F}\n" , ebroom); @@ -3461,9 +3453,9 @@ namespace ThermalISO15099Calc { print(files.TarcogIterationsFile, "\n"); // write temperatures - print(files.TarcogIterationsFile, "{:16.8F} \n", theta(1) - KelvinConv); + print(files.TarcogIterationsFile, "{:16.8F} \n", theta(1) - DataGlobalConstants::KelvinConv()); for (i = 2; i <= 2 * nlayer; ++i) { - print(files.TarcogIterationsFile, " {:16.8F} \n", theta(i) - KelvinConv); + print(files.TarcogIterationsFile, " {:16.8F} \n", theta(i) - DataGlobalConstants::KelvinConv()); } print(files.TarcogIterationsFile, "\n"); @@ -3483,9 +3475,9 @@ namespace ThermalISO15099Calc { print(files.IterationCSVFile, dynFormat); print(files.IterationCSVFile, "\n"); } - print(files.IterationCSVFile, "{:16.8F} \n", theta(1) - KelvinConv); + print(files.IterationCSVFile, "{:16.8F} \n", theta(1) - DataGlobalConstants::KelvinConv()); for (i = 2; i <= 2 * nlayer; ++i) { - print(files.IterationCSVFile, " {:16.8F} \n", theta(i) - KelvinConv); + print(files.IterationCSVFile, " {:16.8F} \n", theta(i) - DataGlobalConstants::KelvinConv()); } print(files.IterationCSVFile, "\n"); diff --git a/src/EnergyPlus/TranspiredCollector.cc b/src/EnergyPlus/TranspiredCollector.cc index ed698a47d44..34616e53571 100644 --- a/src/EnergyPlus/TranspiredCollector.cc +++ b/src/EnergyPlus/TranspiredCollector.cc @@ -112,7 +112,6 @@ namespace TranspiredCollector { // See EngineeringReference for details // Using/Aliasing - using DataGlobals::KelvinConv; using DataHeatBalance::QRadSWOutIncident; using DataVectorTypes::Vector; @@ -913,9 +912,6 @@ namespace TranspiredCollector { Real64 const k(0.0267); // thermal conductivity (W/m K) for air at 300 K // (Mills 1999 Heat Transfer) Real64 const Sigma(5.6697e-08); // Stefan-Boltzmann constant - // REAL(r64), PARAMETER :: KelvinConv = KelvinConv ! Conversion from Celsius to Kelvin - // INTERFACE BLOCK SPECIFICATIONS: - // na // DERIVED TYPE DEFINITIONS: // na @@ -1076,8 +1072,8 @@ namespace TranspiredCollector { InitExteriorConvectionCoeff(state, SurfPtr, HMovInsul, Roughness, AbsExt, TempExt, HExt, HSkyARR(ThisSurf), HGroundARR(ThisSurf), HAirARR(ThisSurf)); ConstrNum = Surface(SurfPtr).Construction; AbsThermSurf = dataMaterial.Material(state.dataConstruction->Construct(ConstrNum).LayerPoint(1)).AbsorpThermal; - TsoK = TH(1, 1, SurfPtr) + KelvinConv; - TscollK = UTSC(UTSCNum).TcollLast + KelvinConv; + TsoK = TH(1, 1, SurfPtr) + DataGlobalConstants::KelvinConv(); + TscollK = UTSC(UTSCNum).TcollLast + DataGlobalConstants::KelvinConv(); HPlenARR(ThisSurf) = Sigma * AbsExt * AbsThermSurf * (pow_4(TscollK) - pow_4(TsoK)) / (TscollK - TsoK); } // AreaSum = sum( Surface( UTSC( UTSCNum ).SurfPtrs ).Area ); //Autodesk:F2C++ Array subscript usage: Replaced by below diff --git a/src/EnergyPlus/UFADManager.cc b/src/EnergyPlus/UFADManager.cc index a7b2844b586..63ac23070af 100644 --- a/src/EnergyPlus/UFADManager.cc +++ b/src/EnergyPlus/UFADManager.cc @@ -396,8 +396,8 @@ namespace UFADManager { ZoneUCSDUI(UINum).CalcTransHeight = false; } if (ZoneUCSDUI(UINum).DiffuserType == Swirl) { - if (ZoneUCSDUI(UINum).A_Kc != AutoCalculate || ZoneUCSDUI(UINum).B_Kc != AutoCalculate || ZoneUCSDUI(UINum).C_Kc != AutoCalculate || - ZoneUCSDUI(UINum).D_Kc != AutoCalculate || ZoneUCSDUI(UINum).E_Kc != AutoCalculate) { + if (ZoneUCSDUI(UINum).A_Kc != DataGlobalConstants::AutoCalculate() || ZoneUCSDUI(UINum).B_Kc != DataGlobalConstants::AutoCalculate() || ZoneUCSDUI(UINum).C_Kc != DataGlobalConstants::AutoCalculate() || + ZoneUCSDUI(UINum).D_Kc != DataGlobalConstants::AutoCalculate() || ZoneUCSDUI(UINum).E_Kc != DataGlobalConstants::AutoCalculate()) { ShowWarningError("For RoomAirSettings:UnderFloorAirDistributionInterior for Zone " + ZoneUCSDUI(UINum).ZoneName + ", input for Coefficients A - E will be ignored when Floor Diffuser Type = Swirl."); ShowContinueError(" To input these Coefficients, use Floor Diffuser Type = Custom."); @@ -408,8 +408,8 @@ namespace UFADManager { ZoneUCSDUI(UINum).D_Kc = 0.0069; ZoneUCSDUI(UINum).E_Kc = -0.00004; } else if (ZoneUCSDUI(UINum).DiffuserType == VarArea) { - if (ZoneUCSDUI(UINum).A_Kc != AutoCalculate || ZoneUCSDUI(UINum).B_Kc != AutoCalculate || ZoneUCSDUI(UINum).C_Kc != AutoCalculate || - ZoneUCSDUI(UINum).D_Kc != AutoCalculate || ZoneUCSDUI(UINum).E_Kc != AutoCalculate) { + if (ZoneUCSDUI(UINum).A_Kc != DataGlobalConstants::AutoCalculate() || ZoneUCSDUI(UINum).B_Kc != DataGlobalConstants::AutoCalculate() || ZoneUCSDUI(UINum).C_Kc != DataGlobalConstants::AutoCalculate() || + ZoneUCSDUI(UINum).D_Kc != DataGlobalConstants::AutoCalculate() || ZoneUCSDUI(UINum).E_Kc != DataGlobalConstants::AutoCalculate()) { ShowWarningError("For RoomAirSettings:UnderFloorAirDistributionInterior for Zone " + ZoneUCSDUI(UINum).ZoneName + ", input for Coefficients A - E will be ignored when Floor Diffuser Type = VariableArea."); ShowContinueError(" To input these Coefficients, use Floor Diffuser Type = Custom."); @@ -420,8 +420,8 @@ namespace UFADManager { ZoneUCSDUI(UINum).D_Kc = 0.0; ZoneUCSDUI(UINum).E_Kc = 0.0; } else if (ZoneUCSDUI(UINum).DiffuserType == DisplVent) { - if (ZoneUCSDUI(UINum).A_Kc != AutoCalculate || ZoneUCSDUI(UINum).B_Kc != AutoCalculate || ZoneUCSDUI(UINum).C_Kc != AutoCalculate || - ZoneUCSDUI(UINum).D_Kc != AutoCalculate || ZoneUCSDUI(UINum).E_Kc != AutoCalculate) { + if (ZoneUCSDUI(UINum).A_Kc != DataGlobalConstants::AutoCalculate() || ZoneUCSDUI(UINum).B_Kc != DataGlobalConstants::AutoCalculate() || ZoneUCSDUI(UINum).C_Kc != DataGlobalConstants::AutoCalculate() || + ZoneUCSDUI(UINum).D_Kc != DataGlobalConstants::AutoCalculate() || ZoneUCSDUI(UINum).E_Kc != DataGlobalConstants::AutoCalculate()) { ShowWarningError("For RoomAirSettings:UnderFloorAirDistributionInterior for Zone " + ZoneUCSDUI(UINum).ZoneName + ", input for Coefficients A - E will be ignored when Floor Diffuser Type = HorizontalDisplacement."); ShowContinueError(" To input these Coefficients, use Floor Diffuser Type = Custom."); @@ -432,8 +432,8 @@ namespace UFADManager { ZoneUCSDUI(UINum).D_Kc = 0.0; ZoneUCSDUI(UINum).E_Kc = 0.0; } else if (ZoneUCSDUI(UINum).DiffuserType == LinBarGrille) { - if (ZoneUCSDUI(UINum).A_Kc != AutoCalculate || ZoneUCSDUI(UINum).B_Kc != AutoCalculate || ZoneUCSDUI(UINum).C_Kc != AutoCalculate || - ZoneUCSDUI(UINum).D_Kc != AutoCalculate || ZoneUCSDUI(UINum).E_Kc != AutoCalculate) { + if (ZoneUCSDUI(UINum).A_Kc != DataGlobalConstants::AutoCalculate() || ZoneUCSDUI(UINum).B_Kc != DataGlobalConstants::AutoCalculate() || ZoneUCSDUI(UINum).C_Kc != DataGlobalConstants::AutoCalculate() || + ZoneUCSDUI(UINum).D_Kc != DataGlobalConstants::AutoCalculate() || ZoneUCSDUI(UINum).E_Kc != DataGlobalConstants::AutoCalculate()) { ShowWarningError("For RoomAirSettings:UnderFloorAirDistributionInterior for Zone " + ZoneUCSDUI(UINum).ZoneName + ", input for Coefficients A - E will be ignored when Floor Diffuser Type = LinearBarGrille."); ShowContinueError(" To input these Coefficients, use Floor Diffuser Type = Custom."); @@ -444,13 +444,13 @@ namespace UFADManager { ZoneUCSDUI(UINum).D_Kc = 0.0; ZoneUCSDUI(UINum).E_Kc = 0.0; } else { - if (ZoneUCSDUI(UINum).A_Kc == AutoCalculate || ZoneUCSDUI(UINum).B_Kc == AutoCalculate || ZoneUCSDUI(UINum).C_Kc == AutoCalculate || - ZoneUCSDUI(UINum).D_Kc == AutoCalculate || ZoneUCSDUI(UINum).E_Kc == AutoCalculate) { + if (ZoneUCSDUI(UINum).A_Kc == DataGlobalConstants::AutoCalculate() || ZoneUCSDUI(UINum).B_Kc == DataGlobalConstants::AutoCalculate() || ZoneUCSDUI(UINum).C_Kc == DataGlobalConstants::AutoCalculate() || + ZoneUCSDUI(UINum).D_Kc == DataGlobalConstants::AutoCalculate() || ZoneUCSDUI(UINum).E_Kc == DataGlobalConstants::AutoCalculate()) { ShowFatalError("For RoomAirSettings:UnderFloorAirDistributionInterior for Zone " + ZoneUCSDUI(UINum).ZoneName + ", input for Coefficients A - E must be specified when Floor Diffuser Type = Custom."); } } - if (ZoneUCSDUI(UINum).PowerPerPlume == AutoCalculate) { + if (ZoneUCSDUI(UINum).PowerPerPlume == DataGlobalConstants::AutoCalculate()) { NumberOfPlumes = 0.0; if (NumberOfOccupants > 0.0) { NumberOfPlumes = NumberOfOccupants; @@ -572,8 +572,8 @@ namespace UFADManager { ZoneUCSDUE(UINum).CalcTransHeight = false; } if (ZoneUCSDUE(UINum).DiffuserType == Swirl) { - if (ZoneUCSDUE(UINum).A_Kc != AutoCalculate || ZoneUCSDUE(UINum).B_Kc != AutoCalculate || ZoneUCSDUE(UINum).C_Kc != AutoCalculate || - ZoneUCSDUE(UINum).D_Kc != AutoCalculate || ZoneUCSDUE(UINum).E_Kc != AutoCalculate) { + if (ZoneUCSDUE(UINum).A_Kc != DataGlobalConstants::AutoCalculate() || ZoneUCSDUE(UINum).B_Kc != DataGlobalConstants::AutoCalculate() || ZoneUCSDUE(UINum).C_Kc != DataGlobalConstants::AutoCalculate() || + ZoneUCSDUE(UINum).D_Kc != DataGlobalConstants::AutoCalculate() || ZoneUCSDUE(UINum).E_Kc != DataGlobalConstants::AutoCalculate()) { ShowWarningError("For RoomAirSettings:UnderFloorAirDistributionExterior for Zone " + ZoneUCSDUE(UINum).ZoneName + ", input for Coefficients A - E will be ignored when Floor Diffuser Type = Swirl."); ShowContinueError(" To input these Coefficients, use Floor Diffuser Type = Custom."); @@ -584,8 +584,8 @@ namespace UFADManager { ZoneUCSDUE(UINum).D_Kc = 0.0069; ZoneUCSDUE(UINum).E_Kc = -0.00004; } else if (ZoneUCSDUE(UINum).DiffuserType == VarArea) { - if (ZoneUCSDUE(UINum).A_Kc != AutoCalculate || ZoneUCSDUE(UINum).B_Kc != AutoCalculate || ZoneUCSDUE(UINum).C_Kc != AutoCalculate || - ZoneUCSDUE(UINum).D_Kc != AutoCalculate || ZoneUCSDUE(UINum).E_Kc != AutoCalculate) { + if (ZoneUCSDUE(UINum).A_Kc != DataGlobalConstants::AutoCalculate() || ZoneUCSDUE(UINum).B_Kc != DataGlobalConstants::AutoCalculate() || ZoneUCSDUE(UINum).C_Kc != DataGlobalConstants::AutoCalculate() || + ZoneUCSDUE(UINum).D_Kc != DataGlobalConstants::AutoCalculate() || ZoneUCSDUE(UINum).E_Kc != DataGlobalConstants::AutoCalculate()) { ShowWarningError("For RoomAirSettings:UnderFloorAirDistributionExterior for Zone " + ZoneUCSDUE(UINum).ZoneName + ", input for Coefficients A - E will be ignored when Floor Diffuser Type = VariableArea."); ShowContinueError(" To input these Coefficients, use Floor Diffuser Type = Custom."); @@ -596,8 +596,8 @@ namespace UFADManager { ZoneUCSDUE(UINum).D_Kc = 0.0; ZoneUCSDUE(UINum).E_Kc = 0.0; } else if (ZoneUCSDUE(UINum).DiffuserType == DisplVent) { - if (ZoneUCSDUE(UINum).A_Kc != AutoCalculate || ZoneUCSDUE(UINum).B_Kc != AutoCalculate || ZoneUCSDUE(UINum).C_Kc != AutoCalculate || - ZoneUCSDUE(UINum).D_Kc != AutoCalculate || ZoneUCSDUE(UINum).E_Kc != AutoCalculate) { + if (ZoneUCSDUE(UINum).A_Kc != DataGlobalConstants::AutoCalculate() || ZoneUCSDUE(UINum).B_Kc != DataGlobalConstants::AutoCalculate() || ZoneUCSDUE(UINum).C_Kc != DataGlobalConstants::AutoCalculate() || + ZoneUCSDUE(UINum).D_Kc != DataGlobalConstants::AutoCalculate() || ZoneUCSDUE(UINum).E_Kc != DataGlobalConstants::AutoCalculate()) { ShowWarningError("For RoomAirSettings:UnderFloorAirDistributionExterior for Zone " + ZoneUCSDUE(UINum).ZoneName + ", input for Coefficients A - E will be ignored when Floor Diffuser Type = HorizontalDisplacement."); ShowContinueError(" To input these Coefficients, use Floor Diffuser Type = Custom."); @@ -608,8 +608,8 @@ namespace UFADManager { ZoneUCSDUE(UINum).D_Kc = 0.0; ZoneUCSDUE(UINum).E_Kc = 0.0; } else if (ZoneUCSDUE(UINum).DiffuserType == LinBarGrille) { - if (ZoneUCSDUE(UINum).A_Kc != AutoCalculate || ZoneUCSDUE(UINum).B_Kc != AutoCalculate || ZoneUCSDUE(UINum).C_Kc != AutoCalculate || - ZoneUCSDUE(UINum).D_Kc != AutoCalculate || ZoneUCSDUE(UINum).E_Kc != AutoCalculate) { + if (ZoneUCSDUE(UINum).A_Kc != DataGlobalConstants::AutoCalculate() || ZoneUCSDUE(UINum).B_Kc != DataGlobalConstants::AutoCalculate() || ZoneUCSDUE(UINum).C_Kc != DataGlobalConstants::AutoCalculate() || + ZoneUCSDUE(UINum).D_Kc != DataGlobalConstants::AutoCalculate() || ZoneUCSDUE(UINum).E_Kc != DataGlobalConstants::AutoCalculate()) { ShowWarningError("For RoomAirSettings:UnderFloorAirDistributionExterior for Zone " + ZoneUCSDUE(UINum).ZoneName + ", input for Coefficients A - E will be ignored when Floor Diffuser Type = LinearBarGrille."); ShowContinueError(" To input these Coefficients, use Floor Diffuser Type = Custom."); @@ -620,13 +620,13 @@ namespace UFADManager { ZoneUCSDUE(UINum).D_Kc = -0.0263; ZoneUCSDUE(UINum).E_Kc = 0.0014; } else { - if (ZoneUCSDUE(UINum).A_Kc == AutoCalculate || ZoneUCSDUE(UINum).B_Kc == AutoCalculate || ZoneUCSDUE(UINum).C_Kc == AutoCalculate || - ZoneUCSDUE(UINum).D_Kc == AutoCalculate || ZoneUCSDUE(UINum).E_Kc == AutoCalculate) { + if (ZoneUCSDUE(UINum).A_Kc == DataGlobalConstants::AutoCalculate() || ZoneUCSDUE(UINum).B_Kc == DataGlobalConstants::AutoCalculate() || ZoneUCSDUE(UINum).C_Kc == DataGlobalConstants::AutoCalculate() || + ZoneUCSDUE(UINum).D_Kc == DataGlobalConstants::AutoCalculate() || ZoneUCSDUE(UINum).E_Kc == DataGlobalConstants::AutoCalculate()) { ShowFatalError("For RoomAirSettings:UnderFloorAirDistributionExterior for Zone " + ZoneUCSDUE(UINum).ZoneName + ", input for Coefficients A - E must be specified when Floor Diffuser Type = Custom."); } } - if (ZoneUCSDUE(UINum).PowerPerPlume == AutoCalculate) { + if (ZoneUCSDUE(UINum).PowerPerPlume == DataGlobalConstants::AutoCalculate()) { if (NumberOfOccupants > 0) { NumberOfPlumes = NumberOfOccupants; } else { @@ -1167,7 +1167,7 @@ namespace UFADManager { SumSysM += MassFlowRate; } if (TotSysFlow > 0.0) { - TSupK = TSupK / SumSysM + KelvinConv; + TSupK = TSupK / SumSysM + DataGlobalConstants::KelvinConv(); } else { TSupK = 0.0; } @@ -1196,7 +1196,7 @@ namespace UFADManager { NumberOfPlumes = 1.0; NumDiffusersPerPlume = 1.0; } - if ((PowerInPlumes <= 0.0) || (TotSysFlow == 0.0) || (TSupK - KelvinConv) > MAT(ZoneNum)) { + if ((PowerInPlumes <= 0.0) || (TotSysFlow == 0.0) || (TSupK - DataGlobalConstants::KelvinConv()) > MAT(ZoneNum)) { // The system will mix HeightFrac = 0.0; } else { @@ -1433,7 +1433,7 @@ namespace UFADManager { if (MIXFLAG) { Phi(ZoneNum) = 1.0; } else { - Phi(ZoneNum) = (ZTOC(ZoneNum) - (TSupK - KelvinConv)) / (ZTMX(ZoneNum) - (TSupK - KelvinConv)); + Phi(ZoneNum) = (ZTOC(ZoneNum) - (TSupK - DataGlobalConstants::KelvinConv())) / (ZTMX(ZoneNum) - (TSupK - DataGlobalConstants::KelvinConv())); } // Mixed for reporting purposes @@ -1644,7 +1644,7 @@ namespace UFADManager { SumSysM += MassFlowRate; } if (TotSysFlow > 0.0) { - TSupK = TSupK / SumSysM + KelvinConv; + TSupK = TSupK / SumSysM + DataGlobalConstants::KelvinConv(); } else { TSupK = 0.0; } @@ -1676,7 +1676,7 @@ namespace UFADManager { NumberOfPlumes = 1.0; NumDiffusersPerPlume = 1.0; } - if ((PowerInPlumes <= 0.0) || (TotSysFlow == 0.0) || (TSupK - KelvinConv) > MAT(ZoneNum)) { + if ((PowerInPlumes <= 0.0) || (TotSysFlow == 0.0) || (TSupK - DataGlobalConstants::KelvinConv()) > MAT(ZoneNum)) { // The system will mix HeightFrac = 0.0; } else { @@ -1947,7 +1947,7 @@ namespace UFADManager { if (MIXFLAG) { Phi(ZoneNum) = 1.0; } else { - Phi(ZoneNum) = (ZTOC(ZoneNum) - (TSupK - KelvinConv)) / (ZTMX(ZoneNum) - (TSupK - KelvinConv)); + Phi(ZoneNum) = (ZTOC(ZoneNum) - (TSupK - DataGlobalConstants::KelvinConv())) / (ZTMX(ZoneNum) - (TSupK - DataGlobalConstants::KelvinConv())); } // Mixed for reporting purposes diff --git a/src/EnergyPlus/UnitHeater.cc b/src/EnergyPlus/UnitHeater.cc index e6a66e7bff2..add7a66e7f8 100644 --- a/src/EnergyPlus/UnitHeater.cc +++ b/src/EnergyPlus/UnitHeater.cc @@ -864,7 +864,7 @@ namespace UnitHeater { if (UnitHeat(UnitHeatNum).HCoilType == WaterHeatingCoil) { rho = GetDensityGlycol(state, PlantLoop(UnitHeat(UnitHeatNum).HWLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(UnitHeat(UnitHeatNum).HWLoopNum).FluidIndex, RoutineName); @@ -1224,11 +1224,11 @@ namespace UnitHeater { if (DesCoilLoad >= SmallLoad) { rho = GetDensityGlycol(state, PlantLoop(UnitHeat(UnitHeatNum).HWLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(UnitHeat(UnitHeatNum).HWLoopNum).FluidIndex, RoutineName); Cp = GetSpecificHeatGlycol(state, PlantLoop(UnitHeat(UnitHeatNum).HWLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(UnitHeat(UnitHeatNum).HWLoopNum).FluidIndex, RoutineName); MaxVolHotWaterFlowDes = DesCoilLoad / (WaterCoilSizDeltaT * Cp * rho); diff --git a/src/EnergyPlus/UnitVentilator.cc b/src/EnergyPlus/UnitVentilator.cc index c6088c5f72b..432488d28d5 100644 --- a/src/EnergyPlus/UnitVentilator.cc +++ b/src/EnergyPlus/UnitVentilator.cc @@ -1471,7 +1471,7 @@ namespace UnitVentilator { if (UnitVent(UnitVentNum).HCoilType == Heating_WaterCoilType) { rho = GetDensityGlycol(state, PlantLoop(UnitVent(UnitVentNum).HWLoopNum).FluidName, - HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(UnitVent(UnitVentNum).HWLoopNum).FluidIndex, RoutineName); @@ -2227,11 +2227,11 @@ namespace UnitVentilator { DesHeatingLoad = sizerHeatingCapacity.size(state, TempSize, errorsFound); } rho = GetDensityGlycol(state, PlantLoop(UnitVent(UnitVentNum).HWLoopNum).FluidName, - HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(UnitVent(UnitVentNum).HWLoopNum).FluidIndex, RoutineName); Cp = GetSpecificHeatGlycol(state, PlantLoop(UnitVent(UnitVentNum).HWLoopNum).FluidName, - HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(UnitVent(UnitVentNum).HWLoopNum).FluidIndex, RoutineName); MaxVolHotWaterFlowDes = DesHeatingLoad / (WaterCoilSizDeltaT * Cp * rho); diff --git a/src/EnergyPlus/UnitarySystem.cc b/src/EnergyPlus/UnitarySystem.cc index ef5b82c2f7c..c32de0da716 100644 --- a/src/EnergyPlus/UnitarySystem.cc +++ b/src/EnergyPlus/UnitarySystem.cc @@ -740,7 +740,7 @@ namespace UnitarySystems { if (this->MaxCoolCoilFluidFlow > 0.0) { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CoolCoilLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CoolCoilLoopNum).FluidIndex, routineName); this->MaxCoolCoilFluidFlow *= rho; @@ -790,7 +790,7 @@ namespace UnitarySystems { if (this->MaxHeatCoilFluidFlow > 0.0) { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->HeatCoilLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(this->HeatCoilLoopNum).FluidIndex, routineName); this->MaxHeatCoilFluidFlow = @@ -849,7 +849,7 @@ namespace UnitarySystems { if (this->m_MaxSuppCoilFluidFlow > 0.0) { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->m_SuppCoilLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->m_SuppCoilLoopNum).FluidIndex, routineName); this->m_MaxSuppCoilFluidFlow = @@ -921,7 +921,7 @@ namespace UnitarySystems { if ((this->m_HeatRecActive) && (!this->m_MyPlantScanFlag)) { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->m_HRLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), DataPlant::PlantLoop(this->m_HRLoopNum).FluidIndex, routineName); @@ -952,7 +952,7 @@ namespace UnitarySystems { WaterCoils::GetCoilMaxWaterFlowRate(state, CoolingCoilType, this->m_CoolingCoilName, initUnitarySystemsErrorsFound); if (CoilMaxVolFlowRate != DataSizing::AutoSize) { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CoolCoilLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->CoolCoilLoopNum).FluidIndex, routineName); this->MaxCoolCoilFluidFlow = CoilMaxVolFlowRate * rho; @@ -978,7 +978,7 @@ namespace UnitarySystems { WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", this->m_HeatingCoilName, initUnitarySystemsErrorsFound); if (CoilMaxVolFlowRate != DataSizing::AutoSize) { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->HeatCoilLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->HeatCoilLoopNum).FluidIndex, routineName); this->MaxHeatCoilFluidFlow = CoilMaxVolFlowRate * rho; @@ -1020,7 +1020,7 @@ namespace UnitarySystems { WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", this->m_SuppHeatCoilName, initUnitarySystemsErrorsFound); if (CoilMaxVolFlowRate != DataSizing::AutoSize) { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->m_SuppCoilLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->m_SuppCoilLoopNum).FluidIndex, routineName); this->m_MaxSuppCoilFluidFlow = CoilMaxVolFlowRate * rho; @@ -9540,7 +9540,7 @@ namespace UnitarySystems { Real64 CoilMaxVolFlowRate = WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", this->m_HeatingCoilName, errorsFound); if (CoilMaxVolFlowRate != DataSizing::AutoSize) { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->HeatCoilLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->HeatCoilLoopNum).FluidIndex, routineName); this->MaxHeatCoilFluidFlow = CoilMaxVolFlowRate * rho; @@ -9581,7 +9581,7 @@ namespace UnitarySystems { Real64 CoilMaxVolFlowRate = WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", this->m_SuppHeatCoilName, errorsFound); if (CoilMaxVolFlowRate != DataSizing::AutoSize) { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->m_SuppCoilLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(this->m_SuppCoilLoopNum).FluidIndex, routineName); this->m_MaxSuppCoilFluidFlow = CoilMaxVolFlowRate * rho; diff --git a/src/EnergyPlus/VariableSpeedCoils.cc b/src/EnergyPlus/VariableSpeedCoils.cc index 0af893ba8b5..ba520ba407b 100644 --- a/src/EnergyPlus/VariableSpeedCoils.cc +++ b/src/EnergyPlus/VariableSpeedCoils.cc @@ -1886,7 +1886,7 @@ namespace VariableSpeedCoils { state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate = NumArray(7); state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate = NumArray(8); - if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate != AutoCalculate) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate != DataGlobalConstants::AutoCalculate()) { if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate <= 0.0) { ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("..." + cNumericFields(7) + " must be > 0.0. entered value=[" + TrimSigDigits(NumArray(7), 3) + "]."); @@ -1894,7 +1894,7 @@ namespace VariableSpeedCoils { } } - if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate != AutoCalculate) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate != DataGlobalConstants::AutoCalculate()) { if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate <= 0.0) { ShowSevereError(RoutineName + CurrentModuleObject + "=\"" + state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name + "\", invalid"); ShowContinueError("..." + cNumericFields(8) + " must be > 0.0 entered value=[" + TrimSigDigits(NumArray(8), 3) + "]."); @@ -3455,12 +3455,12 @@ namespace VariableSpeedCoils { rho = GetDensityGlycol(state, PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidName, - CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidIndex, RoutineNameSimpleWatertoAirHP); Cp = GetSpecificHeatGlycol(state, PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidName, - CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidIndex, RoutineNameSimpleWatertoAirHP); @@ -3778,7 +3778,7 @@ namespace VariableSpeedCoils { } if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType == "WATERHEATING") { - if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate == AutoCalculate) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate == DataGlobalConstants::AutoCalculate()) { state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapWH * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedAirVolFlowRate(NormSpeed) / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(NormSpeed); // 0.00005035; @@ -3789,7 +3789,7 @@ namespace VariableSpeedCoils { state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedAirVolFlowRate, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).AirVolFlowAutoSized); - if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate == AutoCalculate) { + if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedWaterVolFlowRate == DataGlobalConstants::AutoCalculate()) { state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedHPWHCondWaterFlow = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).RatedCapWH * state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterVolFlowRate(NormSpeed) / state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedTotCap(NormSpeed); // 0.00000004487; diff --git a/src/EnergyPlus/VentilatedSlab.cc b/src/EnergyPlus/VentilatedSlab.cc index 10573c9e3c1..8230f9c897e 100644 --- a/src/EnergyPlus/VentilatedSlab.cc +++ b/src/EnergyPlus/VentilatedSlab.cc @@ -1515,7 +1515,7 @@ namespace VentilatedSlab { if (state.dataVentilatedSlab->VentSlab(Item).HCoil_PlantTypeNum == TypeOf_CoilWaterSimpleHeating && !MyPlantScanFlag(Item)) { rho = GetDensityGlycol( - state, PlantLoop(state.dataVentilatedSlab->VentSlab(Item).HWLoopNum).FluidName, HWInitConvTemp, PlantLoop(state.dataVentilatedSlab->VentSlab(Item).HWLoopNum).FluidIndex, RoutineName); + state, PlantLoop(state.dataVentilatedSlab->VentSlab(Item).HWLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp(), PlantLoop(state.dataVentilatedSlab->VentSlab(Item).HWLoopNum).FluidIndex, RoutineName); state.dataVentilatedSlab->VentSlab(Item).MaxHotWaterFlow = rho * state.dataVentilatedSlab->VentSlab(Item).MaxVolHotWaterFlow; state.dataVentilatedSlab->VentSlab(Item).MinHotWaterFlow = rho * state.dataVentilatedSlab->VentSlab(Item).MinVolHotWaterFlow; @@ -1551,7 +1551,7 @@ namespace VentilatedSlab { if ((state.dataVentilatedSlab->VentSlab(Item).CCoil_PlantTypeNum == TypeOf_CoilWaterCooling) || (state.dataVentilatedSlab->VentSlab(Item).CCoil_PlantTypeNum == TypeOf_CoilWaterDetailedFlatCooling)) { rho = GetDensityGlycol(state, PlantLoop(state.dataVentilatedSlab->VentSlab(Item).CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), PlantLoop(state.dataVentilatedSlab->VentSlab(Item).CWLoopNum).FluidIndex, RoutineName); state.dataVentilatedSlab->VentSlab(Item).MaxColdWaterFlow = rho * state.dataVentilatedSlab->VentSlab(Item).MaxVolColdWaterFlow; @@ -2057,11 +2057,11 @@ namespace VentilatedSlab { DesCoilLoad = sizerHeatingCapacity.size(state, TempSize, ErrorsFound); } rho = GetDensityGlycol(state, PlantLoop(state.dataVentilatedSlab->VentSlab(Item).HWLoopNum).FluidName, - HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(state.dataVentilatedSlab->VentSlab(Item).HWLoopNum).FluidIndex, RoutineName); Cp = GetSpecificHeatGlycol(state, PlantLoop(state.dataVentilatedSlab->VentSlab(Item).HWLoopNum).FluidName, - HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(state.dataVentilatedSlab->VentSlab(Item).HWLoopNum).FluidIndex, RoutineName); MaxVolHotWaterFlowDes = DesCoilLoad / (WaterCoilSizDeltaT * Cp * rho); @@ -2175,8 +2175,8 @@ namespace VentilatedSlab { GetSatEnthalpyRefrig(state, fluidNameSteam, TempSteamIn, 0.0, state.dataVentilatedSlab->VentSlab(Item).HCoil_FluidIndex, RoutineName); LatentHeatSteam = EnthSteamInDry - EnthSteamOutWet; SteamDensity = GetSatDensityRefrig(state, fluidNameSteam, TempSteamIn, 1.0, state.dataVentilatedSlab->VentSlab(Item).HCoil_FluidIndex, RoutineName); - Cp = GetSpecificHeatGlycol(state, fluidNameWater, HWInitConvTemp, DummyWaterIndex, RoutineName); - rho = GetDensityGlycol(state, fluidNameWater, HWInitConvTemp, DummyWaterIndex, RoutineName); + Cp = GetSpecificHeatGlycol(state, fluidNameWater, DataGlobalConstants::HWInitConvTemp(), DummyWaterIndex, RoutineName); + rho = GetDensityGlycol(state, fluidNameWater, DataGlobalConstants::HWInitConvTemp(), DummyWaterIndex, RoutineName); MaxVolHotSteamFlowDes = DesCoilLoad / ((PlantSizData(PltSizHeatNum).DeltaT * Cp * rho) + SteamDensity * LatentHeatSteam); } else { diff --git a/src/EnergyPlus/WaterCoils.cc b/src/EnergyPlus/WaterCoils.cc index 02f1d1c468f..cd2ce63574c 100644 --- a/src/EnergyPlus/WaterCoils.cc +++ b/src/EnergyPlus/WaterCoils.cc @@ -1091,7 +1091,7 @@ namespace WaterCoils { if (BeginEnvrnFlag && MyEnvrnFlag(CoilNum)) { rho = GetDensityGlycol(state, PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidName, - InitConvTemp, + DataGlobalConstants::InitConvTemp(), PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidIndex, RoutineName); // Initialize all report variables to a known state at beginning of simulation @@ -2471,11 +2471,11 @@ namespace WaterCoils { DataWaterLoopNum = state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum; rho = GetDensityGlycol(state, PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidIndex, RoutineName); Cp = GetSpecificHeatGlycol( - state, PlantLoop(DataWaterLoopNum).FluidName, DataGlobals::HWInitConvTemp, PlantLoop(DataWaterLoopNum).FluidIndex, RoutineName); + state, PlantLoop(DataWaterLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp(), PlantLoop(DataWaterLoopNum).FluidIndex, RoutineName); if (state.dataWaterCoils->WaterCoil(CoilNum).DesTotWaterCoilLoad > 0.0) { NomCapUserInp = true; } else if (CurSysNum > 0 && CurSysNum <= DataHVACGlobals::NumPrimaryAirSys) { diff --git a/src/EnergyPlus/WaterThermalTanks.cc b/src/EnergyPlus/WaterThermalTanks.cc index 5dcfac49cfa..9ae85f4b334 100644 --- a/src/EnergyPlus/WaterThermalTanks.cc +++ b/src/EnergyPlus/WaterThermalTanks.cc @@ -1190,7 +1190,7 @@ namespace WaterThermalTanks { // Condenser Water Flow Rate HPWH.OperatingWaterFlowRate = hpwhNumeric[2]; - if (HPWH.OperatingWaterFlowRate <= 0.0 && hpwhNumeric[2] != DataGlobals::AutoCalculate) { + if (HPWH.OperatingWaterFlowRate <= 0.0 && hpwhNumeric[2] != DataGlobalConstants::AutoCalculate()) { ShowSevereError(DataIPShortCuts::cCurrentModuleObject + "=\"" + HPWH.Name + "\", "); ShowContinueError(hpwhNumericFieldNames[2] + " must be greater than 0. Condenser water flow rate = " + General::TrimSigDigits(hpwhNumeric[2], 6)); @@ -1228,7 +1228,7 @@ namespace WaterThermalTanks { // Evaporator Air Flow Rate HPWH.OperatingAirFlowRate = hpwhNumeric[3 + nNumericOffset]; - if (HPWH.OperatingAirFlowRate <= 0.0 && hpwhNumeric[3 + nNumericOffset] != DataGlobals::AutoCalculate) { + if (HPWH.OperatingAirFlowRate <= 0.0 && hpwhNumeric[3 + nNumericOffset] != DataGlobalConstants::AutoCalculate()) { ShowSevereError(DataIPShortCuts::cCurrentModuleObject + "=\"" + HPWH.Name + "\", "); ShowContinueError(hpwhNumericFieldNames[3 + nNumericOffset] + " must be greater than 0. Evaporator air flow rate = " + General::TrimSigDigits(hpwhNumeric[3 + nNumericOffset], 6)); @@ -1617,12 +1617,12 @@ namespace WaterThermalTanks { // check the range of condenser pump power to be <= 5 gpm/ton, will be checked in the coil object } - if (HPWH.OperatingWaterFlowRate == DataGlobals::AutoCalculate) { + if (HPWH.OperatingWaterFlowRate == DataGlobalConstants::AutoCalculate()) { HPWH.OperatingWaterFlowRate = 0.00000004487 * HPWH.Capacity; HPWH.WaterFlowRateAutoSized = true; } - if (HPWH.OperatingAirFlowRate == DataGlobals::AutoCalculate) { + if (HPWH.OperatingAirFlowRate == DataGlobalConstants::AutoCalculate()) { HPWH.OperatingAirFlowRate = 0.00005035 * HPWH.Capacity; HPWH.AirFlowRateAutoSized = true; } @@ -2420,7 +2420,7 @@ namespace WaterThermalTanks { Tank.OnCycLossCoeff = DataIPShortCuts::rNumericArgs(15); Tank.OnCycLossFracToZone = DataIPShortCuts::rNumericArgs(16); - Real64 rho = FluidProperties::GetDensityGlycol(state, fluidNameWater, DataGlobals::InitConvTemp, Tank.FluidIndex, RoutineName); + Real64 rho = FluidProperties::GetDensityGlycol(state, fluidNameWater, DataGlobalConstants::InitConvTemp(), Tank.FluidIndex, RoutineName); Tank.MassFlowRateMax = DataIPShortCuts::rNumericArgs(17) * rho; if ((DataIPShortCuts::cAlphaArgs(14).empty()) && (DataIPShortCuts::cAlphaArgs(15).empty())) { @@ -2637,7 +2637,7 @@ namespace WaterThermalTanks { if (Tank.Volume == DataSizing::AutoSize) { Tank.VolumeWasAutoSized = true; } - Real64 rho = FluidProperties::GetDensityGlycol(state, fluidNameWater, DataGlobals::InitConvTemp, Tank.FluidIndex, RoutineName); + Real64 rho = FluidProperties::GetDensityGlycol(state, fluidNameWater, DataGlobalConstants::InitConvTemp(), Tank.FluidIndex, RoutineName); Tank.Mass = Tank.Volume * rho; Tank.Height = DataIPShortCuts::rNumericArgs(2); if (Tank.Height == DataSizing::AutoSize) { @@ -2899,7 +2899,7 @@ namespace WaterThermalTanks { Tank.OffCycFlueLossFracToZone = DataIPShortCuts::rNumericArgs(21); // this is temporary until we know fluid type - rho = FluidProperties::GetDensityGlycol(state, fluidNameWater, DataGlobals::InitConvTemp, Tank.FluidIndex, RoutineName); + rho = FluidProperties::GetDensityGlycol(state, fluidNameWater, DataGlobalConstants::InitConvTemp(), Tank.FluidIndex, RoutineName); Tank.MassFlowRateMax = DataIPShortCuts::rNumericArgs(22) * rho; if ((DataIPShortCuts::cAlphaArgs(16).empty()) && (DataIPShortCuts::cAlphaArgs(17).empty())) { @@ -2942,7 +2942,7 @@ namespace WaterThermalTanks { ErrorsFound = true; } - if ((NumNums > 24) && (DataIPShortCuts::rNumericArgs(25) != DataGlobals::AutoCalculate)) { + if ((NumNums > 24) && (DataIPShortCuts::rNumericArgs(25) != DataGlobalConstants::AutoCalculate())) { Tank.UseOutletHeight = DataIPShortCuts::rNumericArgs(25); } else { // Defaults to top of tank @@ -2970,7 +2970,7 @@ namespace WaterThermalTanks { Tank.SourceEffectiveness = 1.0; } - if ((NumNums > 26) && (DataIPShortCuts::rNumericArgs(27) != DataGlobals::AutoCalculate)) { + if ((NumNums > 26) && (DataIPShortCuts::rNumericArgs(27) != DataGlobalConstants::AutoCalculate())) { Tank.SourceInletHeight = DataIPShortCuts::rNumericArgs(27); } else { // Defaults to top of tank @@ -2987,7 +2987,7 @@ namespace WaterThermalTanks { ErrorsFound = true; } - if ((NumNums > 27) && (DataIPShortCuts::rNumericArgs(28) != DataGlobals::AutoCalculate)) { + if ((NumNums > 27) && (DataIPShortCuts::rNumericArgs(28) != DataGlobalConstants::AutoCalculate())) { Tank.SourceOutletHeight = DataIPShortCuts::rNumericArgs(28); } else { // Defaults to bottom of tank @@ -3479,7 +3479,7 @@ namespace WaterThermalTanks { if (Tank.Volume == DataSizing::AutoSize) { Tank.VolumeWasAutoSized = true; } - Real64 rho = FluidProperties::GetDensityGlycol(state, fluidNameWater, DataGlobals::InitConvTemp, Tank.FluidIndex, RoutineName); + Real64 rho = FluidProperties::GetDensityGlycol(state, fluidNameWater, DataGlobalConstants::InitConvTemp(), Tank.FluidIndex, RoutineName); Tank.Mass = Tank.Volume * rho; Tank.Height = DataIPShortCuts::rNumericArgs(2); if (Tank.Height == DataSizing::AutoSize) { @@ -3624,7 +3624,7 @@ namespace WaterThermalTanks { Tank.SourceSideAvailSchedNum = DataGlobals::ScheduleAlwaysOn; Tank.UseSideAvailSchedNum = DataGlobals::ScheduleAlwaysOn; - if (DataIPShortCuts::rNumericArgs(10) == DataGlobals::AutoCalculate) { + if (DataIPShortCuts::rNumericArgs(10) == DataGlobalConstants::AutoCalculate()) { Tank.UseInletHeight = Tank.Height; // top of tank } if (Tank.UseInletHeight > Tank.Height) { @@ -3661,7 +3661,7 @@ namespace WaterThermalTanks { } Tank.SourceOutletHeight = DataIPShortCuts::rNumericArgs(15); - if (DataIPShortCuts::rNumericArgs(15) == DataGlobals::AutoCalculate) { + if (DataIPShortCuts::rNumericArgs(15) == DataGlobalConstants::AutoCalculate()) { Tank.SourceOutletHeight = Tank.Height; // top of tank } if (Tank.SourceOutletHeight > Tank.Height) { @@ -5126,11 +5126,11 @@ namespace WaterThermalTanks { if ((this->UseSide.loopNum > 0) && allocated(DataPlant::PlantLoop)) { rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->UseSide.loopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->UseSide.loopNum).FluidIndex, RoutineName); } else { - rho = FluidProperties::GetDensityGlycol(state, fluidNameWater, DataGlobals::InitConvTemp, this->FluidIndex, RoutineName); + rho = FluidProperties::GetDensityGlycol(state, fluidNameWater, DataGlobalConstants::InitConvTemp(), this->FluidIndex, RoutineName); } Real64 NodeMass = this->Volume * rho / NumNodes; @@ -5407,7 +5407,7 @@ namespace WaterThermalTanks { if (this->SetLoopIndexFlag && allocated(DataPlant::PlantLoop)) { if ((this->UseInletNode > 0) && (this->HeatPumpNum == 0)) { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->UseSide.loopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->UseSide.loopNum).FluidIndex, GetWaterThermalTankInput); this->PlantUseMassFlowRateMax = this->UseDesignVolFlowRate * rho; @@ -5420,7 +5420,7 @@ namespace WaterThermalTanks { } if ((this->UseInletNode > 0) && (this->HeatPumpNum > 0)) { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->UseSide.loopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->UseSide.loopNum).FluidIndex, GetWaterThermalTankInput); this->PlantUseMassFlowRateMax = this->UseDesignVolFlowRate * rho; @@ -5433,7 +5433,7 @@ namespace WaterThermalTanks { } if ((this->SourceInletNode > 0) && (this->DesuperheaterNum == 0) && (this->HeatPumpNum == 0)) { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->SrcSide.loopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->SrcSide.loopNum).FluidIndex, GetWaterThermalTankInput); this->PlantSourceMassFlowRateMax = this->SourceDesignVolFlowRate * rho; @@ -5497,7 +5497,7 @@ namespace WaterThermalTanks { if (this->UseInletNode > 0 && this->UseOutletNode > 0) { DataLoopNode::Node(this->UseInletNode).Temp = 0.0; Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->UseSide.loopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->UseSide.loopNum).FluidIndex, GetWaterThermalTankInput); this->MassFlowRateMin = this->VolFlowRateMin * rho; @@ -5524,7 +5524,7 @@ namespace WaterThermalTanks { if ((this->SourceInletNode > 0) && (this->DesuperheaterNum == 0) && (this->HeatPumpNum == 0)) { Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->SrcSide.loopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->SrcSide.loopNum).FluidIndex, GetWaterThermalTankInput); this->PlantSourceMassFlowRateMax = this->SourceDesignVolFlowRate * rho; @@ -5553,7 +5553,7 @@ namespace WaterThermalTanks { this->SourceOutletTemp = 0.0; this->SourceMassFlowRate = 0.0; this->SavedSourceOutletTemp = 0.0; - Real64 rho = FluidProperties::GetDensityGlycol(state, fluidNameWater, DataGlobals::InitConvTemp, this->FluidIndex, SizeTankForDemand); + Real64 rho = FluidProperties::GetDensityGlycol(state, fluidNameWater, DataGlobalConstants::InitConvTemp(), this->FluidIndex, SizeTankForDemand); this->PlantSourceMassFlowRateMax = this->SourceDesignVolFlowRate * rho; } @@ -5736,10 +5736,10 @@ namespace WaterThermalTanks { if (SchIndex > 0) { this->UseMassFlowRate = ScheduleManager::GetCurrentScheduleValue(SchIndex) * this->MassFlowRateMax; - this->VolFlowRate = this->UseMassFlowRate / Psychrometrics::RhoH2O(DataGlobals::InitConvTemp); + this->VolFlowRate = this->UseMassFlowRate / Psychrometrics::RhoH2O(DataGlobalConstants::InitConvTemp()); } else { this->UseMassFlowRate = this->MassFlowRateMax; - this->VolFlowRate = this->UseMassFlowRate / Psychrometrics::RhoH2O(DataGlobals::InitConvTemp); + this->VolFlowRate = this->UseMassFlowRate / Psychrometrics::RhoH2O(DataGlobalConstants::InitConvTemp()); } } @@ -10166,7 +10166,7 @@ namespace WaterThermalTanks { } Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->UseSide.loopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->UseSide.loopNum).FluidIndex, RoutineName); if (DataPlant::PlantFirstSizesOkayToFinalize) { @@ -10183,11 +10183,11 @@ namespace WaterThermalTanks { Real64 rho; if (this->UseSide.loopNum > 0) { rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->UseSide.loopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->UseSide.loopNum).FluidIndex, RoutineName); } else { - rho = FluidProperties::GetDensityGlycol(state, fluidNameWater, DataGlobals::InitConvTemp, waterIndex, RoutineName); + rho = FluidProperties::GetDensityGlycol(state, fluidNameWater, DataGlobalConstants::InitConvTemp(), waterIndex, RoutineName); } this->PlantUseMassFlowRateMax = this->UseDesignVolFlowRate * rho; @@ -10227,7 +10227,7 @@ namespace WaterThermalTanks { PlantUtilities::RegisterPlantCompDesignFlow(this->SourceInletNode, tmpSourceDesignVolFlowRate); } Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->SrcSide.loopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->SrcSide.loopNum).FluidIndex, RoutineName); if (DataPlant::PlantFirstSizesOkayToFinalize) { @@ -10245,11 +10245,11 @@ namespace WaterThermalTanks { Real64 rho; if (this->SrcSide.loopNum > 0) { rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->SrcSide.loopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->SrcSide.loopNum).FluidIndex, RoutineName); } else { - rho = FluidProperties::GetDensityGlycol(state, fluidNameWater, DataGlobals::InitConvTemp, waterIndex, RoutineName); + rho = FluidProperties::GetDensityGlycol(state, fluidNameWater, DataGlobalConstants::InitConvTemp(), waterIndex, RoutineName); } this->PlantSourceMassFlowRateMax = this->SourceDesignVolFlowRate * rho; } @@ -10589,7 +10589,7 @@ namespace WaterThermalTanks { if (DataPlant::PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(this->Type, this->Name, "Initial Tank Height [m]", this->Height); } - // check if DataGlobals::AutoCalculate Use outlet and source inlet are still set to autosize by earlier + // check if DataGlobalConstants::AutoCalculate() Use outlet and source inlet are still set to autosize by earlier if (this->UseOutletHeightWasAutoSized) { this->UseOutletHeight = this->Height; } @@ -10818,7 +10818,7 @@ namespace WaterThermalTanks { PlantUtilities::RegisterPlantCompDesignFlow(this->UseInletNode, tmpUseDesignVolFlowRate); } Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->UseSide.loopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->UseSide.loopNum).FluidIndex, RoutineName); if (DataPlant::PlantFirstSizesOkayToFinalize) { @@ -10837,11 +10837,11 @@ namespace WaterThermalTanks { Real64 rho; if (this->UseSide.loopNum > 0) { rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->UseSide.loopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->UseSide.loopNum).FluidIndex, RoutineName); } else { - rho = FluidProperties::GetDensityGlycol(state, fluidNameWater, DataGlobals::InitConvTemp, waterIndex, RoutineName); + rho = FluidProperties::GetDensityGlycol(state, fluidNameWater, DataGlobalConstants::InitConvTemp(), waterIndex, RoutineName); } this->PlantUseMassFlowRateMax = this->UseDesignVolFlowRate * rho; } // autosizing needed. @@ -10902,7 +10902,7 @@ namespace WaterThermalTanks { PlantUtilities::RegisterPlantCompDesignFlow(this->SourceInletNode, tmpSourceDesignVolFlowRate); } Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->SrcSide.loopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->SrcSide.loopNum).FluidIndex, RoutineName); if (DataPlant::PlantFirstSizesOkayToFinalize) { @@ -10921,11 +10921,11 @@ namespace WaterThermalTanks { Real64 rho; if (this->SrcSide.loopNum > 0) { rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->SrcSide.loopNum).FluidName, - DataGlobals::InitConvTemp, + DataGlobalConstants::InitConvTemp(), DataPlant::PlantLoop(this->SrcSide.loopNum).FluidIndex, RoutineName); } else { - rho = FluidProperties::GetDensityGlycol(state, fluidNameWater, DataGlobals::InitConvTemp, waterIndex, RoutineName); + rho = FluidProperties::GetDensityGlycol(state, fluidNameWater, DataGlobalConstants::InitConvTemp(), waterIndex, RoutineName); } this->PlantSourceMassFlowRateMax = this->SourceDesignVolFlowRate * rho; } // autosizing needed. @@ -10968,7 +10968,7 @@ namespace WaterThermalTanks { if (SELECT_CASE_var == SizeEnum::PeakDraw) { // get draw rate from maximum in schedule - Real64 rho = FluidProperties::GetDensityGlycol(state, fluidNameWater, DataGlobals::InitConvTemp, waterIndex, RoutineName); + Real64 rho = FluidProperties::GetDensityGlycol(state, fluidNameWater, DataGlobalConstants::InitConvTemp(), waterIndex, RoutineName); Real64 DrawDesignVolFlowRate = ScheduleManager::GetScheduleMaxValue(this->FlowRateSchedule) * this->MassFlowRateMax / rho; if (this->VolumeWasAutoSized) { @@ -11315,7 +11315,7 @@ namespace WaterThermalTanks { for (auto &e : this->Node) e.Temp = 57.2222; - Real64 TotalDrawMass = 0.243402 * Psychrometrics::RhoH2O(DataGlobals::InitConvTemp); // 64.3 gal * rho + Real64 TotalDrawMass = 0.243402 * Psychrometrics::RhoH2O(DataGlobalConstants::InitConvTemp()); // 64.3 gal * rho Real64 DrawMass = TotalDrawMass / 6.0; // 6 equal draws Real64 SecInTimeStep = DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); Real64 DrawMassFlowRate = DrawMass / SecInTimeStep; diff --git a/src/EnergyPlus/WaterToAirHeatPump.cc b/src/EnergyPlus/WaterToAirHeatPump.cc index 2406d54d2fd..80adb411464 100644 --- a/src/EnergyPlus/WaterToAirHeatPump.cc +++ b/src/EnergyPlus/WaterToAirHeatPump.cc @@ -906,9 +906,9 @@ namespace WaterToAirHeatPump { // The rest of the one time initializations rho = GetDensityGlycol( - state, PlantLoop(state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoopNum).FluidName, InitConvTemp, PlantLoop(state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoopNum).FluidIndex, RoutineName); + state, PlantLoop(state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoopNum).FluidName, DataGlobalConstants::InitConvTemp(), PlantLoop(state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoopNum).FluidIndex, RoutineName); Cp = GetSpecificHeatGlycol( - state, PlantLoop(state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoopNum).FluidName, InitConvTemp, PlantLoop(state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoopNum).FluidIndex, RoutineName); + state, PlantLoop(state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoopNum).FluidName, DataGlobalConstants::InitConvTemp(), PlantLoop(state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoopNum).FluidIndex, RoutineName); state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).DesignWaterMassFlowRate = rho * state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).DesignWaterVolFlowRate; state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).MaxONOFFCyclesperHour = MaxONOFFCyclesperHour; diff --git a/src/EnergyPlus/WaterToAirHeatPumpSimple.cc b/src/EnergyPlus/WaterToAirHeatPumpSimple.cc index 628017ce626..032fc47f04d 100644 --- a/src/EnergyPlus/WaterToAirHeatPumpSimple.cc +++ b/src/EnergyPlus/WaterToAirHeatPumpSimple.cc @@ -938,11 +938,11 @@ namespace WaterToAirHeatPumpSimple { state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).PartLoadRatio = 0.0; rho = GetDensityGlycol(state, PlantLoop(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).LoopNum).FluidName, - InitConvTemp, + DataGlobalConstants::InitConvTemp(), PlantLoop(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).LoopNum).FluidIndex, RoutineName); Cp = GetSpecificHeatGlycol(state, PlantLoop(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).LoopNum).FluidName, - InitConvTemp, + DataGlobalConstants::InitConvTemp(), PlantLoop(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).LoopNum).FluidIndex, RoutineName); diff --git a/src/EnergyPlus/WaterToAirHeatPumpSimple.hh b/src/EnergyPlus/WaterToAirHeatPumpSimple.hh index ffd5717e62d..9d6f53b999c 100644 --- a/src/EnergyPlus/WaterToAirHeatPumpSimple.hh +++ b/src/EnergyPlus/WaterToAirHeatPumpSimple.hh @@ -335,7 +335,7 @@ namespace WaterToAirHeatPumpSimple { // Default Constructor WaterToAirHeatPumpSimpleData() - : CelsiustoKelvin(DataGlobals::KelvinConv), NumWatertoAirHPs(0), GetCoilsInputFlag(true), + : CelsiustoKelvin(DataGlobalConstants::KelvinConv()), NumWatertoAirHPs(0), GetCoilsInputFlag(true), SourceSideMassFlowRate(0.0), SourceSideInletTemp(0.0), SourceSideInletEnth(0.0), LoadSideMassFlowRate(0.0), LoadSideInletDBTemp(0.0), LoadSideInletWBTemp(0.0), LoadSideInletHumRat(0.0), LoadSideInletEnth(0.0), LoadSideOutletDBTemp(0.0), LoadSideOutletHumRat(0.0), LoadSideOutletEnth(0.0), QSensible(0.0), diff --git a/src/EnergyPlus/WaterUse.cc b/src/EnergyPlus/WaterUse.cc index 2b171a856c5..62c03eb18c9 100644 --- a/src/EnergyPlus/WaterUse.cc +++ b/src/EnergyPlus/WaterUse.cc @@ -565,17 +565,17 @@ namespace WaterUse { int thisWaterEquipNum = state.dataWaterUse->WaterConnections(WaterConnNum).myWaterEquipArr(WaterEquipNum); if (state.dataWaterUse->WaterEquipment(thisWaterEquipNum).Zone > 0) { state.dataWaterUse->WaterConnections(WaterConnNum).PeakMassFlowRate += - state.dataWaterUse->WaterEquipment(thisWaterEquipNum).PeakVolFlowRate * Psychrometrics::RhoH2O(DataGlobals::InitConvTemp) * + state.dataWaterUse->WaterEquipment(thisWaterEquipNum).PeakVolFlowRate * Psychrometrics::RhoH2O(DataGlobalConstants::InitConvTemp()) * DataHeatBalance::Zone(state.dataWaterUse->WaterEquipment(thisWaterEquipNum).Zone).Multiplier * DataHeatBalance::Zone(state.dataWaterUse->WaterEquipment(thisWaterEquipNum).Zone).ListMultiplier; } else { // can't have multipliers state.dataWaterUse->WaterConnections(WaterConnNum).PeakMassFlowRate += - state.dataWaterUse->WaterEquipment(thisWaterEquipNum).PeakVolFlowRate * Psychrometrics::RhoH2O(DataGlobals::InitConvTemp); + state.dataWaterUse->WaterEquipment(thisWaterEquipNum).PeakVolFlowRate * Psychrometrics::RhoH2O(DataGlobalConstants::InitConvTemp()); } } PlantUtilities::RegisterPlantCompDesignFlow(state.dataWaterUse->WaterConnections(WaterConnNum).InletNode, state.dataWaterUse->WaterConnections(WaterConnNum).PeakMassFlowRate / - Psychrometrics::RhoH2O(DataGlobals::InitConvTemp)); + Psychrometrics::RhoH2O(DataGlobalConstants::InitConvTemp())); } } } @@ -859,7 +859,7 @@ namespace WaterUse { } } - this->TotalMassFlowRate = this->TotalVolFlowRate * Psychrometrics::RhoH2O(DataGlobals::InitConvTemp); + this->TotalMassFlowRate = this->TotalVolFlowRate * Psychrometrics::RhoH2O(DataGlobalConstants::InitConvTemp()); // Calculate hot and cold water mixing at the tap if (this->TotalMassFlowRate > 0.0) { @@ -924,7 +924,7 @@ namespace WaterUse { this->SensibleEnergy = 0.0; } else { this->SensibleRate = ScheduleManager::GetCurrentScheduleValue(this->SensibleFracSchedule) * this->TotalMassFlowRate * - Psychrometrics::CPHW(DataGlobals::InitConvTemp) * (this->MixedTemp - DataHeatBalFanSys::MAT(this->Zone)); + Psychrometrics::CPHW(DataGlobalConstants::InitConvTemp()) * (this->MixedTemp - DataHeatBalFanSys::MAT(this->Zone)); this->SensibleEnergy = this->SensibleRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); } @@ -953,9 +953,9 @@ namespace WaterUse { if (this->DrainMassFlowRate == 0.0) { this->DrainTemp = this->MixedTemp; } else { - this->DrainTemp = (this->TotalMassFlowRate * Psychrometrics::CPHW(DataGlobals::InitConvTemp) * this->MixedTemp - this->SensibleRate - + this->DrainTemp = (this->TotalMassFlowRate * Psychrometrics::CPHW(DataGlobalConstants::InitConvTemp()) * this->MixedTemp - this->SensibleRate - this->LatentRate) / - (this->DrainMassFlowRate * Psychrometrics::CPHW(DataGlobals::InitConvTemp)); + (this->DrainMassFlowRate * Psychrometrics::CPHW(DataGlobalConstants::InitConvTemp())); } } } @@ -1132,14 +1132,14 @@ namespace WaterUse { if (this->SupplyTankNum > 0) { // Set the demand request for supply water from water storage tank - this->ColdVolFlowRate = this->ColdMassFlowRate / Psychrometrics::RhoH2O(DataGlobals::InitConvTemp); + this->ColdVolFlowRate = this->ColdMassFlowRate / Psychrometrics::RhoH2O(DataGlobalConstants::InitConvTemp()); DataWater::WaterStorage(this->SupplyTankNum).VdotRequestDemand(this->TankDemandID) = this->ColdVolFlowRate; // Check if cold flow rate should be starved by restricted flow from tank // Currently, the tank flow is not really starved--water continues to flow at the tank water temperature // But the user can see the error by comparing report variables for TankVolFlowRate < ColdVolFlowRate this->TankVolFlowRate = DataWater::WaterStorage(this->SupplyTankNum).VdotAvailDemand(this->TankDemandID); - this->TankMassFlowRate = this->TankVolFlowRate * Psychrometrics::RhoH2O(DataGlobals::InitConvTemp); + this->TankMassFlowRate = this->TankVolFlowRate * Psychrometrics::RhoH2O(DataGlobalConstants::InitConvTemp()); } } @@ -1170,7 +1170,7 @@ namespace WaterUse { this->DrainTemp = this->HotTemp; } - this->DrainVolFlowRate = this->DrainMassFlowRate * Psychrometrics::RhoH2O(DataGlobals::InitConvTemp); + this->DrainVolFlowRate = this->DrainMassFlowRate * Psychrometrics::RhoH2O(DataGlobalConstants::InitConvTemp()); } void WaterConnectionsType::CalcConnectionsHeatRecovery() @@ -1210,8 +1210,8 @@ namespace WaterUse { } } - Real64 HXCapacityRate = Psychrometrics::CPHW(DataGlobals::InitConvTemp) * this->RecoveryMassFlowRate; - Real64 DrainCapacityRate = Psychrometrics::CPHW(DataGlobals::InitConvTemp) * this->DrainMassFlowRate; + Real64 HXCapacityRate = Psychrometrics::CPHW(DataGlobalConstants::InitConvTemp()) * this->RecoveryMassFlowRate; + Real64 DrainCapacityRate = Psychrometrics::CPHW(DataGlobalConstants::InitConvTemp()) * this->DrainMassFlowRate; Real64 MinCapacityRate = min(DrainCapacityRate, HXCapacityRate); { @@ -1239,8 +1239,8 @@ namespace WaterUse { this->RecoveryRate = this->Effectiveness * MinCapacityRate * (this->DrainTemp - this->ColdSupplyTemp); this->RecoveryTemp = - this->ColdSupplyTemp + this->RecoveryRate / (Psychrometrics::CPHW(DataGlobals::InitConvTemp) * this->TotalMassFlowRate); - this->WasteTemp = this->DrainTemp - this->RecoveryRate / (Psychrometrics::CPHW(DataGlobals::InitConvTemp) * this->TotalMassFlowRate); + this->ColdSupplyTemp + this->RecoveryRate / (Psychrometrics::CPHW(DataGlobalConstants::InitConvTemp()) * this->TotalMassFlowRate); + this->WasteTemp = this->DrainTemp - this->RecoveryRate / (Psychrometrics::CPHW(DataGlobalConstants::InitConvTemp()) * this->TotalMassFlowRate); if (this->RecoveryTankNum > 0) { DataWater::WaterStorage(this->RecoveryTankNum).VdotAvailSupply(this->TankSupplyID) = this->DrainVolFlowRate; @@ -1305,8 +1305,8 @@ namespace WaterUse { for (int WaterEquipNum = 1; WaterEquipNum <= state.dataWaterUse->numWaterEquipment; ++WaterEquipNum) { auto &thisWEq = state.dataWaterUse->WaterEquipment(WaterEquipNum); - thisWEq.ColdVolFlowRate = thisWEq.ColdMassFlowRate / Psychrometrics::RhoH2O(DataGlobals::InitConvTemp); - thisWEq.HotVolFlowRate = thisWEq.HotMassFlowRate / Psychrometrics::RhoH2O(DataGlobals::InitConvTemp); + thisWEq.ColdVolFlowRate = thisWEq.ColdMassFlowRate / Psychrometrics::RhoH2O(DataGlobalConstants::InitConvTemp()); + thisWEq.HotVolFlowRate = thisWEq.HotMassFlowRate / Psychrometrics::RhoH2O(DataGlobalConstants::InitConvTemp()); thisWEq.TotalVolFlowRate = thisWEq.ColdVolFlowRate + thisWEq.HotVolFlowRate; thisWEq.ColdVolume = thisWEq.ColdVolFlowRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); @@ -1314,9 +1314,9 @@ namespace WaterUse { thisWEq.TotalVolume = thisWEq.TotalVolFlowRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); if (thisWEq.Connections == 0) { - thisWEq.Power = thisWEq.HotMassFlowRate * Psychrometrics::CPHW(DataGlobals::InitConvTemp) * (thisWEq.HotTemp - thisWEq.ColdTemp); + thisWEq.Power = thisWEq.HotMassFlowRate * Psychrometrics::CPHW(DataGlobalConstants::InitConvTemp()) * (thisWEq.HotTemp - thisWEq.ColdTemp); } else { - thisWEq.Power = thisWEq.HotMassFlowRate * Psychrometrics::CPHW(DataGlobals::InitConvTemp) * + thisWEq.Power = thisWEq.HotMassFlowRate * Psychrometrics::CPHW(DataGlobalConstants::InitConvTemp()) * (thisWEq.HotTemp - state.dataWaterUse->WaterConnections(thisWEq.Connections).ReturnTemp); } @@ -1341,30 +1341,30 @@ namespace WaterUse { int WaterEquipNum = this->myWaterEquipArr(Loop); auto &thisWEq = state.dataWaterUse->WaterEquipment(WaterEquipNum); - thisWEq.ColdVolFlowRate = thisWEq.ColdMassFlowRate / Psychrometrics::RhoH2O(DataGlobals::InitConvTemp); - thisWEq.HotVolFlowRate = thisWEq.HotMassFlowRate / Psychrometrics::RhoH2O(DataGlobals::InitConvTemp); + thisWEq.ColdVolFlowRate = thisWEq.ColdMassFlowRate / Psychrometrics::RhoH2O(DataGlobalConstants::InitConvTemp()); + thisWEq.HotVolFlowRate = thisWEq.HotMassFlowRate / Psychrometrics::RhoH2O(DataGlobalConstants::InitConvTemp()); thisWEq.TotalVolFlowRate = thisWEq.ColdVolFlowRate + thisWEq.HotVolFlowRate; thisWEq.ColdVolume = thisWEq.ColdVolFlowRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); thisWEq.HotVolume = thisWEq.HotVolFlowRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); thisWEq.TotalVolume = thisWEq.TotalVolFlowRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); if (thisWEq.Connections == 0) { - thisWEq.Power = thisWEq.HotMassFlowRate * Psychrometrics::CPHW(DataGlobals::InitConvTemp) * (thisWEq.HotTemp - thisWEq.ColdTemp); + thisWEq.Power = thisWEq.HotMassFlowRate * Psychrometrics::CPHW(DataGlobalConstants::InitConvTemp()) * (thisWEq.HotTemp - thisWEq.ColdTemp); } else { - thisWEq.Power = thisWEq.HotMassFlowRate * Psychrometrics::CPHW(DataGlobals::InitConvTemp) * + thisWEq.Power = thisWEq.HotMassFlowRate * Psychrometrics::CPHW(DataGlobalConstants::InitConvTemp()) * (thisWEq.HotTemp - state.dataWaterUse->WaterConnections(thisWEq.Connections).ReturnTemp); } thisWEq.Energy = thisWEq.Power * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); } - this->ColdVolFlowRate = this->ColdMassFlowRate / Psychrometrics::RhoH2O(DataGlobals::InitConvTemp); - this->HotVolFlowRate = this->HotMassFlowRate / Psychrometrics::RhoH2O(DataGlobals::InitConvTemp); + this->ColdVolFlowRate = this->ColdMassFlowRate / Psychrometrics::RhoH2O(DataGlobalConstants::InitConvTemp()); + this->HotVolFlowRate = this->HotMassFlowRate / Psychrometrics::RhoH2O(DataGlobalConstants::InitConvTemp()); this->TotalVolFlowRate = this->ColdVolFlowRate + this->HotVolFlowRate; this->ColdVolume = this->ColdVolFlowRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); this->HotVolume = this->HotVolFlowRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); this->TotalVolume = this->TotalVolFlowRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); - this->Power = this->HotMassFlowRate * Psychrometrics::CPHW(DataGlobals::InitConvTemp) * (this->HotTemp - this->ReturnTemp); + this->Power = this->HotMassFlowRate * Psychrometrics::CPHW(DataGlobalConstants::InitConvTemp()) * (this->HotTemp - this->ReturnTemp); this->Energy = this->Power * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); this->RecoveryEnergy = this->RecoveryRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour(); } diff --git a/src/EnergyPlus/WeatherManager.cc b/src/EnergyPlus/WeatherManager.cc index eed09e769e8..d6eeeaa2031 100644 --- a/src/EnergyPlus/WeatherManager.cc +++ b/src/EnergyPlus/WeatherManager.cc @@ -1881,7 +1881,7 @@ namespace WeatherManager { (DataGlobals::HourOfDay - 1) * DataGlobals::NumOfTimeStepInHour + DataGlobals::TimeStep; DataEnvironment::GroundTemp = state.dataWeatherManager->siteBuildingSurfaceGroundTempsPtr->getGroundTempAtTimeInMonths(state, 0, DataEnvironment::Month); - DataEnvironment::GroundTempKelvin = DataEnvironment::GroundTemp + DataGlobals::KelvinConv; + DataEnvironment::GroundTempKelvin = DataEnvironment::GroundTemp + DataGlobalConstants::KelvinConv(); DataEnvironment::GroundTempFC = state.dataWeatherManager->siteFCFactorMethodGroundTempsPtr->getGroundTempAtTimeInMonths(state, 0, DataEnvironment::Month); DataEnvironment::GroundTemp_Surface = state.dataWeatherManager->siteShallowGroundTempsPtr->getGroundTempAtTimeInMonths(state, 0, DataEnvironment::Month); DataEnvironment::GroundTemp_Deep = state.dataWeatherManager->siteDeepGroundTempsPtr->getGroundTempAtTimeInMonths(state, 0, DataEnvironment::Month); @@ -1963,7 +1963,7 @@ namespace WeatherManager { if (DataEnvironment::EMSWindDirOverrideOn) DataEnvironment::WindDir = DataEnvironment::EMSWindDirOverrideValue; state.dataWeatherManager->HorizIRSky = state.dataWeatherManager->TodayHorizIRSky(DataGlobals::TimeStep, DataGlobals::HourOfDay); DataEnvironment::SkyTemp = state.dataWeatherManager->TodaySkyTemp(DataGlobals::TimeStep, DataGlobals::HourOfDay); - DataEnvironment::SkyTempKelvin = DataEnvironment::SkyTemp + DataGlobals::KelvinConv; + DataEnvironment::SkyTempKelvin = DataEnvironment::SkyTemp + DataGlobalConstants::KelvinConv(); DataEnvironment::DifSolarRad = state.dataWeatherManager->TodayDifSolarRad(DataGlobals::TimeStep, DataGlobals::HourOfDay); if (DataEnvironment::EMSDifSolarRadOverrideOn) DataEnvironment::DifSolarRad = DataEnvironment::EMSDifSolarRadOverrideValue; DataEnvironment::BeamSolarRad = state.dataWeatherManager->TodayBeamSolarRad(DataGlobals::TimeStep, DataGlobals::HourOfDay); @@ -2992,12 +2992,12 @@ namespace WeatherManager { ESky = 0.618 + 0.056 * pow(PartialPress, 0.5); } else if (ESkyCalcType == EmissivityCalcType::IdsoModel) { double const PartialPress = RelHum * Psychrometrics::PsyPsatFnTemp(DryBulb) * 0.01; - ESky = 0.685 + 0.000032 * PartialPress * exp(1699 / (DryBulb + DataGlobals::KelvinConv)); + ESky = 0.685 + 0.000032 * PartialPress * exp(1699 / (DryBulb + DataGlobalConstants::KelvinConv())); } else if (ESkyCalcType == EmissivityCalcType::BerdahlMartinModel) { double const TDewC = min(DryBulb, DewPoint); ESky = 0.758 + 0.521 * (TDewC / 100) + 0.625 * pow_2(TDewC / 100); } else { - ESky = 0.787 + 0.764 * std::log((min(DryBulb, DewPoint) + DataGlobals::KelvinConv) / DataGlobals::KelvinConv); + ESky = 0.787 + 0.764 * std::log((min(DryBulb, DewPoint) + DataGlobalConstants::KelvinConv()) / DataGlobalConstants::KelvinConv()); } ESky = ESky * (1.0 + 0.0224 * OSky - 0.0035 * pow_2(OSky) + 0.00028 * pow_3(OSky)); return ESky; @@ -3673,7 +3673,7 @@ namespace WeatherManager { double RelHum = state.dataWeatherManager->TomorrowOutRelHum(ts, hour) * 0.01; Real64 ESky = CalcSkyEmissivity(state, state.dataWeatherManager->Environment(EnvrnNum).SkyTempModel, OSky, DryBulb, state.dataWeatherManager->TomorrowOutDewPointTemp(ts, hour), RelHum); // Emissivitity of Sky - state.dataWeatherManager->TomorrowHorizIRSky(ts, hour) = ESky * state.dataWeatherManager->Sigma * pow_4(DryBulb + DataGlobals::KelvinConv); + state.dataWeatherManager->TomorrowHorizIRSky(ts, hour) = ESky * state.dataWeatherManager->Sigma * pow_4(DryBulb + DataGlobalConstants::KelvinConv()); if (state.dataWeatherManager->Environment(EnvrnNum).SkyTempModel == EmissivityCalcType::BruntModel || state.dataWeatherManager->Environment(EnvrnNum).SkyTempModel == EmissivityCalcType::IdsoModel || @@ -3681,7 +3681,7 @@ namespace WeatherManager { state.dataWeatherManager->Environment(EnvrnNum).SkyTempModel == EmissivityCalcType::SkyTAlgorithmA || state.dataWeatherManager->Environment(EnvrnNum).SkyTempModel == EmissivityCalcType::ClarkAllenModel) { // Design day not scheduled - state.dataWeatherManager->TomorrowSkyTemp(ts, hour) = (DryBulb + DataGlobals::KelvinConv) * root_4(ESky) - DataGlobals::KelvinConv; + state.dataWeatherManager->TomorrowSkyTemp(ts, hour) = (DryBulb + DataGlobalConstants::KelvinConv()) * root_4(ESky) - DataGlobalConstants::KelvinConv(); } // Generate solar values for timestep // working results = BeamRad and DiffRad @@ -8684,13 +8684,13 @@ namespace WeatherManager { if (!state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).UseWeatherFileHorizontalIR || IRHoriz >= 9999.0) { // Missing or user defined to not use IRHoriz from weather, using sky cover and clear sky emissivity ESky = CalcSkyEmissivity(state, state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).SkyTempModel, OpaqueSkyCover, DryBulb, DewPoint, RelHum); - HorizIRSky = ESky * state.dataWeatherManager->Sigma * pow_4(DryBulb + DataGlobals::KelvinConv); + HorizIRSky = ESky * state.dataWeatherManager->Sigma * pow_4(DryBulb + DataGlobalConstants::KelvinConv()); if (state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).SkyTempModel == EmissivityCalcType::BruntModel || state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).SkyTempModel == EmissivityCalcType::IdsoModel || state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).SkyTempModel == EmissivityCalcType::BerdahlMartinModel || state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).SkyTempModel == EmissivityCalcType::SkyTAlgorithmA || state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).SkyTempModel == EmissivityCalcType::ClarkAllenModel) { - SkyTemp = (DryBulb + DataGlobals::KelvinConv) * root_4(ESky) - DataGlobals::KelvinConv; + SkyTemp = (DryBulb + DataGlobalConstants::KelvinConv()) * root_4(ESky) - DataGlobalConstants::KelvinConv(); } else { SkyTemp = 0.0; // dealt with later } @@ -8703,7 +8703,7 @@ namespace WeatherManager { state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).SkyTempModel == EmissivityCalcType::BerdahlMartinModel || state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).SkyTempModel == EmissivityCalcType::SkyTAlgorithmA || state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).SkyTempModel == EmissivityCalcType::ClarkAllenModel) { - SkyTemp = root_4(IRHoriz / state.dataWeatherManager->Sigma) - DataGlobals::KelvinConv; + SkyTemp = root_4(IRHoriz / state.dataWeatherManager->Sigma) - DataGlobalConstants::KelvinConv(); } else { SkyTemp = 0.0; // dealt with later } diff --git a/src/EnergyPlus/WindowComplexManager.cc b/src/EnergyPlus/WindowComplexManager.cc index b622408ec20..726550ffe17 100644 --- a/src/EnergyPlus/WindowComplexManager.cc +++ b/src/EnergyPlus/WindowComplexManager.cc @@ -98,7 +98,6 @@ namespace WindowComplexManager { using namespace DataComplexFenestration; using namespace DataVectorTypes; using namespace DataBSDFWindow; - using DataGlobals::KelvinConv; using DataGlobals::NumOfTimeStepInHour; using DataGlobals::NumOfZones; using DataGlobals::TimeStepZoneSec; @@ -2470,7 +2469,6 @@ namespace WindowComplexManager { using namespace DataBSDFWindow; using DataGlobals::AnyLocalEnvironmentsInModel; - using DataGlobals::StefanBoltzmann; using DataHeatBalance::GasCoeffsAir; using DataHeatBalance::SupportPillar; using DataLoopNode::Node; @@ -2791,7 +2789,7 @@ namespace WindowComplexManager { CalcDeflection = WindowThermalModel(ThermalModelNum).DeflectionModel; SDScalar = WindowThermalModel(ThermalModelNum).SDScalar; VacuumPressure = WindowThermalModel(ThermalModelNum).VacuumPressureLimit; - Tini = WindowThermalModel(ThermalModelNum).InitialTemperature - KelvinConv; + Tini = WindowThermalModel(ThermalModelNum).InitialTemperature - DataGlobalConstants::KelvinConv(); Pini = WindowThermalModel(ThermalModelNum).InitialPressure; nlayer = state.dataConstruction->Construct(ConstrNum).TotSolidLayers; @@ -2844,7 +2842,7 @@ namespace WindowComplexManager { } } - tind = RefAirTemp + KelvinConv; // Inside air temperature + tind = RefAirTemp + DataGlobalConstants::KelvinConv(); // Inside air temperature // now get "outside" air temperature if (SurfNumAdj > 0) { // Interzone window @@ -2889,9 +2887,9 @@ namespace WindowComplexManager { } } - tout = RefAirTemp + KelvinConv; // outside air temperature + tout = RefAirTemp + DataGlobalConstants::KelvinConv(); // outside air temperature - tsky = MRT(ZoneNumAdj) + KelvinConv; // TODO this misses IR from sources such as high temp radiant and baseboards + tsky = MRT(ZoneNumAdj) + DataGlobalConstants::KelvinConv(); // TODO this misses IR from sources such as high temp radiant and baseboards // ! Add long-wave radiation from adjacent zone absorbed by glass layer closest to the adjacent zone. // AbsRadGlassFace(1) = AbsRadGlassFace(1) + QRadThermInAbs(SurfNumAdj) @@ -2915,19 +2913,19 @@ namespace WindowComplexManager { for (SrdSurfNum = 1; SrdSurfNum <= SurroundingSurfsProperty(SrdSurfsNum).TotSurroundingSurface; SrdSurfNum++) { SrdSurfViewFac = SurroundingSurfsProperty(SrdSurfsNum).SurroundingSurfs(SrdSurfNum).ViewFactor; SrdSurfTempAbs = - GetCurrentScheduleValue(SurroundingSurfsProperty(SrdSurfsNum).SurroundingSurfs(SrdSurfNum).TempSchNum) + KelvinConv; - OutSrdIR += StefanBoltzmann * SrdSurfViewFac * (pow_4(SrdSurfTempAbs)); + GetCurrentScheduleValue(SurroundingSurfsProperty(SrdSurfsNum).SurroundingSurfs(SrdSurfNum).TempSchNum) + DataGlobalConstants::KelvinConv(); + OutSrdIR += DataGlobalConstants::StefanBoltzmann() * SrdSurfViewFac * (pow_4(SrdSurfTempAbs)); } } } if (Surface(SurfNum).ExtWind) { // Window is exposed to wind (and possibly rain) if (IsRain) { // Raining: since wind exposed, outside window surface gets wet - tout = Surface(SurfNum).OutWetBulbTemp + KelvinConv; + tout = Surface(SurfNum).OutWetBulbTemp + DataGlobalConstants::KelvinConv(); } else { // Dry - tout = Surface(SurfNum).OutDryBulbTemp + KelvinConv; + tout = Surface(SurfNum).OutDryBulbTemp + DataGlobalConstants::KelvinConv(); } } else { // Window not exposed to wind - tout = Surface(SurfNum).OutDryBulbTemp + KelvinConv; + tout = Surface(SurfNum).OutDryBulbTemp + DataGlobalConstants::KelvinConv(); } // tsky = SkyTemp + TKelvin tsky = SkyTempKelvin; @@ -2951,7 +2949,7 @@ namespace WindowComplexManager { // IR incident on window from zone surfaces and high-temp radiant sources rmir = SurfWinIRfromParentZone(SurfNum) + QHTRadSysSurf(SurfNum) + QCoolingPanelSurf(SurfNum) + QHWBaseboardSurf(SurfNum) + QSteamBaseboardSurf(SurfNum) + QElecBaseboardSurf(SurfNum); - trmin = root_4(rmir / StefanBoltzmann); // TODO check model equation. + trmin = root_4(rmir / DataGlobalConstants::StefanBoltzmann()); // TODO check model equation. // outdoor wind speed if (!Surface(SurfNum).ExtWind) { @@ -3347,9 +3345,9 @@ namespace WindowComplexManager { // For all cases, get total window heat gain for reporting. See CalcWinFrameAndDividerTemps for // contribution of frame and divider. - SurfInsideTemp = theta(2 * nlayer) - KelvinConv; + SurfInsideTemp = theta(2 * nlayer) - DataGlobalConstants::KelvinConv(); SurfWinEffInsSurfTemp(SurfNum) = SurfInsideTemp; - SurfOutsideTemp = theta(1) - KelvinConv; + SurfOutsideTemp = theta(1) - DataGlobalConstants::KelvinConv(); SurfOutsideEmiss = emis(1); IncidentSolar = Surface(SurfNum).Area * QRadSWOutIncident(SurfNum); @@ -3414,8 +3412,8 @@ namespace WindowComplexManager { // WinGapConvHtFlowRep(SurfNum) = 0.0d0 // WinGapConvHtFlowRepEnergy(SurfNum) = 0.0d0 TotAirflowGap = SurfWinAirflowThisTS(SurfNum) * Surface(SurfNum).Width; - TAirflowGapOutlet = KelvinConv; // TODO Need to calculate this - TAirflowGapOutletC = TAirflowGapOutlet - KelvinConv; + TAirflowGapOutlet = DataGlobalConstants::KelvinConv(); // TODO Need to calculate this + TAirflowGapOutletC = TAirflowGapOutlet - DataGlobalConstants::KelvinConv(); SurfWinTAirflowGapOutlet(SurfNum) = TAirflowGapOutletC; if (SurfWinAirflowThisTS(SurfNum) > 0.0) { ConvHeatFlowForced = sum(qv); // TODO. figure forced ventilation heat flow in Watts @@ -3493,17 +3491,17 @@ namespace WindowComplexManager { if (ShadeFlag == IntShadeOn) SurfWinConvCoeffWithShade(SurfNum) = 0.0; if (ShadeFlag == IntShadeOn) { - SurfInsideTemp = theta(2 * ngllayer + 2) - KelvinConv; + SurfInsideTemp = theta(2 * ngllayer + 2) - DataGlobalConstants::KelvinConv(); // // Get properties of inside shading layer Real64 EffShBlEmiss = SurfaceWindow(SurfNum).EffShBlindEmiss[0]; Real64 EffGlEmiss = SurfaceWindow(SurfNum).EffGlassEmiss[0]; SurfWinEffInsSurfTemp(SurfNum) = - (EffShBlEmiss * SurfInsideTemp + EffGlEmiss * (theta(2 * ngllayer) - KelvinConv)) / (EffShBlEmiss + EffGlEmiss); + (EffShBlEmiss * SurfInsideTemp + EffGlEmiss * (theta(2 * ngllayer) - DataGlobalConstants::KelvinConv())) / (EffShBlEmiss + EffGlEmiss); } else { - SurfOutsideTemp = theta(1) - KelvinConv; + SurfOutsideTemp = theta(1) - DataGlobalConstants::KelvinConv(); } for (k = 1; k <= nlayer; ++k) { @@ -3511,8 +3509,8 @@ namespace WindowComplexManager { SurfaceWindow(SurfNum).ThetaFace(2 * k) = theta(2 * k); // temperatures for reporting - FenLaySurfTempFront(k, SurfNum) = theta(2 * k - 1) - KelvinConv; - FenLaySurfTempBack(k, SurfNum) = theta(2 * k) - KelvinConv; + FenLaySurfTempFront(k, SurfNum) = theta(2 * k - 1) - DataGlobalConstants::KelvinConv(); + FenLaySurfTempBack(k, SurfNum) = theta(2 * k) - DataGlobalConstants::KelvinConv(); // thetas(k) = theta(k) } } diff --git a/src/EnergyPlus/WindowEquivalentLayer.cc b/src/EnergyPlus/WindowEquivalentLayer.cc index 68fd5ca39a5..81acb376baf 100644 --- a/src/EnergyPlus/WindowEquivalentLayer.cc +++ b/src/EnergyPlus/WindowEquivalentLayer.cc @@ -127,10 +127,7 @@ namespace WindowEquivalentLayer { using DataEnvironment::Month; using DataGlobals::CurrentTime; using DataGlobals::HourOfDay; - using DataGlobals::KelvinConv; - using DataGlobals::StefanBoltzmann; using DataGlobals::TimeStep; - using DataGlobals::UniversalGasConst; using DataGlobals::WarmupFlag; using General::TrimSigDigits; @@ -434,11 +431,11 @@ namespace WindowEquivalentLayer { for (I = 1; I <= 10; ++I) { TGO = TOUT + U * DT / HXO; // update glazing surface temps TGI = TIN - U * DT / HXI; - HRO = StefanBoltzmann * EO * (pow_2(TGO + KelvinConv) + pow_2(TOUT + KelvinConv)) * ((TGO + KelvinConv) + (TOUT + KelvinConv)); - HRI = StefanBoltzmann * EI * (pow_2(TGI + KelvinConv) + pow_2(TIN + KelvinConv)) * ((TGI + KelvinConv) + (TIN + KelvinConv)); + HRO = DataGlobalConstants::StefanBoltzmann() * EO * (pow_2(TGO + DataGlobalConstants::KelvinConv()) + pow_2(TOUT + DataGlobalConstants::KelvinConv())) * ((TGO + DataGlobalConstants::KelvinConv()) + (TOUT + DataGlobalConstants::KelvinConv())); + HRI = DataGlobalConstants::StefanBoltzmann() * EI * (pow_2(TGI + DataGlobalConstants::KelvinConv()) + pow_2(TIN + DataGlobalConstants::KelvinConv())) * ((TGI + DataGlobalConstants::KelvinConv()) + (TIN + DataGlobalConstants::KelvinConv())); // HCI = HIC_ASHRAE( Height, TGI, TI) ! BAN June 2103 Raplaced with ISO Std 15099 - TGIK = TGI + KelvinConv; - TIK = TIN + KelvinConv; + TGIK = TGI + DataGlobalConstants::KelvinConv(); + TIK = TIN + DataGlobalConstants::KelvinConv(); HCI = HCInWindowStandardRatings(Height, TGIK, TIK); if (HCI < 0.001) break; HXI = HCI + HRI; @@ -672,7 +669,6 @@ namespace WindowEquivalentLayer { using DataEnvironment::IsRain; using DataEnvironment::SkyTempKelvin; using DataGlobals::AnyLocalEnvironmentsInModel; - using DataGlobals::StefanBoltzmann; using DataLoopNode::Node; using DataZoneEquipment::ZoneEquipConfig; using General::InterpSw; @@ -780,7 +776,7 @@ namespace WindowEquivalentLayer { } } TaIn = RefAirTemp; - TIN = TaIn + KelvinConv; // Inside air temperature, K + TIN = TaIn + DataGlobalConstants::KelvinConv(); // Inside air temperature, K // now get "outside" air temperature if (SurfNumAdj > 0) { @@ -824,8 +820,8 @@ namespace WindowEquivalentLayer { } } - Tout = RefAirTemp + KelvinConv; // outside air temperature - tsky = MRT(ZoneNumAdj) + KelvinConv; // TODO this misses IR from sources such as high temp radiant and baseboards + Tout = RefAirTemp + DataGlobalConstants::KelvinConv(); // outside air temperature + tsky = MRT(ZoneNumAdj) + DataGlobalConstants::KelvinConv(); // TODO this misses IR from sources such as high temp radiant and baseboards // The IR radiance of this window's "exterior" surround is the IR radiance // from surfaces and high-temp radiant sources in the adjacent zone @@ -847,30 +843,30 @@ namespace WindowEquivalentLayer { for (SrdSurfNum = 1; SrdSurfNum <= SurroundingSurfsProperty(SrdSurfsNum).TotSurroundingSurface; SrdSurfNum++) { SrdSurfViewFac = SurroundingSurfsProperty(SrdSurfsNum).SurroundingSurfs(SrdSurfNum).ViewFactor; SrdSurfTempAbs = - GetCurrentScheduleValue(SurroundingSurfsProperty(SrdSurfsNum).SurroundingSurfs(SrdSurfNum).TempSchNum) + KelvinConv; - OutSrdIR += StefanBoltzmann * SrdSurfViewFac * (pow_4(SrdSurfTempAbs)); + GetCurrentScheduleValue(SurroundingSurfsProperty(SrdSurfsNum).SurroundingSurfs(SrdSurfNum).TempSchNum) + DataGlobalConstants::KelvinConv(); + OutSrdIR += DataGlobalConstants::StefanBoltzmann() * SrdSurfViewFac * (pow_4(SrdSurfTempAbs)); } } } if (Surface(SurfNum).ExtWind) { // Window is exposed to wind (and possibly rain) if (IsRain) { // Raining: since wind exposed, outside window surface gets wet - Tout = Surface(SurfNum).OutWetBulbTemp + KelvinConv; + Tout = Surface(SurfNum).OutWetBulbTemp + DataGlobalConstants::KelvinConv(); } else { // Dry - Tout = Surface(SurfNum).OutDryBulbTemp + KelvinConv; + Tout = Surface(SurfNum).OutDryBulbTemp + DataGlobalConstants::KelvinConv(); } } else { // Window not exposed to wind - Tout = Surface(SurfNum).OutDryBulbTemp + KelvinConv; + Tout = Surface(SurfNum).OutDryBulbTemp + DataGlobalConstants::KelvinConv(); } tsky = SkyTempKelvin; - Ebout = StefanBoltzmann * pow_4(Tout); + Ebout = DataGlobalConstants::StefanBoltzmann() * pow_4(Tout); // ASHWAT model may be slightly different outir = Surface(SurfNum).ViewFactorSkyIR * - (AirSkyRadSplit(SurfNum) * StefanBoltzmann * pow_4(tsky) + (1.0 - AirSkyRadSplit(SurfNum)) * Ebout) + + (AirSkyRadSplit(SurfNum) * DataGlobalConstants::StefanBoltzmann() * pow_4(tsky) + (1.0 - AirSkyRadSplit(SurfNum)) * Ebout) + Surface(SurfNum).ViewFactorGroundIR * Ebout + OutSrdIR; } } // Outdoor conditions - TRMOUT = root_4(outir / StefanBoltzmann); // it is in Kelvin scale + TRMOUT = root_4(outir / DataGlobalConstants::StefanBoltzmann()); // it is in Kelvin scale // indoor conditions LWAbsIn = EffectiveEPSLB(CFS(EQLNum)); // windows inside face effective thermal emissivity LWAbsOut = EffectiveEPSLF(CFS(EQLNum)); // windows outside face effective thermal emissivity @@ -879,7 +875,7 @@ namespace WindowEquivalentLayer { // IR incident on window from zone surfaces and high-temp radiant sources rmir = SurfWinIRfromParentZone(SurfNum) + QHTRadSysSurf(SurfNum) + QCoolingPanelSurf(SurfNum) + QHWBaseboardSurf(SurfNum) + QSteamBaseboardSurf(SurfNum) + QElecBaseboardSurf(SurfNum) + QRadThermInAbs(SurfNum); - TRMIN = root_4(rmir / StefanBoltzmann); // TODO check model equation. + TRMIN = root_4(rmir / DataGlobalConstants::StefanBoltzmann()); // TODO check model equation. NL = CFS(EQLNum).NL; QAllSWwinAbs({1, NL + 1}) = QRadSWwinAbs({1, NL + 1}, SurfNum); @@ -889,7 +885,7 @@ namespace WindowEquivalentLayer { // effective surface temperature is set to surface temperature calculated // by the fenestration layers temperature solver - SurfInsideTemp = T(NL) - KelvinConv; + SurfInsideTemp = T(NL) - DataGlobalConstants::KelvinConv(); // Convective to room QCONV = H(NL) * (T(NL) - TIN); // Other convective = total conv - standard model prediction @@ -897,7 +893,7 @@ namespace WindowEquivalentLayer { // Save the extra convection term. This term is added to the zone air heat // balance equation SurfWinOtherConvHeatGain(SurfNum) = Surface(SurfNum).Area * QXConv; - SurfOutsideTemp = T(1) - KelvinConv; + SurfOutsideTemp = T(1) - DataGlobalConstants::KelvinConv(); // Various reporting calculations InSideLayerType = CFS(EQLNum).L(NL).LTYPE; if (InSideLayerType == ltyGLAZE) { @@ -906,7 +902,7 @@ namespace WindowEquivalentLayer { ConvHeatFlowNatural = Surface(SurfNum).Area * QOCFRoom; } SurfWinEffInsSurfTemp(SurfNum) = SurfInsideTemp; - NetIRHeatGainWindow = Surface(SurfNum).Area * LWAbsIn * (StefanBoltzmann * pow_4(SurfInsideTemp + KelvinConv) - rmir); + NetIRHeatGainWindow = Surface(SurfNum).Area * LWAbsIn * (DataGlobalConstants::StefanBoltzmann() * pow_4(SurfInsideTemp + DataGlobalConstants::KelvinConv()) - rmir); ConvHeatGainWindow = Surface(SurfNum).Area * HcIn * (SurfInsideTemp - TaIn); // Window heat gain (or loss) is calculated here SurfWinHeatGain(SurfNum) = SurfWinTransSolar(SurfNum) + ConvHeatGainWindow + NetIRHeatGainWindow + ConvHeatFlowNatural; @@ -4530,8 +4526,8 @@ namespace WindowEquivalentLayer { ITRY = 0; - EB(0) = StefanBoltzmann * pow_4(TOUT); - EB(NL + 1) = StefanBoltzmann * pow_4(TIN); + EB(0) = DataGlobalConstants::StefanBoltzmann() * pow_4(TOUT); + EB(NL + 1) = DataGlobalConstants::StefanBoltzmann() * pow_4(TIN); ADIM = 3 * NL + 2; // DIMENSION OF A-MATRIX @@ -4571,7 +4567,7 @@ namespace WindowEquivalentLayer { // FIRST ESTIMATE OF GLAZING TEMPERATURES AND BLACK EMISSIVE POWERS for (I = 1; I <= NL; ++I) { T(I) = TOUT + double(I) / double(NL + 1) * (TIN - TOUT); - EB(I) = StefanBoltzmann * pow_4(T(I)); + EB(I) = DataGlobalConstants::StefanBoltzmann() * pow_4(T(I)); } CONVRG = 0; @@ -4671,16 +4667,16 @@ namespace WindowEquivalentLayer { // CONVERT TEMPERATURE POTENTIAL CONVECTIVE COEFFICIENTS to // BLACK EMISSIVE POWER POTENTIAL CONVECTIVE COEFFICIENTS - HHAT(0) = HC[0] * (1.0 / StefanBoltzmann) / ((TOUT_2 + pow_2(T(1))) * (TOUT + T(1))); + HHAT(0) = HC[0] * (1.0 / DataGlobalConstants::StefanBoltzmann()) / ((TOUT_2 + pow_2(T(1))) * (TOUT + T(1))); Real64 T_I_2(pow_2(T(1))), T_IP_2; for (I = 1; I <= NL - 1; ++I) { // Scan the cavities T_IP_2 = pow_2(T(I + 1)); - HHAT(I) = HC[I] * (1.0 / StefanBoltzmann) / ((T_I_2 + T_IP_2) * (T(I) + T(I + 1))); + HHAT(I) = HC[I] * (1.0 / DataGlobalConstants::StefanBoltzmann()) / ((T_I_2 + T_IP_2) * (T(I) + T(I + 1))); T_I_2 = T_IP_2; } - HHAT(NL) = HC[NL] * (1.0 / StefanBoltzmann) / ((pow_2(T(NL)) + TIN_2) * (T(NL) + TIN)); + HHAT(NL) = HC[NL] * (1.0 / DataGlobalConstants::StefanBoltzmann()) / ((pow_2(T(NL)) + TIN_2) * (T(NL) + TIN)); // SET UP MATRIX XSOL = 0.0; @@ -4689,7 +4685,7 @@ namespace WindowEquivalentLayer { L = 1; A(1, L) = 1.0; A(2, L) = -1.0 * RHOB(0); // -1.0 * RHOB_OUT - A(ADIM + 1, L) = EPSB_OUT * StefanBoltzmann * TRMOUT_4; + A(ADIM + 1, L) = EPSB_OUT * DataGlobalConstants::StefanBoltzmann() * TRMOUT_4; for (I = 1; I <= NL; ++I) { L = 3 * I - 1; @@ -4744,7 +4740,7 @@ namespace WindowEquivalentLayer { L = 3 * NL + 2; A(3 * NL + 1, L) = -1.0 * RHOF(NL + 1); // - 1.0 * RHOF_ROOM A(3 * NL + 2, L) = 1.0; - A(ADIM + 1, L) = EPSF_ROOM * StefanBoltzmann * TRMIN_4; + A(ADIM + 1, L) = EPSF_ROOM * DataGlobalConstants::StefanBoltzmann() * TRMIN_4; // SOLVE MATRIX // Call SOLMATS for single precision matrix solution @@ -4759,7 +4755,7 @@ namespace WindowEquivalentLayer { JF(I) = XSOL(J); ++J; EB(I) = max(1.0, XSOL(J)); // prevent impossible temps - TNEW(I) = root_4(EB(I) / StefanBoltzmann); + TNEW(I) = root_4(EB(I) / DataGlobalConstants::StefanBoltzmann()); ++J; JB[I] = XSOL(J); MAXERR = max(MAXERR, std::abs(TNEW(I) - T(I)) / TNEW(I)); @@ -4781,7 +4777,7 @@ namespace WindowEquivalentLayer { // UPDATE GLAZING TEMPERATURES AND BLACK EMISSIVE POWERS for (I = 1; I <= NL; ++I) { T(I) += ALPHA * (TNEW(I) - T(I)); - EB(I) = StefanBoltzmann * pow_4(T(I)); + EB(I) = DataGlobalConstants::StefanBoltzmann() * pow_4(T(I)); } // CHECK FOR CONVERGENCE @@ -5008,8 +5004,8 @@ namespace WindowEquivalentLayer { ITRY = 0; - EB(0) = StefanBoltzmann * pow_4(TOUT); - EB(NL + 1) = StefanBoltzmann * pow_4(TIN); + EB(0) = DataGlobalConstants::StefanBoltzmann() * pow_4(TOUT); + EB(NL + 1) = DataGlobalConstants::StefanBoltzmann() * pow_4(TIN); ADIM = 3 * NL + 2; // DIMENSION OF A-MATRIX @@ -5049,7 +5045,7 @@ namespace WindowEquivalentLayer { // FIRST ESTIMATE OF GLAZING TEMPERATURES AND BLACK EMISSIVE POWERS for (I = 1; I <= NL; ++I) { T(I) = TOUT + double(I) / double(NL + 1) * (TIN - TOUT); - EB(I) = StefanBoltzmann * pow_4(T(I)); + EB(I) = DataGlobalConstants::StefanBoltzmann() * pow_4(T(I)); } CONVRG = 0; @@ -5147,16 +5143,16 @@ namespace WindowEquivalentLayer { // CONVERT TEMPERATURE POTENTIAL CONVECTIVE COEFFICIENTS to // BLACK EMISSIVE POWER POTENTIAL CONVECTIVE COEFFICIENTS - HHAT(0) = HC[0] * (1.0 / StefanBoltzmann) / ((TOUT_2 + pow_2(T(1))) * (TOUT + T(1))); + HHAT(0) = HC[0] * (1.0 / DataGlobalConstants::StefanBoltzmann()) / ((TOUT_2 + pow_2(T(1))) * (TOUT + T(1))); Real64 T_I_2(pow_2(T(1))), T_IP_2; for (I = 1; I <= NL - 1; ++I) { // Scan the cavities T_IP_2 = pow_2(T(I + 1)); - HHAT(I) = HC[I] * (1.0 / StefanBoltzmann) / ((T_I_2 + T_IP_2) * (T(I) + T(I + 1))); + HHAT(I) = HC[I] * (1.0 / DataGlobalConstants::StefanBoltzmann()) / ((T_I_2 + T_IP_2) * (T(I) + T(I + 1))); T_I_2 = T_IP_2; } - HHAT(NL) = HC[NL] * (1.0 / StefanBoltzmann) / ((pow_2(T(NL)) + TIN_2) * (T(NL) + TIN)); + HHAT(NL) = HC[NL] * (1.0 / DataGlobalConstants::StefanBoltzmann()) / ((pow_2(T(NL)) + TIN_2) * (T(NL) + TIN)); // SET UP MATRIX XSOL = 0.0; @@ -5165,7 +5161,7 @@ namespace WindowEquivalentLayer { L = 1; A(1, L) = 1.0; A(2, L) = -1.0 * RHOB(0); // -1.0 * RHOB_OUT - A(ADIM + 1, L) = EPSB_OUT * StefanBoltzmann * TRMOUT_4; + A(ADIM + 1, L) = EPSB_OUT * DataGlobalConstants::StefanBoltzmann() * TRMOUT_4; for (I = 1; I <= NL; ++I) { L = 3 * I - 1; @@ -5220,7 +5216,7 @@ namespace WindowEquivalentLayer { L = 3 * NL + 2; A(3 * NL + 1, L) = -1.0 * RHOF(NL + 1); // - 1.0 * RHOF_ROOM A(3 * NL + 2, L) = 1.0; - A(ADIM + 1, L) = EPSF_ROOM * StefanBoltzmann * TRMIN_4; + A(ADIM + 1, L) = EPSF_ROOM * DataGlobalConstants::StefanBoltzmann() * TRMIN_4; // SOLVE MATRIX // Call SOLMATS for single precision matrix solution @@ -5235,7 +5231,7 @@ namespace WindowEquivalentLayer { JF(I) = XSOL(J); ++J; EB(I) = max(1.0, XSOL(J)); // prevent impossible temps - TNEW(I) = root_4(EB(I) / StefanBoltzmann); + TNEW(I) = root_4(EB(I) / DataGlobalConstants::StefanBoltzmann()); ++J; JB[I] = XSOL(J); MAXERR = max(MAXERR, std::abs(TNEW(I) - T(I)) / TNEW(I)); @@ -5257,7 +5253,7 @@ namespace WindowEquivalentLayer { // UPDATE GLAZING TEMPERATURES AND BLACK EMISSIVE POWERS for (I = 1; I <= NL; ++I) { T(I) += ALPHA * (TNEW(I) - T(I)); - EB(I) = StefanBoltzmann * pow_4(T(I)); + EB(I) = DataGlobalConstants::StefanBoltzmann() * pow_4(T(I)); } // CHECK FOR CONVERGENCE @@ -5863,11 +5859,11 @@ namespace WindowEquivalentLayer { Real64 const Td_2(pow_2(Td)); Real64 const Tg_2(pow_2(Tg)); Real64 const Tm_2(pow_2(Tm)); - hr_gm = Epsg * Epsm * FSg_m * StefanBoltzmann * (Tg + Tm) * (Tg_2 + Tm_2); + hr_gm = Epsg * Epsm * FSg_m * DataGlobalConstants::StefanBoltzmann() * (Tg + Tm) * (Tg_2 + Tm_2); hr_gd = - Epsg * Epsdf * FSg_df * StefanBoltzmann * (Td + Tg) * (Td_2 + Tg_2) + Epsg * Epsdb * FSg_db * StefanBoltzmann * (Td + Tg) * (Td_2 + Tg_2); + Epsg * Epsdf * FSg_df * DataGlobalConstants::StefanBoltzmann() * (Td + Tg) * (Td_2 + Tg_2) + Epsg * Epsdb * FSg_db * DataGlobalConstants::StefanBoltzmann() * (Td + Tg) * (Td_2 + Tg_2); hr_md = - Epsm * Epsdf * FSm_df * StefanBoltzmann * (Td + Tm) * (Td_2 + Tm_2) + Epsm * Epsdb * FSm_db * StefanBoltzmann * (Td + Tm) * (Td_2 + Tm_2); + Epsm * Epsdf * FSm_df * DataGlobalConstants::StefanBoltzmann() * (Td + Tm) * (Td_2 + Tm_2) + Epsm * Epsdb * FSm_db * DataGlobalConstants::StefanBoltzmann() * (Td + Tm) * (Td_2 + Tm_2); } void SETUP4x4_A(Real64 const rhog, Real64 const rhodf, Real64 const rhodb, Real64 const taud, Real64 const rhom, Array2A A) @@ -6046,7 +6042,7 @@ namespace WindowEquivalentLayer { HRadPar = 0.0; if ((E1 > 0.001) && (E2 > 0.001)) { DV = (1.0 / E1) + (1.0 / E2) - 1.0; - HRadPar = (StefanBoltzmann / DV) * (T1 + T2) * (pow_2(T1) + pow_2(T2)); + HRadPar = (DataGlobalConstants::StefanBoltzmann() / DV) * (T1 + T2) * (pow_2(T1) + pow_2(T2)); } return HRadPar; } @@ -6435,9 +6431,9 @@ namespace WindowEquivalentLayer { return CFSUFactor; } - TOABS = TOUT + KelvinConv; + TOABS = TOUT + DataGlobalConstants::KelvinConv(); TRMOUT = TOABS; - TIABS = TIN + KelvinConv; + TIABS = TIN + DataGlobalConstants::KelvinConv(); TRMIN = TIABS; NL = FS.NL; @@ -7765,7 +7761,7 @@ namespace WindowEquivalentLayer { PMan = state.dataWindowEquivalentLayer->PAtmSeaLevel; if (present(xPMan)) PMan = xPMan; - G.RHOGAS = DensityCFSFillGas(G.FG, PMan, TMan + KelvinConv); + G.RHOGAS = DensityCFSFillGas(G.FG, PMan, TMan + DataGlobalConstants::KelvinConv()); } void AdjustVBGap(CFSGAP &G, // gap, returned updated @@ -7816,7 +7812,7 @@ namespace WindowEquivalentLayer { // Return value float DensityCFSFillGas; - DensityCFSFillGas = (P * FG.MHAT) / (UniversalGasConst * max(T, 1.0)); + DensityCFSFillGas = (P * FG.MHAT) / (DataGlobalConstants::UniversalGasConst() * max(T, 1.0)); return DensityCFSFillGas; } @@ -8109,7 +8105,7 @@ namespace WindowEquivalentLayer { // PURPOSE OF THIS FUNCTION: // Returns equivalent celsius scale temperature from radiosity - return root_4(J / (StefanBoltzmann * max(Emiss, 0.001))) - KelvinConv; + return root_4(J / (DataGlobalConstants::StefanBoltzmann() * max(Emiss, 0.001))) - DataGlobalConstants::KelvinConv(); } void CalcEQLOpticalProperty(EnergyPlusData &state, diff --git a/src/EnergyPlus/WindowManager.cc b/src/EnergyPlus/WindowManager.cc index 6999f421fba..99990086692 100644 --- a/src/EnergyPlus/WindowManager.cc +++ b/src/EnergyPlus/WindowManager.cc @@ -2534,7 +2534,7 @@ namespace WindowManager { for (SrdSurfNum = 1; SrdSurfNum <= SurroundingSurfsProperty(SrdSurfsNum).TotSurroundingSurface; SrdSurfNum++) { SrdSurfViewFac = SurroundingSurfsProperty(SrdSurfsNum).SurroundingSurfs(SrdSurfNum).ViewFactor; SrdSurfTempAbs = - GetCurrentScheduleValue(SurroundingSurfsProperty(SrdSurfsNum).SurroundingSurfs(SrdSurfNum).TempSchNum) + KelvinConv; + GetCurrentScheduleValue(SurroundingSurfsProperty(SrdSurfsNum).SurroundingSurfs(SrdSurfNum).TempSchNum) + DataGlobalConstants::KelvinConv(); OutSrdIR += state.dataWindowManager->sigma * SrdSurfViewFac * pow_4(SrdSurfTempAbs); } } @@ -2665,7 +2665,7 @@ namespace WindowManager { for (SrdSurfNum = 1; SrdSurfNum <= SurroundingSurfsProperty(SrdSurfsNum).TotSurroundingSurface; SrdSurfNum++) { SrdSurfViewFac = SurroundingSurfsProperty(SrdSurfsNum).SurroundingSurfs(SrdSurfNum).ViewFactor; SrdSurfTempAbs = - GetCurrentScheduleValue(SurroundingSurfsProperty(SrdSurfsNum).SurroundingSurfs(SrdSurfNum).TempSchNum) + KelvinConv; + GetCurrentScheduleValue(SurroundingSurfsProperty(SrdSurfsNum).SurroundingSurfs(SrdSurfNum).TempSchNum) + DataGlobalConstants::KelvinConv(); rad_out_lw_srd_per_area += - emiss_sigma_product * SrdSurfViewFac * (Tsout_4 - pow_4(SrdSurfTempAbs)); } } @@ -3016,7 +3016,7 @@ namespace WindowManager { } else { InsideFaceIndex = state.dataWindowManager->nglface; } - CalcISO15099WindowIntConvCoeff(SurfNum, state.dataWindowManager->thetas(InsideFaceIndex) - KelvinConv, state.dataWindowManager->tin - KelvinConv); + CalcISO15099WindowIntConvCoeff(SurfNum, state.dataWindowManager->thetas(InsideFaceIndex) - DataGlobalConstants::KelvinConv(), state.dataWindowManager->tin - DataGlobalConstants::KelvinConv()); state.dataWindowManager->hcin = HConvIn(SurfNum); } @@ -3576,8 +3576,8 @@ namespace WindowManager { // report out temperatures for (i = 1; i <= state.dataWindowManager->nglfacep; ++i) { ShowContinueError("Glazing face index = " + RoundSigDigits(i) + - " ; new temperature =" + RoundSigDigits(state.dataWindowManager->thetas(i) - KelvinConv, 4) + - "C ; previous temperature = " + RoundSigDigits(state.dataWindowManager->thetasPrev(i) - KelvinConv, 4) + 'C'); + " ; new temperature =" + RoundSigDigits(state.dataWindowManager->thetas(i) - DataGlobalConstants::KelvinConv(), 4) + + "C ; previous temperature = " + RoundSigDigits(state.dataWindowManager->thetasPrev(i) - DataGlobalConstants::KelvinConv(), 4) + 'C'); } } diff --git a/src/EnergyPlus/WindowManager.hh b/src/EnergyPlus/WindowManager.hh index 79e2e841e71..017f3cbcf79 100644 --- a/src/EnergyPlus/WindowManager.hh +++ b/src/EnergyPlus/WindowManager.hh @@ -682,7 +682,7 @@ namespace WindowManager { } // Default Constructor - WindowManagerData() : sigma(5.6697e-8), TKelvin(DataGlobals::KelvinConv), nume(107), numt3(81), + WindowManagerData() : sigma(5.6697e-8), TKelvin(DataGlobalConstants::KelvinConv()), nume(107), numt3(81), gcon(3, 5, 5, 0.0), gvis(3, 5, 5, 0.0), gcp(3, 5, 5, 0.0), gwght(5, 5, 0.0), gfract(5, 5, 0.0), gnmix(5, 0), gap(5, 0.0), thick(5, 0.0), scon(5, 0.0), tir(10, 0.0), emis(10, 0.0), rir(10, 0.0), AbsRadGlassFace(10, 0.0), thetas(10, 0.0), thetasPrev(10, 0.0), fvec(10, 0.0), fjac(10, 10, 0.0), diff --git a/src/EnergyPlus/WindowManagerExteriorThermal.cc b/src/EnergyPlus/WindowManagerExteriorThermal.cc index 575c0e00964..5b839bf0105 100644 --- a/src/EnergyPlus/WindowManagerExteriorThermal.cc +++ b/src/EnergyPlus/WindowManagerExteriorThermal.cc @@ -138,11 +138,11 @@ namespace WindowManager { aTemp = aLayer->getTemperature(aSide); state.dataWindowManager->thetas(i) = aTemp; if (i == 1) { - SurfOutsideTemp = aTemp - KelvinConv; + SurfOutsideTemp = aTemp - DataGlobalConstants::KelvinConv(); } ++i; } - SurfInsideTemp = aTemp - KelvinConv; + SurfInsideTemp = aTemp - DataGlobalConstants::KelvinConv(); if (SurfWinShadingFlag(SurfNum) == IntShadeOn || SurfWinShadingFlag(SurfNum) == IntBlindOn) { auto EffShBlEmiss = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), window.EffShBlindEmiss); auto EffGlEmiss = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), window.EffGlassEmiss); @@ -177,7 +177,7 @@ namespace WindowManager { auto NetIRHeatGainShade = ShadeArea * EpsShIR2 * (state.dataWindowManager->sigma * pow(state.dataWindowManager->thetas(state.dataWindowManager->nglfacep), 4) - rmir) + EpsShIR1 * (state.dataWindowManager->sigma * pow(state.dataWindowManager->thetas(state.dataWindowManager->nglfacep - 1), 4) - rmir) * RhoGlIR2 * TauShIR / ShGlReflFacIR; auto NetIRHeatGainGlass = ShadeArea * (glassEmiss * TauShIR / ShGlReflFacIR) * (state.dataWindowManager->sigma * pow(state.dataWindowManager->thetas(state.dataWindowManager->nglface), 4) - rmir); - auto tind = surface.getInsideAirTemperature(SurfNum) + KelvinConv; + auto tind = surface.getInsideAirTemperature(SurfNum) + DataGlobalConstants::KelvinConv(); auto ConvHeatGainFrZoneSideOfShade = ShadeArea * HConvIn(SurfNum) * (state.dataWindowManager->thetas(state.dataWindowManager->nglfacep) - tind); SurfWinHeatGain(SurfNum) = SurfWinTransSolar(SurfNum) + ConvHeatGainFrZoneSideOfShade + NetIRHeatGainGlass + NetIRHeatGainShade; SurfWinHeatTransfer(SurfNum) = SurfWinHeatGain(SurfNum); @@ -194,7 +194,7 @@ namespace WindowManager { auto glassTemperature = aGlassLayer->getSurface(Side::Back)->getTemperature(); SurfWinEffInsSurfTemp(SurfNum) = - (EffShBlEmiss * SurfInsideTemp + EffGlEmiss * (glassTemperature - KelvinConv)) / (EffShBlEmiss + EffGlEmiss); + (EffShBlEmiss * SurfInsideTemp + EffGlEmiss * (glassTemperature - DataGlobalConstants::KelvinConv())) / (EffShBlEmiss + EffGlEmiss); } else { // Another adoptation to old source that looks suspicious. Check if heat flow through @@ -232,8 +232,8 @@ namespace WindowManager { SurfaceWindow(SurfNum).ThetaFace(2 * k) = state.dataWindowManager->thetas(2 * k); // temperatures for reporting - FenLaySurfTempFront(k, SurfNum) = state.dataWindowManager->thetas(2 * k - 1) - KelvinConv; - FenLaySurfTempBack(k, SurfNum) = state.dataWindowManager->thetas(2 * k) - KelvinConv; + FenLaySurfTempFront(k, SurfNum) = state.dataWindowManager->thetas(2 * k - 1) - DataGlobalConstants::KelvinConv(); + FenLaySurfTempBack(k, SurfNum) = state.dataWindowManager->thetas(2 * k) - DataGlobalConstants::KelvinConv(); } } @@ -594,7 +594,7 @@ namespace WindowManager { // PURPOSE OF THIS SUBROUTINE: // Creates indoor environment object from surface properties in EnergyPlus - auto tin = m_Surface.getInsideAirTemperature(m_SurfNum) + KelvinConv; + auto tin = m_Surface.getInsideAirTemperature(m_SurfNum) + DataGlobalConstants::KelvinConv(); auto hcin = HConvIn(m_SurfNum); auto IR = m_Surface.getInsideIR(m_SurfNum); @@ -616,7 +616,7 @@ namespace WindowManager { // PURPOSE OF THIS SUBROUTINE: // Creates outdoor environment object from surface properties in EnergyPlus - double tout = m_Surface.getOutsideAirTemperature(m_SurfNum) + KelvinConv; + double tout = m_Surface.getOutsideAirTemperature(m_SurfNum) + DataGlobalConstants::KelvinConv(); double IR = m_Surface.getOutsideIR(state, m_SurfNum); // double dirSolRad = QRadSWOutIncident( t_SurfNum ) + QS( Surface( t_SurfNum ).Zone ); double swRadiation = m_Surface.getSWIncident(m_SurfNum); diff --git a/src/EnergyPlus/ZoneEquipmentManager.cc b/src/EnergyPlus/ZoneEquipmentManager.cc index b3f7c3d5e18..a60aa28f1f6 100644 --- a/src/EnergyPlus/ZoneEquipmentManager.cc +++ b/src/EnergyPlus/ZoneEquipmentManager.cc @@ -4949,7 +4949,7 @@ namespace ZoneEquipmentManager { } if (Ventilation(j).ModelType == VentilationWindAndStack) { - if (Ventilation(j).OpenEff != AutoCalculate) { + if (Ventilation(j).OpenEff != DataGlobalConstants::AutoCalculate()) { Cw = Ventilation(j).OpenEff; } else { // linear interpolation between effective angle and wind direction @@ -4957,7 +4957,7 @@ namespace ZoneEquipmentManager { if (angle > 180.0) angle -= 180.0; Cw = 0.55 + angle / 180.0 * (0.3 - 0.55); } - if (Ventilation(j).DiscCoef != AutoCalculate) { + if (Ventilation(j).DiscCoef != DataGlobalConstants::AutoCalculate()) { Cd = Ventilation(j).DiscCoef; } else { Cd = 0.40 + 0.0045 * std::abs(TempExt - ZMAT(NZ)); diff --git a/tst/EnergyPlus/unit/ChillerElectricEIR.unit.cc b/tst/EnergyPlus/unit/ChillerElectricEIR.unit.cc index a5d191eec4d..7a85ea50125 100644 --- a/tst/EnergyPlus/unit/ChillerElectricEIR.unit.cc +++ b/tst/EnergyPlus/unit/ChillerElectricEIR.unit.cc @@ -366,7 +366,7 @@ TEST_F(EnergyPlusFixture, ChillerElectricEIR_EvaporativelyCooled_Calculate) thisEIRChiller.calculate(state, MyLoad, RunFlag); // calc evap-cooler water consumption rate Real64 EvapCondWaterVolFlowRate = thisEIRChiller.CondMassFlowRate * (thisEIRChiller.CondOutletHumRat - DataEnvironment::OutHumRat) / - Psychrometrics::RhoH2O(DataGlobals::InitConvTemp); + Psychrometrics::RhoH2O(DataGlobalConstants::InitConvTemp()); // check evap-cooled condenser water consumption rate EXPECT_NEAR(2.31460814, thisEIRChiller.CondMassFlowRate, 0.0000001); EXPECT_NEAR(6.22019725E-06, EvapCondWaterVolFlowRate, 0.000000001); diff --git a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc index 11d233dad37..f9591166477 100644 --- a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc +++ b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc @@ -5674,7 +5674,7 @@ TEST_F(EnergyPlusFixture, VRFTest_SysCurve_WaterCooled) EXPECT_DOUBLE_EQ(CondVolFlowRate, VRF(VRFCond).WaterCondVolFlowRate); rho = GetDensityGlycol(state, - PlantLoop(VRF(VRFCond).SourceLoopNum).FluidName, InitConvTemp, PlantLoop(VRF(VRFCond).SourceLoopNum).FluidIndex, RoutineName); + PlantLoop(VRF(VRFCond).SourceLoopNum).FluidName, DataGlobalConstants::InitConvTemp(), PlantLoop(VRF(VRFCond).SourceLoopNum).FluidIndex, RoutineName); EXPECT_DOUBLE_EQ(VRF(VRFCond).WaterCondenserDesignMassFlow, (VRF(VRFCond).WaterCondVolFlowRate * rho)); // set zone load to heating diff --git a/tst/EnergyPlus/unit/HeatBalanceKivaManager.unit.cc b/tst/EnergyPlus/unit/HeatBalanceKivaManager.unit.cc index 6a1583dfa0a..7fcb28da06c 100644 --- a/tst/EnergyPlus/unit/HeatBalanceKivaManager.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceKivaManager.unit.cc @@ -208,7 +208,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceKiva_SetInitialBCs) Real64 expectedResult1 = kv1.instance.bcs->slabConvectiveTemp; - EXPECT_NEAR(expectedResult1, zoneAssumedTemperature1 + DataGlobals::KelvinConv, 0.001); + EXPECT_NEAR(expectedResult1, zoneAssumedTemperature1 + DataGlobalConstants::KelvinConv(), 0.001); // Test using default Initial Indoor Temperature with Cooling/Heating Setpoints of 24C/20C @@ -223,7 +223,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceKiva_SetInitialBCs) Real64 expectedResult2 = kv2.instance.bcs->slabConvectiveTemp; - EXPECT_NEAR(expectedResult2, coolingSetpoint2 + DataGlobals::KelvinConv, 0.001); + EXPECT_NEAR(expectedResult2, coolingSetpoint2 + DataGlobalConstants::KelvinConv(), 0.001); // Test using default Initial Indoor Temperature with Cooling/Heating Setpoints of 100C/-100C @@ -241,7 +241,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceKiva_SetInitialBCs) Real64 expectedResult3 = kv3.instance.bcs->slabConvectiveTemp; - EXPECT_NEAR(expectedResult3, coolingSetpoint3 + DataGlobals::KelvinConv, 0.001); + EXPECT_NEAR(expectedResult3, coolingSetpoint3 + DataGlobalConstants::KelvinConv(), 0.001); // Test Initial Indoor Temperature input of 15C with Cooling/Heating Setpoints of 100C/-100C @@ -258,7 +258,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceKiva_SetInitialBCs) Real64 expectedResult4 = kv4.instance.bcs->slabConvectiveTemp; - EXPECT_NEAR(expectedResult4, zoneAssumedTemperature4 + DataGlobals::KelvinConv, 0.001); + EXPECT_NEAR(expectedResult4, zoneAssumedTemperature4 + DataGlobalConstants::KelvinConv(), 0.001); } } // namespace EnergyPlus diff --git a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc index 133097b46c1..007994fce56 100644 --- a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc @@ -1894,8 +1894,6 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertySrdSurfLWR) ScheduleManager::Schedule(3).CurrentValue = 22.0; // Grd temp int SurfNum; - Real64 const StefanBoltzmann(5.6697E-8); - Real64 const KelvinConv(273.15); for (SurfNum = 1; SurfNum <= 6; SurfNum++) { DataHeatBalSurface::TH(1, 1, SurfNum) = 20; // Surf temp DataSurfaces::Surface(SurfNum).OutDryBulbTemp = 22; // Air temp @@ -1913,17 +1911,17 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertySrdSurfLWR) EXPECT_DOUBLE_EQ(0.25, DataSurfaces::Surface(3).ViewFactorSkyIR); EXPECT_DOUBLE_EQ(0.25, DataSurfaces::Surface(3).ViewFactorGroundIR); // Test if sky and grd view factor and temperature correctly overwritten - EXPECT_DOUBLE_EQ((StefanBoltzmann * 0.9 * 0.3 * (pow_4(20.0 + KelvinConv) - pow_4(15.0 + KelvinConv)) / (20.0 - 15.0)), + EXPECT_DOUBLE_EQ((DataGlobalConstants::StefanBoltzmann() * 0.9 * 0.3 * (pow_4(20.0 + DataGlobalConstants::KelvinConv()) - pow_4(15.0 + DataGlobalConstants::KelvinConv())) / (20.0 - 15.0)), DataHeatBalSurface::HSkyExtSurf(1)); - EXPECT_DOUBLE_EQ((StefanBoltzmann * 0.9 * 0.1 * (pow_4(20.0 + KelvinConv) - pow_4(22.0 + KelvinConv)) / (20.0 - 22.0)), + EXPECT_DOUBLE_EQ((DataGlobalConstants::StefanBoltzmann() * 0.9 * 0.1 * (pow_4(20.0 + DataGlobalConstants::KelvinConv()) - pow_4(22.0 + DataGlobalConstants::KelvinConv())) / (20.0 - 22.0)), DataHeatBalSurface::HGrdExtSurf(1)); // Test if LWR from surrounding surfaces correctly calculated - EXPECT_DOUBLE_EQ(StefanBoltzmann * 0.9 * 0.6 * (pow_4(25.0 + KelvinConv) - pow_4(20.0 + KelvinConv)), DataHeatBalSurface::QRadLWOutSrdSurfs(1)); - EXPECT_DOUBLE_EQ(StefanBoltzmann * 0.9 * - (0.3 * (pow_4(25.0 + KelvinConv) - pow_4(20.0 + KelvinConv)) + 0.3 * (pow_4(25.0 + KelvinConv) - pow_4(20.0 + KelvinConv))), + EXPECT_DOUBLE_EQ(DataGlobalConstants::StefanBoltzmann() * 0.9 * 0.6 * (pow_4(25.0 + DataGlobalConstants::KelvinConv()) - pow_4(20.0 + DataGlobalConstants::KelvinConv())), DataHeatBalSurface::QRadLWOutSrdSurfs(1)); + EXPECT_DOUBLE_EQ(DataGlobalConstants::StefanBoltzmann() * 0.9 * + (0.3 * (pow_4(25.0 + DataGlobalConstants::KelvinConv()) - pow_4(20.0 + DataGlobalConstants::KelvinConv())) + 0.3 * (pow_4(25.0 + DataGlobalConstants::KelvinConv()) - pow_4(20.0 + DataGlobalConstants::KelvinConv()))), DataHeatBalSurface::QRadLWOutSrdSurfs(2)); - EXPECT_DOUBLE_EQ(StefanBoltzmann * 0.9 * 0.5 * (pow_4(25.0 + KelvinConv) - pow_4(20.0 + KelvinConv)), DataHeatBalSurface::QRadLWOutSrdSurfs(3)); + EXPECT_DOUBLE_EQ(DataGlobalConstants::StefanBoltzmann() * 0.9 * 0.5 * (pow_4(25.0 + DataGlobalConstants::KelvinConv()) - pow_4(20.0 + DataGlobalConstants::KelvinConv())), DataHeatBalSurface::QRadLWOutSrdSurfs(3)); EXPECT_DOUBLE_EQ(0.0, DataHeatBalSurface::QRadLWOutSrdSurfs(4)); } diff --git a/tst/EnergyPlus/unit/MoistureBalanceEMPD.unit.cc b/tst/EnergyPlus/unit/MoistureBalanceEMPD.unit.cc index b794bf5859d..61ec0ec994e 100644 --- a/tst/EnergyPlus/unit/MoistureBalanceEMPD.unit.cc +++ b/tst/EnergyPlus/unit/MoistureBalanceEMPD.unit.cc @@ -366,7 +366,6 @@ TEST_F(EnergyPlusFixture, CheckEMPDCalc_Slope) auto const &material(dataMaterial.Material(1)); Real64 Tsat(0.0); - Real64 const KelvinConv(273.15); DataHeatBalSurface::TempSurfIn.allocate(surfNum); DataHeatBalSurface::TempSurfIn(surfNum) = 20.0; @@ -375,7 +374,7 @@ TEST_F(EnergyPlusFixture, CheckEMPDCalc_Slope) // Calculate RH for use in material property calculations. Real64 RV_Deep_Old = DataMoistureBalanceEMPD::RVdeepOld( surfNum ); Real64 RVaver = DataMoistureBalanceEMPD::RVSurfLayerOld(surfNum); - Real64 RHaver = RVaver * 461.52 * (Taver + KelvinConv) * std::exp(-23.7093 + 4111.0 / (Taver + 237.7)); + Real64 RHaver = RVaver * 461.52 * (Taver + DataGlobalConstants::KelvinConv()) * std::exp(-23.7093 + 4111.0 / (Taver + 237.7)); Real64 dU_dRH = material.MoistACoeff * material.MoistBCoeff * pow(RHaver, material.MoistBCoeff - 1) + material.MoistCCoeff * material.MoistDCoeff * pow(RHaver, material.MoistDCoeff - 1); diff --git a/tst/EnergyPlus/unit/OutdoorAirUnit.unit.cc b/tst/EnergyPlus/unit/OutdoorAirUnit.unit.cc index 59f80057a50..50547bd214c 100644 --- a/tst/EnergyPlus/unit/OutdoorAirUnit.unit.cc +++ b/tst/EnergyPlus/unit/OutdoorAirUnit.unit.cc @@ -674,8 +674,8 @@ TEST_F(EnergyPlusFixture, OutdoorAirUnit_WaterCoolingCoilAutoSizeTest) Real64 DesWaterCoolingCoilLoad = DesAirMassFlow * (EnthalpyAirIn - EnthalpyAirOut) + FanCoolLoad; Real64 CoilDesWaterDeltaT = PlantSizData(1).DeltaT; - Real64 Cp = GetSpecificHeatGlycol(state, PlantLoop(1).FluidName, DataGlobals::CWInitConvTemp, PlantLoop(1).FluidIndex, " "); - Real64 rho = GetDensityGlycol(state, PlantLoop(1).FluidName, DataGlobals::CWInitConvTemp, PlantLoop(1).FluidIndex, " "); + Real64 Cp = GetSpecificHeatGlycol(state, PlantLoop(1).FluidName, DataGlobalConstants::CWInitConvTemp(), PlantLoop(1).FluidIndex, " "); + Real64 rho = GetDensityGlycol(state, PlantLoop(1).FluidName, DataGlobalConstants::CWInitConvTemp(), PlantLoop(1).FluidIndex, " "); Real64 DesCoolingCoilWaterVolFlowRate = DesWaterCoolingCoilLoad / (CoilDesWaterDeltaT * Cp * rho); // check water coil water flow rate calc EXPECT_EQ(DesWaterCoolingCoilLoad, state.dataWaterCoils->WaterCoil(1).DesWaterCoolingCoilRate); @@ -975,10 +975,10 @@ TEST_F(EnergyPlusFixture, OutdoorAirUnit_SteamHeatingCoilAutoSizeTest) Real64 DesSteamCoilLoad = DesAirMassFlow * CpAirAvg * (DesCoilOutTemp - DesCoilInTemp); // do steam flow rate sizing calculation - Real64 EnthSteamIn = GetSatEnthalpyRefrig(state, "STEAM", DataGlobals::SteamInitConvTemp, 1.0, SteamCoil(1).FluidIndex, ""); - Real64 EnthSteamOut = GetSatEnthalpyRefrig(state, "STEAM", DataGlobals::SteamInitConvTemp, 0.0, SteamCoil(1).FluidIndex, ""); - Real64 SteamDensity = GetSatDensityRefrig(state, "STEAM", DataGlobals::SteamInitConvTemp, 1.0, SteamCoil(1).FluidIndex, ""); - Real64 CpOfCondensate = GetSatSpecificHeatRefrig(state, "STEAM", DataGlobals::SteamInitConvTemp, 0.0, SteamCoil(1).FluidIndex, ""); + Real64 EnthSteamIn = GetSatEnthalpyRefrig(state, "STEAM", DataGlobalConstants::SteamInitConvTemp(), 1.0, SteamCoil(1).FluidIndex, ""); + Real64 EnthSteamOut = GetSatEnthalpyRefrig(state, "STEAM", DataGlobalConstants::SteamInitConvTemp(), 0.0, SteamCoil(1).FluidIndex, ""); + Real64 SteamDensity = GetSatDensityRefrig(state, "STEAM", DataGlobalConstants::SteamInitConvTemp(), 1.0, SteamCoil(1).FluidIndex, ""); + Real64 CpOfCondensate = GetSatSpecificHeatRefrig(state, "STEAM", DataGlobalConstants::SteamInitConvTemp(), 0.0, SteamCoil(1).FluidIndex, ""); Real64 LatentHeatChange = EnthSteamIn - EnthSteamOut; Real64 DesMaxSteamVolFlowRate = DesSteamCoilLoad / (SteamDensity * (LatentHeatChange + SteamCoil(1).DegOfSubcooling * CpOfCondensate)); diff --git a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc index f0aec31510f..7a39f3631c0 100644 --- a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc +++ b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc @@ -3747,9 +3747,9 @@ TEST_F(EnergyPlusFixture, OutputReportTabular_GatherHeatEmissionReport) GatherHeatEmissionReport(state, OutputProcessor::TimeStepType::TimeStepSystem); EXPECT_EQ(reliefEnergy, DataHeatBalance::SysTotalHVACReliefHeatLoss); - EXPECT_EQ(reliefEnergy * DataGlobals::convertJtoGJ, BuildingPreDefRep.emiHVACRelief); + EXPECT_EQ(reliefEnergy * DataGlobalConstants::convertJtoGJ(), BuildingPreDefRep.emiHVACRelief); EXPECT_EQ(condenserReject, DataHeatBalance::SysTotalHVACRejectHeatLoss); - EXPECT_EQ(condenserReject * DataGlobals::convertJtoGJ, BuildingPreDefRep.emiHVACReject); + EXPECT_EQ(condenserReject * DataGlobalConstants::convertJtoGJ(), BuildingPreDefRep.emiHVACReject); DXCoils::NumDXCoils = 2; DXCoils::DXCoil.allocate(2); @@ -3771,9 +3771,9 @@ TEST_F(EnergyPlusFixture, OutputReportTabular_GatherHeatEmissionReport) Real64 coilReject = 1.0 * TimeStepSysSec + 200.0 + 10.0; GatherHeatEmissionReport(state, OutputProcessor::TimeStepType::TimeStepSystem); EXPECT_EQ(reliefEnergy, DataHeatBalance::SysTotalHVACReliefHeatLoss); - EXPECT_EQ(2 * reliefEnergy * DataGlobals::convertJtoGJ, BuildingPreDefRep.emiHVACRelief); + EXPECT_EQ(2 * reliefEnergy * DataGlobalConstants::convertJtoGJ(), BuildingPreDefRep.emiHVACRelief); EXPECT_EQ(condenserReject + coilReject, DataHeatBalance::SysTotalHVACRejectHeatLoss); - EXPECT_EQ(2 * condenserReject * DataGlobals::convertJtoGJ + coilReject * DataGlobals::convertJtoGJ, BuildingPreDefRep.emiHVACReject); + EXPECT_EQ(2 * condenserReject * DataGlobalConstants::convertJtoGJ() + coilReject * DataGlobalConstants::convertJtoGJ(), BuildingPreDefRep.emiHVACReject); } TEST_F(EnergyPlusFixture, OutputTableTimeBins_GetInput) diff --git a/tst/EnergyPlus/unit/PlantCentralGSHP.unit.cc b/tst/EnergyPlus/unit/PlantCentralGSHP.unit.cc index f283d530ae8..741521f67b3 100644 --- a/tst/EnergyPlus/unit/PlantCentralGSHP.unit.cc +++ b/tst/EnergyPlus/unit/PlantCentralGSHP.unit.cc @@ -139,17 +139,17 @@ TEST_F(EnergyPlusFixture, ChillerHeater_Autosize) // Calculate expected values Real64 rho_evap = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(PltSizNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(PltSizNum).FluidIndex, "ChillerHeater_Autosize_TEST"); Real64 Cp_evap = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(PltSizNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(PltSizNum).FluidIndex, "ChillerHeater_Autosize_TEST"); Real64 rho_cond = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(PltSizCondNum).FluidName, - DataGlobals::CWInitConvTemp, + DataGlobalConstants::CWInitConvTemp(), DataPlant::PlantLoop(PltSizCondNum).FluidIndex, "ChillerHeater_Autosize_TEST"); diff --git a/tst/EnergyPlus/unit/ThermalComfort.unit.cc b/tst/EnergyPlus/unit/ThermalComfort.unit.cc index cd7b974b7f8..14b2f6f2b38 100644 --- a/tst/EnergyPlus/unit/ThermalComfort.unit.cc +++ b/tst/EnergyPlus/unit/ThermalComfort.unit.cc @@ -970,7 +970,7 @@ TEST_F(EnergyPlusFixture, ThermalComfort_CalcThermalComfortPierceSET) Zone(People(1).ZonePtr).TotOccupants = People(1).NumberOfPeople; People(1).FractionRadiant = 0.3; People(1).FractionConvected = 1.0 - People(1).FractionRadiant; - People(1).UserSpecSensFrac = AutoCalculate; + People(1).UserSpecSensFrac = DataGlobalConstants::AutoCalculate(); People(1).CO2RateFactor = 3.82e-8; People(1).ActivityLevelPtr = -1; People(1).Show55Warning = true; diff --git a/tst/EnergyPlus/unit/UnitHeater.unit.cc b/tst/EnergyPlus/unit/UnitHeater.unit.cc index a1c83a71f55..dac1a714162 100644 --- a/tst/EnergyPlus/unit/UnitHeater.unit.cc +++ b/tst/EnergyPlus/unit/UnitHeater.unit.cc @@ -1147,11 +1147,11 @@ TEST_F(EnergyPlusFixture, UnitHeater_HWHeatingCoilUAAutoSizingTest) HWMaxVolFlowRate = state.dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate; HWDensity = GetDensityGlycol(state, PlantLoop(UnitHeat(UnitHeatNum).HWLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(UnitHeat(UnitHeatNum).HWLoopNum).FluidIndex, "xxx"); CpHW = GetSpecificHeatGlycol(state, PlantLoop(UnitHeat(UnitHeatNum).HWLoopNum).FluidName, - DataGlobals::HWInitConvTemp, + DataGlobalConstants::HWInitConvTemp(), PlantLoop(UnitHeat(UnitHeatNum).HWLoopNum).FluidIndex, "xxx"); HWPlantDeltaTDesign = PlantSizData(PltSizHeatNum).DeltaT; diff --git a/tst/EnergyPlus/unit/WaterCoils.unit.cc b/tst/EnergyPlus/unit/WaterCoils.unit.cc index b67179f455b..cc8b57eb9ff 100644 --- a/tst/EnergyPlus/unit/WaterCoils.unit.cc +++ b/tst/EnergyPlus/unit/WaterCoils.unit.cc @@ -512,8 +512,8 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterUASizing) Real64 rho = 0; Real64 DesWaterFlowRate = 0; - Cp = GetSpecificHeatGlycol(state, PlantLoop(1).FluidName, DataGlobals::HWInitConvTemp, PlantLoop(1).FluidIndex, "Unit Test"); - rho = GetDensityGlycol(state, PlantLoop(1).FluidName, DataGlobals::HWInitConvTemp, PlantLoop(1).FluidIndex, "Unit Test"); + Cp = GetSpecificHeatGlycol(state, PlantLoop(1).FluidName, DataGlobalConstants::HWInitConvTemp(), PlantLoop(1).FluidIndex, "Unit Test"); + rho = GetDensityGlycol(state, PlantLoop(1).FluidName, DataGlobalConstants::HWInitConvTemp(), PlantLoop(1).FluidIndex, "Unit Test"); DesWaterFlowRate = state.dataWaterCoils->WaterCoil(CoilNum).DesWaterHeatingCoilRate / (10.0 * Cp * rho); // check heating coil design water flow rate @@ -664,8 +664,8 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterLowAirFlowUASizing) Real64 rho = 0; Real64 DesWaterFlowRate = 0; - Cp = GetSpecificHeatGlycol(state, PlantLoop(1).FluidName, DataGlobals::HWInitConvTemp, PlantLoop(1).FluidIndex, "Unit Test"); - rho = GetDensityGlycol(state, PlantLoop(1).FluidName, DataGlobals::HWInitConvTemp, PlantLoop(1).FluidIndex, "Unit Test"); + Cp = GetSpecificHeatGlycol(state, PlantLoop(1).FluidName, DataGlobalConstants::HWInitConvTemp(), PlantLoop(1).FluidIndex, "Unit Test"); + rho = GetDensityGlycol(state, PlantLoop(1).FluidName, DataGlobalConstants::HWInitConvTemp(), PlantLoop(1).FluidIndex, "Unit Test"); DesWaterFlowRate = state.dataWaterCoils->WaterCoil(CoilNum).DesWaterHeatingCoilRate / (10.0 * Cp * rho); // check heating coil design water flow rate @@ -821,8 +821,8 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterUASizingLowHwaterInletTemp) Real64 rho = 0; Real64 DesWaterFlowRate = 0; - Cp = GetSpecificHeatGlycol(state, PlantLoop(1).FluidName, DataGlobals::HWInitConvTemp, PlantLoop(1).FluidIndex, "Unit Test"); - rho = GetDensityGlycol(state, PlantLoop(1).FluidName, DataGlobals::HWInitConvTemp, PlantLoop(1).FluidIndex, "Unit Test"); + Cp = GetSpecificHeatGlycol(state, PlantLoop(1).FluidName, DataGlobalConstants::HWInitConvTemp(), PlantLoop(1).FluidIndex, "Unit Test"); + rho = GetDensityGlycol(state, PlantLoop(1).FluidName, DataGlobalConstants::HWInitConvTemp(), PlantLoop(1).FluidIndex, "Unit Test"); DesWaterFlowRate = state.dataWaterCoils->WaterCoil(CoilNum).DesWaterHeatingCoilRate / (10.0 * Cp * rho); // check heating coil design water flow rate @@ -934,8 +934,8 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterSimpleSizing) Real64 rho = 0; Real64 DesWaterFlowRate = 0; - Cp = GetSpecificHeatGlycol(state, PlantLoop(1).FluidName, DataGlobals::CWInitConvTemp, PlantLoop(1).FluidIndex, "Unit Test"); - rho = GetDensityGlycol(state, PlantLoop(1).FluidName, DataGlobals::CWInitConvTemp, PlantLoop(1).FluidIndex, "Unit Test"); + Cp = GetSpecificHeatGlycol(state, PlantLoop(1).FluidName, DataGlobalConstants::CWInitConvTemp(), PlantLoop(1).FluidIndex, "Unit Test"); + rho = GetDensityGlycol(state, PlantLoop(1).FluidName, DataGlobalConstants::CWInitConvTemp(), PlantLoop(1).FluidIndex, "Unit Test"); DesWaterFlowRate = state.dataWaterCoils->WaterCoil(CoilNum).DesWaterCoolingCoilRate / (state.dataWaterCoils->WaterCoil(CoilNum).DesignWaterDeltaTemp * Cp * rho); // check cooling coil design water flow rate @@ -1049,8 +1049,8 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterDetailedSizing) Real64 rho = 0; Real64 DesWaterFlowRate = 0; - Cp = GetSpecificHeatGlycol(state, PlantLoop(1).FluidName, DataGlobals::CWInitConvTemp, PlantLoop(1).FluidIndex, "Unit Test"); - rho = GetDensityGlycol(state, PlantLoop(1).FluidName, DataGlobals::CWInitConvTemp, PlantLoop(1).FluidIndex, "Unit Test"); + Cp = GetSpecificHeatGlycol(state, PlantLoop(1).FluidName, DataGlobalConstants::CWInitConvTemp(), PlantLoop(1).FluidIndex, "Unit Test"); + rho = GetDensityGlycol(state, PlantLoop(1).FluidName, DataGlobalConstants::CWInitConvTemp(), PlantLoop(1).FluidIndex, "Unit Test"); DesWaterFlowRate = state.dataWaterCoils->WaterCoil(CoilNum).DesWaterCoolingCoilRate / (6.67 * Cp * rho); // check cooling coil design water flow rate EXPECT_DOUBLE_EQ(DesWaterFlowRate, state.dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate); @@ -1146,8 +1146,8 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterSimpleSizing) Real64 rho = 0; Real64 DesWaterFlowRate = 0; - Cp = GetSpecificHeatGlycol(state, PlantLoop(1).FluidName, DataGlobals::HWInitConvTemp, PlantLoop(1).FluidIndex, "Unit Test"); - rho = GetDensityGlycol(state, PlantLoop(1).FluidName, DataGlobals::HWInitConvTemp, PlantLoop(1).FluidIndex, "Unit Test"); + Cp = GetSpecificHeatGlycol(state, PlantLoop(1).FluidName, DataGlobalConstants::HWInitConvTemp(), PlantLoop(1).FluidIndex, "Unit Test"); + rho = GetDensityGlycol(state, PlantLoop(1).FluidName, DataGlobalConstants::HWInitConvTemp(), PlantLoop(1).FluidIndex, "Unit Test"); DesWaterFlowRate = state.dataWaterCoils->WaterCoil(CoilNum).DesWaterHeatingCoilRate / (11.0 * Cp * rho); // check heating coil design water flow rate diff --git a/tst/EnergyPlus/unit/WindowManager.unit.cc b/tst/EnergyPlus/unit/WindowManager.unit.cc index 2c1d4daa723..00cbce4a009 100644 --- a/tst/EnergyPlus/unit/WindowManager.unit.cc +++ b/tst/EnergyPlus/unit/WindowManager.unit.cc @@ -245,7 +245,7 @@ TEST_F(EnergyPlusFixture, WindowFrameTest) DataSurfaces::Surface(winNum).OutDryBulbTemp = T_out; DataHeatBalance::TempEffBulkAir(winNum) = T_in; - DataSurfaces::SurfWinIRfromParentZone(winNum) = DataGlobals::StefanBoltzmann * std::pow(T_in + DataGlobals::KelvinConv, 4); + DataSurfaces::SurfWinIRfromParentZone(winNum) = DataGlobalConstants::StefanBoltzmann() * std::pow(T_in + DataGlobalConstants::KelvinConv(), 4); DataHeatBalFanSys::ZoneAirHumRatAvg.dimension(1, 0.01); DataHeatBalFanSys::ZoneAirHumRat.dimension(1, 0.01); DataHeatBalFanSys::MAT.dimension(1, T_in); @@ -2824,14 +2824,12 @@ TEST_F(EnergyPlusFixture, WindowManager_SrdLWRTest) Real64 inSurfTemp; Real64 outSurfTemp; - Real64 const StefanBoltzmann(5.6697E-8); - Real64 const KelvinConv(273.15); ScheduleManager::Schedule(1).CurrentValue = 25.0; // Srd Srfs Temp // Claculate temperature based on supply flow rate WindowManager::CalcWindowHeatBalance(state, surfNum2, DataHeatBalance::HConvIn(surfNum2), inSurfTemp, outSurfTemp); // Test if LWR from surrounding surfaces correctly calculated - EXPECT_DOUBLE_EQ(StefanBoltzmann * 0.84 * 0.6 * (pow_4(25.0 + KelvinConv) - pow_4(state.dataWindowManager->thetas(1))), DataHeatBalSurface::QRadLWOutSrdSurfs(surfNum2)); + EXPECT_DOUBLE_EQ(DataGlobalConstants::StefanBoltzmann() * 0.84 * 0.6 * (pow_4(25.0 + DataGlobalConstants::KelvinConv()) - pow_4(state.dataWindowManager->thetas(1))), DataHeatBalSurface::QRadLWOutSrdSurfs(surfNum2)); EXPECT_NEAR(-24.9342, DataHeatBalSurface::QHeatEmiReport(surfNum2),3); } TEST_F(EnergyPlusFixture, WindowMaterialComplexShadeTest) From 52146b61edc96795f3f8b18431a3893dff3a5f64 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Fri, 9 Oct 2020 15:23:37 -0600 Subject: [PATCH 07/15] move emsCallFrom to enum --- src/EnergyPlus/DXCoils.cc | 3 +- src/EnergyPlus/DataGlobalConstants.hh | 25 +++++ src/EnergyPlus/DataGlobals.cc | 31 ------- src/EnergyPlus/DataGlobals.hh | 23 ----- src/EnergyPlus/DataRuntimeLanguage.hh | 4 +- src/EnergyPlus/EMSManager.cc | 92 ++++++------------- src/EnergyPlus/EMSManager.hh | 5 +- src/EnergyPlus/ExternalInterface.cc | 7 +- src/EnergyPlus/Fans.cc | 3 +- src/EnergyPlus/Furnaces.cc | 5 +- src/EnergyPlus/HVACFan.cc | 2 +- src/EnergyPlus/HVACManager.cc | 20 ++-- src/EnergyPlus/HVACSizingSimulationManager.cc | 2 +- src/EnergyPlus/HeatBalanceManager.cc | 13 +-- src/EnergyPlus/PlantCondLoopOperation.cc | 6 +- src/EnergyPlus/PluginManager.cc | 46 +++++----- src/EnergyPlus/PluginManager.hh | 6 +- src/EnergyPlus/SimAirServingZones.cc | 2 +- src/EnergyPlus/SimulationManager.cc | 4 +- src/EnergyPlus/UnitarySystem.cc | 4 +- src/EnergyPlus/UserDefinedComponents.cc | 18 ++-- src/EnergyPlus/WeatherManager.cc | 2 +- src/EnergyPlus/ZoneEquipmentManager.cc | 3 +- src/EnergyPlus/api/runtime.cc | 68 +++++++------- tst/EnergyPlus/unit/EMSManager.unit.cc | 48 +++++----- tst/EnergyPlus/unit/HVACFan.unit.cc | 4 +- tst/EnergyPlus/unit/NodeInputManager.unit.cc | 2 +- tst/EnergyPlus/unit/api/datatransfer.unit.cc | 4 +- 28 files changed, 185 insertions(+), 267 deletions(-) diff --git a/src/EnergyPlus/DXCoils.cc b/src/EnergyPlus/DXCoils.cc index 9d88020d636..01102c725ec 100644 --- a/src/EnergyPlus/DXCoils.cc +++ b/src/EnergyPlus/DXCoils.cc @@ -848,7 +848,6 @@ namespace DXCoils { using CurveManager::GetCurveIndex; using CurveManager::SetCurveOutputMinMaxValues; using DataGlobals::AnyEnergyManagementSystemInModel; - using DataGlobals::emsCallFromComponentGetInput; using DataHeatBalance::IntGainTypeOf_SecCoolingDXCoilMultiSpeed; using DataHeatBalance::IntGainTypeOf_SecCoolingDXCoilSingleSpeed; using DataHeatBalance::IntGainTypeOf_SecCoolingDXCoilTwoSpeed; @@ -6008,7 +6007,7 @@ namespace DXCoils { lAlphaBlanks2.deallocate(); lNumericBlanks2.deallocate(); bool anyEMSRan; - ManageEMS(state, emsCallFromComponentGetInput, anyEMSRan, ObjexxFCL::Optional_int_const()); + ManageEMS(state, DataGlobalConstants::EMSCallFrom::ComponentGetInput, anyEMSRan, ObjexxFCL::Optional_int_const()); } void InitDXCoil(EnergyPlusData &state, int const DXCoilNum) // number of the current DX coil unit being simulated diff --git a/src/EnergyPlus/DataGlobalConstants.hh b/src/EnergyPlus/DataGlobalConstants.hh index 36d17d36af6..1de0887d793 100644 --- a/src/EnergyPlus/DataGlobalConstants.hh +++ b/src/EnergyPlus/DataGlobalConstants.hh @@ -258,6 +258,31 @@ namespace DataGlobalConstants { ReadAllWeatherData = 6 // a weather period for reading all weather data prior to the simulation }; + // Parameters for EMS Calling Points + enum class EMSCallFrom { + Unassigned, + ZoneSizing, + SystemSizing, + BeginNewEnvironment, + BeginNewEnvironmentAfterWarmUp, + BeginTimestepBeforePredictor, + BeforeHVACManagers, + AfterHVACManagers, + HVACIterationLoop, + EndSystemTimestepBeforeHVACReporting, + EndSystemTimestepAfterHVACReporting, + EndZoneTimestepBeforeZoneReporting, + EndZoneTimestepAfterZoneReporting, + SetupSimulation, + ExternalInterface, + ComponentGetInput, + UserDefinedComponentModel, + UnitarySystemSizing, + BeginZoneTimestepBeforeInitHeatBalance, + BeginZoneTimestepAfterInitHeatBalance, + BeginZoneTimestepBeforeSetCurrentWeather + }; + Real64 constexpr MaxEXPArg () { return 709.78; } // maximum exponent in EXP() function Real64 constexpr Pi () { return 3.14159265358979324; } // Pi 3.1415926535897932384626435 Real64 constexpr PiOvr2 () { return Pi() / 2.0; } // Pi/2 diff --git a/src/EnergyPlus/DataGlobals.cc b/src/EnergyPlus/DataGlobals.cc index 915405ffb46..896b902171a 100644 --- a/src/EnergyPlus/DataGlobals.cc +++ b/src/EnergyPlus/DataGlobals.cc @@ -72,39 +72,8 @@ namespace DataGlobals { // This data-only module is a repository for all variables which are considered // to be "global" in nature in EnergyPlus. - // Parameters for EMS Calling Points - int const emsCallFromZoneSizing(1); // Identity where EMS called from - int const emsCallFromSystemSizing(2); // Identity where EMS called from - int const emsCallFromBeginNewEvironment(3); // Identity where EMS called from - int const emsCallFromBeginNewEvironmentAfterWarmUp(4); // Identity where EMS called from - int const emsCallFromBeginTimestepBeforePredictor(5); // Identity where EMS called from - int const emsCallFromBeforeHVACManagers(6); // Identity where EMS called from - int const emsCallFromAfterHVACManagers(7); // Identity where EMS called from - int const emsCallFromHVACIterationLoop(8); // Identity where EMS called from - int const emsCallFromEndSystemTimestepBeforeHVACReporting(9); // Identity where EMS called from - int const emsCallFromEndSystemTimestepAfterHVACReporting(10); // Identity where EMS called from - int const emsCallFromEndZoneTimestepBeforeZoneReporting(11); // Identity where EMS called from - int const emsCallFromEndZoneTimestepAfterZoneReporting(12); // Identity where EMS called from - int const emsCallFromSetupSimulation(13); // identify where EMS called from, - // this is for input processing only - int const emsCallFromExternalInterface(14); // Identity where EMS called from - int const emsCallFromComponentGetInput(15); // EMS called from end of get input for a component - int const emsCallFromUserDefinedComponentModel(16); // EMS called from inside a custom user component model - int const emsCallFromUnitarySystemSizing(17); // EMS called from unitary system compound component - int const emsCallFromBeginZoneTimestepBeforeInitHeatBalance(18); // Identity where EMS called from - int const emsCallFromBeginZoneTimestepAfterInitHeatBalance(19); // Identity where EMS called from - int const emsCallFromBeginZoneTimestepBeforeSetCurrentWeather(20); // Identity where EMS called from - int const ScheduleAlwaysOn(-1); // Value when passed to schedule routines gives back 1.0 (on) - // DERIVED TYPE DEFINITIONS: - // na - - // INTERFACE BLOCK SPECIFICATIONS: - // see DataOmterfaces fpr global interface statements - - // MODULE VARIABLE DECLARATIONS: - bool BeginDayFlag(false); // True at the start of each day, False after first time step in day bool BeginEnvrnFlag(false); // True at the start of each environment, False after first time step in environ bool beginEnvrnWarmStartFlag(false); // Sizing Speed Up diff --git a/src/EnergyPlus/DataGlobals.hh b/src/EnergyPlus/DataGlobals.hh index 3b33a17bf2e..d38041632c9 100644 --- a/src/EnergyPlus/DataGlobals.hh +++ b/src/EnergyPlus/DataGlobals.hh @@ -66,29 +66,6 @@ struct EnergyPlusData; namespace DataGlobals { - // Parameters for EMS Calling Points - extern int const emsCallFromZoneSizing; // Identity where EMS called from - extern int const emsCallFromSystemSizing; // Identity where EMS called from - extern int const emsCallFromBeginNewEvironment; // Identity where EMS called from - extern int const emsCallFromBeginNewEvironmentAfterWarmUp; // Identity where EMS called from - extern int const emsCallFromBeginTimestepBeforePredictor; // Identity where EMS called from - extern int const emsCallFromBeforeHVACManagers; // Identity where EMS called from - extern int const emsCallFromAfterHVACManagers; // Identity where EMS called from - extern int const emsCallFromHVACIterationLoop; // Identity where EMS called from - extern int const emsCallFromEndSystemTimestepBeforeHVACReporting; // Identity where EMS called from - extern int const emsCallFromEndSystemTimestepAfterHVACReporting; // Identity where EMS called from - extern int const emsCallFromEndZoneTimestepBeforeZoneReporting; // Identity where EMS called from - extern int const emsCallFromEndZoneTimestepAfterZoneReporting; // Identity where EMS called from - extern int const emsCallFromSetupSimulation; // identify where EMS called from, - // this is for input processing only - extern int const emsCallFromExternalInterface; // Identity where EMS called from - extern int const emsCallFromComponentGetInput; // EMS called from end of get input for a component - extern int const emsCallFromUserDefinedComponentModel; // EMS called from inside a custom user component model - extern int const emsCallFromUnitarySystemSizing; // EMS called from unitary system compound component - extern int const emsCallFromBeginZoneTimestepBeforeInitHeatBalance; // Identity where EMS called from - extern int const emsCallFromBeginZoneTimestepAfterInitHeatBalance; // Identity where EMS called from - extern int const emsCallFromBeginZoneTimestepBeforeSetCurrentWeather; // Identity where EMS called from - extern int const ScheduleAlwaysOn; // Value when passed to schedule routines gives back 1.0 (on) extern bool BeginDayFlag; // True at the start of each day, False after first time step in day diff --git a/src/EnergyPlus/DataRuntimeLanguage.hh b/src/EnergyPlus/DataRuntimeLanguage.hh index 14dccfadc4b..39a161dd0b9 100644 --- a/src/EnergyPlus/DataRuntimeLanguage.hh +++ b/src/EnergyPlus/DataRuntimeLanguage.hh @@ -353,12 +353,12 @@ namespace DataRuntimeLanguage { // Members // structure for Erl program calling managers std::string Name; // user defined name for calling manager - int CallingPoint; // EMS Calling point for this manager, see parameters emsCallFrom* + DataGlobalConstants::EMSCallFrom CallingPoint; // EMS Calling point for this manager, see parameters emsCallFrom* int NumErlPrograms; // count of total number of Erl programs called by this manager Array1D_int ErlProgramARR; // list of integer pointers to Erl programs used by this manager // Default Constructor - EMSProgramCallManagementType() : CallingPoint(0), NumErlPrograms(0) + EMSProgramCallManagementType() : CallingPoint(DataGlobalConstants::EMSCallFrom::Unassigned), NumErlPrograms(0) { } }; diff --git a/src/EnergyPlus/EMSManager.cc b/src/EnergyPlus/EMSManager.cc index be67a88dc3d..05f30c4cb65 100644 --- a/src/EnergyPlus/EMSManager.cc +++ b/src/EnergyPlus/EMSManager.cc @@ -59,9 +59,9 @@ #include #include #include +#include #include #include -#include #include #include #include @@ -91,10 +91,7 @@ namespace EMSManager { // PURPOSE OF THIS MODULE: // This module manages the programmable energy management system(EMS). - // METHODOLOGY EMPLOYED: - // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataRuntimeLanguage; // Data @@ -111,17 +108,11 @@ namespace EMSManager { static std::string const BlankString; - // DERIVED TYPE DEFINITIONS: - - // MODULE VARIABLE TYPE DECLARATIONS: - // MODULE VARIABLE DECLARATIONS: bool GetEMSUserInput(true); // Flag to prevent input from being read multiple times bool ZoneThermostatActuatorsHaveBeenSetup(false); bool FinishProcessingUserInput(true); // Flag to indicate still need to process input - // SUBROUTINE SPECIFICATIONS: - // Functions void clear_state() { @@ -249,7 +240,7 @@ namespace EMSManager { // MODULE SUBROUTINES: void ManageEMS(EnergyPlusData &state, - int const iCalledFrom, // indicates where subroutine was called from, parameters in DataGlobals. + DataGlobalConstants::EMSCallFrom const iCalledFrom, // indicates where subroutine was called from, parameters in DataGlobals. bool &anyProgramRan, // true if any Erl programs ran for this call Optional_int_const ProgramManagerToRun // specific program manager to run ) @@ -270,9 +261,6 @@ namespace EMSManager { // Using/Aliasing using DataGlobals::AnyEnergyManagementSystemInModel; - using DataGlobals::emsCallFromExternalInterface; - using DataGlobals::emsCallFromSetupSimulation; - using DataGlobals::emsCallFromUserDefinedComponentModel; using OutputProcessor::MeterType; using OutputProcessor::RealVariables; using OutputProcessor::RealVariableType; @@ -295,7 +283,7 @@ namespace EMSManager { anyProgramRan = false; if (!AnyEnergyManagementSystemInModel) return; // quick return if nothing to do - if (iCalledFrom == DataGlobals::emsCallFromBeginNewEvironment) { + if (iCalledFrom == DataGlobalConstants::EMSCallFrom::BeginNewEnvironment) { BeginEnvrnInitializeRuntimeLanguage(); PluginManagement::onBeginEnvironment(); } @@ -304,21 +292,21 @@ namespace EMSManager { // also call plugins and callbacks here for convenience bool anyPluginsOrCallbacksRan = false; - if (iCalledFrom != DataGlobals::emsCallFromUserDefinedComponentModel) { // don't run user-defined component plugins this way + if (iCalledFrom != DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel) { // don't run user-defined component plugins this way PluginManagement::runAnyRegisteredCallbacks(state, iCalledFrom, anyPluginsOrCallbacksRan); if (anyPluginsOrCallbacksRan) { anyProgramRan = true; } } - if (iCalledFrom == emsCallFromSetupSimulation) { + if (iCalledFrom == DataGlobalConstants::EMSCallFrom::SetupSimulation) { ProcessEMSInput(state, true); return; } // Run the Erl programs depending on calling point. - if (iCalledFrom != emsCallFromUserDefinedComponentModel) { + if (iCalledFrom != DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel) { for (ProgramManagerNum = 1; ProgramManagerNum <= NumProgramCallManagers; ++ProgramManagerNum) { if (EMSProgramCallManager(ProgramManagerNum).CallingPoint == iCalledFrom) { @@ -337,7 +325,7 @@ namespace EMSManager { } } - if (iCalledFrom == emsCallFromExternalInterface) { + if (iCalledFrom == DataGlobalConstants::EMSCallFrom::ExternalInterface) { anyProgramRan = true; } @@ -387,7 +375,7 @@ namespace EMSManager { ReportEMS(); } - void InitEMS(EnergyPlusData &state, int const iCalledFrom) // indicates where subroutine was called from, parameters in DataGlobals. + void InitEMS(EnergyPlusData &state, DataGlobalConstants::EMSCallFrom const iCalledFrom) // indicates where subroutine was called from, parameters in DataGlobals. { // SUBROUTINE INFORMATION: @@ -408,9 +396,6 @@ namespace EMSManager { // Using/Aliasing using DataGlobals::BeginEnvrnFlag; using DataGlobals::DoingSizing; - using DataGlobals::emsCallFromSystemSizing; - using DataGlobals::emsCallFromUserDefinedComponentModel; - using DataGlobals::emsCallFromZoneSizing; using DataGlobals::KickOffSimulation; using DataZoneControls::GetZoneAirStatsInputFlag; using RuntimeLanguageProcessor::InitializeRuntimeLanguage; @@ -465,8 +450,8 @@ namespace EMSManager { InitializeRuntimeLanguage(state); - if ((BeginEnvrnFlag) || (iCalledFrom == emsCallFromZoneSizing) || (iCalledFrom == emsCallFromSystemSizing) || - (iCalledFrom == emsCallFromUserDefinedComponentModel)) { + if ((BeginEnvrnFlag) || (iCalledFrom == DataGlobalConstants::EMSCallFrom::ZoneSizing) || (iCalledFrom == DataGlobalConstants::EMSCallFrom::SystemSizing) || + (iCalledFrom == DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel)) { // another pass at trying to setup input data. if (FinishProcessingUserInput) { @@ -557,22 +542,6 @@ namespace EMSManager { // Using/Aliasing using DataGlobals::AnyEnergyManagementSystemInModel; - using DataGlobals::emsCallFromAfterHVACManagers; - using DataGlobals::emsCallFromBeforeHVACManagers; - using DataGlobals::emsCallFromBeginNewEvironmentAfterWarmUp; - using DataGlobals::emsCallFromBeginZoneTimestepBeforeInitHeatBalance; - using DataGlobals::emsCallFromBeginZoneTimestepAfterInitHeatBalance; - using DataGlobals::emsCallFromBeginTimestepBeforePredictor; - using DataGlobals::emsCallFromComponentGetInput; - using DataGlobals::emsCallFromEndSystemTimestepAfterHVACReporting; - using DataGlobals::emsCallFromEndSystemTimestepBeforeHVACReporting; - using DataGlobals::emsCallFromEndZoneTimestepAfterZoneReporting; - using DataGlobals::emsCallFromEndZoneTimestepBeforeZoneReporting; - using DataGlobals::emsCallFromHVACIterationLoop; - using DataGlobals::emsCallFromSystemSizing; - using DataGlobals::emsCallFromUnitarySystemSizing; - using DataGlobals::emsCallFromUserDefinedComponentModel; - using DataGlobals::emsCallFromZoneSizing; using RuntimeLanguageProcessor::ExternalInterfaceInitializeErlVariable; using RuntimeLanguageProcessor::FindEMSVariable; using RuntimeLanguageProcessor::InitializeRuntimeLanguage; @@ -973,41 +942,41 @@ namespace EMSManager { auto const SELECT_CASE_var(cAlphaArgs(2)); if (SELECT_CASE_var == "BEGINNEWENVIRONMENT") { - EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobals::emsCallFromBeginNewEvironment; + EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::BeginNewEnvironment; } else if (SELECT_CASE_var == "BEGINZONETIMESTEPBEFORESETCURRENTWEATHER") { - EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobals::emsCallFromBeginZoneTimestepBeforeSetCurrentWeather; + EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::BeginZoneTimestepBeforeSetCurrentWeather; } else if (SELECT_CASE_var == "AFTERNEWENVIRONMENTWARMUPISCOMPLETE") { - EMSProgramCallManager(CallManagerNum).CallingPoint = emsCallFromBeginNewEvironmentAfterWarmUp; + EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::BeginNewEnvironmentAfterWarmUp; } else if (SELECT_CASE_var == "BEGINZONETIMESTEPBEFOREINITHEATBALANCE") { - EMSProgramCallManager(CallManagerNum).CallingPoint = emsCallFromBeginZoneTimestepBeforeInitHeatBalance; + EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::BeginZoneTimestepBeforeInitHeatBalance; } else if (SELECT_CASE_var == "BEGINZONETIMESTEPAFTERINITHEATBALANCE") { - EMSProgramCallManager(CallManagerNum).CallingPoint = emsCallFromBeginZoneTimestepAfterInitHeatBalance; + EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::BeginZoneTimestepAfterInitHeatBalance; } else if (SELECT_CASE_var == "BEGINTIMESTEPBEFOREPREDICTOR") { - EMSProgramCallManager(CallManagerNum).CallingPoint = emsCallFromBeginTimestepBeforePredictor; + EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::BeginTimestepBeforePredictor; } else if (SELECT_CASE_var == "AFTERPREDICTORBEFOREHVACMANAGERS") { - EMSProgramCallManager(CallManagerNum).CallingPoint = emsCallFromBeforeHVACManagers; + EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::BeforeHVACManagers; } else if (SELECT_CASE_var == "AFTERPREDICTORAFTERHVACMANAGERS") { - EMSProgramCallManager(CallManagerNum).CallingPoint = emsCallFromAfterHVACManagers; + EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::AfterHVACManagers; } else if (SELECT_CASE_var == "INSIDEHVACSYSTEMITERATIONLOOP") { - EMSProgramCallManager(CallManagerNum).CallingPoint = emsCallFromHVACIterationLoop; + EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::HVACIterationLoop; } else if (SELECT_CASE_var == "ENDOFZONETIMESTEPBEFOREZONEREPORTING") { - EMSProgramCallManager(CallManagerNum).CallingPoint = emsCallFromEndZoneTimestepBeforeZoneReporting; + EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::EndZoneTimestepBeforeZoneReporting; } else if (SELECT_CASE_var == "ENDOFZONETIMESTEPAFTERZONEREPORTING") { - EMSProgramCallManager(CallManagerNum).CallingPoint = emsCallFromEndZoneTimestepAfterZoneReporting; + EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::EndZoneTimestepAfterZoneReporting; } else if (SELECT_CASE_var == "ENDOFSYSTEMTIMESTEPBEFOREHVACREPORTING") { - EMSProgramCallManager(CallManagerNum).CallingPoint = emsCallFromEndSystemTimestepBeforeHVACReporting; + EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::EndSystemTimestepBeforeHVACReporting; } else if (SELECT_CASE_var == "ENDOFSYSTEMTIMESTEPAFTERHVACREPORTING") { - EMSProgramCallManager(CallManagerNum).CallingPoint = emsCallFromEndSystemTimestepAfterHVACReporting; + EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::EndSystemTimestepAfterHVACReporting; } else if (SELECT_CASE_var == "ENDOFZONESIZING") { - EMSProgramCallManager(CallManagerNum).CallingPoint = emsCallFromZoneSizing; + EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::ZoneSizing; } else if (SELECT_CASE_var == "ENDOFSYSTEMSIZING") { - EMSProgramCallManager(CallManagerNum).CallingPoint = emsCallFromSystemSizing; + EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::SystemSizing; } else if (SELECT_CASE_var == "AFTERCOMPONENTINPUTREADIN") { - EMSProgramCallManager(CallManagerNum).CallingPoint = emsCallFromComponentGetInput; + EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::ComponentGetInput; } else if (SELECT_CASE_var == "USERDEFINEDCOMPONENTMODEL") { - EMSProgramCallManager(CallManagerNum).CallingPoint = emsCallFromUserDefinedComponentModel; + EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel; } else if (SELECT_CASE_var == "UNITARYSYSTEMSIZING") { - EMSProgramCallManager(CallManagerNum).CallingPoint = emsCallFromUnitarySystemSizing; + EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::UnitarySystemSizing; } else { ShowSevereError("Invalid " + cAlphaFieldNames(2) + '=' + cAlphaArgs(2)); ShowContinueError("Entered in " + cCurrentModuleObject + '=' + cAlphaArgs(1)); @@ -2461,7 +2430,6 @@ void SetupEMSActuator(std::string const &cComponentTypeName, // check for duplicates. // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataRuntimeLanguage; std::string const UpperCaseObjectType(UtilityRoutines::MakeUPPERCase(cComponentTypeName)); @@ -2517,7 +2485,6 @@ void SetupEMSActuator(std::string const &cComponentTypeName, // check for duplicates. // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataRuntimeLanguage; std::string const UpperCaseObjectType(UtilityRoutines::MakeUPPERCase(cComponentTypeName)); @@ -2573,7 +2540,6 @@ void SetupEMSActuator(std::string const &cComponentTypeName, // check for duplicates. // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataRuntimeLanguage; std::string const UpperCaseObjectType(UtilityRoutines::MakeUPPERCase(cComponentTypeName)); @@ -2619,7 +2585,6 @@ void SetupEMSInternalVariable(std::string const &cDataTypeName, std::string cons // Setup internal data source and make available to EMS // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataRuntimeLanguage; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -2679,7 +2644,6 @@ void SetupEMSInternalVariable(std::string const &cDataTypeName, std::string cons // Setup internal data source and make available to EMS // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataRuntimeLanguage; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: diff --git a/src/EnergyPlus/EMSManager.hh b/src/EnergyPlus/EMSManager.hh index 32882fffd2a..545f15c0b39 100644 --- a/src/EnergyPlus/EMSManager.hh +++ b/src/EnergyPlus/EMSManager.hh @@ -53,6 +53,7 @@ // EnergyPlus Headers #include +#include namespace EnergyPlus { @@ -94,12 +95,12 @@ namespace EMSManager { // MODULE SUBROUTINES: void ManageEMS(EnergyPlusData &state, - int const iCalledFrom, // indicates where subroutine was called from, parameters in DataGlobals. + DataGlobalConstants::EMSCallFrom iCalledFrom, // indicates where subroutine was called from, parameters in DataGlobals. bool &anyProgramRan, // true if any Erl programs ran for this call Optional_int_const ProgramManagerToRun = _ // specific program manager to run ); - void InitEMS(EnergyPlusData &state, int const iCalledFrom); // indicates where subroutine was called from, parameters in DataGlobals. + void InitEMS(EnergyPlusData &state, DataGlobalConstants::EMSCallFrom iCalledFrom); // indicates where subroutine was called from, parameters in DataGlobals. void ReportEMS(); diff --git a/src/EnergyPlus/ExternalInterface.cc b/src/EnergyPlus/ExternalInterface.cc index 00d7c3f0506..a025d98e508 100644 --- a/src/EnergyPlus/ExternalInterface.cc +++ b/src/EnergyPlus/ExternalInterface.cc @@ -733,7 +733,6 @@ namespace ExternalInterface { // This routine gets, sets and does the time integration in FMUs. // Using/Aliasing - using DataGlobals::emsCallFromExternalInterface; using DataGlobals::WarmupFlag; using EMSManager::ManageEMS; using General::TrimSigDigits; @@ -943,7 +942,7 @@ namespace ExternalInterface { // If we have Erl variables, we need to call ManageEMS so that they get updated in the Erl data structure if (useEMS) { bool anyRan; - ManageEMS(state, emsCallFromExternalInterface, anyRan, ObjexxFCL::Optional_int_const()); + ManageEMS(state, DataGlobalConstants::EMSCallFrom::ExternalInterface, anyRan, ObjexxFCL::Optional_int_const()); } FirstCallGetSetDoStep = false; @@ -1985,7 +1984,6 @@ namespace ExternalInterface { // Using/Aliasing using DataEnvironment::TotalOverallSimDays; using DataEnvironment::TotDesDays; - using DataGlobals::emsCallFromExternalInterface; using DataGlobals::TimeStepZone; using DataGlobals::WarmupFlag; using DataSystemVariables::UpdateDataDuringWarmupExternalInterface; @@ -2287,7 +2285,6 @@ namespace ExternalInterface { // RE-ENGINEERED na // Using/Aliasing - using DataGlobals::emsCallFromExternalInterface; using DataGlobals::MinutesPerTimeStep; using DataGlobals::SimTimeSteps; using EMSManager::ManageEMS; @@ -2411,7 +2408,7 @@ namespace ExternalInterface { // If we have Erl variables, we need to call ManageEMS so that they get updated in the Erl data structure if (useEMS) { bool anyRan; - ManageEMS(state, emsCallFromExternalInterface, anyRan, ObjexxFCL::Optional_int_const()); + ManageEMS(state, DataGlobalConstants::EMSCallFrom::ExternalInterface, anyRan, ObjexxFCL::Optional_int_const()); } firstCall = false; // bug fix causing external interface to send zero at the beginning of sim, Thierry Nouidui diff --git a/src/EnergyPlus/Fans.cc b/src/EnergyPlus/Fans.cc index 97ce2a11482..796a015643f 100644 --- a/src/EnergyPlus/Fans.cc +++ b/src/EnergyPlus/Fans.cc @@ -108,7 +108,6 @@ namespace Fans { using DataEnvironment::StdRhoAir; using DataGlobals::BeginEnvrnFlag; using DataGlobals::DisplayExtraWarnings; - using DataGlobals::emsCallFromComponentGetInput; using DataGlobals::SysSizingCalc; using DataGlobals::WarmupFlag; using DataHVACGlobals::BalancedExhMassFlow; @@ -1000,7 +999,7 @@ namespace Fans { } bool anyRan; - ManageEMS(state, emsCallFromComponentGetInput, anyRan, ObjexxFCL::Optional_int_const()); + ManageEMS(state, DataGlobalConstants::EMSCallFrom::ComponentGetInput, anyRan, ObjexxFCL::Optional_int_const()); MySizeFlag.dimension(state.dataFans->NumFans, true); } diff --git a/src/EnergyPlus/Furnaces.cc b/src/EnergyPlus/Furnaces.cc index 82461547b93..0128092f521 100644 --- a/src/EnergyPlus/Furnaces.cc +++ b/src/EnergyPlus/Furnaces.cc @@ -4746,7 +4746,7 @@ namespace Furnaces { } } bool anyRan; - ManageEMS(state, emsCallFromComponentGetInput, anyRan, ObjexxFCL::Optional_int_const()); + ManageEMS(state, DataGlobalConstants::EMSCallFrom::ComponentGetInput, anyRan, ObjexxFCL::Optional_int_const()); } // End of Get Input subroutines for this Module @@ -6059,7 +6059,6 @@ namespace Furnaces { // Using/Aliasing using namespace DataSizing; - using DataGlobals::emsCallFromUnitarySystemSizing; using EMSManager::ManageEMS; using General::TrimSigDigits; using HVACHXAssistedCoolingCoil::SimHXAssistedCoolingCoil; @@ -6086,7 +6085,7 @@ namespace Furnaces { Real64 MulSpeedFlowScale; // variable speed air flow scaling factor int IHPCoilIndex(0); // refer to cooling or heating coil in IHP bool anyRan; - ManageEMS(state, emsCallFromUnitarySystemSizing, anyRan, ObjexxFCL::Optional_int_const()); // calling point + ManageEMS(state, DataGlobalConstants::EMSCallFrom::UnitarySystemSizing, anyRan, ObjexxFCL::Optional_int_const()); // calling point ThisCtrlZoneNum = 0; DXCoolCap = 0.0; diff --git a/src/EnergyPlus/HVACFan.cc b/src/EnergyPlus/HVACFan.cc index d5833a75506..c32f0c42e2e 100644 --- a/src/EnergyPlus/HVACFan.cc +++ b/src/EnergyPlus/HVACFan.cc @@ -657,7 +657,7 @@ namespace HVACFan { isNumericFieldBlank.deallocate(); bool anyEMSRan = false; - EMSManager::ManageEMS(state, DataGlobals::emsCallFromComponentGetInput, anyEMSRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::ComponentGetInput, anyEMSRan, ObjexxFCL::Optional_int_const()); } void diff --git a/src/EnergyPlus/HVACManager.cc b/src/EnergyPlus/HVACManager.cc index 1256a0055b9..bebbb6f95c9 100644 --- a/src/EnergyPlus/HVACManager.cc +++ b/src/EnergyPlus/HVACManager.cc @@ -135,12 +135,6 @@ namespace HVACManager { using DataGlobals::DayOfSim; using DataGlobals::DisplayExtraWarnings; using DataGlobals::DoOutputReporting; - using DataGlobals::emsCallFromAfterHVACManagers; - using DataGlobals::emsCallFromBeforeHVACManagers; - using DataGlobals::emsCallFromBeginTimestepBeforePredictor; - using DataGlobals::emsCallFromEndSystemTimestepAfterHVACReporting; - using DataGlobals::emsCallFromEndSystemTimestepBeforeHVACReporting; - using DataGlobals::emsCallFromHVACIterationLoop; using DataGlobals::EndHourFlag; using DataGlobals::HourOfDay; using DataGlobals::isPulseZoneSizing; @@ -372,7 +366,7 @@ namespace HVACManager { FracTimeStepZone = TimeStepSys / TimeStepZone; bool anyEMSRan; - ManageEMS(state, emsCallFromBeginTimestepBeforePredictor, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point + ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginTimestepBeforePredictor, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point SetOutAirNodes(state); @@ -514,7 +508,7 @@ namespace HVACManager { OutputReportTabular::CalcHeatEmissionReport(state); } - ManageEMS(state, emsCallFromEndSystemTimestepBeforeHVACReporting, anyEMSRan, ObjexxFCL::Optional_int_const()); // EMS calling point + ManageEMS(state, DataGlobalConstants::EMSCallFrom::EndSystemTimestepBeforeHVACReporting, anyEMSRan, ObjexxFCL::Optional_int_const()); // EMS calling point // This is where output processor data is updated for System Timestep reporting if (!WarmupFlag) { @@ -615,7 +609,7 @@ namespace HVACManager { } UpdateDataandReport(state, OutputProcessor::TimeStepType::TimeStepSystem); } - ManageEMS(state, emsCallFromEndSystemTimestepAfterHVACReporting, anyEMSRan, ObjexxFCL::Optional_int_const()); // EMS calling point + ManageEMS(state, DataGlobalConstants::EMSCallFrom::EndSystemTimestepAfterHVACReporting, anyEMSRan, ObjexxFCL::Optional_int_const()); // EMS calling point // UPDATE SYSTEM CLOCKS SysTimeElapsed += TimeStepSys; @@ -865,7 +859,7 @@ namespace HVACManager { // Before the HVAC simulation, call ManageSetPoints to set all the HVAC // node setpoints bool anyEMSRan = false; - ManageEMS(state, emsCallFromBeforeHVACManagers, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point + ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeforeHVACManagers, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point ManageSetPoints(state); @@ -876,8 +870,8 @@ namespace HVACManager { // the system on/off flags ManageSystemAvailability(state); - ManageEMS(state, emsCallFromAfterHVACManagers, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point - ManageEMS(state, emsCallFromHVACIterationLoop, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point id + ManageEMS(state, DataGlobalConstants::EMSCallFrom::AfterHVACManagers, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point + ManageEMS(state, DataGlobalConstants::EMSCallFrom::HVACIterationLoop, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point id // first explicitly call each system type with FirstHVACIteration, @@ -907,7 +901,7 @@ namespace HVACManager { if (state.dataGlobal->stopSimulation) break; - ManageEMS(state, emsCallFromHVACIterationLoop, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point id + ManageEMS(state, DataGlobalConstants::EMSCallFrom::HVACIterationLoop, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point id // Manages the various component simulations SimSelectedEquipment(state, SimAirLoopsFlag, diff --git a/src/EnergyPlus/HVACSizingSimulationManager.cc b/src/EnergyPlus/HVACSizingSimulationManager.cc index 2a97c41a975..9f367eed7ed 100644 --- a/src/EnergyPlus/HVACSizingSimulationManager.cc +++ b/src/EnergyPlus/HVACSizingSimulationManager.cc @@ -302,7 +302,7 @@ void ManageHVACSizingSimulation(EnergyPlusData &state, bool &ErrorsFound) NumOfWarmupDays = 0; bool anyEMSRan; - ManageEMS(state, DataGlobals::emsCallFromBeginNewEvironment, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point + ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginNewEnvironment, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point while ((DayOfSim < NumOfDayInEnvrn) || (WarmupFlag)) { // Begin day loop ... diff --git a/src/EnergyPlus/HeatBalanceManager.cc b/src/EnergyPlus/HeatBalanceManager.cc index e2efdb9858f..c234c80c5c1 100644 --- a/src/EnergyPlus/HeatBalanceManager.cc +++ b/src/EnergyPlus/HeatBalanceManager.cc @@ -318,9 +318,6 @@ namespace HeatBalanceManager { // Using/Aliasing using namespace HeatBalanceSurfaceManager; - using DataGlobals::emsCallFromBeginNewEvironmentAfterWarmUp; - using DataGlobals::emsCallFromEndZoneTimestepAfterZoneReporting; - using DataGlobals::emsCallFromEndZoneTimestepBeforeZoneReporting; using EMSManager::ManageEMS; using EMSManager::UpdateEMSTrendVariables; @@ -363,13 +360,13 @@ namespace HeatBalanceManager { bool anyRan; ManageEMS(state, - DataGlobals::emsCallFromBeginZoneTimestepBeforeInitHeatBalance, + DataGlobalConstants::EMSCallFrom::BeginZoneTimestepBeforeInitHeatBalance, anyRan, ObjexxFCL::Optional_int_const()); // EMS calling point // These Inits will still have to be looked at as the routines are re-engineered further InitHeatBalance(state); // Initialize all heat balance related parameters - ManageEMS(state, DataGlobals::emsCallFromBeginZoneTimestepAfterInitHeatBalance, anyRan, ObjexxFCL::Optional_int_const()); // EMS calling point + ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginZoneTimestepAfterInitHeatBalance, anyRan, ObjexxFCL::Optional_int_const()); // EMS calling point // Solve the zone heat balance by first calling the Surface Heat Balance Manager // and then the Air Heat Balance Manager is called by the Surface Heat Balance @@ -379,7 +376,7 @@ namespace HeatBalanceManager { // the HVAC system (called from the Air Heat Balance) and the zone (simulated // in the Surface Heat Balance Manager). In the future, this may be improved. ManageSurfaceHeatBalance(state); - ManageEMS(state, emsCallFromEndZoneTimestepBeforeZoneReporting, anyRan, ObjexxFCL::Optional_int_const()); // EMS calling point + ManageEMS(state, DataGlobalConstants::EMSCallFrom::EndZoneTimestepBeforeZoneReporting, anyRan, ObjexxFCL::Optional_int_const()); // EMS calling point RecKeepHeatBalance(state); // Do any heat balance related record keeping // This call has been moved to the FanSystemModule and does effect the output file @@ -388,7 +385,7 @@ namespace HeatBalanceManager { ReportHeatBalance(state); // Manage heat balance reporting until the new reporting is in place - ManageEMS(state, emsCallFromEndZoneTimestepAfterZoneReporting, anyRan, ObjexxFCL::Optional_int_const()); // EMS calling point + ManageEMS(state, DataGlobalConstants::EMSCallFrom::EndZoneTimestepAfterZoneReporting, anyRan, ObjexxFCL::Optional_int_const()); // EMS calling point UpdateEMSTrendVariables(); EnergyPlus::PluginManagement::PluginManager::updatePluginValues(); @@ -400,7 +397,7 @@ namespace HeatBalanceManager { DayOfSim = 0; // Reset DayOfSim if Warmup converged state.dataGlobal->DayOfSimChr = "0"; - ManageEMS(state, emsCallFromBeginNewEvironmentAfterWarmUp, anyRan, ObjexxFCL::Optional_int_const()); // calling point + ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginNewEnvironmentAfterWarmUp, anyRan, ObjexxFCL::Optional_int_const()); // calling point } } diff --git a/src/EnergyPlus/PlantCondLoopOperation.cc b/src/EnergyPlus/PlantCondLoopOperation.cc index 24597a9ac54..4dd14f50fdb 100644 --- a/src/EnergyPlus/PlantCondLoopOperation.cc +++ b/src/EnergyPlus/PlantCondLoopOperation.cc @@ -1839,7 +1839,6 @@ CurrentModuleObject, PlantOpSchemeName); // Using/Aliasing using DataGlobals::BeginEnvrnFlag; - using DataGlobals::emsCallFromUserDefinedComponentModel; using EMSManager::ManageEMS; using ScheduleManager::GetCurrentScheduleValue; using ScheduleManager::GetScheduleIndex; @@ -2087,7 +2086,7 @@ CurrentModuleObject, PlantOpSchemeName); if (BeginEnvrnFlag && this_op_scheme.MyEnvrnFlag) { if (this_op_scheme.ErlInitProgramMngr > 0) { bool anyEMSRan; - ManageEMS(state, emsCallFromUserDefinedComponentModel, anyEMSRan, this_op_scheme.ErlInitProgramMngr); + ManageEMS(state, DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, this_op_scheme.ErlInitProgramMngr); } else if (this_op_scheme.initPluginLocation > -1) { EnergyPlus::PluginManagement::pluginManager->runSingleUserDefinedPlugin(state, this_op_scheme.initPluginLocation); } @@ -3069,7 +3068,6 @@ CurrentModuleObject, PlantOpSchemeName); // na // Using/Aliasing - using DataGlobals::emsCallFromUserDefinedComponentModel; using EMSManager::ManageEMS; // Locals @@ -3098,7 +3096,7 @@ CurrentModuleObject, PlantOpSchemeName); // Call EMS program(s) if (PlantLoop(LoopNum).OpScheme(CurSchemePtr).ErlSimProgramMngr > 0) { bool anyEMSRan; - ManageEMS(state, emsCallFromUserDefinedComponentModel, anyEMSRan, PlantLoop(LoopNum).OpScheme(CurSchemePtr).ErlSimProgramMngr); + ManageEMS(state, DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, PlantLoop(LoopNum).OpScheme(CurSchemePtr).ErlSimProgramMngr); } else if (PlantLoop(LoopNum).OpScheme(CurSchemePtr).simPluginLocation > -1) { EnergyPlus::PluginManagement::pluginManager->runSingleUserDefinedPlugin(state, PlantLoop(LoopNum).OpScheme(CurSchemePtr).simPluginLocation); diff --git a/src/EnergyPlus/PluginManager.cc b/src/EnergyPlus/PluginManager.cc index 09d300c78e9..2e36e9bb19f 100644 --- a/src/EnergyPlus/PluginManager.cc +++ b/src/EnergyPlus/PluginManager.cc @@ -62,7 +62,7 @@ namespace EnergyPlus { namespace PluginManagement { std::unique_ptr pluginManager; - std::map>> callbacks; + std::map>> callbacks; std::vector plugins; std::vector trends; std::vector globalVariableNames; @@ -72,7 +72,7 @@ namespace PluginManagement { bool fullyReady = false; bool apiErrorFlag = false; - void registerNewCallback(EnergyPlusData &EP_UNUSED(state), int iCalledFrom, const std::function &f) + void registerNewCallback(EnergyPlusData &EP_UNUSED(state), DataGlobalConstants::EMSCallFrom iCalledFrom, const std::function &f) { callbacks[iCalledFrom].push_back(f); } @@ -93,7 +93,7 @@ namespace PluginManagement { return (int)callbacks.size(); } - void runAnyRegisteredCallbacks(EnergyPlusData &state, int iCalledFrom, bool &anyRan) + void runAnyRegisteredCallbacks(EnergyPlusData &state, DataGlobalConstants::EMSCallFrom iCalledFrom, bool &anyRan) { if (DataGlobals::KickOffSimulation) return; for (auto const &cb : callbacks[iCalledFrom]) { @@ -923,97 +923,97 @@ namespace PluginManagement { } #if LINK_WITH_PYTHON == 1 - bool PluginInstance::run(EnergyPlusData &state, int iCalledFrom) const + bool PluginInstance::run(EnergyPlusData &state, DataGlobalConstants::EMSCallFrom iCalledFrom) const { // returns true if a plugin actually ran PyObject *pFunctionName = nullptr; const char * functionName = nullptr; - if (iCalledFrom == DataGlobals::emsCallFromBeginNewEvironment) { + if (iCalledFrom == DataGlobalConstants::EMSCallFrom::BeginNewEnvironment) { if (this->bHasBeginNewEnvironment) { pFunctionName = this->pBeginNewEnvironment; functionName = this->sHookBeginNewEnvironment; } - } else if (iCalledFrom == DataGlobals::emsCallFromBeginZoneTimestepBeforeSetCurrentWeather) { + } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::BeginZoneTimestepBeforeSetCurrentWeather) { if (this->bHasBeginZoneTimestepBeforeSetCurrentWeather) { pFunctionName = this->pBeginZoneTimestepBeforeSetCurrentWeather; functionName = this->sHookBeginZoneTimestepBeforeSetCurrentWeather; } - } else if (iCalledFrom == DataGlobals::emsCallFromZoneSizing) { + } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::ZoneSizing) { if (this->bHasEndOfZoneSizing) { pFunctionName = this->pEndOfZoneSizing; functionName = this->sHookEndOfZoneSizing; } - } else if (iCalledFrom == DataGlobals::emsCallFromSystemSizing) { + } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::SystemSizing) { if (this->bHasEndOfSystemSizing) { pFunctionName = this->pEndOfSystemSizing; functionName = this->sHookEndOfSystemSizing; } - } else if (iCalledFrom == DataGlobals::emsCallFromBeginNewEvironmentAfterWarmUp) { + } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::BeginNewEnvironmentAfterWarmUp) { if (this->bHasAfterNewEnvironmentWarmUpIsComplete) { pFunctionName = this->pAfterNewEnvironmentWarmUpIsComplete; functionName = this->sHookAfterNewEnvironmentWarmUpIsComplete; } - } else if (iCalledFrom == DataGlobals::emsCallFromBeginTimestepBeforePredictor) { + } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::BeginTimestepBeforePredictor) { if (this->bHasBeginTimestepBeforePredictor) { pFunctionName = this->pBeginTimestepBeforePredictor; functionName = this->sHookBeginTimestepBeforePredictor; } - } else if (iCalledFrom == DataGlobals::emsCallFromBeforeHVACManagers) { + } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::BeforeHVACManagers) { if (this->bHasAfterPredictorBeforeHVACManagers) { pFunctionName = this->pAfterPredictorBeforeHVACManagers; functionName = this->sHookAfterPredictorBeforeHVACManagers; } - } else if (iCalledFrom == DataGlobals::emsCallFromAfterHVACManagers) { + } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::AfterHVACManagers) { if (this->bHasAfterPredictorAfterHVACManagers) { pFunctionName = this->pAfterPredictorAfterHVACManagers; functionName = this->sHookAfterPredictorAfterHVACManagers; } - } else if (iCalledFrom == DataGlobals::emsCallFromHVACIterationLoop) { + } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::HVACIterationLoop) { if (this->bHasInsideHVACSystemIterationLoop) { pFunctionName = this->pInsideHVACSystemIterationLoop; functionName = this->sHookInsideHVACSystemIterationLoop; } - } else if (iCalledFrom == DataGlobals::emsCallFromEndSystemTimestepBeforeHVACReporting) { + } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::EndSystemTimestepBeforeHVACReporting) { if (this->bHasEndOfSystemTimestepBeforeHVACReporting) { pFunctionName = this->pEndOfSystemTimestepBeforeHVACReporting; functionName = this->sHookEndOfSystemTimestepBeforeHVACReporting; } - } else if (iCalledFrom == DataGlobals::emsCallFromEndSystemTimestepAfterHVACReporting) { + } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::EndSystemTimestepAfterHVACReporting) { if (this->bHasEndOfSystemTimestepAfterHVACReporting) { pFunctionName = this->pEndOfSystemTimestepAfterHVACReporting; functionName = this->sHookEndOfSystemTimestepAfterHVACReporting; } - } else if (iCalledFrom == DataGlobals::emsCallFromEndZoneTimestepBeforeZoneReporting) { + } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::EndZoneTimestepBeforeZoneReporting) { if (this->bHasEndOfZoneTimestepBeforeZoneReporting) { pFunctionName = this->pEndOfZoneTimestepBeforeZoneReporting; functionName = this->sHookEndOfZoneTimestepBeforeZoneReporting; } - } else if (iCalledFrom == DataGlobals::emsCallFromEndZoneTimestepAfterZoneReporting) { + } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::EndZoneTimestepAfterZoneReporting) { if (this->bHasEndOfZoneTimestepAfterZoneReporting) { pFunctionName = this->pEndOfZoneTimestepAfterZoneReporting; functionName = this->sHookEndOfZoneTimestepAfterZoneReporting; } - } else if (iCalledFrom == DataGlobals::emsCallFromComponentGetInput) { + } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::ComponentGetInput) { if (this->bHasAfterComponentInputReadIn) { pFunctionName = this->pAfterComponentInputReadIn; functionName = this->sHookAfterComponentInputReadIn; } - } else if (iCalledFrom == DataGlobals::emsCallFromUserDefinedComponentModel) { + } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel) { if (this->bHasUserDefinedComponentModel) { pFunctionName = this->pUserDefinedComponentModel; functionName = this->sHookUserDefinedComponentModel; } - } else if (iCalledFrom == DataGlobals::emsCallFromUnitarySystemSizing) { + } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::UnitarySystemSizing) { if (this->bHasUnitarySystemSizing) { pFunctionName = this->pUnitarySystemSizing; functionName = this->sHookUnitarySystemSizing; } - } else if (iCalledFrom == DataGlobals::emsCallFromBeginZoneTimestepBeforeInitHeatBalance) { + } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::BeginZoneTimestepBeforeInitHeatBalance) { if (this->bHasBeginZoneTimestepBeforeInitHeatBalance) { pFunctionName = this->pBeginZoneTimestepBeforeInitHeatBalance; functionName = this->sHookBeginZoneTimestepBeforeInitHeatBalance; } - } else if (iCalledFrom == DataGlobals::emsCallFromBeginZoneTimestepAfterInitHeatBalance) { + } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::BeginZoneTimestepAfterInitHeatBalance) { if (this->bHasBeginZoneTimestepAfterInitHeatBalance) { pFunctionName = this->pBeginZoneTimestepAfterInitHeatBalance; functionName = this->sHookBeginZoneTimestepAfterInitHeatBalance; @@ -1340,7 +1340,7 @@ namespace PluginManagement { #if LINK_WITH_PYTHON == 1 void PluginManager::runSingleUserDefinedPlugin(EnergyPlusData &state, int index) { - plugins[index].run(state, DataGlobals::emsCallFromUserDefinedComponentModel); + plugins[index].run(state, DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel); } #else void PluginManager::runSingleUserDefinedPlugin(EnergyPlusData &EP_UNUSED(state), int EP_UNUSED(index)) diff --git a/src/EnergyPlus/PluginManager.hh b/src/EnergyPlus/PluginManager.hh index 40e9090a544..ead03f4897c 100644 --- a/src/EnergyPlus/PluginManager.hh +++ b/src/EnergyPlus/PluginManager.hh @@ -76,8 +76,8 @@ struct EnergyPlusData; namespace PluginManagement { - void registerNewCallback(EnergyPlusData &state, int iCalledFrom, const std::function& f); - void runAnyRegisteredCallbacks(EnergyPlusData &state, int iCalledFrom, bool &anyRan); + void registerNewCallback(EnergyPlusData &state, DataGlobalConstants::EMSCallFrom iCalledFrom, const std::function& f); + void runAnyRegisteredCallbacks(EnergyPlusData &state, DataGlobalConstants::EMSCallFrom iCalledFrom, bool &anyRan); void onBeginEnvironment(); std::string pythonStringForUsage(); @@ -108,7 +108,7 @@ namespace PluginManagement { // methods static void reportPythonError(); - bool run(EnergyPlusData &state, int iCallingPoint) const; // calls main() on this plugin instance + bool run(EnergyPlusData &state, DataGlobalConstants::EMSCallFrom iCallingPoint) const; // calls main() on this plugin instance // plugin calling point hooks const char * sHookBeginNewEnvironment = "on_begin_new_environment"; diff --git a/src/EnergyPlus/SimAirServingZones.cc b/src/EnergyPlus/SimAirServingZones.cc index 10c9925e89c..2952ff31c5c 100644 --- a/src/EnergyPlus/SimAirServingZones.cc +++ b/src/EnergyPlus/SimAirServingZones.cc @@ -7129,7 +7129,7 @@ namespace SimAirServingZones { // EMS calling point to customize system sizing results bool anyEMSRan; - ManageEMS(state, emsCallFromSystemSizing, anyEMSRan, ObjexxFCL::Optional_int_const()); + ManageEMS(state, DataGlobalConstants::EMSCallFrom::SystemSizing, anyEMSRan, ObjexxFCL::Optional_int_const()); // EMS override point if (AnyEnergyManagementSystemInModel) { diff --git a/src/EnergyPlus/SimulationManager.cc b/src/EnergyPlus/SimulationManager.cc index 52f589a8364..1c15a203df0 100644 --- a/src/EnergyPlus/SimulationManager.cc +++ b/src/EnergyPlus/SimulationManager.cc @@ -453,7 +453,7 @@ namespace SimulationManager { CreateEnergyReportStructure(); bool anyEMSRan; ManageEMS(state, - emsCallFromSetupSimulation, + DataGlobalConstants::EMSCallFrom::SetupSimulation, anyEMSRan, ObjexxFCL::Optional_int_const()); // point to finish setup processing EMS, sensor ready now @@ -544,7 +544,7 @@ namespace SimulationManager { HVACManager::ResetNodeData(); // Reset here, because some zone calcs rely on node data (e.g. ZoneITEquip) bool anyEMSRan; - ManageEMS(state, DataGlobals::emsCallFromBeginNewEvironment, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point + ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginNewEnvironment, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point while ((DayOfSim < NumOfDayInEnvrn) || (WarmupFlag)) { // Begin day loop ... if (state.dataGlobal->stopSimulation) break; diff --git a/src/EnergyPlus/UnitarySystem.cc b/src/EnergyPlus/UnitarySystem.cc index c32de0da716..915ff6297dd 100644 --- a/src/EnergyPlus/UnitarySystem.cc +++ b/src/EnergyPlus/UnitarySystem.cc @@ -1527,7 +1527,7 @@ namespace UnitarySystems { EqSizing.OAVolFlow = 0.0; // UnitarySys doesn't have OA bool anyEMSRan; - EMSManager::ManageEMS(state, DataGlobals::emsCallFromUnitarySystemSizing, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point + EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::UnitarySystemSizing, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point bool HardSizeNoDesRun; // Indicator to a hard-sized field with no design sizing data // Initiate all reporting variables @@ -7426,7 +7426,7 @@ namespace UnitarySystems { } // can this be called each time a system is gottem? bool anyEMSRan; - EMSManager::ManageEMS(state, DataGlobals::emsCallFromComponentGetInput, anyEMSRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::ComponentGetInput, anyEMSRan, ObjexxFCL::Optional_int_const()); } } } diff --git a/src/EnergyPlus/UserDefinedComponents.cc b/src/EnergyPlus/UserDefinedComponents.cc index f544decc120..abd3e3aff26 100644 --- a/src/EnergyPlus/UserDefinedComponents.cc +++ b/src/EnergyPlus/UserDefinedComponents.cc @@ -168,7 +168,7 @@ namespace UserDefinedComponents { if (thisLoop > 0) { if (this->Loop(thisLoop).ErlInitProgramMngr > 0) { EMSManager::ManageEMS( - state, DataGlobals::emsCallFromUserDefinedComponentModel, anyEMSRan, this->Loop(thisLoop).ErlInitProgramMngr); + state, DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, this->Loop(thisLoop).ErlInitProgramMngr); } else if (this->Loop(thisLoop).initPluginLocation > -1) { EnergyPlus::PluginManagement::pluginManager->runSingleUserDefinedPlugin(state, this->Loop(thisLoop).initPluginLocation); } @@ -238,14 +238,14 @@ namespace UserDefinedComponents { if (thisLoop > 0) { if (this->Loop(thisLoop).ErlSimProgramMngr > 0) { EMSManager::ManageEMS( - state, DataGlobals::emsCallFromUserDefinedComponentModel, anyEMSRan, this->Loop(thisLoop).ErlSimProgramMngr); + state, DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, this->Loop(thisLoop).ErlSimProgramMngr); } else if (this->Loop(thisLoop).simPluginLocation > -1) { EnergyPlus::PluginManagement::pluginManager->runSingleUserDefinedPlugin(state, this->Loop(thisLoop).simPluginLocation); } } if (this->ErlSimProgramMngr > 0) { - EMSManager::ManageEMS(state, DataGlobals::emsCallFromUserDefinedComponentModel, anyEMSRan, this->ErlSimProgramMngr); + EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, this->ErlSimProgramMngr); } else if (this->simPluginLocation > -1) { EnergyPlus::PluginManagement::pluginManager->runSingleUserDefinedPlugin(state, this->simPluginLocation); } @@ -299,7 +299,7 @@ namespace UserDefinedComponents { if (DataGlobals::BeginEnvrnFlag) { if (UserCoil(CompNum).ErlInitProgramMngr > 0) { EMSManager::ManageEMS( - state, DataGlobals::emsCallFromUserDefinedComponentModel, anyEMSRan, UserCoil(CompNum).ErlInitProgramMngr); + state, DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, UserCoil(CompNum).ErlInitProgramMngr); } else if (UserCoil(CompNum).initPluginLocation > -1) { EnergyPlus::PluginManagement::pluginManager->runSingleUserDefinedPlugin(state, UserCoil(CompNum).initPluginLocation); } @@ -322,7 +322,7 @@ namespace UserDefinedComponents { UserCoil(CompNum).initialize(state); if (UserCoil(CompNum).ErlSimProgramMngr > 0) { - EMSManager::ManageEMS(state, DataGlobals::emsCallFromUserDefinedComponentModel, anyEMSRan, UserCoil(CompNum).ErlSimProgramMngr); + EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, UserCoil(CompNum).ErlSimProgramMngr); } else if (UserCoil(CompNum).simPluginLocation > -1) { EnergyPlus::PluginManagement::pluginManager->runSingleUserDefinedPlugin(state, UserCoil(CompNum).simPluginLocation); } @@ -391,7 +391,7 @@ namespace UserDefinedComponents { if (UserZoneAirHVAC(CompNum).ErlInitProgramMngr > 0) { EMSManager::ManageEMS( - state, DataGlobals::emsCallFromUserDefinedComponentModel, anyEMSRan, UserZoneAirHVAC(CompNum).ErlInitProgramMngr); + state, DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, UserZoneAirHVAC(CompNum).ErlInitProgramMngr); } else if (UserZoneAirHVAC(CompNum).initPluginLocation > -1) { EnergyPlus::PluginManagement::pluginManager->runSingleUserDefinedPlugin(state, UserZoneAirHVAC(CompNum).initPluginLocation); } @@ -418,7 +418,7 @@ namespace UserDefinedComponents { if (UserZoneAirHVAC(CompNum).ErlSimProgramMngr > 0) { EMSManager::ManageEMS( - state, DataGlobals::emsCallFromUserDefinedComponentModel, anyEMSRan, UserZoneAirHVAC(CompNum).ErlSimProgramMngr); + state, DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, UserZoneAirHVAC(CompNum).ErlSimProgramMngr); } else if (UserZoneAirHVAC(CompNum).simPluginLocation > -1) { EnergyPlus::PluginManagement::pluginManager->runSingleUserDefinedPlugin(state, UserZoneAirHVAC(CompNum).simPluginLocation); } @@ -487,7 +487,7 @@ namespace UserDefinedComponents { if (UserAirTerminal(CompNum).ErlInitProgramMngr > 0) { EMSManager::ManageEMS( - state, DataGlobals::emsCallFromUserDefinedComponentModel, anyEMSRan, UserAirTerminal(CompNum).ErlInitProgramMngr); + state, DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, UserAirTerminal(CompNum).ErlInitProgramMngr); } else if (UserAirTerminal(CompNum).initPluginLocation > -1) { EnergyPlus::PluginManagement::pluginManager->runSingleUserDefinedPlugin(state, UserAirTerminal(CompNum).initPluginLocation); } @@ -514,7 +514,7 @@ namespace UserDefinedComponents { if (UserAirTerminal(CompNum).ErlSimProgramMngr > 0) { EMSManager::ManageEMS( - state, DataGlobals::emsCallFromUserDefinedComponentModel, anyEMSRan, UserAirTerminal(CompNum).ErlSimProgramMngr); + state, DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, UserAirTerminal(CompNum).ErlSimProgramMngr); } else if (UserAirTerminal(CompNum).simPluginLocation > -1) { EnergyPlus::PluginManagement::pluginManager->runSingleUserDefinedPlugin(state, UserAirTerminal(CompNum).simPluginLocation); } diff --git a/src/EnergyPlus/WeatherManager.cc b/src/EnergyPlus/WeatherManager.cc index d6eeeaa2031..16147313594 100644 --- a/src/EnergyPlus/WeatherManager.cc +++ b/src/EnergyPlus/WeatherManager.cc @@ -145,7 +145,7 @@ namespace WeatherManager { // Cannot call this during sizing, because EMS will not initialize properly until after simulation kickoff if (!DataGlobals::DoingSizing && !DataGlobals::KickOffSimulation) { EMSManager::ManageEMS( - state, DataGlobals::emsCallFromBeginZoneTimestepBeforeSetCurrentWeather, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point + state, DataGlobalConstants::EMSCallFrom::BeginZoneTimestepBeforeSetCurrentWeather, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point } SetCurrentWeather(state); diff --git a/src/EnergyPlus/ZoneEquipmentManager.cc b/src/EnergyPlus/ZoneEquipmentManager.cc index a60aa28f1f6..e1232da12e2 100644 --- a/src/EnergyPlus/ZoneEquipmentManager.cc +++ b/src/EnergyPlus/ZoneEquipmentManager.cc @@ -1425,7 +1425,6 @@ namespace ZoneEquipmentManager { using DataEnvironment::StdBaroPress; using DataEnvironment::StdRhoAir; using DataGlobals::AnyEnergyManagementSystemInModel; - using DataGlobals::emsCallFromZoneSizing; using DataGlobals::HourOfDay; using DataGlobals::isPulseZoneSizing; using DataGlobals::MinutesPerTimeStep; @@ -1786,7 +1785,7 @@ namespace ZoneEquipmentManager { // candidate EMS calling point to customize CalcFinalZoneSizing bool anyEMSRan; - ManageEMS(state, emsCallFromZoneSizing, anyEMSRan, ObjexxFCL::Optional_int_const()); + ManageEMS(state, DataGlobalConstants::EMSCallFrom::ZoneSizing, anyEMSRan, ObjexxFCL::Optional_int_const()); // now apply EMS overrides (if any) diff --git a/src/EnergyPlus/api/runtime.cc b/src/EnergyPlus/api/runtime.cc index eda0e6a022e..d3b763b9648 100644 --- a/src/EnergyPlus/api/runtime.cc +++ b/src/EnergyPlus/api/runtime.cc @@ -108,162 +108,162 @@ void registerExternalHVACManager(EnergyPlusState state, void (*f)(EnergyPlusStat void callbackBeginNewEnvironment(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromBeginNewEvironment, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeginNewEnvironment, f); } void callbackBeginNewEnvironment(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromBeginNewEvironment, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeginNewEnvironment, f); } void callbackBeginZoneTimestepBeforeSetCurrentWeather(EnergyPlusState state, std::function const& f) { auto* thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromBeginZoneTimestepBeforeSetCurrentWeather, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeginZoneTimestepBeforeSetCurrentWeather, f); } void callbackBeginZoneTimestepBeforeSetCurrentWeather(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto* thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromBeginZoneTimestepBeforeSetCurrentWeather, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeginZoneTimestepBeforeSetCurrentWeather, f); } void callbackAfterNewEnvironmentWarmupComplete(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromBeginNewEvironmentAfterWarmUp, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeginNewEnvironmentAfterWarmUp, f); } void callbackAfterNewEnvironmentWarmupComplete(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromBeginNewEvironmentAfterWarmUp, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeginNewEnvironmentAfterWarmUp, f); } void callbackBeginZoneTimeStepBeforeInitHeatBalance(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromBeginZoneTimestepBeforeInitHeatBalance, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeginZoneTimestepBeforeInitHeatBalance, f); } void callbackBeginZoneTimeStepBeforeInitHeatBalance(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromBeginZoneTimestepBeforeInitHeatBalance, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeginZoneTimestepBeforeInitHeatBalance, f); } void callbackBeginZoneTimeStepAfterInitHeatBalance(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromBeginZoneTimestepAfterInitHeatBalance, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeginZoneTimestepAfterInitHeatBalance, f); } void callbackBeginZoneTimeStepAfterInitHeatBalance(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromBeginZoneTimestepAfterInitHeatBalance, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeginZoneTimestepAfterInitHeatBalance, f); } void callbackBeginTimeStepBeforePredictor(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromBeginTimestepBeforePredictor, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeginTimestepBeforePredictor, f); } void callbackBeginTimeStepBeforePredictor(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromBeginTimestepBeforePredictor, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeginTimestepBeforePredictor, f); } void callbackAfterPredictorBeforeHVACManagers(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromBeforeHVACManagers, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeforeHVACManagers, f); } void callbackAfterPredictorBeforeHVACManagers(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromBeforeHVACManagers, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeforeHVACManagers, f); } void callbackAfterPredictorAfterHVACManagers(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromAfterHVACManagers, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::AfterHVACManagers, f); } void callbackAfterPredictorAfterHVACManagers(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromAfterHVACManagers, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::AfterHVACManagers, f); } void callbackInsideSystemIterationLoop(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromHVACIterationLoop, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::HVACIterationLoop, f); } void callbackInsideSystemIterationLoop(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromHVACIterationLoop, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::HVACIterationLoop, f); } void callbackEndOfZoneTimeStepBeforeZoneReporting(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromEndZoneTimestepBeforeZoneReporting, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::EndZoneTimestepBeforeZoneReporting, f); } void callbackEndOfZoneTimeStepBeforeZoneReporting(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromEndZoneTimestepBeforeZoneReporting, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::EndZoneTimestepBeforeZoneReporting, f); } void callbackEndOfZoneTimeStepAfterZoneReporting(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromEndZoneTimestepAfterZoneReporting, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::EndZoneTimestepAfterZoneReporting, f); } void callbackEndOfZoneTimeStepAfterZoneReporting(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromEndZoneTimestepAfterZoneReporting, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::EndZoneTimestepAfterZoneReporting, f); } void callbackEndOfSystemTimeStepBeforeHVACReporting(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromEndSystemTimestepBeforeHVACReporting, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::EndSystemTimestepBeforeHVACReporting, f); } void callbackEndOfSystemTimeStepBeforeHVACReporting(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromEndSystemTimestepBeforeHVACReporting, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::EndSystemTimestepBeforeHVACReporting, f); } void callbackEndOfSystemTimeStepAfterHVACReporting(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromEndSystemTimestepAfterHVACReporting, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::EndSystemTimestepAfterHVACReporting, f); } void callbackEndOfSystemTimeStepAfterHVACReporting(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromEndSystemTimestepAfterHVACReporting, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::EndSystemTimestepAfterHVACReporting, f); } void callbackEndOfZoneSizing(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromZoneSizing, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::ZoneSizing, f); } void callbackEndOfZoneSizing(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromZoneSizing, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::ZoneSizing, f); } void callbackEndOfSystemSizing(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromSystemSizing, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::SystemSizing, f); } void callbackEndOfSystemSizing(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromSystemSizing, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::SystemSizing, f); } void callbackEndOfAfterComponentGetInput(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromComponentGetInput, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::ComponentGetInput, f); } void callbackEndOfAfterComponentGetInput(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromComponentGetInput, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::ComponentGetInput, f); } //void callbackUserDefinedComponentModel(EnergyPlusState state, std::function f) { @@ -276,10 +276,10 @@ void callbackEndOfAfterComponentGetInput(EnergyPlusState state, void (*f)(Energy void callbackUnitarySystemSizing(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromUnitarySystemSizing, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::UnitarySystemSizing, f); } void callbackUnitarySystemSizing(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobals::emsCallFromUnitarySystemSizing, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::UnitarySystemSizing, f); } diff --git a/tst/EnergyPlus/unit/EMSManager.unit.cc b/tst/EnergyPlus/unit/EMSManager.unit.cc index 2ff1246a27f..d690ecd3610 100644 --- a/tst/EnergyPlus/unit/EMSManager.unit.cc +++ b/tst/EnergyPlus/unit/EMSManager.unit.cc @@ -165,9 +165,9 @@ TEST_F(EnergyPlusFixture, Dual_NodeTempSetpoints) EMSManager::FinishProcessingUserInput = true; bool anyRan; - EMSManager::ManageEMS(state, DataGlobals::emsCallFromSetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); - EMSManager::ManageEMS(state, DataGlobals::emsCallFromBeginNewEvironment, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginNewEnvironment, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_NEAR(DataLoopNode::Node(1).TempSetPointHi, 20.0, 0.000001); @@ -283,13 +283,13 @@ TEST_F(EnergyPlusFixture, SupervisoryControl_PlantComponent_SetActuatedBranchFlo bool anyRan; // set up EMS - EMSManager::ManageEMS(state, DataGlobals::emsCallFromSetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); // set dummy EMS value PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue = 1.0; // dummy value set above should be zero'd on this call since EMS 0's values on begin environment (whether EMS program runs on this call or not) - EMSManager::ManageEMS(state, DataGlobals::emsCallFromBeginNewEvironment, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginNewEnvironment, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_FALSE(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideOn); EXPECT_NEAR(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue, 0.0, 0.000001); @@ -319,7 +319,7 @@ TEST_F(EnergyPlusFixture, SupervisoryControl_PlantComponent_SetActuatedBranchFlo PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue = 1.0; // dummy value set above should remain on this call since EMS calling manager uses BeginTimestepBeforePredictor as the calling point - EMSManager::ManageEMS(state, DataGlobals::emsCallFromBeginNewEvironmentAfterWarmUp, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginNewEnvironmentAfterWarmUp, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_FALSE(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideOn); EXPECT_NEAR(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue, 1.0, 0.000001); @@ -344,7 +344,7 @@ TEST_F(EnergyPlusFixture, SupervisoryControl_PlantComponent_SetActuatedBranchFlo // dummy value set above should reset to 0 on this call since EMS calling manager uses BeginTimestepBeforePredictor as the calling point // override flag should also be true - EMSManager::ManageEMS(state, DataGlobals::emsCallFromBeginTimestepBeforePredictor, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginTimestepBeforePredictor, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_TRUE(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideOn); EXPECT_NEAR(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue, 0.0, 0.000001); @@ -447,12 +447,12 @@ TEST_F(EnergyPlusFixture, SupervisoryControl_PlantComponent_SetComponentFlowRate bool anyRan; // set up EMS - EMSManager::ManageEMS(state, DataGlobals::emsCallFromSetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); // set dummy EMS value PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue = 1.0; // dummy value set above should be zero'd on this call since EMS 0's values on begin environment (whether EMS program runs on this call or not) - EMSManager::ManageEMS(state, DataGlobals::emsCallFromBeginNewEvironment, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginNewEnvironment, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_FALSE(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideOn); EXPECT_NEAR(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue, 0.0, 0.000001); @@ -482,7 +482,7 @@ TEST_F(EnergyPlusFixture, SupervisoryControl_PlantComponent_SetComponentFlowRate PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue = 1.0; // dummy value set above should remain on this call since EMS calling manager uses BeginTimestepBeforePredictor as the calling point - EMSManager::ManageEMS(state, DataGlobals::emsCallFromBeginNewEvironmentAfterWarmUp, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginNewEnvironmentAfterWarmUp, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_FALSE(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideOn); EXPECT_NEAR(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue, 1.0, 0.000001); @@ -509,7 +509,7 @@ TEST_F(EnergyPlusFixture, SupervisoryControl_PlantComponent_SetComponentFlowRate // dummy value set above should reset to 0 on this call since EMS calling manager uses BeginTimestepBeforePredictor as the calling point // override flag should also be true - EMSManager::ManageEMS(state, DataGlobals::emsCallFromBeginTimestepBeforePredictor, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginTimestepBeforePredictor, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_TRUE(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideOn); EXPECT_NEAR(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue, 0.0, 0.000001); @@ -707,8 +707,8 @@ TEST_F(EnergyPlusFixture, Test_EMSLogic) EMSManager::CheckIfAnyEMS(state); EMSManager::FinishProcessingUserInput = true; bool anyRan; - EMSManager::ManageEMS(state, DataGlobals::emsCallFromSetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); - EMSManager::ManageEMS(state, DataGlobals::emsCallFromBeginNewEvironment, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginNewEnvironment, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_NEAR(DataLoopNode::Node(1).TempSetPoint, 11.0, 0.0000001); EXPECT_NEAR(DataLoopNode::Node(2).TempSetPoint, 12.0, 0.0000001); @@ -718,7 +718,7 @@ TEST_F(EnergyPlusFixture, Test_EMSLogic) EXPECT_NEAR(DataLoopNode::Node(6).TempSetPoint, 16.0, 0.0000001); EXPECT_NEAR(DataLoopNode::Node(7).TempSetPoint, 17.0, 0.0000001); - EMSManager::ManageEMS(state, DataGlobals::emsCallFromBeginTimestepBeforePredictor, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginTimestepBeforePredictor, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_NEAR(DataLoopNode::Node(1).TempSetPoint, 21.0, 0.0000001); EXPECT_NEAR(DataLoopNode::Node(2).TempSetPoint, 22.0, 0.0000001); @@ -775,8 +775,8 @@ TEST_F(EnergyPlusFixture, Debug_EMSLogic) EMSManager::CheckIfAnyEMS(state); EMSManager::FinishProcessingUserInput = true; bool anyRan; - EMSManager::ManageEMS(state, DataGlobals::emsCallFromSetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); - EMSManager::ManageEMS(state, DataGlobals::emsCallFromBeginNewEvironment, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginNewEnvironment, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_NEAR(DataLoopNode::Node(1).TempSetPoint, 1.0, 0.0000001); } @@ -815,13 +815,13 @@ TEST_F(EnergyPlusFixture, TestAnyRanArgument) EMSManager::FinishProcessingUserInput = true; bool anyRan; - EMSManager::ManageEMS(state, DataGlobals::emsCallFromSetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_FALSE(anyRan); - EMSManager::ManageEMS(state, DataGlobals::emsCallFromBeginNewEvironment, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginNewEnvironment, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_FALSE(anyRan); - EMSManager::ManageEMS(state, DataGlobals::emsCallFromHVACIterationLoop, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::HVACIterationLoop, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_TRUE(anyRan); } @@ -850,14 +850,14 @@ TEST_F(EnergyPlusFixture, TestUnInitializedEMSVariable1) EMSManager::CheckIfAnyEMS(state); EMSManager::FinishProcessingUserInput = true; bool anyRan; - EMSManager::ManageEMS(state, DataGlobals::emsCallFromSetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); // Find the variable in the list int internalVarNum = RuntimeLanguageProcessor::FindEMSVariable("TempSetpoint1", 0); ASSERT_GT(internalVarNum, 0); // Expect the variable to not yet be initialized EXPECT_FALSE(ErlVariable(internalVarNum).Value.initialized); // next run a small program that sets the value - EMSManager::ManageEMS(state, DataGlobals::emsCallFromBeginNewEvironment, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginNewEnvironment, anyRan, ObjexxFCL::Optional_int_const()); // check that it worked and the value came thru EXPECT_NEAR(ErlVariable(internalVarNum).Value.Number, 21.0, 0.0000001); // check of state to see if now initialized @@ -908,7 +908,7 @@ TEST_F(EnergyPlusFixture, TestUnInitializedEMSVariable2) EMSManager::CheckIfAnyEMS(state); EMSManager::FinishProcessingUserInput = true; bool anyRan; - EMSManager::ManageEMS(state, DataGlobals::emsCallFromSetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); // Expect the variable to not yet be initialized, call EvaluateExpresssion and check argument ErlValueType ReturnValue; @@ -920,7 +920,7 @@ TEST_F(EnergyPlusFixture, TestUnInitializedEMSVariable2) EXPECT_TRUE(seriousErrorFound); // next run a small program that sets the global variable value - EMSManager::ManageEMS(state, DataGlobals::emsCallFromBeginTimestepBeforePredictor, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginTimestepBeforePredictor, anyRan, ObjexxFCL::Optional_int_const()); // now check that it worked, should stay false seriousErrorFound = false; ReturnValue = RuntimeLanguageProcessor::EvaluateExpression(state, @@ -1091,7 +1091,7 @@ TEST_F(EnergyPlusFixture, EMSManager_TestFuntionCall) EXPECT_FALSE(ErrorsFound); bool anyRan; - EMSManager::ManageEMS(state, DataGlobals::emsCallFromHVACIterationLoop, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::HVACIterationLoop, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_TRUE(anyRan); for (int i = 1; i <= 6; ++i) { @@ -1102,7 +1102,7 @@ TEST_F(EnergyPlusFixture, EMSManager_TestFuntionCall) } EMSManager::ManageEMS(state, - DataGlobals::emsCallFromHVACIterationLoop, + DataGlobalConstants::EMSCallFrom::HVACIterationLoop, anyRan, ObjexxFCL::Optional_int_const()); // process trend functions again using above data EXPECT_TRUE(anyRan); diff --git a/tst/EnergyPlus/unit/HVACFan.unit.cc b/tst/EnergyPlus/unit/HVACFan.unit.cc index 7941940ed52..0d5d4e34c8e 100644 --- a/tst/EnergyPlus/unit/HVACFan.unit.cc +++ b/tst/EnergyPlus/unit/HVACFan.unit.cc @@ -630,8 +630,8 @@ TEST_F(EnergyPlusFixture, SystemFanObj_DiscreteMode_EMSPressureRiseResetTest) // reset the pressure rise to -100.0 using EMS program bool anyRan(false); - EMSManager::ManageEMS(state, DataGlobals::emsCallFromSetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); - EMSManager::ManageEMS(state, DataGlobals::emsCallFromBeginTimestepBeforePredictor, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginTimestepBeforePredictor, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_TRUE(anyRan); // simulate the fan with -100.0 Pa fan pressure rise HVACFan::fanObjs[0]->simulate(state, _, _, _, _, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); diff --git a/tst/EnergyPlus/unit/NodeInputManager.unit.cc b/tst/EnergyPlus/unit/NodeInputManager.unit.cc index aba500802cc..9a924dccb5c 100644 --- a/tst/EnergyPlus/unit/NodeInputManager.unit.cc +++ b/tst/EnergyPlus/unit/NodeInputManager.unit.cc @@ -104,7 +104,7 @@ TEST_F(EnergyPlusFixture, NodeMoreInfoEMSsensorCheck1) EMSManager::FinishProcessingUserInput = true; bool anyEMSRan; - EMSManager::ManageEMS(state, DataGlobals::emsCallFromSetupSimulation, anyEMSRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::SetupSimulation, anyEMSRan, ObjexxFCL::Optional_int_const()); DataLoopNode::Node(1).Temp = 20.0; DataLoopNode::Node(1).HumRat = 0.01; diff --git a/tst/EnergyPlus/unit/api/datatransfer.unit.cc b/tst/EnergyPlus/unit/api/datatransfer.unit.cc index 2ff5ae716f7..298f918c7a3 100644 --- a/tst/EnergyPlus/unit/api/datatransfer.unit.cc +++ b/tst/EnergyPlus/unit/api/datatransfer.unit.cc @@ -662,7 +662,7 @@ TEST_F(DataExchangeAPIUnitTestFixture, DataTransfer_Python_EMS_Override) EMSManager::FinishProcessingUserInput = true; bool anyRan; // Calls SetupNodeSetpointsAsActuator (via InitEMS, which calls GetEMSInput too) - EMSManager::ManageEMS(state, DataGlobals::emsCallFromSetupSimulation, anyRan); + EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::SetupSimulation, anyRan); EXPECT_GT(EnergyPlus::DataRuntimeLanguage::numEMSActuatorsAvailable, 0); EXPECT_EQ(1, DataRuntimeLanguage::numActuatorsUsed); @@ -707,7 +707,7 @@ TEST_F(DataExchangeAPIUnitTestFixture, DataTransfer_Python_Python_Override) EMSManager::FinishProcessingUserInput = true; bool anyRan; // Calls SetupNodeSetpointsAsActuator (via InitEMS, which calls GetEMSInput too) - EMSManager::ManageEMS(state, DataGlobals::emsCallFromSetupSimulation, anyRan); + EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::SetupSimulation, anyRan); EXPECT_GT(EnergyPlus::DataRuntimeLanguage::numEMSActuatorsAvailable, 0); EXPECT_EQ(0, DataRuntimeLanguage::numActuatorsUsed); From 2d501c833e51cca6d590e1e3ce9bf41ab9272679 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Sun, 11 Oct 2020 12:20:37 -0600 Subject: [PATCH 08/15] move EvapCoolerType ints to enum and move from DataGlobalConstants to EvaporativeCoolers --- src/EnergyPlus/DataGlobalConstants.cc | 16 --- src/EnergyPlus/DataGlobalConstants.hh | 8 +- src/EnergyPlus/EvaporativeCoolers.cc | 102 +++++++++--------- src/EnergyPlus/EvaporativeCoolers.hh | 21 +++- .../unit/EvaporativeCoolers.unit.cc | 9 +- 5 files changed, 72 insertions(+), 84 deletions(-) diff --git a/src/EnergyPlus/DataGlobalConstants.cc b/src/EnergyPlus/DataGlobalConstants.cc index f1c29ccbb00..242a70f97ba 100644 --- a/src/EnergyPlus/DataGlobalConstants.cc +++ b/src/EnergyPlus/DataGlobalConstants.cc @@ -303,22 +303,6 @@ namespace DataGlobalConstants { int const iGeneratorWindTurbine(7); int const iGeneratorPVWatts(8); - int const iEvapCoolerDirectCELDEKPAD(1001); - int const iEvapCoolerInDirectCELDEKPAD(1002); - int const iEvapCoolerInDirectWETCOIL(1003); - int const iEvapCoolerInDirectRDDSpecial(1004); - int const iEvapCoolerDirectResearchSpecial(1005); - - // DERIVED TYPE DEFINITIONS: - // na - - // MODULE VARIABLE DECLARATIONS: - // na - - // SUBROUTINE SPECIFICATIONS FOR MODULE DataGlobalConstants - - // Functions - int AssignResourceTypeNum(std::string const &ResourceTypeChar) { diff --git a/src/EnergyPlus/DataGlobalConstants.hh b/src/EnergyPlus/DataGlobalConstants.hh index 1de0887d793..8b88b5d47ce 100644 --- a/src/EnergyPlus/DataGlobalConstants.hh +++ b/src/EnergyPlus/DataGlobalConstants.hh @@ -233,12 +233,6 @@ namespace DataGlobalConstants { extern int const iGeneratorWindTurbine; extern int const iGeneratorPVWatts; - extern int const iEvapCoolerDirectCELDEKPAD; - extern int const iEvapCoolerInDirectCELDEKPAD; - extern int const iEvapCoolerInDirectWETCOIL; - extern int const iEvapCoolerInDirectRDDSpecial; - extern int const iEvapCoolerDirectResearchSpecial; - enum class CallIndicator { BeginDay, DuringDay, @@ -286,7 +280,7 @@ namespace DataGlobalConstants { Real64 constexpr MaxEXPArg () { return 709.78; } // maximum exponent in EXP() function Real64 constexpr Pi () { return 3.14159265358979324; } // Pi 3.1415926535897932384626435 Real64 constexpr PiOvr2 () { return Pi() / 2.0; } // Pi/2 - Real64 constexpr TwoPi () { return 2.0 * Pi(); } // 2*Pi 6.2831853071795864769252868r + Real64 constexpr TwoPi () { return 2.0 * Pi(); } // 2*Pi 6.2831853071795864769252868 Real64 constexpr GravityConstant () { return 9.807; } Real64 constexpr DegToRadians () { return Pi() / 180.0; } // Conversion for Degrees to Radians Real64 constexpr RadToDeg () { return 180.0 / Pi(); } // Conversion for Radians to Degrees diff --git a/src/EnergyPlus/EvaporativeCoolers.cc b/src/EnergyPlus/EvaporativeCoolers.cc index 236aecd2b6e..97b612262b8 100644 --- a/src/EnergyPlus/EvaporativeCoolers.cc +++ b/src/EnergyPlus/EvaporativeCoolers.cc @@ -249,16 +249,16 @@ namespace EvaporativeCoolers { { auto const SELECT_CASE_var(EvapCond(EvapCoolNum).EvapCoolerType); - if (SELECT_CASE_var == iEvapCoolerDirectCELDEKPAD) { + if (SELECT_CASE_var == EvapCoolerType::DirectCELDEKPAD) { CalcDirectEvapCooler(EvapCoolNum, ZoneEvapCoolerPLR); - } else if (SELECT_CASE_var == iEvapCoolerInDirectCELDEKPAD) { + } else if (SELECT_CASE_var == EvapCoolerType::InDirectCELDEKPAD) { CalcDryIndirectEvapCooler(EvapCoolNum, ZoneEvapCoolerPLR); - } else if (SELECT_CASE_var == iEvapCoolerInDirectWETCOIL) { + } else if (SELECT_CASE_var == EvapCoolerType::InDirectWETCOIL) { CalcWetIndirectEvapCooler(EvapCoolNum, ZoneEvapCoolerPLR); - } else if (SELECT_CASE_var == iEvapCoolerInDirectRDDSpecial) { + } else if (SELECT_CASE_var == EvapCoolerType::InDirectRDDSpecial) { CalcResearchSpecialPartLoad(state, EvapCoolNum); CalcIndirectResearchSpecialEvapCooler(state, EvapCoolNum, ZoneEvapCoolerPLR); - } else if (SELECT_CASE_var == iEvapCoolerDirectResearchSpecial) { + } else if (SELECT_CASE_var == EvapCoolerType::DirectResearchSpecial) { CalcResearchSpecialPartLoad(state, EvapCoolNum); CalcDirectResearchSpecialEvapCooler(state, EvapCoolNum, ZoneEvapCoolerPLR); } @@ -345,7 +345,7 @@ namespace EvaporativeCoolers { cNumericFieldNames); GlobalNames::VerifyUniqueInterObjectName(UniqueEvapCondNames, cAlphaArgs(1), cCurrentModuleObject, cAlphaFieldNames(1), ErrorsFound); EvapCond(EvapCoolNum).EvapCoolerName = cAlphaArgs(1); - EvapCond(EvapCoolNum).EvapCoolerType = iEvapCoolerDirectCELDEKPAD; + EvapCond(EvapCoolNum).EvapCoolerType = EvapCoolerType::DirectCELDEKPAD; EvapCond(EvapCoolNum).Schedule = cAlphaArgs(2); if (lAlphaFieldBlanks(2)) { @@ -418,7 +418,7 @@ namespace EvaporativeCoolers { cNumericFieldNames); GlobalNames::VerifyUniqueInterObjectName(UniqueEvapCondNames, cAlphaArgs(1), cCurrentModuleObject, cAlphaFieldNames(1), ErrorsFound); EvapCond(EvapCoolNum).EvapCoolerName = cAlphaArgs(1); - EvapCond(EvapCoolNum).EvapCoolerType = iEvapCoolerInDirectCELDEKPAD; //'EvaporativeCooler:Indirect:CelDekPad' + EvapCond(EvapCoolNum).EvapCoolerType = EvapCoolerType::InDirectCELDEKPAD; //'EvaporativeCooler:Indirect:CelDekPad' EvapCond(EvapCoolNum).Schedule = cAlphaArgs(2); if (lAlphaFieldBlanks(2)) { @@ -521,7 +521,7 @@ namespace EvaporativeCoolers { cNumericFieldNames); GlobalNames::VerifyUniqueInterObjectName(UniqueEvapCondNames, cAlphaArgs(1), cCurrentModuleObject, cAlphaFieldNames(1), ErrorsFound); EvapCond(EvapCoolNum).EvapCoolerName = cAlphaArgs(1); - EvapCond(EvapCoolNum).EvapCoolerType = iEvapCoolerInDirectWETCOIL; //'EvaporativeCooler:Indirect:WetCoil' + EvapCond(EvapCoolNum).EvapCoolerType = EvapCoolerType::InDirectWETCOIL; //'EvaporativeCooler:Indirect:WetCoil' EvapCond(EvapCoolNum).Schedule = cAlphaArgs(2); if (lAlphaFieldBlanks(2)) { @@ -615,7 +615,7 @@ namespace EvaporativeCoolers { cNumericFieldNames); GlobalNames::VerifyUniqueInterObjectName(UniqueEvapCondNames, cAlphaArgs(1), cCurrentModuleObject, cAlphaFieldNames(1), ErrorsFound); EvapCond(EvapCoolNum).EvapCoolerName = cAlphaArgs(1); - EvapCond(EvapCoolNum).EvapCoolerType = iEvapCoolerInDirectRDDSpecial; //'EvaporativeCooler:Indirect:ResearchSpecial' + EvapCond(EvapCoolNum).EvapCoolerType = EvapCoolerType::InDirectRDDSpecial; //'EvaporativeCooler:Indirect:ResearchSpecial' EvapCond(EvapCoolNum).Schedule = cAlphaArgs(2); if (lAlphaFieldBlanks(2)) { @@ -757,7 +757,7 @@ namespace EvaporativeCoolers { cNumericFieldNames); GlobalNames::VerifyUniqueInterObjectName(UniqueEvapCondNames, cAlphaArgs(1), cCurrentModuleObject, cAlphaFieldNames(1), ErrorsFound); EvapCond(EvapCoolNum).EvapCoolerName = cAlphaArgs(1); - EvapCond(EvapCoolNum).EvapCoolerType = iEvapCoolerDirectResearchSpecial; + EvapCond(EvapCoolNum).EvapCoolerType = EvapCoolerType::DirectResearchSpecial; EvapCond(EvapCoolNum).Schedule = cAlphaArgs(2); if (lAlphaFieldBlanks(2)) { @@ -980,8 +980,8 @@ namespace EvaporativeCoolers { for (EvapUnitNum = 1; EvapUnitNum <= NumEvapCool; ++EvapUnitNum) { // only check evap coolers that are supposed to have a control node - if ((EvapCond(EvapCoolNum).EvapCoolerType != iEvapCoolerInDirectRDDSpecial) && - (EvapCond(EvapCoolNum).EvapCoolerType != iEvapCoolerDirectResearchSpecial)) + if ((EvapCond(EvapCoolNum).EvapCoolerType != EvapCoolerType::InDirectRDDSpecial) && + (EvapCond(EvapCoolNum).EvapCoolerType != EvapCoolerType::DirectResearchSpecial)) continue; ControlNode = EvapCond(EvapUnitNum).EvapControlNodeNum; @@ -1162,15 +1162,15 @@ namespace EvaporativeCoolers { { auto const SELECT_CASE_var(EvapCond(EvapCoolNum).EvapCoolerType); - if (SELECT_CASE_var == iEvapCoolerInDirectCELDEKPAD) { + if (SELECT_CASE_var == EvapCoolerType::InDirectCELDEKPAD) { CompType = "EvaporativeCooler:Indirect:CelDekPad"; - } else if (SELECT_CASE_var == iEvapCoolerInDirectWETCOIL) { + } else if (SELECT_CASE_var == EvapCoolerType::InDirectWETCOIL) { CompType = "EvaporativeCooler:Indirect:WetCoil"; - } else if (SELECT_CASE_var == iEvapCoolerInDirectRDDSpecial) { + } else if (SELECT_CASE_var == EvapCoolerType::InDirectRDDSpecial) { CompType = "EvaporativeCooler:Indirect:ResearchSpecial"; - } else if (SELECT_CASE_var == iEvapCoolerDirectResearchSpecial) { + } else if (SELECT_CASE_var == EvapCoolerType::DirectResearchSpecial) { CompType = "EvaporativeCooler:Direct:ResearchSpecial"; - } else if (SELECT_CASE_var == iEvapCoolerDirectCELDEKPAD) { + } else if (SELECT_CASE_var == EvapCoolerType::DirectCELDEKPAD) { CompType = "EvaporativeCooler:Direct:CelDekPad"; } } @@ -1202,9 +1202,9 @@ namespace EvaporativeCoolers { if (CurSysNum > 0) { // central system if (!IsAutoSize && !SizingDesRunThisAirSys) { if (EvapCond(EvapCoolNum).IndirectVolFlowRate > 0.0) { - if (EvapCond(EvapCoolNum).EvapCoolerType == iEvapCoolerInDirectCELDEKPAD || - EvapCond(EvapCoolNum).EvapCoolerType == iEvapCoolerInDirectWETCOIL || - EvapCond(EvapCoolNum).EvapCoolerType == iEvapCoolerInDirectRDDSpecial) { + if (EvapCond(EvapCoolNum).EvapCoolerType == EvapCoolerType::InDirectCELDEKPAD || + EvapCond(EvapCoolNum).EvapCoolerType == EvapCoolerType::InDirectWETCOIL || + EvapCond(EvapCoolNum).EvapCoolerType == EvapCoolerType::InDirectRDDSpecial) { BaseSizer::reportSizerOutput(CompType, EvapCond(EvapCoolNum).EvapCoolerName, "User-Specified Secondary Fan Flow Rate [m3/s]", @@ -1219,7 +1219,7 @@ namespace EvaporativeCoolers { IndirectVolFlowRateDes = max(FinalSysSizing(CurSysNum).DesOutAirVolFlow, 0.5 * FinalSysSizing(CurSysNum).DesMainVolFlow); } // apply scaling factor the secondary air fan flow rate - if (EvapCond(EvapCoolNum).EvapCoolerType == iEvapCoolerInDirectRDDSpecial) { + if (EvapCond(EvapCoolNum).EvapCoolerType == EvapCoolerType::InDirectRDDSpecial) { IndirectVolFlowRateDes = IndirectVolFlowRateDes * EvapCond(EvapCoolNum).IndirectVolFlowScalingFactor; } } @@ -1227,9 +1227,9 @@ namespace EvaporativeCoolers { if (!IsAutoSize && !SizingDesRunThisAirSys) { if (EvapCond(EvapCoolNum).IndirectVolFlowRate > 0.0) { // report for the indirect evap cooler types only - if (EvapCond(EvapCoolNum).EvapCoolerType == iEvapCoolerInDirectCELDEKPAD || - EvapCond(EvapCoolNum).EvapCoolerType == iEvapCoolerInDirectWETCOIL || - EvapCond(EvapCoolNum).EvapCoolerType == iEvapCoolerInDirectRDDSpecial) { + if (EvapCond(EvapCoolNum).EvapCoolerType == EvapCoolerType::InDirectCELDEKPAD || + EvapCond(EvapCoolNum).EvapCoolerType == EvapCoolerType::InDirectWETCOIL || + EvapCond(EvapCoolNum).EvapCoolerType == EvapCoolerType::InDirectRDDSpecial) { BaseSizer::reportSizerOutput(CompType, EvapCond(EvapCoolNum).EvapCoolerName, "User-Specified Secondary Fan Flow Rate [m3/s]", @@ -1240,7 +1240,7 @@ namespace EvaporativeCoolers { // zone equip evap coolers IndirectVolFlowRateDes = FinalZoneSizing(CurZoneEqNum).DesCoolVolFlow; // apply scaling factor the secondary air fan flow rate - if (EvapCond(EvapCoolNum).EvapCoolerType == iEvapCoolerInDirectRDDSpecial) { + if (EvapCond(EvapCoolNum).EvapCoolerType == EvapCoolerType::InDirectRDDSpecial) { IndirectVolFlowRateDes = IndirectVolFlowRateDes * EvapCond(EvapCoolNum).IndirectVolFlowScalingFactor; } } @@ -1250,9 +1250,9 @@ namespace EvaporativeCoolers { if (!HardSizeNoDesRun) { if (IsAutoSize) { EvapCond(EvapCoolNum).IndirectVolFlowRate = IndirectVolFlowRateDes; - if (EvapCond(EvapCoolNum).EvapCoolerType == iEvapCoolerInDirectCELDEKPAD || - EvapCond(EvapCoolNum).EvapCoolerType == iEvapCoolerInDirectWETCOIL || - EvapCond(EvapCoolNum).EvapCoolerType == iEvapCoolerInDirectRDDSpecial) { + if (EvapCond(EvapCoolNum).EvapCoolerType == EvapCoolerType::InDirectCELDEKPAD || + EvapCond(EvapCoolNum).EvapCoolerType == EvapCoolerType::InDirectWETCOIL || + EvapCond(EvapCoolNum).EvapCoolerType == EvapCoolerType::InDirectRDDSpecial) { BaseSizer::reportSizerOutput(CompType, EvapCond(EvapCoolNum).EvapCoolerName, "Design Size Secondary Fan Flow Rate [m3/s]", @@ -1326,7 +1326,7 @@ namespace EvaporativeCoolers { if (IsAutoSize) { EvapCond(EvapCoolNum).DesVolFlowRate = volFlowRateDes; // only these two evap coolers has primary air design flow rate - if (EvapCond(EvapCoolNum).EvapCoolerType == iEvapCoolerInDirectRDDSpecial) { + if (EvapCond(EvapCoolNum).EvapCoolerType == EvapCoolerType::InDirectRDDSpecial) { BaseSizer::reportSizerOutput("EvaporativeCooler:Indirect:ResearchSpecial", EvapCond(EvapCoolNum).EvapCoolerName, "Primary Air Design Flow Rate [m3/s]", @@ -1335,7 +1335,7 @@ namespace EvaporativeCoolers { EvapCond(EvapCoolNum).EvapCoolerName, "Secondary Air Design Flow Rate [m3/s]", EvapCond(EvapCoolNum).IndirectVolFlowRate); - } else if (EvapCond(EvapCoolNum).EvapCoolerType == iEvapCoolerDirectResearchSpecial) { + } else if (EvapCond(EvapCoolNum).EvapCoolerType == EvapCoolerType::DirectResearchSpecial) { BaseSizer::reportSizerOutput("EvaporativeCooler:Direct:ResearchSpecial", EvapCond(EvapCoolNum).EvapCoolerName, "Primary Air Design Flow Rate [m3/s]", @@ -1361,7 +1361,7 @@ namespace EvaporativeCoolers { } } - if (EvapCond(EvapCoolNum).EvapCoolerType == iEvapCoolerDirectCELDEKPAD) { + if (EvapCond(EvapCoolNum).EvapCoolerType == EvapCoolerType::DirectCELDEKPAD) { IsAutoSize = false; if (EvapCond(EvapCoolNum).PadArea == AutoSize) { IsAutoSize = true; @@ -1480,7 +1480,7 @@ namespace EvaporativeCoolers { } } - if (EvapCond(EvapCoolNum).EvapCoolerType == iEvapCoolerInDirectCELDEKPAD) { + if (EvapCond(EvapCoolNum).EvapCoolerType == EvapCoolerType::InDirectCELDEKPAD) { IsAutoSize = false; if (EvapCond(EvapCoolNum).IndirectPadArea == AutoSize) { @@ -1609,7 +1609,7 @@ namespace EvaporativeCoolers { } } - if (EvapCond(EvapCoolNum).EvapCoolerType == iEvapCoolerInDirectRDDSpecial) { + if (EvapCond(EvapCoolNum).EvapCoolerType == EvapCoolerType::InDirectRDDSpecial) { // secondary air fan sizing: Secondary flow Rate (m3/s) * Fan Flow Sizing Factor (W/(m3/s) if (EvapCond(EvapCoolNum).IndirectFanPower == AutoSize) { EvapCond(EvapCoolNum).IndirectFanPower = EvapCond(EvapCoolNum).IndirectVolFlowRate * EvapCond(EvapCoolNum).FanSizingSpecificPower; @@ -1629,7 +1629,7 @@ namespace EvaporativeCoolers { } } - if (EvapCond(EvapCoolNum).EvapCoolerType == iEvapCoolerDirectResearchSpecial) { + if (EvapCond(EvapCoolNum).EvapCoolerType == EvapCoolerType::DirectResearchSpecial) { // recirculating water pump sizing: Primary Air Design flow Rate (m3/s) * Pump Sizing Factor (W/(m3/s) if (EvapCond(EvapCoolNum).RecircPumpPower == AutoSize) { EvapCond(EvapCoolNum).RecircPumpPower = EvapCond(EvapCoolNum).DesVolFlowRate * EvapCond(EvapCoolNum).RecircPumpSizingFactor; @@ -2149,7 +2149,7 @@ namespace EvaporativeCoolers { EvapCond(EvapCoolNum).PartLoadFract = 1.0; { auto const SELECT_CASE_var(EvapCond(EvapCoolNum).EvapCoolerType); - if (SELECT_CASE_var == iEvapCoolerInDirectRDDSpecial) { + if (SELECT_CASE_var == EvapCoolerType::InDirectRDDSpecial) { CalcIndirectResearchSpecialEvapCooler(state, EvapCoolNum); UpdateEvapCooler(EvapCoolNum); FullOutput = Node(InletNode).MassFlowRate * (PsyHFnTdbW(Node(OutletNode).Temp, Node(InletNode).HumRat) - @@ -2161,7 +2161,7 @@ namespace EvaporativeCoolers { // now reinit after test call InitEvapCooler(EvapCoolNum); - } else if (SELECT_CASE_var == iEvapCoolerDirectResearchSpecial) { + } else if (SELECT_CASE_var == EvapCoolerType::DirectResearchSpecial) { CalcDirectResearchSpecialEvapCooler(state, EvapCoolNum); UpdateEvapCooler(EvapCoolNum); FullOutput = Node(OutletNode).Temp - Node(InletNode).Temp; @@ -3483,7 +3483,7 @@ namespace EvaporativeCoolers { if (EvapCond(EvapCoolNum).SecondaryOutletNode > 0) { // set outlet nodes of the secondary air side of the EvapCooler (mass Flow Rate Only) - if (EvapCond(EvapCoolNum).EvapCoolerType == iEvapCoolerInDirectRDDSpecial && EvapCond(EvapCoolNum).EvapCoolerOperationControlFlag) { + if (EvapCond(EvapCoolNum).EvapCoolerType == EvapCoolerType::InDirectRDDSpecial && EvapCond(EvapCoolNum).EvapCoolerOperationControlFlag) { Node(OutletNodeSec).Temp = EvapCond(EvapCoolNum).SecOutletTemp; Node(OutletNodeSec).HumRat = EvapCond(EvapCoolNum).SecOutletHumRat; Node(OutletNodeSec).Enthalpy = EvapCond(EvapCoolNum).SecOutletEnthalpy; @@ -3850,19 +3850,19 @@ namespace EvaporativeCoolers { if (SELECT_CASE_var == "EVAPORATIVECOOLER:DIRECT:CELDEKPAD") { ZoneEvapUnit(UnitLoop).EvapCooler_1_ObjectClassName = "EvaporativeCooler:Direct:CelDekPad"; - ZoneEvapUnit(UnitLoop).EvapCooler_1_Type_Num = iEvapCoolerDirectCELDEKPAD; + ZoneEvapUnit(UnitLoop).EvapCooler_1_Type_Num = EvapCoolerType::DirectCELDEKPAD; } else if (SELECT_CASE_var == "EVAPORATIVECOOLER:DIRECT:RESEARCHSPECIAL") { ZoneEvapUnit(UnitLoop).EvapCooler_1_ObjectClassName = "EvaporativeCooler:Direct:ResearchSpecial"; - ZoneEvapUnit(UnitLoop).EvapCooler_1_Type_Num = iEvapCoolerDirectResearchSpecial; + ZoneEvapUnit(UnitLoop).EvapCooler_1_Type_Num = EvapCoolerType::DirectResearchSpecial; } else if (SELECT_CASE_var == "EVAPORATIVECOOLER:INDIRECT:CELDEKPAD") { ZoneEvapUnit(UnitLoop).EvapCooler_1_ObjectClassName = "EvaporativeCooler:Indirect:CelDekPad"; - ZoneEvapUnit(UnitLoop).EvapCooler_1_Type_Num = iEvapCoolerInDirectCELDEKPAD; + ZoneEvapUnit(UnitLoop).EvapCooler_1_Type_Num = EvapCoolerType::InDirectCELDEKPAD; } else if (SELECT_CASE_var == "EVAPORATIVECOOLER:INDIRECT:WETCOIL") { ZoneEvapUnit(UnitLoop).EvapCooler_1_ObjectClassName = "EvaporativeCooler:Indirect:WetCoil"; - ZoneEvapUnit(UnitLoop).EvapCooler_1_Type_Num = iEvapCoolerInDirectWETCOIL; + ZoneEvapUnit(UnitLoop).EvapCooler_1_Type_Num = EvapCoolerType::InDirectWETCOIL; } else if (SELECT_CASE_var == "EVAPORATIVECOOLER:INDIRECT:RESEARCHSPECIAL") { ZoneEvapUnit(UnitLoop).EvapCooler_1_ObjectClassName = "EvaporativeCooler:Indirect:ResearchSpecial"; - ZoneEvapUnit(UnitLoop).EvapCooler_1_Type_Num = iEvapCoolerInDirectRDDSpecial; + ZoneEvapUnit(UnitLoop).EvapCooler_1_Type_Num = EvapCoolerType::InDirectRDDSpecial; } else { ShowSevereError(CurrentModuleObject + "=\"" + ZoneEvapUnit(UnitLoop).Name + "\" invalid data."); ShowContinueError("invalid choice found " + cAlphaFields(11) + "=\"" + Alphas(11) + "\"."); @@ -3884,19 +3884,19 @@ namespace EvaporativeCoolers { if (SELECT_CASE_var == "EVAPORATIVECOOLER:DIRECT:CELDEKPAD") { ZoneEvapUnit(UnitLoop).EvapCooler_2_ObjectClassName = "EvaporativeCooler:Direct:CelDekPad"; - ZoneEvapUnit(UnitLoop).EvapCooler_2_Type_Num = iEvapCoolerDirectCELDEKPAD; + ZoneEvapUnit(UnitLoop).EvapCooler_2_Type_Num = EvapCoolerType::DirectCELDEKPAD; } else if (SELECT_CASE_var == "EVAPORATIVECOOLER:DIRECT:RESEARCHSPECIAL") { ZoneEvapUnit(UnitLoop).EvapCooler_2_ObjectClassName = "EvaporativeCooler:Direct:ResearchSpecial"; - ZoneEvapUnit(UnitLoop).EvapCooler_2_Type_Num = iEvapCoolerDirectResearchSpecial; + ZoneEvapUnit(UnitLoop).EvapCooler_2_Type_Num = EvapCoolerType::DirectResearchSpecial; } else if (SELECT_CASE_var == "EVAPORATIVECOOLER:INDIRECT:CELDEKPAD") { ZoneEvapUnit(UnitLoop).EvapCooler_2_ObjectClassName = "EvaporativeCooler:Indirect:CelDekPad"; - ZoneEvapUnit(UnitLoop).EvapCooler_2_Type_Num = iEvapCoolerInDirectCELDEKPAD; + ZoneEvapUnit(UnitLoop).EvapCooler_2_Type_Num = EvapCoolerType::InDirectCELDEKPAD; } else if (SELECT_CASE_var == "EVAPORATIVECOOLER:INDIRECT:WETCOIL") { ZoneEvapUnit(UnitLoop).EvapCooler_2_ObjectClassName = "EvaporativeCooler:Indirect:WetCoil"; - ZoneEvapUnit(UnitLoop).EvapCooler_2_Type_Num = iEvapCoolerInDirectWETCOIL; + ZoneEvapUnit(UnitLoop).EvapCooler_2_Type_Num = EvapCoolerType::InDirectWETCOIL; } else if (SELECT_CASE_var == "EVAPORATIVECOOLER:INDIRECT:RESEARCHSPECIAL") { ZoneEvapUnit(UnitLoop).EvapCooler_2_ObjectClassName = "EvaporativeCooler:Indirect:ResearchSpecial"; - ZoneEvapUnit(UnitLoop).EvapCooler_2_Type_Num = iEvapCoolerInDirectRDDSpecial; + ZoneEvapUnit(UnitLoop).EvapCooler_2_Type_Num = EvapCoolerType::InDirectRDDSpecial; } else { ShowSevereError(CurrentModuleObject + "=\"" + ZoneEvapUnit(UnitLoop).Name + "\" invalid data."); ShowContinueError("invalid choice found " + cAlphaFields(13) + "=\"" + Alphas(13) + "\"."); @@ -4236,14 +4236,14 @@ namespace EvaporativeCoolers { ZoneEvapUnit(UnitNum).FanAvailStatus = 0.0; // place default cold setpoints on control nodes of select evap coolers - if ((ZoneEvapUnit(UnitNum).EvapCooler_1_Type_Num == iEvapCoolerDirectResearchSpecial) || - (ZoneEvapUnit(UnitNum).EvapCooler_1_Type_Num == iEvapCoolerInDirectRDDSpecial)) { + if ((ZoneEvapUnit(UnitNum).EvapCooler_1_Type_Num == EvapCoolerType::DirectResearchSpecial) || + (ZoneEvapUnit(UnitNum).EvapCooler_1_Type_Num == EvapCoolerType::InDirectRDDSpecial)) { if (EvapCond(ZoneEvapUnit(UnitNum).EvapCooler_1_Index).EvapControlNodeNum > 0) { Node(EvapCond(ZoneEvapUnit(UnitNum).EvapCooler_1_Index).EvapControlNodeNum).TempSetPoint = -20.0; } } - if ((ZoneEvapUnit(UnitNum).EvapCooler_2_Type_Num == iEvapCoolerDirectResearchSpecial) || - (ZoneEvapUnit(UnitNum).EvapCooler_2_Type_Num == iEvapCoolerInDirectRDDSpecial)) { + if ((ZoneEvapUnit(UnitNum).EvapCooler_2_Type_Num == EvapCoolerType::DirectResearchSpecial) || + (ZoneEvapUnit(UnitNum).EvapCooler_2_Type_Num == EvapCoolerType::InDirectRDDSpecial)) { if (EvapCond(ZoneEvapUnit(UnitNum).EvapCooler_2_Index).EvapControlNodeNum > 0) { Node(EvapCond(ZoneEvapUnit(UnitNum).EvapCooler_2_Index).EvapControlNodeNum).TempSetPoint = -20.0; } diff --git a/src/EnergyPlus/EvaporativeCoolers.hh b/src/EnergyPlus/EvaporativeCoolers.hh index 86de32048ea..4b1ee1de3da 100644 --- a/src/EnergyPlus/EvaporativeCoolers.hh +++ b/src/EnergyPlus/EvaporativeCoolers.hh @@ -96,6 +96,15 @@ namespace EvaporativeCoolers { extern int const WetModulated; // the evaporative cooler Research Special is modulated in wet Mode extern int const WetFull; // the evaporative cooler Research Special is run in full capacity in Wet Mode + enum class EvapCoolerType { + Unassigned, + DirectCELDEKPAD, + InDirectCELDEKPAD, + InDirectWETCOIL, + InDirectRDDSpecial, + DirectResearchSpecial + }; + // SUBROUTINE SPECIFICATIONS FOR MODULE EvapCoolers // Types @@ -105,7 +114,7 @@ namespace EvaporativeCoolers { // Members std::string EvapCoolerName; // Name of the EvapCooler int EquipIndex; - int EvapCoolerType; // Type of the EvapCooler (parameters in DataGlobalConstants.cc + EvapCoolerType EvapCoolerType; // Type of the EvapCooler (parameters in DataGlobalConstants.cc std::string EvapControlType; // Type of Control for the EvapCooler std::string Schedule; // HeatingCoil Operation Schedule int SchedPtr; // Pointer to the correct schedule @@ -204,7 +213,8 @@ namespace EvaporativeCoolers { // Default Constructor EvapConditions() - : EquipIndex(0), EvapCoolerType(0), SchedPtr(0), VolFlowRate(0.0), DesVolFlowRate(0.0), OutletTemp(0.0), OuletWetBulbTemp(0.0), + : EquipIndex(0), EvapCoolerType(EvapCoolerType::Unassigned), SchedPtr(0), VolFlowRate(0.0), DesVolFlowRate(0.0), + OutletTemp(0.0), OuletWetBulbTemp(0.0), OutletHumRat(0.0), OutletEnthalpy(0.0), OutletPressure(0.0), OutletMassFlowRate(0.0), OutletMassFlowRateMaxAvail(0.0), OutletMassFlowRateMinAvail(0.0), InitFlag(false), InletNode(0), OutletNode(0), SecondaryInletNode(0), SecondaryOutletNode(0), TertiaryInletNode(0), InletMassFlowRate(0.0), InletMassFlowRateMaxAvail(0.0), InletMassFlowRateMinAvail(0.0), InletTemp(0.0), @@ -260,12 +270,12 @@ namespace EvaporativeCoolers { Real64 ThresholdCoolingLoad; std::string EvapCooler_1_ObjectClassName; std::string EvapCooler_1_Name; - int EvapCooler_1_Type_Num; + EvapCoolerType EvapCooler_1_Type_Num; int EvapCooler_1_Index; bool EvapCooler_1_AvailStatus; std::string EvapCooler_2_ObjectClassName; std::string EvapCooler_2_Name; - int EvapCooler_2_Type_Num; + EvapCoolerType EvapCooler_2_Type_Num; int EvapCooler_2_Index; bool EvapCooler_2_AvailStatus; Real64 OAInletRho; // fills internal variable, current inlet air density [kg/m3] @@ -306,7 +316,8 @@ namespace EvaporativeCoolers { UnitReliefNodeNum(0), FanType_Num(0), FanIndex(0), ActualFanVolFlowRate(0.0), FanAvailSchedPtr(0), FanInletNodeNum(0), FanOutletNodeNum(0), OpMode(0), DesignAirVolumeFlowRate(0.0), DesignAirMassFlowRate(0.0), DesignFanSpeedRatio(0.0), FanSpeedRatio(0.0), FanLocation(0), ControlSchemeType(0), TimeElapsed(0.0), ThrottlingRange(0.0), IsOnThisTimestep(false), WasOnLastTimestep(false), - ThresholdCoolingLoad(0.0), EvapCooler_1_Type_Num(0), EvapCooler_1_Index(0), EvapCooler_1_AvailStatus(false), EvapCooler_2_Type_Num(0), + ThresholdCoolingLoad(0.0), EvapCooler_1_Type_Num(EvapCoolerType::Unassigned), EvapCooler_1_Index(0), + EvapCooler_1_AvailStatus(false), EvapCooler_2_Type_Num(EvapCoolerType::Unassigned), EvapCooler_2_Index(0), EvapCooler_2_AvailStatus(false), OAInletRho(0.0), OAInletCp(0.0), OAInletTemp(0.0), OAInletHumRat(0.0), OAInletMassFlowRate(0.0), UnitOutletTemp(0.0), UnitOutletHumRat(0.0), UnitOutletMassFlowRate(0.0), UnitReliefTemp(0.0), UnitReliefHumRat(0.0), UnitReliefMassFlowRate(0.0), UnitTotalCoolingRate(0.0), UnitTotalCoolingEnergy(0.0), diff --git a/tst/EnergyPlus/unit/EvaporativeCoolers.unit.cc b/tst/EnergyPlus/unit/EvaporativeCoolers.unit.cc index 1ffcfc05dc4..a56d914fd9d 100644 --- a/tst/EnergyPlus/unit/EvaporativeCoolers.unit.cc +++ b/tst/EnergyPlus/unit/EvaporativeCoolers.unit.cc @@ -72,7 +72,6 @@ using namespace EnergyPlus::Psychrometrics; using namespace EnergyPlus::DataSizing; using namespace EnergyPlus::DataAirSystems; using namespace EnergyPlus::EvaporativeCoolers; -using EnergyPlus::DataGlobalConstants::iEvapCoolerInDirectRDDSpecial; namespace EnergyPlus { @@ -493,7 +492,7 @@ TEST_F(EnergyPlusFixture, EvaporativeCoolers_SizeEvapCooler) DataSizing::FinalSysSizing(1).DesOutAirVolFlow = 0.4; // set up the structure to size the flow rates for an RDDSpecial - thisEvapCooler.EvapCoolerType = DataGlobalConstants::iEvapCoolerInDirectRDDSpecial; + thisEvapCooler.EvapCoolerType = EvapCoolerType::InDirectRDDSpecial; thisEvapCooler.DesVolFlowRate = DataSizing::AutoSize; thisEvapCooler.PadArea = 0.0; thisEvapCooler.PadDepth = 0.0; @@ -508,7 +507,7 @@ TEST_F(EnergyPlusFixture, EvaporativeCoolers_SizeEvapCooler) EXPECT_NEAR(1.0, thisEvapCooler.DesVolFlowRate, 0.0001); // now let's try to size some of the pad properties - thisEvapCooler.EvapCoolerType = DataGlobalConstants::iEvapCoolerDirectCELDEKPAD; + thisEvapCooler.EvapCoolerType = EvapCoolerType::DirectCELDEKPAD; thisEvapCooler.DesVolFlowRate = 1.0; thisEvapCooler.PadArea = DataSizing::AutoSize; thisEvapCooler.PadDepth = DataSizing::AutoSize; @@ -525,7 +524,7 @@ TEST_F(EnergyPlusFixture, EvaporativeCoolers_SizeEvapCooler) DataAirSystems::PrimaryAirSystem(1).Branch(1).Comp(1).Name = "NOT-MyEvapCooler"; // set up the structure to size the flow rates for an indirect celdekpad - thisEvapCooler.EvapCoolerType = DataGlobalConstants::iEvapCoolerInDirectCELDEKPAD; + thisEvapCooler.EvapCoolerType = EvapCoolerType::InDirectCELDEKPAD; thisEvapCooler.DesVolFlowRate = DataSizing::AutoSize; thisEvapCooler.PadArea = 0.0; thisEvapCooler.PadDepth = 0.0; @@ -730,7 +729,7 @@ TEST_F(EnergyPlusFixture, DirectEvapCoolerResearchSpecialCalcTest) state.dataCurveManager->PerfCurve(CurveNum).Var1Max = 1.0; // set up the flow rates for a direct RDDSpecial - thisEvapCooler.EvapCoolerType = DataGlobalConstants::iEvapCoolerDirectResearchSpecial; + thisEvapCooler.EvapCoolerType = EvapCoolerType::DirectResearchSpecial; thisEvapCooler.EvapCoolerName = "MyDirectEvapCoolerRS"; thisEvapCooler.SchedPtr = DataGlobals::ScheduleAlwaysOn; thisEvapCooler.PumpPowerModifierCurveIndex = CurveNum; From 73a70e7286bb963bdd3552ccdd088d8c276f29a5 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Sun, 11 Oct 2020 12:55:14 -0600 Subject: [PATCH 09/15] move EMSCallFrom from DataGlobalConstants to EMSManager --- src/EnergyPlus/DXCoils.cc | 2 +- src/EnergyPlus/DataGlobalConstants.hh | 25 ------- src/EnergyPlus/DataRuntimeLanguage.cc | 4 -- src/EnergyPlus/DataRuntimeLanguage.hh | 5 +- src/EnergyPlus/EMSManager.cc | 72 +++++++++---------- src/EnergyPlus/EMSManager.hh | 29 +++++++- src/EnergyPlus/ExternalInterface.cc | 4 +- src/EnergyPlus/Fans.cc | 2 +- src/EnergyPlus/Furnaces.cc | 4 +- src/EnergyPlus/HVACFan.cc | 2 +- src/EnergyPlus/HVACManager.cc | 14 ++-- src/EnergyPlus/HVACSizingSimulationManager.cc | 2 +- src/EnergyPlus/HeatBalanceManager.cc | 10 +-- src/EnergyPlus/PlantCondLoopOperation.cc | 4 +- src/EnergyPlus/PluginManager.cc | 46 ++++++------ src/EnergyPlus/PluginManager.hh | 10 ++- src/EnergyPlus/SimAirServingZones.cc | 2 +- src/EnergyPlus/SimulationManager.cc | 4 +- src/EnergyPlus/UnitarySystem.cc | 4 +- src/EnergyPlus/UserDefinedComponents.cc | 18 ++--- src/EnergyPlus/WeatherManager.cc | 2 +- src/EnergyPlus/ZoneEquipmentManager.cc | 2 +- src/EnergyPlus/api/runtime.cc | 68 +++++++++--------- tst/EnergyPlus/unit/EMSManager.unit.cc | 48 ++++++------- tst/EnergyPlus/unit/HVACFan.unit.cc | 4 +- tst/EnergyPlus/unit/NodeInputManager.unit.cc | 2 +- tst/EnergyPlus/unit/api/datatransfer.unit.cc | 4 +- 27 files changed, 197 insertions(+), 196 deletions(-) diff --git a/src/EnergyPlus/DXCoils.cc b/src/EnergyPlus/DXCoils.cc index 01102c725ec..798fefbf24c 100644 --- a/src/EnergyPlus/DXCoils.cc +++ b/src/EnergyPlus/DXCoils.cc @@ -6007,7 +6007,7 @@ namespace DXCoils { lAlphaBlanks2.deallocate(); lNumericBlanks2.deallocate(); bool anyEMSRan; - ManageEMS(state, DataGlobalConstants::EMSCallFrom::ComponentGetInput, anyEMSRan, ObjexxFCL::Optional_int_const()); + ManageEMS(state, EMSManager::EMSCallFrom::ComponentGetInput, anyEMSRan, ObjexxFCL::Optional_int_const()); } void InitDXCoil(EnergyPlusData &state, int const DXCoilNum) // number of the current DX coil unit being simulated diff --git a/src/EnergyPlus/DataGlobalConstants.hh b/src/EnergyPlus/DataGlobalConstants.hh index 8b88b5d47ce..d17b3b5e860 100644 --- a/src/EnergyPlus/DataGlobalConstants.hh +++ b/src/EnergyPlus/DataGlobalConstants.hh @@ -252,31 +252,6 @@ namespace DataGlobalConstants { ReadAllWeatherData = 6 // a weather period for reading all weather data prior to the simulation }; - // Parameters for EMS Calling Points - enum class EMSCallFrom { - Unassigned, - ZoneSizing, - SystemSizing, - BeginNewEnvironment, - BeginNewEnvironmentAfterWarmUp, - BeginTimestepBeforePredictor, - BeforeHVACManagers, - AfterHVACManagers, - HVACIterationLoop, - EndSystemTimestepBeforeHVACReporting, - EndSystemTimestepAfterHVACReporting, - EndZoneTimestepBeforeZoneReporting, - EndZoneTimestepAfterZoneReporting, - SetupSimulation, - ExternalInterface, - ComponentGetInput, - UserDefinedComponentModel, - UnitarySystemSizing, - BeginZoneTimestepBeforeInitHeatBalance, - BeginZoneTimestepAfterInitHeatBalance, - BeginZoneTimestepBeforeSetCurrentWeather - }; - Real64 constexpr MaxEXPArg () { return 709.78; } // maximum exponent in EXP() function Real64 constexpr Pi () { return 3.14159265358979324; } // Pi 3.1415926535897932384626435 Real64 constexpr PiOvr2 () { return Pi() / 2.0; } // Pi/2 diff --git a/src/EnergyPlus/DataRuntimeLanguage.cc b/src/EnergyPlus/DataRuntimeLanguage.cc index c14f142ca60..135adf1e70a 100644 --- a/src/EnergyPlus/DataRuntimeLanguage.cc +++ b/src/EnergyPlus/DataRuntimeLanguage.cc @@ -49,7 +49,6 @@ #include // EnergyPlus Headers -#include #include #include @@ -69,9 +68,6 @@ namespace DataRuntimeLanguage { // METHODOLOGY EMPLOYED: na - // Using/Aliasing - using namespace DataPrecisionGlobals; - // Data // module should be available to other modules and routines. // Thus, all variables in this module must be PUBLIC. diff --git a/src/EnergyPlus/DataRuntimeLanguage.hh b/src/EnergyPlus/DataRuntimeLanguage.hh index 39a161dd0b9..b7b15cae791 100644 --- a/src/EnergyPlus/DataRuntimeLanguage.hh +++ b/src/EnergyPlus/DataRuntimeLanguage.hh @@ -60,6 +60,7 @@ // EnergyPlus Headers #include +#include #include namespace EnergyPlus { @@ -353,12 +354,12 @@ namespace DataRuntimeLanguage { // Members // structure for Erl program calling managers std::string Name; // user defined name for calling manager - DataGlobalConstants::EMSCallFrom CallingPoint; // EMS Calling point for this manager, see parameters emsCallFrom* + EMSManager::EMSCallFrom CallingPoint; // EMS Calling point for this manager, see parameters emsCallFrom* int NumErlPrograms; // count of total number of Erl programs called by this manager Array1D_int ErlProgramARR; // list of integer pointers to Erl programs used by this manager // Default Constructor - EMSProgramCallManagementType() : CallingPoint(DataGlobalConstants::EMSCallFrom::Unassigned), NumErlPrograms(0) + EMSProgramCallManagementType() : CallingPoint(EMSManager::EMSCallFrom::Unassigned), NumErlPrograms(0) { } }; diff --git a/src/EnergyPlus/EMSManager.cc b/src/EnergyPlus/EMSManager.cc index 05f30c4cb65..e9f196021da 100644 --- a/src/EnergyPlus/EMSManager.cc +++ b/src/EnergyPlus/EMSManager.cc @@ -240,7 +240,7 @@ namespace EMSManager { // MODULE SUBROUTINES: void ManageEMS(EnergyPlusData &state, - DataGlobalConstants::EMSCallFrom const iCalledFrom, // indicates where subroutine was called from, parameters in DataGlobals. + EMSCallFrom const iCalledFrom, // indicates where subroutine was called from, parameters in DataGlobals. bool &anyProgramRan, // true if any Erl programs ran for this call Optional_int_const ProgramManagerToRun // specific program manager to run ) @@ -283,7 +283,7 @@ namespace EMSManager { anyProgramRan = false; if (!AnyEnergyManagementSystemInModel) return; // quick return if nothing to do - if (iCalledFrom == DataGlobalConstants::EMSCallFrom::BeginNewEnvironment) { + if (iCalledFrom == EMSCallFrom::BeginNewEnvironment) { BeginEnvrnInitializeRuntimeLanguage(); PluginManagement::onBeginEnvironment(); } @@ -292,21 +292,21 @@ namespace EMSManager { // also call plugins and callbacks here for convenience bool anyPluginsOrCallbacksRan = false; - if (iCalledFrom != DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel) { // don't run user-defined component plugins this way + if (iCalledFrom != EMSCallFrom::UserDefinedComponentModel) { // don't run user-defined component plugins this way PluginManagement::runAnyRegisteredCallbacks(state, iCalledFrom, anyPluginsOrCallbacksRan); if (anyPluginsOrCallbacksRan) { anyProgramRan = true; } } - if (iCalledFrom == DataGlobalConstants::EMSCallFrom::SetupSimulation) { + if (iCalledFrom == EMSCallFrom::SetupSimulation) { ProcessEMSInput(state, true); return; } // Run the Erl programs depending on calling point. - if (iCalledFrom != DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel) { + if (iCalledFrom != EMSCallFrom::UserDefinedComponentModel) { for (ProgramManagerNum = 1; ProgramManagerNum <= NumProgramCallManagers; ++ProgramManagerNum) { if (EMSProgramCallManager(ProgramManagerNum).CallingPoint == iCalledFrom) { @@ -325,7 +325,7 @@ namespace EMSManager { } } - if (iCalledFrom == DataGlobalConstants::EMSCallFrom::ExternalInterface) { + if (iCalledFrom == EMSCallFrom::ExternalInterface) { anyProgramRan = true; } @@ -375,7 +375,7 @@ namespace EMSManager { ReportEMS(); } - void InitEMS(EnergyPlusData &state, DataGlobalConstants::EMSCallFrom const iCalledFrom) // indicates where subroutine was called from, parameters in DataGlobals. + void InitEMS(EnergyPlusData &state, EMSCallFrom const iCalledFrom) // indicates where subroutine was called from, parameters in DataGlobals. { // SUBROUTINE INFORMATION: @@ -450,8 +450,8 @@ namespace EMSManager { InitializeRuntimeLanguage(state); - if ((BeginEnvrnFlag) || (iCalledFrom == DataGlobalConstants::EMSCallFrom::ZoneSizing) || (iCalledFrom == DataGlobalConstants::EMSCallFrom::SystemSizing) || - (iCalledFrom == DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel)) { + if ((BeginEnvrnFlag) || (iCalledFrom == EMSCallFrom::ZoneSizing) || (iCalledFrom == EMSCallFrom::SystemSizing) || + (iCalledFrom == EMSCallFrom::UserDefinedComponentModel)) { // another pass at trying to setup input data. if (FinishProcessingUserInput) { @@ -942,41 +942,41 @@ namespace EMSManager { auto const SELECT_CASE_var(cAlphaArgs(2)); if (SELECT_CASE_var == "BEGINNEWENVIRONMENT") { - EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::BeginNewEnvironment; + EMSProgramCallManager(CallManagerNum).CallingPoint = EMSCallFrom::BeginNewEnvironment; } else if (SELECT_CASE_var == "BEGINZONETIMESTEPBEFORESETCURRENTWEATHER") { - EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::BeginZoneTimestepBeforeSetCurrentWeather; + EMSProgramCallManager(CallManagerNum).CallingPoint = EMSCallFrom::BeginZoneTimestepBeforeSetCurrentWeather; } else if (SELECT_CASE_var == "AFTERNEWENVIRONMENTWARMUPISCOMPLETE") { - EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::BeginNewEnvironmentAfterWarmUp; + EMSProgramCallManager(CallManagerNum).CallingPoint = EMSCallFrom::BeginNewEnvironmentAfterWarmUp; } else if (SELECT_CASE_var == "BEGINZONETIMESTEPBEFOREINITHEATBALANCE") { - EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::BeginZoneTimestepBeforeInitHeatBalance; + EMSProgramCallManager(CallManagerNum).CallingPoint = EMSCallFrom::BeginZoneTimestepBeforeInitHeatBalance; } else if (SELECT_CASE_var == "BEGINZONETIMESTEPAFTERINITHEATBALANCE") { - EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::BeginZoneTimestepAfterInitHeatBalance; + EMSProgramCallManager(CallManagerNum).CallingPoint = EMSCallFrom::BeginZoneTimestepAfterInitHeatBalance; } else if (SELECT_CASE_var == "BEGINTIMESTEPBEFOREPREDICTOR") { - EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::BeginTimestepBeforePredictor; + EMSProgramCallManager(CallManagerNum).CallingPoint = EMSCallFrom::BeginTimestepBeforePredictor; } else if (SELECT_CASE_var == "AFTERPREDICTORBEFOREHVACMANAGERS") { - EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::BeforeHVACManagers; + EMSProgramCallManager(CallManagerNum).CallingPoint = EMSCallFrom::BeforeHVACManagers; } else if (SELECT_CASE_var == "AFTERPREDICTORAFTERHVACMANAGERS") { - EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::AfterHVACManagers; + EMSProgramCallManager(CallManagerNum).CallingPoint = EMSCallFrom::AfterHVACManagers; } else if (SELECT_CASE_var == "INSIDEHVACSYSTEMITERATIONLOOP") { - EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::HVACIterationLoop; + EMSProgramCallManager(CallManagerNum).CallingPoint = EMSCallFrom::HVACIterationLoop; } else if (SELECT_CASE_var == "ENDOFZONETIMESTEPBEFOREZONEREPORTING") { - EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::EndZoneTimestepBeforeZoneReporting; + EMSProgramCallManager(CallManagerNum).CallingPoint = EMSCallFrom::EndZoneTimestepBeforeZoneReporting; } else if (SELECT_CASE_var == "ENDOFZONETIMESTEPAFTERZONEREPORTING") { - EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::EndZoneTimestepAfterZoneReporting; + EMSProgramCallManager(CallManagerNum).CallingPoint = EMSCallFrom::EndZoneTimestepAfterZoneReporting; } else if (SELECT_CASE_var == "ENDOFSYSTEMTIMESTEPBEFOREHVACREPORTING") { - EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::EndSystemTimestepBeforeHVACReporting; + EMSProgramCallManager(CallManagerNum).CallingPoint = EMSCallFrom::EndSystemTimestepBeforeHVACReporting; } else if (SELECT_CASE_var == "ENDOFSYSTEMTIMESTEPAFTERHVACREPORTING") { - EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::EndSystemTimestepAfterHVACReporting; + EMSProgramCallManager(CallManagerNum).CallingPoint = EMSCallFrom::EndSystemTimestepAfterHVACReporting; } else if (SELECT_CASE_var == "ENDOFZONESIZING") { - EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::ZoneSizing; + EMSProgramCallManager(CallManagerNum).CallingPoint = EMSCallFrom::ZoneSizing; } else if (SELECT_CASE_var == "ENDOFSYSTEMSIZING") { - EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::SystemSizing; + EMSProgramCallManager(CallManagerNum).CallingPoint = EMSCallFrom::SystemSizing; } else if (SELECT_CASE_var == "AFTERCOMPONENTINPUTREADIN") { - EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::ComponentGetInput; + EMSProgramCallManager(CallManagerNum).CallingPoint = EMSCallFrom::ComponentGetInput; } else if (SELECT_CASE_var == "USERDEFINEDCOMPONENTMODEL") { - EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel; + EMSProgramCallManager(CallManagerNum).CallingPoint = EMSCallFrom::UserDefinedComponentModel; } else if (SELECT_CASE_var == "UNITARYSYSTEMSIZING") { - EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::UnitarySystemSizing; + EMSProgramCallManager(CallManagerNum).CallingPoint = EMSCallFrom::UnitarySystemSizing; } else { ShowSevereError("Invalid " + cAlphaFieldNames(2) + '=' + cAlphaArgs(2)); ShowContinueError("Entered in " + cCurrentModuleObject + '=' + cAlphaArgs(1)); @@ -1820,31 +1820,31 @@ namespace EMSManager { nodeSetpointCheck.needsSetpointChecking = false; if (nodeSetpointCheck.checkTemperatureSetPoint) { - nodeSetpointCheck.needsSetpointChecking |= !CheckIfNodeSetPointManaged(NodeNum, EMSManager::iTemperatureSetPoint, true); + nodeSetpointCheck.needsSetpointChecking |= !CheckIfNodeSetPointManaged(NodeNum, iTemperatureSetPoint, true); } if (nodeSetpointCheck.checkTemperatureMinSetPoint) { - nodeSetpointCheck.needsSetpointChecking |= !CheckIfNodeSetPointManaged(NodeNum, EMSManager::iTemperatureMinSetPoint, true); + nodeSetpointCheck.needsSetpointChecking |= !CheckIfNodeSetPointManaged(NodeNum, iTemperatureMinSetPoint, true); } if (nodeSetpointCheck.checkTemperatureMaxSetPoint) { - nodeSetpointCheck.needsSetpointChecking |= !CheckIfNodeSetPointManaged(NodeNum, EMSManager::iTemperatureMaxSetPoint, true); + nodeSetpointCheck.needsSetpointChecking |= !CheckIfNodeSetPointManaged(NodeNum, iTemperatureMaxSetPoint, true); } if (nodeSetpointCheck.checkHumidityRatioSetPoint) { - nodeSetpointCheck.needsSetpointChecking |= !CheckIfNodeSetPointManaged(NodeNum, EMSManager::iHumidityRatioSetPoint, true); + nodeSetpointCheck.needsSetpointChecking |= !CheckIfNodeSetPointManaged(NodeNum, iHumidityRatioSetPoint, true); } if (nodeSetpointCheck.checkHumidityRatioMinSetPoint) { - nodeSetpointCheck.needsSetpointChecking |= !CheckIfNodeSetPointManaged(NodeNum, EMSManager::iHumidityRatioMinSetPoint, true); + nodeSetpointCheck.needsSetpointChecking |= !CheckIfNodeSetPointManaged(NodeNum, iHumidityRatioMinSetPoint, true); } if (nodeSetpointCheck.checkHumidityRatioMaxSetPoint) { - nodeSetpointCheck.needsSetpointChecking |= !CheckIfNodeSetPointManaged(NodeNum, EMSManager::iHumidityRatioMaxSetPoint, true); + nodeSetpointCheck.needsSetpointChecking |= !CheckIfNodeSetPointManaged(NodeNum, iHumidityRatioMaxSetPoint, true); } if (nodeSetpointCheck.checkMassFlowRateSetPoint) { - nodeSetpointCheck.needsSetpointChecking |= !CheckIfNodeSetPointManaged(NodeNum, EMSManager::iMassFlowRateSetPoint, true); + nodeSetpointCheck.needsSetpointChecking |= !CheckIfNodeSetPointManaged(NodeNum, iMassFlowRateSetPoint, true); } if (nodeSetpointCheck.checkMassFlowRateMinSetPoint) { - nodeSetpointCheck.needsSetpointChecking |= !CheckIfNodeSetPointManaged(NodeNum, EMSManager::iMassFlowRateMinSetPoint, true); + nodeSetpointCheck.needsSetpointChecking |= !CheckIfNodeSetPointManaged(NodeNum, iMassFlowRateMinSetPoint, true); } if (nodeSetpointCheck.checkMassFlowRateMaxSetPoint) { - nodeSetpointCheck.needsSetpointChecking |= !CheckIfNodeSetPointManaged(NodeNum, EMSManager::iMassFlowRateMaxSetPoint, true); + nodeSetpointCheck.needsSetpointChecking |= !CheckIfNodeSetPointManaged(NodeNum, iMassFlowRateMaxSetPoint, true); } if (nodeSetpointCheck.needsSetpointChecking) { diff --git a/src/EnergyPlus/EMSManager.hh b/src/EnergyPlus/EMSManager.hh index 545f15c0b39..cdc3b9f6b99 100644 --- a/src/EnergyPlus/EMSManager.hh +++ b/src/EnergyPlus/EMSManager.hh @@ -85,6 +85,31 @@ namespace EMSManager { extern bool ZoneThermostatActuatorsHaveBeenSetup; extern bool FinishProcessingUserInput; // Flag to indicate still need to process input + // Parameters for EMS Calling Points + enum class EMSCallFrom { + Unassigned, + ZoneSizing, + SystemSizing, + BeginNewEnvironment, + BeginNewEnvironmentAfterWarmUp, + BeginTimestepBeforePredictor, + BeforeHVACManagers, + AfterHVACManagers, + HVACIterationLoop, + EndSystemTimestepBeforeHVACReporting, + EndSystemTimestepAfterHVACReporting, + EndZoneTimestepBeforeZoneReporting, + EndZoneTimestepAfterZoneReporting, + SetupSimulation, + ExternalInterface, + ComponentGetInput, + UserDefinedComponentModel, + UnitarySystemSizing, + BeginZoneTimestepBeforeInitHeatBalance, + BeginZoneTimestepAfterInitHeatBalance, + BeginZoneTimestepBeforeSetCurrentWeather + }; + // SUBROUTINE SPECIFICATIONS: // Functions @@ -95,12 +120,12 @@ namespace EMSManager { // MODULE SUBROUTINES: void ManageEMS(EnergyPlusData &state, - DataGlobalConstants::EMSCallFrom iCalledFrom, // indicates where subroutine was called from, parameters in DataGlobals. + EMSCallFrom iCalledFrom, // indicates where subroutine was called from, parameters in DataGlobals. bool &anyProgramRan, // true if any Erl programs ran for this call Optional_int_const ProgramManagerToRun = _ // specific program manager to run ); - void InitEMS(EnergyPlusData &state, DataGlobalConstants::EMSCallFrom iCalledFrom); // indicates where subroutine was called from, parameters in DataGlobals. + void InitEMS(EnergyPlusData &state, EMSCallFrom iCalledFrom); // indicates where subroutine was called from, parameters in DataGlobals. void ReportEMS(); diff --git a/src/EnergyPlus/ExternalInterface.cc b/src/EnergyPlus/ExternalInterface.cc index a025d98e508..0ef5532c54e 100644 --- a/src/EnergyPlus/ExternalInterface.cc +++ b/src/EnergyPlus/ExternalInterface.cc @@ -942,7 +942,7 @@ namespace ExternalInterface { // If we have Erl variables, we need to call ManageEMS so that they get updated in the Erl data structure if (useEMS) { bool anyRan; - ManageEMS(state, DataGlobalConstants::EMSCallFrom::ExternalInterface, anyRan, ObjexxFCL::Optional_int_const()); + ManageEMS(state, EMSManager::EMSCallFrom::ExternalInterface, anyRan, ObjexxFCL::Optional_int_const()); } FirstCallGetSetDoStep = false; @@ -2408,7 +2408,7 @@ namespace ExternalInterface { // If we have Erl variables, we need to call ManageEMS so that they get updated in the Erl data structure if (useEMS) { bool anyRan; - ManageEMS(state, DataGlobalConstants::EMSCallFrom::ExternalInterface, anyRan, ObjexxFCL::Optional_int_const()); + ManageEMS(state, EMSManager::EMSCallFrom::ExternalInterface, anyRan, ObjexxFCL::Optional_int_const()); } firstCall = false; // bug fix causing external interface to send zero at the beginning of sim, Thierry Nouidui diff --git a/src/EnergyPlus/Fans.cc b/src/EnergyPlus/Fans.cc index 796a015643f..4262af79a2b 100644 --- a/src/EnergyPlus/Fans.cc +++ b/src/EnergyPlus/Fans.cc @@ -999,7 +999,7 @@ namespace Fans { } bool anyRan; - ManageEMS(state, DataGlobalConstants::EMSCallFrom::ComponentGetInput, anyRan, ObjexxFCL::Optional_int_const()); + ManageEMS(state, EMSManager::EMSCallFrom::ComponentGetInput, anyRan, ObjexxFCL::Optional_int_const()); MySizeFlag.dimension(state.dataFans->NumFans, true); } diff --git a/src/EnergyPlus/Furnaces.cc b/src/EnergyPlus/Furnaces.cc index 0128092f521..0ba77b386fc 100644 --- a/src/EnergyPlus/Furnaces.cc +++ b/src/EnergyPlus/Furnaces.cc @@ -4746,7 +4746,7 @@ namespace Furnaces { } } bool anyRan; - ManageEMS(state, DataGlobalConstants::EMSCallFrom::ComponentGetInput, anyRan, ObjexxFCL::Optional_int_const()); + ManageEMS(state, EMSManager::EMSCallFrom::ComponentGetInput, anyRan, ObjexxFCL::Optional_int_const()); } // End of Get Input subroutines for this Module @@ -6085,7 +6085,7 @@ namespace Furnaces { Real64 MulSpeedFlowScale; // variable speed air flow scaling factor int IHPCoilIndex(0); // refer to cooling or heating coil in IHP bool anyRan; - ManageEMS(state, DataGlobalConstants::EMSCallFrom::UnitarySystemSizing, anyRan, ObjexxFCL::Optional_int_const()); // calling point + ManageEMS(state, EMSManager::EMSCallFrom::UnitarySystemSizing, anyRan, ObjexxFCL::Optional_int_const()); // calling point ThisCtrlZoneNum = 0; DXCoolCap = 0.0; diff --git a/src/EnergyPlus/HVACFan.cc b/src/EnergyPlus/HVACFan.cc index c32f0c42e2e..dfdc79752fb 100644 --- a/src/EnergyPlus/HVACFan.cc +++ b/src/EnergyPlus/HVACFan.cc @@ -657,7 +657,7 @@ namespace HVACFan { isNumericFieldBlank.deallocate(); bool anyEMSRan = false; - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::ComponentGetInput, anyEMSRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::ComponentGetInput, anyEMSRan, ObjexxFCL::Optional_int_const()); } void diff --git a/src/EnergyPlus/HVACManager.cc b/src/EnergyPlus/HVACManager.cc index bebbb6f95c9..45c9a0242d6 100644 --- a/src/EnergyPlus/HVACManager.cc +++ b/src/EnergyPlus/HVACManager.cc @@ -366,7 +366,7 @@ namespace HVACManager { FracTimeStepZone = TimeStepSys / TimeStepZone; bool anyEMSRan; - ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginTimestepBeforePredictor, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point + ManageEMS(state, EMSManager::EMSCallFrom::BeginTimestepBeforePredictor, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point SetOutAirNodes(state); @@ -508,7 +508,7 @@ namespace HVACManager { OutputReportTabular::CalcHeatEmissionReport(state); } - ManageEMS(state, DataGlobalConstants::EMSCallFrom::EndSystemTimestepBeforeHVACReporting, anyEMSRan, ObjexxFCL::Optional_int_const()); // EMS calling point + ManageEMS(state, EMSManager::EMSCallFrom::EndSystemTimestepBeforeHVACReporting, anyEMSRan, ObjexxFCL::Optional_int_const()); // EMS calling point // This is where output processor data is updated for System Timestep reporting if (!WarmupFlag) { @@ -609,7 +609,7 @@ namespace HVACManager { } UpdateDataandReport(state, OutputProcessor::TimeStepType::TimeStepSystem); } - ManageEMS(state, DataGlobalConstants::EMSCallFrom::EndSystemTimestepAfterHVACReporting, anyEMSRan, ObjexxFCL::Optional_int_const()); // EMS calling point + ManageEMS(state, EMSManager::EMSCallFrom::EndSystemTimestepAfterHVACReporting, anyEMSRan, ObjexxFCL::Optional_int_const()); // EMS calling point // UPDATE SYSTEM CLOCKS SysTimeElapsed += TimeStepSys; @@ -859,7 +859,7 @@ namespace HVACManager { // Before the HVAC simulation, call ManageSetPoints to set all the HVAC // node setpoints bool anyEMSRan = false; - ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeforeHVACManagers, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point + ManageEMS(state, EMSManager::EMSCallFrom::BeforeHVACManagers, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point ManageSetPoints(state); @@ -870,8 +870,8 @@ namespace HVACManager { // the system on/off flags ManageSystemAvailability(state); - ManageEMS(state, DataGlobalConstants::EMSCallFrom::AfterHVACManagers, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point - ManageEMS(state, DataGlobalConstants::EMSCallFrom::HVACIterationLoop, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point id + ManageEMS(state, EMSManager::EMSCallFrom::AfterHVACManagers, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point + ManageEMS(state, EMSManager::EMSCallFrom::HVACIterationLoop, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point id // first explicitly call each system type with FirstHVACIteration, @@ -901,7 +901,7 @@ namespace HVACManager { if (state.dataGlobal->stopSimulation) break; - ManageEMS(state, DataGlobalConstants::EMSCallFrom::HVACIterationLoop, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point id + ManageEMS(state, EMSManager::EMSCallFrom::HVACIterationLoop, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point id // Manages the various component simulations SimSelectedEquipment(state, SimAirLoopsFlag, diff --git a/src/EnergyPlus/HVACSizingSimulationManager.cc b/src/EnergyPlus/HVACSizingSimulationManager.cc index 9f367eed7ed..f4848486091 100644 --- a/src/EnergyPlus/HVACSizingSimulationManager.cc +++ b/src/EnergyPlus/HVACSizingSimulationManager.cc @@ -302,7 +302,7 @@ void ManageHVACSizingSimulation(EnergyPlusData &state, bool &ErrorsFound) NumOfWarmupDays = 0; bool anyEMSRan; - ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginNewEnvironment, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point + ManageEMS(state, EMSManager::EMSCallFrom::BeginNewEnvironment, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point while ((DayOfSim < NumOfDayInEnvrn) || (WarmupFlag)) { // Begin day loop ... diff --git a/src/EnergyPlus/HeatBalanceManager.cc b/src/EnergyPlus/HeatBalanceManager.cc index c234c80c5c1..6b2e14db333 100644 --- a/src/EnergyPlus/HeatBalanceManager.cc +++ b/src/EnergyPlus/HeatBalanceManager.cc @@ -360,13 +360,13 @@ namespace HeatBalanceManager { bool anyRan; ManageEMS(state, - DataGlobalConstants::EMSCallFrom::BeginZoneTimestepBeforeInitHeatBalance, + EMSManager::EMSCallFrom::BeginZoneTimestepBeforeInitHeatBalance, anyRan, ObjexxFCL::Optional_int_const()); // EMS calling point // These Inits will still have to be looked at as the routines are re-engineered further InitHeatBalance(state); // Initialize all heat balance related parameters - ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginZoneTimestepAfterInitHeatBalance, anyRan, ObjexxFCL::Optional_int_const()); // EMS calling point + ManageEMS(state, EMSManager::EMSCallFrom::BeginZoneTimestepAfterInitHeatBalance, anyRan, ObjexxFCL::Optional_int_const()); // EMS calling point // Solve the zone heat balance by first calling the Surface Heat Balance Manager // and then the Air Heat Balance Manager is called by the Surface Heat Balance @@ -376,7 +376,7 @@ namespace HeatBalanceManager { // the HVAC system (called from the Air Heat Balance) and the zone (simulated // in the Surface Heat Balance Manager). In the future, this may be improved. ManageSurfaceHeatBalance(state); - ManageEMS(state, DataGlobalConstants::EMSCallFrom::EndZoneTimestepBeforeZoneReporting, anyRan, ObjexxFCL::Optional_int_const()); // EMS calling point + ManageEMS(state, EMSManager::EMSCallFrom::EndZoneTimestepBeforeZoneReporting, anyRan, ObjexxFCL::Optional_int_const()); // EMS calling point RecKeepHeatBalance(state); // Do any heat balance related record keeping // This call has been moved to the FanSystemModule and does effect the output file @@ -385,7 +385,7 @@ namespace HeatBalanceManager { ReportHeatBalance(state); // Manage heat balance reporting until the new reporting is in place - ManageEMS(state, DataGlobalConstants::EMSCallFrom::EndZoneTimestepAfterZoneReporting, anyRan, ObjexxFCL::Optional_int_const()); // EMS calling point + ManageEMS(state, EMSManager::EMSCallFrom::EndZoneTimestepAfterZoneReporting, anyRan, ObjexxFCL::Optional_int_const()); // EMS calling point UpdateEMSTrendVariables(); EnergyPlus::PluginManagement::PluginManager::updatePluginValues(); @@ -397,7 +397,7 @@ namespace HeatBalanceManager { DayOfSim = 0; // Reset DayOfSim if Warmup converged state.dataGlobal->DayOfSimChr = "0"; - ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginNewEnvironmentAfterWarmUp, anyRan, ObjexxFCL::Optional_int_const()); // calling point + ManageEMS(state, EMSManager::EMSCallFrom::BeginNewEnvironmentAfterWarmUp, anyRan, ObjexxFCL::Optional_int_const()); // calling point } } diff --git a/src/EnergyPlus/PlantCondLoopOperation.cc b/src/EnergyPlus/PlantCondLoopOperation.cc index 4dd14f50fdb..9baf76076eb 100644 --- a/src/EnergyPlus/PlantCondLoopOperation.cc +++ b/src/EnergyPlus/PlantCondLoopOperation.cc @@ -2086,7 +2086,7 @@ CurrentModuleObject, PlantOpSchemeName); if (BeginEnvrnFlag && this_op_scheme.MyEnvrnFlag) { if (this_op_scheme.ErlInitProgramMngr > 0) { bool anyEMSRan; - ManageEMS(state, DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, this_op_scheme.ErlInitProgramMngr); + ManageEMS(state, EMSManager::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, this_op_scheme.ErlInitProgramMngr); } else if (this_op_scheme.initPluginLocation > -1) { EnergyPlus::PluginManagement::pluginManager->runSingleUserDefinedPlugin(state, this_op_scheme.initPluginLocation); } @@ -3096,7 +3096,7 @@ CurrentModuleObject, PlantOpSchemeName); // Call EMS program(s) if (PlantLoop(LoopNum).OpScheme(CurSchemePtr).ErlSimProgramMngr > 0) { bool anyEMSRan; - ManageEMS(state, DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, PlantLoop(LoopNum).OpScheme(CurSchemePtr).ErlSimProgramMngr); + ManageEMS(state, EMSManager::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, PlantLoop(LoopNum).OpScheme(CurSchemePtr).ErlSimProgramMngr); } else if (PlantLoop(LoopNum).OpScheme(CurSchemePtr).simPluginLocation > -1) { EnergyPlus::PluginManagement::pluginManager->runSingleUserDefinedPlugin(state, PlantLoop(LoopNum).OpScheme(CurSchemePtr).simPluginLocation); diff --git a/src/EnergyPlus/PluginManager.cc b/src/EnergyPlus/PluginManager.cc index 2e36e9bb19f..cef875d6a3c 100644 --- a/src/EnergyPlus/PluginManager.cc +++ b/src/EnergyPlus/PluginManager.cc @@ -62,7 +62,7 @@ namespace EnergyPlus { namespace PluginManagement { std::unique_ptr pluginManager; - std::map>> callbacks; + std::map>> callbacks; std::vector plugins; std::vector trends; std::vector globalVariableNames; @@ -72,7 +72,7 @@ namespace PluginManagement { bool fullyReady = false; bool apiErrorFlag = false; - void registerNewCallback(EnergyPlusData &EP_UNUSED(state), DataGlobalConstants::EMSCallFrom iCalledFrom, const std::function &f) + void registerNewCallback(EnergyPlusData &EP_UNUSED(state), EMSManager::EMSCallFrom iCalledFrom, const std::function &f) { callbacks[iCalledFrom].push_back(f); } @@ -93,7 +93,7 @@ namespace PluginManagement { return (int)callbacks.size(); } - void runAnyRegisteredCallbacks(EnergyPlusData &state, DataGlobalConstants::EMSCallFrom iCalledFrom, bool &anyRan) + void runAnyRegisteredCallbacks(EnergyPlusData &state, EMSManager::EMSCallFrom iCalledFrom, bool &anyRan) { if (DataGlobals::KickOffSimulation) return; for (auto const &cb : callbacks[iCalledFrom]) { @@ -923,97 +923,97 @@ namespace PluginManagement { } #if LINK_WITH_PYTHON == 1 - bool PluginInstance::run(EnergyPlusData &state, DataGlobalConstants::EMSCallFrom iCalledFrom) const + bool PluginInstance::run(EnergyPlusData &state, EMSManager::EMSCallFrom iCalledFrom) const { // returns true if a plugin actually ran PyObject *pFunctionName = nullptr; const char * functionName = nullptr; - if (iCalledFrom == DataGlobalConstants::EMSCallFrom::BeginNewEnvironment) { + if (iCalledFrom == EMSManager::EMSCallFrom::BeginNewEnvironment) { if (this->bHasBeginNewEnvironment) { pFunctionName = this->pBeginNewEnvironment; functionName = this->sHookBeginNewEnvironment; } - } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::BeginZoneTimestepBeforeSetCurrentWeather) { + } else if (iCalledFrom == EMSManager::EMSCallFrom::BeginZoneTimestepBeforeSetCurrentWeather) { if (this->bHasBeginZoneTimestepBeforeSetCurrentWeather) { pFunctionName = this->pBeginZoneTimestepBeforeSetCurrentWeather; functionName = this->sHookBeginZoneTimestepBeforeSetCurrentWeather; } - } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::ZoneSizing) { + } else if (iCalledFrom == EMSManager::EMSCallFrom::ZoneSizing) { if (this->bHasEndOfZoneSizing) { pFunctionName = this->pEndOfZoneSizing; functionName = this->sHookEndOfZoneSizing; } - } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::SystemSizing) { + } else if (iCalledFrom == EMSManager::EMSCallFrom::SystemSizing) { if (this->bHasEndOfSystemSizing) { pFunctionName = this->pEndOfSystemSizing; functionName = this->sHookEndOfSystemSizing; } - } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::BeginNewEnvironmentAfterWarmUp) { + } else if (iCalledFrom == EMSManager::EMSCallFrom::BeginNewEnvironmentAfterWarmUp) { if (this->bHasAfterNewEnvironmentWarmUpIsComplete) { pFunctionName = this->pAfterNewEnvironmentWarmUpIsComplete; functionName = this->sHookAfterNewEnvironmentWarmUpIsComplete; } - } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::BeginTimestepBeforePredictor) { + } else if (iCalledFrom == EMSManager::EMSCallFrom::BeginTimestepBeforePredictor) { if (this->bHasBeginTimestepBeforePredictor) { pFunctionName = this->pBeginTimestepBeforePredictor; functionName = this->sHookBeginTimestepBeforePredictor; } - } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::BeforeHVACManagers) { + } else if (iCalledFrom == EMSManager::EMSCallFrom::BeforeHVACManagers) { if (this->bHasAfterPredictorBeforeHVACManagers) { pFunctionName = this->pAfterPredictorBeforeHVACManagers; functionName = this->sHookAfterPredictorBeforeHVACManagers; } - } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::AfterHVACManagers) { + } else if (iCalledFrom == EMSManager::EMSCallFrom::AfterHVACManagers) { if (this->bHasAfterPredictorAfterHVACManagers) { pFunctionName = this->pAfterPredictorAfterHVACManagers; functionName = this->sHookAfterPredictorAfterHVACManagers; } - } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::HVACIterationLoop) { + } else if (iCalledFrom == EMSManager::EMSCallFrom::HVACIterationLoop) { if (this->bHasInsideHVACSystemIterationLoop) { pFunctionName = this->pInsideHVACSystemIterationLoop; functionName = this->sHookInsideHVACSystemIterationLoop; } - } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::EndSystemTimestepBeforeHVACReporting) { + } else if (iCalledFrom == EMSManager::EMSCallFrom::EndSystemTimestepBeforeHVACReporting) { if (this->bHasEndOfSystemTimestepBeforeHVACReporting) { pFunctionName = this->pEndOfSystemTimestepBeforeHVACReporting; functionName = this->sHookEndOfSystemTimestepBeforeHVACReporting; } - } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::EndSystemTimestepAfterHVACReporting) { + } else if (iCalledFrom == EMSManager::EMSCallFrom::EndSystemTimestepAfterHVACReporting) { if (this->bHasEndOfSystemTimestepAfterHVACReporting) { pFunctionName = this->pEndOfSystemTimestepAfterHVACReporting; functionName = this->sHookEndOfSystemTimestepAfterHVACReporting; } - } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::EndZoneTimestepBeforeZoneReporting) { + } else if (iCalledFrom == EMSManager::EMSCallFrom::EndZoneTimestepBeforeZoneReporting) { if (this->bHasEndOfZoneTimestepBeforeZoneReporting) { pFunctionName = this->pEndOfZoneTimestepBeforeZoneReporting; functionName = this->sHookEndOfZoneTimestepBeforeZoneReporting; } - } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::EndZoneTimestepAfterZoneReporting) { + } else if (iCalledFrom == EMSManager::EMSCallFrom::EndZoneTimestepAfterZoneReporting) { if (this->bHasEndOfZoneTimestepAfterZoneReporting) { pFunctionName = this->pEndOfZoneTimestepAfterZoneReporting; functionName = this->sHookEndOfZoneTimestepAfterZoneReporting; } - } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::ComponentGetInput) { + } else if (iCalledFrom == EMSManager::EMSCallFrom::ComponentGetInput) { if (this->bHasAfterComponentInputReadIn) { pFunctionName = this->pAfterComponentInputReadIn; functionName = this->sHookAfterComponentInputReadIn; } - } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel) { + } else if (iCalledFrom == EMSManager::EMSCallFrom::UserDefinedComponentModel) { if (this->bHasUserDefinedComponentModel) { pFunctionName = this->pUserDefinedComponentModel; functionName = this->sHookUserDefinedComponentModel; } - } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::UnitarySystemSizing) { + } else if (iCalledFrom == EMSManager::EMSCallFrom::UnitarySystemSizing) { if (this->bHasUnitarySystemSizing) { pFunctionName = this->pUnitarySystemSizing; functionName = this->sHookUnitarySystemSizing; } - } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::BeginZoneTimestepBeforeInitHeatBalance) { + } else if (iCalledFrom == EMSManager::EMSCallFrom::BeginZoneTimestepBeforeInitHeatBalance) { if (this->bHasBeginZoneTimestepBeforeInitHeatBalance) { pFunctionName = this->pBeginZoneTimestepBeforeInitHeatBalance; functionName = this->sHookBeginZoneTimestepBeforeInitHeatBalance; } - } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::BeginZoneTimestepAfterInitHeatBalance) { + } else if (iCalledFrom == EMSManager::EMSCallFrom::BeginZoneTimestepAfterInitHeatBalance) { if (this->bHasBeginZoneTimestepAfterInitHeatBalance) { pFunctionName = this->pBeginZoneTimestepAfterInitHeatBalance; functionName = this->sHookBeginZoneTimestepAfterInitHeatBalance; @@ -1340,7 +1340,7 @@ namespace PluginManagement { #if LINK_WITH_PYTHON == 1 void PluginManager::runSingleUserDefinedPlugin(EnergyPlusData &state, int index) { - plugins[index].run(state, DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel); + plugins[index].run(state, EMSManager::EMSCallFrom::UserDefinedComponentModel); } #else void PluginManager::runSingleUserDefinedPlugin(EnergyPlusData &EP_UNUSED(state), int EP_UNUSED(index)) diff --git a/src/EnergyPlus/PluginManager.hh b/src/EnergyPlus/PluginManager.hh index ead03f4897c..2f66e565456 100644 --- a/src/EnergyPlus/PluginManager.hh +++ b/src/EnergyPlus/PluginManager.hh @@ -48,11 +48,15 @@ #ifndef EPLUS_PLUGIN_MANAGER_HH #define EPLUS_PLUGIN_MANAGER_HH +// C++ Headers #include #include #include #include + +// EnergyPlus Headers #include +#include #include #if LINK_WITH_PYTHON @@ -76,8 +80,8 @@ struct EnergyPlusData; namespace PluginManagement { - void registerNewCallback(EnergyPlusData &state, DataGlobalConstants::EMSCallFrom iCalledFrom, const std::function& f); - void runAnyRegisteredCallbacks(EnergyPlusData &state, DataGlobalConstants::EMSCallFrom iCalledFrom, bool &anyRan); + void registerNewCallback(EnergyPlusData &state, EMSManager::EMSCallFrom iCalledFrom, const std::function& f); + void runAnyRegisteredCallbacks(EnergyPlusData &state, EMSManager::EMSCallFrom iCalledFrom, bool &anyRan); void onBeginEnvironment(); std::string pythonStringForUsage(); @@ -108,7 +112,7 @@ namespace PluginManagement { // methods static void reportPythonError(); - bool run(EnergyPlusData &state, DataGlobalConstants::EMSCallFrom iCallingPoint) const; // calls main() on this plugin instance + bool run(EnergyPlusData &state, EMSManager::EMSCallFrom iCallingPoint) const; // calls main() on this plugin instance // plugin calling point hooks const char * sHookBeginNewEnvironment = "on_begin_new_environment"; diff --git a/src/EnergyPlus/SimAirServingZones.cc b/src/EnergyPlus/SimAirServingZones.cc index 2952ff31c5c..2102f49dbb1 100644 --- a/src/EnergyPlus/SimAirServingZones.cc +++ b/src/EnergyPlus/SimAirServingZones.cc @@ -7129,7 +7129,7 @@ namespace SimAirServingZones { // EMS calling point to customize system sizing results bool anyEMSRan; - ManageEMS(state, DataGlobalConstants::EMSCallFrom::SystemSizing, anyEMSRan, ObjexxFCL::Optional_int_const()); + ManageEMS(state, EMSManager::EMSCallFrom::SystemSizing, anyEMSRan, ObjexxFCL::Optional_int_const()); // EMS override point if (AnyEnergyManagementSystemInModel) { diff --git a/src/EnergyPlus/SimulationManager.cc b/src/EnergyPlus/SimulationManager.cc index 1c15a203df0..6c216b896b2 100644 --- a/src/EnergyPlus/SimulationManager.cc +++ b/src/EnergyPlus/SimulationManager.cc @@ -453,7 +453,7 @@ namespace SimulationManager { CreateEnergyReportStructure(); bool anyEMSRan; ManageEMS(state, - DataGlobalConstants::EMSCallFrom::SetupSimulation, + EMSManager::EMSCallFrom::SetupSimulation, anyEMSRan, ObjexxFCL::Optional_int_const()); // point to finish setup processing EMS, sensor ready now @@ -544,7 +544,7 @@ namespace SimulationManager { HVACManager::ResetNodeData(); // Reset here, because some zone calcs rely on node data (e.g. ZoneITEquip) bool anyEMSRan; - ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginNewEnvironment, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point + ManageEMS(state, EMSManager::EMSCallFrom::BeginNewEnvironment, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point while ((DayOfSim < NumOfDayInEnvrn) || (WarmupFlag)) { // Begin day loop ... if (state.dataGlobal->stopSimulation) break; diff --git a/src/EnergyPlus/UnitarySystem.cc b/src/EnergyPlus/UnitarySystem.cc index 915ff6297dd..4e3250307fd 100644 --- a/src/EnergyPlus/UnitarySystem.cc +++ b/src/EnergyPlus/UnitarySystem.cc @@ -1527,7 +1527,7 @@ namespace UnitarySystems { EqSizing.OAVolFlow = 0.0; // UnitarySys doesn't have OA bool anyEMSRan; - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::UnitarySystemSizing, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::UnitarySystemSizing, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point bool HardSizeNoDesRun; // Indicator to a hard-sized field with no design sizing data // Initiate all reporting variables @@ -7426,7 +7426,7 @@ namespace UnitarySystems { } // can this be called each time a system is gottem? bool anyEMSRan; - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::ComponentGetInput, anyEMSRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::ComponentGetInput, anyEMSRan, ObjexxFCL::Optional_int_const()); } } } diff --git a/src/EnergyPlus/UserDefinedComponents.cc b/src/EnergyPlus/UserDefinedComponents.cc index abd3e3aff26..30807d6c60d 100644 --- a/src/EnergyPlus/UserDefinedComponents.cc +++ b/src/EnergyPlus/UserDefinedComponents.cc @@ -168,7 +168,7 @@ namespace UserDefinedComponents { if (thisLoop > 0) { if (this->Loop(thisLoop).ErlInitProgramMngr > 0) { EMSManager::ManageEMS( - state, DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, this->Loop(thisLoop).ErlInitProgramMngr); + state, EMSManager::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, this->Loop(thisLoop).ErlInitProgramMngr); } else if (this->Loop(thisLoop).initPluginLocation > -1) { EnergyPlus::PluginManagement::pluginManager->runSingleUserDefinedPlugin(state, this->Loop(thisLoop).initPluginLocation); } @@ -238,14 +238,14 @@ namespace UserDefinedComponents { if (thisLoop > 0) { if (this->Loop(thisLoop).ErlSimProgramMngr > 0) { EMSManager::ManageEMS( - state, DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, this->Loop(thisLoop).ErlSimProgramMngr); + state, EMSManager::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, this->Loop(thisLoop).ErlSimProgramMngr); } else if (this->Loop(thisLoop).simPluginLocation > -1) { EnergyPlus::PluginManagement::pluginManager->runSingleUserDefinedPlugin(state, this->Loop(thisLoop).simPluginLocation); } } if (this->ErlSimProgramMngr > 0) { - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, this->ErlSimProgramMngr); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, this->ErlSimProgramMngr); } else if (this->simPluginLocation > -1) { EnergyPlus::PluginManagement::pluginManager->runSingleUserDefinedPlugin(state, this->simPluginLocation); } @@ -299,7 +299,7 @@ namespace UserDefinedComponents { if (DataGlobals::BeginEnvrnFlag) { if (UserCoil(CompNum).ErlInitProgramMngr > 0) { EMSManager::ManageEMS( - state, DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, UserCoil(CompNum).ErlInitProgramMngr); + state, EMSManager::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, UserCoil(CompNum).ErlInitProgramMngr); } else if (UserCoil(CompNum).initPluginLocation > -1) { EnergyPlus::PluginManagement::pluginManager->runSingleUserDefinedPlugin(state, UserCoil(CompNum).initPluginLocation); } @@ -322,7 +322,7 @@ namespace UserDefinedComponents { UserCoil(CompNum).initialize(state); if (UserCoil(CompNum).ErlSimProgramMngr > 0) { - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, UserCoil(CompNum).ErlSimProgramMngr); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, UserCoil(CompNum).ErlSimProgramMngr); } else if (UserCoil(CompNum).simPluginLocation > -1) { EnergyPlus::PluginManagement::pluginManager->runSingleUserDefinedPlugin(state, UserCoil(CompNum).simPluginLocation); } @@ -391,7 +391,7 @@ namespace UserDefinedComponents { if (UserZoneAirHVAC(CompNum).ErlInitProgramMngr > 0) { EMSManager::ManageEMS( - state, DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, UserZoneAirHVAC(CompNum).ErlInitProgramMngr); + state, EMSManager::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, UserZoneAirHVAC(CompNum).ErlInitProgramMngr); } else if (UserZoneAirHVAC(CompNum).initPluginLocation > -1) { EnergyPlus::PluginManagement::pluginManager->runSingleUserDefinedPlugin(state, UserZoneAirHVAC(CompNum).initPluginLocation); } @@ -418,7 +418,7 @@ namespace UserDefinedComponents { if (UserZoneAirHVAC(CompNum).ErlSimProgramMngr > 0) { EMSManager::ManageEMS( - state, DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, UserZoneAirHVAC(CompNum).ErlSimProgramMngr); + state, EMSManager::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, UserZoneAirHVAC(CompNum).ErlSimProgramMngr); } else if (UserZoneAirHVAC(CompNum).simPluginLocation > -1) { EnergyPlus::PluginManagement::pluginManager->runSingleUserDefinedPlugin(state, UserZoneAirHVAC(CompNum).simPluginLocation); } @@ -487,7 +487,7 @@ namespace UserDefinedComponents { if (UserAirTerminal(CompNum).ErlInitProgramMngr > 0) { EMSManager::ManageEMS( - state, DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, UserAirTerminal(CompNum).ErlInitProgramMngr); + state, EMSManager::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, UserAirTerminal(CompNum).ErlInitProgramMngr); } else if (UserAirTerminal(CompNum).initPluginLocation > -1) { EnergyPlus::PluginManagement::pluginManager->runSingleUserDefinedPlugin(state, UserAirTerminal(CompNum).initPluginLocation); } @@ -514,7 +514,7 @@ namespace UserDefinedComponents { if (UserAirTerminal(CompNum).ErlSimProgramMngr > 0) { EMSManager::ManageEMS( - state, DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, UserAirTerminal(CompNum).ErlSimProgramMngr); + state, EMSManager::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, UserAirTerminal(CompNum).ErlSimProgramMngr); } else if (UserAirTerminal(CompNum).simPluginLocation > -1) { EnergyPlus::PluginManagement::pluginManager->runSingleUserDefinedPlugin(state, UserAirTerminal(CompNum).simPluginLocation); } diff --git a/src/EnergyPlus/WeatherManager.cc b/src/EnergyPlus/WeatherManager.cc index 16147313594..6f5e5d970cb 100644 --- a/src/EnergyPlus/WeatherManager.cc +++ b/src/EnergyPlus/WeatherManager.cc @@ -145,7 +145,7 @@ namespace WeatherManager { // Cannot call this during sizing, because EMS will not initialize properly until after simulation kickoff if (!DataGlobals::DoingSizing && !DataGlobals::KickOffSimulation) { EMSManager::ManageEMS( - state, DataGlobalConstants::EMSCallFrom::BeginZoneTimestepBeforeSetCurrentWeather, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point + state, EMSManager::EMSCallFrom::BeginZoneTimestepBeforeSetCurrentWeather, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point } SetCurrentWeather(state); diff --git a/src/EnergyPlus/ZoneEquipmentManager.cc b/src/EnergyPlus/ZoneEquipmentManager.cc index e1232da12e2..aed79b498af 100644 --- a/src/EnergyPlus/ZoneEquipmentManager.cc +++ b/src/EnergyPlus/ZoneEquipmentManager.cc @@ -1785,7 +1785,7 @@ namespace ZoneEquipmentManager { // candidate EMS calling point to customize CalcFinalZoneSizing bool anyEMSRan; - ManageEMS(state, DataGlobalConstants::EMSCallFrom::ZoneSizing, anyEMSRan, ObjexxFCL::Optional_int_const()); + ManageEMS(state, EMSManager::EMSCallFrom::ZoneSizing, anyEMSRan, ObjexxFCL::Optional_int_const()); // now apply EMS overrides (if any) diff --git a/src/EnergyPlus/api/runtime.cc b/src/EnergyPlus/api/runtime.cc index d3b763b9648..59f668fefe2 100644 --- a/src/EnergyPlus/api/runtime.cc +++ b/src/EnergyPlus/api/runtime.cc @@ -108,162 +108,162 @@ void registerExternalHVACManager(EnergyPlusState state, void (*f)(EnergyPlusStat void callbackBeginNewEnvironment(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeginNewEnvironment, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::BeginNewEnvironment, f); } void callbackBeginNewEnvironment(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeginNewEnvironment, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::BeginNewEnvironment, f); } void callbackBeginZoneTimestepBeforeSetCurrentWeather(EnergyPlusState state, std::function const& f) { auto* thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeginZoneTimestepBeforeSetCurrentWeather, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::BeginZoneTimestepBeforeSetCurrentWeather, f); } void callbackBeginZoneTimestepBeforeSetCurrentWeather(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto* thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeginZoneTimestepBeforeSetCurrentWeather, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::BeginZoneTimestepBeforeSetCurrentWeather, f); } void callbackAfterNewEnvironmentWarmupComplete(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeginNewEnvironmentAfterWarmUp, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::BeginNewEnvironmentAfterWarmUp, f); } void callbackAfterNewEnvironmentWarmupComplete(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeginNewEnvironmentAfterWarmUp, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::BeginNewEnvironmentAfterWarmUp, f); } void callbackBeginZoneTimeStepBeforeInitHeatBalance(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeginZoneTimestepBeforeInitHeatBalance, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::BeginZoneTimestepBeforeInitHeatBalance, f); } void callbackBeginZoneTimeStepBeforeInitHeatBalance(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeginZoneTimestepBeforeInitHeatBalance, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::BeginZoneTimestepBeforeInitHeatBalance, f); } void callbackBeginZoneTimeStepAfterInitHeatBalance(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeginZoneTimestepAfterInitHeatBalance, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::BeginZoneTimestepAfterInitHeatBalance, f); } void callbackBeginZoneTimeStepAfterInitHeatBalance(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeginZoneTimestepAfterInitHeatBalance, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::BeginZoneTimestepAfterInitHeatBalance, f); } void callbackBeginTimeStepBeforePredictor(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeginTimestepBeforePredictor, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::BeginTimestepBeforePredictor, f); } void callbackBeginTimeStepBeforePredictor(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeginTimestepBeforePredictor, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::BeginTimestepBeforePredictor, f); } void callbackAfterPredictorBeforeHVACManagers(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeforeHVACManagers, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::BeforeHVACManagers, f); } void callbackAfterPredictorBeforeHVACManagers(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeforeHVACManagers, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::BeforeHVACManagers, f); } void callbackAfterPredictorAfterHVACManagers(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::AfterHVACManagers, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::AfterHVACManagers, f); } void callbackAfterPredictorAfterHVACManagers(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::AfterHVACManagers, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::AfterHVACManagers, f); } void callbackInsideSystemIterationLoop(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::HVACIterationLoop, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::HVACIterationLoop, f); } void callbackInsideSystemIterationLoop(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::HVACIterationLoop, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::HVACIterationLoop, f); } void callbackEndOfZoneTimeStepBeforeZoneReporting(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::EndZoneTimestepBeforeZoneReporting, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::EndZoneTimestepBeforeZoneReporting, f); } void callbackEndOfZoneTimeStepBeforeZoneReporting(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::EndZoneTimestepBeforeZoneReporting, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::EndZoneTimestepBeforeZoneReporting, f); } void callbackEndOfZoneTimeStepAfterZoneReporting(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::EndZoneTimestepAfterZoneReporting, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::EndZoneTimestepAfterZoneReporting, f); } void callbackEndOfZoneTimeStepAfterZoneReporting(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::EndZoneTimestepAfterZoneReporting, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::EndZoneTimestepAfterZoneReporting, f); } void callbackEndOfSystemTimeStepBeforeHVACReporting(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::EndSystemTimestepBeforeHVACReporting, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::EndSystemTimestepBeforeHVACReporting, f); } void callbackEndOfSystemTimeStepBeforeHVACReporting(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::EndSystemTimestepBeforeHVACReporting, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::EndSystemTimestepBeforeHVACReporting, f); } void callbackEndOfSystemTimeStepAfterHVACReporting(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::EndSystemTimestepAfterHVACReporting, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::EndSystemTimestepAfterHVACReporting, f); } void callbackEndOfSystemTimeStepAfterHVACReporting(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::EndSystemTimestepAfterHVACReporting, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::EndSystemTimestepAfterHVACReporting, f); } void callbackEndOfZoneSizing(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::ZoneSizing, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::ZoneSizing, f); } void callbackEndOfZoneSizing(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::ZoneSizing, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::ZoneSizing, f); } void callbackEndOfSystemSizing(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::SystemSizing, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::SystemSizing, f); } void callbackEndOfSystemSizing(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::SystemSizing, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::SystemSizing, f); } void callbackEndOfAfterComponentGetInput(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::ComponentGetInput, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::ComponentGetInput, f); } void callbackEndOfAfterComponentGetInput(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::ComponentGetInput, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::ComponentGetInput, f); } //void callbackUserDefinedComponentModel(EnergyPlusState state, std::function f) { @@ -276,10 +276,10 @@ void callbackEndOfAfterComponentGetInput(EnergyPlusState state, void (*f)(Energy void callbackUnitarySystemSizing(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::UnitarySystemSizing, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::UnitarySystemSizing, f); } void callbackUnitarySystemSizing(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::UnitarySystemSizing, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::UnitarySystemSizing, f); } diff --git a/tst/EnergyPlus/unit/EMSManager.unit.cc b/tst/EnergyPlus/unit/EMSManager.unit.cc index d690ecd3610..0f25ec2966d 100644 --- a/tst/EnergyPlus/unit/EMSManager.unit.cc +++ b/tst/EnergyPlus/unit/EMSManager.unit.cc @@ -165,9 +165,9 @@ TEST_F(EnergyPlusFixture, Dual_NodeTempSetpoints) EMSManager::FinishProcessingUserInput = true; bool anyRan; - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginNewEnvironment, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::BeginNewEnvironment, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_NEAR(DataLoopNode::Node(1).TempSetPointHi, 20.0, 0.000001); @@ -283,13 +283,13 @@ TEST_F(EnergyPlusFixture, SupervisoryControl_PlantComponent_SetActuatedBranchFlo bool anyRan; // set up EMS - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); // set dummy EMS value PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue = 1.0; // dummy value set above should be zero'd on this call since EMS 0's values on begin environment (whether EMS program runs on this call or not) - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginNewEnvironment, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::BeginNewEnvironment, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_FALSE(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideOn); EXPECT_NEAR(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue, 0.0, 0.000001); @@ -319,7 +319,7 @@ TEST_F(EnergyPlusFixture, SupervisoryControl_PlantComponent_SetActuatedBranchFlo PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue = 1.0; // dummy value set above should remain on this call since EMS calling manager uses BeginTimestepBeforePredictor as the calling point - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginNewEnvironmentAfterWarmUp, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::BeginNewEnvironmentAfterWarmUp, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_FALSE(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideOn); EXPECT_NEAR(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue, 1.0, 0.000001); @@ -344,7 +344,7 @@ TEST_F(EnergyPlusFixture, SupervisoryControl_PlantComponent_SetActuatedBranchFlo // dummy value set above should reset to 0 on this call since EMS calling manager uses BeginTimestepBeforePredictor as the calling point // override flag should also be true - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginTimestepBeforePredictor, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::BeginTimestepBeforePredictor, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_TRUE(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideOn); EXPECT_NEAR(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue, 0.0, 0.000001); @@ -447,12 +447,12 @@ TEST_F(EnergyPlusFixture, SupervisoryControl_PlantComponent_SetComponentFlowRate bool anyRan; // set up EMS - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); // set dummy EMS value PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue = 1.0; // dummy value set above should be zero'd on this call since EMS 0's values on begin environment (whether EMS program runs on this call or not) - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginNewEnvironment, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::BeginNewEnvironment, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_FALSE(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideOn); EXPECT_NEAR(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue, 0.0, 0.000001); @@ -482,7 +482,7 @@ TEST_F(EnergyPlusFixture, SupervisoryControl_PlantComponent_SetComponentFlowRate PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue = 1.0; // dummy value set above should remain on this call since EMS calling manager uses BeginTimestepBeforePredictor as the calling point - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginNewEnvironmentAfterWarmUp, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::BeginNewEnvironmentAfterWarmUp, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_FALSE(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideOn); EXPECT_NEAR(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue, 1.0, 0.000001); @@ -509,7 +509,7 @@ TEST_F(EnergyPlusFixture, SupervisoryControl_PlantComponent_SetComponentFlowRate // dummy value set above should reset to 0 on this call since EMS calling manager uses BeginTimestepBeforePredictor as the calling point // override flag should also be true - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginTimestepBeforePredictor, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::BeginTimestepBeforePredictor, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_TRUE(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideOn); EXPECT_NEAR(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue, 0.0, 0.000001); @@ -707,8 +707,8 @@ TEST_F(EnergyPlusFixture, Test_EMSLogic) EMSManager::CheckIfAnyEMS(state); EMSManager::FinishProcessingUserInput = true; bool anyRan; - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginNewEnvironment, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::BeginNewEnvironment, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_NEAR(DataLoopNode::Node(1).TempSetPoint, 11.0, 0.0000001); EXPECT_NEAR(DataLoopNode::Node(2).TempSetPoint, 12.0, 0.0000001); @@ -718,7 +718,7 @@ TEST_F(EnergyPlusFixture, Test_EMSLogic) EXPECT_NEAR(DataLoopNode::Node(6).TempSetPoint, 16.0, 0.0000001); EXPECT_NEAR(DataLoopNode::Node(7).TempSetPoint, 17.0, 0.0000001); - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginTimestepBeforePredictor, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::BeginTimestepBeforePredictor, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_NEAR(DataLoopNode::Node(1).TempSetPoint, 21.0, 0.0000001); EXPECT_NEAR(DataLoopNode::Node(2).TempSetPoint, 22.0, 0.0000001); @@ -775,8 +775,8 @@ TEST_F(EnergyPlusFixture, Debug_EMSLogic) EMSManager::CheckIfAnyEMS(state); EMSManager::FinishProcessingUserInput = true; bool anyRan; - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginNewEnvironment, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::BeginNewEnvironment, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_NEAR(DataLoopNode::Node(1).TempSetPoint, 1.0, 0.0000001); } @@ -815,13 +815,13 @@ TEST_F(EnergyPlusFixture, TestAnyRanArgument) EMSManager::FinishProcessingUserInput = true; bool anyRan; - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_FALSE(anyRan); - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginNewEnvironment, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::BeginNewEnvironment, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_FALSE(anyRan); - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::HVACIterationLoop, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::HVACIterationLoop, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_TRUE(anyRan); } @@ -850,14 +850,14 @@ TEST_F(EnergyPlusFixture, TestUnInitializedEMSVariable1) EMSManager::CheckIfAnyEMS(state); EMSManager::FinishProcessingUserInput = true; bool anyRan; - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); // Find the variable in the list int internalVarNum = RuntimeLanguageProcessor::FindEMSVariable("TempSetpoint1", 0); ASSERT_GT(internalVarNum, 0); // Expect the variable to not yet be initialized EXPECT_FALSE(ErlVariable(internalVarNum).Value.initialized); // next run a small program that sets the value - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginNewEnvironment, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::BeginNewEnvironment, anyRan, ObjexxFCL::Optional_int_const()); // check that it worked and the value came thru EXPECT_NEAR(ErlVariable(internalVarNum).Value.Number, 21.0, 0.0000001); // check of state to see if now initialized @@ -908,7 +908,7 @@ TEST_F(EnergyPlusFixture, TestUnInitializedEMSVariable2) EMSManager::CheckIfAnyEMS(state); EMSManager::FinishProcessingUserInput = true; bool anyRan; - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); // Expect the variable to not yet be initialized, call EvaluateExpresssion and check argument ErlValueType ReturnValue; @@ -920,7 +920,7 @@ TEST_F(EnergyPlusFixture, TestUnInitializedEMSVariable2) EXPECT_TRUE(seriousErrorFound); // next run a small program that sets the global variable value - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginTimestepBeforePredictor, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::BeginTimestepBeforePredictor, anyRan, ObjexxFCL::Optional_int_const()); // now check that it worked, should stay false seriousErrorFound = false; ReturnValue = RuntimeLanguageProcessor::EvaluateExpression(state, @@ -1091,7 +1091,7 @@ TEST_F(EnergyPlusFixture, EMSManager_TestFuntionCall) EXPECT_FALSE(ErrorsFound); bool anyRan; - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::HVACIterationLoop, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::HVACIterationLoop, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_TRUE(anyRan); for (int i = 1; i <= 6; ++i) { @@ -1102,7 +1102,7 @@ TEST_F(EnergyPlusFixture, EMSManager_TestFuntionCall) } EMSManager::ManageEMS(state, - DataGlobalConstants::EMSCallFrom::HVACIterationLoop, + EMSManager::EMSCallFrom::HVACIterationLoop, anyRan, ObjexxFCL::Optional_int_const()); // process trend functions again using above data EXPECT_TRUE(anyRan); diff --git a/tst/EnergyPlus/unit/HVACFan.unit.cc b/tst/EnergyPlus/unit/HVACFan.unit.cc index 0d5d4e34c8e..bf716910ba2 100644 --- a/tst/EnergyPlus/unit/HVACFan.unit.cc +++ b/tst/EnergyPlus/unit/HVACFan.unit.cc @@ -630,8 +630,8 @@ TEST_F(EnergyPlusFixture, SystemFanObj_DiscreteMode_EMSPressureRiseResetTest) // reset the pressure rise to -100.0 using EMS program bool anyRan(false); - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginTimestepBeforePredictor, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::BeginTimestepBeforePredictor, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_TRUE(anyRan); // simulate the fan with -100.0 Pa fan pressure rise HVACFan::fanObjs[0]->simulate(state, _, _, _, _, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); diff --git a/tst/EnergyPlus/unit/NodeInputManager.unit.cc b/tst/EnergyPlus/unit/NodeInputManager.unit.cc index 9a924dccb5c..e14f6296856 100644 --- a/tst/EnergyPlus/unit/NodeInputManager.unit.cc +++ b/tst/EnergyPlus/unit/NodeInputManager.unit.cc @@ -104,7 +104,7 @@ TEST_F(EnergyPlusFixture, NodeMoreInfoEMSsensorCheck1) EMSManager::FinishProcessingUserInput = true; bool anyEMSRan; - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::SetupSimulation, anyEMSRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::SetupSimulation, anyEMSRan, ObjexxFCL::Optional_int_const()); DataLoopNode::Node(1).Temp = 20.0; DataLoopNode::Node(1).HumRat = 0.01; diff --git a/tst/EnergyPlus/unit/api/datatransfer.unit.cc b/tst/EnergyPlus/unit/api/datatransfer.unit.cc index 298f918c7a3..ab2fd7f5531 100644 --- a/tst/EnergyPlus/unit/api/datatransfer.unit.cc +++ b/tst/EnergyPlus/unit/api/datatransfer.unit.cc @@ -662,7 +662,7 @@ TEST_F(DataExchangeAPIUnitTestFixture, DataTransfer_Python_EMS_Override) EMSManager::FinishProcessingUserInput = true; bool anyRan; // Calls SetupNodeSetpointsAsActuator (via InitEMS, which calls GetEMSInput too) - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::SetupSimulation, anyRan); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::SetupSimulation, anyRan); EXPECT_GT(EnergyPlus::DataRuntimeLanguage::numEMSActuatorsAvailable, 0); EXPECT_EQ(1, DataRuntimeLanguage::numActuatorsUsed); @@ -707,7 +707,7 @@ TEST_F(DataExchangeAPIUnitTestFixture, DataTransfer_Python_Python_Override) EMSManager::FinishProcessingUserInput = true; bool anyRan; // Calls SetupNodeSetpointsAsActuator (via InitEMS, which calls GetEMSInput too) - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::SetupSimulation, anyRan); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::SetupSimulation, anyRan); EXPECT_GT(EnergyPlus::DataRuntimeLanguage::numEMSActuatorsAvailable, 0); EXPECT_EQ(0, DataRuntimeLanguage::numActuatorsUsed); From a9ba76d8614b7586bf494fb292b48c7adcbf13ed Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Sun, 11 Oct 2020 15:47:26 -0600 Subject: [PATCH 10/15] move generator type ints from DataGlobalConstants to ElectricPowerServiceManager --- src/EnergyPlus/CTElectricGenerator.hh | 10 ++- src/EnergyPlus/ChillerExhaustAbsorption.cc | 6 +- src/EnergyPlus/ChillerExhaustAbsorption.hh | 11 +-- src/EnergyPlus/DataGlobalConstants.cc | 9 --- src/EnergyPlus/DataGlobalConstants.hh | 9 --- src/EnergyPlus/ElectricPowerServiceManager.cc | 71 ++++++++++--------- src/EnergyPlus/ElectricPowerServiceManager.hh | 27 +++---- src/EnergyPlus/GeneratorDynamicsManager.cc | 20 +++--- src/EnergyPlus/GeneratorDynamicsManager.hh | 5 +- src/EnergyPlus/ICEngineElectricGenerator.hh | 8 +-- src/EnergyPlus/MicroCHPElectricGenerator.cc | 6 +- .../MicroturbineElectricGenerator.hh | 8 +-- src/EnergyPlus/Photovoltaics.cc | 4 +- src/EnergyPlus/Photovoltaics.hh | 7 +- src/EnergyPlus/WindTurbine.cc | 4 +- src/EnergyPlus/WindTurbine.hh | 40 ++++++----- 16 files changed, 115 insertions(+), 130 deletions(-) diff --git a/src/EnergyPlus/CTElectricGenerator.hh b/src/EnergyPlus/CTElectricGenerator.hh index e9cfd03ae4d..b556a3981bf 100644 --- a/src/EnergyPlus/CTElectricGenerator.hh +++ b/src/EnergyPlus/CTElectricGenerator.hh @@ -52,9 +52,9 @@ #include // EnergyPlus Headers -#include -#include #include +#include +#include #include #include @@ -65,14 +65,12 @@ struct EnergyPlusData; namespace CTElectricGenerator { - using DataGlobalConstants::iGeneratorCombTurbine; - struct CTGeneratorData : PlantComponent { // Members std::string Name; // user identifier std::string TypeOf; // Type of Generator - int CompType_Num; + GeneratorType CompType_Num; std::string FuelType; // Type of Fuel - DIESEL, GASOLINE, GAS Real64 RatedPowerOutput; // W - design nominal capacity of Generator int ElectricCircuitNode; // Electric Circuit Node @@ -131,7 +129,7 @@ namespace CTElectricGenerator { // Default Constructor CTGeneratorData() - : TypeOf("Generator:CombustionTurbine"), CompType_Num(iGeneratorCombTurbine), RatedPowerOutput(0.0), ElectricCircuitNode(0), + : TypeOf("Generator:CombustionTurbine"), CompType_Num(GeneratorType::CombTurbine), RatedPowerOutput(0.0), ElectricCircuitNode(0), MinPartLoadRat(0.0), MaxPartLoadRat(0.0), OptPartLoadRat(0.0), FuelEnergyUseRate(0.0), FuelEnergy(0.0), PLBasedFuelInputCurve(0), TempBasedFuelInputCurve(0), ExhaustFlow(0.0), ExhaustFlowCurve(0), ExhaustTemp(0.0), PLBasedExhaustTempCurve(0), TempBasedExhaustTempCurve(0), QLubeOilRecovered(0.0), QExhaustRecovered(0.0), QTotalHeatRecovered(0.0), LubeOilEnergyRec(0.0), diff --git a/src/EnergyPlus/ChillerExhaustAbsorption.cc b/src/EnergyPlus/ChillerExhaustAbsorption.cc index d209dfd694b..364dd6bb072 100644 --- a/src/EnergyPlus/ChillerExhaustAbsorption.cc +++ b/src/EnergyPlus/ChillerExhaustAbsorption.cc @@ -457,10 +457,10 @@ namespace ChillerExhaustAbsorption { thisChiller.TypeOf = cAlphaArgs(17); if (UtilityRoutines::SameString(cAlphaArgs(17), "Generator:MicroTurbine")) { - thisChiller.CompType_Num = DataGlobalConstants::iGeneratorMicroturbine; - thisChiller.ExhuastSourceName = cAlphaArgs(18); + thisChiller.CompType_Num = GeneratorType::Microturbine; + thisChiller.ExhaustSourceName = cAlphaArgs(18); - auto thisMTG = MicroturbineElectricGenerator::MTGeneratorSpecs::factory(state, thisChiller.ExhuastSourceName); + auto thisMTG = MicroturbineElectricGenerator::MTGeneratorSpecs::factory(state, thisChiller.ExhaustSourceName); thisChiller.ExhaustAirInletNodeNum = dynamic_cast(thisMTG)->CombustionAirOutletNodeNum; } diff --git a/src/EnergyPlus/ChillerExhaustAbsorption.hh b/src/EnergyPlus/ChillerExhaustAbsorption.hh index 659d3a892ae..f8c6884ccd0 100644 --- a/src/EnergyPlus/ChillerExhaustAbsorption.hh +++ b/src/EnergyPlus/ChillerExhaustAbsorption.hh @@ -54,6 +54,7 @@ // EnergyPlus Headers #include #include +#include #include #include #include @@ -140,11 +141,11 @@ namespace ChillerExhaustAbsorption { int HWLoopSideNum; // hot water plant loop side index int HWBranchNum; // hot water plant loop branch index int HWCompNum; // hot water plant loop component index - int CompType_Num; // Numeric designator for CompType (TypeOf) - int ExhTempLTAbsLeavingTempIndex; // index for exhaust potentail less than thermal energy needed during cooling - int ExhTempLTAbsLeavingHeatingTempIndex; // index for exhaust potentail less than thermal energy needed during heating + GeneratorType CompType_Num; // Numeric designator for CompType (TypeOf) + int ExhTempLTAbsLeavingTempIndex; // index for exhaust potential less than thermal energy needed during cooling + int ExhTempLTAbsLeavingHeatingTempIndex; // index for exhaust potential less than thermal energy needed during heating std::string TypeOf; // Generator type - std::string ExhuastSourceName; // Generator type Name + std::string ExhaustSourceName; // Generator type Name bool oneTimeInit; bool envrnInit; bool plantScanInit; @@ -202,7 +203,7 @@ namespace ChillerExhaustAbsorption { isWaterCooled(false), CHWLowLimitTemp(0.0), ExhaustAirInletNodeNum(0), DesCondMassFlowRate(0.0), DesHeatMassFlowRate(0.0), DesEvapMassFlowRate(0.0), DeltaTempCoolErrCount(0), DeltaTempHeatErrCount(0), CondErrCount(0), PossibleSubcooling(false), CWLoopNum(0), CWLoopSideNum(0), CWBranchNum(0), CWCompNum(0), CDLoopNum(0), CDLoopSideNum(0), CDBranchNum(0), CDCompNum(0), HWLoopNum(0), - HWLoopSideNum(0), HWBranchNum(0), HWCompNum(0), CompType_Num(0), ExhTempLTAbsLeavingTempIndex(0), + HWLoopSideNum(0), HWBranchNum(0), HWCompNum(0), CompType_Num(GeneratorType::Unassigned), ExhTempLTAbsLeavingTempIndex(0), ExhTempLTAbsLeavingHeatingTempIndex(0), oneTimeInit(true), envrnInit(true), plantScanInit(true), oldCondSupplyTemp(0.0), CoolingLoad(0.0), CoolingEnergy(0.0), HeatingLoad(0.0), HeatingEnergy(0.0), TowerLoad(0.0), TowerEnergy(0.0), ThermalEnergyUseRate(0.0), ThermalEnergy(0.0), CoolThermalEnergyUseRate(0.0), CoolThermalEnergy(0.0), HeatThermalEnergyUseRate(0.0), HeatThermalEnergy(0.0), diff --git a/src/EnergyPlus/DataGlobalConstants.cc b/src/EnergyPlus/DataGlobalConstants.cc index 242a70f97ba..9822be5fd34 100644 --- a/src/EnergyPlus/DataGlobalConstants.cc +++ b/src/EnergyPlus/DataGlobalConstants.cc @@ -294,15 +294,6 @@ namespace DataGlobalConstants { cRT_OtherFuel1, cRT_OtherFuel2}); - int const iGeneratorICEngine(1); - int const iGeneratorCombTurbine(2); - int const iGeneratorPV(3); - int const iGeneratorFuelCell(4); - int const iGeneratorMicroCHP(5); - int const iGeneratorMicroturbine(6); - int const iGeneratorWindTurbine(7); - int const iGeneratorPVWatts(8); - int AssignResourceTypeNum(std::string const &ResourceTypeChar) { diff --git a/src/EnergyPlus/DataGlobalConstants.hh b/src/EnergyPlus/DataGlobalConstants.hh index d17b3b5e860..ccca48ee8ea 100644 --- a/src/EnergyPlus/DataGlobalConstants.hh +++ b/src/EnergyPlus/DataGlobalConstants.hh @@ -224,15 +224,6 @@ namespace DataGlobalConstants { extern int const ResourceTypeInitialOffset; // to reach "ValidTypes" extern Array1D_string const cRT_ValidTypes; - extern int const iGeneratorICEngine; - extern int const iGeneratorCombTurbine; - extern int const iGeneratorPV; - extern int const iGeneratorFuelCell; - extern int const iGeneratorMicroCHP; - extern int const iGeneratorMicroturbine; - extern int const iGeneratorWindTurbine; - extern int const iGeneratorPVWatts; - enum class CallIndicator { BeginDay, DuringDay, diff --git a/src/EnergyPlus/ElectricPowerServiceManager.cc b/src/EnergyPlus/ElectricPowerServiceManager.cc index aa20fd84a0e..ade5fff72c9 100644 --- a/src/EnergyPlus/ElectricPowerServiceManager.cc +++ b/src/EnergyPlus/ElectricPowerServiceManager.cc @@ -469,10 +469,10 @@ void ElectricPowerServiceManager::reportPVandWindCapacity() for (auto &lc : elecLoadCenterObjs) { if (lc->numGenerators > 0) { for (auto &g : lc->elecGenCntrlObj) { - if (g->compGenTypeOf_Num == DataGlobalConstants::iGeneratorPV) { + if (g->compGenTypeOf_Num == GeneratorType::PV) { pvTotalCapacity_ += g->maxPowerOut; } - if (g->compGenTypeOf_Num == DataGlobalConstants::iGeneratorWindTurbine) { + if (g->compGenTypeOf_Num == GeneratorType::WindTurbine) { windTotalCapacity_ += g->maxPowerOut; } } @@ -937,7 +937,7 @@ ElectPowerLoadCenter::ElectPowerLoadCenter(EnergyPlusData &state, int const obje if (inverterObj->modelType() == DCtoACInverter::InverterModelType::pvWatts) { Real64 totalDCCapacity = 0.0; for (const auto &generatorController : elecGenCntrlObj) { - if (generatorController->generatorType != GeneratorController::GeneratorType::pvWatts) { + if (generatorController->generatorType != GeneratorType::PVWatts) { errorsFound = true; ShowSevereError(routineName + "ElectricLoadCenter:Distribution=\"" + name_ + "\","); ShowContinueError("ElectricLoadCenter:Inverter:PVWatts can only be used with Generator:PVWatts"); @@ -1977,7 +1977,8 @@ GeneratorController::GeneratorController(EnergyPlusData &state, Real64 ratedElecPowerOutput, std::string const &availSchedName, Real64 thermalToElectRatio) - : compGenTypeOf_Num(0), compPlantTypeOf_Num(0), generatorType(GeneratorType::notYetSet), generatorIndex(0), maxPowerOut(0.0), availSchedPtr(0), + : compGenTypeOf_Num(GeneratorType::Unassigned), compPlantTypeOf_Num(0), generatorType(GeneratorType::Unassigned), + generatorIndex(0), maxPowerOut(0.0), availSchedPtr(0), powerRequestThisTimestep(0.0), onThisTimestep(false), eMSPowerRequest(0.0), eMSRequestOn(false), plantInfoFound(false), cogenLocation(PlantLocation(0, 0, 0, 0)), nominalThermElectRatio(0.0), dCElectricityProd(0.0), dCElectProdRate(0.0), electricityProd(0.0), electProdRate(0.0), thermalProd(0.0), thermProdRate(0.0), errCountNegElectProd_(0) @@ -1988,32 +1989,32 @@ GeneratorController::GeneratorController(EnergyPlusData &state, name = objectName; typeOfName = objectType; if (UtilityRoutines::SameString(objectType, "Generator:InternalCombustionEngine")) { - generatorType = GeneratorType::iCEngine; - compGenTypeOf_Num = DataGlobalConstants::iGeneratorICEngine; + generatorType = GeneratorType::ICEngine; + compGenTypeOf_Num = GeneratorType::ICEngine; compPlantTypeOf_Num = DataPlant::TypeOf_Generator_ICEngine; compPlantName = name; } else if (UtilityRoutines::SameString(objectType, "Generator:CombustionTurbine")) { - generatorType = GeneratorType::combTurbine; - compGenTypeOf_Num = DataGlobalConstants::iGeneratorCombTurbine; + generatorType = GeneratorType::CombTurbine; + compGenTypeOf_Num = GeneratorType::CombTurbine; compPlantTypeOf_Num = DataPlant::TypeOf_Generator_CTurbine; compPlantName = name; } else if (UtilityRoutines::SameString(objectType, "Generator:MicroTurbine")) { - generatorType = GeneratorType::microturbine; - compGenTypeOf_Num = DataGlobalConstants::iGeneratorMicroturbine; + generatorType = GeneratorType::Microturbine; + compGenTypeOf_Num = GeneratorType::Microturbine; compPlantTypeOf_Num = DataPlant::TypeOf_Generator_MicroTurbine; compPlantName = name; } else if (UtilityRoutines::SameString(objectType, "Generator:Photovoltaic")) { - generatorType = GeneratorType::pV; - compGenTypeOf_Num = DataGlobalConstants::iGeneratorPV; + generatorType = GeneratorType::PV; + compGenTypeOf_Num = GeneratorType::PV; compPlantTypeOf_Num = DataPlant::TypeOf_PVTSolarCollectorFlatPlate; compPlantName = name; } else if (UtilityRoutines::SameString(objectType, "Generator:PVWatts")) { - generatorType = GeneratorType::pvWatts; - compGenTypeOf_Num = DataGlobalConstants::iGeneratorPVWatts; + generatorType = GeneratorType::PVWatts; + compGenTypeOf_Num = GeneratorType::PVWatts; compPlantTypeOf_Num = DataPlant::TypeOf_Other; } else if (UtilityRoutines::SameString(objectType, "Generator:FuelCell")) { - generatorType = GeneratorType::fuelCell; - compGenTypeOf_Num = DataGlobalConstants::iGeneratorFuelCell; + generatorType = GeneratorType::FuelCell; + compGenTypeOf_Num = GeneratorType::FuelCell; // fuel cell has two possible plant component types, stack cooler and exhaust gas HX. // exhaust gas HX is required and it assumed that it has more thermal capacity and is used for control compPlantTypeOf_Num = DataPlant::TypeOf_Generator_FCExhaust; @@ -2021,13 +2022,13 @@ GeneratorController::GeneratorController(EnergyPlusData &state, auto thisFC = FuelCellElectricGenerator::FCDataStruct::factory(state, name); compPlantName = dynamic_cast (thisFC)->ExhaustHX.Name; } else if (UtilityRoutines::SameString(objectType, "Generator:MicroCHP")) { - generatorType = GeneratorType::microCHP; - compGenTypeOf_Num = DataGlobalConstants::iGeneratorMicroCHP; + generatorType = GeneratorType::MicroCHP; + compGenTypeOf_Num = GeneratorType::MicroCHP; compPlantTypeOf_Num = DataPlant::TypeOf_Generator_MicroCHP; compPlantName = name; } else if (UtilityRoutines::SameString(objectType, "Generator:WindTurbine")) { - generatorType = GeneratorType::windTurbine; - compGenTypeOf_Num = DataGlobalConstants::iGeneratorWindTurbine; + generatorType = GeneratorType::WindTurbine; + compGenTypeOf_Num = GeneratorType::WindTurbine; compPlantTypeOf_Num = DataPlant::TypeOf_Other; } else { ShowSevereError(routineName + DataIPShortCuts::cCurrentModuleObject + " invalid entry."); @@ -2044,9 +2045,9 @@ GeneratorController::GeneratorController(EnergyPlusData &state, ShowContinueError("Invalid availability schedule = " + availSchedName); ShowContinueError("Schedule was not found "); } else { - if (generatorType == GeneratorType::pvWatts) { + if (generatorType == GeneratorType::PVWatts) { ShowWarningError(routineName + DataIPShortCuts::cCurrentModuleObject + ", Availability Schedule for Generator:PVWatts '" + objectName + "' will be be ignored (runs all the time)."); - } else if (generatorType == GeneratorType::pV) { + } else if (generatorType == GeneratorType::PV) { // It should only warn if Performance type is SimplePV (DataPhotovoltaics::iSimplePVModel). // Except you need GetPVInput to have run already etc // Note: you can't use DataIPShortCuts::cAlphaArgs etc or it'll override what will still need to be processed in @@ -2104,7 +2105,7 @@ void GeneratorController::simGeneratorGetPowerOutput(EnergyPlusData &state, { // Select and call models and also collect results for load center power conditioning and reporting switch (generatorType) { - case GeneratorType::iCEngine: { + case GeneratorType::ICEngine: { auto thisICE = ICEngineElectricGenerator::ICEngineGeneratorSpecs::factory(state, name); @@ -2124,7 +2125,7 @@ void GeneratorController::simGeneratorGetPowerOutput(EnergyPlusData &state, thermalPowerOutput = thermProdRate; break; } - case GeneratorType::combTurbine: { + case GeneratorType::CombTurbine: { auto thisCTE = CTElectricGenerator::CTGeneratorData::factory(state, name); // dummy vars @@ -2143,15 +2144,15 @@ void GeneratorController::simGeneratorGetPowerOutput(EnergyPlusData &state, thermalPowerOutput = thermProdRate; break; } - case GeneratorType::pV: { - Photovoltaics::SimPVGenerator(state, DataGlobalConstants::iGeneratorPV, name, generatorIndex, runFlag, myElecLoadRequest); + case GeneratorType::PV: { + Photovoltaics::SimPVGenerator(state, GeneratorType::PV, name, generatorIndex, runFlag, myElecLoadRequest); Photovoltaics::GetPVGeneratorResults( - DataGlobalConstants::iGeneratorPV, generatorIndex, dCElectProdRate, dCElectricityProd, thermProdRate, thermalProd); + GeneratorType::PV, generatorIndex, dCElectProdRate, dCElectricityProd, thermProdRate, thermalProd); electricPowerOutput = dCElectProdRate; thermalPowerOutput = thermProdRate; break; } - case GeneratorType::pvWatts: { + case GeneratorType::PVWatts: { PVWatts::PVWattsGenerator &pvwattsGenerator(PVWatts::GetOrCreatePVWattsGenerator(state, name)); pvwattsGenerator.calc(state); pvwattsGenerator.getResults(dCElectProdRate, dCElectricityProd, thermProdRate, thermalProd); @@ -2159,7 +2160,7 @@ void GeneratorController::simGeneratorGetPowerOutput(EnergyPlusData &state, thermalPowerOutput = thermProdRate; break; } - case GeneratorType::fuelCell: { + case GeneratorType::FuelCell: { auto thisFC = FuelCellElectricGenerator::FCDataStruct::factory(state, name); dynamic_cast (thisFC)->SimFuelCellGenerator(state, runFlag, myElecLoadRequest, FirstHVACIteration); electProdRate = dynamic_cast (thisFC)->Report.ACPowerGen; @@ -2170,7 +2171,7 @@ void GeneratorController::simGeneratorGetPowerOutput(EnergyPlusData &state, thermalPowerOutput = thermProdRate; break; } - case GeneratorType::microCHP: { + case GeneratorType::MicroCHP: { auto thisMCHP = MicroCHPElectricGenerator::MicroCHPDataStruct::factory(state, name); // simulate @@ -2195,7 +2196,7 @@ void GeneratorController::simGeneratorGetPowerOutput(EnergyPlusData &state, thermalPowerOutput = thermProdRate; break; } - case GeneratorType::microturbine: { + case GeneratorType::Microturbine: { auto thisMTG = MicroturbineElectricGenerator::MTGeneratorSpecs::factory(state, name); // dummy vars @@ -2214,15 +2215,15 @@ void GeneratorController::simGeneratorGetPowerOutput(EnergyPlusData &state, thermalPowerOutput = thermProdRate; break; } - case GeneratorType::windTurbine: { - WindTurbine::SimWindTurbine(state, DataGlobalConstants::iGeneratorWindTurbine, name, generatorIndex, runFlag, myElecLoadRequest); + case GeneratorType::WindTurbine: { + WindTurbine::SimWindTurbine(state, GeneratorType::WindTurbine, name, generatorIndex, runFlag, myElecLoadRequest); WindTurbine::GetWTGeneratorResults(state, - DataGlobalConstants::iGeneratorWindTurbine, generatorIndex, electProdRate, electricityProd, thermProdRate, thermalProd); + GeneratorType::WindTurbine, generatorIndex, electProdRate, electricityProd, thermProdRate, thermalProd); electricPowerOutput = electProdRate; thermalPowerOutput = thermProdRate; break; } - case GeneratorType::notYetSet: { + case GeneratorType::Unassigned: { // do nothing break; } diff --git a/src/EnergyPlus/ElectricPowerServiceManager.hh b/src/EnergyPlus/ElectricPowerServiceManager.hh index 189610c21dc..480c759edcc 100644 --- a/src/EnergyPlus/ElectricPowerServiceManager.hh +++ b/src/EnergyPlus/ElectricPowerServiceManager.hh @@ -54,6 +54,7 @@ #include // EnergyPlus Headers +#include #include #include #include @@ -69,6 +70,18 @@ enum class ThermalLossDestination : int lostToOutside // device thermal losses have no destination }; +enum class GeneratorType { + Unassigned, + ICEngine, + CombTurbine, + PV, + FuelCell, + MicroCHP, + Microturbine, + WindTurbine, + PVWatts +}; + void initializeElectricPowerServiceZoneGains(); class DCtoACInverter @@ -491,22 +504,10 @@ public: // Method void reinitAtBeginEnvironment(); public: // data // might make this class a friend of ElectPowerLoadCenter? - enum class GeneratorType : int - { - notYetSet = 0, - iCEngine, - combTurbine, - pV, - fuelCell, - microCHP, - microturbine, - windTurbine, - pvWatts, - }; std::string name; // user identifier std::string typeOfName; // equipment type - int compGenTypeOf_Num; // Numeric designator for generator CompType (TypeOf), in DataGlobalConstants + GeneratorType compGenTypeOf_Num; // Numeric designator for generator CompType (TypeOf), in DataGlobalConstants int compPlantTypeOf_Num; // numeric designator for plant component, in DataPlant std::string compPlantName; // name of plant component if heat recovery GeneratorType generatorType; diff --git a/src/EnergyPlus/GeneratorDynamicsManager.cc b/src/EnergyPlus/GeneratorDynamicsManager.cc index 71ea46630e9..44a7b00f087 100644 --- a/src/EnergyPlus/GeneratorDynamicsManager.cc +++ b/src/EnergyPlus/GeneratorDynamicsManager.cc @@ -149,7 +149,7 @@ namespace GeneratorDynamicsManager { } void ManageGeneratorControlState(EnergyPlusData &state, - int const GeneratorType, // type of Generator + GeneratorType const GeneratorType, // type of Generator std::string const &EP_UNUSED(GeneratorName), // user specified name of Generator int const GeneratorNum, // Generator number bool const RunFlagElectCenter, // TRUE when Generator operating per electric load center request @@ -279,7 +279,7 @@ namespace GeneratorDynamicsManager { // get index for this generator in dynamics control structure { auto const SELECT_CASE_var(GeneratorType); - if (SELECT_CASE_var == iGeneratorMicroCHP) { + if (SELECT_CASE_var == GeneratorType::MicroCHP) { DynaCntrlNum = MicroCHPElectricGenerator::MicroCHP(GeneratorNum).DynamicsControlID; // OutletCWnode = MicroCHPElectricGenerator::MicroCHP(GeneratorNum)%PlantOutletNodeID InletCWnode = MicroCHPElectricGenerator::MicroCHP(GeneratorNum).PlantInletNodeID; @@ -288,7 +288,7 @@ namespace GeneratorDynamicsManager { InternalFlowControl = true; } LimitMinMdotcw = MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.MinWaterMdot; - } else if (SELECT_CASE_var == iGeneratorFuelCell) { + } else if (SELECT_CASE_var == GeneratorType::FuelCell) { // not yet } else { } @@ -425,7 +425,7 @@ namespace GeneratorDynamicsManager { } } else if (GeneratorDynamics(DynaCntrlNum).WarmUpByEngineTemp) { - if (GeneratorType == iGeneratorMicroCHP) { + if (GeneratorType == GeneratorType::MicroCHP) { // only change to normal if this is result from completed timestep, not just an interation if (MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.TengLast >= GeneratorDynamics(DynaCntrlNum).TnomEngOp) { newOpMode = OpModeNormal; @@ -616,12 +616,12 @@ namespace GeneratorDynamicsManager { { auto const SELECT_CASE_var(GeneratorType); - if (SELECT_CASE_var == iGeneratorFuelCell) { + if (SELECT_CASE_var == GeneratorType::FuelCell) { // constant power level during start up (modeling artifact) //? hours or seconds here? Pel = GeneratorDynamics(DynaCntrlNum).StartUpElectProd / GeneratorDynamics(DynaCntrlNum).StartUpTimeDelay; - } else if (SELECT_CASE_var == iGeneratorMicroCHP) { + } else if (SELECT_CASE_var == GeneratorType::MicroCHP) { Pel = PelInput * PLRforSubtimestepStartUp; } @@ -669,7 +669,7 @@ namespace GeneratorDynamicsManager { // now do record keeping for amount of time spent in various operating modes { auto const SELECT_CASE_var(GeneratorType); - if (SELECT_CASE_var == iGeneratorMicroCHP) { + if (SELECT_CASE_var == GeneratorType::MicroCHP) { // first clear out values MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.OffModeTime = 0.0; MicroCHPElectricGenerator::MicroCHP(GeneratorNum).A42Model.StandyByModeTime = 0.0; @@ -732,7 +732,7 @@ namespace GeneratorDynamicsManager { } } - } else if (SELECT_CASE_var == iGeneratorFuelCell) { + } else if (SELECT_CASE_var == GeneratorType::FuelCell) { // not yet using this control manager } else { } @@ -744,7 +744,7 @@ namespace GeneratorDynamicsManager { OperatingMode = newOpMode; } - void ManageGeneratorFuelFlow(int const GeneratorType, // type of Generator + void ManageGeneratorFuelFlow(GeneratorType const GeneratorType, // type of Generator std::string const &EP_UNUSED(GeneratorName), // user specified name of Generator int const GeneratorNum, // Generator number bool const EP_UNUSED(RunFlag), // TRUE when Generator operating @@ -801,7 +801,7 @@ namespace GeneratorDynamicsManager { // get index from GeneratorNum { auto const SELECT_CASE_var(GeneratorType); - if (SELECT_CASE_var == iGeneratorMicroCHP) { + if (SELECT_CASE_var == GeneratorType::MicroCHP) { DynaCntrlNum = MicroCHPElectricGenerator::MicroCHP(GeneratorNum).DynamicsControlID; } } diff --git a/src/EnergyPlus/GeneratorDynamicsManager.hh b/src/EnergyPlus/GeneratorDynamicsManager.hh index de2c996b7df..de2c0ecbda9 100644 --- a/src/EnergyPlus/GeneratorDynamicsManager.hh +++ b/src/EnergyPlus/GeneratorDynamicsManager.hh @@ -52,6 +52,7 @@ #include // EnergyPlus Headers +#include #include namespace EnergyPlus { @@ -75,7 +76,7 @@ namespace GeneratorDynamicsManager { void SetupGeneratorControlStateManager(int const GenNum); // index of generator to setup void ManageGeneratorControlState(EnergyPlusData &state, - int const GeneratorType, // type of Generator + GeneratorType const GeneratorType, // type of Generator std::string const &GeneratorName, // user specified name of Generator int const GeneratorNum, // Generator number bool const RunFlagElectCenter, // TRUE when Generator operating per electric load center request @@ -89,7 +90,7 @@ namespace GeneratorDynamicsManager { bool const FirstHVACIteration // True is this is first HVAC iteration ); - void ManageGeneratorFuelFlow(int const GeneratorType, // type of Generator + void ManageGeneratorFuelFlow(GeneratorType const GeneratorType, // type of Generator std::string const &GeneratorName, // user specified name of Generator int const GeneratorNum, // Generator number bool const RunFlag, // TRUE when Generator operating diff --git a/src/EnergyPlus/ICEngineElectricGenerator.hh b/src/EnergyPlus/ICEngineElectricGenerator.hh index cdf90b41699..f80ce2e8ef3 100644 --- a/src/EnergyPlus/ICEngineElectricGenerator.hh +++ b/src/EnergyPlus/ICEngineElectricGenerator.hh @@ -52,8 +52,8 @@ #include // EnergyPlus Headers -#include #include +#include #include #include @@ -64,8 +64,6 @@ struct EnergyPlusData; namespace ICEngineElectricGenerator { - using DataGlobalConstants::iGeneratorICEngine; - extern Real64 const ReferenceTemp; // Reference temperature by which lower heating // value is reported. This should be subtracted // off of when calculated exhaust energies. @@ -78,7 +76,7 @@ namespace ICEngineElectricGenerator { // Members std::string Name; // user identifier std::string TypeOf; // Type of Generator - int CompType_Num; + GeneratorType CompType_Num; std::string FuelType; // Type of Fuel - DIESEL, GASOLINE, GAS Real64 RatedPowerOutput; // W - design nominal capacity of Generator int ElectricCircuitNode; // Electric Circuit Node @@ -140,7 +138,7 @@ namespace ICEngineElectricGenerator { // Default Constructor ICEngineGeneratorSpecs() - : TypeOf("Generator:InternalCombustionEngine"), CompType_Num(iGeneratorICEngine), RatedPowerOutput(0.0), ElectricCircuitNode(0), + : TypeOf("Generator:InternalCombustionEngine"), CompType_Num(GeneratorType::ICEngine), RatedPowerOutput(0.0), ElectricCircuitNode(0), MinPartLoadRat(0.0), MaxPartLoadRat(0.0), OptPartLoadRat(0.0), ElecOutputFuelRat(0.0), ElecOutputFuelCurve(0), RecJacHeattoFuelRat(0.0), RecJacHeattoFuelCurve(0), RecLubeHeattoFuelRat(0.0), RecLubeHeattoFuelCurve(0), TotExhausttoFuelRat(0.0), TotExhausttoFuelCurve(0), ExhaustTemp(0.0), ExhaustTempCurve(0), ErrExhaustTempIndex(0), UA(0.0), UACoef(2, 0.0), MaxExhaustperPowerOutput(0.0), diff --git a/src/EnergyPlus/MicroCHPElectricGenerator.cc b/src/EnergyPlus/MicroCHPElectricGenerator.cc index 92c7a18c88a..35b8a4bbfe2 100644 --- a/src/EnergyPlus/MicroCHPElectricGenerator.cc +++ b/src/EnergyPlus/MicroCHPElectricGenerator.cc @@ -760,7 +760,7 @@ namespace MicroCHPElectricGenerator { bool RunFlag(false); GeneratorDynamicsManager::ManageGeneratorControlState(state, - DataGlobalConstants::iGeneratorMicroCHP, + GeneratorType::MicroCHP, this->Name, this->DynamicsControlID, RunFlagElectCenter, @@ -883,7 +883,7 @@ namespace MicroCHPElectricGenerator { bool ConstrainedDecreasingNdot(false); Real64 MdotFuelAllowed = 0.0; - GeneratorDynamicsManager::ManageGeneratorFuelFlow(DataGlobalConstants::iGeneratorMicroCHP, + GeneratorDynamicsManager::ManageGeneratorFuelFlow(GeneratorType::MicroCHP, this->Name, this->DynamicsControlID, RunFlag, @@ -997,7 +997,7 @@ namespace MicroCHPElectricGenerator { bool ConstrainedDecreasingNdot(false); Real64 MdotFuelAllowed = 0.0; - GeneratorDynamicsManager::ManageGeneratorFuelFlow(DataGlobalConstants::iGeneratorMicroCHP, + GeneratorDynamicsManager::ManageGeneratorFuelFlow(GeneratorType::MicroCHP, this->Name, this->DynamicsControlID, RunFlag, diff --git a/src/EnergyPlus/MicroturbineElectricGenerator.hh b/src/EnergyPlus/MicroturbineElectricGenerator.hh index 6a66b3bdfcd..283e8b494fc 100644 --- a/src/EnergyPlus/MicroturbineElectricGenerator.hh +++ b/src/EnergyPlus/MicroturbineElectricGenerator.hh @@ -52,8 +52,8 @@ #include // EnergyPlus Headers -#include #include +#include #include #include @@ -64,8 +64,6 @@ struct EnergyPlusData; namespace MicroturbineElectricGenerator { - using DataGlobalConstants::iGeneratorMicroturbine; - extern int NumMTGenerators; // number of MT Generators specified in input extern bool GetMTInput; // then TRUE, calls subroutine to read input file. @@ -121,7 +119,7 @@ namespace MicroturbineElectricGenerator { Real64 ExhaustAirTemperature; // Combustion exhaust air temperature (C) Real64 ExhaustAirHumRat; // Combustion exhaust air humidity ratio (kg/kg) // Other required variables/calculated values - int CompType_Num; + GeneratorType CompType_Num; Real64 RefCombustAirInletDensity; // Reference combustion air inlet density (kg/m3) Real64 MinPartLoadRat; // Min allowed operating frac full load Real64 MaxPartLoadRat; // Max allowed operating frac full load @@ -186,7 +184,7 @@ namespace MicroturbineElectricGenerator { HeatRecRateFWaterFlowCurveNum(0), HeatRecMinVolFlowRate(0.0), HeatRecMaxVolFlowRate(0.0), HeatRecMaxWaterTemp(0.0), CombustionAirInletNodeNum(0), CombustionAirOutletNodeNum(0), ExhAirCalcsActive(false), RefExhaustAirMassFlowRate(0.0), ExhaustAirMassFlowRate(0.0), ExhFlowFTempCurveNum(0), ExhFlowFPLRCurveNum(0), NomExhAirOutletTemp(0.0), ExhAirTempFTempCurveNum(0), - ExhAirTempFPLRCurveNum(0), ExhaustAirTemperature(0.0), ExhaustAirHumRat(0.0), CompType_Num(iGeneratorMicroturbine), + ExhAirTempFPLRCurveNum(0), ExhaustAirTemperature(0.0), ExhaustAirHumRat(0.0), CompType_Num(GeneratorType::Microturbine), RefCombustAirInletDensity(0.0), MinPartLoadRat(0.0), MaxPartLoadRat(0.0), FuelEnergyUseRateHHV(0.0), FuelEnergyUseRateLHV(0.0), QHeatRecovered(0.0), ExhaustEnergyRec(0.0), DesignHeatRecMassFlowRate(0.0), HeatRecActive(false), HeatRecInletTemp(0.0), HeatRecOutletTemp(0.0), HeatRecMinMassFlowRate(0.0), HeatRecMaxMassFlowRate(0.0), HeatRecMdot(0.0), HRLoopNum(0), HRLoopSideNum(0), diff --git a/src/EnergyPlus/Photovoltaics.cc b/src/EnergyPlus/Photovoltaics.cc index c59630a3444..b655583d481 100644 --- a/src/EnergyPlus/Photovoltaics.cc +++ b/src/EnergyPlus/Photovoltaics.cc @@ -142,7 +142,7 @@ namespace Photovoltaics { } void SimPVGenerator(EnergyPlusData &state, - int const EP_UNUSED(GeneratorType), // type of Generator !unused1208 + GeneratorType const EP_UNUSED(GeneratorType), // type of Generator !unused1208 std::string const &GeneratorName, // user specified name of Generator int &GeneratorIndex, bool const RunFlag, // is PV ON or OFF as determined by schedules in ElecLoadCenter @@ -222,7 +222,7 @@ namespace Photovoltaics { ReportPV(PVnum); } - void GetPVGeneratorResults(int const EP_UNUSED(GeneratorType), // type of Generator !unused1208 + void GetPVGeneratorResults(GeneratorType const EP_UNUSED(GeneratorType), // type of Generator !unused1208 int const GeneratorIndex, Real64 &GeneratorPower, // electrical power Real64 &GeneratorEnergy, // electrical energy diff --git a/src/EnergyPlus/Photovoltaics.hh b/src/EnergyPlus/Photovoltaics.hh index 8fca71db8bf..bfa07b03f0a 100644 --- a/src/EnergyPlus/Photovoltaics.hh +++ b/src/EnergyPlus/Photovoltaics.hh @@ -55,6 +55,7 @@ #include // EnergyPlus Headers +#include #include namespace EnergyPlus { @@ -76,14 +77,14 @@ namespace Photovoltaics { void clear_state(); void SimPVGenerator(EnergyPlusData &state, - int const GeneratorType, // type of Generator !unused1208 + GeneratorType const GeneratorType, // type of Generator std::string const &GeneratorName, // user specified name of Generator int &GeneratorIndex, bool const RunFlag, // is PV ON or OFF as determined by schedules in ElecLoadCenter - Real64 const PVLoad // electrical load on the PV (not really used... PV models assume "full on" !unused1208 + Real64 const PVLoad // electrical load on the PV (not really used... PV models assume "full on" ); - void GetPVGeneratorResults(int const GeneratorType, // type of Generator !unused1208 + void GetPVGeneratorResults(GeneratorType const GeneratorType, // type of Generator int const GeneratorIndex, Real64 &GeneratorPower, // electrical power Real64 &GeneratorEnergy, // electrical energy diff --git a/src/EnergyPlus/WindTurbine.cc b/src/EnergyPlus/WindTurbine.cc index 26dbd1e8522..23b8557f200 100644 --- a/src/EnergyPlus/WindTurbine.cc +++ b/src/EnergyPlus/WindTurbine.cc @@ -99,7 +99,7 @@ namespace WindTurbine { static std::string const BlankString; void SimWindTurbine(EnergyPlusData &state, - int const EP_UNUSED(GeneratorType), // Type of Generator + GeneratorType const EP_UNUSED(GeneratorType), // Type of Generator std::string const &GeneratorName, // User specified name of Generator int &GeneratorIndex, // Generator index bool const RunFlag, // ON or OFF @@ -155,7 +155,7 @@ namespace WindTurbine { } void GetWTGeneratorResults(EnergyPlusData &state, - int const EP_UNUSED(GeneratorType), // Type of Generator + GeneratorType const EP_UNUSED(GeneratorType), // Type of Generator int const GeneratorIndex, // Generator number Real64 &GeneratorPower, // Electrical power Real64 &GeneratorEnergy, // Electrical energy diff --git a/src/EnergyPlus/WindTurbine.hh b/src/EnergyPlus/WindTurbine.hh index fe9499efd7c..5491f9322da 100644 --- a/src/EnergyPlus/WindTurbine.hh +++ b/src/EnergyPlus/WindTurbine.hh @@ -54,6 +54,7 @@ // EnergyPlus Headers #include #include +#include #include namespace EnergyPlus { @@ -64,15 +65,17 @@ struct EnergyPlusData; namespace WindTurbine { enum class RotorType { + Unassigned = 0, HAWT = 1, // 'HorizontalAxisWindTurbine' VAWT = 2, // 'VerticalAxisWindTurbine' }; enum class ControlType { - FSFP = 1, // 'FixedSpeedFixedPitch' - FSVP = 2, // 'FixedSpeedVariablePitch' - VSFP = 3, // 'VariableSpeedFixedPitch' - VSVP = 4 // 'VariableSpeedVariablePitch' + Unassigned = 0, + FSFP = 1, // 'FixedSpeedFixedPitch' + FSVP = 2, // 'FixedSpeedVariablePitch' + VSFP = 3, // 'VariableSpeedFixedPitch' + VSVP = 4 // 'VariableSpeedVariablePitch' }; struct WindTurbineParams @@ -80,14 +83,14 @@ namespace WindTurbine { // Members std::string Name; // The component name std::string Schedule; // Available schedule - RotorType rotorType; // Rotor type (HAWT or VAWT) - ControlType controlType; // Control type + RotorType rotorType; // Rotor type (HAWT or VAWT) + ControlType controlType; // Control type int SchedPtr; // Schedule int NumOfBlade; // Blade number Real64 RatedRotorSpeed; // Rated rotor speed in m/s Real64 RotorDiameter; // Diameter of rotor in m Real64 RotorHeight; // Overall height of the rotor in m - Real64 RatedPower; // Nominal average power outpout at the rated wind speed in Watts + Real64 RatedPower; // Nominal average power output at the rated wind speed in Watts Real64 RatedWindSpeed; // Rated wind speed showing maximum power output in Watts Real64 CutInSpeed; // Minimum wind speed for system operation in m/s Real64 CutOutSpeed; // Maximum wind speed for system operation in m/s @@ -120,14 +123,15 @@ namespace WindTurbine { Real64 WSFactor; // Relative flow velocity for VAWTs in m/s Real64 AngOfAttack; // Angle of attack in degree Real64 IntRelFlowVel; // Integral of relative flow velocity - Real64 TanForce; // Tnagential force + Real64 TanForce; // Tangential force Real64 NorForce; // Normal force in N.m Real64 TotTorque; // Total torque in N.m Real64 AzimuthAng; // Azimuth angle between blades // Default Constructor WindTurbineParams() - : SchedPtr(0), NumOfBlade(0), RatedRotorSpeed(0.0), RotorDiameter(0.0), RotorHeight(0.0), RatedPower(0.0), + : rotorType(RotorType::Unassigned), controlType(ControlType::Unassigned), SchedPtr(0), NumOfBlade(0), RatedRotorSpeed(0.0), + RotorDiameter(0.0), RotorHeight(0.0), RatedPower(0.0), RatedWindSpeed(0.0), CutInSpeed(0.0), CutOutSpeed(0.0), SysEfficiency(0.0), MaxTipSpeedRatio(0.0), MaxPowerCoeff(0.0), LocalAnnualAvgWS(0.0), AnnualTMYWS(0.0), HeightForLocalWS(0.0), ChordArea(0.0), DragCoeff(0.0), LiftCoeff(0.0), PowerCoeffC1(0.0), PowerCoeffC2(0.0), PowerCoeffC3(0.0), PowerCoeffC4(0.0), PowerCoeffC5(0.0), PowerCoeffC6(0.0), TotPower(0.0), Power(0.0), @@ -139,16 +143,16 @@ namespace WindTurbine { }; void SimWindTurbine(EnergyPlusData &state, - int const GeneratorType, // Type of Generator + GeneratorType GeneratorType, // Type of Generator std::string const &GeneratorName, // User specified name of Generator int &GeneratorIndex, // Generator index - bool const RunFlag, // ON or OFF - Real64 const WTLoad // Electrical load on WT (not used) + bool RunFlag, // ON or OFF + Real64 WTLoad // Electrical load on WT (not used) ); void GetWTGeneratorResults(EnergyPlusData &state, - int const GeneratorType, // Type of Generator - int const GeneratorIndex, // Generator number + GeneratorType GeneratorType, // Type of Generator + int GeneratorIndex, // Generator number Real64 &GeneratorPower, // Electrical power Real64 &GeneratorEnergy, // Electrical energy Real64 &ThermalPower, @@ -156,14 +160,14 @@ namespace WindTurbine { void GetWindTurbineInput(EnergyPlusData &state); - void InitWindTurbine(EnergyPlusData &state, int const WindTurbineNum); + void InitWindTurbine(EnergyPlusData &state, int WindTurbineNum); void CalcWindTurbine(EnergyPlusData &state, - int const WindTurbineNum, // System is on - bool const RunFlag // System is on + int WindTurbineNum, // System is on + bool RunFlag // System is on ); - void ReportWindTurbine(EnergyPlusData &state, int const WindTurbineNum); + void ReportWindTurbine(EnergyPlusData &state, int WindTurbineNum); //***************************************************************************************** From 2de59eff2e58990750236cfa0d6538ea826d1579 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Sun, 11 Oct 2020 17:14:52 -0600 Subject: [PATCH 11/15] fix EvapCooler naming conflict, remove UC resource strings, cleanup DataPrecisionGlobals usages --- src/EnergyPlus/BaseboardRadiator.cc | 5 +- src/EnergyPlus/ChillerGasAbsorption.cc | 1 - .../Coils/CoilCoolingDXCurveFitSpeed.cc | 1 - src/EnergyPlus/DXCoils.cc | 10 +- src/EnergyPlus/DXFEarClipping.cc | 2 - src/EnergyPlus/DataBSDFWindow.cc | 3 - src/EnergyPlus/DataBranchAirLoopPlant.cc | 3 - src/EnergyPlus/DataComplexFenestration.cc | 4 - src/EnergyPlus/DataContaminantBalance.cc | 2 - src/EnergyPlus/DataConvergParams.cc | 4 - src/EnergyPlus/DataConversions.cc | 4 - src/EnergyPlus/DataDElight.cc | 4 - src/EnergyPlus/DataDaylighting.cc | 4 - src/EnergyPlus/DataDaylightingDevices.cc | 4 - src/EnergyPlus/DataDefineEquip.cc | 4 - src/EnergyPlus/DataEnvironment.cc | 2 - src/EnergyPlus/DataErrorTracking.cc | 4 - src/EnergyPlus/DataGenerators.cc | 4 - src/EnergyPlus/DataGlobalConstants.cc | 47 ------- src/EnergyPlus/DataGlobalConstants.hh | 47 ------- src/EnergyPlus/DataHVACGlobals.cc | 4 - src/EnergyPlus/DataHeatBalFanSys.cc | 4 - src/EnergyPlus/DataHeatBalSurface.cc | 4 - src/EnergyPlus/DataIPShortCuts.cc | 2 - src/EnergyPlus/DataLoopNode.cc | 4 - src/EnergyPlus/DataMoistureBalance.cc | 3 - src/EnergyPlus/DataMoistureBalanceEMPD.cc | 2 - src/EnergyPlus/DataPhotovoltaics.cc | 4 - src/EnergyPlus/DataRoomAirModel.cc | 3 - src/EnergyPlus/DataRootFinder.cc | 3 - src/EnergyPlus/DataSizing.cc | 3 - src/EnergyPlus/DataSurfaceColors.cc | 3 - src/EnergyPlus/DataSurfaceLists.cc | 3 - src/EnergyPlus/DataSurfaces.cc | 2 - src/EnergyPlus/DataTimings.cc | 2 - src/EnergyPlus/DataUCSDSharedData.cc | 2 - src/EnergyPlus/DataViewFactorInformation.cc | 3 - src/EnergyPlus/DataWater.cc | 3 - src/EnergyPlus/DataWindowEquivalentLayer.cc | 3 - src/EnergyPlus/DataZoneControls.cc | 2 - src/EnergyPlus/DataZoneEnergyDemands.cc | 3 - src/EnergyPlus/DataZoneEquipment.cc | 2 - src/EnergyPlus/DaylightingDevices.cc | 2 - src/EnergyPlus/DaylightingManager.cc | 3 +- src/EnergyPlus/EarthTube.cc | 2 - src/EnergyPlus/EcoRoofManager.cc | 2 - src/EnergyPlus/EvaporativeCoolers.cc | 88 ++++++------- src/EnergyPlus/EvaporativeCoolers.hh | 124 +++++++++--------- src/EnergyPlus/FanCoilUnits.cc | 17 ++- src/EnergyPlus/Fans.cc | 3 +- src/EnergyPlus/FluidCoolers.cc | 1 - src/EnergyPlus/FluidProperties.cc | 2 - src/EnergyPlus/GlobalNames.cc | 2 - src/EnergyPlus/HVACControllers.cc | 11 +- src/EnergyPlus/HVACDXSystem.cc | 2 - src/EnergyPlus/HVACDuct.cc | 2 - src/EnergyPlus/HVACFan.cc | 1 - src/EnergyPlus/HVACHXAssistedCoolingCoil.cc | 2 - src/EnergyPlus/HVACManager.cc | 2 - src/EnergyPlus/HVACSingleDuctInduc.cc | 2 - .../HeatBalanceInternalHeatGains.cc | 2 - src/EnergyPlus/HeatBalanceManager.cc | 2 - .../HeatBalanceMovableInsulation.cc | 2 - src/EnergyPlus/HeatPumpWaterToWaterSimple.cc | 2 - src/EnergyPlus/HeatRecovery.cc | 2 - src/EnergyPlus/HighTempRadiantSystem.cc | 2 - src/EnergyPlus/Humidifiers.cc | 2 - src/EnergyPlus/HybridModel.cc | 2 - src/EnergyPlus/IntegratedHeatPump.cc | 2 - src/EnergyPlus/InternalHeatGains.cc | 5 +- src/EnergyPlus/MixedAir.cc | 2 - src/EnergyPlus/OutAirNodeManager.cc | 2 - src/EnergyPlus/OutputProcessor.cc | 25 ---- src/EnergyPlus/OutputReportPredefined.cc | 3 - src/EnergyPlus/OutsideEnergySources.cc | 1 - src/EnergyPlus/PackagedTerminalHeatPump.cc | 2 - src/EnergyPlus/Photovoltaics.cc | 5 +- src/EnergyPlus/PipeHeatTransfer.cc | 2 - src/EnergyPlus/Pipes.cc | 2 - src/EnergyPlus/Plant/DataPlant.cc | 2 - src/EnergyPlus/PlantCondLoopOperation.cc | 2 - src/EnergyPlus/PlantLoadProfile.cc | 2 - src/EnergyPlus/PlantPressureSystem.cc | 2 - src/EnergyPlus/PlantUtilities.cc | 3 - src/EnergyPlus/PlantValves.cc | 2 - src/EnergyPlus/PoweredInductionUnits.cc | 5 +- src/EnergyPlus/Psychrometrics.cc | 4 +- src/EnergyPlus/Pumps.cc | 1 - src/EnergyPlus/PurchasedAirManager.cc | 2 - src/EnergyPlus/ReturnAirPathManager.cc | 2 - src/EnergyPlus/RoomAirModelAirflowNetwork.cc | 2 - src/EnergyPlus/RoomAirModelManager.cc | 2 - src/EnergyPlus/RoomAirModelUserTempPattern.cc | 2 - src/EnergyPlus/RootFinder.cc | 3 +- src/EnergyPlus/SZVAVModel.cc | 12 +- src/EnergyPlus/SetPointManager.cc | 15 +-- src/EnergyPlus/SimAirServingZones.cc | 30 ++--- src/EnergyPlus/SimulationManager.cc | 3 - src/EnergyPlus/SingleDuct.cc | 2 - src/EnergyPlus/SteamBaseboardRadiator.cc | 2 - src/EnergyPlus/SteamCoils.cc | 2 - src/EnergyPlus/SurfaceGroundHeatExchanger.cc | 5 +- src/EnergyPlus/TARCOGCommon.cc | 3 - src/EnergyPlus/TARCOGGassesParams.cc | 3 - src/EnergyPlus/TARCOGOutput.cc | 2 - src/EnergyPlus/TARCOGParams.cc | 3 - src/EnergyPlus/ThermalComfort.cc | 3 +- src/EnergyPlus/ThermalISO15099Calc.cc | 2 - src/EnergyPlus/UFADManager.cc | 2 - src/EnergyPlus/UnitHeater.cc | 2 - src/EnergyPlus/UnitVentilator.cc | 2 - src/EnergyPlus/WaterCoils.cc | 2 - src/EnergyPlus/WaterToAirHeatPumpSimple.cc | 3 +- src/EnergyPlus/WindTurbine.cc | 2 - src/EnergyPlus/WindowAC.cc | 2 - src/EnergyPlus/ZoneDehumidifier.cc | 2 - src/EnergyPlus/ZoneTempPredictorCorrector.cc | 6 +- .../unit/EvaporativeCoolers.unit.cc | 8 +- 118 files changed, 168 insertions(+), 544 deletions(-) diff --git a/src/EnergyPlus/BaseboardRadiator.cc b/src/EnergyPlus/BaseboardRadiator.cc index 527e87adb18..6de57ae59b1 100644 --- a/src/EnergyPlus/BaseboardRadiator.cc +++ b/src/EnergyPlus/BaseboardRadiator.cc @@ -96,7 +96,6 @@ namespace BaseboardRadiator { // RE-ENGINEERED na // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataGlobals; using DataHVACGlobals::SmallLoad; using DataPlant::PlantLoop; @@ -1087,13 +1086,13 @@ namespace BaseboardRadiator { // To prevent possible underflows (numbers smaller than the computer can handle) we must break // the calculation up into steps and check the size of the exponential arguments. AA = -CapacityRatio * std::pow(NTU, 0.78); - if (AA < EXP_LowerLimit) { + if (AA < DataPrecisionGlobals::EXP_LowerLimit) { BB = 0.0; } else { BB = std::exp(AA); } CC = (1.0 / CapacityRatio) * std::pow(NTU, 0.22) * (BB - 1.0); - if (CC < EXP_LowerLimit) { + if (CC < DataPrecisionGlobals::EXP_LowerLimit) { Effectiveness = 1.0; } else { Effectiveness = 1.0 - std::exp(CC); diff --git a/src/EnergyPlus/ChillerGasAbsorption.cc b/src/EnergyPlus/ChillerGasAbsorption.cc index 1aef67686c7..bce9410376c 100644 --- a/src/EnergyPlus/ChillerGasAbsorption.cc +++ b/src/EnergyPlus/ChillerGasAbsorption.cc @@ -64,7 +64,6 @@ #include #include #include -#include #include #include #include diff --git a/src/EnergyPlus/Coils/CoilCoolingDXCurveFitSpeed.cc b/src/EnergyPlus/Coils/CoilCoolingDXCurveFitSpeed.cc index 9053d2a04e4..96b1fab42a1 100644 --- a/src/EnergyPlus/Coils/CoilCoolingDXCurveFitSpeed.cc +++ b/src/EnergyPlus/Coils/CoilCoolingDXCurveFitSpeed.cc @@ -50,7 +50,6 @@ #include #include #include -#include #include #include #include diff --git a/src/EnergyPlus/DXCoils.cc b/src/EnergyPlus/DXCoils.cc index 798fefbf24c..aa4a3684a70 100644 --- a/src/EnergyPlus/DXCoils.cc +++ b/src/EnergyPlus/DXCoils.cc @@ -63,7 +63,6 @@ #include #include #include -#include #include #include #include @@ -126,7 +125,6 @@ namespace DXCoils { // USE STATEMENTS: // Use statements for data only modules // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataLoopNode; using namespace DataGlobals; using namespace DataHVACGlobals; @@ -8728,7 +8726,7 @@ namespace DXCoils { A0 = 0.0; } ADiff = -A0 / AirMassFlow; - if (ADiff >= EXP_LowerLimit) { + if (ADiff >= DataPrecisionGlobals::EXP_LowerLimit) { CBF = std::exp(ADiff); } else { CBF = 0.0; @@ -9677,7 +9675,7 @@ namespace DXCoils { A0 = 0.0; } ADiff = -A0 / AirMassFlow; - if (ADiff >= EXP_LowerLimit) { + if (ADiff >= DataPrecisionGlobals::EXP_LowerLimit) { CBF = std::exp(ADiff); } else { CBF = 0.0; @@ -11058,7 +11056,7 @@ namespace DXCoils { A0 = 0.0; } ADiff = -A0 / AirMassFlowRate; - if (ADiff >= EXP_LowerLimit) { + if (ADiff >= DataPrecisionGlobals::EXP_LowerLimit) { CBFAdj = std::exp(ADiff); } else { CBFAdj = 1.0e-6; @@ -15923,7 +15921,7 @@ namespace DXCoils { A0 = 0.0; } ADiff = -A0 / AirMassFlow; - if (ADiff >= EXP_LowerLimit) { + if (ADiff >= DataPrecisionGlobals::EXP_LowerLimit) { CBF = std::exp(ADiff); } else { CBF = 0.0; diff --git a/src/EnergyPlus/DXFEarClipping.cc b/src/EnergyPlus/DXFEarClipping.cc index d1b95d9d7db..52c43a96252 100644 --- a/src/EnergyPlus/DXFEarClipping.cc +++ b/src/EnergyPlus/DXFEarClipping.cc @@ -56,7 +56,6 @@ #include #include #include -#include #include #include @@ -87,7 +86,6 @@ namespace DXFEarClipping { // Use statements: // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataVectorTypes; // Data diff --git a/src/EnergyPlus/DataBSDFWindow.cc b/src/EnergyPlus/DataBSDFWindow.cc index ce8b927d60a..cf1893f2862 100644 --- a/src/EnergyPlus/DataBSDFWindow.cc +++ b/src/EnergyPlus/DataBSDFWindow.cc @@ -48,8 +48,6 @@ // EnergyPlus Headers #include #include -#include - namespace EnergyPlus { namespace DataBSDFWindow { @@ -80,7 +78,6 @@ namespace DataBSDFWindow { // USE STATEMENTS: // // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataVectorTypes; // diff --git a/src/EnergyPlus/DataBranchAirLoopPlant.cc b/src/EnergyPlus/DataBranchAirLoopPlant.cc index f23e45a7aa7..53ac42e5635 100644 --- a/src/EnergyPlus/DataBranchAirLoopPlant.cc +++ b/src/EnergyPlus/DataBranchAirLoopPlant.cc @@ -47,8 +47,6 @@ // EnergyPlus Headers #include -#include - namespace EnergyPlus { namespace DataBranchAirLoopPlant { @@ -77,7 +75,6 @@ namespace DataBranchAirLoopPlant { // USE STATEMENTS: // // Using/Aliasing - using namespace DataPrecisionGlobals; // // Data diff --git a/src/EnergyPlus/DataComplexFenestration.cc b/src/EnergyPlus/DataComplexFenestration.cc index 9ad4d983e9f..21b91e15a98 100644 --- a/src/EnergyPlus/DataComplexFenestration.cc +++ b/src/EnergyPlus/DataComplexFenestration.cc @@ -47,8 +47,6 @@ // EnergyPlus Headers #include -#include - namespace EnergyPlus { namespace DataComplexFenestration { @@ -62,8 +60,6 @@ namespace DataComplexFenestration { // This module contains data necessary for complex fenestration calculations // Using/Aliasing - using namespace DataPrecisionGlobals; - // Data // Parameters for complex shade int const csVenetianHorizontal(1); diff --git a/src/EnergyPlus/DataContaminantBalance.cc b/src/EnergyPlus/DataContaminantBalance.cc index d84900f7b16..0f07adfeed2 100644 --- a/src/EnergyPlus/DataContaminantBalance.cc +++ b/src/EnergyPlus/DataContaminantBalance.cc @@ -47,7 +47,6 @@ // EnergyPlus Headers #include -#include #include namespace EnergyPlus { @@ -65,7 +64,6 @@ namespace DataContaminantBalance { // that is needed to pass from the Contaminant Balance Module. // Using/Aliasing - using namespace DataPrecisionGlobals; using DataSurfaces::MaxSlatAngs; // Data diff --git a/src/EnergyPlus/DataConvergParams.cc b/src/EnergyPlus/DataConvergParams.cc index d853c75d80d..8b6899df79e 100644 --- a/src/EnergyPlus/DataConvergParams.cc +++ b/src/EnergyPlus/DataConvergParams.cc @@ -51,8 +51,6 @@ // EnergyPlus Headers #include -#include - namespace EnergyPlus { namespace DataConvergParams { @@ -62,8 +60,6 @@ namespace DataConvergParams { // of the HVAC simulation. // Using/Aliasing - using namespace DataPrecisionGlobals; - // Data // -only module should be available to other modules and routines. // Thus, all variables in this module must be PUBLIC. diff --git a/src/EnergyPlus/DataConversions.cc b/src/EnergyPlus/DataConversions.cc index 0c8d5f5ecb4..4f1714073e4 100644 --- a/src/EnergyPlus/DataConversions.cc +++ b/src/EnergyPlus/DataConversions.cc @@ -47,8 +47,6 @@ // EnergyPlus Headers #include -#include - namespace EnergyPlus { namespace DataConversions { @@ -79,8 +77,6 @@ namespace DataConversions { // na // Using/Aliasing - using namespace DataPrecisionGlobals; - // Data // -only module should be available to other modules and routines. // Thus, all variables in this module must be PUBLIC. diff --git a/src/EnergyPlus/DataDElight.cc b/src/EnergyPlus/DataDElight.cc index 4a1e6036af3..b7297a30d34 100644 --- a/src/EnergyPlus/DataDElight.cc +++ b/src/EnergyPlus/DataDElight.cc @@ -47,8 +47,6 @@ // EnergyPlus Headers #include -#include - namespace EnergyPlus { namespace DataDElight { @@ -73,8 +71,6 @@ namespace DataDElight { // na // Using/Aliasing - using namespace DataPrecisionGlobals; - // Data // -only module should be available to other modules and routines. // Thus, all variables in this module must be PUBLIC. diff --git a/src/EnergyPlus/DataDaylighting.cc b/src/EnergyPlus/DataDaylighting.cc index 26284638c60..ca87a05f295 100644 --- a/src/EnergyPlus/DataDaylighting.cc +++ b/src/EnergyPlus/DataDaylighting.cc @@ -47,8 +47,6 @@ // EnergyPlus Headers #include -#include - namespace EnergyPlus { namespace DataDaylighting { @@ -73,8 +71,6 @@ namespace DataDaylighting { // na // Using/Aliasing - using namespace DataPrecisionGlobals; - // Data // -only module should be available to other modules and routines. // Thus, all variables in this module must be PUBLIC. diff --git a/src/EnergyPlus/DataDaylightingDevices.cc b/src/EnergyPlus/DataDaylightingDevices.cc index 61861fae174..4efb9ce3101 100644 --- a/src/EnergyPlus/DataDaylightingDevices.cc +++ b/src/EnergyPlus/DataDaylightingDevices.cc @@ -47,8 +47,6 @@ // EnergyPlus Headers #include -#include - namespace EnergyPlus { namespace DataDaylightingDevices { @@ -68,8 +66,6 @@ namespace DataDaylightingDevices { // OTHER NOTES: na // Using/Aliasing - using namespace DataPrecisionGlobals; - // Data // -only module should be available to other modules and routines. // Thus, all variables in this module must be PUBLIC. diff --git a/src/EnergyPlus/DataDefineEquip.cc b/src/EnergyPlus/DataDefineEquip.cc index 91f87c5e9ab..2cae86cb2ec 100644 --- a/src/EnergyPlus/DataDefineEquip.cc +++ b/src/EnergyPlus/DataDefineEquip.cc @@ -47,8 +47,6 @@ // EnergyPlus Headers #include -#include - namespace EnergyPlus { namespace DataDefineEquip { @@ -69,8 +67,6 @@ namespace DataDefineEquip { // OTHER NOTES: none // Using/Aliasing - using namespace DataPrecisionGlobals; - // Data // -only module should be available to other modules and routines. // Thus, all variables in this module must be PUBLIC. diff --git a/src/EnergyPlus/DataEnvironment.cc b/src/EnergyPlus/DataEnvironment.cc index 6d4eec92df0..a76b376bc5c 100644 --- a/src/EnergyPlus/DataEnvironment.cc +++ b/src/EnergyPlus/DataEnvironment.cc @@ -51,7 +51,6 @@ // EnergyPlus Headers #include #include -#include #include #include @@ -81,7 +80,6 @@ namespace DataEnvironment { // na // Using/Aliasing - using namespace DataPrecisionGlobals; // Data // -only module should be available to other modules and routines. // Thus, all variables in this module must be PUBLIC. diff --git a/src/EnergyPlus/DataErrorTracking.cc b/src/EnergyPlus/DataErrorTracking.cc index bc1e6d7815b..aae8649bf9c 100644 --- a/src/EnergyPlus/DataErrorTracking.cc +++ b/src/EnergyPlus/DataErrorTracking.cc @@ -47,8 +47,6 @@ // EnergyPlus Headers #include -#include - namespace EnergyPlus { namespace DataErrorTracking { @@ -73,8 +71,6 @@ namespace DataErrorTracking { // na // Using/Aliasing - using namespace DataPrecisionGlobals; - // Data // -only module should be available to other modules and routines. // Thus, all variables in this module must be PUBLIC. diff --git a/src/EnergyPlus/DataGenerators.cc b/src/EnergyPlus/DataGenerators.cc index 762a5511b28..3ac5aaed825 100644 --- a/src/EnergyPlus/DataGenerators.cc +++ b/src/EnergyPlus/DataGenerators.cc @@ -47,8 +47,6 @@ // EnergyPlus Headers #include -#include - namespace EnergyPlus { namespace DataGenerators { @@ -73,8 +71,6 @@ namespace DataGenerators { // na // Using/Aliasing - using namespace DataPrecisionGlobals; - // Data // -only module should be available to other modules and routines. // Thus, all variables in this module must be PUBLIC. diff --git a/src/EnergyPlus/DataGlobalConstants.cc b/src/EnergyPlus/DataGlobalConstants.cc index 9822be5fd34..12f7382a945 100644 --- a/src/EnergyPlus/DataGlobalConstants.cc +++ b/src/EnergyPlus/DataGlobalConstants.cc @@ -103,145 +103,98 @@ namespace DataGlobalConstants { // Resource Types std::string const cRT_None("None"); - std::string const cRT_NoneUC("NONE"); int const iRT_None(1000); std::string const cRT_Electricity("Electricity"); - std::string const cRT_ElectricityUC("ELECTRICITY"); int const iRT_Electricity(1001); std::string const cRT_Natural_Gas("NaturalGas"); - std::string const cRT_Natural_GasUC("NATURALGAS"); int const iRT_Natural_Gas(1002); std::string const cRT_Gasoline("Gasoline"); - std::string const cRT_GasolineUC("GASOLINE"); int const iRT_Gasoline(1003); std::string const cRT_Diesel("Diesel"); - std::string const cRT_DieselUC("DIESEL"); int const iRT_Diesel(1004); std::string const cRT_Coal("Coal"); - std::string const cRT_CoalUC("COAL"); int const iRT_Coal(1005); std::string const cRT_FuelOil_1("FuelOilNo1"); - std::string const cRT_FuelOil_1UC("FUELOILNO1"); int const iRT_FuelOil_1(1006); std::string const cRT_FuelOil_2("FuelOilNo2"); - std::string const cRT_FuelOil_2UC("FUELOILNO2"); int const iRT_FuelOil_2(1007); std::string const cRT_Propane("Propane"); - std::string const cRT_PropaneUC("PROPANE"); int const iRT_Propane(1008); std::string const cRT_Water("Water"); - std::string const cRT_WaterUC("WATER"); int const iRT_Water(1009); std::string const cRT_EnergyTransfer("EnergyTransfer"); - std::string const cRT_EnergyTransferUC("ENERGYTRANSFER"); int const iRT_EnergyTransfer(1010); std::string const cRT_Steam("Steam"); - std::string const cRT_SteamUC("STEAM"); int const iRT_Steam(1011); std::string const cRT_DistrictCooling("DistrictCooling"); - std::string const cRT_DistrictCoolingUC("DISTRICTCOOLING"); int const iRT_DistrictCooling(1012); std::string const cRT_DistrictHeating("DistrictHeating"); - std::string const cRT_DistrictHeatingUC("DISTRICTHEATING"); int const iRT_DistrictHeating(1013); std::string const cRT_ElectricityProduced("ElectricityProduced"); - std::string const cRT_ElectricityProducedUC("ELECTRICITYPRODUCED"); int const iRT_ElectricityProduced(1014); std::string const cRT_ElectricityPurchased("ElectricityPurchased"); - std::string const cRT_ElectricityPurchasedUC("ELECTRICITYPURCHASED"); int const iRT_ElectricityPurchased(1015); std::string const cRT_ElectricitySurplusSold("ElectricitySurplusSold"); - std::string const cRT_ElectricitySurplusSoldUC("ELECTRICITYSURPLUSSOLD"); int const iRT_ElectricitySurplusSold(1016); std::string const cRT_ElectricityNet("ElectricityNet"); - std::string const cRT_ElectricityNetUC("ELECTRICITYNET"); int const iRT_ElectricityNet(1017); std::string const cRT_SolarWater("SolarWater"); - std::string const cRT_SolarWaterUC("SOLARWATER"); int const iRT_SolarWater(1018); std::string const cRT_SolarAir("SolarAir"); - std::string const cRT_SolarAirUC("SOLARAIR"); int const iRT_SolarAir(1019); std::string const cRT_SO2("SO2"); - std::string const cRT_SO2UC("SO2"); int const iRT_SO2(1020); std::string const cRT_NOx("NOx"); - std::string const cRT_NOxUC("NOX"); int const iRT_NOx(1021); std::string const cRT_N2O("N2O"); - std::string const cRT_N2OUC("N2O"); int const iRT_N2O(1022); std::string const cRT_PM("PM"); - std::string const cRT_PMUC("PM"); int const iRT_PM(1023); std::string const cRT_PM2_5("PM2.5"); - std::string const cRT_PM2_5UC("PM2.5"); int const iRT_PM2_5(1024); std::string const cRT_PM10("PM10"); - std::string const cRT_PM10UC("PM10"); int const iRT_PM10(1025); std::string const cRT_CO("CO"); - std::string const cRT_COUC("CO"); int const iRT_CO(1026); std::string const cRT_CO2("CO2"); - std::string const cRT_CO2UC("CO2"); int const iRT_CO2(1027); std::string const cRT_CH4("CH4"); - std::string const cRT_CH4UC("CH4"); int const iRT_CH4(1028); std::string const cRT_NH3("NH3"); - std::string const cRT_NH3UC("NH3"); int const iRT_NH3(1029); std::string const cRT_NMVOC("NMVOC"); - std::string const cRT_NMVOCUC("NMVOC"); int const iRT_NMVOC(1030); std::string const cRT_Hg("Hg"); - std::string const cRT_HgUC("HG"); int const iRT_Hg(1031); std::string const cRT_Pb("Pb"); - std::string const cRT_PbUC("PB"); int const iRT_Pb(1032); std::string const cRT_NuclearHigh("NuclearHigh"); - std::string const cRT_NuclearHighUC("NUCLEARHIGH"); int const iRT_NuclearHigh(1033); std::string const cRT_NuclearLow("NuclearLow"); - std::string const cRT_NuclearLowUC("NUCLEARLOW"); int const iRT_NuclearLow(1034); std::string const cRT_WaterEnvironmentalFactors("WaterEnvironmentalFactors"); - std::string const cRT_WaterEnvironmentalFactorsUC("WATERENVIRONMENTALFACTORS"); int const iRT_WaterEnvironmentalFactors(1035); std::string const cRT_CarbonEquivalent("Carbon Equivalent"); - std::string const cRT_CarbonEquivalentUC("CARBON EQUIVALENT"); int const iRT_CarbonEquivalent(1036); std::string const cRT_Source("Source"); - std::string const cRT_SourceUC("SOURCE"); int const iRT_Source(1037); std::string const cRT_PlantLoopHeatingDemand("PlantLoopHeatingDemand"); - std::string const cRT_PlantLoopHeatingDemandUC("PLANTLOOPHEATINGDEMAND"); int const iRT_PlantLoopHeatingDemand(1038); std::string const cRT_PlantLoopCoolingDemand("PlantLoopCoolingDemand"); - std::string const cRT_PlantLoopCoolingDemandUC("PLANTLOOPCOOLINGDEMAND"); int const iRT_PlantLoopCoolingDemand(1039); std::string const cRT_OnSiteWater("OnSiteWater"); - std::string const cRT_OnSiteWaterUC("ONSITEWATER"); int const iRT_OnSiteWater(1040); std::string const cRT_MainsWater("MainsWater"); - std::string const cRT_MainsWaterUC("MAINSWATER"); int const iRT_MainsWater(1041); std::string const cRT_RainWater("RainWater"); - std::string const cRT_RainWaterUC("RAINWATER"); int const iRT_RainWater(1042); std::string const cRT_WellWater("WellWater"); - std::string const cRT_WellWaterUC("WellWATER"); int const iRT_WellWater(1043); std::string const cRT_Condensate("Condensate"); - std::string const cRT_CondensateUC("CONDENSATE"); int const iRT_Condensate(1044); std::string const cRT_OtherFuel1("OtherFuel1"); - std::string const cRT_OtherFuel1UC("OTHERFUEL1"); int const iRT_OtherFuel1(1045); std::string const cRT_OtherFuel2("OtherFuel2"); - std::string const cRT_OtherFuel2UC("OTHERFUEL2"); int const iRT_OtherFuel2(1046); int const NumOfResourceTypes(46); int const ResourceTypeInitialOffset(1000); // to reach "ValidTypes" diff --git a/src/EnergyPlus/DataGlobalConstants.hh b/src/EnergyPlus/DataGlobalConstants.hh index ccca48ee8ea..6b4413b8c38 100644 --- a/src/EnergyPlus/DataGlobalConstants.hh +++ b/src/EnergyPlus/DataGlobalConstants.hh @@ -80,145 +80,98 @@ namespace DataGlobalConstants { // Resource Types extern std::string const cRT_None; - extern std::string const cRT_NoneUC; extern int const iRT_None; extern std::string const cRT_Electricity; - extern std::string const cRT_ElectricityUC; extern int const iRT_Electricity; extern std::string const cRT_Natural_Gas; - extern std::string const cRT_Natural_GasUC; extern int const iRT_Natural_Gas; extern std::string const cRT_Gasoline; - extern std::string const cRT_GasolineUC; extern int const iRT_Gasoline; extern std::string const cRT_Diesel; - extern std::string const cRT_DieselUC; extern int const iRT_Diesel; extern std::string const cRT_Coal; - extern std::string const cRT_CoalUC; extern int const iRT_Coal; extern std::string const cRT_FuelOil_1; - extern std::string const cRT_FuelOil_1UC; extern int const iRT_FuelOil_1; extern std::string const cRT_FuelOil_2; - extern std::string const cRT_FuelOil_2UC; extern int const iRT_FuelOil_2; extern std::string const cRT_Propane; - extern std::string const cRT_PropaneUC; extern int const iRT_Propane; extern std::string const cRT_Water; - extern std::string const cRT_WaterUC; extern int const iRT_Water; extern std::string const cRT_EnergyTransfer; - extern std::string const cRT_EnergyTransferUC; extern int const iRT_EnergyTransfer; extern std::string const cRT_Steam; - extern std::string const cRT_SteamUC; extern int const iRT_Steam; extern std::string const cRT_DistrictCooling; - extern std::string const cRT_DistrictCoolingUC; extern int const iRT_DistrictCooling; extern std::string const cRT_DistrictHeating; - extern std::string const cRT_DistrictHeatingUC; extern int const iRT_DistrictHeating; extern std::string const cRT_ElectricityProduced; - extern std::string const cRT_ElectricityProducedUC; extern int const iRT_ElectricityProduced; extern std::string const cRT_ElectricityPurchased; - extern std::string const cRT_ElectricityPurchasedUC; extern int const iRT_ElectricityPurchased; extern std::string const cRT_ElectricitySurplusSold; - extern std::string const cRT_ElectricitySurplusSoldUC; extern int const iRT_ElectricitySurplusSold; extern std::string const cRT_ElectricityNet; - extern std::string const cRT_ElectricityNetUC; extern int const iRT_ElectricityNet; extern std::string const cRT_SolarWater; - extern std::string const cRT_SolarWaterUC; extern int const iRT_SolarWater; extern std::string const cRT_SolarAir; - extern std::string const cRT_SolarAirUC; extern int const iRT_SolarAir; extern std::string const cRT_SO2; - extern std::string const cRT_SO2UC; extern int const iRT_SO2; extern std::string const cRT_NOx; - extern std::string const cRT_NOxUC; extern int const iRT_NOx; extern std::string const cRT_N2O; - extern std::string const cRT_N2OUC; extern int const iRT_N2O; extern std::string const cRT_PM; - extern std::string const cRT_PMUC; extern int const iRT_PM; extern std::string const cRT_PM2_5; - extern std::string const cRT_PM2_5UC; extern int const iRT_PM2_5; extern std::string const cRT_PM10; - extern std::string const cRT_PM10UC; extern int const iRT_PM10; extern std::string const cRT_CO; - extern std::string const cRT_COUC; extern int const iRT_CO; extern std::string const cRT_CO2; - extern std::string const cRT_CO2UC; extern int const iRT_CO2; extern std::string const cRT_CH4; - extern std::string const cRT_CH4UC; extern int const iRT_CH4; extern std::string const cRT_NH3; - extern std::string const cRT_NH3UC; extern int const iRT_NH3; extern std::string const cRT_NMVOC; - extern std::string const cRT_NMVOCUC; extern int const iRT_NMVOC; extern std::string const cRT_Hg; - extern std::string const cRT_HgUC; extern int const iRT_Hg; extern std::string const cRT_Pb; - extern std::string const cRT_PbUC; extern int const iRT_Pb; extern std::string const cRT_NuclearHigh; - extern std::string const cRT_NuclearHighUC; extern int const iRT_NuclearHigh; extern std::string const cRT_NuclearLow; - extern std::string const cRT_NuclearLowUC; extern int const iRT_NuclearLow; extern std::string const cRT_WaterEnvironmentalFactors; - extern std::string const cRT_WaterEnvironmentalFactorsUC; extern int const iRT_WaterEnvironmentalFactors; extern std::string const cRT_CarbonEquivalent; - extern std::string const cRT_CarbonEquivalentUC; extern int const iRT_CarbonEquivalent; extern std::string const cRT_Source; - extern std::string const cRT_SourceUC; extern int const iRT_Source; extern std::string const cRT_PlantLoopHeatingDemand; - extern std::string const cRT_PlantLoopHeatingDemandUC; extern int const iRT_PlantLoopHeatingDemand; extern std::string const cRT_PlantLoopCoolingDemand; - extern std::string const cRT_PlantLoopCoolingDemandUC; extern int const iRT_PlantLoopCoolingDemand; extern std::string const cRT_OnSiteWater; - extern std::string const cRT_OnSiteWaterUC; extern int const iRT_OnSiteWater; extern std::string const cRT_MainsWater; - extern std::string const cRT_MainsWaterUC; extern int const iRT_MainsWater; extern std::string const cRT_RainWater; - extern std::string const cRT_RainWaterUC; extern int const iRT_RainWater; extern std::string const cRT_WellWater; - extern std::string const cRT_WellWaterUC; extern int const iRT_WellWater; extern std::string const cRT_Condensate; - extern std::string const cRT_CondensateUC; extern int const iRT_Condensate; extern std::string const cRT_OtherFuel1; - extern std::string const cRT_OtherFuel1UC; extern int const iRT_OtherFuel1; extern std::string const cRT_OtherFuel2; - extern std::string const cRT_OtherFuel2UC; extern int const iRT_OtherFuel2; extern int const NumOfResourceTypes; extern int const ResourceTypeInitialOffset; // to reach "ValidTypes" diff --git a/src/EnergyPlus/DataHVACGlobals.cc b/src/EnergyPlus/DataHVACGlobals.cc index 70c12fad36f..9a115638a6b 100644 --- a/src/EnergyPlus/DataHVACGlobals.cc +++ b/src/EnergyPlus/DataHVACGlobals.cc @@ -47,8 +47,6 @@ // EnergyPlus Headers #include -#include - namespace EnergyPlus { namespace DataHVACGlobals { @@ -67,8 +65,6 @@ namespace DataHVACGlobals { // OTHER NOTES: // Using/Aliasing - using namespace DataPrecisionGlobals; - // Data // -only module should be available to other modules and routines. // Thus, all variables in this module must be PUBLIC. diff --git a/src/EnergyPlus/DataHeatBalFanSys.cc b/src/EnergyPlus/DataHeatBalFanSys.cc index 1556c9e5a23..cdb2506ebba 100644 --- a/src/EnergyPlus/DataHeatBalFanSys.cc +++ b/src/EnergyPlus/DataHeatBalFanSys.cc @@ -47,8 +47,6 @@ // EnergyPlus Headers #include -#include - namespace EnergyPlus { namespace DataHeatBalFanSys { @@ -64,8 +62,6 @@ namespace DataHeatBalFanSys { // Heat Balance Module to the Fan Systems // Using/Aliasing - using namespace DataPrecisionGlobals; - // Data // -only module should be available to other modules and routines. // Thus, all variables in this module must be PUBLIC. diff --git a/src/EnergyPlus/DataHeatBalSurface.cc b/src/EnergyPlus/DataHeatBalSurface.cc index 07f8ea599ce..0858625c839 100644 --- a/src/EnergyPlus/DataHeatBalSurface.cc +++ b/src/EnergyPlus/DataHeatBalSurface.cc @@ -47,8 +47,6 @@ // EnergyPlus Headers #include -#include - namespace EnergyPlus { namespace DataHeatBalSurface { @@ -62,8 +60,6 @@ namespace DataHeatBalSurface { // heat balances which are now "external" subroutines. // Using/Aliasing - using namespace DataPrecisionGlobals; - // Data // MODULE PARAMETER DEFINITIONS Real64 const MinSurfaceTempLimit(-100.0); // Lowest inside surface temperature allowed in Celsius diff --git a/src/EnergyPlus/DataIPShortCuts.cc b/src/EnergyPlus/DataIPShortCuts.cc index ad3238d293a..b1d5dcd110e 100644 --- a/src/EnergyPlus/DataIPShortCuts.cc +++ b/src/EnergyPlus/DataIPShortCuts.cc @@ -48,8 +48,6 @@ // EnergyPlus Headers #include #include -#include - namespace EnergyPlus { namespace DataIPShortCuts { diff --git a/src/EnergyPlus/DataLoopNode.cc b/src/EnergyPlus/DataLoopNode.cc index d9f62332634..04902ab575f 100644 --- a/src/EnergyPlus/DataLoopNode.cc +++ b/src/EnergyPlus/DataLoopNode.cc @@ -47,8 +47,6 @@ // EnergyPlus Headers #include -#include - namespace EnergyPlus { namespace DataLoopNode { @@ -73,8 +71,6 @@ namespace DataLoopNode { // USE STATEMENTS: // Use statements for data only modules // Using/Aliasing - using namespace DataPrecisionGlobals; - // Data // MODULE PARAMETER DEFINITIONS: // Valid Fluid Types for Nodes diff --git a/src/EnergyPlus/DataMoistureBalance.cc b/src/EnergyPlus/DataMoistureBalance.cc index 6c1944b1096..11ca8fc272f 100644 --- a/src/EnergyPlus/DataMoistureBalance.cc +++ b/src/EnergyPlus/DataMoistureBalance.cc @@ -47,7 +47,6 @@ // EnergyPlus Headers #include -#include namespace EnergyPlus { @@ -65,8 +64,6 @@ namespace DataMoistureBalance { // Data is still used in the CondFD solution. // Using/Aliasing - using namespace DataPrecisionGlobals; - // Data // module should be available to other modules and routines. Thus, // all variables in this module must be PUBLIC. diff --git a/src/EnergyPlus/DataMoistureBalanceEMPD.cc b/src/EnergyPlus/DataMoistureBalanceEMPD.cc index 43bcefaf2e0..2e0287eedd3 100644 --- a/src/EnergyPlus/DataMoistureBalanceEMPD.cc +++ b/src/EnergyPlus/DataMoistureBalanceEMPD.cc @@ -47,7 +47,6 @@ // EnergyPlus Headers #include -#include namespace EnergyPlus { @@ -64,7 +63,6 @@ namespace DataMoistureBalanceEMPD { // moisture level at interior surfaces // Using/Aliasing - using namespace DataPrecisionGlobals; // Data // module should be available to other modules and routines. Thus, diff --git a/src/EnergyPlus/DataPhotovoltaics.cc b/src/EnergyPlus/DataPhotovoltaics.cc index a8f4a78f17f..7fcaa3f1b8c 100644 --- a/src/EnergyPlus/DataPhotovoltaics.cc +++ b/src/EnergyPlus/DataPhotovoltaics.cc @@ -47,8 +47,6 @@ // EnergyPlus Headers #include -#include - namespace EnergyPlus { namespace DataPhotovoltaics { @@ -73,8 +71,6 @@ namespace DataPhotovoltaics { // na // Using/Aliasing - using namespace DataPrecisionGlobals; - // Data // -only module should be available to other modules and routines. // Thus, all variables in this module must be PUBLIC. diff --git a/src/EnergyPlus/DataRoomAirModel.cc b/src/EnergyPlus/DataRoomAirModel.cc index 2a96c5eb39b..8ff17bbba30 100644 --- a/src/EnergyPlus/DataRoomAirModel.cc +++ b/src/EnergyPlus/DataRoomAirModel.cc @@ -46,7 +46,6 @@ // POSSIBILITY OF SUCH DAMAGE. // EnergyPlus Headers -#include #include namespace EnergyPlus { @@ -68,8 +67,6 @@ namespace DataRoomAirModel { // USE STATEMENTS: ! UCSD // Using/Aliasing - using namespace DataPrecisionGlobals; - // Data // module should be available to other modules and routines. Thus, // all variables in this module must be PUBLIC. diff --git a/src/EnergyPlus/DataRootFinder.cc b/src/EnergyPlus/DataRootFinder.cc index 3d30450ce10..e11118c9f64 100644 --- a/src/EnergyPlus/DataRootFinder.cc +++ b/src/EnergyPlus/DataRootFinder.cc @@ -46,7 +46,6 @@ // POSSIBILITY OF SUCH DAMAGE. // EnergyPlus Headers -#include #include namespace EnergyPlus { @@ -73,8 +72,6 @@ namespace DataRootFinder { // na // Using/Aliasing - using namespace DataPrecisionGlobals; - // Data // -only module should be available to other modules and routines. // Thus, all variables in this module must be PUBLIC. diff --git a/src/EnergyPlus/DataSizing.cc b/src/EnergyPlus/DataSizing.cc index 6d431bfca61..c191bb03b2d 100644 --- a/src/EnergyPlus/DataSizing.cc +++ b/src/EnergyPlus/DataSizing.cc @@ -46,7 +46,6 @@ // POSSIBILITY OF SUCH DAMAGE. // EnergyPlus Headers -#include #include #include #include @@ -74,8 +73,6 @@ namespace DataSizing { // na // Using/Aliasing - using namespace DataPrecisionGlobals; - // Data // -only module should be available to other modules and routines. // Thus, all variables in this module must be PUBLIC. diff --git a/src/EnergyPlus/DataSurfaceColors.cc b/src/EnergyPlus/DataSurfaceColors.cc index cf3c1c5755d..b36d689c3c1 100644 --- a/src/EnergyPlus/DataSurfaceColors.cc +++ b/src/EnergyPlus/DataSurfaceColors.cc @@ -48,7 +48,6 @@ // EnergyPlus Headers #include #include -#include #include #include #include @@ -80,8 +79,6 @@ namespace DataSurfaceColors { // na // Using/Aliasing - using namespace DataPrecisionGlobals; - // Data // MODULE PARAMETER DEFINITIONS: int const NumColors(15); diff --git a/src/EnergyPlus/DataSurfaceLists.cc b/src/EnergyPlus/DataSurfaceLists.cc index 8033ece19c8..40658e9bb99 100644 --- a/src/EnergyPlus/DataSurfaceLists.cc +++ b/src/EnergyPlus/DataSurfaceLists.cc @@ -51,7 +51,6 @@ // EnergyPlus Headers #include #include -#include #include #include #include @@ -79,8 +78,6 @@ namespace DataSurfaceLists { // na // Using/Aliasing - using namespace DataPrecisionGlobals; - // Data // -only module should be available to other modules and routines. // Thus, all variables in this module must be PUBLIC. diff --git a/src/EnergyPlus/DataSurfaces.cc b/src/EnergyPlus/DataSurfaces.cc index c743a18dfdc..e22e91caaab 100644 --- a/src/EnergyPlus/DataSurfaces.cc +++ b/src/EnergyPlus/DataSurfaces.cc @@ -59,7 +59,6 @@ #include #include #include -#include #include #include #include @@ -92,7 +91,6 @@ namespace DataSurfaces { // na // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataVectorTypes; using namespace DataBSDFWindow; using namespace DataHeatBalance; diff --git a/src/EnergyPlus/DataTimings.cc b/src/EnergyPlus/DataTimings.cc index 882696f3b4d..f25680bf1f7 100644 --- a/src/EnergyPlus/DataTimings.cc +++ b/src/EnergyPlus/DataTimings.cc @@ -52,7 +52,6 @@ // EnergyPlus Headers #include #include -#include #include #include #include @@ -86,7 +85,6 @@ namespace DataTimings { // na // Using/Aliasing - using namespace DataPrecisionGlobals; using DataSystemVariables::DeveloperFlag; using DataSystemVariables::tabchar; diff --git a/src/EnergyPlus/DataUCSDSharedData.cc b/src/EnergyPlus/DataUCSDSharedData.cc index 89f3488faef..b7c62fe114b 100644 --- a/src/EnergyPlus/DataUCSDSharedData.cc +++ b/src/EnergyPlus/DataUCSDSharedData.cc @@ -46,7 +46,6 @@ // POSSIBILITY OF SUCH DAMAGE. // EnergyPlus Headers -#include #include namespace EnergyPlus { @@ -76,7 +75,6 @@ namespace DataUCSDSharedData { // USE STATEMENTS: // // Using/Aliasing - using namespace DataPrecisionGlobals; // // Data diff --git a/src/EnergyPlus/DataViewFactorInformation.cc b/src/EnergyPlus/DataViewFactorInformation.cc index 91f419935bf..fba554d66a7 100644 --- a/src/EnergyPlus/DataViewFactorInformation.cc +++ b/src/EnergyPlus/DataViewFactorInformation.cc @@ -46,7 +46,6 @@ // POSSIBILITY OF SUCH DAMAGE. // EnergyPlus Headers -#include #include namespace EnergyPlus { @@ -60,8 +59,6 @@ namespace DataViewFactorInformation { // AUTHOR Rob Hitchcock // DATE WRITTEN September 2007; Moved from HeatBalanceIntRadExchange - using namespace DataPrecisionGlobals; - int NumOfRadiantEnclosures(0); // Number of radiant enclosures int NumOfSolarEnclosures(0); // Number of solar enclosures diff --git a/src/EnergyPlus/DataWater.cc b/src/EnergyPlus/DataWater.cc index a81f7c0ec7e..df9d229d94a 100644 --- a/src/EnergyPlus/DataWater.cc +++ b/src/EnergyPlus/DataWater.cc @@ -46,7 +46,6 @@ // POSSIBILITY OF SUCH DAMAGE. // EnergyPlus Headers -#include #include namespace EnergyPlus { @@ -75,8 +74,6 @@ namespace DataWater { // na // Using/Aliasing - using namespace DataPrecisionGlobals; - // Data // -only module should be available to other modules and routines. // Thus, all variables in this module must be PUBLI diff --git a/src/EnergyPlus/DataWindowEquivalentLayer.cc b/src/EnergyPlus/DataWindowEquivalentLayer.cc index 60b6452a7c3..30312eb7886 100644 --- a/src/EnergyPlus/DataWindowEquivalentLayer.cc +++ b/src/EnergyPlus/DataWindowEquivalentLayer.cc @@ -46,7 +46,6 @@ // POSSIBILITY OF SUCH DAMAGE. // EnergyPlus Headers -#include #include namespace EnergyPlus { @@ -71,8 +70,6 @@ namespace DataWindowEquivalentLayer { // na // Using/Aliasing - using namespace DataPrecisionGlobals; - // Data // CFSTY: Complex Fenestration System int const CFSMAXNL(6); // max # of glaze or shade layers diff --git a/src/EnergyPlus/DataZoneControls.cc b/src/EnergyPlus/DataZoneControls.cc index a885a332260..42a964f741d 100644 --- a/src/EnergyPlus/DataZoneControls.cc +++ b/src/EnergyPlus/DataZoneControls.cc @@ -46,7 +46,6 @@ // POSSIBILITY OF SUCH DAMAGE. // EnergyPlus Headers -#include #include namespace EnergyPlus { @@ -76,7 +75,6 @@ namespace DataZoneControls { // na // Using/Aliasing - using namespace DataPrecisionGlobals; // // Data diff --git a/src/EnergyPlus/DataZoneEnergyDemands.cc b/src/EnergyPlus/DataZoneEnergyDemands.cc index 9e91f3be7ea..77fe244cbb1 100644 --- a/src/EnergyPlus/DataZoneEnergyDemands.cc +++ b/src/EnergyPlus/DataZoneEnergyDemands.cc @@ -46,7 +46,6 @@ // POSSIBILITY OF SUCH DAMAGE. // EnergyPlus Headers -#include #include namespace EnergyPlus { @@ -62,8 +61,6 @@ namespace DataZoneEnergyDemands { // loop managers as well as the coil simulations // Using/Aliasing - using namespace DataPrecisionGlobals; - // Data // -only module should be available to other modules and routines. // Thus, all variables in this module must be PUBLIC. diff --git a/src/EnergyPlus/DataZoneEquipment.cc b/src/EnergyPlus/DataZoneEquipment.cc index da1a572cd6b..115ad251655 100644 --- a/src/EnergyPlus/DataZoneEquipment.cc +++ b/src/EnergyPlus/DataZoneEquipment.cc @@ -57,7 +57,6 @@ #include #include #include -#include #include #include #include @@ -83,7 +82,6 @@ namespace DataZoneEquipment { // This module contains variable declarations for zone equipment configuration data // Using/Aliasing - using namespace DataPrecisionGlobals; using DataGlobals::NumOfZones; // Data diff --git a/src/EnergyPlus/DaylightingDevices.cc b/src/EnergyPlus/DaylightingDevices.cc index ef803afde5d..8e28cdbd94a 100644 --- a/src/EnergyPlus/DaylightingDevices.cc +++ b/src/EnergyPlus/DaylightingDevices.cc @@ -61,7 +61,6 @@ #include #include #include -#include #include #include #include @@ -168,7 +167,6 @@ namespace DaylightingDevices { // Mills, A. F. Heat and Mass Transfer, 1995, p. 499. (Shape factor for adjacent rectangles.) // Using/Aliasing - using namespace DataPrecisionGlobals; using DataGlobals::NumOfZones; using DataHeatBalance::MinimalShadowing; using DataHeatBalance::SolarDistribution; diff --git a/src/EnergyPlus/DaylightingManager.cc b/src/EnergyPlus/DaylightingManager.cc index 378271bfbd3..55f0bfcec36 100644 --- a/src/EnergyPlus/DaylightingManager.cc +++ b/src/EnergyPlus/DaylightingManager.cc @@ -148,7 +148,6 @@ namespace DaylightingManager { // DLUMEF DayltgLuminousEfficacy WeatherManager WeatherManager // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataGlobals; using namespace DataHeatBalance; using namespace DataSurfaces; @@ -9130,7 +9129,7 @@ namespace DaylightingManager { Z = DataGlobalConstants::PiOvr2() - PHSUN; if (ISky >= 1 && ISky <= 3) { // Following not needed for overcast sky COSG = SPHSKY * SPHSUN + std::cos(PHSKY) * CPHSUN * std::cos(THSKY - THSUN); - COSG = max(constant_minusone, min(COSG, 1.0)); // Prevent out of range due to roundoff + COSG = max(DataPrecisionGlobals::constant_minusone, min(COSG, 1.0)); // Prevent out of range due to roundoff G = std::acos(COSG); } diff --git a/src/EnergyPlus/EarthTube.cc b/src/EnergyPlus/EarthTube.cc index 4a75f27e03c..1a0b2e5cd8e 100644 --- a/src/EnergyPlus/EarthTube.cc +++ b/src/EnergyPlus/EarthTube.cc @@ -59,7 +59,6 @@ #include #include #include -#include #include #include #include @@ -88,7 +87,6 @@ namespace EarthTube { // Cambridge Massachusetts, MIT Press, 1989, pp 206-212 // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataGlobals; using namespace DataEnvironment; using namespace DataHeatBalFanSys; diff --git a/src/EnergyPlus/EcoRoofManager.cc b/src/EnergyPlus/EcoRoofManager.cc index 23c009f8f43..469b7fd5941 100644 --- a/src/EnergyPlus/EcoRoofManager.cc +++ b/src/EnergyPlus/EcoRoofManager.cc @@ -61,7 +61,6 @@ #include #include #include -#include #include #include #include @@ -97,7 +96,6 @@ namespace EcoRoofManager { // USE STATEMENTS: // Use statements for data only modules // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataSurfaces; using namespace DataGlobals; using namespace DataLoopNode; diff --git a/src/EnergyPlus/EvaporativeCoolers.cc b/src/EnergyPlus/EvaporativeCoolers.cc index 97b612262b8..916583a1743 100644 --- a/src/EnergyPlus/EvaporativeCoolers.cc +++ b/src/EnergyPlus/EvaporativeCoolers.cc @@ -68,7 +68,6 @@ #include #include #include -#include #include #include #include @@ -120,7 +119,6 @@ namespace EvaporativeCoolers { // USE STATEMENTS: // Use statements for data only modules // Using/Aliasing - using namespace DataPrecisionGlobals; using DataGlobals::BeginDayFlag; using DataGlobals::BeginEnvrnFlag; using DataGlobals::DisplayExtraWarnings; @@ -247,15 +245,15 @@ namespace EvaporativeCoolers { InitEvapCooler(EvapCoolNum); // Initialize all related parameters { - auto const SELECT_CASE_var(EvapCond(EvapCoolNum).EvapCoolerType); + auto const SELECT_CASE_var(EvapCond(EvapCoolNum).evapCoolerType); if (SELECT_CASE_var == EvapCoolerType::DirectCELDEKPAD) { CalcDirectEvapCooler(EvapCoolNum, ZoneEvapCoolerPLR); - } else if (SELECT_CASE_var == EvapCoolerType::InDirectCELDEKPAD) { + } else if (SELECT_CASE_var == EvapCoolerType::IndirectCELDEKPAD) { CalcDryIndirectEvapCooler(EvapCoolNum, ZoneEvapCoolerPLR); - } else if (SELECT_CASE_var == EvapCoolerType::InDirectWETCOIL) { + } else if (SELECT_CASE_var == EvapCoolerType::IndirectWETCOIL) { CalcWetIndirectEvapCooler(EvapCoolNum, ZoneEvapCoolerPLR); - } else if (SELECT_CASE_var == EvapCoolerType::InDirectRDDSpecial) { + } else if (SELECT_CASE_var == EvapCoolerType::IndirectRDDSpecial) { CalcResearchSpecialPartLoad(state, EvapCoolNum); CalcIndirectResearchSpecialEvapCooler(state, EvapCoolNum, ZoneEvapCoolerPLR); } else if (SELECT_CASE_var == EvapCoolerType::DirectResearchSpecial) { @@ -345,7 +343,7 @@ namespace EvaporativeCoolers { cNumericFieldNames); GlobalNames::VerifyUniqueInterObjectName(UniqueEvapCondNames, cAlphaArgs(1), cCurrentModuleObject, cAlphaFieldNames(1), ErrorsFound); EvapCond(EvapCoolNum).EvapCoolerName = cAlphaArgs(1); - EvapCond(EvapCoolNum).EvapCoolerType = EvapCoolerType::DirectCELDEKPAD; + EvapCond(EvapCoolNum).evapCoolerType = EvapCoolerType::DirectCELDEKPAD; EvapCond(EvapCoolNum).Schedule = cAlphaArgs(2); if (lAlphaFieldBlanks(2)) { @@ -418,7 +416,7 @@ namespace EvaporativeCoolers { cNumericFieldNames); GlobalNames::VerifyUniqueInterObjectName(UniqueEvapCondNames, cAlphaArgs(1), cCurrentModuleObject, cAlphaFieldNames(1), ErrorsFound); EvapCond(EvapCoolNum).EvapCoolerName = cAlphaArgs(1); - EvapCond(EvapCoolNum).EvapCoolerType = EvapCoolerType::InDirectCELDEKPAD; //'EvaporativeCooler:Indirect:CelDekPad' + EvapCond(EvapCoolNum).evapCoolerType = EvapCoolerType::IndirectCELDEKPAD; //'EvaporativeCooler:Indirect:CelDekPad' EvapCond(EvapCoolNum).Schedule = cAlphaArgs(2); if (lAlphaFieldBlanks(2)) { @@ -521,7 +519,7 @@ namespace EvaporativeCoolers { cNumericFieldNames); GlobalNames::VerifyUniqueInterObjectName(UniqueEvapCondNames, cAlphaArgs(1), cCurrentModuleObject, cAlphaFieldNames(1), ErrorsFound); EvapCond(EvapCoolNum).EvapCoolerName = cAlphaArgs(1); - EvapCond(EvapCoolNum).EvapCoolerType = EvapCoolerType::InDirectWETCOIL; //'EvaporativeCooler:Indirect:WetCoil' + EvapCond(EvapCoolNum).evapCoolerType = EvapCoolerType::IndirectWETCOIL; //'EvaporativeCooler:Indirect:WetCoil' EvapCond(EvapCoolNum).Schedule = cAlphaArgs(2); if (lAlphaFieldBlanks(2)) { @@ -615,7 +613,7 @@ namespace EvaporativeCoolers { cNumericFieldNames); GlobalNames::VerifyUniqueInterObjectName(UniqueEvapCondNames, cAlphaArgs(1), cCurrentModuleObject, cAlphaFieldNames(1), ErrorsFound); EvapCond(EvapCoolNum).EvapCoolerName = cAlphaArgs(1); - EvapCond(EvapCoolNum).EvapCoolerType = EvapCoolerType::InDirectRDDSpecial; //'EvaporativeCooler:Indirect:ResearchSpecial' + EvapCond(EvapCoolNum).evapCoolerType = EvapCoolerType::IndirectRDDSpecial; //'EvaporativeCooler:Indirect:ResearchSpecial' EvapCond(EvapCoolNum).Schedule = cAlphaArgs(2); if (lAlphaFieldBlanks(2)) { @@ -757,7 +755,7 @@ namespace EvaporativeCoolers { cNumericFieldNames); GlobalNames::VerifyUniqueInterObjectName(UniqueEvapCondNames, cAlphaArgs(1), cCurrentModuleObject, cAlphaFieldNames(1), ErrorsFound); EvapCond(EvapCoolNum).EvapCoolerName = cAlphaArgs(1); - EvapCond(EvapCoolNum).EvapCoolerType = EvapCoolerType::DirectResearchSpecial; + EvapCond(EvapCoolNum).evapCoolerType = EvapCoolerType::DirectResearchSpecial; EvapCond(EvapCoolNum).Schedule = cAlphaArgs(2); if (lAlphaFieldBlanks(2)) { @@ -980,8 +978,8 @@ namespace EvaporativeCoolers { for (EvapUnitNum = 1; EvapUnitNum <= NumEvapCool; ++EvapUnitNum) { // only check evap coolers that are supposed to have a control node - if ((EvapCond(EvapCoolNum).EvapCoolerType != EvapCoolerType::InDirectRDDSpecial) && - (EvapCond(EvapCoolNum).EvapCoolerType != EvapCoolerType::DirectResearchSpecial)) + if ((EvapCond(EvapCoolNum).evapCoolerType != EvapCoolerType::IndirectRDDSpecial) && + (EvapCond(EvapCoolNum).evapCoolerType != EvapCoolerType::DirectResearchSpecial)) continue; ControlNode = EvapCond(EvapUnitNum).EvapControlNodeNum; @@ -1161,12 +1159,12 @@ namespace EvaporativeCoolers { } { - auto const SELECT_CASE_var(EvapCond(EvapCoolNum).EvapCoolerType); - if (SELECT_CASE_var == EvapCoolerType::InDirectCELDEKPAD) { + auto const SELECT_CASE_var(EvapCond(EvapCoolNum).evapCoolerType); + if (SELECT_CASE_var == EvapCoolerType::IndirectCELDEKPAD) { CompType = "EvaporativeCooler:Indirect:CelDekPad"; - } else if (SELECT_CASE_var == EvapCoolerType::InDirectWETCOIL) { + } else if (SELECT_CASE_var == EvapCoolerType::IndirectWETCOIL) { CompType = "EvaporativeCooler:Indirect:WetCoil"; - } else if (SELECT_CASE_var == EvapCoolerType::InDirectRDDSpecial) { + } else if (SELECT_CASE_var == EvapCoolerType::IndirectRDDSpecial) { CompType = "EvaporativeCooler:Indirect:ResearchSpecial"; } else if (SELECT_CASE_var == EvapCoolerType::DirectResearchSpecial) { CompType = "EvaporativeCooler:Direct:ResearchSpecial"; @@ -1202,9 +1200,9 @@ namespace EvaporativeCoolers { if (CurSysNum > 0) { // central system if (!IsAutoSize && !SizingDesRunThisAirSys) { if (EvapCond(EvapCoolNum).IndirectVolFlowRate > 0.0) { - if (EvapCond(EvapCoolNum).EvapCoolerType == EvapCoolerType::InDirectCELDEKPAD || - EvapCond(EvapCoolNum).EvapCoolerType == EvapCoolerType::InDirectWETCOIL || - EvapCond(EvapCoolNum).EvapCoolerType == EvapCoolerType::InDirectRDDSpecial) { + if (EvapCond(EvapCoolNum).evapCoolerType == EvapCoolerType::IndirectCELDEKPAD || + EvapCond(EvapCoolNum).evapCoolerType == EvapCoolerType::IndirectWETCOIL || + EvapCond(EvapCoolNum).evapCoolerType == EvapCoolerType::IndirectRDDSpecial) { BaseSizer::reportSizerOutput(CompType, EvapCond(EvapCoolNum).EvapCoolerName, "User-Specified Secondary Fan Flow Rate [m3/s]", @@ -1219,7 +1217,7 @@ namespace EvaporativeCoolers { IndirectVolFlowRateDes = max(FinalSysSizing(CurSysNum).DesOutAirVolFlow, 0.5 * FinalSysSizing(CurSysNum).DesMainVolFlow); } // apply scaling factor the secondary air fan flow rate - if (EvapCond(EvapCoolNum).EvapCoolerType == EvapCoolerType::InDirectRDDSpecial) { + if (EvapCond(EvapCoolNum).evapCoolerType == EvapCoolerType::IndirectRDDSpecial) { IndirectVolFlowRateDes = IndirectVolFlowRateDes * EvapCond(EvapCoolNum).IndirectVolFlowScalingFactor; } } @@ -1227,9 +1225,9 @@ namespace EvaporativeCoolers { if (!IsAutoSize && !SizingDesRunThisAirSys) { if (EvapCond(EvapCoolNum).IndirectVolFlowRate > 0.0) { // report for the indirect evap cooler types only - if (EvapCond(EvapCoolNum).EvapCoolerType == EvapCoolerType::InDirectCELDEKPAD || - EvapCond(EvapCoolNum).EvapCoolerType == EvapCoolerType::InDirectWETCOIL || - EvapCond(EvapCoolNum).EvapCoolerType == EvapCoolerType::InDirectRDDSpecial) { + if (EvapCond(EvapCoolNum).evapCoolerType == EvapCoolerType::IndirectCELDEKPAD || + EvapCond(EvapCoolNum).evapCoolerType == EvapCoolerType::IndirectWETCOIL || + EvapCond(EvapCoolNum).evapCoolerType == EvapCoolerType::IndirectRDDSpecial) { BaseSizer::reportSizerOutput(CompType, EvapCond(EvapCoolNum).EvapCoolerName, "User-Specified Secondary Fan Flow Rate [m3/s]", @@ -1240,7 +1238,7 @@ namespace EvaporativeCoolers { // zone equip evap coolers IndirectVolFlowRateDes = FinalZoneSizing(CurZoneEqNum).DesCoolVolFlow; // apply scaling factor the secondary air fan flow rate - if (EvapCond(EvapCoolNum).EvapCoolerType == EvapCoolerType::InDirectRDDSpecial) { + if (EvapCond(EvapCoolNum).evapCoolerType == EvapCoolerType::IndirectRDDSpecial) { IndirectVolFlowRateDes = IndirectVolFlowRateDes * EvapCond(EvapCoolNum).IndirectVolFlowScalingFactor; } } @@ -1250,9 +1248,9 @@ namespace EvaporativeCoolers { if (!HardSizeNoDesRun) { if (IsAutoSize) { EvapCond(EvapCoolNum).IndirectVolFlowRate = IndirectVolFlowRateDes; - if (EvapCond(EvapCoolNum).EvapCoolerType == EvapCoolerType::InDirectCELDEKPAD || - EvapCond(EvapCoolNum).EvapCoolerType == EvapCoolerType::InDirectWETCOIL || - EvapCond(EvapCoolNum).EvapCoolerType == EvapCoolerType::InDirectRDDSpecial) { + if (EvapCond(EvapCoolNum).evapCoolerType == EvapCoolerType::IndirectCELDEKPAD || + EvapCond(EvapCoolNum).evapCoolerType == EvapCoolerType::IndirectWETCOIL || + EvapCond(EvapCoolNum).evapCoolerType == EvapCoolerType::IndirectRDDSpecial) { BaseSizer::reportSizerOutput(CompType, EvapCond(EvapCoolNum).EvapCoolerName, "Design Size Secondary Fan Flow Rate [m3/s]", @@ -1326,7 +1324,7 @@ namespace EvaporativeCoolers { if (IsAutoSize) { EvapCond(EvapCoolNum).DesVolFlowRate = volFlowRateDes; // only these two evap coolers has primary air design flow rate - if (EvapCond(EvapCoolNum).EvapCoolerType == EvapCoolerType::InDirectRDDSpecial) { + if (EvapCond(EvapCoolNum).evapCoolerType == EvapCoolerType::IndirectRDDSpecial) { BaseSizer::reportSizerOutput("EvaporativeCooler:Indirect:ResearchSpecial", EvapCond(EvapCoolNum).EvapCoolerName, "Primary Air Design Flow Rate [m3/s]", @@ -1335,7 +1333,7 @@ namespace EvaporativeCoolers { EvapCond(EvapCoolNum).EvapCoolerName, "Secondary Air Design Flow Rate [m3/s]", EvapCond(EvapCoolNum).IndirectVolFlowRate); - } else if (EvapCond(EvapCoolNum).EvapCoolerType == EvapCoolerType::DirectResearchSpecial) { + } else if (EvapCond(EvapCoolNum).evapCoolerType == EvapCoolerType::DirectResearchSpecial) { BaseSizer::reportSizerOutput("EvaporativeCooler:Direct:ResearchSpecial", EvapCond(EvapCoolNum).EvapCoolerName, "Primary Air Design Flow Rate [m3/s]", @@ -1361,7 +1359,7 @@ namespace EvaporativeCoolers { } } - if (EvapCond(EvapCoolNum).EvapCoolerType == EvapCoolerType::DirectCELDEKPAD) { + if (EvapCond(EvapCoolNum).evapCoolerType == EvapCoolerType::DirectCELDEKPAD) { IsAutoSize = false; if (EvapCond(EvapCoolNum).PadArea == AutoSize) { IsAutoSize = true; @@ -1480,7 +1478,7 @@ namespace EvaporativeCoolers { } } - if (EvapCond(EvapCoolNum).EvapCoolerType == EvapCoolerType::InDirectCELDEKPAD) { + if (EvapCond(EvapCoolNum).evapCoolerType == EvapCoolerType::IndirectCELDEKPAD) { IsAutoSize = false; if (EvapCond(EvapCoolNum).IndirectPadArea == AutoSize) { @@ -1609,7 +1607,7 @@ namespace EvaporativeCoolers { } } - if (EvapCond(EvapCoolNum).EvapCoolerType == EvapCoolerType::InDirectRDDSpecial) { + if (EvapCond(EvapCoolNum).evapCoolerType == EvapCoolerType::IndirectRDDSpecial) { // secondary air fan sizing: Secondary flow Rate (m3/s) * Fan Flow Sizing Factor (W/(m3/s) if (EvapCond(EvapCoolNum).IndirectFanPower == AutoSize) { EvapCond(EvapCoolNum).IndirectFanPower = EvapCond(EvapCoolNum).IndirectVolFlowRate * EvapCond(EvapCoolNum).FanSizingSpecificPower; @@ -1629,7 +1627,7 @@ namespace EvaporativeCoolers { } } - if (EvapCond(EvapCoolNum).EvapCoolerType == EvapCoolerType::DirectResearchSpecial) { + if (EvapCond(EvapCoolNum).evapCoolerType == EvapCoolerType::DirectResearchSpecial) { // recirculating water pump sizing: Primary Air Design flow Rate (m3/s) * Pump Sizing Factor (W/(m3/s) if (EvapCond(EvapCoolNum).RecircPumpPower == AutoSize) { EvapCond(EvapCoolNum).RecircPumpPower = EvapCond(EvapCoolNum).DesVolFlowRate * EvapCond(EvapCoolNum).RecircPumpSizingFactor; @@ -2148,8 +2146,8 @@ namespace EvaporativeCoolers { // Get full load result, depending on model EvapCond(EvapCoolNum).PartLoadFract = 1.0; { - auto const SELECT_CASE_var(EvapCond(EvapCoolNum).EvapCoolerType); - if (SELECT_CASE_var == EvapCoolerType::InDirectRDDSpecial) { + auto const SELECT_CASE_var(EvapCond(EvapCoolNum).evapCoolerType); + if (SELECT_CASE_var == EvapCoolerType::IndirectRDDSpecial) { CalcIndirectResearchSpecialEvapCooler(state, EvapCoolNum); UpdateEvapCooler(EvapCoolNum); FullOutput = Node(InletNode).MassFlowRate * (PsyHFnTdbW(Node(OutletNode).Temp, Node(InletNode).HumRat) - @@ -3483,7 +3481,7 @@ namespace EvaporativeCoolers { if (EvapCond(EvapCoolNum).SecondaryOutletNode > 0) { // set outlet nodes of the secondary air side of the EvapCooler (mass Flow Rate Only) - if (EvapCond(EvapCoolNum).EvapCoolerType == EvapCoolerType::InDirectRDDSpecial && EvapCond(EvapCoolNum).EvapCoolerOperationControlFlag) { + if (EvapCond(EvapCoolNum).evapCoolerType == EvapCoolerType::IndirectRDDSpecial && EvapCond(EvapCoolNum).EvapCoolerOperationControlFlag) { Node(OutletNodeSec).Temp = EvapCond(EvapCoolNum).SecOutletTemp; Node(OutletNodeSec).HumRat = EvapCond(EvapCoolNum).SecOutletHumRat; Node(OutletNodeSec).Enthalpy = EvapCond(EvapCoolNum).SecOutletEnthalpy; @@ -3856,13 +3854,13 @@ namespace EvaporativeCoolers { ZoneEvapUnit(UnitLoop).EvapCooler_1_Type_Num = EvapCoolerType::DirectResearchSpecial; } else if (SELECT_CASE_var == "EVAPORATIVECOOLER:INDIRECT:CELDEKPAD") { ZoneEvapUnit(UnitLoop).EvapCooler_1_ObjectClassName = "EvaporativeCooler:Indirect:CelDekPad"; - ZoneEvapUnit(UnitLoop).EvapCooler_1_Type_Num = EvapCoolerType::InDirectCELDEKPAD; + ZoneEvapUnit(UnitLoop).EvapCooler_1_Type_Num = EvapCoolerType::IndirectCELDEKPAD; } else if (SELECT_CASE_var == "EVAPORATIVECOOLER:INDIRECT:WETCOIL") { ZoneEvapUnit(UnitLoop).EvapCooler_1_ObjectClassName = "EvaporativeCooler:Indirect:WetCoil"; - ZoneEvapUnit(UnitLoop).EvapCooler_1_Type_Num = EvapCoolerType::InDirectWETCOIL; + ZoneEvapUnit(UnitLoop).EvapCooler_1_Type_Num = EvapCoolerType::IndirectWETCOIL; } else if (SELECT_CASE_var == "EVAPORATIVECOOLER:INDIRECT:RESEARCHSPECIAL") { ZoneEvapUnit(UnitLoop).EvapCooler_1_ObjectClassName = "EvaporativeCooler:Indirect:ResearchSpecial"; - ZoneEvapUnit(UnitLoop).EvapCooler_1_Type_Num = EvapCoolerType::InDirectRDDSpecial; + ZoneEvapUnit(UnitLoop).EvapCooler_1_Type_Num = EvapCoolerType::IndirectRDDSpecial; } else { ShowSevereError(CurrentModuleObject + "=\"" + ZoneEvapUnit(UnitLoop).Name + "\" invalid data."); ShowContinueError("invalid choice found " + cAlphaFields(11) + "=\"" + Alphas(11) + "\"."); @@ -3890,13 +3888,13 @@ namespace EvaporativeCoolers { ZoneEvapUnit(UnitLoop).EvapCooler_2_Type_Num = EvapCoolerType::DirectResearchSpecial; } else if (SELECT_CASE_var == "EVAPORATIVECOOLER:INDIRECT:CELDEKPAD") { ZoneEvapUnit(UnitLoop).EvapCooler_2_ObjectClassName = "EvaporativeCooler:Indirect:CelDekPad"; - ZoneEvapUnit(UnitLoop).EvapCooler_2_Type_Num = EvapCoolerType::InDirectCELDEKPAD; + ZoneEvapUnit(UnitLoop).EvapCooler_2_Type_Num = EvapCoolerType::IndirectCELDEKPAD; } else if (SELECT_CASE_var == "EVAPORATIVECOOLER:INDIRECT:WETCOIL") { ZoneEvapUnit(UnitLoop).EvapCooler_2_ObjectClassName = "EvaporativeCooler:Indirect:WetCoil"; - ZoneEvapUnit(UnitLoop).EvapCooler_2_Type_Num = EvapCoolerType::InDirectWETCOIL; + ZoneEvapUnit(UnitLoop).EvapCooler_2_Type_Num = EvapCoolerType::IndirectWETCOIL; } else if (SELECT_CASE_var == "EVAPORATIVECOOLER:INDIRECT:RESEARCHSPECIAL") { ZoneEvapUnit(UnitLoop).EvapCooler_2_ObjectClassName = "EvaporativeCooler:Indirect:ResearchSpecial"; - ZoneEvapUnit(UnitLoop).EvapCooler_2_Type_Num = EvapCoolerType::InDirectRDDSpecial; + ZoneEvapUnit(UnitLoop).EvapCooler_2_Type_Num = EvapCoolerType::IndirectRDDSpecial; } else { ShowSevereError(CurrentModuleObject + "=\"" + ZoneEvapUnit(UnitLoop).Name + "\" invalid data."); ShowContinueError("invalid choice found " + cAlphaFields(13) + "=\"" + Alphas(13) + "\"."); @@ -4237,13 +4235,13 @@ namespace EvaporativeCoolers { // place default cold setpoints on control nodes of select evap coolers if ((ZoneEvapUnit(UnitNum).EvapCooler_1_Type_Num == EvapCoolerType::DirectResearchSpecial) || - (ZoneEvapUnit(UnitNum).EvapCooler_1_Type_Num == EvapCoolerType::InDirectRDDSpecial)) { + (ZoneEvapUnit(UnitNum).EvapCooler_1_Type_Num == EvapCoolerType::IndirectRDDSpecial)) { if (EvapCond(ZoneEvapUnit(UnitNum).EvapCooler_1_Index).EvapControlNodeNum > 0) { Node(EvapCond(ZoneEvapUnit(UnitNum).EvapCooler_1_Index).EvapControlNodeNum).TempSetPoint = -20.0; } } if ((ZoneEvapUnit(UnitNum).EvapCooler_2_Type_Num == EvapCoolerType::DirectResearchSpecial) || - (ZoneEvapUnit(UnitNum).EvapCooler_2_Type_Num == EvapCoolerType::InDirectRDDSpecial)) { + (ZoneEvapUnit(UnitNum).EvapCooler_2_Type_Num == EvapCoolerType::IndirectRDDSpecial)) { if (EvapCond(ZoneEvapUnit(UnitNum).EvapCooler_2_Index).EvapControlNodeNum > 0) { Node(EvapCond(ZoneEvapUnit(UnitNum).EvapCooler_2_Index).EvapControlNodeNum).TempSetPoint = -20.0; } diff --git a/src/EnergyPlus/EvaporativeCoolers.hh b/src/EnergyPlus/EvaporativeCoolers.hh index 4b1ee1de3da..c7cbb5c189d 100644 --- a/src/EnergyPlus/EvaporativeCoolers.hh +++ b/src/EnergyPlus/EvaporativeCoolers.hh @@ -99,9 +99,9 @@ namespace EvaporativeCoolers { enum class EvapCoolerType { Unassigned, DirectCELDEKPAD, - InDirectCELDEKPAD, - InDirectWETCOIL, - InDirectRDDSpecial, + IndirectCELDEKPAD, + IndirectWETCOIL, + IndirectRDDSpecial, DirectResearchSpecial }; @@ -114,7 +114,7 @@ namespace EvaporativeCoolers { // Members std::string EvapCoolerName; // Name of the EvapCooler int EquipIndex; - EvapCoolerType EvapCoolerType; // Type of the EvapCooler (parameters in DataGlobalConstants.cc + EvapCoolerType evapCoolerType; // Type of the EvapCooler std::string EvapControlType; // Type of Control for the EvapCooler std::string Schedule; // HeatingCoil Operation Schedule int SchedPtr; // Pointer to the correct schedule @@ -213,7 +213,7 @@ namespace EvaporativeCoolers { // Default Constructor EvapConditions() - : EquipIndex(0), EvapCoolerType(EvapCoolerType::Unassigned), SchedPtr(0), VolFlowRate(0.0), DesVolFlowRate(0.0), + : EquipIndex(0), evapCoolerType(EvapCoolerType::Unassigned), SchedPtr(0), VolFlowRate(0.0), DesVolFlowRate(0.0), OutletTemp(0.0), OuletWetBulbTemp(0.0), OutletHumRat(0.0), OutletEnthalpy(0.0), OutletPressure(0.0), OutletMassFlowRate(0.0), OutletMassFlowRateMaxAvail(0.0), OutletMassFlowRateMinAvail(0.0), InitFlag(false), InletNode(0), OutletNode(0), SecondaryInletNode(0), SecondaryOutletNode(0), @@ -335,9 +335,7 @@ namespace EvaporativeCoolers { Array1D_string FieldNames; // Default Constructor - ZoneEvapCoolerUnitFieldData() - { - } + ZoneEvapCoolerUnitFieldData() = default; }; // Object Data @@ -347,7 +345,7 @@ namespace EvaporativeCoolers { // Functions - void SimEvapCooler(EnergyPlusData &state, std::string const &CompName, int &CompIndex, Real64 const PartLoadRatio = 1.0); + void SimEvapCooler(EnergyPlusData &state, std::string const &CompName, int &CompIndex, Real64 PartLoadRatio = 1.0); // Get Input Section of the Module //****************************************************************************** @@ -360,9 +358,9 @@ namespace EvaporativeCoolers { // Beginning Initialization Section of the Module //****************************************************************************** - void InitEvapCooler(int const EvapCoolNum); + void InitEvapCooler(int EvapCoolNum); - void SizeEvapCooler(int const EvapCoolNum); + void SizeEvapCooler(int EvapCoolNum); // End Initialization Section of the Module //****************************************************************************** @@ -370,58 +368,58 @@ namespace EvaporativeCoolers { // Begin Algorithm Section of the Module //****************************************************************************** - void CalcDirectEvapCooler(int &EvapCoolNum, Real64 const PartLoadRatio); + void CalcDirectEvapCooler(int &EvapCoolNum, Real64 PartLoadRatio); - void CalcDryIndirectEvapCooler(int &EvapCoolNum, Real64 const PartLoadRatio); + void CalcDryIndirectEvapCooler(int &EvapCoolNum, Real64 PartLoadRatio); - void CalcWetIndirectEvapCooler(int &EvapCoolNum, Real64 const PartLoadRatio); + void CalcWetIndirectEvapCooler(int &EvapCoolNum, Real64 PartLoadRatio); void CalcResearchSpecialPartLoad(EnergyPlusData &state, int &EvapCoolNum); void CalcIndirectResearchSpecialEvapCoolerAdvanced(EnergyPlusData &state, - int const EvapCoolNum, - Real64 const InletDryBulbTempSec, - Real64 const InletWetBulbTempSec, - Real64 const InletDewPointTempSec, - Real64 const InletHumRatioSec); - - int IndirectResearchSpecialEvapCoolerOperatingMode(int const EvapCoolNum, - Real64 const InletDryBulbTempSec, - Real64 const InletWetBulbTempSec, - Real64 const TdbOutSysWetMin, - Real64 const TdbOutSysDryMin); - - void CalcSecondaryAirOutletCondition(int const EvapCoolNum, - int const OperatingMode, - Real64 const AirMassFlowSec, - Real64 const EDBTSec, - Real64 const EWBTSec, - Real64 const EHumRatSec, - Real64 const QHXTotal, + int EvapCoolNum, + Real64 InletDryBulbTempSec, + Real64 InletWetBulbTempSec, + Real64 InletDewPointTempSec, + Real64 InletHumRatioSec); + + int IndirectResearchSpecialEvapCoolerOperatingMode(int EvapCoolNum, + Real64 InletDryBulbTempSec, + Real64 InletWetBulbTempSec, + Real64 TdbOutSysWetMin, + Real64 TdbOutSysDryMin); + + void CalcSecondaryAirOutletCondition(int EvapCoolNum, + int OperatingMode, + Real64 AirMassFlowSec, + Real64 EDBTSec, + Real64 EWBTSec, + Real64 EHumRatSec, + Real64 QHXTotal, Real64 &QHXLatent); void CalcIndirectRDDEvapCoolerOutletTemp(EnergyPlusData &state, - int const EvapCoolNum, - int const DryOrWetOperatingMode, - Real64 const AirMassFlowSec, - Real64 const EDBTSec, - Real64 const EWBTSec, - Real64 const EHumRatSec); + int EvapCoolNum, + int DryOrWetOperatingMode, + Real64 AirMassFlowSec, + Real64 EDBTSec, + Real64 EWBTSec, + Real64 EHumRatSec); Real64 CalcEvapCoolRDDSecFlowResidual(EnergyPlusData &state, - Real64 const AirMassFlowSec, + Real64 AirMassFlowSec, Array1D const &Par // Par( 6 ) is desired temperature C ); Real64 IndEvapCoolerPower(EnergyPlusData &state, - int const EvapCoolIndex, // Unit index - int const DryWetMode, // dry or wet operating mode of evaporator cooler - Real64 const FlowRatio // secondary air flow fraction + int EvapCoolIndex, // Unit index + int DryWetMode, // dry or wet operating mode of evaporator cooler + Real64 FlowRatio // secondary air flow fraction ); - void CalcIndirectResearchSpecialEvapCooler(EnergyPlusData &state, int const EvapCoolNum, Real64 const FanPLR = 1.0); + void CalcIndirectResearchSpecialEvapCooler(EnergyPlusData &state, int EvapCoolNum, Real64 FanPLR = 1.0); - void CalcDirectResearchSpecialEvapCooler(EnergyPlusData &state, int const EvapCoolNum, Real64 const FanPLR = 1.0); + void CalcDirectResearchSpecialEvapCooler(EnergyPlusData &state, int EvapCoolNum, Real64 FanPLR = 1.0); // End Algorithm Section of the Module // ***************************************************************************** @@ -429,7 +427,7 @@ namespace EvaporativeCoolers { // Beginning of Update subroutines for the EvapCooler Module // ***************************************************************************** - void UpdateEvapCooler(int const EvapCoolNum); + void UpdateEvapCooler(int EvapCoolNum); // End of Update subroutines for the EvapCooler Module // ***************************************************************************** @@ -437,7 +435,7 @@ namespace EvaporativeCoolers { // Beginning of Reporting subroutines for the EvapCooler Module // ***************************************************************************** - void ReportEvapCooler(int const EvapCoolNum); + void ReportEvapCooler(int EvapCoolNum); //*************** // Begin routines for zone HVAC Evaporative cooler unit @@ -445,7 +443,7 @@ namespace EvaporativeCoolers { //*************** void SimZoneEvaporativeCoolerUnit(EnergyPlusData &state, std::string const &CompName, // name of the packaged terminal heat pump - int const ZoneNum, // number of zone being served + int ZoneNum, // number of zone being served Real64 &SensibleOutputProvided, // sensible capacity delivered to zone Real64 &LatentOutputProvided, // Latent add/removal (kg/s), dehumid = negative int &CompIndex // index to zone hvac unit @@ -453,42 +451,42 @@ namespace EvaporativeCoolers { void GetInputZoneEvaporativeCoolerUnit(EnergyPlusData &state); - void InitZoneEvaporativeCoolerUnit(EnergyPlusData &state, int const UnitNum, // unit number - int const ZoneNum // number of zone being served + void InitZoneEvaporativeCoolerUnit(EnergyPlusData &state, int UnitNum, // unit number + int ZoneNum // number of zone being served ); - void SizeZoneEvaporativeCoolerUnit(EnergyPlusData &state, int const UnitNum); // unit number + void SizeZoneEvaporativeCoolerUnit(EnergyPlusData &state, int UnitNum); // unit number - void CalcZoneEvaporativeCoolerUnit(EnergyPlusData &state, int const UnitNum, // unit number - int const ZoneNum, // number of zone being served + void CalcZoneEvaporativeCoolerUnit(EnergyPlusData &state, int UnitNum, // unit number + int ZoneNum, // number of zone being served Real64 &SensibleOutputProvided, // sensible capacity delivered to zone Real64 &LatentOutputProvided // Latent add/removal (kg/s), dehumid = negative ); - void CalcZoneEvapUnitOutput(EnergyPlusData &state, int const UnitNum, // unit number - Real64 const PartLoadRatio, // zone evap unit part load ratiod + void CalcZoneEvapUnitOutput(EnergyPlusData &state, int UnitNum, // unit number + Real64 PartLoadRatio, // zone evap unit part load ratiod Real64 &SensibleOutputProvided, // sensible capacity delivered to zone Real64 &LatentOutputProvided // Latent add/removal (kg/s), dehumid = negative ); - void ControlZoneEvapUnitOutput(EnergyPlusData &state, int const UnitNum, // unit number - Real64 const ZoneCoolingLoad // target cooling load + void ControlZoneEvapUnitOutput(EnergyPlusData &state, int UnitNum, // unit number + Real64 ZoneCoolingLoad // target cooling load ); - Real64 ZoneEvapUnitLoadResidual(EnergyPlusData &state, Real64 const PartLoadRatio, // zone evap unit part load ratiod + Real64 ZoneEvapUnitLoadResidual(EnergyPlusData &state, Real64 PartLoadRatio, // zone evap unit part load ratiod Array1D const &Par // parameters ); - void ControlVSEvapUnitToMeetLoad(EnergyPlusData &state, int const UnitNum, // unit number - int const ZoneNum, // number of zone being served - Real64 const ZoneCoolingLoad // target cooling load + void ControlVSEvapUnitToMeetLoad(EnergyPlusData &state, int UnitNum, // unit number + int ZoneNum, // number of zone being served + Real64 ZoneCoolingLoad // target cooling load ); - Real64 VSEvapUnitLoadResidual(EnergyPlusData &state, Real64 const FanSpeedRatio, + Real64 VSEvapUnitLoadResidual(EnergyPlusData &state, Real64 FanSpeedRatio, Array1D const &Par // parameters ); - void ReportZoneEvaporativeCoolerUnit(int const UnitNum); // unit number + void ReportZoneEvaporativeCoolerUnit(int UnitNum); // unit number // End of Reporting subroutines for the EvaporativeCoolers Module // ***************************************************************************** diff --git a/src/EnergyPlus/FanCoilUnits.cc b/src/EnergyPlus/FanCoilUnits.cc index 6e4be0a2dd1..8a025dfc441 100644 --- a/src/EnergyPlus/FanCoilUnits.cc +++ b/src/EnergyPlus/FanCoilUnits.cc @@ -127,7 +127,6 @@ namespace FanCoilUnits { // USE STATEMENTS: // Use statements for data only modules // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataLoopNode; using namespace DataSizing; using DataEnvironment::OutBaroPress; @@ -2691,8 +2690,8 @@ namespace FanCoilUnits { QTotUnitOut = AirMassFlow * (Node(OutletNode).Enthalpy - Node(InletNode).Enthalpy); // report variables FanCoil(FanCoilNum).HeatPower = max(0.0, QUnitOut); - FanCoil(FanCoilNum).SensCoolPower = std::abs(min(constant_zero, QUnitOut)); - FanCoil(FanCoilNum).TotCoolPower = std::abs(min(constant_zero, QTotUnitOut)); + FanCoil(FanCoilNum).SensCoolPower = std::abs(min(DataPrecisionGlobals::constant_zero, QUnitOut)); + FanCoil(FanCoilNum).TotCoolPower = std::abs(min(DataPrecisionGlobals::constant_zero, QTotUnitOut)); if (FanCoil(FanCoilNum).FanType_Num != DataHVACGlobals::FanType_SystemModelObject) { FanCoil(FanCoilNum).ElecPower = Fans::GetFanPower(FanCoil(FanCoilNum).FanIndex); } else { @@ -3017,8 +3016,8 @@ namespace FanCoilUnits { QTotUnitOut = AirMassFlow * (Node(OutletNode).Enthalpy - Node(InletNode).Enthalpy); // report variables FanCoil(FanCoilNum).HeatPower = max(0.0, QUnitOut); - FanCoil(FanCoilNum).SensCoolPower = std::abs(min(constant_zero, QUnitOut)); - FanCoil(FanCoilNum).TotCoolPower = std::abs(min(constant_zero, QTotUnitOut)); + FanCoil(FanCoilNum).SensCoolPower = std::abs(min(DataPrecisionGlobals::constant_zero, QUnitOut)); + FanCoil(FanCoilNum).TotCoolPower = std::abs(min(DataPrecisionGlobals::constant_zero, QTotUnitOut)); if (FanCoil(FanCoilNum).FanType_Num != DataHVACGlobals::FanType_SystemModelObject) { FanCoil(FanCoilNum).ElecPower = Fans::GetFanPower(FanCoil(FanCoilNum).FanIndex); } else { @@ -3352,8 +3351,8 @@ namespace FanCoilUnits { QTotUnitOut = AirMassFlow * (Node(OutletNode).Enthalpy - Node(InletNode).Enthalpy); // report variables FanCoil(FanCoilNum).HeatPower = max(0.0, QSensUnitOutNoATM); - FanCoil(FanCoilNum).SensCoolPower = std::abs(min(constant_zero, QSensUnitOutNoATM)); - FanCoil(FanCoilNum).TotCoolPower = std::abs(min(constant_zero, QTotUnitOut)); + FanCoil(FanCoilNum).SensCoolPower = std::abs(min(DataPrecisionGlobals::constant_zero, QSensUnitOutNoATM)); + FanCoil(FanCoilNum).TotCoolPower = std::abs(min(DataPrecisionGlobals::constant_zero, QTotUnitOut)); if (FanCoil(FanCoilNum).FanType_Num != DataHVACGlobals::FanType_SystemModelObject) { FanCoil(FanCoilNum).ElecPower = Fans::GetFanPower(FanCoil(FanCoilNum).FanIndex); } else { @@ -3374,8 +3373,8 @@ namespace FanCoilUnits { QTotUnitOut = AirMassFlow * (Node(OutletNode).Enthalpy - Node(InletNode).Enthalpy); // report variables FanCoil(FanCoilNum).HeatPower = max(0.0, QSensUnitOutNoATM); - FanCoil(FanCoilNum).SensCoolPower = std::abs(min(constant_zero, QSensUnitOutNoATM)); - FanCoil(FanCoilNum).TotCoolPower = std::abs(min(constant_zero, QTotUnitOut)); + FanCoil(FanCoilNum).SensCoolPower = std::abs(min(DataPrecisionGlobals::constant_zero, QSensUnitOutNoATM)); + FanCoil(FanCoilNum).TotCoolPower = std::abs(min(DataPrecisionGlobals::constant_zero, QTotUnitOut)); if (FanCoil(FanCoilNum).FanType_Num != DataHVACGlobals::FanType_SystemModelObject) { FanCoil(FanCoilNum).ElecPower = Fans::GetFanPower(FanCoil(FanCoilNum).FanIndex); } else { diff --git a/src/EnergyPlus/Fans.cc b/src/EnergyPlus/Fans.cc index 4262af79a2b..e920907194b 100644 --- a/src/EnergyPlus/Fans.cc +++ b/src/EnergyPlus/Fans.cc @@ -102,7 +102,6 @@ namespace Fans { // USE STATEMENTS: // Use statements for data only modules // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataLoopNode; using namespace DataGlobals; using DataEnvironment::StdRhoAir; @@ -3155,7 +3154,7 @@ namespace Fans { MotEff = Fan(FanNum).MotEff; MotInAirFrac = Fan(FanNum).MotInAirFrac; RhoAir = StdRhoAir; - CpAir = PsyCpAirFnW(constant_zero); + CpAir = PsyCpAirFnW(DataPrecisionGlobals::constant_zero); DesignDeltaT = (DeltaP / (RhoAir * CpAir * TotEff)) * (MotEff + MotInAirFrac * (1.0 - MotEff)); } else { DesignDeltaT = 0.0; diff --git a/src/EnergyPlus/FluidCoolers.cc b/src/EnergyPlus/FluidCoolers.cc index bc94af4d18f..fccef8b07ec 100644 --- a/src/EnergyPlus/FluidCoolers.cc +++ b/src/EnergyPlus/FluidCoolers.cc @@ -61,7 +61,6 @@ #include #include #include -#include #include #include #include diff --git a/src/EnergyPlus/FluidProperties.cc b/src/EnergyPlus/FluidProperties.cc index 1f52f9880df..f8db0694b3a 100644 --- a/src/EnergyPlus/FluidProperties.cc +++ b/src/EnergyPlus/FluidProperties.cc @@ -57,7 +57,6 @@ // EnergyPlus Headers #include -#include #include #include #include @@ -110,7 +109,6 @@ namespace FluidProperties { // USE STATEMENTS // Using/Aliasing - using namespace DataPrecisionGlobals; using DataGlobals::WarmupFlag; using General::RoundSigDigits; diff --git a/src/EnergyPlus/GlobalNames.cc b/src/EnergyPlus/GlobalNames.cc index 3557f0a7654..20b2dc396c1 100644 --- a/src/EnergyPlus/GlobalNames.cc +++ b/src/EnergyPlus/GlobalNames.cc @@ -46,7 +46,6 @@ // POSSIBILITY OF SUCH DAMAGE. // EnergyPlus Headers -#include #include #include #include @@ -78,7 +77,6 @@ namespace GlobalNames { // na // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataGlobals; // Data diff --git a/src/EnergyPlus/HVACControllers.cc b/src/EnergyPlus/HVACControllers.cc index 93b7476d41d..c37e6eb962d 100644 --- a/src/EnergyPlus/HVACControllers.cc +++ b/src/EnergyPlus/HVACControllers.cc @@ -180,7 +180,6 @@ namespace HVACControllers { // USE STATEMENTS: // Use statements for data only modules // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataLoopNode; using namespace DataGlobals; using DataHVACGlobals::SetPointErrorFlag; @@ -412,7 +411,7 @@ namespace HVACControllers { HVACControllers::ControllerProps(ControlNum).HumRatCtrlOverride = false; // Put the controller tolerance (offset) back to it's original value RootFinder::SetupRootFinder( - RootFinders(ControlNum), iSlopeDecreasing, iMethodBrent, constant_zero, 1.0e-6, ControllerProps(ControlNum).Offset); + RootFinders(ControlNum), iSlopeDecreasing, iMethodBrent, DataPrecisionGlobals::constant_zero, 1.0e-6, ControllerProps(ControlNum).Offset); } // If a iControllerOpColdStart call, reset the actuator inlet flows @@ -1161,7 +1160,7 @@ namespace HVACControllers { SetupRootFinder(RootFinders(ControlNum), iSlopeIncreasing, iMethodBrent, - constant_zero, + DataPrecisionGlobals::constant_zero, 1.0e-6, ControllerProps(ControlNum).Offset); // Slope type | Method type | TolX: no relative tolerance for X variables | // ATolX: absolute tolerance for X variables | ATolY: absolute tolerance for @@ -1171,7 +1170,7 @@ namespace HVACControllers { SetupRootFinder(RootFinders(ControlNum), iSlopeDecreasing, iMethodBrent, - constant_zero, + DataPrecisionGlobals::constant_zero, 1.0e-6, ControllerProps(ControlNum).Offset); // Slope type | Method type | TolX: no relative tolerance for X variables | // ATolX: absolute tolerance for X variables | ATolY: absolute tolerance for @@ -1495,7 +1494,7 @@ namespace HVACControllers { // Check to see if the component is running; if not converged and return. This check will be done // by looking at the component mass flow rate at the sensed node. if (Node(SensedNode).MassFlowRate == 0.0) { - ExitCalcController(ControlNum, constant_zero, iModeOff, IsConvergedFlag, IsUpToDateFlag); + ExitCalcController(ControlNum, DataPrecisionGlobals::constant_zero, iModeOff, IsConvergedFlag, IsUpToDateFlag); return; } @@ -2251,7 +2250,7 @@ namespace HVACControllers { if (thisController.Action == iReverseAction) { // Cooling coil controller should always be ReverseAction, but skip this if not RootFinder::SetupRootFinder( - RootFinders(ControlNum), iSlopeDecreasing, iMethodFalsePosition, constant_zero, 1.0e-6, 1.0e-5); + RootFinders(ControlNum), iSlopeDecreasing, iMethodFalsePosition, DataPrecisionGlobals::constant_zero, 1.0e-6, 1.0e-5); } // Do a cold start reset, same as iControllerOpColdStart ResetController(ControlNum, false, IsConvergedFlag); diff --git a/src/EnergyPlus/HVACDXSystem.cc b/src/EnergyPlus/HVACDXSystem.cc index d33b67cad24..400fc1e48f6 100644 --- a/src/EnergyPlus/HVACDXSystem.cc +++ b/src/EnergyPlus/HVACDXSystem.cc @@ -62,7 +62,6 @@ #include #include #include -#include #include #include //coil report #include @@ -119,7 +118,6 @@ namespace HVACDXSystem { // USE STATEMENTS: // Use statements for data only modules // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataLoopNode; using namespace DataGlobals; using namespace DataHVACGlobals; diff --git a/src/EnergyPlus/HVACDuct.cc b/src/EnergyPlus/HVACDuct.cc index c22483f9f61..5bcac778717 100644 --- a/src/EnergyPlus/HVACDuct.cc +++ b/src/EnergyPlus/HVACDuct.cc @@ -52,7 +52,6 @@ #include #include #include -#include #include #include #include @@ -91,7 +90,6 @@ namespace HVACDuct { // USE STATEMENTS: // // Using/Aliasing - using namespace DataPrecisionGlobals; using DataGlobals::BeginEnvrnFlag; using namespace DataHVACGlobals; using namespace DataLoopNode; diff --git a/src/EnergyPlus/HVACFan.cc b/src/EnergyPlus/HVACFan.cc index dfdc79752fb..2e966a0adc0 100644 --- a/src/EnergyPlus/HVACFan.cc +++ b/src/EnergyPlus/HVACFan.cc @@ -50,7 +50,6 @@ #include #include #include -#include #include #include #include diff --git a/src/EnergyPlus/HVACHXAssistedCoolingCoil.cc b/src/EnergyPlus/HVACHXAssistedCoolingCoil.cc index d6b01479bcb..c3043f6b740 100644 --- a/src/EnergyPlus/HVACHXAssistedCoolingCoil.cc +++ b/src/EnergyPlus/HVACHXAssistedCoolingCoil.cc @@ -57,7 +57,6 @@ #include #include #include -#include #include #include #include @@ -102,7 +101,6 @@ namespace HVACHXAssistedCoolingCoil { // USE STATEMENTS: // Use statements for data only modules // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataLoopNode; using namespace DataGlobals; using namespace DataHVACGlobals; diff --git a/src/EnergyPlus/HVACManager.cc b/src/EnergyPlus/HVACManager.cc index 45c9a0242d6..309b4bda4f4 100644 --- a/src/EnergyPlus/HVACManager.cc +++ b/src/EnergyPlus/HVACManager.cc @@ -69,7 +69,6 @@ #include #include #include -#include #include #include #include @@ -126,7 +125,6 @@ namespace HVACManager { // REFERENCES: // Using/Aliasing - using namespace DataPrecisionGlobals; using DataGlobals::AnyEnergyManagementSystemInModel; using DataGlobals::AnyIdealCondEntSetPointInModel; using DataGlobals::BeginDayFlag; diff --git a/src/EnergyPlus/HVACSingleDuctInduc.cc b/src/EnergyPlus/HVACSingleDuctInduc.cc index afa0f98c003..e747292a3f5 100644 --- a/src/EnergyPlus/HVACSingleDuctInduc.cc +++ b/src/EnergyPlus/HVACSingleDuctInduc.cc @@ -62,7 +62,6 @@ #include #include #include -#include #include #include #include @@ -109,7 +108,6 @@ namespace HVACSingleDuctInduc { // na // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataLoopNode; using DataEnvironment::StdRhoAir; using DataGlobals::BeginEnvrnFlag; diff --git a/src/EnergyPlus/HeatBalanceInternalHeatGains.cc b/src/EnergyPlus/HeatBalanceInternalHeatGains.cc index 3e08f88d584..a2713601680 100644 --- a/src/EnergyPlus/HeatBalanceInternalHeatGains.cc +++ b/src/EnergyPlus/HeatBalanceInternalHeatGains.cc @@ -50,7 +50,6 @@ // EnergyPlus Headers #include -#include #include #include @@ -86,7 +85,6 @@ void SetupZoneInternalGain(int const ZoneNum, // and HVAC components with skin loss models like thermal tanks, and power conditioning. // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataHeatBalance; // SUBROUTINE PARAMETER DEFINITIONS: diff --git a/src/EnergyPlus/HeatBalanceManager.cc b/src/EnergyPlus/HeatBalanceManager.cc index 6b2e14db333..747da140e03 100644 --- a/src/EnergyPlus/HeatBalanceManager.cc +++ b/src/EnergyPlus/HeatBalanceManager.cc @@ -72,7 +72,6 @@ #include #include #include -#include #include #include #include @@ -144,7 +143,6 @@ namespace HeatBalanceManager { // USE STATEMENTS: // Use statements for data only modules // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataComplexFenestration; using namespace DataGlobals; using namespace DataEnvironment; diff --git a/src/EnergyPlus/HeatBalanceMovableInsulation.cc b/src/EnergyPlus/HeatBalanceMovableInsulation.cc index 6ed92c31c92..2e9673d4feb 100644 --- a/src/EnergyPlus/HeatBalanceMovableInsulation.cc +++ b/src/EnergyPlus/HeatBalanceMovableInsulation.cc @@ -50,7 +50,6 @@ // EnergyPlus Headers #include -#include #include #include #include @@ -72,7 +71,6 @@ namespace HeatBalanceMovableInsulation { // movable and transparent insulation. // USE STATEMENTS: - using namespace DataPrecisionGlobals; using DataSurfaces::Surface; using ScheduleManager::GetCurrentScheduleValue; diff --git a/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc b/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc index 91f368f3185..ebd28bafa0a 100644 --- a/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc +++ b/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc @@ -56,7 +56,6 @@ #include #include #include -#include #include #include #include @@ -103,7 +102,6 @@ namespace HeatPumpWaterToWaterSimple { // USE STATEMENTS: // Use statements for data only modules // Using/Aliasing - using namespace DataPrecisionGlobals; using DataGlobals::BeginEnvrnFlag; using DataGlobals::BeginSimFlag; using DataGlobals::DayOfSim; diff --git a/src/EnergyPlus/HeatRecovery.cc b/src/EnergyPlus/HeatRecovery.cc index 4cf3367ace4..6c8d0b9bcbb 100644 --- a/src/EnergyPlus/HeatRecovery.cc +++ b/src/EnergyPlus/HeatRecovery.cc @@ -63,7 +63,6 @@ #include #include #include -#include #include #include #include @@ -111,7 +110,6 @@ namespace HeatRecovery { // USE STATEMENTS: // Use statements for data only modules // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataHVACGlobals; using DataGlobals::BeginEnvrnFlag; using DataGlobals::DisplayExtraWarnings; diff --git a/src/EnergyPlus/HighTempRadiantSystem.cc b/src/EnergyPlus/HighTempRadiantSystem.cc index 7bf013d6faf..38d1c876a95 100644 --- a/src/EnergyPlus/HighTempRadiantSystem.cc +++ b/src/EnergyPlus/HighTempRadiantSystem.cc @@ -61,7 +61,6 @@ #include #include #include -#include #include #include #include @@ -112,7 +111,6 @@ namespace HighTempRadiantSystem { // USE STATEMENTS: // Use statements for data only modules // Using/Aliasing - using namespace DataPrecisionGlobals; using DataGlobals::BeginTimeStepFlag; using DataGlobals::DisplayExtraWarnings; using DataGlobals::ScheduleAlwaysOn; diff --git a/src/EnergyPlus/Humidifiers.cc b/src/EnergyPlus/Humidifiers.cc index 120c315a993..72480c1e207 100644 --- a/src/EnergyPlus/Humidifiers.cc +++ b/src/EnergyPlus/Humidifiers.cc @@ -57,7 +57,6 @@ #include #include #include -#include #include #include #include @@ -102,7 +101,6 @@ namespace Humidifiers { // REFERENCES: ASHRAE HVAC 2 Toolkit, page 4-112 // Using/Aliasing - using namespace DataPrecisionGlobals; using DataGlobals::BeginEnvrnFlag; using DataGlobals::DisplayExtraWarnings; using DataGlobals::ScheduleAlwaysOn; diff --git a/src/EnergyPlus/HybridModel.cc b/src/EnergyPlus/HybridModel.cc index 8eb29e4fb3f..37c9c91a7d4 100644 --- a/src/EnergyPlus/HybridModel.cc +++ b/src/EnergyPlus/HybridModel.cc @@ -51,7 +51,6 @@ // EnergyPlus Headers #include #include -#include #include #include #include @@ -80,7 +79,6 @@ namespace HybridModel { // Using/Aliasing using namespace DataGlobals; using namespace DataHeatBalance; - using namespace DataPrecisionGlobals; using namespace DataRoomAirModel; using DataGlobals::ScheduleAlwaysOn; using General::CheckCreatedZoneItemName; diff --git a/src/EnergyPlus/IntegratedHeatPump.cc b/src/EnergyPlus/IntegratedHeatPump.cc index 0a790ecf895..65340145ad0 100644 --- a/src/EnergyPlus/IntegratedHeatPump.cc +++ b/src/EnergyPlus/IntegratedHeatPump.cc @@ -54,7 +54,6 @@ #include #include #include -#include #include #include #include @@ -73,7 +72,6 @@ namespace EnergyPlus { namespace IntegratedHeatPump { // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataLoopNode; using namespace DataGlobals; using General::RoundSigDigits; diff --git a/src/EnergyPlus/InternalHeatGains.cc b/src/EnergyPlus/InternalHeatGains.cc index f3213361c1d..d59d521ff07 100644 --- a/src/EnergyPlus/InternalHeatGains.cc +++ b/src/EnergyPlus/InternalHeatGains.cc @@ -124,7 +124,6 @@ namespace InternalHeatGains { // OTHER NOTES: none // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataGlobals; using namespace DataEnvironment; using namespace DataHeatBalance; @@ -1571,7 +1570,7 @@ namespace InternalHeatGains { if (Zone(zonePt).FloorArea > 0.0) { PreDefTableEntry(pdchInLtDens, liteName, Lights(Loop).DesignLevel / Zone(zonePt).FloorArea, 4); } else { - PreDefTableEntry(pdchInLtDens, liteName, constant_zero, 4); + PreDefTableEntry(pdchInLtDens, liteName, DataPrecisionGlobals::constant_zero, 4); } PreDefTableEntry(pdchInLtArea, liteName, Zone(zonePt).FloorArea * mult); PreDefTableEntry(pdchInLtPower, liteName, Lights(Loop).DesignLevel * mult); @@ -1585,7 +1584,7 @@ namespace InternalHeatGains { if (sumArea > 0.0) { PreDefTableEntry(pdchInLtDens, "Interior Lighting Total", sumPower / sumArea, 4); //** line 792 } else { - PreDefTableEntry(pdchInLtDens, "Interior Lighting Total", constant_zero, 4); + PreDefTableEntry(pdchInLtDens, "Interior Lighting Total", DataPrecisionGlobals::constant_zero, 4); } PreDefTableEntry(pdchInLtArea, "Interior Lighting Total", sumArea); PreDefTableEntry(pdchInLtPower, "Interior Lighting Total", sumPower); diff --git a/src/EnergyPlus/MixedAir.cc b/src/EnergyPlus/MixedAir.cc index 484f388d815..e2e4a8ca5e7 100644 --- a/src/EnergyPlus/MixedAir.cc +++ b/src/EnergyPlus/MixedAir.cc @@ -68,7 +68,6 @@ #include #include #include -#include #include #include #include @@ -146,7 +145,6 @@ namespace MixedAir { // USE STATEMENTS: // Use statements for data only modules // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataLoopNode; using namespace DataAirLoop; using DataGlobals::AnyEnergyManagementSystemInModel; diff --git a/src/EnergyPlus/OutAirNodeManager.cc b/src/EnergyPlus/OutAirNodeManager.cc index 4e21ce68bce..b59e2fa125f 100644 --- a/src/EnergyPlus/OutAirNodeManager.cc +++ b/src/EnergyPlus/OutAirNodeManager.cc @@ -55,7 +55,6 @@ #include #include #include -#include #include #include #include @@ -91,7 +90,6 @@ namespace OutAirNodeManager { // USE STATEMENTS: // Use statements for data only modules // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataLoopNode; using namespace DataGlobals; using namespace DataEnvironment; diff --git a/src/EnergyPlus/OutputProcessor.cc b/src/EnergyPlus/OutputProcessor.cc index 229ba6bf5f3..c269a1cb6fa 100644 --- a/src/EnergyPlus/OutputProcessor.cc +++ b/src/EnergyPlus/OutputProcessor.cc @@ -72,7 +72,6 @@ #include #include #include -#include #include #include #include @@ -113,7 +112,6 @@ namespace OutputProcessor { // na // Using/Aliasing - using namespace DataPrecisionGlobals; using DataEnvironment::DayOfMonth; using DataEnvironment::DayOfWeek; using DataEnvironment::DSTIndicator; @@ -4036,8 +4034,6 @@ namespace OutputProcessor { // na // Using/Aliasing - using namespace DataPrecisionGlobals; - // Locals // FUNCTION ARGUMENT DEFINITIONS: @@ -4903,7 +4899,6 @@ namespace OutputProcessor { // na // Using/Aliasing - using namespace DataPrecisionGlobals; using General::strip_trailing_zeros; // Locals @@ -5479,7 +5474,6 @@ void SetupOutputVariable(EnergyPlusData &state, // Pointers (as pointers), pointers (as indices), and lots of other KEWL data stuff. // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace OutputProcessor; using General::TrimSigDigits; @@ -5722,7 +5716,6 @@ void SetupOutputVariable(EnergyPlusData &state, // Pointers (as pointers), pointers (as indices), and lots of other KEWL data stuff. // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace OutputProcessor; using General::TrimSigDigits; @@ -5894,8 +5887,6 @@ void SetupOutputVariable(EnergyPlusData &state, // na // Using/Aliasing - using namespace DataPrecisionGlobals; - // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -5950,7 +5941,6 @@ void UpdateDataandReport(EnergyPlusData &state, OutputProcessor::TimeStepType co // na // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace OutputProcessor; using DataEnvironment::EndMonthFlag; using DataEnvironment::EndYearFlag; @@ -6711,7 +6701,6 @@ void GenOutputVariablesAuditReport() // na // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace OutputProcessor; using DataGlobals::DisplayAdvancedReportVariables; @@ -6814,7 +6803,6 @@ void UpdateMeterReporting(EnergyPlusData &state) // Using/Aliasing using namespace DataIPShortCuts; - using namespace DataPrecisionGlobals; using namespace OutputProcessor; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -7075,7 +7063,6 @@ void SetInitialMeterReportingAndOutputNames(EnergyPlusData &state, // na // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace OutputProcessor; using General::TrimSigDigits; @@ -7437,7 +7424,6 @@ int GetMeterIndex(std::string const &MeterName) // obtain a meter "value". // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace OutputProcessor; using SortAndStringUtilities::SetupAndSort; @@ -7491,7 +7477,6 @@ std::string GetMeterResourceType(int const MeterNumber) // Which Meter Number (f // na // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace OutputProcessor; // Return value @@ -7538,7 +7523,6 @@ Real64 GetCurrentMeterValue(int const MeterNumber) // Which Meter Number (from G // na // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace OutputProcessor; // Return value @@ -7590,7 +7574,6 @@ Real64 GetInstantMeterValue(int const MeterNumber, / // na // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace OutputProcessor; // Return value @@ -7779,7 +7762,6 @@ Real64 GetInternalVariableValue(int const varType, // 1=integer, 2=real, 3=me // na // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace OutputProcessor; using ScheduleManager::GetCurrentScheduleValue; @@ -7863,7 +7845,6 @@ Real64 GetInternalVariableValueExternalInterface(int const varType, // 1=inte // na // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace OutputProcessor; using ScheduleManager::GetCurrentScheduleValue; @@ -7942,7 +7923,6 @@ int GetNumMeteredVariables(std::string const &EP_UNUSED(ComponentType), // Given // na // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace OutputProcessor; // Return value @@ -8005,7 +7985,6 @@ void GetMeteredVariables(std::string const &ComponentType, // for metered variables associated with the given ComponentType/Name. // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataGlobalConstants; using namespace OutputProcessor; @@ -8086,7 +8065,6 @@ void GetMeteredVariables(std::string const &ComponentType, // for metered variables associated with the given ComponentType/Name. // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataGlobalConstants; using namespace OutputProcessor; @@ -8190,7 +8168,6 @@ void GetVariableKeyCountandType(EnergyPlusData &state, // 2 = HVAC time step // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace OutputProcessor; using ScheduleManager::GetScheduleIndex; using ScheduleManager::GetScheduleType; @@ -8365,7 +8342,6 @@ void GetVariableKeys(EnergyPlusData &state, // in the data array for the // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace OutputProcessor; using ScheduleManager::GetScheduleIndex; @@ -8568,7 +8544,6 @@ void InitPollutionMeterReporting(EnergyPlusData &state, std::string const &Repor // Pollutant:Carbon Equivalent // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace OutputProcessor; // SUBROUTINE PARAMETER DEFINITIONS: // Now for the Pollution Meters diff --git a/src/EnergyPlus/OutputReportPredefined.cc b/src/EnergyPlus/OutputReportPredefined.cc index 842c4dd0cf1..23e3de81ea9 100644 --- a/src/EnergyPlus/OutputReportPredefined.cc +++ b/src/EnergyPlus/OutputReportPredefined.cc @@ -49,7 +49,6 @@ #include // EnergyPlus Headers -#include #include namespace EnergyPlus { @@ -68,8 +67,6 @@ namespace OutputReportPredefined { // None. // OTHER NOTES:. // Using/Aliasing - using namespace DataPrecisionGlobals; - // Data // The following section initializes the predefined column heading variables // The variables get their value in AssignPredefined diff --git a/src/EnergyPlus/OutsideEnergySources.cc b/src/EnergyPlus/OutsideEnergySources.cc index de762305b7c..f5a5503bc2c 100644 --- a/src/EnergyPlus/OutsideEnergySources.cc +++ b/src/EnergyPlus/OutsideEnergySources.cc @@ -62,7 +62,6 @@ #include #include #include -#include #include #include #include diff --git a/src/EnergyPlus/PackagedTerminalHeatPump.cc b/src/EnergyPlus/PackagedTerminalHeatPump.cc index f7424331c73..047bc2a2cfa 100644 --- a/src/EnergyPlus/PackagedTerminalHeatPump.cc +++ b/src/EnergyPlus/PackagedTerminalHeatPump.cc @@ -72,7 +72,6 @@ #include #include #include -#include #include #include #include @@ -138,7 +137,6 @@ namespace PackagedTerminalHeatPump { // USE STATEMENTS: // Use statements for data only modules // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataLoopNode; using namespace DataSizing; using DataGlobals::BeginEnvrnFlag; diff --git a/src/EnergyPlus/Photovoltaics.cc b/src/EnergyPlus/Photovoltaics.cc index b655583d481..1d6c9b165e8 100644 --- a/src/EnergyPlus/Photovoltaics.cc +++ b/src/EnergyPlus/Photovoltaics.cc @@ -114,7 +114,6 @@ namespace Photovoltaics { // OTHER NOTES: none // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataPhotovoltaics; using DataGlobals::BeginDayFlag; using DataGlobals::BeginEnvrnFlag; @@ -1442,11 +1441,11 @@ namespace Photovoltaics { // NEWTON --> ISC (STARTVALUE: ISCG1 - BASED ON IL=ISC) ISCG1 = IL; - NEWTON(ISC, FUN, FI, ISC, constant_zero, IO, IL, SeriesResistance, AA, ISCG1, EPS); + NEWTON(ISC, FUN, FI, ISC, DataPrecisionGlobals::constant_zero, IO, IL, SeriesResistance, AA, ISCG1, EPS); // NEWTON --> VOC (STARTVALUE: VOCG1 - BASED ON IM=0.0) VOCG1 = (std::log(IL / IO) + 1.0) * AA; - NEWTON(VOC, FUN, FV, constant_zero, VOC, IO, IL, SeriesResistance, AA, VOCG1, EPS); + NEWTON(VOC, FUN, FV, DataPrecisionGlobals::constant_zero, VOC, IO, IL, SeriesResistance, AA, VOCG1, EPS); // maximum power point tracking diff --git a/src/EnergyPlus/PipeHeatTransfer.cc b/src/EnergyPlus/PipeHeatTransfer.cc index 75a93943769..ac1eff0963a 100644 --- a/src/EnergyPlus/PipeHeatTransfer.cc +++ b/src/EnergyPlus/PipeHeatTransfer.cc @@ -67,7 +67,6 @@ #include #include #include -#include #include #include #include @@ -116,7 +115,6 @@ namespace PipeHeatTransfer { // OTHER NOTES: Equation Numbers listed in buried pipe routines are from Piechowski's thesis // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace GroundTemperatureManager; using DataPlant::TypeOf_PipeExterior; using DataPlant::TypeOf_PipeInterior; diff --git a/src/EnergyPlus/Pipes.cc b/src/EnergyPlus/Pipes.cc index 97528b81c08..641bdaa3995 100644 --- a/src/EnergyPlus/Pipes.cc +++ b/src/EnergyPlus/Pipes.cc @@ -54,7 +54,6 @@ #include #include #include -#include #include #include #include @@ -92,7 +91,6 @@ namespace Pipes { // USE STATEMENTS: // Use statements for data only modules // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataHVACGlobals; using namespace DataLoopNode; using DataPlant::TypeOf_Pipe; diff --git a/src/EnergyPlus/Plant/DataPlant.cc b/src/EnergyPlus/Plant/DataPlant.cc index d3102dfb7ed..9a23dc8a2af 100644 --- a/src/EnergyPlus/Plant/DataPlant.cc +++ b/src/EnergyPlus/Plant/DataPlant.cc @@ -50,7 +50,6 @@ // EnergyPlus Headers #include -#include #include namespace EnergyPlus { @@ -62,7 +61,6 @@ namespace DataPlant { // Condenser Loops. // Using/Aliasing - using namespace DataPrecisionGlobals; using DataGlobals::DoingSizing; using DataLoopNode::NodeID; using DataLoopNode::SensedNodeFlagValue; diff --git a/src/EnergyPlus/PlantCondLoopOperation.cc b/src/EnergyPlus/PlantCondLoopOperation.cc index 9baf76076eb..d6cb0e09271 100644 --- a/src/EnergyPlus/PlantCondLoopOperation.cc +++ b/src/EnergyPlus/PlantCondLoopOperation.cc @@ -65,7 +65,6 @@ #include #include #include -#include #include #include #include @@ -107,7 +106,6 @@ namespace PlantCondLoopOperation { // REFERENCES: // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataPlant; using DataHVACGlobals::NumCondLoops; using DataHVACGlobals::NumPlantLoops; diff --git a/src/EnergyPlus/PlantLoadProfile.cc b/src/EnergyPlus/PlantLoadProfile.cc index 6ae052c9611..7b92b18697b 100644 --- a/src/EnergyPlus/PlantLoadProfile.cc +++ b/src/EnergyPlus/PlantLoadProfile.cc @@ -57,7 +57,6 @@ #include #include #include -#include #include #include #include @@ -89,7 +88,6 @@ namespace PlantLoadProfile { // manager (see NonZoneEquipmentManager.cc). // Using/Aliasing - using namespace DataPrecisionGlobals; using DataGlobals::BeginEnvrnFlag; using DataPlant::PlantLoop; using DataPlant::TypeOf_PlantLoadProfile; diff --git a/src/EnergyPlus/PlantPressureSystem.cc b/src/EnergyPlus/PlantPressureSystem.cc index 0e51546bbe4..41e568ddf8a 100644 --- a/src/EnergyPlus/PlantPressureSystem.cc +++ b/src/EnergyPlus/PlantPressureSystem.cc @@ -61,7 +61,6 @@ #include #include #include -#include #include #include #include @@ -102,7 +101,6 @@ namespace PlantPressureSystem { // -Not currently implemented // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataBranchAirLoopPlant; // Data diff --git a/src/EnergyPlus/PlantUtilities.cc b/src/EnergyPlus/PlantUtilities.cc index a04742e56ce..eaed562f1c2 100644 --- a/src/EnergyPlus/PlantUtilities.cc +++ b/src/EnergyPlus/PlantUtilities.cc @@ -59,7 +59,6 @@ #include #include #include -#include #include #include #include @@ -94,8 +93,6 @@ namespace PlantUtilities { // // // Using/Aliasing - using namespace DataPrecisionGlobals; - namespace { struct CriteriaData { diff --git a/src/EnergyPlus/PlantValves.cc b/src/EnergyPlus/PlantValves.cc index cfe63b367ac..35f0b9e6d86 100644 --- a/src/EnergyPlus/PlantValves.cc +++ b/src/EnergyPlus/PlantValves.cc @@ -58,7 +58,6 @@ #include #include #include -#include #include #include #include @@ -85,7 +84,6 @@ namespace PlantValves { // PURPOSE OF THIS MODULE: // Collect "valve" type models for Plant loops - using namespace DataPrecisionGlobals; using namespace DataLoopNode; using General::TrimSigDigits; diff --git a/src/EnergyPlus/PoweredInductionUnits.cc b/src/EnergyPlus/PoweredInductionUnits.cc index 9574809e53f..ff34c00cc8a 100644 --- a/src/EnergyPlus/PoweredInductionUnits.cc +++ b/src/EnergyPlus/PoweredInductionUnits.cc @@ -109,7 +109,6 @@ namespace PoweredInductionUnits { // to meet the zone load. // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataLoopNode; using DataEnvironment::StdRhoAir; using DataGlobals::BeginDayFlag; @@ -1778,7 +1777,7 @@ namespace PoweredInductionUnits { PowerMet = Node(OutletNode).MassFlowRate * (PsyHFnTdbW(Node(OutletNode).Temp, Node(ZoneNode).HumRat) - PsyHFnTdbW(Node(ZoneNode).Temp, Node(ZoneNode).HumRat)); PIU(PIUNum).HeatingRate = max(0.0, PowerMet); - PIU(PIUNum).SensCoolRate = std::abs(min(constant_zero, PowerMet)); + PIU(PIUNum).SensCoolRate = std::abs(min(DataPrecisionGlobals::constant_zero, PowerMet)); if (Node(OutletNode).MassFlowRate == 0.0) { Node(PriNode).MassFlowRate = 0.0; Node(SecNode).MassFlowRate = 0.0; @@ -2067,7 +2066,7 @@ namespace PoweredInductionUnits { PowerMet = Node(OutletNode).MassFlowRate * (PsyHFnTdbW(Node(OutletNode).Temp, Node(ZoneNode).HumRat) - PsyHFnTdbW(Node(ZoneNode).Temp, Node(ZoneNode).HumRat)); PIU(PIUNum).HeatingRate = max(0.0, PowerMet); - PIU(PIUNum).SensCoolRate = std::abs(min(constant_zero, PowerMet)); + PIU(PIUNum).SensCoolRate = std::abs(min(DataPrecisionGlobals::constant_zero, PowerMet)); if (Node(OutletNode).MassFlowRate == 0.0) { Node(PriNode).MassFlowRate = 0.0; Node(SecNode).MassFlowRate = 0.0; diff --git a/src/EnergyPlus/Psychrometrics.cc b/src/EnergyPlus/Psychrometrics.cc index 683c1424563..bcf5c2c7ccf 100644 --- a/src/EnergyPlus/Psychrometrics.cc +++ b/src/EnergyPlus/Psychrometrics.cc @@ -57,7 +57,6 @@ // EnergyPlus Headers #include #include -#include #include #include #include @@ -101,8 +100,7 @@ namespace Psychrometrics { // more research on hfg calc // Using/Aliasing - using namespace DataPrecisionGlobals; -#ifdef EP_psych_errors + #ifdef EP_psych_errors using namespace DataGlobals; using namespace DataEnvironment; #endif diff --git a/src/EnergyPlus/Pumps.cc b/src/EnergyPlus/Pumps.cc index 5ed61889a62..22c6ba2a950 100644 --- a/src/EnergyPlus/Pumps.cc +++ b/src/EnergyPlus/Pumps.cc @@ -61,7 +61,6 @@ #include #include #include -#include #include #include #include diff --git a/src/EnergyPlus/PurchasedAirManager.cc b/src/EnergyPlus/PurchasedAirManager.cc index 2ff52656872..a744bc3a956 100644 --- a/src/EnergyPlus/PurchasedAirManager.cc +++ b/src/EnergyPlus/PurchasedAirManager.cc @@ -66,7 +66,6 @@ #include #include #include -#include #include #include #include @@ -120,7 +119,6 @@ namespace PurchasedAirManager { // USE STATEMENTS: // Use statements for data only modules // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataGlobals; using namespace DataHVACGlobals; using DataEnvironment::OutBaroPress; diff --git a/src/EnergyPlus/ReturnAirPathManager.cc b/src/EnergyPlus/ReturnAirPathManager.cc index e388e322218..53bf6c08694 100644 --- a/src/EnergyPlus/ReturnAirPathManager.cc +++ b/src/EnergyPlus/ReturnAirPathManager.cc @@ -56,7 +56,6 @@ #include #include #include -#include #include #include #include @@ -90,7 +89,6 @@ namespace ReturnAirPathManager { // USE STATEMENTS: // Use statements for data only modules // Using/Aliasing - using namespace DataPrecisionGlobals; using DataGlobals::BeginDayFlag; using DataGlobals::BeginEnvrnFlag; using DataZoneEquipment::NumReturnAirPaths; diff --git a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc index 00c9ac9e274..36b03ac6d9a 100644 --- a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc +++ b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc @@ -65,7 +65,6 @@ #include #include #include -#include #include #include #include @@ -114,7 +113,6 @@ namespace RoomAirModelAirflowNetwork { // na // Using/Aliasing - using namespace DataPrecisionGlobals; using DataGlobals::NumOfZones; using namespace DataRoomAirModel; using namespace DataHeatBalSurface; diff --git a/src/EnergyPlus/RoomAirModelManager.cc b/src/EnergyPlus/RoomAirModelManager.cc index d7bb95db658..de90dcf4679 100644 --- a/src/EnergyPlus/RoomAirModelManager.cc +++ b/src/EnergyPlus/RoomAirModelManager.cc @@ -67,7 +67,6 @@ #include #include #include -#include #include #include #include @@ -109,7 +108,6 @@ namespace RoomAirModelManager { // na // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataGlobals; using namespace DataRoomAirModel; using General::RoundSigDigits; diff --git a/src/EnergyPlus/RoomAirModelUserTempPattern.cc b/src/EnergyPlus/RoomAirModelUserTempPattern.cc index aabbe89e73a..3a6b2b6ea45 100644 --- a/src/EnergyPlus/RoomAirModelUserTempPattern.cc +++ b/src/EnergyPlus/RoomAirModelUserTempPattern.cc @@ -61,7 +61,6 @@ #include #include #include -#include #include #include #include @@ -104,7 +103,6 @@ namespace RoomAirModelUserTempPattern { // na // Using/Aliasing - using namespace DataPrecisionGlobals; using DataGlobals::DisplayExtraWarnings; using namespace DataRoomAirModel; diff --git a/src/EnergyPlus/RootFinder.cc b/src/EnergyPlus/RootFinder.cc index d59b9f8cb47..b7589006626 100644 --- a/src/EnergyPlus/RootFinder.cc +++ b/src/EnergyPlus/RootFinder.cc @@ -175,7 +175,6 @@ namespace RootFinder { // USE STATEMENTS: // Use statements for data only modules // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataRootFinder; using namespace DataGlobals; using General::TrimSigDigits; @@ -283,7 +282,7 @@ namespace RootFinder { RootFinderData.Controls.ATolY = ATolY; // Reset internal data for root finder with fictive min and max values - ResetRootFinder(RootFinderData, constant_zero, constant_zero); + ResetRootFinder(RootFinderData, DataPrecisionGlobals::constant_zero, DataPrecisionGlobals::constant_zero); } void ResetRootFinder(RootFinderDataType &RootFinderData, // Data used by root finding algorithm diff --git a/src/EnergyPlus/SZVAVModel.cc b/src/EnergyPlus/SZVAVModel.cc index 0e68befda1f..f0c9568d767 100644 --- a/src/EnergyPlus/SZVAVModel.cc +++ b/src/EnergyPlus/SZVAVModel.cc @@ -58,7 +58,6 @@ // EnergyPlus Headers #include #include -#include #include #include #include @@ -75,7 +74,6 @@ namespace SZVAVModel { // Module containing routines for general use // Using/Aliasing - using namespace DataPrecisionGlobals; using DataHVACGlobals::Bisection; using DataHVACGlobals::HVACSystemRootFinding; @@ -386,7 +384,7 @@ namespace SZVAVModel { } } } else { // too much capacity when coil off, could lower air flow rate here to meet load if air flow is above minimum - TempSolveRoot::SolveRoot(state, + TempSolveRoot::SolveRoot(state, 0.001, MaxIter, SolFlag, PartLoadRatio, PackagedTerminalHeatPump::CalcPTUnitAirAndWaterFlowResidual, 0.0, 1.0, Par); if (SolFlag < 0) { MessagePrefix = "Step 2c: "; @@ -409,7 +407,7 @@ namespace SZVAVModel { // set the water flow ratio so water coil gets proper flow if (SZVAVModel.MaxHeatCoilFluidFlow > 0.0) SZVAVModel.HeatCoilWaterFlowRatio = maxCoilFluidFlow / SZVAVModel.MaxHeatCoilFluidFlow; } - PackagedTerminalHeatPump::CalcPTUnit(state, + PackagedTerminalHeatPump::CalcPTUnit(state, SysIndex, FirstHVACIteration, PartLoadRatio, TempSensOutput, ZoneLoad, OnOffAirFlowRatio, SupHeaterLoad, HXUnitOn); coilActive = DataLoopNode::Node(coilAirInletNode).Temp - DataLoopNode::Node(coilAirOutletNode).Temp; if (!coilActive) { // if the coil is schedule off or the plant cannot provide water @@ -443,7 +441,7 @@ namespace SZVAVModel { coilBranchNum, coilCompNum); } - PackagedTerminalHeatPump::CalcPTUnit(state, + PackagedTerminalHeatPump::CalcPTUnit(state, SysIndex, FirstHVACIteration, PartLoadRatio, TempSensOutput, ZoneLoad, OnOffAirFlowRatio, SupHeaterLoad, HXUnitOn); if ((CoolingLoad && ZoneLoad < TempSensOutput) || (HeatingLoad && ZoneLoad > TempSensOutput)) { // otherwise iterate on load @@ -475,7 +473,7 @@ namespace SZVAVModel { if (SolFlag < 0) { if (SolFlag == -1) { // get capacity for warning - PackagedTerminalHeatPump::CalcPTUnit(state, + PackagedTerminalHeatPump::CalcPTUnit(state, SysIndex, FirstHVACIteration, PartLoadRatio, TempSensOutput, ZoneLoad, OnOffAirFlowRatio, SupHeaterLoad, HXUnitOn); if (std::abs(TempSensOutput - ZoneLoad) * SZVAVModel.ControlZoneMassFlowFrac > @@ -1175,7 +1173,7 @@ namespace SZVAVModel { Par[12] = minAirMassFlow; // operating air flow rate, minAirMassFlow indicates low speed air flow rate, maxAirMassFlow indicates full // air flow Par[13] = 0.0; // SA Temp target, 0 means iterate on load and not SA temperature - + TempSolveRoot::SolveRoot(state, 0.001, MaxIter, SolFlag, PartLoadRatio, thisSys.calcUnitarySystemWaterFlowResidual, 0.0, 1.0, Par); if (SolFlag < 0) { MessagePrefix = "Step 1: "; diff --git a/src/EnergyPlus/SetPointManager.cc b/src/EnergyPlus/SetPointManager.cc index 0bacb49b368..80212069447 100644 --- a/src/EnergyPlus/SetPointManager.cc +++ b/src/EnergyPlus/SetPointManager.cc @@ -135,7 +135,6 @@ namespace SetPointManager { // USE STATEMENTS: // Use statements for data only modules // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataLoopNode; using namespace DataAirLoop; using DataEnvironment::OutBaroPress; @@ -4791,9 +4790,9 @@ namespace SetPointManager { Node(MixedAirSetPtMgr(SetPtMgrNum).RefNode).Press = OutBaroPress; Node(MixedAirSetPtMgr(SetPtMgrNum).FanInNode).Press = OutBaroPress; Node(MixedAirSetPtMgr(SetPtMgrNum).FanOutNode).Press = OutBaroPress; - Node(MixedAirSetPtMgr(SetPtMgrNum).RefNode).Enthalpy = PsyHFnTdbW(constant_twenty, OutHumRat); - Node(MixedAirSetPtMgr(SetPtMgrNum).FanInNode).Enthalpy = PsyHFnTdbW(constant_twenty, OutHumRat); - Node(MixedAirSetPtMgr(SetPtMgrNum).FanOutNode).Enthalpy = PsyHFnTdbW(constant_twenty, OutHumRat); + Node(MixedAirSetPtMgr(SetPtMgrNum).RefNode).Enthalpy = PsyHFnTdbW(DataPrecisionGlobals::constant_twenty, OutHumRat); + Node(MixedAirSetPtMgr(SetPtMgrNum).FanInNode).Enthalpy = PsyHFnTdbW(DataPrecisionGlobals::constant_twenty, OutHumRat); + Node(MixedAirSetPtMgr(SetPtMgrNum).FanOutNode).Enthalpy = PsyHFnTdbW(DataPrecisionGlobals::constant_twenty, OutHumRat); for (CtrlNodeIndex = 1; CtrlNodeIndex <= MixedAirSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { NodeNum = MixedAirSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number if (MixedAirSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { @@ -4824,10 +4823,10 @@ namespace SetPointManager { Node(OAPretreatSetPtMgr(SetPtMgrNum).MixedOutNode).Press = OutBaroPress; Node(OAPretreatSetPtMgr(SetPtMgrNum).OAInNode).Press = OutBaroPress; Node(OAPretreatSetPtMgr(SetPtMgrNum).ReturnInNode).Press = OutBaroPress; - Node(OAPretreatSetPtMgr(SetPtMgrNum).RefNode).Enthalpy = PsyHFnTdbW(constant_twenty, OutHumRat); - Node(OAPretreatSetPtMgr(SetPtMgrNum).MixedOutNode).Enthalpy = PsyHFnTdbW(constant_twenty, OutHumRat); - Node(OAPretreatSetPtMgr(SetPtMgrNum).OAInNode).Enthalpy = PsyHFnTdbW(constant_twenty, OutHumRat); - Node(OAPretreatSetPtMgr(SetPtMgrNum).ReturnInNode).Enthalpy = PsyHFnTdbW(constant_twenty, OutHumRat); + Node(OAPretreatSetPtMgr(SetPtMgrNum).RefNode).Enthalpy = PsyHFnTdbW(DataPrecisionGlobals::constant_twenty, OutHumRat); + Node(OAPretreatSetPtMgr(SetPtMgrNum).MixedOutNode).Enthalpy = PsyHFnTdbW(DataPrecisionGlobals::constant_twenty, OutHumRat); + Node(OAPretreatSetPtMgr(SetPtMgrNum).OAInNode).Enthalpy = PsyHFnTdbW(DataPrecisionGlobals::constant_twenty, OutHumRat); + Node(OAPretreatSetPtMgr(SetPtMgrNum).ReturnInNode).Enthalpy = PsyHFnTdbW(DataPrecisionGlobals::constant_twenty, OutHumRat); for (CtrlNodeIndex = 1; CtrlNodeIndex <= OAPretreatSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { NodeNum = OAPretreatSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number if (OAPretreatSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { diff --git a/src/EnergyPlus/SimAirServingZones.cc b/src/EnergyPlus/SimAirServingZones.cc index 2102f49dbb1..837ed5dea7b 100644 --- a/src/EnergyPlus/SimAirServingZones.cc +++ b/src/EnergyPlus/SimAirServingZones.cc @@ -144,7 +144,6 @@ namespace SimAirServingZones { // USE STATEMENTS // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataLoopNode; using namespace DataAirLoop; using namespace DataGlobals; @@ -3630,7 +3629,7 @@ namespace SimAirServingZones { // CASE(DXCoil_CoolingHXAsst) ! 'CoilSystem:Cooling:DX:HeatExchangerAssisted' // CALL SimHXAssistedCoolingCoil(CompName,FirstHVACIteration,CoilOn,0.0,CompIndex,ContFanCycCoil) } else if (SELECT_CASE_var == WaterCoil_CoolingHXAsst) { // 'CoilSystem:Cooling:Water:HeatExchangerAssisted' - SimHXAssistedCoolingCoil(state, CompName, FirstHVACIteration, CoilOn, constant_zero, CompIndex, ContFanCycCoil, _, _, _, QActual); + SimHXAssistedCoolingCoil(state, CompName, FirstHVACIteration, CoilOn, DataPrecisionGlobals::constant_zero, CompIndex, ContFanCycCoil, _, _, _, QActual); if (QActual > 0.0) CoolingActive = true; // determine if coil is ON } else if (SELECT_CASE_var == WaterCoil_SimpleHeat) { // 'Coil:Heating:Water' @@ -3638,7 +3637,7 @@ namespace SimAirServingZones { if (QActual > 0.0) HeatingActive = true; // determine if coil is ON } else if (SELECT_CASE_var == SteamCoil_AirHeat) { // 'Coil:Heating:Steam' - SimulateSteamCoilComponents(state, CompName, FirstHVACIteration, CompIndex, constant_zero, QActual); + SimulateSteamCoilComponents(state, CompName, FirstHVACIteration, CompIndex, DataPrecisionGlobals::constant_zero, QActual); if (QActual > 0.0) HeatingActive = true; // determine if coil is ON } else if (SELECT_CASE_var == WaterCoil_DetailedCool) { // 'Coil:Cooling:Water:DetailedGeometry' @@ -5635,7 +5634,7 @@ namespace SimAirServingZones { SysSizing(CurOverallSimDay, AirLoopNum).SysCoolOutHumRatSeq(TimeStepInDay) = OutHumRat; // From the mixed air temp, system design supply air temp, and the mass flow rate // calculate the system sensible cooling capacity - SysSensCoolCap = PsyCpAirFnW(constant_zero) * SysSizing(CurOverallSimDay, AirLoopNum).CoolFlowSeq(TimeStepInDay) * + SysSensCoolCap = PsyCpAirFnW(DataPrecisionGlobals::constant_zero) * SysSizing(CurOverallSimDay, AirLoopNum).CoolFlowSeq(TimeStepInDay) * (SysCoolMixTemp - SysSizing(CurOverallSimDay, AirLoopNum).CoolSupTemp); SysSensCoolCap = max(0.0, SysSensCoolCap); // calculate the system total cooling capacity @@ -5757,7 +5756,7 @@ namespace SimAirServingZones { SysSizing(CurOverallSimDay, AirLoopNum).SysHeatOutTempSeq(TimeStepInDay) = OutDryBulbTemp; SysSizing(CurOverallSimDay, AirLoopNum).SysHeatOutHumRatSeq(TimeStepInDay) = OutHumRat; // From the mixed air temp, heating supply air temp, and mass flow rate calculate the system heating capacity - SysHeatCap = PsyCpAirFnW(constant_zero) * SysSizing(CurOverallSimDay, AirLoopNum).HeatFlowSeq(TimeStepInDay) * + SysHeatCap = PsyCpAirFnW(DataPrecisionGlobals::constant_zero) * SysSizing(CurOverallSimDay, AirLoopNum).HeatFlowSeq(TimeStepInDay) * (SysSizing(CurOverallSimDay, AirLoopNum).HeatSupTemp - SysHeatMixTemp); SysHeatCap = max(0.0, SysHeatCap); // save the system heating capacity for the time step @@ -5847,7 +5846,7 @@ namespace SimAirServingZones { SysSizing(CurOverallSimDay, AirLoopNum).SysHeatOutTempSeq(TimeStepInDay) = OutDryBulbTemp; SysSizing(CurOverallSimDay, AirLoopNum).SysHeatOutHumRatSeq(TimeStepInDay) = OutHumRat; // From the mixed air temp, heating supply air temp, and mass flow rate calculate the system heating capacity - SysHeatCap = PsyCpAirFnW(constant_zero) * SysSizing(CurOverallSimDay, AirLoopNum).HeatFlowSeq(TimeStepInDay) * + SysHeatCap = PsyCpAirFnW(DataPrecisionGlobals::constant_zero) * SysSizing(CurOverallSimDay, AirLoopNum).HeatFlowSeq(TimeStepInDay) * (SysSizing(CurOverallSimDay, AirLoopNum).HeatSupTemp - SysHeatMixTemp); SysHeatCap = max(0.0, SysHeatCap); // save the system heating capacity for the time step @@ -6663,7 +6662,7 @@ namespace SimAirServingZones { } SysCoolMixTemp = OutAirTemp * OutAirFrac + SysCoolRetTemp * (1.0 - OutAirFrac); SysCoolMixHumRat = OutAirHumRat * OutAirFrac + SysCoolRetHumRat * (1.0 - OutAirFrac); - SysSensCoolCap = PsyCpAirFnW(constant_zero) * CalcSysSizing(AirLoopNum).NonCoinCoolMassFlow * + SysSensCoolCap = PsyCpAirFnW(DataPrecisionGlobals::constant_zero) * CalcSysSizing(AirLoopNum).NonCoinCoolMassFlow * (SysCoolMixTemp - CalcSysSizing(AirLoopNum).CoolSupTemp); SysSensCoolCap = max(0.0, SysSensCoolCap); SysTotCoolCap = CalcSysSizing(AirLoopNum).NonCoinCoolMassFlow * @@ -6724,7 +6723,7 @@ namespace SimAirServingZones { } SysHeatMixTemp = OutAirTemp * OutAirFrac + SysHeatRetTemp * (1.0 - OutAirFrac); SysHeatMixHumRat = OutAirHumRat * OutAirFrac + SysHeatRetHumRat * (1.0 - OutAirFrac); - SysHeatCap = PsyCpAirFnW(constant_zero) * CalcSysSizing(AirLoopNum).NonCoinHeatMassFlow * + SysHeatCap = PsyCpAirFnW(DataPrecisionGlobals::constant_zero) * CalcSysSizing(AirLoopNum).NonCoinHeatMassFlow * (CalcSysSizing(AirLoopNum).HeatSupTemp - SysHeatMixTemp); SysHeatCap = max(0.0, SysHeatCap); } @@ -6768,7 +6767,7 @@ namespace SimAirServingZones { } SysHeatMixTemp = OutAirTemp * OutAirFrac + SysHeatRetTemp * (1.0 - OutAirFrac); SysHeatMixHumRat = OutAirHumRat * OutAirFrac + SysHeatRetHumRat * (1.0 - OutAirFrac); - SysHeatCap = PsyCpAirFnW(constant_zero) * CalcSysSizing(AirLoopNum).NonCoinHeatMassFlow * + SysHeatCap = PsyCpAirFnW(DataPrecisionGlobals::constant_zero) * CalcSysSizing(AirLoopNum).NonCoinHeatMassFlow * (CalcSysSizing(AirLoopNum).HeatSupTemp - SysHeatMixTemp); SysHeatCap = max(0.0, SysHeatCap); } @@ -6943,7 +6942,7 @@ namespace SimAirServingZones { FinalSysSizing(AirLoopNum).SysCoolRetTempSeq(TimeStepIndex) * (1.0 - OutAirFrac); SysCoolMixHumRat = FinalSysSizing(AirLoopNum).SysCoolOutHumRatSeq(TimeStepIndex) * OutAirFrac + FinalSysSizing(AirLoopNum).SysCoolRetHumRatSeq(TimeStepIndex) * (1.0 - OutAirFrac); - SysSensCoolCap = PsyCpAirFnW(constant_zero) * FinalSysSizing(AirLoopNum).CoolFlowSeq(TimeStepIndex) * + SysSensCoolCap = PsyCpAirFnW(DataPrecisionGlobals::constant_zero) * FinalSysSizing(AirLoopNum).CoolFlowSeq(TimeStepIndex) * (SysCoolMixTemp - FinalSysSizing(AirLoopNum).CoolSupTemp); SysSensCoolCap = max(0.0, SysSensCoolCap); SysTotCoolCap = FinalSysSizing(AirLoopNum).CoolFlowSeq(TimeStepIndex) * @@ -6966,7 +6965,7 @@ namespace SimAirServingZones { FinalSysSizing(AirLoopNum).MixHumRatAtCoolPeak = FinalSysSizing(AirLoopNum).OutHumRatAtCoolPeak * OutAirFrac + FinalSysSizing(AirLoopNum).RetHumRatAtCoolPeak * (1.0 - OutAirFrac); FinalSysSizing(AirLoopNum).SensCoolCap = - PsyCpAirFnW(constant_zero) * RhoAir * FinalSysSizing(AirLoopNum).DesCoolVolFlow * + PsyCpAirFnW(DataPrecisionGlobals::constant_zero) * RhoAir * FinalSysSizing(AirLoopNum).DesCoolVolFlow * (FinalSysSizing(AirLoopNum).MixTempAtCoolPeak - FinalSysSizing(AirLoopNum).CoolSupTemp); FinalSysSizing(AirLoopNum).SensCoolCap = max(0.0, FinalSysSizing(AirLoopNum).SensCoolCap); FinalSysSizing(AirLoopNum).TotCoolCap = @@ -7024,7 +7023,7 @@ namespace SimAirServingZones { FinalSysSizing(AirLoopNum).SysHeatRetTempSeq(TimeStepIndex) * (1.0 - OutAirFrac); SysHeatMixHumRat = FinalSysSizing(AirLoopNum).SysHeatOutHumRatSeq(TimeStepIndex) * OutAirFrac + FinalSysSizing(AirLoopNum).SysHeatRetHumRatSeq(TimeStepIndex) * (1.0 - OutAirFrac); - SysHeatCap = PsyCpAirFnW(constant_zero) * FinalSysSizing(AirLoopNum).HeatFlowSeq(TimeStepIndex) * + SysHeatCap = PsyCpAirFnW(DataPrecisionGlobals::constant_zero) * FinalSysSizing(AirLoopNum).HeatFlowSeq(TimeStepIndex) * (FinalSysSizing(AirLoopNum).HeatSupTemp - SysHeatMixTemp); SysHeatCap = max(0.0, SysHeatCap); FinalSysSizing(AirLoopNum).HeatCapSeq(TimeStepIndex) = SysHeatCap; @@ -7041,7 +7040,7 @@ namespace SimAirServingZones { FinalSysSizing(AirLoopNum).HeatOutTemp * OutAirFrac + FinalSysSizing(AirLoopNum).HeatRetTemp * (1.0 - OutAirFrac); FinalSysSizing(AirLoopNum).HeatMixHumRat = FinalSysSizing(AirLoopNum).HeatOutHumRat * OutAirFrac + FinalSysSizing(AirLoopNum).HeatRetHumRat * (1.0 - OutAirFrac); - FinalSysSizing(AirLoopNum).HeatCap = PsyCpAirFnW(constant_zero) * RhoAir * FinalSysSizing(AirLoopNum).DesHeatVolFlow * + FinalSysSizing(AirLoopNum).HeatCap = PsyCpAirFnW(DataPrecisionGlobals::constant_zero) * RhoAir * FinalSysSizing(AirLoopNum).DesHeatVolFlow * (FinalSysSizing(AirLoopNum).HeatSupTemp - FinalSysSizing(AirLoopNum).HeatMixTemp); FinalSysSizing(AirLoopNum).HeatCap = max(0.0, FinalSysSizing(AirLoopNum).HeatCap); } @@ -7290,7 +7289,6 @@ namespace SimAirServingZones { // Modifies the design sizing flow rates for system scalable sizing method // Using/Aliasing - using namespace DataPrecisionGlobals; using DataEnvironment::StdRhoAir; using DataSizing::CalcSysSizing; using DataSizing::FinalSysSizing; @@ -7427,7 +7425,7 @@ namespace SimAirServingZones { OutAirFrac * FinalSysSizing(AirLoopNum).HeatOutTemp + (1.0 - OutAirFrac) * FinalSysSizing(AirLoopNum).HeatRetTemp; } CoilOutTemp = FinalSysSizing(AirLoopNum).HeatSupTemp; - CpAirStd = PsyCpAirFnW(constant_zero); + CpAirStd = PsyCpAirFnW(DataPrecisionGlobals::constant_zero); AutosizedCapacity = StdRhoAir * FinalSysSizing(AirLoopNum).DesHeatVolFlow * CpAirStd * (CoilOutTemp - CoilInTemp); TempSize = FinalSysSizing(AirLoopNum).FlowPerHeatingCapacity * AutosizedCapacity * FractionOfAutosize; } else if (FinalSysSizing(AirLoopNum).HeatingCapMethod == HeatingDesignCapacity) { @@ -7450,7 +7448,7 @@ namespace SimAirServingZones { OutAirFrac * FinalSysSizing(AirLoopNum).HeatOutTemp + (1.0 - OutAirFrac) * FinalSysSizing(AirLoopNum).HeatRetTemp; } CoilOutTemp = FinalSysSizing(AirLoopNum).HeatSupTemp; - CpAirStd = PsyCpAirFnW(constant_zero); + CpAirStd = PsyCpAirFnW(DataPrecisionGlobals::constant_zero); AutosizedCapacity = StdRhoAir * FinalSysSizing(AirLoopNum).DesHeatVolFlow * CpAirStd * (CoilOutTemp - CoilInTemp); TempSize = FinalSysSizing(AirLoopNum).FlowPerHeatingCapacity * AutosizedCapacity * FractionOfAutosize; } else { diff --git a/src/EnergyPlus/SimulationManager.cc b/src/EnergyPlus/SimulationManager.cc index 6c216b896b2..12ab1babc23 100644 --- a/src/EnergyPlus/SimulationManager.cc +++ b/src/EnergyPlus/SimulationManager.cc @@ -84,7 +84,6 @@ extern "C" { #include #include #include -#include #include #include #include @@ -172,7 +171,6 @@ namespace SimulationManager { // and internal Evolutionary Engineering documentation. // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataGlobals; using namespace DataSizing; using namespace DataReportingFlags; @@ -3143,7 +3141,6 @@ void Resimulate(EnergyPlusData &state, // ReportHeatBalance // Using/Aliasing - using namespace DataPrecisionGlobals; using DataHeatBalFanSys::iGetZoneSetPoints; using DataHeatBalFanSys::iPredictStep; using DemandManager::DemandManagerExtIterations; diff --git a/src/EnergyPlus/SingleDuct.cc b/src/EnergyPlus/SingleDuct.cc index e05a5045856..86c977d2896 100644 --- a/src/EnergyPlus/SingleDuct.cc +++ b/src/EnergyPlus/SingleDuct.cc @@ -67,7 +67,6 @@ #include #include #include -#include #include #include #include @@ -110,7 +109,6 @@ namespace SingleDuct { // simulate single duct systems as a single driver or inter-connecting controllers. // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataLoopNode; using BranchNodeConnections::SetUpCompSets; using BranchNodeConnections::TestCompSet; diff --git a/src/EnergyPlus/SteamBaseboardRadiator.cc b/src/EnergyPlus/SteamBaseboardRadiator.cc index b74f6778e16..2bdc2840951 100644 --- a/src/EnergyPlus/SteamBaseboardRadiator.cc +++ b/src/EnergyPlus/SteamBaseboardRadiator.cc @@ -63,7 +63,6 @@ #include #include #include -#include #include #include #include @@ -113,7 +112,6 @@ namespace SteamBaseboardRadiator { // USE STATEMENTS: // Use statements for data only modules // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataGlobals; using DataHVACGlobals::SmallLoad; using DataHVACGlobals::SysTimeElapsed; diff --git a/src/EnergyPlus/SteamCoils.cc b/src/EnergyPlus/SteamCoils.cc index 9f01c5654d9..8ad7549a0c8 100644 --- a/src/EnergyPlus/SteamCoils.cc +++ b/src/EnergyPlus/SteamCoils.cc @@ -61,7 +61,6 @@ #include #include #include -#include #include #include #include @@ -109,7 +108,6 @@ namespace SteamCoils { // USE STATEMENTS: // Use statements for data only modules // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataLoopNode; using namespace DataGlobals; using namespace DataHVACGlobals; diff --git a/src/EnergyPlus/SurfaceGroundHeatExchanger.cc b/src/EnergyPlus/SurfaceGroundHeatExchanger.cc index 885e644017b..190aa40cdfe 100644 --- a/src/EnergyPlus/SurfaceGroundHeatExchanger.cc +++ b/src/EnergyPlus/SurfaceGroundHeatExchanger.cc @@ -119,7 +119,6 @@ namespace SurfaceGroundHeatExchanger { // USE STATEMENTS: // Use statements for data only modules // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataLoopNode; // Use statements for access to subroutines in other modules @@ -519,7 +518,7 @@ namespace SurfaceGroundHeatExchanger { if (errFlag) { ShowFatalError("InitSurfaceGroundHeatExchanger: Program terminated due to previous condition(s)."); } - rho = GetDensityGlycol(state, PlantLoop(this->LoopNum).FluidName, constant_zero, PlantLoop(this->LoopNum).FluidIndex, RoutineName); + rho = GetDensityGlycol(state, PlantLoop(this->LoopNum).FluidName, DataPrecisionGlobals::constant_zero, PlantLoop(this->LoopNum).FluidIndex, RoutineName); this->DesignMassFlowRate = DataGlobalConstants::Pi() / 4.0 * pow_2(this->TubeDiameter) * DesignVelocity * rho * this->TubeCircuits; InitComponentNodes(0.0, this->DesignMassFlowRate, @@ -1228,7 +1227,7 @@ namespace SurfaceGroundHeatExchanger { NTU = DataGlobalConstants::Pi() * Kactual * NuD * PipeLength / (WaterMassFlow * CpWater); // Calculate Epsilon*MassFlowRate*Cp - if (-NTU >= EXP_LowerLimit) { + if (-NTU >= DataPrecisionGlobals::EXP_LowerLimit) { CalcHXEffectTerm = (1.0 - std::exp(-NTU)) * WaterMassFlow * CpWater; } else { CalcHXEffectTerm = 1.0 * WaterMassFlow * CpWater; diff --git a/src/EnergyPlus/TARCOGCommon.cc b/src/EnergyPlus/TARCOGCommon.cc index 2f5e6ee305a..4b6c690d5a7 100644 --- a/src/EnergyPlus/TARCOGCommon.cc +++ b/src/EnergyPlus/TARCOGCommon.cc @@ -51,7 +51,6 @@ // EnergyPlus Headers #include -#include #include #include @@ -82,8 +81,6 @@ namespace TARCOGCommon { // USE STATEMENTS: // Using/Aliasing - using namespace DataPrecisionGlobals; - // Functions bool IsShadingLayer(int const layertype) diff --git a/src/EnergyPlus/TARCOGGassesParams.cc b/src/EnergyPlus/TARCOGGassesParams.cc index d9aa4ae495a..f4e556ff203 100644 --- a/src/EnergyPlus/TARCOGGassesParams.cc +++ b/src/EnergyPlus/TARCOGGassesParams.cc @@ -46,7 +46,6 @@ // POSSIBILITY OF SUCH DAMAGE. // EnergyPlus Headers -#include #include namespace EnergyPlus { @@ -74,8 +73,6 @@ namespace TARCOGGassesParams { // USE STATEMENTS: // Using/Aliasing - using namespace DataPrecisionGlobals; - // Data // Max number of gasses int const maxgas(10); diff --git a/src/EnergyPlus/TARCOGOutput.cc b/src/EnergyPlus/TARCOGOutput.cc index 9df853d260e..2a36b4f863f 100644 --- a/src/EnergyPlus/TARCOGOutput.cc +++ b/src/EnergyPlus/TARCOGOutput.cc @@ -51,7 +51,6 @@ // EnergyPlus Headers #include -#include #include #include #include @@ -85,7 +84,6 @@ namespace TARCOGOutput { // USE STATEMENTS: // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace TARCOGCommon; using namespace TARCOGGassesParams; using namespace TARCOGParams; diff --git a/src/EnergyPlus/TARCOGParams.cc b/src/EnergyPlus/TARCOGParams.cc index 00b999b1679..988df425023 100644 --- a/src/EnergyPlus/TARCOGParams.cc +++ b/src/EnergyPlus/TARCOGParams.cc @@ -46,7 +46,6 @@ // POSSIBILITY OF SUCH DAMAGE. // EnergyPlus Headers -#include #include namespace EnergyPlus { @@ -78,8 +77,6 @@ namespace TARCOGParams { // USE STATEMENTS: // Using/Aliasing - using namespace DataPrecisionGlobals; - // Data // REAL(r64), parameter :: StefanBoltzmannConst = 5.6697d-8 ! Stefan-Boltzman constant (5.6697e-8 [W/m^2K^4]) // REAL(r64), parameter :: GravityConstant = 9.807d0 diff --git a/src/EnergyPlus/ThermalComfort.cc b/src/EnergyPlus/ThermalComfort.cc index 7e12761303d..4fd099aa6c9 100644 --- a/src/EnergyPlus/ThermalComfort.cc +++ b/src/EnergyPlus/ThermalComfort.cc @@ -101,7 +101,6 @@ namespace ThermalComfort { // the people statements and perform the requested thermal comfort evaluations // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataGlobals; using DataEnvironment::OutBaroPress; using DataEnvironment::OutDryBulbTemp; @@ -917,7 +916,7 @@ namespace ThermalComfort { // Calculate the Fanger PPD (Predicted Percentage of Dissatisfied), as a % Real64 expTest1 = -0.03353 * pow_4(PMV) - 0.2179 * pow_2(PMV); - if (expTest1 > EXP_LowerLimit) { + if (expTest1 > DataPrecisionGlobals::EXP_LowerLimit) { PPD = 100.0 - 95.0 * std::exp(expTest1); } else { PPD = 100.0; diff --git a/src/EnergyPlus/ThermalISO15099Calc.cc b/src/EnergyPlus/ThermalISO15099Calc.cc index 56bb2f2e2a2..922abb1ba65 100644 --- a/src/EnergyPlus/ThermalISO15099Calc.cc +++ b/src/EnergyPlus/ThermalISO15099Calc.cc @@ -54,7 +54,6 @@ // EnergyPlus Headers #include -#include #include #include #include @@ -102,7 +101,6 @@ namespace ThermalISO15099Calc { // USE STATEMENTS: // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace TARCOGGassesParams; using namespace TARCOGParams; using namespace TARCOGArgs; diff --git a/src/EnergyPlus/UFADManager.cc b/src/EnergyPlus/UFADManager.cc index 63ac23070af..9227ddc1b68 100644 --- a/src/EnergyPlus/UFADManager.cc +++ b/src/EnergyPlus/UFADManager.cc @@ -63,7 +63,6 @@ #include #include #include -#include #include #include #include @@ -105,7 +104,6 @@ namespace UFADManager { // na // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataGlobals; using namespace DataLoopNode; using namespace DataEnvironment; diff --git a/src/EnergyPlus/UnitHeater.cc b/src/EnergyPlus/UnitHeater.cc index add7a66e7f8..c16e8938519 100644 --- a/src/EnergyPlus/UnitHeater.cc +++ b/src/EnergyPlus/UnitHeater.cc @@ -61,7 +61,6 @@ #include #include #include -#include #include #include #include @@ -116,7 +115,6 @@ namespace UnitHeater { // module (FanCoilUnits.cc) // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataLoopNode; using DataGlobals::BeginDayFlag; using DataGlobals::BeginEnvrnFlag; diff --git a/src/EnergyPlus/UnitVentilator.cc b/src/EnergyPlus/UnitVentilator.cc index 432488d28d5..36b7722af46 100644 --- a/src/EnergyPlus/UnitVentilator.cc +++ b/src/EnergyPlus/UnitVentilator.cc @@ -66,7 +66,6 @@ #include #include #include -#include #include #include #include @@ -122,7 +121,6 @@ namespace UnitVentilator { // Fred Buhl's fan coil module (FanCoilUnits.cc) // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataLoopNode; using DataGlobals::BeginDayFlag; using DataGlobals::BeginEnvrnFlag; diff --git a/src/EnergyPlus/WaterCoils.cc b/src/EnergyPlus/WaterCoils.cc index cd2ce63574c..8f77fa0c66d 100644 --- a/src/EnergyPlus/WaterCoils.cc +++ b/src/EnergyPlus/WaterCoils.cc @@ -82,7 +82,6 @@ #include #include #include -#include #include #include #include @@ -134,7 +133,6 @@ namespace WaterCoils { // USE STATEMENTS: // Use statements for data only modules // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataLoopNode; using namespace DataGlobals; using DataEnvironment::OutBaroPress; diff --git a/src/EnergyPlus/WaterToAirHeatPumpSimple.cc b/src/EnergyPlus/WaterToAirHeatPumpSimple.cc index 032fc47f04d..82180b83ca4 100644 --- a/src/EnergyPlus/WaterToAirHeatPumpSimple.cc +++ b/src/EnergyPlus/WaterToAirHeatPumpSimple.cc @@ -115,7 +115,6 @@ namespace WaterToAirHeatPumpSimple { // Use statements for data only modules // Use statements for access to subroutines in other modules // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataLoopNode; using namespace DataGlobals; using namespace DataSizing; @@ -235,7 +234,7 @@ namespace WaterToAirHeatPumpSimple { HPTimeConstant, FanDelayTime, SensLoad, - constant_zero, + DataPrecisionGlobals::constant_zero, CyclingScheme, OnOffAirFlowRatio, FirstHVACIteration); diff --git a/src/EnergyPlus/WindTurbine.cc b/src/EnergyPlus/WindTurbine.cc index 23b8557f200..66ca35f299a 100644 --- a/src/EnergyPlus/WindTurbine.cc +++ b/src/EnergyPlus/WindTurbine.cc @@ -92,8 +92,6 @@ namespace WindTurbine { // Mazharul Islam, David S.K. Ting, and Amir Fartaj. 2008. Aerodynamic Models for Darrieus-type sSraight-bladed // Vertical Axis Wind Turbines. Renewable & Sustainable Energy Reviews, Volume 12, pp.1087-1109 - // using namespace DataPrecisionGlobals; - // using namespace DataGenerators; using DataGlobals::BeginEnvrnFlag; using DataGlobals::ScheduleAlwaysOn; static std::string const BlankString; diff --git a/src/EnergyPlus/WindowAC.cc b/src/EnergyPlus/WindowAC.cc index c1ee6478ed6..5187bdcb1af 100644 --- a/src/EnergyPlus/WindowAC.cc +++ b/src/EnergyPlus/WindowAC.cc @@ -65,7 +65,6 @@ #include #include #include -#include #include #include #include @@ -110,7 +109,6 @@ namespace WindowAC { // modeled - instead cycling inefficiencies must be included in the efficiency // curves of the DX module. - using namespace DataPrecisionGlobals; using namespace DataLoopNode; using namespace DataSizing; using DataEnvironment::OutBaroPress; diff --git a/src/EnergyPlus/ZoneDehumidifier.cc b/src/EnergyPlus/ZoneDehumidifier.cc index d00eaa50713..a81b3e45c82 100644 --- a/src/EnergyPlus/ZoneDehumidifier.cc +++ b/src/EnergyPlus/ZoneDehumidifier.cc @@ -58,7 +58,6 @@ #include #include #include -#include #include #include #include @@ -109,7 +108,6 @@ namespace ZoneDehumidifier { // http://www.thermastor.com/HI-E-DRY-195/HI-E-DRY-195-Spec.pdf // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataLoopNode; using DataEnvironment::OutBaroPress; using DataEnvironment::StdBaroPress; diff --git a/src/EnergyPlus/ZoneTempPredictorCorrector.cc b/src/EnergyPlus/ZoneTempPredictorCorrector.cc index d8d29e6ad32..7e7af9d0c5e 100644 --- a/src/EnergyPlus/ZoneTempPredictorCorrector.cc +++ b/src/EnergyPlus/ZoneTempPredictorCorrector.cc @@ -56,8 +56,6 @@ // EnergyPlus Headers #include -#include - #include #include #include @@ -71,7 +69,6 @@ #include #include #include -#include #include #include #include @@ -124,7 +121,6 @@ namespace ZoneTempPredictorCorrector { // "correct" step determines zone air temp with available HVAC // Using/Aliasing - using namespace DataPrecisionGlobals; using namespace DataGlobals; using namespace DataHVACGlobals; using namespace DataHeatBalance; @@ -4756,7 +4752,7 @@ namespace ZoneTempPredictorCorrector { // FLOW: // Initializations - ZoneTempChange = constant_zero; + ZoneTempChange = DataPrecisionGlobals::constant_zero; // Update zone temperatures for (ZoneNum = 1; ZoneNum <= NumOfZones; ++ZoneNum) { diff --git a/tst/EnergyPlus/unit/EvaporativeCoolers.unit.cc b/tst/EnergyPlus/unit/EvaporativeCoolers.unit.cc index a56d914fd9d..1611fcc9a25 100644 --- a/tst/EnergyPlus/unit/EvaporativeCoolers.unit.cc +++ b/tst/EnergyPlus/unit/EvaporativeCoolers.unit.cc @@ -492,7 +492,7 @@ TEST_F(EnergyPlusFixture, EvaporativeCoolers_SizeEvapCooler) DataSizing::FinalSysSizing(1).DesOutAirVolFlow = 0.4; // set up the structure to size the flow rates for an RDDSpecial - thisEvapCooler.EvapCoolerType = EvapCoolerType::InDirectRDDSpecial; + thisEvapCooler.evapCoolerType = EvapCoolerType::IndirectRDDSpecial; thisEvapCooler.DesVolFlowRate = DataSizing::AutoSize; thisEvapCooler.PadArea = 0.0; thisEvapCooler.PadDepth = 0.0; @@ -507,7 +507,7 @@ TEST_F(EnergyPlusFixture, EvaporativeCoolers_SizeEvapCooler) EXPECT_NEAR(1.0, thisEvapCooler.DesVolFlowRate, 0.0001); // now let's try to size some of the pad properties - thisEvapCooler.EvapCoolerType = EvapCoolerType::DirectCELDEKPAD; + thisEvapCooler.evapCoolerType = EvapCoolerType::DirectCELDEKPAD; thisEvapCooler.DesVolFlowRate = 1.0; thisEvapCooler.PadArea = DataSizing::AutoSize; thisEvapCooler.PadDepth = DataSizing::AutoSize; @@ -524,7 +524,7 @@ TEST_F(EnergyPlusFixture, EvaporativeCoolers_SizeEvapCooler) DataAirSystems::PrimaryAirSystem(1).Branch(1).Comp(1).Name = "NOT-MyEvapCooler"; // set up the structure to size the flow rates for an indirect celdekpad - thisEvapCooler.EvapCoolerType = EvapCoolerType::InDirectCELDEKPAD; + thisEvapCooler.evapCoolerType = EvapCoolerType::IndirectCELDEKPAD; thisEvapCooler.DesVolFlowRate = DataSizing::AutoSize; thisEvapCooler.PadArea = 0.0; thisEvapCooler.PadDepth = 0.0; @@ -729,7 +729,7 @@ TEST_F(EnergyPlusFixture, DirectEvapCoolerResearchSpecialCalcTest) state.dataCurveManager->PerfCurve(CurveNum).Var1Max = 1.0; // set up the flow rates for a direct RDDSpecial - thisEvapCooler.EvapCoolerType = EvapCoolerType::DirectResearchSpecial; + thisEvapCooler.evapCoolerType = EvapCoolerType::DirectResearchSpecial; thisEvapCooler.EvapCoolerName = "MyDirectEvapCoolerRS"; thisEvapCooler.SchedPtr = DataGlobals::ScheduleAlwaysOn; thisEvapCooler.PumpPowerModifierCurveIndex = CurveNum; From 1cb26ea625aed3854ca2de582383f2babf952a08 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Mon, 12 Oct 2020 09:59:10 -0600 Subject: [PATCH 12/15] remove unused resource strings --- src/EnergyPlus/DataGlobalConstants.cc | 95 --------------------------- src/EnergyPlus/DataGlobalConstants.hh | 52 +-------------- src/EnergyPlus/SystemReports.cc | 5 -- 3 files changed, 2 insertions(+), 150 deletions(-) diff --git a/src/EnergyPlus/DataGlobalConstants.cc b/src/EnergyPlus/DataGlobalConstants.cc index 12f7382a945..e4fb62cc9b9 100644 --- a/src/EnergyPlus/DataGlobalConstants.cc +++ b/src/EnergyPlus/DataGlobalConstants.cc @@ -102,150 +102,55 @@ namespace DataGlobalConstants { int const endUseCogeneration(14); // Resource Types - std::string const cRT_None("None"); int const iRT_None(1000); - std::string const cRT_Electricity("Electricity"); int const iRT_Electricity(1001); - std::string const cRT_Natural_Gas("NaturalGas"); int const iRT_Natural_Gas(1002); - std::string const cRT_Gasoline("Gasoline"); int const iRT_Gasoline(1003); - std::string const cRT_Diesel("Diesel"); int const iRT_Diesel(1004); - std::string const cRT_Coal("Coal"); int const iRT_Coal(1005); - std::string const cRT_FuelOil_1("FuelOilNo1"); int const iRT_FuelOil_1(1006); - std::string const cRT_FuelOil_2("FuelOilNo2"); int const iRT_FuelOil_2(1007); - std::string const cRT_Propane("Propane"); int const iRT_Propane(1008); - std::string const cRT_Water("Water"); int const iRT_Water(1009); - std::string const cRT_EnergyTransfer("EnergyTransfer"); int const iRT_EnergyTransfer(1010); - std::string const cRT_Steam("Steam"); int const iRT_Steam(1011); - std::string const cRT_DistrictCooling("DistrictCooling"); int const iRT_DistrictCooling(1012); - std::string const cRT_DistrictHeating("DistrictHeating"); int const iRT_DistrictHeating(1013); - std::string const cRT_ElectricityProduced("ElectricityProduced"); int const iRT_ElectricityProduced(1014); - std::string const cRT_ElectricityPurchased("ElectricityPurchased"); int const iRT_ElectricityPurchased(1015); - std::string const cRT_ElectricitySurplusSold("ElectricitySurplusSold"); int const iRT_ElectricitySurplusSold(1016); - std::string const cRT_ElectricityNet("ElectricityNet"); int const iRT_ElectricityNet(1017); - std::string const cRT_SolarWater("SolarWater"); int const iRT_SolarWater(1018); - std::string const cRT_SolarAir("SolarAir"); int const iRT_SolarAir(1019); - std::string const cRT_SO2("SO2"); int const iRT_SO2(1020); - std::string const cRT_NOx("NOx"); int const iRT_NOx(1021); - std::string const cRT_N2O("N2O"); int const iRT_N2O(1022); - std::string const cRT_PM("PM"); int const iRT_PM(1023); - std::string const cRT_PM2_5("PM2.5"); int const iRT_PM2_5(1024); - std::string const cRT_PM10("PM10"); int const iRT_PM10(1025); - std::string const cRT_CO("CO"); int const iRT_CO(1026); - std::string const cRT_CO2("CO2"); int const iRT_CO2(1027); - std::string const cRT_CH4("CH4"); int const iRT_CH4(1028); - std::string const cRT_NH3("NH3"); int const iRT_NH3(1029); - std::string const cRT_NMVOC("NMVOC"); int const iRT_NMVOC(1030); - std::string const cRT_Hg("Hg"); int const iRT_Hg(1031); - std::string const cRT_Pb("Pb"); int const iRT_Pb(1032); - std::string const cRT_NuclearHigh("NuclearHigh"); int const iRT_NuclearHigh(1033); - std::string const cRT_NuclearLow("NuclearLow"); int const iRT_NuclearLow(1034); - std::string const cRT_WaterEnvironmentalFactors("WaterEnvironmentalFactors"); int const iRT_WaterEnvironmentalFactors(1035); - std::string const cRT_CarbonEquivalent("Carbon Equivalent"); int const iRT_CarbonEquivalent(1036); - std::string const cRT_Source("Source"); int const iRT_Source(1037); - std::string const cRT_PlantLoopHeatingDemand("PlantLoopHeatingDemand"); int const iRT_PlantLoopHeatingDemand(1038); - std::string const cRT_PlantLoopCoolingDemand("PlantLoopCoolingDemand"); int const iRT_PlantLoopCoolingDemand(1039); - std::string const cRT_OnSiteWater("OnSiteWater"); int const iRT_OnSiteWater(1040); - std::string const cRT_MainsWater("MainsWater"); int const iRT_MainsWater(1041); - std::string const cRT_RainWater("RainWater"); int const iRT_RainWater(1042); - std::string const cRT_WellWater("WellWater"); int const iRT_WellWater(1043); - std::string const cRT_Condensate("Condensate"); int const iRT_Condensate(1044); - std::string const cRT_OtherFuel1("OtherFuel1"); int const iRT_OtherFuel1(1045); - std::string const cRT_OtherFuel2("OtherFuel2"); int const iRT_OtherFuel2(1046); int const NumOfResourceTypes(46); int const ResourceTypeInitialOffset(1000); // to reach "ValidTypes" - Array1D_string const cRT_ValidTypes({0, NumOfResourceTypes}, - {cRT_None, - cRT_Electricity, - cRT_Natural_Gas, - cRT_Gasoline, - cRT_Diesel, - cRT_Coal, - cRT_FuelOil_1, - cRT_FuelOil_2, - cRT_Propane, - cRT_Water, - cRT_EnergyTransfer, - cRT_Steam, - cRT_DistrictCooling, - cRT_DistrictHeating, - cRT_ElectricityProduced, - cRT_ElectricityPurchased, - cRT_ElectricitySurplusSold, - cRT_ElectricityNet, - cRT_SolarWater, - cRT_SolarAir, - cRT_SO2, - cRT_NOx, - cRT_N2O, - cRT_PM, - cRT_PM2_5, - cRT_PM10, - cRT_CO, - cRT_CO2, - cRT_CH4, - cRT_NH3, - cRT_NMVOC, - cRT_Hg, - cRT_Pb, - cRT_NuclearHigh, - cRT_NuclearLow, - cRT_WaterEnvironmentalFactors, - cRT_CarbonEquivalent, - cRT_Source, - cRT_PlantLoopHeatingDemand, - cRT_PlantLoopCoolingDemand, - cRT_OnSiteWater, - cRT_MainsWater, - cRT_RainWater, - cRT_WellWater, - cRT_Condensate, - cRT_OtherFuel1, - cRT_OtherFuel2}); int AssignResourceTypeNum(std::string const &ResourceTypeChar) { diff --git a/src/EnergyPlus/DataGlobalConstants.hh b/src/EnergyPlus/DataGlobalConstants.hh index 6b4413b8c38..c863341432f 100644 --- a/src/EnergyPlus/DataGlobalConstants.hh +++ b/src/EnergyPlus/DataGlobalConstants.hh @@ -79,103 +79,55 @@ namespace DataGlobalConstants { extern int const endUseCogeneration; // Resource Types - extern std::string const cRT_None; extern int const iRT_None; - extern std::string const cRT_Electricity; extern int const iRT_Electricity; - extern std::string const cRT_Natural_Gas; extern int const iRT_Natural_Gas; - extern std::string const cRT_Gasoline; extern int const iRT_Gasoline; - extern std::string const cRT_Diesel; extern int const iRT_Diesel; - extern std::string const cRT_Coal; extern int const iRT_Coal; - extern std::string const cRT_FuelOil_1; extern int const iRT_FuelOil_1; - extern std::string const cRT_FuelOil_2; extern int const iRT_FuelOil_2; - extern std::string const cRT_Propane; extern int const iRT_Propane; - extern std::string const cRT_Water; extern int const iRT_Water; - extern std::string const cRT_EnergyTransfer; extern int const iRT_EnergyTransfer; - extern std::string const cRT_Steam; extern int const iRT_Steam; - extern std::string const cRT_DistrictCooling; extern int const iRT_DistrictCooling; - extern std::string const cRT_DistrictHeating; extern int const iRT_DistrictHeating; - extern std::string const cRT_ElectricityProduced; extern int const iRT_ElectricityProduced; - extern std::string const cRT_ElectricityPurchased; extern int const iRT_ElectricityPurchased; - extern std::string const cRT_ElectricitySurplusSold; extern int const iRT_ElectricitySurplusSold; - extern std::string const cRT_ElectricityNet; extern int const iRT_ElectricityNet; - extern std::string const cRT_SolarWater; extern int const iRT_SolarWater; - extern std::string const cRT_SolarAir; extern int const iRT_SolarAir; - extern std::string const cRT_SO2; extern int const iRT_SO2; - extern std::string const cRT_NOx; extern int const iRT_NOx; - extern std::string const cRT_N2O; extern int const iRT_N2O; - extern std::string const cRT_PM; extern int const iRT_PM; - extern std::string const cRT_PM2_5; extern int const iRT_PM2_5; - extern std::string const cRT_PM10; extern int const iRT_PM10; - extern std::string const cRT_CO; extern int const iRT_CO; - extern std::string const cRT_CO2; extern int const iRT_CO2; - extern std::string const cRT_CH4; extern int const iRT_CH4; - extern std::string const cRT_NH3; extern int const iRT_NH3; - extern std::string const cRT_NMVOC; extern int const iRT_NMVOC; - extern std::string const cRT_Hg; extern int const iRT_Hg; - extern std::string const cRT_Pb; extern int const iRT_Pb; - extern std::string const cRT_NuclearHigh; extern int const iRT_NuclearHigh; - extern std::string const cRT_NuclearLow; extern int const iRT_NuclearLow; - extern std::string const cRT_WaterEnvironmentalFactors; extern int const iRT_WaterEnvironmentalFactors; - extern std::string const cRT_CarbonEquivalent; extern int const iRT_CarbonEquivalent; - extern std::string const cRT_Source; extern int const iRT_Source; - extern std::string const cRT_PlantLoopHeatingDemand; extern int const iRT_PlantLoopHeatingDemand; - extern std::string const cRT_PlantLoopCoolingDemand; extern int const iRT_PlantLoopCoolingDemand; - extern std::string const cRT_OnSiteWater; extern int const iRT_OnSiteWater; - extern std::string const cRT_MainsWater; extern int const iRT_MainsWater; - extern std::string const cRT_RainWater; extern int const iRT_RainWater; - extern std::string const cRT_WellWater; extern int const iRT_WellWater; - extern std::string const cRT_Condensate; extern int const iRT_Condensate; - extern std::string const cRT_OtherFuel1; extern int const iRT_OtherFuel1; - extern std::string const cRT_OtherFuel2; extern int const iRT_OtherFuel2; extern int const NumOfResourceTypes; - extern int const ResourceTypeInitialOffset; // to reach "ValidTypes" - extern Array1D_string const cRT_ValidTypes; + extern int const ResourceTypeInitialOffset; enum class CallIndicator { BeginDay, @@ -216,7 +168,7 @@ namespace DataGlobalConstants { Real64 constexpr HWInitConvTemp () { return 60.0; } // [deg C], standard init hot water vol to mass flow conversion temp Real64 constexpr SteamInitConvTemp () { return 100.0; } // [deg C], standard init steam vol to mass flow conversion temp Real64 constexpr StefanBoltzmann () { return 5.6697E-8; } // Stefan-Boltzmann constant in W/(m2*K4) - Real64 constexpr UniversalGasConst () { return 8314.462175; } // (J/mol*K) + Real64 constexpr UniversalGasConst () { return 8314.462175; } // Universal Gas Constant (J/mol*K) Real64 constexpr convertJtoGJ () { return 1.0E-9; } // Conversion factor for J to GJ int AssignResourceTypeNum(std::string const &ResourceTypeChar); diff --git a/src/EnergyPlus/SystemReports.cc b/src/EnergyPlus/SystemReports.cc index 7414fbeefcb..6c27f60cbc8 100644 --- a/src/EnergyPlus/SystemReports.cc +++ b/src/EnergyPlus/SystemReports.cc @@ -4051,11 +4051,6 @@ namespace SystemReports { if (!AirLoopLoadsReportEnabled) return; - // following for debug - // CHARACTER(len=60) :: cEnergyType - - // cEnergyType=cRT_ValidTypes(EnergyType-ResourceTypeInitialOffset) - // Find enum for the component type string ComponentTypes comp_type; auto const it = component_map.find(CompType); From 8ff19ef45eff34ee59863d142fe024df5b558319 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Mon, 12 Oct 2020 16:43:32 -0600 Subject: [PATCH 13/15] move DataGlobalConstants resource ints to enum --- src/EnergyPlus/BoilerSteam.hh | 4 +- src/EnergyPlus/Boilers.hh | 8 +- .../Coils/CoilCoolingDXCurveFitPerformance.cc | 8 +- .../Coils/CoilCoolingDXCurveFitPerformance.hh | 5 +- src/EnergyPlus/DXCoils.cc | 32 +- src/EnergyPlus/DXCoils.hh | 5 +- src/EnergyPlus/DataGlobalConstants.cc | 399 +++++++++--------- src/EnergyPlus/DataGlobalConstants.hh | 105 ++--- src/EnergyPlus/DataZoneEquipment.hh | 4 +- src/EnergyPlus/EconomicLifeCycleCost.cc | 189 +++++---- src/EnergyPlus/EconomicLifeCycleCost.hh | 19 +- src/EnergyPlus/EconomicTariff.cc | 2 +- src/EnergyPlus/EconomicTariff.hh | 11 +- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 6 +- src/EnergyPlus/HVACVariableRefrigerantFlow.hh | 5 +- src/EnergyPlus/HeatingCoils.cc | 16 +- src/EnergyPlus/HeatingCoils.hh | 5 +- src/EnergyPlus/OutputProcessor.cc | 12 +- src/EnergyPlus/OutputProcessor.hh | 4 +- src/EnergyPlus/OutputReportTabular.cc | 2 +- src/EnergyPlus/Plant/MeterData.hh | 4 +- src/EnergyPlus/SetPointManager.cc | 29 +- src/EnergyPlus/SimulationManager.cc | 11 +- src/EnergyPlus/SystemReports.cc | 149 ++++--- src/EnergyPlus/SystemReports.hh | 3 +- src/EnergyPlus/UtilityRoutines.cc | 2 +- src/EnergyPlus/UtilityRoutines.hh | 11 +- tst/EnergyPlus/unit/DXCoils.unit.cc | 8 +- .../unit/DataGlobalConstants.unit.cc | 185 ++++---- .../unit/EconomicLifeCycleCost.unit.cc | 40 +- .../unit/HVACVariableRefrigerantFlow.unit.cc | 10 +- tst/EnergyPlus/unit/HeatingCoils.unit.cc | 6 +- tst/EnergyPlus/unit/OutputProcessor.unit.cc | 6 +- .../unit/PlantLoopHeatPumpEIR.unit.cc | 20 +- tst/EnergyPlus/unit/SystemReports.unit.cc | 30 +- .../unit/UnitaryHybridAirConditioner.unit.cc | 20 +- 36 files changed, 739 insertions(+), 636 deletions(-) diff --git a/src/EnergyPlus/BoilerSteam.hh b/src/EnergyPlus/BoilerSteam.hh index bfde8f0a6df..4e649cc0ec1 100644 --- a/src/EnergyPlus/BoilerSteam.hh +++ b/src/EnergyPlus/BoilerSteam.hh @@ -68,7 +68,7 @@ namespace BoilerSteam { { // Members std::string Name; // user identifier - int FuelType; // resource type + DataGlobalConstants::ResourceType FuelType; // resource type bool Available; // TRUE if machine available in current time step bool ON; // TRUE: simulate the machine at it's operating part load ratio bool MissingSetPointErrDone; // Missing outlet node setpoint message flag @@ -114,7 +114,7 @@ namespace BoilerSteam { // Default Constructor BoilerSpecs() - : FuelType(0), Available(false), ON(false), MissingSetPointErrDone(false), UseLoopSetPoint(false), DesMassFlowRate(0.0), + : FuelType(DataGlobalConstants::ResourceType::Unknown), Available(false), ON(false), MissingSetPointErrDone(false), UseLoopSetPoint(false), DesMassFlowRate(0.0), MassFlowRate(0.0), NomCap(0.0), NomCapWasAutoSized(false), NomEffic(0.0), MinPartLoadRat(0.0), MaxPartLoadRat(0.0), OptPartLoadRat(0.0), OperPartLoadRat(0.0), TempUpLimitBoilerOut(0.0), BoilerMaxOperPress(0.0), BoilerPressCheck(0.0), SizFac(0.0), BoilerInletNodeNum(0), BoilerOutletNodeNum(0), FullLoadCoef(3, 0.0), TypeNum(0), LoopNum(0), LoopSideNum(0), BranchNum(0), CompNum(0), PressErrIndex(0), diff --git a/src/EnergyPlus/Boilers.hh b/src/EnergyPlus/Boilers.hh index b1b49c6648c..3900572c86c 100644 --- a/src/EnergyPlus/Boilers.hh +++ b/src/EnergyPlus/Boilers.hh @@ -55,6 +55,7 @@ #include #include #include +#include #include #include @@ -77,7 +78,7 @@ namespace Boilers { { // Members std::string Name; // user identifier - int FuelType; // resource type assignment + DataGlobalConstants::ResourceType FuelType; // resource type assignment int TypeNum; // plant loop type identifier int LoopNum; // plant loop connection int LoopSideNum; // plant loop side connection @@ -89,7 +90,7 @@ namespace Boilers { bool NomCapWasAutoSized; // true if previous was set to autosize input Real64 NomEffic; // boiler efficiency at design conditions Real64 TempDesBoilerOut; // C - Boiler design outlet temperature - DataPlant::FlowMode FlowMode; // one of 3 modes for component flow during operation + DataPlant::FlowMode FlowMode; // one of 3 modes for component flow during operation bool ModulatedFlowSetToLoop; // True if the setpoint is missing at the outlet node bool ModulatedFlowErrDone; // true if setpoint warning issued Real64 VolFlowRate; // m3/s - Boiler water design volumetric flow rate @@ -137,7 +138,8 @@ namespace Boilers { // Default Constructor BoilerSpecs() - : FuelType(0), TypeNum(0), LoopNum(0), LoopSideNum(0), BranchNum(0), CompNum(0), Available(false), ON(false), NomCap(0.0), + : FuelType(DataGlobalConstants::ResourceType::Unknown), TypeNum(0), LoopNum(0), LoopSideNum(0), BranchNum(0), CompNum(0), Available(false), + ON(false), NomCap(0.0), NomCapWasAutoSized(false), NomEffic(0.0), TempDesBoilerOut(0.0), FlowMode(DataPlant::FlowMode::NOTSET), ModulatedFlowSetToLoop(false), ModulatedFlowErrDone(false), VolFlowRate(0.0), VolFlowRateWasAutoSized(false), DesMassFlowRate(0.0), MassFlowRate(0.0), SizFac(0.0), BoilerInletNodeNum(0), BoilerOutletNodeNum(0), MinPartLoadRat(0.0), MaxPartLoadRat(0.0), OptPartLoadRat(0.0), OperPartLoadRat(0.0), diff --git a/src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.cc b/src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.cc index 54dac2b1978..6ef0666c831 100644 --- a/src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.cc +++ b/src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.cc @@ -86,14 +86,14 @@ void CoilCoolingDXCurveFitPerformance::instantiateFromInputSpec(EnergyPlus::Ener } this->evapCondBasinHeatCap = input_data.basin_heater_capacity; this->evapCondBasinHeatSetpoint = input_data.basin_heater_setpoint_temperature; - if (input_data.basin_heater_operating_shedule_name.empty()) { + if (input_data.basin_heater_operating_schedule_name.empty()) { this->evapCondBasinHeatSchedulIndex = DataGlobals::ScheduleAlwaysOn; } else { - this->evapCondBasinHeatSchedulIndex = ScheduleManager::GetScheduleIndex(state, input_data.basin_heater_operating_shedule_name); + this->evapCondBasinHeatSchedulIndex = ScheduleManager::GetScheduleIndex(state, input_data.basin_heater_operating_schedule_name); } if (this->evapCondBasinHeatSchedulIndex == 0) { ShowSevereError(routineName + this->object_name + "=\"" + this->name + "\", invalid"); - ShowContinueError("...Evaporative Condenser Basin Heater Operating Schedule Name=\"" + input_data.basin_heater_operating_shedule_name + + ShowContinueError("...Evaporative Condenser Basin Heater Operating Schedule Name=\"" + input_data.basin_heater_operating_schedule_name + "\"."); errorsFound = true; } @@ -151,7 +151,7 @@ CoilCoolingDXCurveFitPerformance::CoilCoolingDXCurveFitPerformance(EnergyPlus::E input_specs.capacity_control = cAlphaArgs(2); input_specs.basin_heater_capacity = rNumericArgs(5); input_specs.basin_heater_setpoint_temperature = rNumericArgs(6); - input_specs.basin_heater_operating_shedule_name = cAlphaArgs(3); + input_specs.basin_heater_operating_schedule_name = cAlphaArgs(3); input_specs.compressor_fuel_type = DataGlobalConstants::AssignResourceTypeNum(cAlphaArgs(4)); input_specs.base_operating_mode_name = cAlphaArgs(5); if (!lAlphaFieldBlanks(6)) { diff --git a/src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.hh b/src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.hh index 1eed5057ae0..b3ece415fc0 100644 --- a/src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.hh +++ b/src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.hh @@ -52,6 +52,7 @@ #include #include +#include #include #include @@ -69,8 +70,8 @@ struct CoilCoolingDXCurveFitPerformanceInputSpecification Real64 unit_internal_static_air_pressure; Real64 basin_heater_capacity; Real64 basin_heater_setpoint_temperature; - std::string basin_heater_operating_shedule_name; - int compressor_fuel_type; + std::string basin_heater_operating_schedule_name; + DataGlobalConstants::ResourceType compressor_fuel_type; std::string base_operating_mode_name; std::string alternate_operating_mode_name; std::string alternate_operating_mode2_name; diff --git a/src/EnergyPlus/DXCoils.cc b/src/EnergyPlus/DXCoils.cc index aa4a3684a70..3da598a80b4 100644 --- a/src/EnergyPlus/DXCoils.cc +++ b/src/EnergyPlus/DXCoils.cc @@ -4176,7 +4176,7 @@ namespace DXCoils { // Read waste heat modifier curve name DXCoil(DXCoilNum).MSWasteHeat(I) = GetCurveIndex(state, Alphas(18 + (I - 1) * 6)); // convert curve name to number - if (DXCoil(DXCoilNum).FuelTypeNum != DataGlobalConstants::iRT_Electricity) { + if (DXCoil(DXCoilNum).FuelTypeNum != DataGlobalConstants::ResourceType::Electricity) { if (DXCoil(DXCoilNum).MSWasteHeat(I) > 0) { // Verify Curve Object, only legal types are BiQuadratic ErrorsFound |= CurveManager::CheckCurveDims(state, DXCoil(DXCoilNum).MSWasteHeat(I), // Curve index @@ -4635,7 +4635,7 @@ namespace DXCoils { // Read waste heat modifier curve name DXCoil(DXCoilNum).MSWasteHeat(I) = GetCurveIndex(state, Alphas(15 + (I - 1) * 6)); // convert curve name to number - if (DXCoil(DXCoilNum).FuelTypeNum != DataGlobalConstants::iRT_Electricity) { + if (DXCoil(DXCoilNum).FuelTypeNum != DataGlobalConstants::ResourceType::Electricity) { if (DXCoil(DXCoilNum).MSWasteHeat(I) > 0) { // Verify Curve Object, only legal types are BiQuadratic ErrorsFound |= CurveManager::CheckCurveDims(state, DXCoil(DXCoilNum).MSWasteHeat(I), // Curve index @@ -5602,7 +5602,7 @@ namespace DXCoils { _, "System"); - if (Coil.FuelTypeNum != DataGlobalConstants::iRT_Electricity) { + if (Coil.FuelTypeNum != DataGlobalConstants::ResourceType::Electricity) { SetupOutputVariable(state, "Cooling Coil " + Coil.FuelType + " Rate", OutputProcessor::Unit::W, Coil.FuelUsed, @@ -5727,7 +5727,7 @@ namespace DXCoils { _, "System"); - if (Coil.FuelTypeNum != DataGlobalConstants::iRT_Electricity) { + if (Coil.FuelTypeNum != DataGlobalConstants::ResourceType::Electricity) { SetupOutputVariable(state, "Heating Coil " + Coil.FuelType + " Rate", OutputProcessor::Unit::W, Coil.FuelUsed, @@ -5747,7 +5747,7 @@ namespace DXCoils { "System"); } - if (Coil.FuelTypeNum != DataGlobalConstants::iRT_Electricity && Coil.DefrostStrategy == ReverseCycle) { + if (Coil.FuelTypeNum != DataGlobalConstants::ResourceType::Electricity && Coil.DefrostStrategy == ReverseCycle) { SetupOutputVariable(state, "Heating Coil Defrost " + Coil.FuelType + " Rate", OutputProcessor::Unit::W, Coil.DefrostPower, @@ -6108,7 +6108,7 @@ namespace DXCoils { if ((DXCoil(DXCoilNum).DXCoilType_Num == CoilDX_MultiSpeedCooling || DXCoil(DXCoilNum).DXCoilType_Num == CoilDX_MultiSpeedHeating) && MyEnvrnFlag(DXCoilNum)) { - if (DXCoil(DXCoilNum).FuelTypeNum != DataGlobalConstants::iRT_Electricity) { + if (DXCoil(DXCoilNum).FuelTypeNum != DataGlobalConstants::ResourceType::Electricity) { if (DXCoil(DXCoilNum).MSHPHeatRecActive) { for (SpeedNum = 1; SpeedNum <= DXCoil(DXCoilNum).NumOfSpeeds; ++SpeedNum) { if (DXCoil(DXCoilNum).MSWasteHeat(SpeedNum) == 0) { @@ -12188,7 +12188,7 @@ namespace DXCoils { // Waste heat calculation // TODO: waste heat not considered even if defined in Cooling:DX:MultiSpeed, N16, \field Speed 1 Rated Waste Heat Fraction of // Power Input - if (DXCoil(DXCoilNum).FuelTypeNum != DataGlobalConstants::iRT_Electricity) { + if (DXCoil(DXCoilNum).FuelTypeNum != DataGlobalConstants::ResourceType::Electricity) { if (DXCoil(DXCoilNum).MSWasteHeat(SpeedNumLS) == 0) { WasteHeatLS = DXCoil(DXCoilNum).MSWasteHeatFrac(SpeedNumLS); } else { @@ -12209,7 +12209,7 @@ namespace DXCoils { } // Energy use for other fuel types - if (DXCoil(DXCoilNum).FuelTypeNum != DataGlobalConstants::iRT_Electricity) { + if (DXCoil(DXCoilNum).FuelTypeNum != DataGlobalConstants::ResourceType::Electricity) { DXCoil(DXCoilNum).FuelUsed = DXCoil(DXCoilNum).ElecCoolingPower; DXCoil(DXCoilNum).ElecCoolingPower = 0.0; } @@ -12426,7 +12426,7 @@ namespace DXCoils { } } // Energy use for other fuel types - if (DXCoil(DXCoilNum).FuelTypeNum != DataGlobalConstants::iRT_Electricity) { + if (DXCoil(DXCoilNum).FuelTypeNum != DataGlobalConstants::ResourceType::Electricity) { DXCoil(DXCoilNum).FuelUsed = DXCoil(DXCoilNum).ElecCoolingPower; DXCoil(DXCoilNum).ElecCoolingPower = 0.0; } @@ -12930,7 +12930,7 @@ namespace DXCoils { } // Waste heat calculation - if (DXCoil(DXCoilNum).FuelTypeNum != DataGlobalConstants::iRT_Electricity) { + if (DXCoil(DXCoilNum).FuelTypeNum != DataGlobalConstants::ResourceType::Electricity) { if (DXCoil(DXCoilNum).MSWasteHeat(SpeedNumLS) == 0) { WasteHeatLS = DXCoil(DXCoilNum).MSWasteHeatFrac(SpeedNumLS); } else { @@ -12949,7 +12949,7 @@ namespace DXCoils { MSHPWasteHeat = DXCoil(DXCoilNum).MSFuelWasteHeat; } } - if (DXCoil(DXCoilNum).FuelTypeNum != DataGlobalConstants::iRT_Electricity) { + if (DXCoil(DXCoilNum).FuelTypeNum != DataGlobalConstants::ResourceType::Electricity) { DXCoil(DXCoilNum).FuelUsed = DXCoil(DXCoilNum).ElecHeatingPower; DXCoil(DXCoilNum).ElecHeatingPower = 0.0; @@ -13160,7 +13160,7 @@ namespace DXCoils { OutletAirEnthalpy = InletAirEnthalpy + DXCoil(DXCoilNum).TotalHeatingEnergyRate / DXCoil(DXCoilNum).InletAirMassFlowRate; OutletAirTemp = PsyTdbFnHW(OutletAirEnthalpy, OutletAirHumRat); } - if (DXCoil(DXCoilNum).MSHPHeatRecActive || DXCoil(DXCoilNum).FuelTypeNum != DataGlobalConstants::iRT_Electricity) { + if (DXCoil(DXCoilNum).MSHPHeatRecActive || DXCoil(DXCoilNum).FuelTypeNum != DataGlobalConstants::ResourceType::Electricity) { if (DXCoil(DXCoilNum).MSWasteHeat(SpeedNum) == 0) { DXCoil(DXCoilNum).MSFuelWasteHeat = DXCoil(DXCoilNum).MSWasteHeatFrac(SpeedNum) * DXCoil(DXCoilNum).ElecHeatingPower; } else { @@ -13171,7 +13171,7 @@ namespace DXCoils { MSHPWasteHeat = DXCoil(DXCoilNum).MSFuelWasteHeat; } } - if (DXCoil(DXCoilNum).FuelTypeNum != DataGlobalConstants::iRT_Electricity) { + if (DXCoil(DXCoilNum).FuelTypeNum != DataGlobalConstants::ResourceType::Electricity) { DXCoil(DXCoilNum).FuelUsed = DXCoil(DXCoilNum).ElecHeatingPower; DXCoil(DXCoilNum).ElecHeatingPower = 0.0; @@ -13325,7 +13325,7 @@ namespace DXCoils { DXElecHeatingPower = DXCoil(DXCoilNum).ElecHeatingPower + DXCoil(DXCoilNum).CrankcaseHeaterPower; } else if (SELECT_CASE_var == CoilDX_MultiSpeedHeating) { DXCoil(DXCoilNum).TotalHeatingEnergy = DXCoil(DXCoilNum).TotalHeatingEnergyRate * ReportingConstant; - if (DXCoil(DXCoilNum).FuelTypeNum == DataGlobalConstants::iRT_Electricity) { + if (DXCoil(DXCoilNum).FuelTypeNum == DataGlobalConstants::ResourceType::Electricity) { DXCoil(DXCoilNum).ElecHeatingConsumption = DXCoil(DXCoilNum).ElecHeatingPower * ReportingConstant; } else { DXCoil(DXCoilNum).FuelConsumed = DXCoil(DXCoilNum).FuelUsed * ReportingConstant; @@ -13341,7 +13341,7 @@ namespace DXCoils { DXElecCoolingPower = DXCoil(DXCoilNum).ElecCoolingPower; DXCoil(DXCoilNum).EvapCondPumpElecConsumption = DXCoil(DXCoilNum).EvapCondPumpElecPower * ReportingConstant; DXCoil(DXCoilNum).EvapWaterConsump = DXCoil(DXCoilNum).EvapWaterConsumpRate * ReportingConstant; - if (DXCoil(DXCoilNum).FuelTypeNum == DataGlobalConstants::iRT_Electricity) { + if (DXCoil(DXCoilNum).FuelTypeNum == DataGlobalConstants::ResourceType::Electricity) { DXCoil(DXCoilNum).ElecCoolingConsumption = DXCoil(DXCoilNum).ElecCoolingPower * ReportingConstant; } else { DXCoil(DXCoilNum).FuelConsumed = DXCoil(DXCoilNum).FuelUsed * ReportingConstant; @@ -16950,7 +16950,7 @@ namespace DXCoils { // PURPOSE OF THIS SUBROUTINE: // Set the heat recovery flag true when the parent object requests heat recovery. - if (DXCoil(DXCoilNum).FuelTypeNum != DataGlobalConstants::iRT_Electricity) { + if (DXCoil(DXCoilNum).FuelTypeNum != DataGlobalConstants::ResourceType::Electricity) { DXCoil(DXCoilNum).MSHPHeatRecActive = true; } } diff --git a/src/EnergyPlus/DXCoils.hh b/src/EnergyPlus/DXCoils.hh index 815d519e9e5..8a2a486ae15 100644 --- a/src/EnergyPlus/DXCoils.hh +++ b/src/EnergyPlus/DXCoils.hh @@ -396,7 +396,7 @@ namespace DXCoils { Real64 TimeStepSysLast; // last system time step (used to check for downshifting) // for multispeed DX coil type std::string FuelType; // Fuel type string - int FuelTypeNum; // Fuel type number + DataGlobalConstants::ResourceType FuelTypeNum; // Fuel type number int NumOfSpeeds; // Number of speeds bool PLRImpact; // Part load fraction applied to Speed Number > 1 bool LatentImpact; // Latent degradation applied to Speed Number > 1 @@ -536,7 +536,8 @@ namespace DXCoils { ErrIndex4(0), LowAmbErrIndex(0), HighAmbErrIndex(0), PLFErrIndex(0), PLRErrIndex(0), PrintLowAmbMessage(false), PrintHighAmbMessage(false), EvapWaterSupplyMode(WaterSupplyFromMains), EvapWaterSupTankID(0), EvapWaterTankDemandARRID(0), CondensateCollectMode(CondensateDiscarded), CondensateTankID(0), CondensateTankSupplyARRID(0), CondensateVdot(0.0), CondensateVol(0.0), - CurrentEndTimeLast(0.0), TimeStepSysLast(0.0), FuelTypeNum(0), NumOfSpeeds(0), PLRImpact(false), LatentImpact(false), MSFuelWasteHeat(0.0), + CurrentEndTimeLast(0.0), TimeStepSysLast(0.0), FuelTypeNum(DataGlobalConstants::ResourceType::Unknown), NumOfSpeeds(0), PLRImpact(false), + LatentImpact(false), MSFuelWasteHeat(0.0), MSHPHeatRecActive(false), MSHPDesignSpecIndex(0), CoolingCoilPresent(true), HeatingCoilPresent(true), ISHundredPercentDOASDXCoil(false), SHRFTemp(MaxModes, 0), SHRFTempErrorIndex(0), SHRFFlow(MaxModes, 0), SHRFFlowErrorIndex(0), SHRFTemp2(0), SHRFFlow2(0), UserSHRCurveExists(false), ASHRAE127StdRprt(false), SecZonePtr(0), SecCoilSHRFT(0), SecCoilSHRFF(0), SecCoilAirFlow(0.0), diff --git a/src/EnergyPlus/DataGlobalConstants.cc b/src/EnergyPlus/DataGlobalConstants.cc index e4fb62cc9b9..dd2c602314a 100644 --- a/src/EnergyPlus/DataGlobalConstants.cc +++ b/src/EnergyPlus/DataGlobalConstants.cc @@ -45,11 +45,8 @@ // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. -// ObjexxFCL Headers - // EnergyPlus Headers #include -#include #include namespace EnergyPlus { @@ -101,58 +98,56 @@ namespace DataGlobalConstants { int const endUseRefrigeration(13); int const endUseCogeneration(14); - // Resource Types - int const iRT_None(1000); - int const iRT_Electricity(1001); - int const iRT_Natural_Gas(1002); - int const iRT_Gasoline(1003); - int const iRT_Diesel(1004); - int const iRT_Coal(1005); - int const iRT_FuelOil_1(1006); - int const iRT_FuelOil_2(1007); - int const iRT_Propane(1008); - int const iRT_Water(1009); - int const iRT_EnergyTransfer(1010); - int const iRT_Steam(1011); - int const iRT_DistrictCooling(1012); - int const iRT_DistrictHeating(1013); - int const iRT_ElectricityProduced(1014); - int const iRT_ElectricityPurchased(1015); - int const iRT_ElectricitySurplusSold(1016); - int const iRT_ElectricityNet(1017); - int const iRT_SolarWater(1018); - int const iRT_SolarAir(1019); - int const iRT_SO2(1020); - int const iRT_NOx(1021); - int const iRT_N2O(1022); - int const iRT_PM(1023); - int const iRT_PM2_5(1024); - int const iRT_PM10(1025); - int const iRT_CO(1026); - int const iRT_CO2(1027); - int const iRT_CH4(1028); - int const iRT_NH3(1029); - int const iRT_NMVOC(1030); - int const iRT_Hg(1031); - int const iRT_Pb(1032); - int const iRT_NuclearHigh(1033); - int const iRT_NuclearLow(1034); - int const iRT_WaterEnvironmentalFactors(1035); - int const iRT_CarbonEquivalent(1036); - int const iRT_Source(1037); - int const iRT_PlantLoopHeatingDemand(1038); - int const iRT_PlantLoopCoolingDemand(1039); - int const iRT_OnSiteWater(1040); - int const iRT_MainsWater(1041); - int const iRT_RainWater(1042); - int const iRT_WellWater(1043); - int const iRT_Condensate(1044); - int const iRT_OtherFuel1(1045); - int const iRT_OtherFuel2(1046); - int const NumOfResourceTypes(46); - int const ResourceTypeInitialOffset(1000); // to reach "ValidTypes" - - int AssignResourceTypeNum(std::string const &ResourceTypeChar) + std::vector AllResourceTypes({ResourceType::Unknown, + ResourceType::None, + ResourceType::Electricity, + ResourceType::Natural_Gas, + ResourceType::Gasoline, + ResourceType::Diesel, + ResourceType::Coal, + ResourceType::FuelOil_1, + ResourceType::FuelOil_2, + ResourceType::Propane, + ResourceType::Water, + ResourceType::EnergyTransfer, + ResourceType::Steam, + ResourceType::DistrictCooling, + ResourceType::DistrictHeating, + ResourceType::ElectricityProduced, + ResourceType::ElectricityPurchased, + ResourceType::ElectricitySurplusSold, + ResourceType::ElectricityNet, + ResourceType::SolarWater, + ResourceType::SolarAir, + ResourceType::SO2, + ResourceType::NOx, + ResourceType::N2O, + ResourceType::PM, + ResourceType::PM2_5, + ResourceType::PM10, + ResourceType::CO, + ResourceType::CO2, + ResourceType::CH4, + ResourceType::NH3, + ResourceType::NMVOC, + ResourceType::Hg, + ResourceType::Pb, + ResourceType::NuclearHigh, + ResourceType::NuclearLow, + ResourceType::WaterEnvironmentalFactors, + ResourceType::CarbonEquivalent, + ResourceType::Source, + ResourceType::PlantLoopHeatingDemand, + ResourceType::PlantLoopCoolingDemand, + ResourceType::OnSiteWater, + ResourceType::MainsWater, + ResourceType::RainWater, + ResourceType::WellWater, + ResourceType::Condensate, + ResourceType::OtherFuel1, + ResourceType::OtherFuel2}); + + ResourceType AssignResourceTypeNum(std::string const &ResourceTypeChar) { // FUNCTION INFORMATION: @@ -164,161 +159,154 @@ namespace DataGlobalConstants { // PURPOSE OF THIS FUNCTION: // Assists in assigning proper numeric resource types to data structures. - // Return value - int ResourceTypeNum; - - ResourceTypeNum = 0; - { auto const SELECT_CASE_var(UtilityRoutines::MakeUPPERCase(ResourceTypeChar)); if (SELECT_CASE_var == "ELECTRICITY") { - ResourceTypeNum = iRT_Electricity; + return ResourceType::Electricity; } else if ((SELECT_CASE_var == "GAS") || (SELECT_CASE_var == "NATURALGAS")) { - ResourceTypeNum = iRT_Natural_Gas; + return ResourceType::Natural_Gas; } else if (SELECT_CASE_var == "GASOLINE") { - ResourceTypeNum = iRT_Gasoline; + return ResourceType::Gasoline; } else if (SELECT_CASE_var == "DIESEL") { - ResourceTypeNum = iRT_Diesel; + return ResourceType::Diesel; } else if (SELECT_CASE_var == "COAL") { - ResourceTypeNum = iRT_Coal; + return ResourceType::Coal; } else if ((SELECT_CASE_var == "FUELOILNO1") || (SELECT_CASE_var == "FuelOilNo1")) { - ResourceTypeNum = iRT_FuelOil_1; + return ResourceType::FuelOil_1; } else if ((SELECT_CASE_var == "FUELOILNO2") || (SELECT_CASE_var == "FuelOilNo2")) { - ResourceTypeNum = iRT_FuelOil_2; + return ResourceType::FuelOil_2; } else if (SELECT_CASE_var == "PROPANE") { - ResourceTypeNum = iRT_Propane; + return ResourceType::Propane; } else if (SELECT_CASE_var == "OTHERFUEL1") { - ResourceTypeNum = iRT_OtherFuel1; + return ResourceType::OtherFuel1; } else if (SELECT_CASE_var == "OTHERFUEL2") { - ResourceTypeNum = iRT_OtherFuel2; + return ResourceType::OtherFuel2; } else if ((SELECT_CASE_var == "WATER") || (SELECT_CASE_var == "H2O")) { - ResourceTypeNum = iRT_Water; // use record keeping + return ResourceType::Water; // use record keeping } else if ((SELECT_CASE_var == "ONSITEWATER") || (SELECT_CASE_var == "WATERPRODUCED") || (SELECT_CASE_var == "ONSITE WATER")) { - ResourceTypeNum = iRT_OnSiteWater; // these are for supply record keeping + return ResourceType::OnSiteWater; // these are for supply record keeping } else if ((SELECT_CASE_var == "MAINSWATER") || (SELECT_CASE_var == "WATERSUPPLY")) { - ResourceTypeNum = iRT_MainsWater; // record keeping + return ResourceType::MainsWater; // record keeping } else if ((SELECT_CASE_var == "RAINWATER") || (SELECT_CASE_var == "PRECIPITATION")) { - ResourceTypeNum = iRT_RainWater; // record keeping + return ResourceType::RainWater; // record keeping } else if ((SELECT_CASE_var == "WELLWATER") || (SELECT_CASE_var == "Groundwater")) { - ResourceTypeNum = iRT_WellWater; // record keeping + return ResourceType::WellWater; // record keeping } else if (SELECT_CASE_var == "CONDENSATE") { - ResourceTypeNum = iRT_Condensate; + return ResourceType::Condensate; } else if (SELECT_CASE_var == "ENERGYTRANSFER") { - ResourceTypeNum = iRT_EnergyTransfer; + return ResourceType::EnergyTransfer; } else if (SELECT_CASE_var == "STEAM") { - ResourceTypeNum = iRT_Steam; + return ResourceType::Steam; } else if (SELECT_CASE_var == "DISTRICTCOOLING") { - ResourceTypeNum = iRT_DistrictCooling; + return ResourceType::DistrictCooling; } else if (SELECT_CASE_var == "DISTRICTHEATING") { - ResourceTypeNum = iRT_DistrictHeating; + return ResourceType::DistrictHeating; } else if (SELECT_CASE_var == "ELECTRICITYPRODUCED") { - ResourceTypeNum = iRT_ElectricityProduced; + return ResourceType::ElectricityProduced; } else if (SELECT_CASE_var == "ELECTRICITYPURCHASED") { - ResourceTypeNum = iRT_ElectricityPurchased; + return ResourceType::ElectricityPurchased; } else if (SELECT_CASE_var == "ELECTRICITYSURPLUSSOLD") { - ResourceTypeNum = iRT_ElectricitySurplusSold; + return ResourceType::ElectricitySurplusSold; } else if (SELECT_CASE_var == "ELECTRICITYNET") { - ResourceTypeNum = iRT_ElectricityNet; + return ResourceType::ElectricityNet; } else if (SELECT_CASE_var == "SOLARWATER") { - ResourceTypeNum = iRT_SolarWater; + return ResourceType::SolarWater; } else if (SELECT_CASE_var == "SOLARAIR") { - ResourceTypeNum = iRT_SolarAir; + return ResourceType::SolarAir; } else if (SELECT_CASE_var == "SO2") { - ResourceTypeNum = iRT_SO2; + return ResourceType::SO2; } else if (SELECT_CASE_var == "NOX") { - ResourceTypeNum = iRT_NOx; + return ResourceType::NOx; } else if (SELECT_CASE_var == "N2O") { - ResourceTypeNum = iRT_N2O; + return ResourceType::N2O; } else if (SELECT_CASE_var == "PM") { - ResourceTypeNum = iRT_PM; + return ResourceType::PM; } else if (SELECT_CASE_var == "PM2.5") { - ResourceTypeNum = iRT_PM2_5; + return ResourceType::PM2_5; } else if (SELECT_CASE_var == "PM10") { - ResourceTypeNum = iRT_PM10; + return ResourceType::PM10; } else if (SELECT_CASE_var == "CO") { - ResourceTypeNum = iRT_CO; + return ResourceType::CO; } else if (SELECT_CASE_var == "CO2") { - ResourceTypeNum = iRT_CO2; + return ResourceType::CO2; } else if (SELECT_CASE_var == "CH4") { - ResourceTypeNum = iRT_CH4; + return ResourceType::CH4; } else if (SELECT_CASE_var == "NH3") { - ResourceTypeNum = iRT_NH3; + return ResourceType::NH3; } else if (SELECT_CASE_var == "NMVOC") { - ResourceTypeNum = iRT_NMVOC; + return ResourceType::NMVOC; } else if (SELECT_CASE_var == "HG") { - ResourceTypeNum = iRT_Hg; + return ResourceType::Hg; } else if (SELECT_CASE_var == "PB") { - ResourceTypeNum = iRT_Pb; + return ResourceType::Pb; } else if (SELECT_CASE_var == "NUCLEAR HIGH") { - ResourceTypeNum = iRT_NuclearHigh; + return ResourceType::NuclearHigh; } else if (SELECT_CASE_var == "NUCLEAR LOW") { - ResourceTypeNum = iRT_NuclearLow; + return ResourceType::NuclearLow; } else if (SELECT_CASE_var == "WATERENVIRONMENTALFACTORS") { - ResourceTypeNum = iRT_WaterEnvironmentalFactors; + return ResourceType::WaterEnvironmentalFactors; } else if (SELECT_CASE_var == "CARBON EQUIVALENT") { - ResourceTypeNum = iRT_CarbonEquivalent; + return ResourceType::CarbonEquivalent; } else if (SELECT_CASE_var == "SOURCE") { - ResourceTypeNum = iRT_Source; + return ResourceType::Source; } else if (SELECT_CASE_var == "PLANTLOOPHEATINGDEMAND") { - ResourceTypeNum = iRT_PlantLoopHeatingDemand; + return ResourceType::PlantLoopHeatingDemand; } else if (SELECT_CASE_var == "PLANTLOOPCOOLINGDEMAND") { - ResourceTypeNum = iRT_PlantLoopCoolingDemand; + return ResourceType::PlantLoopCoolingDemand; } else { - ResourceTypeNum = 0; + return ResourceType::Unknown; } } - - return ResourceTypeNum; } - std::string GetResourceTypeChar(int const ResourceTypeNum) + std::string GetResourceTypeChar(ResourceType const ResourceTypeNum) { // FUNCTION INFORMATION: @@ -330,156 +318,151 @@ namespace DataGlobalConstants { // PURPOSE OF THIS FUNCTION: // Shows the resource type character string, given the resource type numeric. - // Return value - std::string ResourceTypeChar; - { auto const SELECT_CASE_var(ResourceTypeNum); - if (SELECT_CASE_var == iRT_Electricity) { - ResourceTypeChar = "Electricity"; + if (SELECT_CASE_var == ResourceType::Electricity) { + return "Electricity"; - } else if (SELECT_CASE_var == iRT_Natural_Gas) { - ResourceTypeChar = "NaturalGas"; + } else if (SELECT_CASE_var == ResourceType::Natural_Gas) { + return "NaturalGas"; - } else if (SELECT_CASE_var == iRT_Gasoline) { - ResourceTypeChar = "Gasoline"; + } else if (SELECT_CASE_var == ResourceType::Gasoline) { + return "Gasoline"; - } else if (SELECT_CASE_var == iRT_Diesel) { - ResourceTypeChar = "Diesel"; + } else if (SELECT_CASE_var == ResourceType::Diesel) { + return "Diesel"; - } else if (SELECT_CASE_var == iRT_Coal) { - ResourceTypeChar = "Coal"; + } else if (SELECT_CASE_var == ResourceType::Coal) { + return "Coal"; - } else if (SELECT_CASE_var == iRT_FuelOil_1) { - ResourceTypeChar = "FuelOilNo1"; + } else if (SELECT_CASE_var == ResourceType::FuelOil_1) { + return "FuelOilNo1"; - } else if (SELECT_CASE_var == iRT_FuelOil_2) { - ResourceTypeChar = "FuelOilNo2"; + } else if (SELECT_CASE_var == ResourceType::FuelOil_2) { + return "FuelOilNo2"; - } else if (SELECT_CASE_var == iRT_Propane) { - ResourceTypeChar = "Propane"; + } else if (SELECT_CASE_var == ResourceType::Propane) { + return "Propane"; - } else if (SELECT_CASE_var == iRT_OtherFuel1) { - ResourceTypeChar = "OtherFuel1"; + } else if (SELECT_CASE_var == ResourceType::OtherFuel1) { + return "OtherFuel1"; - } else if (SELECT_CASE_var == iRT_OtherFuel2) { - ResourceTypeChar = "OtherFuel2"; + } else if (SELECT_CASE_var == ResourceType::OtherFuel2) { + return "OtherFuel2"; - } else if (SELECT_CASE_var == iRT_Water) { - ResourceTypeChar = "Water"; + } else if (SELECT_CASE_var == ResourceType::Water) { + return "Water"; - } else if (SELECT_CASE_var == iRT_OnSiteWater) { - ResourceTypeChar = "OnSiteWater"; + } else if (SELECT_CASE_var == ResourceType::OnSiteWater) { + return "OnSiteWater"; - } else if (SELECT_CASE_var == iRT_MainsWater) { - ResourceTypeChar = "MainsWater"; + } else if (SELECT_CASE_var == ResourceType::MainsWater) { + return "MainsWater"; - } else if (SELECT_CASE_var == iRT_RainWater) { - ResourceTypeChar = "RainWater"; + } else if (SELECT_CASE_var == ResourceType::RainWater) { + return "RainWater"; - } else if (SELECT_CASE_var == iRT_Condensate) { - ResourceTypeChar = "Condensate"; + } else if (SELECT_CASE_var == ResourceType::Condensate) { + return "Condensate"; - } else if (SELECT_CASE_var == iRT_WellWater) { - ResourceTypeChar = "WellWater"; + } else if (SELECT_CASE_var == ResourceType::WellWater) { + return "WellWater"; - } else if (SELECT_CASE_var == iRT_EnergyTransfer) { - ResourceTypeChar = "EnergyTransfer"; + } else if (SELECT_CASE_var == ResourceType::EnergyTransfer) { + return "EnergyTransfer"; - } else if (SELECT_CASE_var == iRT_Steam) { - ResourceTypeChar = "Steam"; + } else if (SELECT_CASE_var == ResourceType::Steam) { + return "Steam"; - } else if (SELECT_CASE_var == iRT_DistrictCooling) { - ResourceTypeChar = "DistrictCooling"; + } else if (SELECT_CASE_var == ResourceType::DistrictCooling) { + return "DistrictCooling"; - } else if (SELECT_CASE_var == iRT_DistrictHeating) { - ResourceTypeChar = "DistrictHeating"; + } else if (SELECT_CASE_var == ResourceType::DistrictHeating) { + return "DistrictHeating"; - } else if (SELECT_CASE_var == iRT_ElectricityProduced) { - ResourceTypeChar = "ElectricityProduced"; + } else if (SELECT_CASE_var == ResourceType::ElectricityProduced) { + return "ElectricityProduced"; - } else if (SELECT_CASE_var == iRT_ElectricityPurchased) { - ResourceTypeChar = "ElectricityPurchased"; + } else if (SELECT_CASE_var == ResourceType::ElectricityPurchased) { + return "ElectricityPurchased"; - } else if (SELECT_CASE_var == iRT_ElectricitySurplusSold) { - ResourceTypeChar = "ElectricitySurplusSold"; + } else if (SELECT_CASE_var == ResourceType::ElectricitySurplusSold) { + return "ElectricitySurplusSold"; - } else if (SELECT_CASE_var == iRT_ElectricityNet) { - ResourceTypeChar = "ElectricityNet"; + } else if (SELECT_CASE_var == ResourceType::ElectricityNet) { + return "ElectricityNet"; - } else if (SELECT_CASE_var == iRT_SolarWater) { - ResourceTypeChar = "SolarWater"; + } else if (SELECT_CASE_var == ResourceType::SolarWater) { + return "SolarWater"; - } else if (SELECT_CASE_var == iRT_SolarAir) { - ResourceTypeChar = "SolarAir"; + } else if (SELECT_CASE_var == ResourceType::SolarAir) { + return "SolarAir"; - } else if (SELECT_CASE_var == iRT_SO2) { - ResourceTypeChar = "SO2"; + } else if (SELECT_CASE_var == ResourceType::SO2) { + return "SO2"; - } else if (SELECT_CASE_var == iRT_NOx) { - ResourceTypeChar = "NOx"; + } else if (SELECT_CASE_var == ResourceType::NOx) { + return "NOx"; - } else if (SELECT_CASE_var == iRT_N2O) { - ResourceTypeChar = "N2O"; + } else if (SELECT_CASE_var == ResourceType::N2O) { + return "N2O"; - } else if (SELECT_CASE_var == iRT_PM) { - ResourceTypeChar = "PM"; + } else if (SELECT_CASE_var == ResourceType::PM) { + return "PM"; - } else if (SELECT_CASE_var == iRT_PM2_5) { - ResourceTypeChar = "PM2.5"; + } else if (SELECT_CASE_var == ResourceType::PM2_5) { + return "PM2.5"; - } else if (SELECT_CASE_var == iRT_PM10) { - ResourceTypeChar = "PM10"; + } else if (SELECT_CASE_var == ResourceType::PM10) { + return "PM10"; - } else if (SELECT_CASE_var == iRT_CO) { - ResourceTypeChar = "CO"; + } else if (SELECT_CASE_var == ResourceType::CO) { + return "CO"; - } else if (SELECT_CASE_var == iRT_CO2) { - ResourceTypeChar = "CO2"; + } else if (SELECT_CASE_var == ResourceType::CO2) { + return "CO2"; - } else if (SELECT_CASE_var == iRT_CH4) { - ResourceTypeChar = "CH4"; + } else if (SELECT_CASE_var == ResourceType::CH4) { + return "CH4"; - } else if (SELECT_CASE_var == iRT_NH3) { - ResourceTypeChar = "NH3"; + } else if (SELECT_CASE_var == ResourceType::NH3) { + return "NH3"; - } else if (SELECT_CASE_var == iRT_NMVOC) { - ResourceTypeChar = "NMVOC"; + } else if (SELECT_CASE_var == ResourceType::NMVOC) { + return "NMVOC"; - } else if (SELECT_CASE_var == iRT_Hg) { - ResourceTypeChar = "Hg"; + } else if (SELECT_CASE_var == ResourceType::Hg) { + return "Hg"; - } else if (SELECT_CASE_var == iRT_Pb) { - ResourceTypeChar = "Pb"; + } else if (SELECT_CASE_var == ResourceType::Pb) { + return "Pb"; - } else if (SELECT_CASE_var == iRT_NuclearHigh) { - ResourceTypeChar = "Nuclear High"; + } else if (SELECT_CASE_var == ResourceType::NuclearHigh) { + return "Nuclear High"; - } else if (SELECT_CASE_var == iRT_NuclearLow) { - ResourceTypeChar = "Nuclear Low"; + } else if (SELECT_CASE_var == ResourceType::NuclearLow) { + return "Nuclear Low"; - } else if (SELECT_CASE_var == iRT_WaterEnvironmentalFactors) { - ResourceTypeChar = "WaterEnvironmentalFactors"; + } else if (SELECT_CASE_var == ResourceType::WaterEnvironmentalFactors) { + return "WaterEnvironmentalFactors"; - } else if (SELECT_CASE_var == iRT_CarbonEquivalent) { - ResourceTypeChar = "Carbon Equivalent"; + } else if (SELECT_CASE_var == ResourceType::CarbonEquivalent) { + return "Carbon Equivalent"; - } else if (SELECT_CASE_var == iRT_Source) { - ResourceTypeChar = "Source"; + } else if (SELECT_CASE_var == ResourceType::Source) { + return "Source"; - } else if (SELECT_CASE_var == iRT_PlantLoopHeatingDemand) { - ResourceTypeChar = "PlantLoopHeatingDemand"; + } else if (SELECT_CASE_var == ResourceType::PlantLoopHeatingDemand) { + return "PlantLoopHeatingDemand"; - } else if (SELECT_CASE_var == iRT_PlantLoopCoolingDemand) { - ResourceTypeChar = "PlantLoopCoolingDemand"; + } else if (SELECT_CASE_var == ResourceType::PlantLoopCoolingDemand) { + return "PlantLoopCoolingDemand"; } else { - ResourceTypeChar = "Unknown"; + return "Unknown"; } } - - return ResourceTypeChar; } } // namespace DataGlobalConstants diff --git a/src/EnergyPlus/DataGlobalConstants.hh b/src/EnergyPlus/DataGlobalConstants.hh index c863341432f..d6873c3d682 100644 --- a/src/EnergyPlus/DataGlobalConstants.hh +++ b/src/EnergyPlus/DataGlobalConstants.hh @@ -79,55 +79,58 @@ namespace DataGlobalConstants { extern int const endUseCogeneration; // Resource Types - extern int const iRT_None; - extern int const iRT_Electricity; - extern int const iRT_Natural_Gas; - extern int const iRT_Gasoline; - extern int const iRT_Diesel; - extern int const iRT_Coal; - extern int const iRT_FuelOil_1; - extern int const iRT_FuelOil_2; - extern int const iRT_Propane; - extern int const iRT_Water; - extern int const iRT_EnergyTransfer; - extern int const iRT_Steam; - extern int const iRT_DistrictCooling; - extern int const iRT_DistrictHeating; - extern int const iRT_ElectricityProduced; - extern int const iRT_ElectricityPurchased; - extern int const iRT_ElectricitySurplusSold; - extern int const iRT_ElectricityNet; - extern int const iRT_SolarWater; - extern int const iRT_SolarAir; - extern int const iRT_SO2; - extern int const iRT_NOx; - extern int const iRT_N2O; - extern int const iRT_PM; - extern int const iRT_PM2_5; - extern int const iRT_PM10; - extern int const iRT_CO; - extern int const iRT_CO2; - extern int const iRT_CH4; - extern int const iRT_NH3; - extern int const iRT_NMVOC; - extern int const iRT_Hg; - extern int const iRT_Pb; - extern int const iRT_NuclearHigh; - extern int const iRT_NuclearLow; - extern int const iRT_WaterEnvironmentalFactors; - extern int const iRT_CarbonEquivalent; - extern int const iRT_Source; - extern int const iRT_PlantLoopHeatingDemand; - extern int const iRT_PlantLoopCoolingDemand; - extern int const iRT_OnSiteWater; - extern int const iRT_MainsWater; - extern int const iRT_RainWater; - extern int const iRT_WellWater; - extern int const iRT_Condensate; - extern int const iRT_OtherFuel1; - extern int const iRT_OtherFuel2; - extern int const NumOfResourceTypes; - extern int const ResourceTypeInitialOffset; + enum class ResourceType { + Unknown, + None, + Electricity, + Natural_Gas, + Gasoline, + Diesel, + Coal, + FuelOil_1, + FuelOil_2, + Propane, + Water, + EnergyTransfer, + Steam, + DistrictCooling, + DistrictHeating, + ElectricityProduced, + ElectricityPurchased, + ElectricitySurplusSold, + ElectricityNet, + SolarWater, + SolarAir, + SO2, + NOx, + N2O, + PM, + PM2_5, + PM10, + CO, + CO2, + CH4, + NH3, + NMVOC, + Hg, + Pb, + NuclearHigh, + NuclearLow, + WaterEnvironmentalFactors, + CarbonEquivalent, + Source, + PlantLoopHeatingDemand, + PlantLoopCoolingDemand, + OnSiteWater, + MainsWater, + RainWater, + WellWater, + Condensate, + OtherFuel1, + OtherFuel2 + }; + + extern std::vector AllResourceTypes; enum class CallIndicator { BeginDay, @@ -171,8 +174,8 @@ namespace DataGlobalConstants { Real64 constexpr UniversalGasConst () { return 8314.462175; } // Universal Gas Constant (J/mol*K) Real64 constexpr convertJtoGJ () { return 1.0E-9; } // Conversion factor for J to GJ - int AssignResourceTypeNum(std::string const &ResourceTypeChar); - std::string GetResourceTypeChar(int ResourceTypeNum); + ResourceType AssignResourceTypeNum(std::string const &ResourceTypeChar); + std::string GetResourceTypeChar(ResourceType ResourceTypeNum); } // namespace DataGlobalConstants diff --git a/src/EnergyPlus/DataZoneEquipment.hh b/src/EnergyPlus/DataZoneEquipment.hh index 3eddbe75b4e..263787772d9 100644 --- a/src/EnergyPlus/DataZoneEquipment.hh +++ b/src/EnergyPlus/DataZoneEquipment.hh @@ -161,7 +161,7 @@ namespace DataZoneEquipment { // Members std::string ReportVarName; OutputProcessor::Unit ReportVarUnits; - int ResourceType; + DataGlobalConstants::ResourceType ResourceType; std::string EndUse; int EndUse_CompMode; std::string Group; @@ -172,7 +172,7 @@ namespace DataZoneEquipment { // Default Constructor EquipMeterData() - : ReportVarUnits(OutputProcessor::Unit::None), ResourceType(0), EndUse_CompMode(0), ReportVarIndex(0), + : ReportVarUnits(OutputProcessor::Unit::None), ResourceType(DataGlobalConstants::ResourceType::Unknown), EndUse_CompMode(0), ReportVarIndex(0), ReportVarIndexType(OutputProcessor::TimeStepType::TimeStepZone), ReportVarType(0), CurMeterReading(0.0) { } diff --git a/src/EnergyPlus/EconomicLifeCycleCost.cc b/src/EnergyPlus/EconomicLifeCycleCost.cc index 275f3cdc236..c783f4eb872 100644 --- a/src/EnergyPlus/EconomicLifeCycleCost.cc +++ b/src/EnergyPlus/EconomicLifeCycleCost.cc @@ -201,7 +201,7 @@ namespace EconomicLifeCycleCost { // present value factors Array1D SPV; - Array2D energySPV; // yearly equivalent to FEMP UPV* values + std::map> energySPV; // yearly equivalent to FEMP UPV* values // arrays related to computing after tax cashflow and present value Array1D DepreciatedCapital; @@ -215,7 +215,7 @@ namespace EconomicLifeCycleCost { // arrays related to escalated energy costs Array1D EscalatedTotEnergy; - Array2D EscalatedEnergy; + std::map> EscalatedEnergy; // SUBROUTINE SPECIFICATIONS FOR MODULE : @@ -1247,19 +1247,35 @@ namespace EconomicLifeCycleCost { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int iCashFlow; - int iResource; int jCost; - int jMonth; int jAdj; int kYear; int offset; int month; // number of months since base date int firstMonth; int monthsBaseToService; - Array2D resourceCosts; + + std::map> resourceCosts; + for (int jMonth = 1; jMonth <= 12; ++jMonth) { + std::map monthMap; + for (auto iResource : DataGlobalConstants::AllResourceTypes) { + monthMap.insert(std::pair (iResource, 0.0)); + } + resourceCosts.insert(std::pair> (jMonth, monthMap)); + } + Array1D curResourceCosts(12); - Array1D_bool resourceCostNotZero; - Array1D resourceCostAnnual; + + std::map resourceCostNotZero; + for (auto iResource : DataGlobalConstants::AllResourceTypes) { + resourceCostNotZero.insert(std::pair(iResource, false)); + } + + std::map resourceCostAnnual; + for (auto iResource : DataGlobalConstants::AllResourceTypes) { + resourceCostAnnual.insert(std::pair(iResource, 0.0)); + } + Real64 annualCost; int cashFlowCounter; int found; @@ -1284,29 +1300,33 @@ namespace EconomicLifeCycleCost { NonrecurringCost(numNonrecurringCost).monthsFromStart = 0; NonrecurringCost(numNonrecurringCost).totalMonthsFromStart = 0; } + // gather costs from EconomicTariff for each end use - resourceCosts.allocate(12, NumOfResourceTypes); - resourceCostNotZero.allocate(NumOfResourceTypes); - resourceCostAnnual.allocate(NumOfResourceTypes); numResourcesUsed = 0; - for (iResource = 1; iResource <= NumOfResourceTypes; ++iResource) { - GetMonthlyCostForResource(iResource + ResourceTypeInitialOffset, curResourceCosts); + for (auto iResource : DataGlobalConstants::AllResourceTypes) { + GetMonthlyCostForResource(iResource, curResourceCosts); annualCost = 0.0; - for (jMonth = 1; jMonth <= 12; ++jMonth) { - resourceCosts(jMonth, iResource) = curResourceCosts(jMonth); - annualCost += resourceCosts(jMonth, iResource); + for (int jMonth = 1; jMonth <= 12; ++jMonth) { + resourceCosts.at(jMonth).at(iResource) = curResourceCosts(jMonth); + annualCost += resourceCosts.at(jMonth).at(iResource); } if (annualCost != 0.0) { ++numResourcesUsed; - resourceCostNotZero(iResource) = true; + resourceCostNotZero.at(iResource) = true; } else { - resourceCostNotZero(iResource) = false; + resourceCostNotZero.at(iResource) = false; } - resourceCostAnnual(iResource) = annualCost; + resourceCostAnnual.at(iResource) = annualCost; } // allocate the escalated energy cost arrays - EscalatedEnergy.allocate(lengthStudyYears, NumOfResourceTypes); - EscalatedEnergy = 0.0; + for (int year = 1; year <= lengthStudyYears; ++year) { + std::map yearMap; + for (auto iResource : DataGlobalConstants::AllResourceTypes) { + yearMap.insert(std::pair (iResource, 0.0)); + } + EscalatedEnergy.insert(std::pair>(year, yearMap)); + } + EscalatedTotEnergy.allocate(lengthStudyYears); EscalatedTotEnergy = 0.0; @@ -1319,7 +1339,7 @@ namespace EconomicLifeCycleCost { // for the monthly value since it will be slightly wrong. Instead use inverse of // formula from Newnan (4-32) which is r = m x (ia + 1)^(1/m) - 1) inflationPerMonth = std::pow(inflation + 1.0, 1.0 / 12.0) - 1; - for (jMonth = 1; jMonth <= lengthStudyTotalMonths; ++jMonth) { + for (int jMonth = 1; jMonth <= lengthStudyTotalMonths; ++jMonth) { monthlyInflationFactor(jMonth) = std::pow(1.0 + inflationPerMonth, jMonth - 1); } } @@ -1388,41 +1408,66 @@ namespace EconomicLifeCycleCost { // Put resource costs into cashflows // the first cash flow for resources should be after the categories, recurring and nonrecurring costs cashFlowCounter = countOfCostCat + numRecurringCosts + numNonrecurringCost; - for (iResource = 1; iResource <= NumOfResourceTypes; ++iResource) { - if (resourceCostNotZero(iResource)) { + for (auto iResource : DataGlobalConstants::AllResourceTypes) { + if (resourceCostNotZero.at(iResource)) { ++cashFlowCounter; - int curResource_iRT = iResource + ResourceTypeInitialOffset; - if (curResource_iRT == iRT_Water || (curResource_iRT >= iRT_OnSiteWater && curResource_iRT <= iRT_Condensate)) { - CashFlow(cashFlowCounter).Category = costCatWater; - } else if (curResource_iRT >= iRT_Electricity && curResource_iRT <= iRT_SolarAir) { // iRT_Water already filtered by first if block - CashFlow(cashFlowCounter).Category = costCatEnergy; - } else { - CashFlow(cashFlowCounter).Category = costCatOperation; + + switch(iResource) { + case DataGlobalConstants::ResourceType::Water: + case DataGlobalConstants::ResourceType::OnSiteWater: + case DataGlobalConstants::ResourceType::MainsWater: + case DataGlobalConstants::ResourceType::RainWater: + case DataGlobalConstants::ResourceType::WellWater: + case DataGlobalConstants::ResourceType::Condensate: + CashFlow(cashFlowCounter).Category = costCatWater; + break; + case DataGlobalConstants::ResourceType::Electricity: + case DataGlobalConstants::ResourceType::Natural_Gas: + case DataGlobalConstants::ResourceType::Gasoline: + case DataGlobalConstants::ResourceType::Diesel: + case DataGlobalConstants::ResourceType::Coal: + case DataGlobalConstants::ResourceType::FuelOil_1: + case DataGlobalConstants::ResourceType::FuelOil_2: + case DataGlobalConstants::ResourceType::Propane: + case DataGlobalConstants::ResourceType::EnergyTransfer: + case DataGlobalConstants::ResourceType::Steam: + case DataGlobalConstants::ResourceType::DistrictCooling: + case DataGlobalConstants::ResourceType::DistrictHeating: + case DataGlobalConstants::ResourceType::ElectricityProduced: + case DataGlobalConstants::ResourceType::ElectricityPurchased: + case DataGlobalConstants::ResourceType::ElectricityNet: + case DataGlobalConstants::ResourceType::SolarWater: + case DataGlobalConstants::ResourceType::SolarAir: + CashFlow(cashFlowCounter).Category = costCatEnergy; + break; + default: + CashFlow(cashFlowCounter).Category = costCatOperation; } - CashFlow(cashFlowCounter).Resource = curResource_iRT; + + CashFlow(cashFlowCounter).Resource = iResource; CashFlow(cashFlowCounter).SourceKind = skResource; - CashFlow(cashFlowCounter).name = GetResourceTypeChar(curResource_iRT); + CashFlow(cashFlowCounter).name = GetResourceTypeChar(iResource); if (cashFlowCounter <= numCashFlow) { // put the monthly energy costs into the cashflow prior to adjustments // energy costs (a.k.a. resource costs) start at the start of service and repeat // until the end of the study total - for (jMonth = 1; jMonth <= 12; ++jMonth) { - CashFlow(cashFlowCounter).mnAmount(monthsBaseToService + jMonth) = resourceCosts(jMonth, iResource); + for (int jMonth = 1; jMonth <= 12; ++jMonth) { + CashFlow(cashFlowCounter).mnAmount(monthsBaseToService + jMonth) = resourceCosts.at(jMonth).at(iResource); } - CashFlow(cashFlowCounter).orginalCost = resourceCostAnnual(iResource); - for (jMonth = monthsBaseToService + 13; jMonth <= lengthStudyTotalMonths; ++jMonth) { + CashFlow(cashFlowCounter).orginalCost = resourceCostAnnual.at(iResource); + for (int jMonth = monthsBaseToService + 13; jMonth <= lengthStudyTotalMonths; ++jMonth) { // use the cost from a year earlier CashFlow(cashFlowCounter).mnAmount(jMonth) = CashFlow(cashFlowCounter).mnAmount(jMonth - 12); } // add in the impact of inflation - for (jMonth = 1; jMonth <= lengthStudyTotalMonths; ++jMonth) { + for (int jMonth = 1; jMonth <= lengthStudyTotalMonths; ++jMonth) { CashFlow(cashFlowCounter).mnAmount(jMonth) *= monthlyInflationFactor(jMonth); } // now factor in adjustments // need to find the correct adjustment to use for the current resource found = 0; for (jAdj = 1; jAdj <= numUseAdjustment; ++jAdj) { - if (UseAdjustment(jAdj).resource == iResource + ResourceTypeInitialOffset) { + if (UseAdjustment(jAdj).resource == iResource) { found = jAdj; break; } @@ -1430,7 +1475,7 @@ namespace EconomicLifeCycleCost { // if any adjustments were found for that resource apply the multiplier if (found != 0) { for (kYear = 1; kYear <= lengthStudyYears; ++kYear) { // if service period is later than base period then this will go too far - for (jMonth = 1; jMonth <= 12; ++jMonth) { + for (int jMonth = 1; jMonth <= 12; ++jMonth) { month = (kYear - 1) * 12 + jMonth; if (month > lengthStudyTotalMonths) break; CashFlow(cashFlowCounter).mnAmount(month) *= UseAdjustment(found).Adjustment(kYear); @@ -1449,13 +1494,13 @@ namespace EconomicLifeCycleCost { for (jCost = countOfCostCat + 1; jCost <= numCashFlow; ++jCost) { curCategory = CashFlow(jCost).Category; if ((curCategory <= countOfCostCat) && (curCategory >= 1)) { - for (jMonth = 1; jMonth <= lengthStudyTotalMonths; ++jMonth) { + for (int jMonth = 1; jMonth <= lengthStudyTotalMonths; ++jMonth) { CashFlow(curCategory).mnAmount(jMonth) += CashFlow(jCost).mnAmount(jMonth); } } } // create total categories - for (jMonth = 1; jMonth <= lengthStudyTotalMonths; ++jMonth) { + for (int jMonth = 1; jMonth <= lengthStudyTotalMonths; ++jMonth) { CashFlow(costCatTotEnergy).mnAmount(jMonth) = CashFlow(costCatEnergy).mnAmount(jMonth); CashFlow(costCatTotOper).mnAmount(jMonth) = CashFlow(costCatMaintenance).mnAmount(jMonth) + CashFlow(costCatRepair).mnAmount(jMonth) + CashFlow(costCatOperation).mnAmount(jMonth) + CashFlow(costCatReplacement).mnAmount(jMonth) + @@ -1471,7 +1516,7 @@ namespace EconomicLifeCycleCost { for (jCost = 1; jCost <= numCashFlow; ++jCost) { for (kYear = 1; kYear <= lengthStudyYears; ++kYear) { annualCost = 0.0; - for (jMonth = 1; jMonth <= 12; ++jMonth) { + for (int jMonth = 1; jMonth <= 12; ++jMonth) { month = (kYear - 1) * 12 + jMonth; if (month <= lengthStudyTotalMonths) { annualCost += CashFlow(jCost).mnAmount(month); @@ -1482,8 +1527,8 @@ namespace EconomicLifeCycleCost { } // generate a warning if resource referenced was not used for (int nUsePriceEsc = 1; nUsePriceEsc <= numUsePriceEscalation; ++nUsePriceEsc) { - int curResource = UsePriceEscalation(nUsePriceEsc).resource - ResourceTypeInitialOffset; - if (!resourceCostNotZero(curResource) && DataGlobals::DoWeathSim) { + auto curResource = UsePriceEscalation(nUsePriceEsc).resource; + if (!resourceCostNotZero.at(curResource) && DataGlobals::DoWeathSim) { ShowWarningError("The resource referenced by LifeCycleCost:UsePriceEscalation= \"" + UsePriceEscalation(nUsePriceEsc).name + "\" has no energy cost. "); ShowContinueError("... It is likely that the wrong resource is used. The resource should match the meter used in Utility:Tariff."); @@ -1494,41 +1539,39 @@ namespace EconomicLifeCycleCost { void ComputeEscalatedEnergyCosts() { // J. Glazer - August 2019 - int curResource; int nUsePriceEsc; for (int iCashFlow = 1; iCashFlow <= numCashFlow; ++iCashFlow) { if (CashFlow(iCashFlow).pvKind == pvkEnergy) { // make sure this is not water - int curResource_iRT = CashFlow(iCashFlow).Resource; - if (CashFlow(iCashFlow).Resource == iRT_Water || - (CashFlow(iCashFlow).Resource >= iRT_OnSiteWater && CashFlow(iCashFlow).Resource <= iRT_Condensate)) { + auto curResource = CashFlow(iCashFlow).Resource; + if (CashFlow(iCashFlow).Resource == DataGlobalConstants::ResourceType::Water || + (CashFlow(iCashFlow).Resource >= DataGlobalConstants::ResourceType::OnSiteWater && CashFlow(iCashFlow).Resource <= DataGlobalConstants::ResourceType::Condensate)) { continue; } - curResource = curResource_iRT - ResourceTypeInitialOffset; - if ((curResource >= 1) && (curResource < NumOfResourceTypes)) { + if ((curResource != DataGlobalConstants::ResourceType::None)) { int found = 0; for (nUsePriceEsc = 1; nUsePriceEsc <= numUsePriceEscalation; ++nUsePriceEsc) { - if (UsePriceEscalation(nUsePriceEsc).resource - ResourceTypeInitialOffset == curResource) { + if (UsePriceEscalation(nUsePriceEsc).resource == curResource) { found = nUsePriceEsc; break; } } if (found > 0) { for (int jYear = 1; jYear <= lengthStudyYears; ++jYear) { - EscalatedEnergy(jYear, curResource) = CashFlow(iCashFlow).yrAmount(jYear) * UsePriceEscalation(found).Escalation(jYear); + EscalatedEnergy.at(jYear).at(curResource) = CashFlow(iCashFlow).yrAmount(jYear) * UsePriceEscalation(found).Escalation(jYear); } } else { // if no escalation than just store the original energy cost for (int jYear = 1; jYear <= lengthStudyYears; ++jYear) { - EscalatedEnergy(jYear, curResource) = CashFlow(iCashFlow).yrAmount(jYear); + EscalatedEnergy.at(jYear).at(curResource) = CashFlow(iCashFlow).yrAmount(jYear); } } } } } - for (int kResource = 1; kResource <= NumOfResourceTypes; ++kResource) { + for (auto kResource : DataGlobalConstants::AllResourceTypes) { for (int jYear = 1; jYear <= lengthStudyYears; ++jYear) { - EscalatedTotEnergy(jYear) += EscalatedEnergy(jYear, kResource); + EscalatedTotEnergy(jYear) += EscalatedEnergy.at(jYear).at(kResource); } } } @@ -1567,11 +1610,9 @@ namespace EconomicLifeCycleCost { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: Real64 totalPV; int curCategory; - int curResource; Real64 curDiscountRate; int iCashFlow; int jYear; - int kResource; int nUsePriceEsc; Real64 effectiveYear; @@ -1581,7 +1622,7 @@ namespace EconomicLifeCycleCost { auto const SELECT_CASE_var(CashFlow(iCashFlow).SourceKind); if (SELECT_CASE_var == skResource) { // only for real fuels purchased such as electricity, natural gas, etc.. - if ((CashFlow(iCashFlow).Resource >= iRT_Electricity) && (CashFlow(iCashFlow).Resource <= iRT_ElectricitySurplusSold)) { + if ((CashFlow(iCashFlow).Resource >= DataGlobalConstants::ResourceType::Electricity) && (CashFlow(iCashFlow).Resource <= DataGlobalConstants::ResourceType::ElectricitySurplusSold)) { CashFlow(iCashFlow).pvKind = pvkEnergy; } else { CashFlow(iCashFlow).pvKind = pvkNonEnergy; @@ -1601,7 +1642,14 @@ namespace EconomicLifeCycleCost { } // compute the Single Present Value factors based on the discount rate SPV.allocate(lengthStudyYears); - energySPV.allocate(lengthStudyYears, NumOfResourceTypes); + for (int year = 1; year <= lengthStudyYears; ++lengthStudyYears) { + std::map yearMap; + for (auto iResource : DataGlobalConstants::AllResourceTypes) { + yearMap.insert(std::pair (iResource, 0.0)); + } + energySPV.insert(std::pair>(year, yearMap)); + } + // Depending if using Constant or Current Dollar analysis // use the appropriate discount rate if (inflationApproach == inflAppConstantDollar) { @@ -1627,14 +1675,14 @@ namespace EconomicLifeCycleCost { } // use SPV as default values for all energy types for (jYear = 1; jYear <= lengthStudyYears; ++jYear) { - for (kResource = 1; kResource <= NumOfResourceTypes; ++kResource) { - energySPV(jYear, kResource) = SPV(jYear); + for (auto kResource : DataGlobalConstants::AllResourceTypes) { + energySPV.at(jYear).at(kResource) = SPV(jYear); } } // loop through the resources and if they match a UseEscalation use those values instead for (nUsePriceEsc = 1; nUsePriceEsc <= numUsePriceEscalation; ++nUsePriceEsc) { - curResource = UsePriceEscalation(nUsePriceEsc).resource - ResourceTypeInitialOffset; - if ((curResource >= 1) && (curResource < NumOfResourceTypes)) { + auto curResource = UsePriceEscalation(nUsePriceEsc).resource; + if (curResource != DataGlobalConstants::ResourceType::None) { for (jYear = 1; jYear <= lengthStudyYears; ++jYear) { // the following is based on UPV* formula from NIST 135 supplement but is for a single year { @@ -1648,7 +1696,7 @@ namespace EconomicLifeCycleCost { } else { } } - energySPV(jYear, curResource) = + energySPV.at(jYear).at(curResource) = UsePriceEscalation(nUsePriceEsc).Escalation(jYear) / std::pow(1.0 + curDiscountRate, effectiveYear); } } @@ -1664,11 +1712,11 @@ namespace EconomicLifeCycleCost { } CashFlow(iCashFlow).presentValue = totalPV; } else if (SELECT_CASE_var == pvkEnergy) { - curResource = CashFlow(iCashFlow).Resource - ResourceTypeInitialOffset; - if ((curResource >= 1) && (curResource < NumOfResourceTypes)) { + auto curResource = CashFlow(iCashFlow).Resource; + if (curResource != DataGlobalConstants::ResourceType::None) { totalPV = 0.0; for (jYear = 1; jYear <= lengthStudyYears; ++jYear) { - CashFlow(iCashFlow).yrPresVal(jYear) = CashFlow(iCashFlow).yrAmount(jYear) * energySPV(jYear, curResource); + CashFlow(iCashFlow).yrPresVal(jYear) = CashFlow(iCashFlow).yrAmount(jYear) * energySPV.at(jYear).at(curResource); totalPV += CashFlow(iCashFlow).yrPresVal(jYear); } CashFlow(iCashFlow).presentValue = totalPV; @@ -2357,10 +2405,10 @@ namespace EconomicLifeCycleCost { for (int jObj = 1; jObj <= numResourcesUsed; ++jObj) { curCashFlow = countOfCostCat + numRecurringCosts + numNonrecurringCost + jObj; columnHead(jObj) = CashFlow(curCashFlow).name; - int curResource = CashFlow(curCashFlow).Resource - ResourceTypeInitialOffset; - if (CashFlow(curCashFlow).Resource != iRT_Water) { + auto curResource = CashFlow(curCashFlow).Resource; + if (CashFlow(curCashFlow).Resource != DataGlobalConstants::ResourceType::Water) { for (iYear = 1; iYear <= lengthStudyYears; ++iYear) { - tableBody(jObj, iYear) = RealToStr(EscalatedEnergy(iYear, curResource), 2); + tableBody(jObj, iYear) = RealToStr(EscalatedEnergy.at(iYear).at(curResource), 2); } } else { // for water just use the original cashflow since not involved in escalation for (iYear = 1; iYear <= lengthStudyYears; ++iYear) { @@ -2890,7 +2938,6 @@ namespace EconomicLifeCycleCost { numCashFlow = 0; numResourcesUsed = 0; SPV.deallocate(); - energySPV.deallocate(); DepreciatedCapital.deallocate(); TaxableIncome.deallocate(); Taxes.deallocate(); diff --git a/src/EnergyPlus/EconomicLifeCycleCost.hh b/src/EnergyPlus/EconomicLifeCycleCost.hh index e89c91506d6..48e39f36b69 100644 --- a/src/EnergyPlus/EconomicLifeCycleCost.hh +++ b/src/EnergyPlus/EconomicLifeCycleCost.hh @@ -48,12 +48,16 @@ #ifndef EconomicLifeCycleCost_hh_INCLUDED #define EconomicLifeCycleCost_hh_INCLUDED +// C++ Headers +#include + // ObjexxFCL Headers #include #include // EnergyPlus Headers #include +#include #include namespace EnergyPlus { @@ -159,7 +163,6 @@ namespace EconomicLifeCycleCost { // present value factors extern Array1D SPV; - extern Array2D energySPV; // yearly equivalent to FEMP UPV* values // arrays related to computing after tax cashflow and present value extern Array1D DepreciatedCapital; @@ -172,7 +175,7 @@ namespace EconomicLifeCycleCost { // arrays related to escalated energy costs extern Array1D EscalatedTotEnergy; - extern Array2D EscalatedEnergy; + extern std::map> EscalatedEnergy; // SUBROUTINE SPECIFICATIONS FOR MODULE : @@ -225,14 +228,14 @@ namespace EconomicLifeCycleCost { { // Members std::string name; // Name - int resource; // resource like electricity or natural gas (uses definitions from DataGlobalConstants) + DataGlobalConstants::ResourceType resource; // resource like electricity or natural gas (uses definitions from DataGlobalConstants) int escalationStartYear; // Escalation Start Year 1900-2100 int escalationStartMonth; // Escalation Start Month 1 to 12 Array1D Escalation; // Escalation by year, first year is baseDateYear // last year is baseDateYear + lengthStudyYears - 1 // Default Constructor - UsePriceEscalationType() : resource(0), escalationStartYear(0), escalationStartMonth(0) + UsePriceEscalationType() : resource(DataGlobalConstants::ResourceType::Unknown), escalationStartYear(0), escalationStartMonth(0) { } }; @@ -241,12 +244,12 @@ namespace EconomicLifeCycleCost { { // Members std::string name; // Name - int resource; // resource like electricity or natural gas (uses definitions from DataGlobalConstants) + DataGlobalConstants::ResourceType resource; // resource like electricity or natural gas (uses definitions from DataGlobalConstants) Array1D Adjustment; // Adjustment by year, first year is baseDateYear // last year is baseDateYear + lengthStudyYears - 1 // Default Constructor - UseAdjustmentType() : resource(0) + UseAdjustmentType() : resource(DataGlobalConstants::ResourceType::Unknown) { } }; @@ -256,7 +259,7 @@ namespace EconomicLifeCycleCost { // Members std::string name; // Name - just for labeling output - use Category for aggregation int SourceKind; // 1=recurring, 2=nonrecurring, 3=resource - int Resource; // resource like electricity or natural gas (uses definitions from DataGlobalConstants) + DataGlobalConstants::ResourceType Resource; // resource like electricity or natural gas (uses definitions from DataGlobalConstants) int Category; // uses "costCat" constants above Array1D mnAmount; // cashflow dollar amount by month, first year is baseDateYear // last year is baseDateYear + lengthStudyYears - 1 @@ -267,7 +270,7 @@ namespace EconomicLifeCycleCost { Array1D yrPresVal; // present value by year, first year is baseDateYear // Default Constructor - CashFlowType() : SourceKind(0), Resource(0), Category(0), pvKind(0), presentValue(0.), orginalCost(0.) + CashFlowType() : SourceKind(0), Resource(DataGlobalConstants::ResourceType::Unknown), Category(0), pvKind(0), presentValue(0.), orginalCost(0.) { } }; diff --git a/src/EnergyPlus/EconomicTariff.cc b/src/EnergyPlus/EconomicTariff.cc index ba3fe13a929..63dadd0d58a 100644 --- a/src/EnergyPlus/EconomicTariff.cc +++ b/src/EnergyPlus/EconomicTariff.cc @@ -5017,7 +5017,7 @@ namespace EconomicTariff { MinTariffIndex.deallocate(); } - void GetMonthlyCostForResource(int const inResourceNumber, Array1A outMonthlyCosts) + void GetMonthlyCostForResource(DataGlobalConstants::ResourceType const inResourceNumber, Array1A outMonthlyCosts) { // AUTHOR Jason Glazer // DATE WRITTEN May 2010 diff --git a/src/EnergyPlus/EconomicTariff.hh b/src/EnergyPlus/EconomicTariff.hh index 65ca307e9e6..82471277af1 100644 --- a/src/EnergyPlus/EconomicTariff.hh +++ b/src/EnergyPlus/EconomicTariff.hh @@ -309,9 +309,9 @@ namespace EconomicTariff { std::string reportMeter; // name of the report meter int reportMeterIndx; // index of the report meter int kindElectricMtr; // kind of electric meter - see enumerated list above, 0 is not electric - int kindWaterMtr; // kinf of water meter - 0 (default) is not water, 1 is water - int kindGasMtr; // kinf of gas meter - 0 (default) is not gas, 1 is gas - int resourceNum; // based on list of DataGlobalConstants + int kindWaterMtr; // kind of water meter - 0 (default) is not water, 1 is water + int kindGasMtr; // kind of gas meter - 0 (default) is not gas, 1 is gas + DataGlobalConstants::ResourceType resourceNum; // based on list of DataGlobalConstants int convChoice; // enumerated choice index of the conversion factor Real64 energyConv; // energy conversion factor Real64 demandConv; // demand conversion factor @@ -414,7 +414,8 @@ namespace EconomicTariff { // Default Constructor TariffType() - : reportMeterIndx(0), kindElectricMtr(0), kindWaterMtr(0), kindGasMtr(0), resourceNum(0), convChoice(0), energyConv(0.0), demandConv(0.0), + : reportMeterIndx(0), kindElectricMtr(0), kindWaterMtr(0), kindGasMtr(0), resourceNum(DataGlobalConstants::ResourceType::Unknown), + convChoice(0), energyConv(0.0), demandConv(0.0), periodSchIndex(0), seasonSchIndex(0), monthSchIndex(0), demandWindow(0), demWinTime(0.0), monthChgVal(0.0), monthChgPt(0), minMonthChgVal(0.0), minMonthChgPt(0), chargeSchIndex(0), baseUseSchIndex(0), buyOrSell(0), firstCategory(0), lastCategory(0), ptEnergyCharges(0), ptDemandCharges(0), ptServiceCharges(0), ptBasis(0), ptAdjustment(0), ptSurcharge(0), ptSubtotal(0), ptTaxes(0), @@ -680,7 +681,7 @@ namespace EconomicTariff { void selectTariff(); - void GetMonthlyCostForResource(int const inResourceNumber, Array1A outMonthlyCosts); + void GetMonthlyCostForResource(DataGlobalConstants::ResourceType const inResourceNumber, Array1A outMonthlyCosts); void clear_state(); diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index 3db2e0bcd26..e827a4e6f76 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -2464,7 +2464,7 @@ namespace HVACVariableRefrigerantFlow { VRF(VRFNum).VRFSystemTypeNum = VRF_HeatPump; VRF(VRFNum).VRFAlgorithmTypeNum = AlgorithmTypeFluidTCtrl; VRF(VRFNum).FuelType = "Electricity"; - VRF(VRFNum).FuelTypeNum = DataGlobalConstants::iRT_Electricity; + VRF(VRFNum).FuelTypeNum = DataGlobalConstants::ResourceType::Electricity; if (lAlphaFieldBlanks(2)) { VRF(VRFNum).SchedPtr = ScheduleAlwaysOn; @@ -2828,7 +2828,7 @@ namespace HVACVariableRefrigerantFlow { VRF(VRFNum).VRFSystemTypeNum = VRF_HeatPump; VRF(VRFNum).VRFAlgorithmTypeNum = AlgorithmTypeFluidTCtrl; VRF(VRFNum).FuelType = "Electricity"; - VRF(VRFNum).FuelTypeNum = DataGlobalConstants::iRT_Electricity; + VRF(VRFNum).FuelTypeNum = DataGlobalConstants::ResourceType::Electricity; if (lAlphaFieldBlanks(2)) { VRF(VRFNum).SchedPtr = ScheduleAlwaysOn; @@ -4863,7 +4863,7 @@ namespace HVACVariableRefrigerantFlow { } if (VRF(NumCond).DefrostStrategy == Resistive || - (VRF(NumCond).DefrostStrategy == ReverseCycle && VRF(NumCond).FuelTypeNum == DataGlobalConstants::iRT_Electricity)) { + (VRF(NumCond).DefrostStrategy == ReverseCycle && VRF(NumCond).FuelTypeNum == DataGlobalConstants::ResourceType::Electricity)) { SetupOutputVariable(state, "VRF Heat Pump Defrost Electricity Rate", OutputProcessor::Unit::W, VRF(NumCond).DefrostPower, diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.hh b/src/EnergyPlus/HVACVariableRefrigerantFlow.hh index a7f2b40be17..b2150a236dd 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.hh +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.hh @@ -257,7 +257,7 @@ namespace HVACVariableRefrigerantFlow { int CoolingMaxTempLimitIndex; // Warning message recurring error index int HeatingMaxTempLimitIndex; // Warning message recurring error index std::string FuelType; // Fuel type - int FuelTypeNum; // Fuel type number + DataGlobalConstants::ResourceType FuelTypeNum; // Fuel type number Real64 SUMultiplier; // exponential timer for mode changes Real64 TUCoolingLoad; // total TU cooling load for each VRF system Real64 TUHeatingLoad; // total TU heating load for each VRF system @@ -404,7 +404,8 @@ namespace HVACVariableRefrigerantFlow { EvapCondEffectiveness(0.0), EvapCondAirVolFlowRate(0.0), EvapCondPumpPower(0.0), CoolCombRatioPTR(0), HeatCombRatioPTR(0), OperatingMode(0), ElecPower(0.0), ElecCoolingPower(0.0), ElecHeatingPower(0.0), CoolElecConsumption(0.0), HeatElecConsumption(0.0), CrankCaseHeaterPower(0.0), CrankCaseHeaterElecConsumption(0.0), EvapCondPumpElecPower(0.0), EvapCondPumpElecConsumption(0.0), - EvapWaterConsumpRate(0.0), HRMaxTempLimitIndex(0), CoolingMaxTempLimitIndex(0), HeatingMaxTempLimitIndex(0), FuelTypeNum(0), + EvapWaterConsumpRate(0.0), HRMaxTempLimitIndex(0), CoolingMaxTempLimitIndex(0), HeatingMaxTempLimitIndex(0), + FuelTypeNum(DataGlobalConstants::ResourceType::Unknown), SUMultiplier(0.0), TUCoolingLoad(0.0), TUHeatingLoad(0.0), SwitchedMode(false), OperatingCOP(0.0), MinOATHeatRecovery(0.0), MaxOATHeatRecovery(0.0), HRCAPFTCool(0), HRCAPFTCoolConst(0.9), HRInitialCoolCapFrac(0.5), HRCoolCapTC(0.15), HREIRFTCool(0), HREIRFTCoolConst(1.1), HRInitialCoolEIRFrac(1.0), HRCoolEIRTC(0.0), HRCAPFTHeat(0), HRCAPFTHeatConst(1.1), HRInitialHeatCapFrac(1.0), diff --git a/src/EnergyPlus/HeatingCoils.cc b/src/EnergyPlus/HeatingCoils.cc index 0f29c493416..d005e73e162 100644 --- a/src/EnergyPlus/HeatingCoils.cc +++ b/src/EnergyPlus/HeatingCoils.cc @@ -413,7 +413,7 @@ namespace HeatingCoils { CoilNum = ElecCoilNum; CurrentModuleObject = "Coil:Heating:Electric"; - HeatingCoil(CoilNum).FuelType_Num = iRT_Electricity; + HeatingCoil(CoilNum).FuelType_Num = DataGlobalConstants::ResourceType::Electricity; inputProcessor->getObjectItem(state, CurrentModuleObject, @@ -516,7 +516,7 @@ namespace HeatingCoils { CoilNum = NumElecCoil + ElecCoilNum; CurrentModuleObject = "Coil:Heating:Electric:MultiStage"; - HeatingCoil(CoilNum).FuelType_Num = iRT_Electricity; + HeatingCoil(CoilNum).FuelType_Num = DataGlobalConstants::ResourceType::Electricity; inputProcessor->getObjectItem(state, CurrentModuleObject, @@ -666,10 +666,10 @@ namespace HeatingCoils { coil.HCoilType_Num = Coil_HeatingGasOrOtherFuel; coil.FuelType_Num = AssignResourceTypeNum(Alphas(3)); - if (!(coil.FuelType_Num == iRT_Natural_Gas || coil.FuelType_Num == iRT_Propane || coil.FuelType_Num == iRT_Diesel || - coil.FuelType_Num == iRT_Gasoline || coil.FuelType_Num == iRT_FuelOil_1 || coil.FuelType_Num == iRT_FuelOil_2 || - coil.FuelType_Num == iRT_OtherFuel1 || coil.FuelType_Num == iRT_OtherFuel2 || coil.FuelType_Num == iRT_Coal) || - coil.FuelType_Num == 0) { + if (!(coil.FuelType_Num == DataGlobalConstants::ResourceType::Natural_Gas || coil.FuelType_Num == DataGlobalConstants::ResourceType::Propane || coil.FuelType_Num == DataGlobalConstants::ResourceType::Diesel || + coil.FuelType_Num == DataGlobalConstants::ResourceType::Gasoline || coil.FuelType_Num == DataGlobalConstants::ResourceType::FuelOil_1 || coil.FuelType_Num == DataGlobalConstants::ResourceType::FuelOil_2 || + coil.FuelType_Num == DataGlobalConstants::ResourceType::OtherFuel1 || coil.FuelType_Num == DataGlobalConstants::ResourceType::OtherFuel2 || coil.FuelType_Num == DataGlobalConstants::ResourceType::Coal) || + coil.FuelType_Num == DataGlobalConstants::ResourceType::None) { ShowSevereError(RoutineName + CurrentModuleObject + ": Invalid " + cAlphaFields(3) + " entered =" + Alphas(3) + " for " + cAlphaFields(1) + '=' + Alphas(1)); InputErrorsFound = true; @@ -763,7 +763,7 @@ namespace HeatingCoils { CoilNum = NumElecCoil + NumElecCoilMultiStage + NumFuelCoil + FuelCoilNum; CurrentModuleObject = "Coil:Heating:Gas:MultiStage"; - HeatingCoil(CoilNum).FuelType_Num = iRT_Natural_Gas; + HeatingCoil(CoilNum).FuelType_Num = DataGlobalConstants::ResourceType::Natural_Gas; inputProcessor->getObjectItem(state, CurrentModuleObject, @@ -924,7 +924,7 @@ namespace HeatingCoils { CoilNum = NumElecCoil + NumElecCoilMultiStage + NumFuelCoil + NumGasCoilMultiStage + DesuperheaterCoilNum; CurrentModuleObject = "Coil:Heating:Desuperheater"; - HeatingCoil(CoilNum).FuelType_Num = iRT_Electricity; + HeatingCoil(CoilNum).FuelType_Num = DataGlobalConstants::ResourceType::Electricity; inputProcessor->getObjectItem(state, CurrentModuleObject, diff --git a/src/EnergyPlus/HeatingCoils.hh b/src/EnergyPlus/HeatingCoils.hh index a99200e6c22..631f62a439d 100644 --- a/src/EnergyPlus/HeatingCoils.hh +++ b/src/EnergyPlus/HeatingCoils.hh @@ -116,7 +116,7 @@ namespace HeatingCoils { std::string HeatingCoilType; // Type of HeatingCoil ie. Heating or Cooling std::string HeatingCoilModel; // Type of HeatingCoil ie. Simple, Detailed, etc. int HCoilType_Num; - int FuelType_Num; // Type of fuel used, reference resource type integers + DataGlobalConstants::ResourceType FuelType_Num; // Type of fuel used, reference resource type integers std::string Schedule; // HeatingCoil Operation Schedule int SchedPtr; // Pointer to the correct schedule int InsuffTemperatureWarn; // Used for recurring error message @@ -176,7 +176,8 @@ namespace HeatingCoils { int AirLoopNum; // Airloop number // Default Constructor HeatingCoilEquipConditions() - : HCoilType_Num(0), FuelType_Num(0), SchedPtr(0), InsuffTemperatureWarn(0), InletAirMassFlowRate(0.0), OutletAirMassFlowRate(0.0), + : HCoilType_Num(0), FuelType_Num(DataGlobalConstants::ResourceType::Unknown), SchedPtr(0), InsuffTemperatureWarn(0), + InletAirMassFlowRate(0.0), OutletAirMassFlowRate(0.0), InletAirTemp(0.0), OutletAirTemp(0.0), InletAirHumRat(0.0), OutletAirHumRat(0.0), InletAirEnthalpy(0.0), OutletAirEnthalpy(0.0), HeatingCoilLoad(0.0), HeatingCoilRate(0.0), FuelUseLoad(0.0), ElecUseLoad(0.0), FuelUseRate(0.0), ElecUseRate(0.0), Efficiency(0.0), NominalCapacity(0.0), DesiredOutletTemp(0.0), DesiredOutletHumRat(0.0), AvailTemperature(0.0), AirInletNodeNum(0), AirOutletNodeNum(0), diff --git a/src/EnergyPlus/OutputProcessor.cc b/src/EnergyPlus/OutputProcessor.cc index c269a1cb6fa..1f64cc8ebdd 100644 --- a/src/EnergyPlus/OutputProcessor.cc +++ b/src/EnergyPlus/OutputProcessor.cc @@ -51,9 +51,7 @@ #include #include #include -#include #include -#include #include #include @@ -65,11 +63,9 @@ // EnergyPlus Headers #include "re2/re2.h" -#include #include #include #include -#include #include #include #include @@ -7966,7 +7962,7 @@ void GetMeteredVariables(std::string const &ComponentType, Array1D_int &VarTypes, // Variable Types (1=integer, 2=real, 3=meter) Array1D &TimeStepTypes, // Variable Index Types (1=Zone,2=HVAC) Array1D &unitsForVar, // units from enum for each variable - Array1D_int &ResourceTypes, // ResourceTypes for each variable + std::map &ResourceTypes, // ResourceTypes for each variable Array1D_string &EndUses, // EndUses for each variable Array1D_string &Groups, // Groups for each variable Array1D_string &Names, // Variable Names for each variable @@ -8012,7 +8008,7 @@ void GetMeteredVariables(std::string const &ComponentType, TimeStepTypes(NumVariables) = RVariableTypes(Loop).timeStepType; unitsForVar(NumVariables) = RVariableTypes(Loop).units; - ResourceTypes(NumVariables) = AssignResourceTypeNum(UtilityRoutines::MakeUPPERCase(EnergyMeters(MeterPtr).ResourceType)); + ResourceTypes.at(NumVariables) = AssignResourceTypeNum(UtilityRoutines::MakeUPPERCase(EnergyMeters(MeterPtr).ResourceType)); Names(NumVariables) = RVariableTypes(Loop).VarNameUC; @@ -8046,7 +8042,7 @@ void GetMeteredVariables(std::string const &ComponentType, Array1D_int &VarTypes, // Variable Types (1=integer, 2=real, 3=meter) Array1D &TimeStepTypes, // Variable Index Types (1=Zone,2=HVAC) Array1D &unitsForVar, // units from enum for each variable - Array1D_int &ResourceTypes, // ResourceTypes for each variable + std::map &ResourceTypes, // ResourceTypes for each variable Array1D_string &EndUses, // EndUses for each variable Array1D_string &Groups, // Groups for each variable Array1D_string &Names, // Variable Names for each variable @@ -8092,7 +8088,7 @@ void GetMeteredVariables(std::string const &ComponentType, TimeStepTypes(NumVariables) = RVariableTypes(Loop).timeStepType; unitsForVar(NumVariables) = RVariableTypes(Loop).units; - ResourceTypes(NumVariables) = AssignResourceTypeNum(UtilityRoutines::MakeUPPERCase(EnergyMeters(MeterPtr).ResourceType)); + ResourceTypes.at(NumVariables) = AssignResourceTypeNum(UtilityRoutines::MakeUPPERCase(EnergyMeters(MeterPtr).ResourceType)); Names(NumVariables) = RVariableTypes(Loop).VarNameUC; for (MeterNum = 1; MeterNum <= NumOnMeterPtr; ++MeterNum) { diff --git a/src/EnergyPlus/OutputProcessor.hh b/src/EnergyPlus/OutputProcessor.hh index d359a68afe9..e6bc7dd1fef 100644 --- a/src/EnergyPlus/OutputProcessor.hh +++ b/src/EnergyPlus/OutputProcessor.hh @@ -1013,7 +1013,7 @@ void GetMeteredVariables(std::string const &ComponentType, Array1D_int &VarTypes, // Variable Types (1=integer, 2=real, 3=meter) Array1D &TimeStepTypes, // Variable Index Types (1=Zone,2=HVAC), Array1D &unitsForVar, // units from enum for each variable - Array1D_int &ResourceTypes, // ResourceTypes for each variable + std::map &ResourceTypes, // ResourceTypes for each variable Array1D_string &EndUses, // EndUses for each variable Array1D_string &Groups, // Groups for each variable Array1D_string &Names, // Variable Names for each variable @@ -1026,7 +1026,7 @@ void GetMeteredVariables(std::string const &ComponentType, Array1D_int &VarTypes, // Variable Types (1=integer, 2=real, 3=meter) Array1D &TimeStepTypes, // Variable Index Types (1=Zone,2=HVAC), Array1D &unitsForVar, // units from enum for each variable - Array1D_int &ResourceTypes, // ResourceTypes for each variable + std::map &ResourceTypes, // ResourceTypes for each variable Array1D_string &EndUses, // EndUses for each variable Array1D_string &Groups, // Groups for each variable Array1D_string &Names, // Variable Names for each variable diff --git a/src/EnergyPlus/OutputReportTabular.cc b/src/EnergyPlus/OutputReportTabular.cc index f11d4b0f9e4..2cb5e1749dc 100644 --- a/src/EnergyPlus/OutputReportTabular.cc +++ b/src/EnergyPlus/OutputReportTabular.cc @@ -4975,7 +4975,7 @@ namespace OutputReportTabular { SysTotalHVACRejectHeatLoss += DXCoil(iCoil).EvapCondPumpElecConsumption + DXCoil(iCoil).BasinHeaterConsumption + DXCoil(iCoil).EvapWaterConsump * RhoWater * H2OHtOfVap_HVAC; } - if (DXCoil(iCoil).FuelTypeNum != DataGlobalConstants::iRT_Electricity) { + if (DXCoil(iCoil).FuelTypeNum != DataGlobalConstants::ResourceType::Electricity) { SysTotalHVACRejectHeatLoss += DXCoil(iCoil).MSFuelWasteHeat * TimeStepSysSec; } } else if (DXCoil(iCoil).DXCoilType_Num == DataHVACGlobals::CoilDX_HeatingEmpirical || diff --git a/src/EnergyPlus/Plant/MeterData.hh b/src/EnergyPlus/Plant/MeterData.hh index 94c8225b723..abe88e98507 100644 --- a/src/EnergyPlus/Plant/MeterData.hh +++ b/src/EnergyPlus/Plant/MeterData.hh @@ -58,7 +58,7 @@ namespace DataPlant { // Members std::string ReportVarName; OutputProcessor::Unit ReportVarUnits; - int ResourceType; + DataGlobalConstants::ResourceType ResourceType; std::string EndUse; int EndUse_CompMode; std::string Group; @@ -69,7 +69,7 @@ namespace DataPlant { // Default Constructor MeterData() - : ReportVarUnits(OutputProcessor::Unit::None), ResourceType(0), EndUse_CompMode(0), ReportVarIndex(0), + : ReportVarUnits(OutputProcessor::Unit::None), ResourceType(DataGlobalConstants::ResourceType::Unknown), EndUse_CompMode(0), ReportVarIndex(0), ReportVarIndexType(OutputProcessor::TimeStepType::TimeStepZone), ReportVarType(0), CurMeterReading(0.0) { } diff --git a/src/EnergyPlus/SetPointManager.cc b/src/EnergyPlus/SetPointManager.cc index 80212069447..4e5632de2bb 100644 --- a/src/EnergyPlus/SetPointManager.cc +++ b/src/EnergyPlus/SetPointManager.cc @@ -7855,7 +7855,7 @@ namespace SetPointManager { Array1D_int VarTypes; // Variable Types (1=integer, 2=real, 3=meter) Array1D IndexTypes; // Variable Index Types (1=Zone,2=HVAC) Array1D unitsForVar; // units from enum for each variable - Array1D_int ResourceTypes; // ResourceTypes for each variable + std::map ResourceTypes; // ResourceTypes for each variable Array1D_string EndUses; // EndUses for each variable Array1D_string Groups; // Groups for each variable Array1D_string Names; // Variable Names for each variable @@ -7881,7 +7881,11 @@ namespace SetPointManager { VarTypes.allocate(NumVariables); IndexTypes.allocate(NumVariables); unitsForVar.allocate(NumVariables); - ResourceTypes.allocate(NumVariables); + + for (int varN = 1; varN <= NumVariables; ++varN) { + ResourceTypes.insert(std::pair(varN, DataGlobalConstants::ResourceType::None)); + } + EndUses.allocate(NumVariables); Groups.allocate(NumVariables); Names.allocate(NumVariables); @@ -7897,7 +7901,12 @@ namespace SetPointManager { VarTypes.allocate(NumVariables); IndexTypes.allocate(NumVariables); unitsForVar.allocate(NumVariables); - ResourceTypes.allocate(NumVariables); + + ResourceTypes.clear(); + for (int varN = 1; varN <= NumVariables; ++varN) { + ResourceTypes.insert(std::pair(varN, DataGlobalConstants::ResourceType::None)); + } + EndUses.allocate(NumVariables); Groups.allocate(NumVariables); Names.allocate(NumVariables); @@ -7914,7 +7923,12 @@ namespace SetPointManager { VarTypes.allocate(NumVariables); IndexTypes.allocate(NumVariables); unitsForVar.allocate(NumVariables); - ResourceTypes.allocate(NumVariables); + + ResourceTypes.clear(); + for (int varN = 1; varN <= NumVariables; ++varN) { + ResourceTypes.insert(std::pair(varN, DataGlobalConstants::ResourceType::None)); + } + EndUses.allocate(NumVariables); Groups.allocate(NumVariables); Names.allocate(NumVariables); @@ -7932,7 +7946,12 @@ namespace SetPointManager { VarTypes.allocate(NumVariables); IndexTypes.allocate(NumVariables); unitsForVar.allocate(NumVariables); - ResourceTypes.allocate(NumVariables); + + ResourceTypes.clear(); + for (int varN = 1; varN <= NumVariables; ++varN) { + ResourceTypes.insert(std::pair(varN, DataGlobalConstants::ResourceType::None)); + } + EndUses.allocate(NumVariables); Groups.allocate(NumVariables); Names.allocate(NumVariables); diff --git a/src/EnergyPlus/SimulationManager.cc b/src/EnergyPlus/SimulationManager.cc index 12ab1babc23..45c7b7db208 100644 --- a/src/EnergyPlus/SimulationManager.cc +++ b/src/EnergyPlus/SimulationManager.cc @@ -2987,7 +2987,7 @@ namespace SimulationManager { Array1D_int VarTypes; Array1D unitsForVar; // units from enum for each variable Array1D_string VarNames; - Array1D_int ResourceTypes; + std::map ResourceTypes; Array1D_string EndUses; Array1D_string Groups; @@ -3004,7 +3004,11 @@ namespace SimulationManager { VarTypes.dimension(NumVariables, 0); VarNames.allocate(NumVariables); unitsForVar.allocate(NumVariables); - ResourceTypes.dimension(NumVariables, 0); + + for (int idx = 1; idx <= NumVariables; ++idx) { + ResourceTypes.insert(std::pair(idx, DataGlobalConstants::ResourceType::None)); + } + EndUses.allocate(NumVariables); Groups.allocate(NumVariables); GetMeteredVariables(CompSets(Loop).CType, @@ -3025,7 +3029,7 @@ namespace SimulationManager { VarIDs(Loop1), VarNames(Loop1), unitEnumToString(unitsForVar(Loop1)), - GetResourceTypeChar(ResourceTypes(Loop1)), + GetResourceTypeChar(ResourceTypes.at(Loop1)), EndUses(Loop1), Groups(Loop1) // TODO: Should call OutputProcessor::StandardTimeStepTypeKey(IndexTypes(Loop1)) to return "Zone" or "HVAC" @@ -3038,7 +3042,6 @@ namespace SimulationManager { VarIDs.deallocate(); VarNames.deallocate(); unitsForVar.deallocate(); - ResourceTypes.deallocate(); EndUses.deallocate(); Groups.deallocate(); } diff --git a/src/EnergyPlus/SystemReports.cc b/src/EnergyPlus/SystemReports.cc index 6c27f60cbc8..45bb6d094aa 100644 --- a/src/EnergyPlus/SystemReports.cc +++ b/src/EnergyPlus/SystemReports.cc @@ -487,7 +487,7 @@ namespace SystemReports { AirDistUnitNum = max(AirDistUnitNum, ZoneEquipConfig(CtrlZoneNum).AirDistUnitHeat(ZoneInletNodeNum).AirDistUnitIndex); if (ListNum > 0 && AirDistUnitNum > 0) { for (VarNum = 1; VarNum <= ZoneEquipList(ListNum).EquipData(AirDistUnitNum).NumMeteredVars; ++VarNum) { - if (ZoneEquipList(ListNum).EquipData(AirDistUnitNum).MeteredVar(VarNum).ResourceType == iRT_EnergyTransfer) { + if (ZoneEquipList(ListNum).EquipData(AirDistUnitNum).MeteredVar(VarNum).ResourceType == DataGlobalConstants::ResourceType::EnergyTransfer) { ZoneEquipList(ListNum).EquipData(AirDistUnitNum).EnergyTransComp = EnergyTransfer; CompType = ZoneEquipList(ListNum).EquipData(AirDistUnitNum).TypeOf; CompName = ZoneEquipList(ListNum).EquipData(AirDistUnitNum).Name; @@ -503,7 +503,7 @@ namespace SystemReports { for (VarNum = 1; VarNum <= ZoneEquipList(ListNum).EquipData(AirDistUnitNum).SubEquipData(SubEquipNum).NumMeteredVars; ++VarNum) { if (ZoneEquipList(ListNum).EquipData(AirDistUnitNum).SubEquipData(SubEquipNum).MeteredVar(VarNum).ResourceType == - iRT_EnergyTransfer) { + DataGlobalConstants::ResourceType::EnergyTransfer) { ZoneEquipList(ListNum).EquipData(AirDistUnitNum).SubEquipData(SubEquipNum).EnergyTransComp = EnergyTransfer; CompType = ZoneEquipList(ListNum).EquipData(AirDistUnitNum).SubEquipData(SubEquipNum).TypeOf; CompName = ZoneEquipList(ListNum).EquipData(AirDistUnitNum).SubEquipData(SubEquipNum).Name; @@ -530,7 +530,7 @@ namespace SystemReports { .SubEquipData(SubEquipNum) .SubSubEquipData(SubSubEquipNum) .MeteredVar(VarNum) - .ResourceType == iRT_EnergyTransfer) { + .ResourceType == DataGlobalConstants::ResourceType::EnergyTransfer) { ZoneEquipList(ListNum) .EquipData(AirDistUnitNum) .SubEquipData(SubEquipNum) @@ -2489,7 +2489,7 @@ namespace SystemReports { Array1D_string UnitsStrings; // UnitsStrings for each variable Array1D IndexTypes; // Variable Idx Types (1=Zone,2=HVAC) Array1D unitsForVar; // units from enum for each variable - Array1D_int ResourceTypes; // ResourceTypes for each variable + std::map ResourceTypes; // ResourceTypes for each variable Array1D_string EndUses; // EndUses for each variable Array1D_string Groups; // Groups for each variable Array1D_string Names; // Variable Names for each variable @@ -2630,7 +2630,11 @@ namespace SystemReports { VarTypes.allocate(NumVariables); IndexTypes.allocate(NumVariables); unitsForVar.allocate(NumVariables); - ResourceTypes.allocate(NumVariables); + + for (int idx = 1; idx <= NumVariables; ++idx) { + ResourceTypes.insert(std::pair(idx, DataGlobalConstants::ResourceType::None)); + } + EndUses.allocate(NumVariables); Groups.allocate(NumVariables); Names.allocate(NumVariables); @@ -2657,7 +2661,7 @@ namespace SystemReports { thisVar.ReportVarIndex = VarIndexes(VarNum); thisVar.ReportVarIndexType = IndexTypes(VarNum); thisVar.ReportVarType = VarTypes(VarNum); - thisVar.ResourceType = ResourceTypes(VarNum); + thisVar.ResourceType = ResourceTypes.at(VarNum); thisVar.EndUse = EndUses(VarNum); if (thisVar.EndUse == "HEATINGCOILS" && ModeFlagOn) { for (VarNum1 = 1; VarNum1 <= NumVariables; ++VarNum1) { @@ -2680,7 +2684,6 @@ namespace SystemReports { VarTypes.deallocate(); IndexTypes.deallocate(); unitsForVar.deallocate(); - ResourceTypes.deallocate(); EndUses.deallocate(); Groups.deallocate(); Names.deallocate(); @@ -2695,7 +2698,10 @@ namespace SystemReports { VarTypes.allocate(NumVariables); IndexTypes.allocate(NumVariables); unitsForVar.allocate(NumVariables); - ResourceTypes.allocate(NumVariables); + ResourceTypes.clear(); + for (int idx = 1; idx <= NumVariables; ++idx) { + ResourceTypes.insert(std::pair(idx, DataGlobalConstants::ResourceType::None)); + } EndUses.allocate(NumVariables); Groups.allocate(NumVariables); Names.allocate(NumVariables); @@ -2722,7 +2728,7 @@ namespace SystemReports { thisVar.ReportVarIndex = VarIndexes(VarNum); thisVar.ReportVarIndexType = IndexTypes(VarNum); thisVar.ReportVarType = VarTypes(VarNum); - thisVar.ResourceType = ResourceTypes(VarNum); + thisVar.ResourceType = ResourceTypes.at(VarNum); thisVar.EndUse = EndUses(VarNum); if (thisVar.EndUse == "HEATINGCOILS" && ModeFlagOn) { for (VarNum1 = 1; VarNum1 <= NumVariables; ++VarNum1) { @@ -2745,7 +2751,6 @@ namespace SystemReports { VarTypes.deallocate(); IndexTypes.deallocate(); unitsForVar.deallocate(); - ResourceTypes.deallocate(); EndUses.deallocate(); Groups.deallocate(); Names.deallocate(); @@ -2763,7 +2768,10 @@ namespace SystemReports { VarTypes.allocate(NumVariables); IndexTypes.allocate(NumVariables); unitsForVar.allocate(NumVariables); - ResourceTypes.allocate(NumVariables); + ResourceTypes.clear(); + for (int idx = 1; idx <= NumVariables; ++idx) { + ResourceTypes.insert(std::pair(idx, DataGlobalConstants::ResourceType::None)); + } EndUses.allocate(NumVariables); Groups.allocate(NumVariables); Names.allocate(NumVariables); @@ -2790,7 +2798,7 @@ namespace SystemReports { thisVar.ReportVarIndex = VarIndexes(VarNum); thisVar.ReportVarIndexType = IndexTypes(VarNum); thisVar.ReportVarType = VarTypes(VarNum); - thisVar.ResourceType = ResourceTypes(VarNum); + thisVar.ResourceType = ResourceTypes.at(VarNum); thisVar.EndUse = EndUses(VarNum); if (thisVar.EndUse == "HEATINGCOILS" && ModeFlagOn) { for (VarNum1 = 1; VarNum1 <= NumVariables; ++VarNum1) { @@ -2815,7 +2823,6 @@ namespace SystemReports { VarTypes.deallocate(); IndexTypes.deallocate(); unitsForVar.deallocate(); - ResourceTypes.deallocate(); EndUses.deallocate(); Groups.deallocate(); Names.deallocate(); @@ -2872,7 +2879,10 @@ namespace SystemReports { VarTypes.allocate(NumVariables); IndexTypes.allocate(NumVariables); unitsForVar.allocate(NumVariables); - ResourceTypes.allocate(NumVariables); + ResourceTypes.clear(); + for (int idx = 1; idx <= NumVariables; ++idx) { + ResourceTypes.insert(std::pair(idx, DataGlobalConstants::ResourceType::None)); + } EndUses.allocate(NumVariables); Groups.allocate(NumVariables); Names.allocate(NumVariables); @@ -2890,7 +2900,7 @@ namespace SystemReports { thisVar.ReportVarIndex = VarIndexes(VarNum); thisVar.ReportVarIndexType = IndexTypes(VarNum); thisVar.ReportVarType = VarTypes(VarNum); - thisVar.ResourceType = ResourceTypes(VarNum); + thisVar.ResourceType = ResourceTypes.at(VarNum); thisVar.EndUse = EndUses(VarNum); if (thisVar.EndUse == "HEATINGCOILS" && ModeFlagOn) { for (VarNum1 = 1; VarNum1 <= NumVariables; ++VarNum1) { @@ -2913,7 +2923,6 @@ namespace SystemReports { VarTypes.deallocate(); IndexTypes.deallocate(); unitsForVar.deallocate(); - ResourceTypes.deallocate(); EndUses.deallocate(); Groups.deallocate(); Names.deallocate(); @@ -3021,7 +3030,10 @@ namespace SystemReports { VarTypes.allocate(NumVariables); IndexTypes.allocate(NumVariables); unitsForVar.allocate(NumVariables); - ResourceTypes.allocate(NumVariables); + ResourceTypes.clear(); + for (int idx = 1; idx <= NumVariables; ++idx) { + ResourceTypes.insert(std::pair(idx, DataGlobalConstants::ResourceType::None)); + } EndUses.allocate(NumVariables); Groups.allocate(NumVariables); Names.allocate(NumVariables); @@ -3048,7 +3060,7 @@ namespace SystemReports { thisVar.ReportVarIndex = VarIndexes(VarNum); thisVar.ReportVarIndexType = IndexTypes(VarNum); thisVar.ReportVarType = VarTypes(VarNum); - thisVar.ResourceType = ResourceTypes(VarNum); + thisVar.ResourceType = ResourceTypes.at(VarNum); thisVar.EndUse = EndUses(VarNum); if (thisVar.EndUse == "HEATINGCOILS" && ModeFlagOn) { for (VarNum1 = 1; VarNum1 <= NumVariables; ++VarNum1) { @@ -3071,7 +3083,6 @@ namespace SystemReports { VarTypes.deallocate(); IndexTypes.deallocate(); unitsForVar.deallocate(); - ResourceTypes.deallocate(); EndUses.deallocate(); Groups.deallocate(); Names.deallocate(); @@ -3088,7 +3099,10 @@ namespace SystemReports { VarTypes.allocate(NumVariables); IndexTypes.allocate(NumVariables); unitsForVar.allocate(NumVariables); - ResourceTypes.allocate(NumVariables); + ResourceTypes.clear(); + for (int idx = 1; idx <= NumVariables; ++idx) { + ResourceTypes.insert(std::pair(idx, DataGlobalConstants::ResourceType::None)); + } EndUses.allocate(NumVariables); Groups.allocate(NumVariables); Names.allocate(NumVariables); @@ -3115,7 +3129,7 @@ namespace SystemReports { thisVar.ReportVarIndex = VarIndexes(VarNum); thisVar.ReportVarIndexType = IndexTypes(VarNum); thisVar.ReportVarType = VarTypes(VarNum); - thisVar.ResourceType = ResourceTypes(VarNum); + thisVar.ResourceType = ResourceTypes.at(VarNum); thisVar.EndUse = EndUses(VarNum); if (thisVar.EndUse == "HEATINGCOILS" && ModeFlagOn) { for (VarNum1 = 1; VarNum1 <= NumVariables; ++VarNum1) { @@ -3138,7 +3152,6 @@ namespace SystemReports { VarTypes.deallocate(); IndexTypes.deallocate(); unitsForVar.deallocate(); - ResourceTypes.deallocate(); EndUses.deallocate(); Groups.deallocate(); Names.deallocate(); @@ -3345,7 +3358,10 @@ namespace SystemReports { VarTypes.allocate(NumVariables); IndexTypes.allocate(NumVariables); unitsForVar.allocate(NumVariables); - ResourceTypes.allocate(NumVariables); + ResourceTypes.clear(); + for (int idx = 1; idx <= NumVariables; ++idx) { + ResourceTypes.insert(std::pair(idx, DataGlobalConstants::ResourceType::None)); + } EndUses.allocate(NumVariables); Groups.allocate(NumVariables); Names.allocate(NumVariables); @@ -3373,7 +3389,7 @@ namespace SystemReports { thisVar.ReportVarIndex = VarIndexes(VarNum); thisVar.ReportVarIndexType = IndexTypes(VarNum); thisVar.ReportVarType = VarTypes(VarNum); - thisVar.ResourceType = ResourceTypes(VarNum); + thisVar.ResourceType = ResourceTypes.at(VarNum); thisVar.EndUse = EndUses(VarNum); if (thisVar.EndUse == "HEATINGCOILS" && ModeFlagOn) { for (VarNum1 = 1; VarNum1 <= NumVariables; ++VarNum1) { @@ -3396,7 +3412,6 @@ namespace SystemReports { VarTypes.deallocate(); IndexTypes.deallocate(); unitsForVar.deallocate(); - ResourceTypes.deallocate(); EndUses.deallocate(); Groups.deallocate(); Names.deallocate(); @@ -3411,7 +3426,10 @@ namespace SystemReports { VarTypes.allocate(NumVariables); IndexTypes.allocate(NumVariables); unitsForVar.allocate(NumVariables); - ResourceTypes.allocate(NumVariables); + ResourceTypes.clear(); + for (int idx = 1; idx <= NumVariables; ++idx) { + ResourceTypes.insert(std::pair(idx, DataGlobalConstants::ResourceType::None)); + } EndUses.allocate(NumVariables); Groups.allocate(NumVariables); Names.allocate(NumVariables); @@ -3438,7 +3456,7 @@ namespace SystemReports { thisVar.ReportVarIndex = VarIndexes(VarNum); thisVar.ReportVarIndexType = IndexTypes(VarNum); thisVar.ReportVarType = VarTypes(VarNum); - thisVar.ResourceType = ResourceTypes(VarNum); + thisVar.ResourceType = ResourceTypes.at(VarNum); thisVar.EndUse = EndUses(VarNum); if (thisVar.EndUse == "HEATINGCOILS" && ModeFlagOn) { for (VarNum1 = 1; VarNum1 <= NumVariables; ++VarNum1) { @@ -3461,7 +3479,6 @@ namespace SystemReports { VarTypes.deallocate(); IndexTypes.deallocate(); unitsForVar.deallocate(); - ResourceTypes.deallocate(); EndUses.deallocate(); Groups.deallocate(); Names.deallocate(); @@ -3536,7 +3553,7 @@ namespace SystemReports { int ADUHeatNum; int AirDistCoolInletNodeNum; int AirDistHeatInletNodeNum; - int EnergyType; + DataGlobalConstants::ResourceType EnergyType; int ActualZoneNum; Real64 CompEnergyUse; Real64 ZoneLoad; @@ -3608,7 +3625,7 @@ namespace SystemReports { PsyHFnTdbW(Node(OutletNodeNum).Temp, Node(OutletNodeNum).HumRat)); CompLoad *= TimeStepSys * DataGlobalConstants::SecInHour(); CompEnergyUse = 0.0; - EnergyType = iRT_None; + EnergyType = DataGlobalConstants::ResourceType::None; CompLoadFlag = true; CalcSystemEnergyUse(CompLoadFlag, AirLoopNum, pasBranchComp.TypeOf, EnergyType, CompLoad, CompEnergyUse); CompLoadFlag = false; @@ -3629,7 +3646,7 @@ namespace SystemReports { PsyHFnTdbW(Node(OutletNodeNum).Temp, Node(OutletNodeNum).HumRat)); CompLoad *= TimeStepSys * DataGlobalConstants::SecInHour(); CompEnergyUse = 0.0; - EnergyType = iRT_None; + EnergyType = DataGlobalConstants::ResourceType::None; CompLoadFlag = true; CalcSystemEnergyUse(CompLoadFlag, AirLoopNum, pasBranchSubComp.TypeOf, EnergyType, CompLoad, CompEnergyUse); CompLoadFlag = false; @@ -3650,7 +3667,7 @@ namespace SystemReports { PsyHFnTdbW(Node(OutletNodeNum).Temp, Node(OutletNodeNum).HumRat)); CompLoad *= TimeStepSys * DataGlobalConstants::SecInHour(); CompEnergyUse = 0.0; - EnergyType = iRT_None; + EnergyType = DataGlobalConstants::ResourceType::None; CompLoadFlag = true; CalcSystemEnergyUse(CompLoadFlag, AirLoopNum, pasBranchSubSubComp.TypeOf, EnergyType, CompLoad, CompEnergyUse); CompLoadFlag = false; @@ -3737,7 +3754,7 @@ namespace SystemReports { } CompLoad *= TimeStepSys * DataGlobalConstants::SecInHour(); CompEnergyUse = 0.0; - EnergyType = iRT_None; + EnergyType = DataGlobalConstants::ResourceType::None; CompLoadFlag = true; CalcSystemEnergyUse(CompLoadFlag, AirLoopNum, zelEquipData.TypeOf, EnergyType, CompLoad, CompEnergyUse); CompLoadFlag = false; @@ -3756,7 +3773,7 @@ namespace SystemReports { PsyHFnTdbW(Node(OutletNodeNum).Temp, Node(OutletNodeNum).HumRat)); CompLoad *= TimeStepSys * DataGlobalConstants::SecInHour(); CompEnergyUse = 0.0; - EnergyType = iRT_None; + EnergyType = DataGlobalConstants::ResourceType::None; CompLoadFlag = true; CalcSystemEnergyUse(CompLoadFlag, AirLoopNum, zelSubEquipData.TypeOf, EnergyType, CompLoad, CompEnergyUse); CompLoadFlag = false; @@ -3775,7 +3792,7 @@ namespace SystemReports { PsyHFnTdbW(Node(OutletNodeNum).Temp, Node(OutletNodeNum).HumRat)); CompLoad *= TimeStepSys * DataGlobalConstants::SecInHour(); CompEnergyUse = 0.0; - EnergyType = iRT_None; + EnergyType = DataGlobalConstants::ResourceType::None; CompLoadFlag = true; CalcSystemEnergyUse(CompLoadFlag, AirLoopNum, zelSubSubEquipData.TypeOf, EnergyType, CompLoad, CompEnergyUse); CompLoadFlag = false; @@ -3808,7 +3825,7 @@ namespace SystemReports { void CalcSystemEnergyUse(bool const CompLoadFlag, int const AirLoopNum, std::string const &CompType, - int const EnergyType, + DataGlobalConstants::ResourceType const EnergyType, Real64 const CompLoad, Real64 const CompEnergy) { @@ -4107,9 +4124,9 @@ namespace SystemReports { case COIL_WATERHEATING_AIRTOWATERHEATPUMP_VARIABLESPEED: if (CompLoadFlag) SysCCCompCLNG(AirLoopNum) += std::abs(CompLoad); - if ((EnergyType == iRT_PlantLoopCoolingDemand) || (EnergyType == iRT_DistrictCooling)) { + if ((EnergyType == DataGlobalConstants::ResourceType::PlantLoopCoolingDemand) || (EnergyType == DataGlobalConstants::ResourceType::DistrictCooling)) { SysCCCompH2OCOLD(AirLoopNum) += CompEnergy; - } else if (EnergyType == iRT_Electricity) { + } else if (EnergyType == DataGlobalConstants::ResourceType::Electricity) { SysCCCompElec(AirLoopNum) += CompEnergy; } @@ -4128,15 +4145,15 @@ namespace SystemReports { case COIL_HEATING_DESUPERHEATER: if (CompLoadFlag) SysHCCompHTNG(AirLoopNum) += std::abs(CompLoad); - if ((EnergyType == iRT_PlantLoopHeatingDemand) || (EnergyType == iRT_DistrictHeating)) { + if ((EnergyType == DataGlobalConstants::ResourceType::PlantLoopHeatingDemand) || (EnergyType == DataGlobalConstants::ResourceType::DistrictHeating)) { SysHCCompH2OHOT(AirLoopNum) += CompEnergy; - } else if (EnergyType == iRT_Steam) { + } else if (EnergyType == DataGlobalConstants::ResourceType::Steam) { SysHCCompSteam(AirLoopNum) += CompEnergy; - } else if (EnergyType == iRT_Electricity) { + } else if (EnergyType == DataGlobalConstants::ResourceType::Electricity) { SysHCCompElec(AirLoopNum) += CompEnergy; - } else if (EnergyType == iRT_Natural_Gas) { + } else if (EnergyType == DataGlobalConstants::ResourceType::Natural_Gas) { SysHCCompNaturalGas(AirLoopNum) += CompEnergy; - } else if (EnergyType == iRT_Propane) { + } else if (EnergyType == DataGlobalConstants::ResourceType::Propane) { SysHCCompPropane(AirLoopNum) += CompEnergy; } @@ -4145,7 +4162,7 @@ namespace SystemReports { case COIL_HEATING_ELECTRIC_MULTISTAGE: if (CompLoadFlag) SysHCCompHTNG(AirLoopNum) += std::abs(CompLoad); - if (EnergyType == iRT_Electricity) { + if (EnergyType == DataGlobalConstants::ResourceType::Electricity) { SysHCCompElecRes(AirLoopNum) += CompEnergy; } @@ -4159,21 +4176,21 @@ namespace SystemReports { SysHCCompHTNG(AirLoopNum) += std::abs(CompLoad); } } - if ((EnergyType == iRT_PlantLoopHeatingDemand) || (EnergyType == iRT_DistrictHeating)) { + if ((EnergyType == DataGlobalConstants::ResourceType::PlantLoopHeatingDemand) || (EnergyType == DataGlobalConstants::ResourceType::DistrictHeating)) { SysHCCompH2OHOT(AirLoopNum) += CompEnergy; - } else if ((EnergyType == iRT_PlantLoopCoolingDemand) || (EnergyType == iRT_DistrictCooling)) { + } else if ((EnergyType == DataGlobalConstants::ResourceType::PlantLoopCoolingDemand) || (EnergyType == DataGlobalConstants::ResourceType::DistrictCooling)) { SysCCCompH2OCOLD(AirLoopNum) += CompEnergy; - } else if (EnergyType == iRT_Steam) { + } else if (EnergyType == DataGlobalConstants::ResourceType::Steam) { SysHCCompSteam(AirLoopNum) += CompEnergy; - } else if (EnergyType == iRT_Electricity) { + } else if (EnergyType == DataGlobalConstants::ResourceType::Electricity) { if (CompLoad > 0.0) { SysCCCompElec(AirLoopNum) += CompEnergy; } else { SysHCCompElec(AirLoopNum) += CompEnergy; } - } else if (EnergyType == iRT_Natural_Gas) { + } else if (EnergyType == DataGlobalConstants::ResourceType::Natural_Gas) { SysHCCompNaturalGas(AirLoopNum) += CompEnergy; - } else if (EnergyType == iRT_Propane) { + } else if (EnergyType == DataGlobalConstants::ResourceType::Propane) { SysHCCompPropane(AirLoopNum) += CompEnergy; } @@ -4221,13 +4238,13 @@ namespace SystemReports { case HUMIDIFIER_STEAM_GAS: case HUMIDIFIER_STEAM_ELECTRIC: if (CompLoadFlag) SysHumidHTNG(AirLoopNum) += std::abs(CompLoad); - if (EnergyType == iRT_Water) { + if (EnergyType == DataGlobalConstants::ResourceType::Water) { SysDomesticH2O(AirLoopNum) += std::abs(CompEnergy); - } else if (EnergyType == iRT_Electricity) { + } else if (EnergyType == DataGlobalConstants::ResourceType::Electricity) { SysHumidElec(AirLoopNum) += CompEnergy; - } else if (EnergyType == iRT_Natural_Gas) { + } else if (EnergyType == DataGlobalConstants::ResourceType::Natural_Gas) { SysHumidNaturalGas(AirLoopNum) += CompEnergy; - } else if (EnergyType == iRT_Propane) { + } else if (EnergyType == DataGlobalConstants::ResourceType::Propane) { SysHumidPropane(AirLoopNum) += CompEnergy; } @@ -4239,9 +4256,9 @@ namespace SystemReports { case EVAPORATIVECOOLER_DIRECT_RESEARCHSPECIAL: case EVAPORATIVECOOLER_INDIRECT_RESEARCHSPECIAL: if (CompLoadFlag) SysEvapCLNG(AirLoopNum) += std::abs(CompLoad); - if (EnergyType == iRT_Water) { + if (EnergyType == DataGlobalConstants::ResourceType::Water) { SysDomesticH2O(AirLoopNum) += std::abs(CompEnergy); - } else if (EnergyType == iRT_Electricity) { + } else if (EnergyType == DataGlobalConstants::ResourceType::Electricity) { SysEvapElec(AirLoopNum) += CompEnergy; } @@ -4250,7 +4267,7 @@ namespace SystemReports { case DEHUMIDIFIER_DESICCANT_NOFANS: case DEHUMIDIFIER_DESICCANT_SYSTEM: if (CompLoadFlag) DesDehumidCLNG(AirLoopNum) += std::abs(CompLoad); - if (EnergyType == iRT_Electricity) { + if (EnergyType == DataGlobalConstants::ResourceType::Electricity) { DesDehumidElec(AirLoopNum) += CompEnergy; } @@ -4324,21 +4341,21 @@ namespace SystemReports { SysUserDefinedTerminalHeating(AirLoopNum) += std::abs(CompLoad); } } - if ((EnergyType == iRT_PlantLoopHeatingDemand) || (EnergyType == iRT_DistrictHeating)) { + if ((EnergyType == DataGlobalConstants::ResourceType::PlantLoopHeatingDemand) || (EnergyType == DataGlobalConstants::ResourceType::DistrictHeating)) { SysHCCompH2OHOT(AirLoopNum) += CompEnergy; - } else if ((EnergyType == iRT_PlantLoopCoolingDemand) || (EnergyType == iRT_DistrictCooling)) { + } else if ((EnergyType == DataGlobalConstants::ResourceType::PlantLoopCoolingDemand) || (EnergyType == DataGlobalConstants::ResourceType::DistrictCooling)) { SysCCCompH2OCOLD(AirLoopNum) += CompEnergy; - } else if (EnergyType == iRT_Steam) { + } else if (EnergyType == DataGlobalConstants::ResourceType::Steam) { SysHCCompSteam(AirLoopNum) += CompEnergy; - } else if (EnergyType == iRT_Electricity) { + } else if (EnergyType == DataGlobalConstants::ResourceType::Electricity) { if (CompLoad > 0.0) { SysCCCompElec(AirLoopNum) += CompEnergy; } else { SysHCCompElec(AirLoopNum) += CompEnergy; } - } else if (EnergyType == iRT_Natural_Gas) { + } else if (EnergyType == DataGlobalConstants::ResourceType::Natural_Gas) { SysHCCompNaturalGas(AirLoopNum) += CompEnergy; - } else if (EnergyType == iRT_Propane) { + } else if (EnergyType == DataGlobalConstants::ResourceType::Propane) { SysHCCompPropane(AirLoopNum) += CompEnergy; } // Recurring warning for unaccounted equipment types @@ -4938,7 +4955,7 @@ namespace SystemReports { { auto &thisComp(PrimaryAirSystem(AirLoopNum).Branch(BranchNum).Comp(CompNum)); for (VarNum = 1; VarNum <= thisComp.NumMeteredVars; ++VarNum) { - if (thisComp.MeteredVar(VarNum).ResourceType == iRT_EnergyTransfer) { + if (thisComp.MeteredVar(VarNum).ResourceType == DataGlobalConstants::ResourceType::EnergyTransfer) { thisComp.EnergyTransComp = EnergyTrans; CompType = thisComp.TypeOf; CompName = thisComp.Name; @@ -4955,7 +4972,7 @@ namespace SystemReports { { auto &thisSubComp(thisComp.SubComp(SubCompNum)); for (VarNum = 1; VarNum <= thisSubComp.NumMeteredVars; ++VarNum) { - if (thisSubComp.MeteredVar(VarNum).ResourceType == iRT_EnergyTransfer) { + if (thisSubComp.MeteredVar(VarNum).ResourceType == DataGlobalConstants::ResourceType::EnergyTransfer) { thisSubComp.EnergyTransComp = EnergyTrans; CompType = thisSubComp.TypeOf; CompName = thisSubComp.Name; @@ -4973,7 +4990,7 @@ namespace SystemReports { { auto &thisSubSubComp(thisSubComp.SubSubComp(SubSubCompNum)); for (VarNum = 1; VarNum <= thisSubSubComp.NumMeteredVars; ++VarNum) { - if (thisSubSubComp.MeteredVar(VarNum).ResourceType == iRT_EnergyTransfer) { + if (thisSubSubComp.MeteredVar(VarNum).ResourceType == DataGlobalConstants::ResourceType::EnergyTransfer) { thisSubSubComp.EnergyTransComp = EnergyTrans; CompType = thisSubSubComp.TypeOf; CompName = thisSubSubComp.Name; diff --git a/src/EnergyPlus/SystemReports.hh b/src/EnergyPlus/SystemReports.hh index e8d10083744..da75dee1ee4 100644 --- a/src/EnergyPlus/SystemReports.hh +++ b/src/EnergyPlus/SystemReports.hh @@ -52,6 +52,7 @@ #include // EnergyPlus Headers +#include #include namespace EnergyPlus { @@ -305,7 +306,7 @@ namespace SystemReports { void CalcSystemEnergyUse(bool const CompLoadFlag, int const AirLoopNum, std::string const &CompType, - int const EnergyType, + DataGlobalConstants::ResourceType const EnergyType, Real64 const CompLoad, Real64 const CompEnergy); diff --git a/src/EnergyPlus/UtilityRoutines.cc b/src/EnergyPlus/UtilityRoutines.cc index 8c9c816c805..1e44bdb8f20 100644 --- a/src/EnergyPlus/UtilityRoutines.cc +++ b/src/EnergyPlus/UtilityRoutines.cc @@ -534,7 +534,7 @@ namespace UtilityRoutines { bool ValidateFuelTypeWithAssignResourceTypeNum(std::string const &FuelTypeInput, std::string &FuelTypeOutput, - int &FuelTypeNum, + DataGlobalConstants::ResourceType &FuelTypeNum, bool &FuelTypeErrorsFound) { // FUNCTION INFORMATION: diff --git a/src/EnergyPlus/UtilityRoutines.hh b/src/EnergyPlus/UtilityRoutines.hh index 1a3f454b3fc..7c8c5210e94 100644 --- a/src/EnergyPlus/UtilityRoutines.hh +++ b/src/EnergyPlus/UtilityRoutines.hh @@ -48,6 +48,9 @@ #ifndef UtilityRoutines_hh_INCLUDED #define UtilityRoutines_hh_INCLUDED +// C++ Headers +#include + // ObjexxFCL Headers #include #include @@ -56,10 +59,9 @@ #include // EnergyPlus Headers +#include #include -#include - namespace EnergyPlus { // Forward declarations @@ -573,7 +575,10 @@ namespace UtilityRoutines { bool ValidateFuelType(std::string const &FuelTypeInput, std::string &FuelTypeOutput, bool &FuelTypeErrorsFound, bool const &AllowSteamAndDistrict = false); - bool ValidateFuelTypeWithAssignResourceTypeNum(std::string const &FuelTypeInput, std::string &FuelTypeOutput, int &FuelTypeNum, bool &FuelTypeErrorsFound); + bool ValidateFuelTypeWithAssignResourceTypeNum(std::string const &FuelTypeInput, + std::string &FuelTypeOutput, + DataGlobalConstants::ResourceType &FuelTypeNum, + bool &FuelTypeErrorsFound); } // namespace UtilityRoutines diff --git a/tst/EnergyPlus/unit/DXCoils.unit.cc b/tst/EnergyPlus/unit/DXCoils.unit.cc index ee6ea445ef7..7cba05cd17e 100644 --- a/tst/EnergyPlus/unit/DXCoils.unit.cc +++ b/tst/EnergyPlus/unit/DXCoils.unit.cc @@ -454,7 +454,7 @@ TEST_F(EnergyPlusFixture, TestMultiSpeedDefrostCOP) Coil.DefrostCapacity = 1000; Coil.PLRImpact = false; Coil.FuelType = "Electricity"; - Coil.FuelTypeNum = DataGlobalConstants::iRT_Electricity; + Coil.FuelTypeNum = DataGlobalConstants::ResourceType::Electricity; Coil.RegionNum = 4; Coil.MSRatedTotCap(1) = 2202.5268975202675; Coil.MSRatedCOP(1) = 4.200635910578916; @@ -810,7 +810,7 @@ TEST_F(EnergyPlusFixture, TestSingleSpeedDefrostCOP) Coil.DefrostCapacity = 1000; Coil.PLRImpact = false; Coil.FuelType = "Electricity"; - Coil.FuelTypeNum = DataGlobalConstants::iRT_Electricity; + Coil.FuelTypeNum = DataGlobalConstants::ResourceType::Electricity; Coil.RegionNum = 4; state.dataCurveManager->NumCurves = 5; @@ -1304,14 +1304,14 @@ TEST_F(EnergyPlusFixture, TestMultiSpeedWasteHeat) GetDXCoils(state); EXPECT_EQ("Electricity", DXCoil(1).FuelType); // it also covers a test for fuel type input - EXPECT_EQ(DataGlobalConstants::iRT_Electricity, DXCoil(1).FuelTypeNum); + EXPECT_EQ(DataGlobalConstants::ResourceType::Electricity, DXCoil(1).FuelTypeNum); EXPECT_EQ(0, DXCoil(1).MSWasteHeat(2)); // Test calculations of the waste heat function #5162 // Case 2 test waste heat is zero when the parent has not heat recovery inputs DXCoil(1).FuelType = "NaturalGas"; - DXCoil(1).FuelTypeNum = DataGlobalConstants::iRT_Natural_Gas; + DXCoil(1).FuelTypeNum = DataGlobalConstants::ResourceType::Natural_Gas; DXCoil(1).MSHPHeatRecActive = false; OutDryBulbTemp = 35; diff --git a/tst/EnergyPlus/unit/DataGlobalConstants.unit.cc b/tst/EnergyPlus/unit/DataGlobalConstants.unit.cc index b43cec32f29..5d8437e6db4 100644 --- a/tst/EnergyPlus/unit/DataGlobalConstants.unit.cc +++ b/tst/EnergyPlus/unit/DataGlobalConstants.unit.cc @@ -61,102 +61,103 @@ using namespace ObjexxFCL; TEST_F(EnergyPlusFixture, DataGlobalConstants_AssignResourceTypeNum) { - EXPECT_EQ(DataGlobalConstants::iRT_Electricity, DataGlobalConstants::AssignResourceTypeNum("Electricity")); - EXPECT_EQ(DataGlobalConstants::iRT_Natural_Gas, DataGlobalConstants::AssignResourceTypeNum("NaturalGas")); - EXPECT_EQ(DataGlobalConstants::iRT_Gasoline, DataGlobalConstants::AssignResourceTypeNum("Gasoline")); - EXPECT_EQ(DataGlobalConstants::iRT_Diesel, DataGlobalConstants::AssignResourceTypeNum("Diesel")); - EXPECT_EQ(DataGlobalConstants::iRT_Coal, DataGlobalConstants::AssignResourceTypeNum("Coal")); - EXPECT_EQ(DataGlobalConstants::iRT_FuelOil_1, DataGlobalConstants::AssignResourceTypeNum("FuelOilNo1")); - EXPECT_EQ(DataGlobalConstants::iRT_FuelOil_2, DataGlobalConstants::AssignResourceTypeNum("FuelOilNo2")); - EXPECT_EQ(DataGlobalConstants::iRT_Propane, DataGlobalConstants::AssignResourceTypeNum("Propane")); - EXPECT_EQ(DataGlobalConstants::iRT_OtherFuel1, DataGlobalConstants::AssignResourceTypeNum("OtherFuel1")); - EXPECT_EQ(DataGlobalConstants::iRT_OtherFuel2, DataGlobalConstants::AssignResourceTypeNum("OtherFuel2")); - EXPECT_EQ(DataGlobalConstants::iRT_Water, DataGlobalConstants::AssignResourceTypeNum("Water")); - EXPECT_EQ(DataGlobalConstants::iRT_OnSiteWater, DataGlobalConstants::AssignResourceTypeNum("OnSiteWater")); - EXPECT_EQ(DataGlobalConstants::iRT_MainsWater, DataGlobalConstants::AssignResourceTypeNum("MainsWater")); - EXPECT_EQ(DataGlobalConstants::iRT_RainWater, DataGlobalConstants::AssignResourceTypeNum("RainWater")); - EXPECT_EQ(DataGlobalConstants::iRT_WellWater, DataGlobalConstants::AssignResourceTypeNum("WellWater")); - EXPECT_EQ(DataGlobalConstants::iRT_Condensate, DataGlobalConstants::AssignResourceTypeNum("Condensate")); - EXPECT_EQ(DataGlobalConstants::iRT_EnergyTransfer, DataGlobalConstants::AssignResourceTypeNum("EnergyTransfer")); - EXPECT_EQ(DataGlobalConstants::iRT_Steam, DataGlobalConstants::AssignResourceTypeNum("Steam")); - EXPECT_EQ(DataGlobalConstants::iRT_DistrictCooling, DataGlobalConstants::AssignResourceTypeNum("DistrictCooling")); - EXPECT_EQ(DataGlobalConstants::iRT_DistrictHeating, DataGlobalConstants::AssignResourceTypeNum("DistrictHeating")); - EXPECT_EQ(DataGlobalConstants::iRT_ElectricityProduced, DataGlobalConstants::AssignResourceTypeNum("ElectricityProduced")); - EXPECT_EQ(DataGlobalConstants::iRT_ElectricityPurchased, DataGlobalConstants::AssignResourceTypeNum("ElectricityPurchased")); - EXPECT_EQ(DataGlobalConstants::iRT_ElectricitySurplusSold, DataGlobalConstants::AssignResourceTypeNum("ElectricitySurplusSold")); - EXPECT_EQ(DataGlobalConstants::iRT_ElectricityNet, DataGlobalConstants::AssignResourceTypeNum("ElectricityNet")); - EXPECT_EQ(DataGlobalConstants::iRT_SolarWater, DataGlobalConstants::AssignResourceTypeNum("SolarWater")); - EXPECT_EQ(DataGlobalConstants::iRT_SolarAir, DataGlobalConstants::AssignResourceTypeNum("SolarAir")); - EXPECT_EQ(DataGlobalConstants::iRT_SO2, DataGlobalConstants::AssignResourceTypeNum("SO2")); - EXPECT_EQ(DataGlobalConstants::iRT_NOx, DataGlobalConstants::AssignResourceTypeNum("NOx")); - EXPECT_EQ(DataGlobalConstants::iRT_N2O, DataGlobalConstants::AssignResourceTypeNum("N2O")); - EXPECT_EQ(DataGlobalConstants::iRT_PM, DataGlobalConstants::AssignResourceTypeNum("PM")); - EXPECT_EQ(DataGlobalConstants::iRT_PM2_5, DataGlobalConstants::AssignResourceTypeNum("PM2.5")); - EXPECT_EQ(DataGlobalConstants::iRT_PM10, DataGlobalConstants::AssignResourceTypeNum("PM10")); - EXPECT_EQ(DataGlobalConstants::iRT_CO, DataGlobalConstants::AssignResourceTypeNum("CO")); - EXPECT_EQ(DataGlobalConstants::iRT_CO2, DataGlobalConstants::AssignResourceTypeNum("CO2")); - EXPECT_EQ(DataGlobalConstants::iRT_CH4, DataGlobalConstants::AssignResourceTypeNum("CH4")); - EXPECT_EQ(DataGlobalConstants::iRT_NH3, DataGlobalConstants::AssignResourceTypeNum("NH3")); - EXPECT_EQ(DataGlobalConstants::iRT_NMVOC, DataGlobalConstants::AssignResourceTypeNum("NMVOC")); - EXPECT_EQ(DataGlobalConstants::iRT_Hg, DataGlobalConstants::AssignResourceTypeNum("Hg")); - EXPECT_EQ(DataGlobalConstants::iRT_Pb, DataGlobalConstants::AssignResourceTypeNum("Pb")); - EXPECT_EQ(DataGlobalConstants::iRT_NuclearHigh, DataGlobalConstants::AssignResourceTypeNum("Nuclear High")); - EXPECT_EQ(DataGlobalConstants::iRT_NuclearLow, DataGlobalConstants::AssignResourceTypeNum("Nuclear Low")); - EXPECT_EQ(DataGlobalConstants::iRT_WaterEnvironmentalFactors, DataGlobalConstants::AssignResourceTypeNum("WaterEnvironmentalFactors")); - EXPECT_EQ(DataGlobalConstants::iRT_CarbonEquivalent, DataGlobalConstants::AssignResourceTypeNum("Carbon Equivalent")); - EXPECT_EQ(DataGlobalConstants::iRT_PlantLoopHeatingDemand, DataGlobalConstants::AssignResourceTypeNum("PlantLoopHeatingDemand")); - EXPECT_EQ(DataGlobalConstants::iRT_PlantLoopCoolingDemand, DataGlobalConstants::AssignResourceTypeNum("PlantLoopCoolingDemand")); - EXPECT_EQ(0, DataGlobalConstants::AssignResourceTypeNum("XYZ")); + EXPECT_EQ(DataGlobalConstants::ResourceType::Electricity, DataGlobalConstants::AssignResourceTypeNum("Electricity")); + EXPECT_EQ(DataGlobalConstants::ResourceType::Natural_Gas, DataGlobalConstants::AssignResourceTypeNum("NaturalGas")); + EXPECT_EQ(DataGlobalConstants::ResourceType::Gasoline, DataGlobalConstants::AssignResourceTypeNum("Gasoline")); + EXPECT_EQ(DataGlobalConstants::ResourceType::Diesel, DataGlobalConstants::AssignResourceTypeNum("Diesel")); + EXPECT_EQ(DataGlobalConstants::ResourceType::Coal, DataGlobalConstants::AssignResourceTypeNum("Coal")); + EXPECT_EQ(DataGlobalConstants::ResourceType::FuelOil_1, DataGlobalConstants::AssignResourceTypeNum("FuelOilNo1")); + EXPECT_EQ(DataGlobalConstants::ResourceType::FuelOil_2, DataGlobalConstants::AssignResourceTypeNum("FuelOilNo2")); + EXPECT_EQ(DataGlobalConstants::ResourceType::Propane, DataGlobalConstants::AssignResourceTypeNum("Propane")); + EXPECT_EQ(DataGlobalConstants::ResourceType::OtherFuel1, DataGlobalConstants::AssignResourceTypeNum("OtherFuel1")); + EXPECT_EQ(DataGlobalConstants::ResourceType::OtherFuel2, DataGlobalConstants::AssignResourceTypeNum("OtherFuel2")); + EXPECT_EQ(DataGlobalConstants::ResourceType::Water, DataGlobalConstants::AssignResourceTypeNum("Water")); + EXPECT_EQ(DataGlobalConstants::ResourceType::OnSiteWater, DataGlobalConstants::AssignResourceTypeNum("OnSiteWater")); + EXPECT_EQ(DataGlobalConstants::ResourceType::MainsWater, DataGlobalConstants::AssignResourceTypeNum("MainsWater")); + EXPECT_EQ(DataGlobalConstants::ResourceType::RainWater, DataGlobalConstants::AssignResourceTypeNum("RainWater")); + EXPECT_EQ(DataGlobalConstants::ResourceType::WellWater, DataGlobalConstants::AssignResourceTypeNum("WellWater")); + EXPECT_EQ(DataGlobalConstants::ResourceType::Condensate, DataGlobalConstants::AssignResourceTypeNum("Condensate")); + EXPECT_EQ(DataGlobalConstants::ResourceType::EnergyTransfer, DataGlobalConstants::AssignResourceTypeNum("EnergyTransfer")); + EXPECT_EQ(DataGlobalConstants::ResourceType::Steam, DataGlobalConstants::AssignResourceTypeNum("Steam")); + EXPECT_EQ(DataGlobalConstants::ResourceType::DistrictCooling, DataGlobalConstants::AssignResourceTypeNum("DistrictCooling")); + EXPECT_EQ(DataGlobalConstants::ResourceType::DistrictHeating, DataGlobalConstants::AssignResourceTypeNum("DistrictHeating")); + EXPECT_EQ(DataGlobalConstants::ResourceType::ElectricityProduced, DataGlobalConstants::AssignResourceTypeNum("ElectricityProduced")); + EXPECT_EQ(DataGlobalConstants::ResourceType::ElectricityPurchased, DataGlobalConstants::AssignResourceTypeNum("ElectricityPurchased")); + EXPECT_EQ(DataGlobalConstants::ResourceType::ElectricitySurplusSold, DataGlobalConstants::AssignResourceTypeNum("ElectricitySurplusSold")); + EXPECT_EQ(DataGlobalConstants::ResourceType::ElectricityNet, DataGlobalConstants::AssignResourceTypeNum("ElectricityNet")); + EXPECT_EQ(DataGlobalConstants::ResourceType::SolarWater, DataGlobalConstants::AssignResourceTypeNum("SolarWater")); + EXPECT_EQ(DataGlobalConstants::ResourceType::SolarAir, DataGlobalConstants::AssignResourceTypeNum("SolarAir")); + EXPECT_EQ(DataGlobalConstants::ResourceType::SO2, DataGlobalConstants::AssignResourceTypeNum("SO2")); + EXPECT_EQ(DataGlobalConstants::ResourceType::NOx, DataGlobalConstants::AssignResourceTypeNum("NOx")); + EXPECT_EQ(DataGlobalConstants::ResourceType::N2O, DataGlobalConstants::AssignResourceTypeNum("N2O")); + EXPECT_EQ(DataGlobalConstants::ResourceType::PM, DataGlobalConstants::AssignResourceTypeNum("PM")); + EXPECT_EQ(DataGlobalConstants::ResourceType::PM2_5, DataGlobalConstants::AssignResourceTypeNum("PM2.5")); + EXPECT_EQ(DataGlobalConstants::ResourceType::PM10, DataGlobalConstants::AssignResourceTypeNum("PM10")); + EXPECT_EQ(DataGlobalConstants::ResourceType::CO, DataGlobalConstants::AssignResourceTypeNum("CO")); + EXPECT_EQ(DataGlobalConstants::ResourceType::CO2, DataGlobalConstants::AssignResourceTypeNum("CO2")); + EXPECT_EQ(DataGlobalConstants::ResourceType::CH4, DataGlobalConstants::AssignResourceTypeNum("CH4")); + EXPECT_EQ(DataGlobalConstants::ResourceType::NH3, DataGlobalConstants::AssignResourceTypeNum("NH3")); + EXPECT_EQ(DataGlobalConstants::ResourceType::NMVOC, DataGlobalConstants::AssignResourceTypeNum("NMVOC")); + EXPECT_EQ(DataGlobalConstants::ResourceType::Hg, DataGlobalConstants::AssignResourceTypeNum("Hg")); + EXPECT_EQ(DataGlobalConstants::ResourceType::Pb, DataGlobalConstants::AssignResourceTypeNum("Pb")); + EXPECT_EQ(DataGlobalConstants::ResourceType::NuclearHigh, DataGlobalConstants::AssignResourceTypeNum("Nuclear High")); + EXPECT_EQ(DataGlobalConstants::ResourceType::NuclearLow, DataGlobalConstants::AssignResourceTypeNum("Nuclear Low")); + EXPECT_EQ(DataGlobalConstants::ResourceType::WaterEnvironmentalFactors, DataGlobalConstants::AssignResourceTypeNum("WaterEnvironmentalFactors")); + EXPECT_EQ(DataGlobalConstants::ResourceType::CarbonEquivalent, DataGlobalConstants::AssignResourceTypeNum("Carbon Equivalent")); + EXPECT_EQ(DataGlobalConstants::ResourceType::PlantLoopHeatingDemand, DataGlobalConstants::AssignResourceTypeNum("PlantLoopHeatingDemand")); + EXPECT_EQ(DataGlobalConstants::ResourceType::PlantLoopCoolingDemand, DataGlobalConstants::AssignResourceTypeNum("PlantLoopCoolingDemand")); + EXPECT_EQ(DataGlobalConstants::ResourceType::Unknown, DataGlobalConstants::AssignResourceTypeNum("XYZ")); } TEST_F(EnergyPlusFixture, DataGlobalConstants_GetResourceTypeChar) { - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_Electricity), "Electricity"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_Natural_Gas), "NaturalGas"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_Gasoline), "Gasoline"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_Diesel), "Diesel"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_Coal), "Coal"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_FuelOil_1), "FuelOilNo1"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_FuelOil_2), "FuelOilNo2"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_Propane), "Propane"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_OtherFuel1), "OtherFuel1"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_OtherFuel2), "OtherFuel2"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_Water), "Water"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_OnSiteWater), "OnSiteWater"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_MainsWater), "MainsWater"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_RainWater), "RainWater"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_WellWater), "WellWater"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_Condensate), "Condensate"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_EnergyTransfer), "EnergyTransfer"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_Steam), "Steam"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_DistrictCooling), "DistrictCooling"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_DistrictHeating), "DistrictHeating"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_ElectricityProduced), "ElectricityProduced"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_ElectricityPurchased), "ElectricityPurchased"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_ElectricitySurplusSold), "ElectricitySurplusSold"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_ElectricityNet), "ElectricityNet"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_SolarWater), "SolarWater"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_SolarAir), "SolarAir"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_SO2), "SO2"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_NOx), "NOx"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_N2O), "N2O"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_PM), "PM"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_PM2_5), "PM2.5"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_PM10), "PM10"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_CO), "CO"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_CO2), "CO2"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_CH4), "CH4"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_NH3), "NH3"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_NMVOC), "NMVOC"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_Hg), "Hg"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_Pb), "Pb"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_NuclearHigh), "Nuclear High"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_NuclearLow), "Nuclear Low"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_WaterEnvironmentalFactors), "WaterEnvironmentalFactors"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_CarbonEquivalent), "Carbon Equivalent"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_PlantLoopHeatingDemand), "PlantLoopHeatingDemand"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::iRT_PlantLoopCoolingDemand), "PlantLoopCoolingDemand"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(0), "Unknown"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::Electricity), "Electricity"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::Natural_Gas), "NaturalGas"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::Gasoline), "Gasoline"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::Diesel), "Diesel"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::Coal), "Coal"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::FuelOil_1), "FuelOilNo1"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::FuelOil_2), "FuelOilNo2"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::Propane), "Propane"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::OtherFuel1), "OtherFuel1"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::OtherFuel2), "OtherFuel2"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::Water), "Water"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::OnSiteWater), "OnSiteWater"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::MainsWater), "MainsWater"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::RainWater), "RainWater"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::WellWater), "WellWater"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::Condensate), "Condensate"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::EnergyTransfer), "EnergyTransfer"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::Steam), "Steam"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::DistrictCooling), "DistrictCooling"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::DistrictHeating), "DistrictHeating"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::ElectricityProduced), "ElectricityProduced"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::ElectricityPurchased), "ElectricityPurchased"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::ElectricitySurplusSold), "ElectricitySurplusSold"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::ElectricityNet), "ElectricityNet"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::SolarWater), "SolarWater"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::SolarAir), "SolarAir"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::SO2), "SO2"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::NOx), "NOx"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::N2O), "N2O"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::PM), "PM"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::PM2_5), "PM2.5"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::PM10), "PM10"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::CO), "CO"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::CO2), "CO2"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::CH4), "CH4"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::NH3), "NH3"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::NMVOC), "NMVOC"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::Hg), "Hg"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::Pb), "Pb"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::NuclearHigh), "Nuclear High"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::NuclearLow), "Nuclear Low"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::WaterEnvironmentalFactors), "WaterEnvironmentalFactors"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::CarbonEquivalent), "Carbon Equivalent"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::PlantLoopHeatingDemand), "PlantLoopHeatingDemand"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::PlantLoopCoolingDemand), "PlantLoopCoolingDemand"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::Unknown), "Unknown"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::None), "Unknown"); } diff --git a/tst/EnergyPlus/unit/EconomicLifeCycleCost.unit.cc b/tst/EnergyPlus/unit/EconomicLifeCycleCost.unit.cc index 66e7ac7f9e7..219b304430a 100644 --- a/tst/EnergyPlus/unit/EconomicLifeCycleCost.unit.cc +++ b/tst/EnergyPlus/unit/EconomicLifeCycleCost.unit.cc @@ -53,11 +53,7 @@ // Google Test Headers #include -// ObjexxFCL Headers -#include - // EnergyPlus Headers -#include #include #include #include @@ -428,7 +424,7 @@ TEST_F(EnergyPlusFixture, EconomicLifeCycleCost_ComputeEscalatedEnergyCosts) numCashFlow = 1; CashFlow.allocate(numCashFlow); CashFlow(1).pvKind = pvkEnergy; - CashFlow(1).Resource = 1001; + CashFlow(1).Resource = DataGlobalConstants::ResourceType::Electricity; CashFlow(1).yrAmount.allocate(lengthStudyYears); CashFlow(1).yrAmount(1) = 100; CashFlow(1).yrAmount(2) = 110; @@ -438,17 +434,23 @@ TEST_F(EnergyPlusFixture, EconomicLifeCycleCost_ComputeEscalatedEnergyCosts) numResourcesUsed = 1; - EscalatedEnergy.allocate(lengthStudyYears, NumOfResourceTypes); - EscalatedEnergy = 0.0; + for (int year = 1; year <= lengthStudyYears; ++year) { + std::map yearMap; + for (auto iResource : DataGlobalConstants::AllResourceTypes) { + yearMap.insert(std::pair (iResource, 0.0)); + } + EscalatedEnergy.insert(std::pair>(year, yearMap)); + } + EscalatedTotEnergy.allocate(lengthStudyYears); EscalatedTotEnergy = 0.0; ComputeEscalatedEnergyCosts(); - EXPECT_NEAR(EscalatedEnergy(1, 1), 100., 0.001); - EXPECT_NEAR(EscalatedEnergy(2, 1), 110., 0.001); - EXPECT_NEAR(EscalatedEnergy(3, 1), 120., 0.001); - EXPECT_NEAR(EscalatedEnergy(4, 1), 130., 0.001); - EXPECT_NEAR(EscalatedEnergy(5, 1), 140., 0.001); + EXPECT_NEAR(EscalatedEnergy.at(1).at( DataGlobalConstants::ResourceType::Electricity), 100., 0.001); + EXPECT_NEAR(EscalatedEnergy.at(2).at( DataGlobalConstants::ResourceType::Electricity), 110., 0.001); + EXPECT_NEAR(EscalatedEnergy.at(3).at( DataGlobalConstants::ResourceType::Electricity), 120., 0.001); + EXPECT_NEAR(EscalatedEnergy.at(4).at( DataGlobalConstants::ResourceType::Electricity), 130., 0.001); + EXPECT_NEAR(EscalatedEnergy.at(5).at( DataGlobalConstants::ResourceType::Electricity), 140., 0.001); EXPECT_NEAR(EscalatedTotEnergy(1), 100., 0.001); EXPECT_NEAR(EscalatedTotEnergy(2), 110., 0.001); @@ -458,7 +460,7 @@ TEST_F(EnergyPlusFixture, EconomicLifeCycleCost_ComputeEscalatedEnergyCosts) numUsePriceEscalation = 1; UsePriceEscalation.allocate(numUsePriceEscalation); - UsePriceEscalation(1).resource = 1001; + UsePriceEscalation(1).resource = DataGlobalConstants::ResourceType::Electricity; UsePriceEscalation(1).Escalation.allocate(lengthStudyYears); UsePriceEscalation(1).Escalation(1) = 1.03; UsePriceEscalation(1).Escalation(2) = 1.05; @@ -470,11 +472,11 @@ TEST_F(EnergyPlusFixture, EconomicLifeCycleCost_ComputeEscalatedEnergyCosts) EscalatedTotEnergy = 0.0; ComputeEscalatedEnergyCosts(); - EXPECT_NEAR(EscalatedEnergy(1, 1), 103.0, 0.001); - EXPECT_NEAR(EscalatedEnergy(2, 1), 115.5, 0.001); - EXPECT_NEAR(EscalatedEnergy(3, 1), 128.4, 0.001); - EXPECT_NEAR(EscalatedEnergy(4, 1), 144.3, 0.001); - EXPECT_NEAR(EscalatedEnergy(5, 1), 161.0, 0.001); + EXPECT_NEAR(EscalatedEnergy.at(1).at(DataGlobalConstants::ResourceType::Electricity), 103.0, 0.001); + EXPECT_NEAR(EscalatedEnergy.at(2).at(DataGlobalConstants::ResourceType::Electricity), 115.5, 0.001); + EXPECT_NEAR(EscalatedEnergy.at(3).at(DataGlobalConstants::ResourceType::Electricity), 128.4, 0.001); + EXPECT_NEAR(EscalatedEnergy.at(4).at(DataGlobalConstants::ResourceType::Electricity), 144.3, 0.001); + EXPECT_NEAR(EscalatedEnergy.at(5).at(DataGlobalConstants::ResourceType::Electricity), 161.0, 0.001); EXPECT_NEAR(EscalatedTotEnergy(1), 103., 0.001); EXPECT_NEAR(EscalatedTotEnergy(2), 115.5, 0.001); @@ -517,7 +519,7 @@ TEST_F(EnergyPlusFixture, EconomicLifeCycleCost_ExpressAsCashFlows) numTariff = 1; tariff.allocate(1); tariff(1).isSelected = true; - tariff(1).resourceNum = 1001; + tariff(1).resourceNum = DataGlobalConstants::ResourceType::Electricity; tariff(1).ptTotal = 1; econVar.allocate(1); econVar(1).values.allocate(12); diff --git a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc index f9591166477..0f2563c56b2 100644 --- a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc +++ b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc @@ -4723,7 +4723,7 @@ TEST_F(EnergyPlusFixture, VRFTest_SysCurve_GetInputFailers) // Additional tests for fuel type input EXPECT_EQ(VRF(VRFTUNum).FuelType, "Electricity"); - EXPECT_EQ(VRF(VRFTUNum).FuelTypeNum, DataGlobalConstants::iRT_Electricity); + EXPECT_EQ(VRF(VRFTUNum).FuelTypeNum, DataGlobalConstants::ResourceType::Electricity); } TEST_F(EnergyPlusFixture, VRFTest_SysCurve_WaterCooled) @@ -7921,7 +7921,7 @@ TEST_F(EnergyPlusFixture, VRFTU_CalcVRFSupplementalHeatingCoilElectric) HeatingCoils::CoilIsSuppHeater = true; HeatingCoils::HeatingCoil(CoilNum).Name = thisVRFTU.SuppHeatCoilName; HeatingCoils::HeatingCoil(CoilNum).HeatingCoilType = thisVRFTU.SuppHeatCoilType; - HeatingCoils::HeatingCoil(CoilNum).FuelType_Num = DataGlobalConstants::iRT_Electricity; + HeatingCoils::HeatingCoil(CoilNum).FuelType_Num = DataGlobalConstants::ResourceType::Electricity; HeatingCoils::HeatingCoil(CoilNum).HCoilType_Num = thisVRFTU.SuppHeatCoilType_Num; HeatingCoils::HeatingCoil(CoilNum).AirInletNodeNum = thisVRFTU.SuppHeatCoilAirInletNode; HeatingCoils::HeatingCoil(CoilNum).AirOutletNodeNum = thisVRFTU.SuppHeatCoilAirOutletNode; @@ -7985,7 +7985,7 @@ TEST_F(EnergyPlusFixture, VRFTU_CalcVRFSupplementalHeatingCoilFuel) HeatingCoils::CoilIsSuppHeater = true; HeatingCoils::HeatingCoil(CoilNum).Name = thisVRFTU.SuppHeatCoilName; HeatingCoils::HeatingCoil(CoilNum).HeatingCoilType = thisVRFTU.SuppHeatCoilType; - HeatingCoils::HeatingCoil(CoilNum).FuelType_Num = DataGlobalConstants::iRT_Natural_Gas; + HeatingCoils::HeatingCoil(CoilNum).FuelType_Num = DataGlobalConstants::ResourceType::Natural_Gas; HeatingCoils::HeatingCoil(CoilNum).HCoilType_Num = thisVRFTU.SuppHeatCoilType_Num; HeatingCoils::HeatingCoil(CoilNum).AirInletNodeNum = thisVRFTU.SuppHeatCoilAirInletNode; HeatingCoils::HeatingCoil(CoilNum).AirOutletNodeNum = thisVRFTU.SuppHeatCoilAirOutletNode; @@ -8056,7 +8056,7 @@ TEST_F(EnergyPlusFixture, VRFTU_CalcVRFSupplementalHeatingCoilWater) state.dataWaterCoils->WaterCoil(CoilNum).SchedPtr = DataGlobals::ScheduleAlwaysOn; state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum = 1; - // state.dataWaterCoils->WaterCoil(CoilNum).FuelType_Num = DataGlobalConstants::iRT_Natural_Gas; + // state.dataWaterCoils->WaterCoil(CoilNum).FuelType_Num = DataGlobalConstants::ResourceType::Natural_Gas; state.dataWaterCoils->WaterCoil(CoilNum).AirInletNodeNum = thisVRFTU.SuppHeatCoilAirInletNode; state.dataWaterCoils->WaterCoil(CoilNum).AirOutletNodeNum = thisVRFTU.SuppHeatCoilAirOutletNode; state.dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum = thisVRFTU.SuppHeatCoilFluidInletNode; @@ -14250,7 +14250,7 @@ TEST_F(EnergyPlusFixture, VRF_MinPLR_and_EIRfPLRCruveMinPLRInputsTest) EXPECT_EQ(1.00, maxEIRfLowPLRXInput); // getinput checks this EXPECT_GT(thisHeatEIRFPLR.Var1Min, thisVRF.MinPLR); // expect warning message EXPECT_EQ(thisVRF.FuelType, "Electricity"); // Check fuel type input that uses UtilityRoutines::ValidateFuelTypeWithAssignResourceTypeNum() - EXPECT_EQ(thisVRF.FuelTypeNum, DataGlobalConstants::iRT_Electricity); // Check fuel type input that uses UtilityRoutines::ValidateFuelTypeWithAssignResourceTypeNum() + EXPECT_EQ(thisVRF.FuelTypeNum, DataGlobalConstants::ResourceType::Electricity); // Check fuel type input that uses UtilityRoutines::ValidateFuelTypeWithAssignResourceTypeNum() } diff --git a/tst/EnergyPlus/unit/HeatingCoils.unit.cc b/tst/EnergyPlus/unit/HeatingCoils.unit.cc index 565ad0f5ebd..67fb780a541 100644 --- a/tst/EnergyPlus/unit/HeatingCoils.unit.cc +++ b/tst/EnergyPlus/unit/HeatingCoils.unit.cc @@ -74,7 +74,7 @@ TEST_F(EnergyPlusFixture, HeatingCoils_FuelTypeInput) ASSERT_NO_THROW(HeatingCoils::GetHeatingCoilInput(state)); - EXPECT_EQ(HeatingCoils::HeatingCoil(1).FuelType_Num, DataGlobalConstants::iRT_OtherFuel1); + EXPECT_EQ(HeatingCoils::HeatingCoil(1).FuelType_Num, DataGlobalConstants::ResourceType::OtherFuel1); } TEST_F(EnergyPlusFixture, HeatingCoils_FuelTypeInputError) @@ -114,7 +114,7 @@ TEST_F(EnergyPlusFixture, HeatingCoils_FuelTypeCoal) ASSERT_NO_THROW(HeatingCoils::GetHeatingCoilInput(state)); - EXPECT_EQ(HeatingCoils::HeatingCoil(1).FuelType_Num, DataGlobalConstants::iRT_Coal); + EXPECT_EQ(HeatingCoils::HeatingCoil(1).FuelType_Num, DataGlobalConstants::ResourceType::Coal); } TEST_F(EnergyPlusFixture, HeatingCoils_FuelTypePropaneGas) @@ -128,7 +128,7 @@ TEST_F(EnergyPlusFixture, HeatingCoils_FuelTypePropaneGas) ASSERT_NO_THROW(HeatingCoils::GetHeatingCoilInput(state)); - EXPECT_EQ(HeatingCoils::HeatingCoil(1).FuelType_Num, DataGlobalConstants::iRT_Propane); + EXPECT_EQ(HeatingCoils::HeatingCoil(1).FuelType_Num, DataGlobalConstants::ResourceType::Propane); } TEST_F(EnergyPlusFixture, HeatingCoils_OutletAirPropertiesTest) diff --git a/tst/EnergyPlus/unit/OutputProcessor.unit.cc b/tst/EnergyPlus/unit/OutputProcessor.unit.cc index 1a79dbe03e5..1d90ddc6801 100644 --- a/tst/EnergyPlus/unit/OutputProcessor.unit.cc +++ b/tst/EnergyPlus/unit/OutputProcessor.unit.cc @@ -82,7 +82,7 @@ namespace OutputProcessor { Array1D_int VarTypes(NumVariables); // Variable Types (1=integer, 2=real, 3=meter) Array1D IndexTypes(NumVariables); // Variable Index Types (1=Zone,2=HVAC) Array1D unitsForVar(NumVariables); // units from enum for each variable - Array1D_int ResourceTypes(NumVariables); // ResourceTypes for each variable + std::map ResourceTypes; // ResourceTypes for each variable Array1D_string EndUses(NumVariables); // EndUses for each variable Array1D_string Groups(NumVariables); // Groups for each variable Array1D_string Names(NumVariables); // Variable Names for each variable @@ -93,6 +93,10 @@ namespace OutputProcessor { int NumFound; + for (int varN = 1; varN <= NumVariables; ++varN) { + ResourceTypes.insert(std::pair(varN, DataGlobalConstants::ResourceType::None)); + } + GetMeteredVariables(TypeOfComp, NameOfComp, VarIndexes, VarTypes, IndexTypes, unitsForVar, ResourceTypes, EndUses, Groups, Names, NumFound); EXPECT_EQ(0, NumFound); diff --git a/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc b/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc index a43ed76b649..55ee42d2f50 100644 --- a/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc +++ b/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc @@ -2796,18 +2796,22 @@ TEST_F(EnergyPlusFixture, CoolingMetering) Array1D_int VarTypes(NumVariables); // Variable Types (1=integer, 2=real, 3=meter) Array1D IndexTypes(NumVariables); // Variable Index Types (1=Zone,2=HVAC) Array1D unitsForVar(NumVariables); // units from enum for each variable - Array1D_int ResourceTypes(NumVariables); // ResourceTypes for each variable + std::map ResourceTypes; // ResourceTypes for each variable Array1D_string EndUses(NumVariables); // EndUses for each variable Array1D_string Groups(NumVariables); // Groups for each variable Array1D_string Names(NumVariables); // Variable Names for each variable + for (int varN = 1; varN <= NumVariables; ++varN) { + ResourceTypes.insert(std::pair(varN, DataGlobalConstants::ResourceType::None)); + } + GetMeteredVariables(TypeOfComp, NameOfComp, VarIndexes, VarTypes, IndexTypes, unitsForVar, ResourceTypes, EndUses, Groups, Names, NumFound); EXPECT_EQ(2, NumFound); - EXPECT_EQ(ResourceTypes(1), 1010); // ENERGYTRANSFER + EXPECT_EQ(ResourceTypes.at(1), DataGlobalConstants::ResourceType::EnergyTransfer); // ENERGYTRANSFER EXPECT_EQ(EndUses(1), ""); EXPECT_EQ(Groups(1), "PLANT"); - EXPECT_EQ(ResourceTypes(2), 1001); // Electric + EXPECT_EQ(ResourceTypes.at(2), DataGlobalConstants::ResourceType::Electricity); // Electric EXPECT_EQ(EndUses(2), "COOLING"); EXPECT_EQ(Groups(2), "PLANT"); } @@ -2892,18 +2896,22 @@ TEST_F(EnergyPlusFixture, HeatingMetering) Array1D_int VarTypes(NumVariables); // Variable Types (1=integer, 2=real, 3=meter) Array1D IndexTypes(NumVariables); // Variable Index Types (1=Zone,2=HVAC) Array1D unitsForVar(NumVariables); // units from enum for each variable - Array1D_int ResourceTypes(NumVariables); // ResourceTypes for each variable + std::map ResourceTypes; // ResourceTypes for each variable Array1D_string EndUses(NumVariables); // EndUses for each variable Array1D_string Groups(NumVariables); // Groups for each variable Array1D_string Names(NumVariables); // Variable Names for each variable + for (int varN = 1; varN <= NumVariables; ++varN) { + ResourceTypes.insert(std::pair(varN, DataGlobalConstants::ResourceType::None)); + } + GetMeteredVariables(TypeOfComp, NameOfComp, VarIndexes, VarTypes, IndexTypes, unitsForVar, ResourceTypes, EndUses, Groups, Names, NumFound); EXPECT_EQ(2, NumFound); - EXPECT_EQ(ResourceTypes(1), 1010); // ENERGYTRANSFER + EXPECT_EQ(ResourceTypes.at(1), DataGlobalConstants::ResourceType::EnergyTransfer); // ENERGYTRANSFER EXPECT_EQ(EndUses(1), ""); EXPECT_EQ(Groups(1), "PLANT"); - EXPECT_EQ(ResourceTypes(2), 1001); // Electric + EXPECT_EQ(ResourceTypes.at(2), DataGlobalConstants::ResourceType::Electricity); // Electric EXPECT_EQ(EndUses(2), "HEATING"); EXPECT_EQ(Groups(2), "PLANT"); } diff --git a/tst/EnergyPlus/unit/SystemReports.unit.cc b/tst/EnergyPlus/unit/SystemReports.unit.cc index 0aac5c0e9e3..ad6d972f25a 100644 --- a/tst/EnergyPlus/unit/SystemReports.unit.cc +++ b/tst/EnergyPlus/unit/SystemReports.unit.cc @@ -51,15 +51,15 @@ #include // EnergyPlus Headers - -#include -#include #include -#include "Fixtures/EnergyPlusFixture.hh" -#include #include #include #include +#include +#include +#include + +#include "Fixtures/EnergyPlusFixture.hh" using namespace EnergyPlus::SystemReports; using namespace EnergyPlus::DataGlobalConstants; @@ -73,14 +73,14 @@ TEST_F(EnergyPlusFixture, SeparateGasOutputVariables) DataHVACGlobals::NumPrimaryAirSys = 1; PrimaryAirSystem.allocate(1); DataLoopNode::Node.allocate(2); - + bool CompLoadFlag(false); int AirLoopNum(1); std::string CompType1; std::string CompType2; Real64 CompLoad(150.0); Real64 CompEnergyUse(100.0); - + PrimaryAirSystem(1).NumBranches = 1; PrimaryAirSystem(1).Branch.allocate(1); PrimaryAirSystem(1).Branch(1).TotalComponents = 2; @@ -106,7 +106,7 @@ TEST_F(EnergyPlusFixture, SeparateGasOutputVariables) PrimaryAirSystem(1).Branch(1).Comp(2).MeteredVar(1).EndUse_CompMode = 1; PrimaryAirSystem(1).Branch(1).Comp(2).MeteredVar(1).CurMeterReading = 100.0; PrimaryAirSystem(1).Branch(1).Comp(2).MeteredVar(1).ResourceType = AssignResourceTypeNum("NaturalGas"); - + DataLoopNode::Node(1).MassFlowRate = 1.0; DataLoopNode::Node(2).MassFlowRate = 1.0; @@ -123,18 +123,18 @@ TEST_F(EnergyPlusFixture, SeparateGasOutputVariables) //Calculate SysHumidNaturalGas ("Air System Humidifier NaturalGas Energy" Output Variable) CalcSystemEnergyUse( - CompLoadFlag, - AirLoopNum, - PrimaryAirSystem(1).Branch(1).Comp(1).TypeOf, + CompLoadFlag, + AirLoopNum, + PrimaryAirSystem(1).Branch(1).Comp(1).TypeOf, PrimaryAirSystem(1).Branch(1).Comp(1).MeteredVar(1).ResourceType, CompLoad, CompEnergyUse); // Calculate SysHCCompNaturalGas ("Air System Heating Coil NaturalGas Energy" Output Variable) CalcSystemEnergyUse( - CompLoadFlag, - AirLoopNum, - PrimaryAirSystem(1).Branch(1).Comp(2).TypeOf, + CompLoadFlag, + AirLoopNum, + PrimaryAirSystem(1).Branch(1).Comp(2).TypeOf, PrimaryAirSystem(1).Branch(1).Comp(2).MeteredVar(1).ResourceType, CompLoad, CompEnergyUse); @@ -199,7 +199,7 @@ TEST_F(EnergyPlusFixture, SeparateGasOutputVariables) PrimaryAirSystem(1).Branch(1).Comp(2).MeteredVar(1).ResourceType, CompLoad, CompEnergyUse); - + EXPECT_EQ(SysHumidPropane(1), 100); EXPECT_EQ(SysHCCompPropane(1), 100); diff --git a/tst/EnergyPlus/unit/UnitaryHybridAirConditioner.unit.cc b/tst/EnergyPlus/unit/UnitaryHybridAirConditioner.unit.cc index e0f7e2c5f22..422e39cd9d8 100644 --- a/tst/EnergyPlus/unit/UnitaryHybridAirConditioner.unit.cc +++ b/tst/EnergyPlus/unit/UnitaryHybridAirConditioner.unit.cc @@ -461,11 +461,15 @@ TEST_F(EnergyPlusFixture, DISABLED_Test_UnitaryHybridAirConditioner_Unittest) Array1D IndexTypes( NumVariables); // Variable Index Types (1=Zone,2=HVAC) Array1D unitsForVar(NumVariables); // units from enum for each variable - Array1D_int ResourceTypes(NumVariables); // ResourceTypes for each variable + std::map ResourceTypes; // ResourceTypes for each variable Array1D_string EndUses(NumVariables); // EndUses for each variable Array1D_string Groups(NumVariables); // Groups for each variable Array1D_string Names(NumVariables); // Variable Names for each variable + for (int varN = 1; varN <= NumVariables; ++varN) { + ResourceTypes.insert(std::pair(varN, DataGlobalConstants::ResourceType::None)); + } + GetMeteredVariables(TypeOfComp, NameOfComp, VarIndexes, VarTypes, IndexTypes, unitsForVar, ResourceTypes, EndUses, Groups, Names, NumFound); @@ -474,25 +478,25 @@ TEST_F(EnergyPlusFixture, DISABLED_Test_UnitaryHybridAirConditioner_Unittest) // Check the meters associated with the ZoneHVAC:HybridUnitaryHVAC outputs EXPECT_EQ(21, NumFound); - EXPECT_EQ(ResourceTypes(1), 1010); // ENERGYTRANSFER - Cooling + EXPECT_EQ(ResourceTypes.at(1), DataGlobalConstants::ResourceType::EnergyTransfer); // ENERGYTRANSFER - Cooling EXPECT_EQ(EndUses(1), "COOLINGCOILS"); EXPECT_EQ(Groups(1), "HVAC"); - EXPECT_EQ(ResourceTypes(2), 1010); // ENERGYTRANSFER - Heating + EXPECT_EQ(ResourceTypes.at(2), DataGlobalConstants::ResourceType::EnergyTransfer); // ENERGYTRANSFER - Heating EXPECT_EQ(EndUses(2), "HEATINGCOILS"); EXPECT_EQ(Groups(2), "HVAC"); - EXPECT_EQ(ResourceTypes(3), 1001); // ELECTRIC - Cooling Energy + EXPECT_EQ(ResourceTypes.at(3), DataGlobalConstants::ResourceType::Electricity); // ELECTRIC - Cooling Energy EXPECT_EQ(EndUses(3), "COOLING"); EXPECT_EQ(Groups(3), "HVAC"); - EXPECT_EQ(ResourceTypes(4), 1001); // ELECTRIC - Fan Energy + EXPECT_EQ(ResourceTypes.at(4), DataGlobalConstants::ResourceType::Electricity); // ELECTRIC - Fan Energy EXPECT_EQ(EndUses(4), "FANS"); EXPECT_EQ(Groups(4), "HVAC"); - EXPECT_EQ(ResourceTypes(5), 1002); // NATURALGAS - Secondary Fuel Type - specified in UnitaryHybridUnitTest_DOSA.idf + EXPECT_EQ(ResourceTypes.at(5), DataGlobalConstants::ResourceType::Natural_Gas); // NATURALGAS - Secondary Fuel Type - specified in UnitaryHybridUnitTest_DOSA.idf EXPECT_EQ(EndUses(5), "COOLING"); EXPECT_EQ(Groups(5), "HVAC"); - EXPECT_EQ(ResourceTypes(6), 1012); // DISTRICTCOOLING - Third Fuel Type - specified in UnitaryHybridUnitTest_DOSA.idf + EXPECT_EQ(ResourceTypes.at(6), DataGlobalConstants::ResourceType::DistrictCooling); // DISTRICTCOOLING - Third Fuel Type - specified in UnitaryHybridUnitTest_DOSA.idf EXPECT_EQ(EndUses(6), "COOLING"); EXPECT_EQ(Groups(6), "HVAC"); - EXPECT_EQ(ResourceTypes(7), 1009); // WATER - Cooling Water Use + EXPECT_EQ(ResourceTypes.at(7), DataGlobalConstants::ResourceType::Water); // WATER - Cooling Water Use EXPECT_EQ(EndUses(7), "COOLING"); EXPECT_EQ(Groups(7), "HVAC"); From de11039c6b6ce8c86464e7f422b02569c47f7e3e Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Tue, 13 Oct 2020 11:04:39 -0600 Subject: [PATCH 14/15] remove unused enum value, fix loop limits bug in economics after refactor --- src/EnergyPlus/BoilerSteam.hh | 2 +- src/EnergyPlus/Boilers.hh | 2 +- src/EnergyPlus/DXCoils.hh | 2 +- src/EnergyPlus/DataGlobalConstants.cc | 9 ++++----- src/EnergyPlus/DataGlobalConstants.hh | 1 - src/EnergyPlus/DataZoneEquipment.hh | 2 +- src/EnergyPlus/EconomicLifeCycleCost.cc | 2 +- src/EnergyPlus/EconomicLifeCycleCost.hh | 6 +++--- src/EnergyPlus/EconomicTariff.hh | 2 +- src/EnergyPlus/HVACVariableRefrigerantFlow.hh | 2 +- src/EnergyPlus/HeatingCoils.hh | 2 +- src/EnergyPlus/Plant/MeterData.hh | 2 +- tst/EnergyPlus/unit/DataGlobalConstants.unit.cc | 4 ++-- 13 files changed, 18 insertions(+), 20 deletions(-) diff --git a/src/EnergyPlus/BoilerSteam.hh b/src/EnergyPlus/BoilerSteam.hh index 4e649cc0ec1..886428f83c2 100644 --- a/src/EnergyPlus/BoilerSteam.hh +++ b/src/EnergyPlus/BoilerSteam.hh @@ -114,7 +114,7 @@ namespace BoilerSteam { // Default Constructor BoilerSpecs() - : FuelType(DataGlobalConstants::ResourceType::Unknown), Available(false), ON(false), MissingSetPointErrDone(false), UseLoopSetPoint(false), DesMassFlowRate(0.0), + : FuelType(DataGlobalConstants::ResourceType::None), Available(false), ON(false), MissingSetPointErrDone(false), UseLoopSetPoint(false), DesMassFlowRate(0.0), MassFlowRate(0.0), NomCap(0.0), NomCapWasAutoSized(false), NomEffic(0.0), MinPartLoadRat(0.0), MaxPartLoadRat(0.0), OptPartLoadRat(0.0), OperPartLoadRat(0.0), TempUpLimitBoilerOut(0.0), BoilerMaxOperPress(0.0), BoilerPressCheck(0.0), SizFac(0.0), BoilerInletNodeNum(0), BoilerOutletNodeNum(0), FullLoadCoef(3, 0.0), TypeNum(0), LoopNum(0), LoopSideNum(0), BranchNum(0), CompNum(0), PressErrIndex(0), diff --git a/src/EnergyPlus/Boilers.hh b/src/EnergyPlus/Boilers.hh index 3900572c86c..fc07a6d9869 100644 --- a/src/EnergyPlus/Boilers.hh +++ b/src/EnergyPlus/Boilers.hh @@ -138,7 +138,7 @@ namespace Boilers { // Default Constructor BoilerSpecs() - : FuelType(DataGlobalConstants::ResourceType::Unknown), TypeNum(0), LoopNum(0), LoopSideNum(0), BranchNum(0), CompNum(0), Available(false), + : FuelType(DataGlobalConstants::ResourceType::None), TypeNum(0), LoopNum(0), LoopSideNum(0), BranchNum(0), CompNum(0), Available(false), ON(false), NomCap(0.0), NomCapWasAutoSized(false), NomEffic(0.0), TempDesBoilerOut(0.0), FlowMode(DataPlant::FlowMode::NOTSET), ModulatedFlowSetToLoop(false), ModulatedFlowErrDone(false), VolFlowRate(0.0), VolFlowRateWasAutoSized(false), DesMassFlowRate(0.0), MassFlowRate(0.0), SizFac(0.0), diff --git a/src/EnergyPlus/DXCoils.hh b/src/EnergyPlus/DXCoils.hh index 8a2a486ae15..3340f9a7143 100644 --- a/src/EnergyPlus/DXCoils.hh +++ b/src/EnergyPlus/DXCoils.hh @@ -536,7 +536,7 @@ namespace DXCoils { ErrIndex4(0), LowAmbErrIndex(0), HighAmbErrIndex(0), PLFErrIndex(0), PLRErrIndex(0), PrintLowAmbMessage(false), PrintHighAmbMessage(false), EvapWaterSupplyMode(WaterSupplyFromMains), EvapWaterSupTankID(0), EvapWaterTankDemandARRID(0), CondensateCollectMode(CondensateDiscarded), CondensateTankID(0), CondensateTankSupplyARRID(0), CondensateVdot(0.0), CondensateVol(0.0), - CurrentEndTimeLast(0.0), TimeStepSysLast(0.0), FuelTypeNum(DataGlobalConstants::ResourceType::Unknown), NumOfSpeeds(0), PLRImpact(false), + CurrentEndTimeLast(0.0), TimeStepSysLast(0.0), FuelTypeNum(DataGlobalConstants::ResourceType::None), NumOfSpeeds(0), PLRImpact(false), LatentImpact(false), MSFuelWasteHeat(0.0), MSHPHeatRecActive(false), MSHPDesignSpecIndex(0), CoolingCoilPresent(true), HeatingCoilPresent(true), ISHundredPercentDOASDXCoil(false), SHRFTemp(MaxModes, 0), SHRFTempErrorIndex(0), SHRFFlow(MaxModes, 0), SHRFFlowErrorIndex(0), SHRFTemp2(0), SHRFFlow2(0), diff --git a/src/EnergyPlus/DataGlobalConstants.cc b/src/EnergyPlus/DataGlobalConstants.cc index dd2c602314a..2fef3b87d3d 100644 --- a/src/EnergyPlus/DataGlobalConstants.cc +++ b/src/EnergyPlus/DataGlobalConstants.cc @@ -98,8 +98,7 @@ namespace DataGlobalConstants { int const endUseRefrigeration(13); int const endUseCogeneration(14); - std::vector AllResourceTypes({ResourceType::Unknown, - ResourceType::None, + std::vector AllResourceTypes({ResourceType::None, ResourceType::Electricity, ResourceType::Natural_Gas, ResourceType::Gasoline, @@ -177,10 +176,10 @@ namespace DataGlobalConstants { } else if (SELECT_CASE_var == "COAL") { return ResourceType::Coal; - } else if ((SELECT_CASE_var == "FUELOILNO1") || (SELECT_CASE_var == "FuelOilNo1")) { + } else if (SELECT_CASE_var == "FUELOILNO1") { return ResourceType::FuelOil_1; - } else if ((SELECT_CASE_var == "FUELOILNO2") || (SELECT_CASE_var == "FuelOilNo2")) { + } else if (SELECT_CASE_var == "FUELOILNO2") { return ResourceType::FuelOil_2; } else if (SELECT_CASE_var == "PROPANE") { @@ -301,7 +300,7 @@ namespace DataGlobalConstants { return ResourceType::PlantLoopCoolingDemand; } else { - return ResourceType::Unknown; + return ResourceType::None; } } } diff --git a/src/EnergyPlus/DataGlobalConstants.hh b/src/EnergyPlus/DataGlobalConstants.hh index d6873c3d682..c81813388b1 100644 --- a/src/EnergyPlus/DataGlobalConstants.hh +++ b/src/EnergyPlus/DataGlobalConstants.hh @@ -80,7 +80,6 @@ namespace DataGlobalConstants { // Resource Types enum class ResourceType { - Unknown, None, Electricity, Natural_Gas, diff --git a/src/EnergyPlus/DataZoneEquipment.hh b/src/EnergyPlus/DataZoneEquipment.hh index 263787772d9..ff831c64a2c 100644 --- a/src/EnergyPlus/DataZoneEquipment.hh +++ b/src/EnergyPlus/DataZoneEquipment.hh @@ -172,7 +172,7 @@ namespace DataZoneEquipment { // Default Constructor EquipMeterData() - : ReportVarUnits(OutputProcessor::Unit::None), ResourceType(DataGlobalConstants::ResourceType::Unknown), EndUse_CompMode(0), ReportVarIndex(0), + : ReportVarUnits(OutputProcessor::Unit::None), ResourceType(DataGlobalConstants::ResourceType::None), EndUse_CompMode(0), ReportVarIndex(0), ReportVarIndexType(OutputProcessor::TimeStepType::TimeStepZone), ReportVarType(0), CurMeterReading(0.0) { } diff --git a/src/EnergyPlus/EconomicLifeCycleCost.cc b/src/EnergyPlus/EconomicLifeCycleCost.cc index c783f4eb872..1ee4c2600d8 100644 --- a/src/EnergyPlus/EconomicLifeCycleCost.cc +++ b/src/EnergyPlus/EconomicLifeCycleCost.cc @@ -1642,7 +1642,7 @@ namespace EconomicLifeCycleCost { } // compute the Single Present Value factors based on the discount rate SPV.allocate(lengthStudyYears); - for (int year = 1; year <= lengthStudyYears; ++lengthStudyYears) { + for (int year = 1; year <= lengthStudyYears; ++year) { std::map yearMap; for (auto iResource : DataGlobalConstants::AllResourceTypes) { yearMap.insert(std::pair (iResource, 0.0)); diff --git a/src/EnergyPlus/EconomicLifeCycleCost.hh b/src/EnergyPlus/EconomicLifeCycleCost.hh index 48e39f36b69..1013fe89bad 100644 --- a/src/EnergyPlus/EconomicLifeCycleCost.hh +++ b/src/EnergyPlus/EconomicLifeCycleCost.hh @@ -235,7 +235,7 @@ namespace EconomicLifeCycleCost { // last year is baseDateYear + lengthStudyYears - 1 // Default Constructor - UsePriceEscalationType() : resource(DataGlobalConstants::ResourceType::Unknown), escalationStartYear(0), escalationStartMonth(0) + UsePriceEscalationType() : resource(DataGlobalConstants::ResourceType::None), escalationStartYear(0), escalationStartMonth(0) { } }; @@ -249,7 +249,7 @@ namespace EconomicLifeCycleCost { // last year is baseDateYear + lengthStudyYears - 1 // Default Constructor - UseAdjustmentType() : resource(DataGlobalConstants::ResourceType::Unknown) + UseAdjustmentType() : resource(DataGlobalConstants::ResourceType::None) { } }; @@ -270,7 +270,7 @@ namespace EconomicLifeCycleCost { Array1D yrPresVal; // present value by year, first year is baseDateYear // Default Constructor - CashFlowType() : SourceKind(0), Resource(DataGlobalConstants::ResourceType::Unknown), Category(0), pvKind(0), presentValue(0.), orginalCost(0.) + CashFlowType() : SourceKind(0), Resource(DataGlobalConstants::ResourceType::None), Category(0), pvKind(0), presentValue(0.), orginalCost(0.) { } }; diff --git a/src/EnergyPlus/EconomicTariff.hh b/src/EnergyPlus/EconomicTariff.hh index 82471277af1..8a96e7d6f7f 100644 --- a/src/EnergyPlus/EconomicTariff.hh +++ b/src/EnergyPlus/EconomicTariff.hh @@ -414,7 +414,7 @@ namespace EconomicTariff { // Default Constructor TariffType() - : reportMeterIndx(0), kindElectricMtr(0), kindWaterMtr(0), kindGasMtr(0), resourceNum(DataGlobalConstants::ResourceType::Unknown), + : reportMeterIndx(0), kindElectricMtr(0), kindWaterMtr(0), kindGasMtr(0), resourceNum(DataGlobalConstants::ResourceType::None), convChoice(0), energyConv(0.0), demandConv(0.0), periodSchIndex(0), seasonSchIndex(0), monthSchIndex(0), demandWindow(0), demWinTime(0.0), monthChgVal(0.0), monthChgPt(0), minMonthChgVal(0.0), minMonthChgPt(0), chargeSchIndex(0), baseUseSchIndex(0), buyOrSell(0), firstCategory(0), lastCategory(0), diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.hh b/src/EnergyPlus/HVACVariableRefrigerantFlow.hh index b2150a236dd..d912e0c2d16 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.hh +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.hh @@ -405,7 +405,7 @@ namespace HVACVariableRefrigerantFlow { OperatingMode(0), ElecPower(0.0), ElecCoolingPower(0.0), ElecHeatingPower(0.0), CoolElecConsumption(0.0), HeatElecConsumption(0.0), CrankCaseHeaterPower(0.0), CrankCaseHeaterElecConsumption(0.0), EvapCondPumpElecPower(0.0), EvapCondPumpElecConsumption(0.0), EvapWaterConsumpRate(0.0), HRMaxTempLimitIndex(0), CoolingMaxTempLimitIndex(0), HeatingMaxTempLimitIndex(0), - FuelTypeNum(DataGlobalConstants::ResourceType::Unknown), + FuelTypeNum(DataGlobalConstants::ResourceType::None), SUMultiplier(0.0), TUCoolingLoad(0.0), TUHeatingLoad(0.0), SwitchedMode(false), OperatingCOP(0.0), MinOATHeatRecovery(0.0), MaxOATHeatRecovery(0.0), HRCAPFTCool(0), HRCAPFTCoolConst(0.9), HRInitialCoolCapFrac(0.5), HRCoolCapTC(0.15), HREIRFTCool(0), HREIRFTCoolConst(1.1), HRInitialCoolEIRFrac(1.0), HRCoolEIRTC(0.0), HRCAPFTHeat(0), HRCAPFTHeatConst(1.1), HRInitialHeatCapFrac(1.0), diff --git a/src/EnergyPlus/HeatingCoils.hh b/src/EnergyPlus/HeatingCoils.hh index 631f62a439d..f58ac7f1ef6 100644 --- a/src/EnergyPlus/HeatingCoils.hh +++ b/src/EnergyPlus/HeatingCoils.hh @@ -176,7 +176,7 @@ namespace HeatingCoils { int AirLoopNum; // Airloop number // Default Constructor HeatingCoilEquipConditions() - : HCoilType_Num(0), FuelType_Num(DataGlobalConstants::ResourceType::Unknown), SchedPtr(0), InsuffTemperatureWarn(0), + : HCoilType_Num(0), FuelType_Num(DataGlobalConstants::ResourceType::None), SchedPtr(0), InsuffTemperatureWarn(0), InletAirMassFlowRate(0.0), OutletAirMassFlowRate(0.0), InletAirTemp(0.0), OutletAirTemp(0.0), InletAirHumRat(0.0), OutletAirHumRat(0.0), InletAirEnthalpy(0.0), OutletAirEnthalpy(0.0), HeatingCoilLoad(0.0), HeatingCoilRate(0.0), FuelUseLoad(0.0), ElecUseLoad(0.0), FuelUseRate(0.0), ElecUseRate(0.0), Efficiency(0.0), diff --git a/src/EnergyPlus/Plant/MeterData.hh b/src/EnergyPlus/Plant/MeterData.hh index abe88e98507..fe200bdd371 100644 --- a/src/EnergyPlus/Plant/MeterData.hh +++ b/src/EnergyPlus/Plant/MeterData.hh @@ -69,7 +69,7 @@ namespace DataPlant { // Default Constructor MeterData() - : ReportVarUnits(OutputProcessor::Unit::None), ResourceType(DataGlobalConstants::ResourceType::Unknown), EndUse_CompMode(0), ReportVarIndex(0), + : ReportVarUnits(OutputProcessor::Unit::None), ResourceType(DataGlobalConstants::ResourceType::None), EndUse_CompMode(0), ReportVarIndex(0), ReportVarIndexType(OutputProcessor::TimeStepType::TimeStepZone), ReportVarType(0), CurMeterReading(0.0) { } diff --git a/tst/EnergyPlus/unit/DataGlobalConstants.unit.cc b/tst/EnergyPlus/unit/DataGlobalConstants.unit.cc index 5d8437e6db4..a29f26c3076 100644 --- a/tst/EnergyPlus/unit/DataGlobalConstants.unit.cc +++ b/tst/EnergyPlus/unit/DataGlobalConstants.unit.cc @@ -106,7 +106,7 @@ TEST_F(EnergyPlusFixture, DataGlobalConstants_AssignResourceTypeNum) EXPECT_EQ(DataGlobalConstants::ResourceType::CarbonEquivalent, DataGlobalConstants::AssignResourceTypeNum("Carbon Equivalent")); EXPECT_EQ(DataGlobalConstants::ResourceType::PlantLoopHeatingDemand, DataGlobalConstants::AssignResourceTypeNum("PlantLoopHeatingDemand")); EXPECT_EQ(DataGlobalConstants::ResourceType::PlantLoopCoolingDemand, DataGlobalConstants::AssignResourceTypeNum("PlantLoopCoolingDemand")); - EXPECT_EQ(DataGlobalConstants::ResourceType::Unknown, DataGlobalConstants::AssignResourceTypeNum("XYZ")); + EXPECT_EQ(DataGlobalConstants::ResourceType::None, DataGlobalConstants::AssignResourceTypeNum("XYZ")); } TEST_F(EnergyPlusFixture, DataGlobalConstants_GetResourceTypeChar) @@ -157,7 +157,7 @@ TEST_F(EnergyPlusFixture, DataGlobalConstants_GetResourceTypeChar) EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::CarbonEquivalent), "Carbon Equivalent"); EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::PlantLoopHeatingDemand), "PlantLoopHeatingDemand"); EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::PlantLoopCoolingDemand), "PlantLoopCoolingDemand"); - EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::Unknown), "Unknown"); + EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::None), "Unknown"); EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::None), "Unknown"); } From 4e9dd82c5dfc3901da2da87712e63e9ccfaf09f9 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Tue, 13 Oct 2020 13:02:46 -0600 Subject: [PATCH 15/15] move endUse ints to enum --- src/EnergyPlus/DataGlobalConstants.cc | 62 ++--- src/EnergyPlus/DataGlobalConstants.hh | 45 ++- src/EnergyPlus/OutputProcessor.cc | 61 ++--- src/EnergyPlus/OutputReportTabular.cc | 259 +++++++++--------- .../unit/OutputReportTabular.unit.cc | 32 +-- 5 files changed, 211 insertions(+), 248 deletions(-) diff --git a/src/EnergyPlus/DataGlobalConstants.cc b/src/EnergyPlus/DataGlobalConstants.cc index 2fef3b87d3d..f824d8c96f8 100644 --- a/src/EnergyPlus/DataGlobalConstants.cc +++ b/src/EnergyPlus/DataGlobalConstants.cc @@ -45,6 +45,9 @@ // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. +// C++ Headers +#include + // EnergyPlus Headers #include #include @@ -53,50 +56,21 @@ namespace EnergyPlus { namespace DataGlobalConstants { - // Module containing the data constants for components, meters, etc throughout - // EnergyPlus - - // MODULE INFORMATION: - // AUTHOR Linda Lawrie - // DATE WRITTEN June 2005 - // MODIFIED na - // RE-ENGINEERED na - - // PURPOSE OF THIS MODULE: - // Provide a central storage place for various constants and their "integer equivalents" - // used throughout EnergyPlus. Integer equivalents are needed for efficiency in run time. - - // METHODOLOGY EMPLOYED: - // na - - // REFERENCES: - // na - - // OTHER NOTES: - // na - - // USE STATEMENTS: - // na - - // Data - // MODULE PARAMETER DEFINITIONS: - // End Use Parameters - int const NumEndUses(14); - - int const endUseHeating(1); - int const endUseCooling(2); - int const endUseInteriorLights(3); - int const endUseExteriorLights(4); - int const endUseInteriorEquipment(5); - int const endUseExteriorEquipment(6); - int const endUseFans(7); - int const endUsePumps(8); - int const endUseHeatRejection(9); - int const endUseHumidification(10); - int const endUseHeatRecovery(11); - int const endUseWaterSystem(12); - int const endUseRefrigeration(13); - int const endUseCogeneration(14); + std::map iEndUse = {{EndUse::Heating, 1}, + {EndUse::Cooling, 2}, + {EndUse::InteriorLights, 3}, + {EndUse::ExteriorLights, 4}, + {EndUse::InteriorEquipment, 5}, + {EndUse::ExteriorEquipment, 6}, + {EndUse::Fans, 7}, + {EndUse::Pumps, 8}, + {EndUse::HeatRejection, 9}, + {EndUse::Humidification, 10}, + {EndUse::HeatRecovery, 11}, + {EndUse::WaterSystem, 12}, + {EndUse::Refrigeration, 13}, + {EndUse::Cogeneration, 14}, + }; std::vector AllResourceTypes({ResourceType::None, ResourceType::Electricity, diff --git a/src/EnergyPlus/DataGlobalConstants.hh b/src/EnergyPlus/DataGlobalConstants.hh index c81813388b1..7242905ff18 100644 --- a/src/EnergyPlus/DataGlobalConstants.hh +++ b/src/EnergyPlus/DataGlobalConstants.hh @@ -48,8 +48,8 @@ #ifndef DataGlobalConstants_hh_INCLUDED #define DataGlobalConstants_hh_INCLUDED -// ObjexxFCL Headers -#include +// C++ Headers +#include // EnergyPlus Headers #include @@ -58,27 +58,23 @@ namespace EnergyPlus { namespace DataGlobalConstants { - // Data - // MODULE PARAMETER DEFINITIONS: - // End Use Parameters - extern int const NumEndUses; - - extern int const endUseHeating; - extern int const endUseCooling; - extern int const endUseInteriorLights; - extern int const endUseExteriorLights; - extern int const endUseInteriorEquipment; - extern int const endUseExteriorEquipment; - extern int const endUseFans; - extern int const endUsePumps; - extern int const endUseHeatRejection; - extern int const endUseHumidification; - extern int const endUseHeatRecovery; - extern int const endUseWaterSystem; - extern int const endUseRefrigeration; - extern int const endUseCogeneration; + enum class EndUse { + Heating, + Cooling, + InteriorLights, + ExteriorLights, + InteriorEquipment, + ExteriorEquipment, + Fans, + Pumps, + HeatRejection, + Humidification, + HeatRecovery, + WaterSystem, + Refrigeration, + Cogeneration + }; - // Resource Types enum class ResourceType { None, Electricity, @@ -129,8 +125,6 @@ namespace DataGlobalConstants { OtherFuel2 }; - extern std::vector AllResourceTypes; - enum class CallIndicator { BeginDay, DuringDay, @@ -176,6 +170,9 @@ namespace DataGlobalConstants { ResourceType AssignResourceTypeNum(std::string const &ResourceTypeChar); std::string GetResourceTypeChar(ResourceType ResourceTypeNum); + extern std::vector AllResourceTypes; + extern std::map iEndUse; + } // namespace DataGlobalConstants } // namespace EnergyPlus diff --git a/src/EnergyPlus/OutputProcessor.cc b/src/EnergyPlus/OutputProcessor.cc index 1f64cc8ebdd..605d82f466d 100644 --- a/src/EnergyPlus/OutputProcessor.cc +++ b/src/EnergyPlus/OutputProcessor.cc @@ -461,37 +461,37 @@ namespace OutputProcessor { NumExtraVars = 0; // Initialize end use category names - the indices must match up with endUseNames in OutputReportTabular - EndUseCategory.allocate(NumEndUses); - EndUseCategory(endUseHeating).Name = "Heating"; - EndUseCategory(endUseCooling).Name = "Cooling"; - EndUseCategory(endUseInteriorLights).Name = "InteriorLights"; - EndUseCategory(endUseExteriorLights).Name = "ExteriorLights"; - EndUseCategory(endUseInteriorEquipment).Name = "InteriorEquipment"; - EndUseCategory(endUseExteriorEquipment).Name = "ExteriorEquipment"; - EndUseCategory(endUseFans).Name = "Fans"; - EndUseCategory(endUsePumps).Name = "Pumps"; - EndUseCategory(endUseHeatRejection).Name = "HeatRejection"; - EndUseCategory(endUseHumidification).Name = "Humidifier"; - EndUseCategory(endUseHeatRecovery).Name = "HeatRecovery"; - EndUseCategory(endUseWaterSystem).Name = "WaterSystems"; - EndUseCategory(endUseRefrigeration).Name = "Refrigeration"; - EndUseCategory(endUseCogeneration).Name = "Cogeneration"; + EndUseCategory.allocate(DataGlobalConstants::iEndUse.size()); + EndUseCategory(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Heating)).Name = "Heating"; + EndUseCategory(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Cooling)).Name = "Cooling"; + EndUseCategory(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::InteriorLights)).Name = "InteriorLights"; + EndUseCategory(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights)).Name = "ExteriorLights"; + EndUseCategory(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::InteriorEquipment)).Name = "InteriorEquipment"; + EndUseCategory(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorEquipment)).Name = "ExteriorEquipment"; + EndUseCategory(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Fans)).Name = "Fans"; + EndUseCategory(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Pumps)).Name = "Pumps"; + EndUseCategory(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::HeatRejection)).Name = "HeatRejection"; + EndUseCategory(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Humidification)).Name = "Humidifier"; + EndUseCategory(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::HeatRecovery)).Name = "HeatRecovery"; + EndUseCategory(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::WaterSystem)).Name = "WaterSystems"; + EndUseCategory(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Refrigeration)).Name = "Refrigeration"; + EndUseCategory(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Cogeneration)).Name = "Cogeneration"; // Initialize display names for output table - this could go away if end use key names are changed to match - EndUseCategory(endUseHeating).DisplayName = "Heating"; - EndUseCategory(endUseCooling).DisplayName = "Cooling"; - EndUseCategory(endUseInteriorLights).DisplayName = "Interior Lighting"; - EndUseCategory(endUseExteriorLights).DisplayName = "Exterior Lighting"; - EndUseCategory(endUseInteriorEquipment).DisplayName = "Interior Equipment"; - EndUseCategory(endUseExteriorEquipment).DisplayName = "Exterior Equipment"; - EndUseCategory(endUseFans).DisplayName = "Fans"; - EndUseCategory(endUsePumps).DisplayName = "Pumps"; - EndUseCategory(endUseHeatRejection).DisplayName = "Heat Rejection"; - EndUseCategory(endUseHumidification).DisplayName = "Humidification"; - EndUseCategory(endUseHeatRecovery).DisplayName = "Heat Recovery"; - EndUseCategory(endUseWaterSystem).DisplayName = "Water Systems"; - EndUseCategory(endUseRefrigeration).DisplayName = "Refrigeration"; - EndUseCategory(endUseCogeneration).DisplayName = "Generators"; + EndUseCategory(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Heating)).DisplayName = "Heating"; + EndUseCategory(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Cooling)).DisplayName = "Cooling"; + EndUseCategory(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::InteriorLights)).DisplayName = "Interior Lighting"; + EndUseCategory(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights)).DisplayName = "Exterior Lighting"; + EndUseCategory(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::InteriorEquipment)).DisplayName = "Interior Equipment"; + EndUseCategory(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorEquipment)).DisplayName = "Exterior Equipment"; + EndUseCategory(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Fans)).DisplayName = "Fans"; + EndUseCategory(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Pumps)).DisplayName = "Pumps"; + EndUseCategory(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::HeatRejection)).DisplayName = "Heat Rejection"; + EndUseCategory(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Humidification)).DisplayName = "Humidification"; + EndUseCategory(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::HeatRecovery)).DisplayName = "Heat Recovery"; + EndUseCategory(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::WaterSystem)).DisplayName = "Water Systems"; + EndUseCategory(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Refrigeration)).DisplayName = "Refrigeration"; + EndUseCategory(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Cogeneration)).DisplayName = "Generators"; OutputInitialized = true; @@ -3955,12 +3955,11 @@ namespace OutputProcessor { // This subroutine manages the list of subcategories for each end-use category. // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int EndUseNum; int EndUseSubNum; int NumSubs; bool Found = false; - for (EndUseNum = 1; EndUseNum <= NumEndUses; ++EndUseNum) { + for (size_t EndUseNum = 1; EndUseNum <= DataGlobalConstants::iEndUse.size(); ++EndUseNum) { if (UtilityRoutines::SameString(EndUseCategory(EndUseNum).Name, EndUseName)) { for (EndUseSubNum = 1; EndUseSubNum <= EndUseCategory(EndUseNum).NumSubcategories; ++EndUseSubNum) { diff --git a/src/EnergyPlus/OutputReportTabular.cc b/src/EnergyPlus/OutputReportTabular.cc index 2cb5e1749dc..9a0717b1a8d 100644 --- a/src/EnergyPlus/OutputReportTabular.cc +++ b/src/EnergyPlus/OutputReportTabular.cc @@ -307,26 +307,26 @@ namespace OutputReportTabular { Array1D SourceFactors(numResourceTypes, 0.0); Array1D_bool ffSchedUsed(numResourceTypes, false); Array1D_int ffSchedIndex(numResourceTypes, 0); - Array2D_int meterNumEndUseBEPS(numResourceTypes, NumEndUses, 0); + Array2D_int meterNumEndUseBEPS(numResourceTypes, DataGlobalConstants::iEndUse.size(), 0); Array3D_int meterNumEndUseSubBEPS; // arrays that hold the names of the resource and end uses Array1D_string resourceTypeNames(numResourceTypes); Array1D_string sourceTypeNames(numSourceTypes); - Array1D_string endUseNames(NumEndUses); + Array1D_string endUseNames(DataGlobalConstants::iEndUse.size()); // arrays that hold the actual values for the year Array1D gatherTotalsBEPS(numResourceTypes, 0.0); Array1D gatherTotalsBySourceBEPS(numResourceTypes, 0.0); Array1D gatherTotalsSource(numSourceTypes, 0.0); Array1D gatherTotalsBySource(numSourceTypes, 0.0); - Array2D gatherEndUseBEPS(numResourceTypes, NumEndUses, 0.0); - Array2D gatherEndUseBySourceBEPS(numResourceTypes, NumEndUses, 0.0); + Array2D gatherEndUseBEPS(numResourceTypes, DataGlobalConstants::iEndUse.size(), 0.0); + Array2D gatherEndUseBySourceBEPS(numResourceTypes, DataGlobalConstants::iEndUse.size(), 0.0); Array3D gatherEndUseSubBEPS; - Array1D_bool needOtherRowLEED45(NumEndUses); + Array1D_bool needOtherRowLEED45(DataGlobalConstants::iEndUse.size()); // arrays the hold the demand values Array1D gatherDemandTotal(numResourceTypes, 0.0); - Array2D gatherDemandEndUse(numResourceTypes, NumEndUses, 0.0); - Array2D gatherDemandIndEndUse(numResourceTypes, NumEndUses, 0.0); + Array2D gatherDemandEndUse(numResourceTypes, DataGlobalConstants::iEndUse.size(), 0.0); + Array2D gatherDemandIndEndUse(numResourceTypes, DataGlobalConstants::iEndUse.size(), 0.0); Array3D gatherDemandEndUseSub; Array3D gatherDemandIndEndUseSub; Array1D_int gatherDemandTimeStamp(numResourceTypes, 0); @@ -602,17 +602,17 @@ namespace OutputReportTabular { SourceFactors = Array1D(numResourceTypes, 0.0); ffSchedUsed = Array1D_bool(numResourceTypes, false); ffSchedIndex = Array1D_int(numResourceTypes, 0); - meterNumEndUseBEPS = Array2D_int(numResourceTypes, NumEndUses, 0); + meterNumEndUseBEPS = Array2D_int(numResourceTypes, DataGlobalConstants::iEndUse.size(), 0); meterNumEndUseSubBEPS.deallocate(); gatherTotalsBEPS = Array1D(numResourceTypes, 0.0); gatherTotalsBySourceBEPS = Array1D(numResourceTypes, 0.0); gatherTotalsSource = Array1D(numSourceTypes, 0.0); gatherTotalsBySource = Array1D(numSourceTypes, 0.0); - gatherEndUseBEPS = Array2D(numResourceTypes, NumEndUses, 0.0); - gatherEndUseBySourceBEPS = Array2D(numResourceTypes, NumEndUses, 0.0); + gatherEndUseBEPS = Array2D(numResourceTypes, DataGlobalConstants::iEndUse.size(), 0.0); + gatherEndUseBySourceBEPS = Array2D(numResourceTypes, DataGlobalConstants::iEndUse.size(), 0.0); gatherEndUseSubBEPS.deallocate(); gatherDemandTotal = Array1D(numResourceTypes, 0.0); - gatherDemandEndUse = Array2D(numResourceTypes, NumEndUses, 0.0); + gatherDemandEndUse = Array2D(numResourceTypes, DataGlobalConstants::iEndUse.size(), 0.0); gatherDemandEndUseSub.deallocate(); gatherDemandIndEndUseSub.deallocate(); gatherDemandTimeStamp = Array1D_int(numResourceTypes, 0); @@ -1986,7 +1986,6 @@ namespace OutputReportTabular { std::string meterName; int meterNumber; int iResource; - int jEndUse; int kEndUseSub; int jReport; bool nameFound; @@ -2283,23 +2282,23 @@ namespace OutputReportTabular { sourceTypeNames(12) = "OtherFuel2"; // initialize the end use names - endUseNames(endUseHeating) = "Heating"; - endUseNames(endUseCooling) = "Cooling"; - endUseNames(endUseInteriorLights) = "InteriorLights"; - endUseNames(endUseExteriorLights) = "ExteriorLights"; - endUseNames(endUseInteriorEquipment) = "InteriorEquipment"; - endUseNames(endUseExteriorEquipment) = "ExteriorEquipment"; - endUseNames(endUseFans) = "Fans"; - endUseNames(endUsePumps) = "Pumps"; - endUseNames(endUseHeatRejection) = "HeatRejection"; - endUseNames(endUseHumidification) = "Humidifier"; - endUseNames(endUseHeatRecovery) = "HeatRecovery"; - endUseNames(endUseWaterSystem) = "WaterSystems"; - endUseNames(endUseRefrigeration) = "Refrigeration"; - endUseNames(endUseCogeneration) = "Cogeneration"; + endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Heating)) = "Heating"; + endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Cooling)) = "Cooling"; + endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::InteriorLights)) = "InteriorLights"; + endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights)) = "ExteriorLights"; + endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::InteriorEquipment)) = "InteriorEquipment"; + endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorEquipment)) = "ExteriorEquipment"; + endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Fans)) = "Fans"; + endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Pumps)) = "Pumps"; + endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::HeatRejection)) = "HeatRejection"; + endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Humidification)) = "Humidifier"; + endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::HeatRecovery)) = "HeatRecovery"; + endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::WaterSystem)) = "WaterSystems"; + endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Refrigeration)) = "Refrigeration"; + endUseNames(DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Cogeneration)) = "Cogeneration"; // End use subs must be dynamically allocated to accomodate the end use with the most subcategories - meterNumEndUseSubBEPS.allocate(MaxNumSubcategories, NumEndUses, numResourceTypes); + meterNumEndUseSubBEPS.allocate(MaxNumSubcategories, DataGlobalConstants::iEndUse.size(), numResourceTypes); meterNumEndUseSubBEPS = 0; // loop through all of the resources and end uses and sub end uses for the entire facility @@ -2308,7 +2307,7 @@ namespace OutputReportTabular { meterNumber = GetMeterIndex(meterName); meterNumTotalsBEPS(iResource) = meterNumber; - for (jEndUse = 1; jEndUse <= NumEndUses; ++jEndUse) { + for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { meterName = endUseNames(jEndUse) + ':' + resourceTypeNames(iResource); //// ':FACILITY' meterNumber = GetMeterIndex(meterName); meterNumEndUseBEPS(iResource, jEndUse) = meterNumber; @@ -2334,12 +2333,12 @@ namespace OutputReportTabular { gatherTotalsBySource = 0.0; gatherEndUseBEPS = 0.0; gatherEndUseBySourceBEPS = 0.0; - // End use subs must be dynamically allocated to accomodate the end use with the most subcategories - gatherEndUseSubBEPS.allocate(MaxNumSubcategories, NumEndUses, numResourceTypes); + // End use subs must be dynamically allocated to accommodate the end use with the most subcategories + gatherEndUseSubBEPS.allocate(MaxNumSubcategories, DataGlobalConstants::iEndUse.size(), numResourceTypes); gatherEndUseSubBEPS = 0.0; - gatherDemandEndUseSub.allocate(MaxNumSubcategories, NumEndUses, numResourceTypes); + gatherDemandEndUseSub.allocate(MaxNumSubcategories, DataGlobalConstants::iEndUse.size(), numResourceTypes); gatherDemandEndUseSub = 0.0; - gatherDemandIndEndUseSub.allocate(MaxNumSubcategories, NumEndUses, numResourceTypes); + gatherDemandIndEndUseSub.allocate(MaxNumSubcategories, DataGlobalConstants::iEndUse.size(), numResourceTypes); gatherDemandIndEndUseSub = 0.0; // get meter numbers for other meters relating to electric load components @@ -4463,7 +4462,6 @@ namespace OutputReportTabular { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int iResource; - int jEndUse; int kEndUseSub; Real64 curMeterValue; int curMeterNumber; @@ -4491,7 +4489,7 @@ namespace OutputReportTabular { gatherTotalsBEPS(iResource) += curMeterValue; } - for (jEndUse = 1; jEndUse <= NumEndUses; ++jEndUse) { + for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { curMeterNumber = meterNumEndUseBEPS(iResource, jEndUse); if (curMeterNumber > 0) { curMeterValue = GetCurrentMeterValue(curMeterNumber); @@ -4625,7 +4623,6 @@ namespace OutputReportTabular { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int iResource; - int jEndUse; Real64 curMeterValue; int curMeterNumber; @@ -4650,7 +4647,7 @@ namespace OutputReportTabular { } } - for (jEndUse = 1; jEndUse <= NumEndUses; ++jEndUse) { + for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { if (ffSchedUsed(iResource)) { curMeterNumber = meterNumEndUseBEPS(iResource, jEndUse); if (curMeterNumber > 0) { @@ -4748,7 +4745,6 @@ namespace OutputReportTabular { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int iResource; - int jEndUse; int kEndUseSub; Real64 curDemandValue; int curMeterNumber; @@ -4772,7 +4768,7 @@ namespace OutputReportTabular { gatherDemandTimeStamp(iResource) = timestepTimeStamp; // if new peak demand is set, then gather all of the end use values at this particular // time to find the components of the peak demand - for (jEndUse = 1; jEndUse <= NumEndUses; ++jEndUse) { + for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { curMeterNumber = meterNumEndUseBEPS(iResource, jEndUse); if (curMeterNumber > 0) { curDemandValue = GetCurrentMeterValue(curMeterNumber) / TimeStepZoneSec; @@ -4795,7 +4791,7 @@ namespace OutputReportTabular { if ((displayLEEDSummary) && (t_timeStepType == OutputProcessor::TimeStepType::TimeStepZone)) { // loop through all of the resources and end uses for the entire facility for (iResource = 1; iResource <= numResourceTypes; ++iResource) { - for (jEndUse = 1; jEndUse <= NumEndUses; ++jEndUse) { + for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { curMeterNumber = meterNumEndUseBEPS(iResource, jEndUse); if (curMeterNumber > 0) { curDemandValue = GetCurrentMeterValue(curMeterNumber) / TimeStepZoneSec; @@ -7500,9 +7496,9 @@ namespace OutputReportTabular { Array2D useVal(13, 15); Array2D normalVal(13, 4); Array1D collapsedTotal(13); - Array2D collapsedEndUse(13, NumEndUses); - Array3D collapsedEndUseSub(MaxNumSubcategories, NumEndUses, 13); - Array2D endUseSubOther(13, NumEndUses); + Array2D collapsedEndUse(13, DataGlobalConstants::iEndUse.size()); + Array3D collapsedEndUseSub(MaxNumSubcategories, DataGlobalConstants::iEndUse.size(), 13); + Array2D endUseSubOther(13, DataGlobalConstants::iEndUse.size()); Real64 totalOnsiteHeat; Real64 totalOnsiteWater; Real64 totalWater; @@ -7513,7 +7509,6 @@ namespace OutputReportTabular { Real64 netSourceEnergyUse; Real64 netSourceElecPurchasedSold; int iResource; - int jEndUse; int kEndUseSub; int i; Real64 largeConversionFactor; @@ -7564,7 +7559,7 @@ namespace OutputReportTabular { // determine building floor areas DetermineBuildingFloorArea(); // collapse the gatherEndUseBEPS array to the resource groups displayed - for (jEndUse = 1; jEndUse <= NumEndUses; ++jEndUse) { + for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { collapsedEndUse(1, jEndUse) = gatherEndUseBEPS(1, jEndUse); // electricity collapsedEndUse(2, jEndUse) = gatherEndUseBEPS(2, jEndUse); // natural gas collapsedEndUse(3, jEndUse) = gatherEndUseBEPS(6, jEndUse); // gasoline @@ -7617,7 +7612,7 @@ namespace OutputReportTabular { UtilityRoutines::appendPerfLog(state, "Facility Any Zone Oscillating Temperatures in Deadband Time [hours]", General::RoundSigDigits(state.dataZoneTempPredictorCorrector->AnnualAnyZoneTempOscillateInDeadband, 2)); } - for (jEndUse = 1; jEndUse <= NumEndUses; ++jEndUse) { + for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { for (kEndUseSub = 1; kEndUseSub <= EndUseCategory(jEndUse).NumSubcategories; ++kEndUseSub) { collapsedEndUseSub(kEndUseSub, jEndUse, 1) = gatherEndUseSubBEPS(kEndUseSub, jEndUse, 1); // electricity collapsedEndUseSub(kEndUseSub, jEndUse, 2) = gatherEndUseSubBEPS(kEndUseSub, jEndUse, 2); // natural gas @@ -7664,7 +7659,7 @@ namespace OutputReportTabular { // convert units into GJ (divide by 1,000,000,000) if J otherwise kWh for (iResource = 1; iResource <= 12; ++iResource) { // don't do water - for (jEndUse = 1; jEndUse <= NumEndUses; ++jEndUse) { + for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { collapsedEndUse(iResource, jEndUse) /= largeConversionFactor; for (kEndUseSub = 1; kEndUseSub <= EndUseCategory(jEndUse).NumSubcategories; ++kEndUseSub) { collapsedEndUseSub(kEndUseSub, jEndUse, iResource) /= largeConversionFactor; @@ -7673,7 +7668,7 @@ namespace OutputReportTabular { collapsedTotal(iResource) /= largeConversionFactor; } // do water - for (jEndUse = 1; jEndUse <= NumEndUses; ++jEndUse) { + for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { collapsedEndUse(13, jEndUse) /= waterConversionFactor; for (kEndUseSub = 1; kEndUseSub <= EndUseCategory(jEndUse).NumSubcategories; ++kEndUseSub) { collapsedEndUseSub(kEndUseSub, jEndUse, 13) /= waterConversionFactor; @@ -7706,8 +7701,8 @@ namespace OutputReportTabular { resourcePrimaryHeating = 0; heatingMaximum = 0.0; for (iResource = 1; iResource <= 12; ++iResource) { // don't do water - if (collapsedEndUse(iResource, endUseHeating) > heatingMaximum) { - heatingMaximum = collapsedEndUse(iResource, endUseHeating); + if (collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Heating)) > heatingMaximum) { + heatingMaximum = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Heating)); resourcePrimaryHeating = iResource; } } @@ -8151,20 +8146,20 @@ namespace OutputReportTabular { columnWidth = 10; // array assignment - same for all columns tableBody.allocate(13, 16); for (iResource = 1; iResource <= 13; ++iResource) { - useVal(iResource, 1) = collapsedEndUse(iResource, endUseHeating); - useVal(iResource, 2) = collapsedEndUse(iResource, endUseCooling); - useVal(iResource, 3) = collapsedEndUse(iResource, endUseInteriorLights); - useVal(iResource, 4) = collapsedEndUse(iResource, endUseExteriorLights); - useVal(iResource, 5) = collapsedEndUse(iResource, endUseInteriorEquipment); - useVal(iResource, 6) = collapsedEndUse(iResource, endUseExteriorEquipment); - useVal(iResource, 7) = collapsedEndUse(iResource, endUseFans); - useVal(iResource, 8) = collapsedEndUse(iResource, endUsePumps); - useVal(iResource, 9) = collapsedEndUse(iResource, endUseHeatRejection); - useVal(iResource, 10) = collapsedEndUse(iResource, endUseHumidification); - useVal(iResource, 11) = collapsedEndUse(iResource, endUseHeatRecovery); - useVal(iResource, 12) = collapsedEndUse(iResource, endUseWaterSystem); - useVal(iResource, 13) = collapsedEndUse(iResource, endUseRefrigeration); - useVal(iResource, 14) = collapsedEndUse(iResource, endUseCogeneration); + useVal(iResource, 1) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Heating)); + useVal(iResource, 2) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Cooling)); + useVal(iResource, 3) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::InteriorLights)); + useVal(iResource, 4) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights)); + useVal(iResource, 5) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::InteriorEquipment)); + useVal(iResource, 6) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorEquipment)); + useVal(iResource, 7) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Fans)); + useVal(iResource, 8) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Pumps)); + useVal(iResource, 9) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::HeatRejection)); + useVal(iResource, 10) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Humidification)); + useVal(iResource, 11) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::HeatRecovery)); + useVal(iResource, 12) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::WaterSystem)); + useVal(iResource, 13) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Refrigeration)); + useVal(iResource, 14) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Cogeneration)); useVal(iResource, 15) = collapsedTotal(iResource); // totals } @@ -8235,7 +8230,7 @@ namespace OutputReportTabular { tableBody = ""; for (iResource = 1; iResource <= 13; ++iResource) { - for (jEndUse = 1; jEndUse <= 14; ++jEndUse) { + for (size_t jEndUse = 1; jEndUse <= 14; ++jEndUse) { tableBody(iResource, jEndUse) = RealToStr(useVal(iResource, jEndUse), 2); } tableBody(iResource, 16) = RealToStr(useVal(iResource, 15), 2); @@ -8405,7 +8400,7 @@ namespace OutputReportTabular { // if not, determine the difference for the 'other' row needOtherRowLEED45 = false; // set array to all false assuming no other rows are needed for (iResource = 1; iResource <= 13; ++iResource) { - for (jEndUse = 1; jEndUse <= NumEndUses; ++jEndUse) { + for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { if (EndUseCategory(jEndUse).NumSubcategories > 0) { // set the value to the total for the end use endUseSubOther(iResource, jEndUse) = collapsedEndUse(iResource, jEndUse); @@ -8427,7 +8422,7 @@ namespace OutputReportTabular { // determine the number of rows needed for sub-table numRows = 0; - for (jEndUse = 1; jEndUse <= NumEndUses; ++jEndUse) { + for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { if (EndUseCategory(jEndUse).NumSubcategories > 0) { for (kEndUseSub = 1; kEndUseSub <= EndUseCategory(jEndUse).NumSubcategories; ++kEndUseSub) { ++numRows; @@ -8451,7 +8446,7 @@ namespace OutputReportTabular { // Build row head and subcategories columns i = 1; - for (jEndUse = 1; jEndUse <= NumEndUses; ++jEndUse) { + for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { rowHead(i) = EndUseCategory(jEndUse).DisplayName; if (EndUseCategory(jEndUse).NumSubcategories > 0) { for (kEndUseSub = 1; kEndUseSub <= EndUseCategory(jEndUse).NumSubcategories; ++kEndUseSub) { @@ -8520,7 +8515,7 @@ namespace OutputReportTabular { for (iResource = 1; iResource <= 13; ++iResource) { i = 1; - for (jEndUse = 1; jEndUse <= NumEndUses; ++jEndUse) { + for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { if (EndUseCategory(jEndUse).NumSubcategories > 0) { for (kEndUseSub = 1; kEndUseSub <= EndUseCategory(jEndUse).NumSubcategories; ++kEndUseSub) { tableBody(iResource + 1, i) = RealToStr(collapsedEndUseSub(kEndUseSub, jEndUse, iResource), 2); @@ -8597,7 +8592,7 @@ namespace OutputReportTabular { for (iResource = 1; iResource <= 12; ++iResource) { i = 1; - for (jEndUse = 1; jEndUse <= NumEndUses; ++jEndUse) { + for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { if (EndUseCategory(jEndUse).NumSubcategories > 0) { for (kEndUseSub = 1; kEndUseSub <= EndUseCategory(jEndUse).NumSubcategories; ++kEndUseSub) { PreDefTableEntry(resource_entry_map(iResource), @@ -8629,19 +8624,19 @@ namespace OutputReportTabular { columnWidth = 7; // array assignment - same for all columns tableBody.allocate(13, 4); for (iResource = 1; iResource <= 13; ++iResource) { - normalVal(iResource, 1) = collapsedEndUse(iResource, endUseInteriorLights) + - collapsedEndUse(iResource, endUseExteriorLights); // Lights <- InteriorLights | <- ExteriorLights + normalVal(iResource, 1) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::InteriorLights)) + + collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights)); // Lights <- InteriorLights | <- ExteriorLights - normalVal(iResource, 2) = collapsedEndUse(iResource, endUseFans) + collapsedEndUse(iResource, endUsePumps) + - collapsedEndUse(iResource, endUseHeating) + collapsedEndUse(iResource, endUseCooling) + - collapsedEndUse(iResource, endUseHeatRejection) + collapsedEndUse(iResource, endUseHumidification) + - collapsedEndUse(iResource, endUseWaterSystem); // HVAC <- fans | <- pumps | <- heating | <- cooling | + normalVal(iResource, 2) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Fans)) + collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Pumps)) + + collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Heating)) + collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Cooling)) + + collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::HeatRejection)) + collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Humidification)) + + collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::WaterSystem)); // HVAC <- fans | <- pumps | <- heating | <- cooling | // <- heat rejection | <- humidification | <- water system // domestic hot water - normalVal(iResource, 3) = collapsedEndUse(iResource, endUseInteriorEquipment) + collapsedEndUse(iResource, endUseExteriorEquipment) + - collapsedEndUse(iResource, endUseCogeneration) + collapsedEndUse(iResource, endUseHeatRecovery) + - collapsedEndUse(iResource, endUseRefrigeration); // Other <- InteriorEquipment | <- ExteriorEquipment | + normalVal(iResource, 3) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::InteriorEquipment)) + collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorEquipment)) + + collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Cogeneration)) + collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::HeatRecovery)) + + collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Refrigeration)); // Other <- InteriorEquipment | <- ExteriorEquipment | // <- generator fuel | <- Heat Recovery (parasitics) | <- // Refrigeration @@ -8649,7 +8644,7 @@ namespace OutputReportTabular { } // convert the normalized end use values to MJ from GJ if using J for (iResource = 1; iResource <= 12; ++iResource) { // not including resource=13 water - for (jEndUse = 1; jEndUse <= 4; ++jEndUse) { + for (size_t jEndUse = 1; jEndUse <= 4; ++jEndUse) { normalVal(iResource, jEndUse) *= kConversionFactor; } } @@ -8712,7 +8707,7 @@ namespace OutputReportTabular { tableBody = ""; if (convBldgCondFloorArea > 0) { for (iResource = 1; iResource <= 13; ++iResource) { - for (jEndUse = 1; jEndUse <= 4; ++jEndUse) { + for (size_t jEndUse = 1; jEndUse <= 4; ++jEndUse) { tableBody(iResource, jEndUse) = RealToStr(normalVal(iResource, jEndUse) / convBldgCondFloorArea, 2); } } @@ -8742,7 +8737,7 @@ namespace OutputReportTabular { tableBody = ""; if (convBldgGrossFloorArea > 0) { for (iResource = 1; iResource <= 13; ++iResource) { - for (jEndUse = 1; jEndUse <= 4; ++jEndUse) { + for (size_t jEndUse = 1; jEndUse <= 4; ++jEndUse) { tableBody(iResource, jEndUse) = RealToStr(normalVal(iResource, jEndUse) / convBldgGrossFloorArea, 2); } } @@ -9177,10 +9172,9 @@ namespace OutputReportTabular { // all arrays are in the format: (row, columnm) Array2D useVal(13, 15); Array1D collapsedTotal(13); - Array2D collapsedEndUse(13, NumEndUses); - Array3D collapsedEndUseSub(MaxNumSubcategories, NumEndUses, 13); + Array2D collapsedEndUse(13, DataGlobalConstants::iEndUse.size()); + Array3D collapsedEndUseSub(MaxNumSubcategories, DataGlobalConstants::iEndUse.size(), 13); int iResource; - int jEndUse; Real64 largeConversionFactor; Real64 areaConversionFactor; @@ -9196,7 +9190,7 @@ namespace OutputReportTabular { // determine building floor areas DetermineBuildingFloorArea(); // collapse the gatherEndUseBEPS array to the resource groups displayed - for (jEndUse = 1; jEndUse <= NumEndUses; ++jEndUse) { + for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { collapsedEndUse(1, jEndUse) = gatherEndUseBySourceBEPS(1, jEndUse); // electricity collapsedEndUse(2, jEndUse) = gatherEndUseBySourceBEPS(2, jEndUse); // natural gas collapsedEndUse(3, jEndUse) = gatherEndUseBySourceBEPS(6, jEndUse); // gasoline @@ -9245,7 +9239,7 @@ namespace OutputReportTabular { // convert units into MJ (divide by 1,000,000) if J otherwise kWh for (iResource = 1; iResource <= 12; ++iResource) { // don't do water - for (jEndUse = 1; jEndUse <= NumEndUses; ++jEndUse) { + for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { collapsedEndUse(iResource, jEndUse) /= largeConversionFactor; } collapsedTotal(iResource) /= largeConversionFactor; @@ -9257,20 +9251,20 @@ namespace OutputReportTabular { columnWidth = 10; // array assignment - same for all columns tableBody.allocate(12, 16); for (iResource = 1; iResource <= 13; ++iResource) { - useVal(iResource, 1) = collapsedEndUse(iResource, endUseHeating); - useVal(iResource, 2) = collapsedEndUse(iResource, endUseCooling); - useVal(iResource, 3) = collapsedEndUse(iResource, endUseInteriorLights); - useVal(iResource, 4) = collapsedEndUse(iResource, endUseExteriorLights); - useVal(iResource, 5) = collapsedEndUse(iResource, endUseInteriorEquipment); - useVal(iResource, 6) = collapsedEndUse(iResource, endUseExteriorEquipment); - useVal(iResource, 7) = collapsedEndUse(iResource, endUseFans); - useVal(iResource, 8) = collapsedEndUse(iResource, endUsePumps); - useVal(iResource, 9) = collapsedEndUse(iResource, endUseHeatRejection); - useVal(iResource, 10) = collapsedEndUse(iResource, endUseHumidification); - useVal(iResource, 11) = collapsedEndUse(iResource, endUseHeatRecovery); - useVal(iResource, 12) = collapsedEndUse(iResource, endUseWaterSystem); - useVal(iResource, 13) = collapsedEndUse(iResource, endUseRefrigeration); - useVal(iResource, 14) = collapsedEndUse(iResource, endUseCogeneration); + useVal(iResource, 1) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Heating)); + useVal(iResource, 2) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Cooling)); + useVal(iResource, 3) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::InteriorLights)); + useVal(iResource, 4) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights)); + useVal(iResource, 5) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::InteriorEquipment)); + useVal(iResource, 6) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorEquipment)); + useVal(iResource, 7) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Fans)); + useVal(iResource, 8) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Pumps)); + useVal(iResource, 9) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::HeatRejection)); + useVal(iResource, 10) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Humidification)); + useVal(iResource, 11) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::HeatRecovery)); + useVal(iResource, 12) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::WaterSystem)); + useVal(iResource, 13) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Refrigeration)); + useVal(iResource, 14) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Cogeneration)); useVal(iResource, 15) = collapsedTotal(iResource); // totals } @@ -9343,7 +9337,7 @@ namespace OutputReportTabular { tableBody = ""; for (iResource = 1; iResource <= 12; ++iResource) { - for (jEndUse = 1; jEndUse <= 14; ++jEndUse) { + for (size_t jEndUse = 1; jEndUse <= 14; ++jEndUse) { tableBody(iResource, jEndUse) = RealToStr(useVal(iResource, jEndUse) / largeConversionFactor, 2); } tableBody(iResource, 16) = RealToStr(useVal(iResource, 15) / largeConversionFactor, 2); @@ -9422,7 +9416,7 @@ namespace OutputReportTabular { Real64 convBldgCondFloorArea = buildingConditionedFloorArea / areaConversionFactor; if (convBldgCondFloorArea > 0) { for (iResource = 1; iResource <= 12; ++iResource) { - for (jEndUse = 1; jEndUse <= 14; ++jEndUse) { + for (size_t jEndUse = 1; jEndUse <= 14; ++jEndUse) { tableBody(iResource, jEndUse) = RealToStr(useVal(iResource, jEndUse) / convBldgCondFloorArea, 2); } tableBody(iResource, 16) = RealToStr(useVal(iResource, 15) / convBldgCondFloorArea, 2); @@ -9460,7 +9454,7 @@ namespace OutputReportTabular { if (convBldgGrossFloorArea > 0) { for (iResource = 1; iResource <= 12; ++iResource) { - for (jEndUse = 1; jEndUse <= 14; ++jEndUse) { + for (size_t jEndUse = 1; jEndUse <= 14; ++jEndUse) { tableBody(iResource, jEndUse) = RealToStr(useVal(iResource, jEndUse) / convBldgGrossFloorArea, 2); } tableBody(iResource, 16) = RealToStr(useVal(iResource, 15) / convBldgGrossFloorArea, 2); @@ -9540,14 +9534,13 @@ namespace OutputReportTabular { // all arrays are in the format: (row, column) Array2D useVal(13, 15); Array1D collapsedTotal(13); - Array2D collapsedEndUse(13, NumEndUses); - Array2D collapsedIndEndUse(13, NumEndUses); + Array2D collapsedEndUse(13, DataGlobalConstants::iEndUse.size()); + Array2D collapsedIndEndUse(13, DataGlobalConstants::iEndUse.size()); Array1D_int collapsedTimeStep(13); - Array3D collapsedEndUseSub(MaxNumSubcategories, NumEndUses, 13); - Array3D collapsedIndEndUseSub(MaxNumSubcategories, NumEndUses, 13); - Array2D endUseSubOther(13, NumEndUses); + Array3D collapsedEndUseSub(MaxNumSubcategories, DataGlobalConstants::iEndUse.size(), 13); + Array3D collapsedIndEndUseSub(MaxNumSubcategories, DataGlobalConstants::iEndUse.size(), 13); + Array2D endUseSubOther(13, DataGlobalConstants::iEndUse.size()); int iResource; - int jEndUse; int kEndUseSub; int i; int numRows; @@ -9619,7 +9612,7 @@ namespace OutputReportTabular { // collapse the gatherEndUseBEPS array to the resource groups displayed collapsedEndUse = 0.0; - for (jEndUse = 1; jEndUse <= NumEndUses; ++jEndUse) { + for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { collapsedEndUse(1, jEndUse) = gatherDemandEndUse(1, jEndUse) * powerConversion; // electricity collapsedEndUse(2, jEndUse) = gatherDemandEndUse(2, jEndUse) * powerConversion; // natural gas collapsedEndUse(3, jEndUse) = gatherDemandEndUse(6, jEndUse) * powerConversion; // gasoline @@ -9634,7 +9627,7 @@ namespace OutputReportTabular { collapsedEndUse(12, jEndUse) = gatherDemandEndUse(distrHeatSelected, jEndUse) * powerConversion; // district heating collapsedEndUse(13, jEndUse) = gatherDemandEndUse(7, jEndUse) * flowConversion; // water } - for (jEndUse = 1; jEndUse <= NumEndUses; ++jEndUse) { + for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { for (kEndUseSub = 1; kEndUseSub <= EndUseCategory(jEndUse).NumSubcategories; ++kEndUseSub) { collapsedEndUseSub(kEndUseSub, jEndUse, 1) = gatherDemandEndUseSub(kEndUseSub, jEndUse, 1) * powerConversion; // electricity collapsedEndUseSub(kEndUseSub, jEndUse, 2) = gatherDemandEndUseSub(kEndUseSub, jEndUse, 2) * powerConversion; // natural gas @@ -9656,7 +9649,7 @@ namespace OutputReportTabular { // collapse the gatherEndUseBEPS array to the resource groups displayed // no unit conversion, it is done at the reporting stage if necessary collapsedIndEndUse = 0.0; - for (jEndUse = 1; jEndUse <= NumEndUses; ++jEndUse) { + for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { collapsedIndEndUse(1, jEndUse) = gatherDemandIndEndUse(1, jEndUse); // electricity collapsedIndEndUse(2, jEndUse) = gatherDemandIndEndUse(2, jEndUse); // natural gas collapsedIndEndUse(3, jEndUse) = gatherDemandIndEndUse(6, jEndUse); // gasoline @@ -9671,7 +9664,7 @@ namespace OutputReportTabular { collapsedIndEndUse(12, jEndUse) = gatherDemandIndEndUse(distrHeatSelected, jEndUse); // district heating collapsedIndEndUse(13, jEndUse) = gatherDemandIndEndUse(7, jEndUse); // water } - for (jEndUse = 1; jEndUse <= NumEndUses; ++jEndUse) { + for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { for (kEndUseSub = 1; kEndUseSub <= EndUseCategory(jEndUse).NumSubcategories; ++kEndUseSub) { collapsedIndEndUseSub(kEndUseSub, jEndUse, 1) = gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 1); // electricity collapsedIndEndUseSub(kEndUseSub, jEndUse, 2) = gatherDemandIndEndUseSub(kEndUseSub, jEndUse, 2); // natural gas @@ -9711,20 +9704,20 @@ namespace OutputReportTabular { columnWidth = 10; // array assignment - same for all columns tableBody.allocate(13, 17); for (iResource = 1; iResource <= 13; ++iResource) { - useVal(iResource, 1) = collapsedEndUse(iResource, endUseHeating); - useVal(iResource, 2) = collapsedEndUse(iResource, endUseCooling); - useVal(iResource, 3) = collapsedEndUse(iResource, endUseInteriorLights); - useVal(iResource, 4) = collapsedEndUse(iResource, endUseExteriorLights); - useVal(iResource, 5) = collapsedEndUse(iResource, endUseInteriorEquipment); - useVal(iResource, 6) = collapsedEndUse(iResource, endUseExteriorEquipment); - useVal(iResource, 7) = collapsedEndUse(iResource, endUseFans); - useVal(iResource, 8) = collapsedEndUse(iResource, endUsePumps); - useVal(iResource, 9) = collapsedEndUse(iResource, endUseHeatRejection); - useVal(iResource, 10) = collapsedEndUse(iResource, endUseHumidification); - useVal(iResource, 11) = collapsedEndUse(iResource, endUseHeatRecovery); - useVal(iResource, 12) = collapsedEndUse(iResource, endUseWaterSystem); - useVal(iResource, 13) = collapsedEndUse(iResource, endUseRefrigeration); - useVal(iResource, 14) = collapsedEndUse(iResource, endUseCogeneration); + useVal(iResource, 1) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Heating)); + useVal(iResource, 2) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Cooling)); + useVal(iResource, 3) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::InteriorLights)); + useVal(iResource, 4) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights)); + useVal(iResource, 5) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::InteriorEquipment)); + useVal(iResource, 6) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorEquipment)); + useVal(iResource, 7) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Fans)); + useVal(iResource, 8) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Pumps)); + useVal(iResource, 9) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::HeatRejection)); + useVal(iResource, 10) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Humidification)); + useVal(iResource, 11) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::HeatRecovery)); + useVal(iResource, 12) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::WaterSystem)); + useVal(iResource, 13) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Refrigeration)); + useVal(iResource, 14) = collapsedEndUse(iResource, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Cogeneration)); useVal(iResource, 15) = collapsedTotal(iResource); // totals } @@ -9792,7 +9785,7 @@ namespace OutputReportTabular { tableBody = ""; for (iResource = 1; iResource <= 13; ++iResource) { - for (jEndUse = 1; jEndUse <= 14; ++jEndUse) { + for (size_t jEndUse = 1; jEndUse <= 14; ++jEndUse) { tableBody(iResource, 1 + jEndUse) = RealToStr(useVal(iResource, jEndUse), 2); } tableBody(iResource, 1) = DateToString(collapsedTimeStep(iResource)); @@ -9815,7 +9808,7 @@ namespace OutputReportTabular { //---- End Uses By Subcategory Sub-Table numRows = 0; - for (jEndUse = 1; jEndUse <= NumEndUses; ++jEndUse) { + for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { if (EndUseCategory(jEndUse).NumSubcategories > 0) { for (kEndUseSub = 1; kEndUseSub <= EndUseCategory(jEndUse).NumSubcategories; ++kEndUseSub) { ++numRows; @@ -9836,7 +9829,7 @@ namespace OutputReportTabular { // Build row head and subcategories columns i = 1; - for (jEndUse = 1; jEndUse <= NumEndUses; ++jEndUse) { + for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { rowHead(i) = EndUseCategory(jEndUse).DisplayName; if (EndUseCategory(jEndUse).NumSubcategories > 0) { for (kEndUseSub = 1; kEndUseSub <= EndUseCategory(jEndUse).NumSubcategories; ++kEndUseSub) { @@ -9897,7 +9890,7 @@ namespace OutputReportTabular { for (iResource = 1; iResource <= 13; ++iResource) { i = 1; - for (jEndUse = 1; jEndUse <= NumEndUses; ++jEndUse) { + for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { if (EndUseCategory(jEndUse).NumSubcategories > 0) { for (kEndUseSub = 1; kEndUseSub <= EndUseCategory(jEndUse).NumSubcategories; ++kEndUseSub) { tableBody(iResource + 1, i) = RealToStr(collapsedEndUseSub(kEndUseSub, jEndUse, iResource), 2); @@ -9941,7 +9934,7 @@ namespace OutputReportTabular { // EAp2-4/5. Performance Rating Method Compliance for (iResource = 1; iResource <= 13; ++iResource) { - for (jEndUse = 1; jEndUse <= NumEndUses; ++jEndUse) { + for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { if (needOtherRowLEED45(jEndUse)) { if (EndUseCategory(jEndUse).NumSubcategories == 0) { endUseSubOther(iResource, jEndUse) = @@ -9977,7 +9970,7 @@ namespace OutputReportTabular { for (iResource = 1; iResource <= 12; ++iResource) { i = 1; - for (jEndUse = 1; jEndUse <= NumEndUses; ++jEndUse) { + for (size_t jEndUse = 1; jEndUse <= DataGlobalConstants::iEndUse.size(); ++jEndUse) { if (EndUseCategory(jEndUse).NumSubcategories > 0) { for (kEndUseSub = 1; kEndUseSub <= EndUseCategory(jEndUse).NumSubcategories; ++kEndUseSub) { PreDefTableEntry(resource_entry_map(iResource), diff --git a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc index 7a39f3631c0..bff7296e882 100644 --- a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc +++ b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc @@ -3596,26 +3596,26 @@ TEST_F(EnergyPlusFixture, OutputReportTabular_ConfirmResetBEPSGathering) UpdateMeterReporting(state); UpdateDataandReport(state, OutputProcessor::TimeStepType::TimeStepZone); GatherBEPSResultsForTimestep(OutputProcessor::TimeStepType::TimeStepZone); - EXPECT_EQ(extLitUse * 3, gatherEndUseBEPS(1, endUseExteriorLights)); + EXPECT_EQ(extLitUse * 3, gatherEndUseBEPS(1, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights))); UpdateMeterReporting(state); UpdateDataandReport(state, OutputProcessor::TimeStepType::TimeStepZone); GatherBEPSResultsForTimestep(OutputProcessor::TimeStepType::TimeStepZone); - EXPECT_EQ(extLitUse * 6, gatherEndUseBEPS(1, endUseExteriorLights)); + EXPECT_EQ(extLitUse * 6, gatherEndUseBEPS(1, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights))); UpdateMeterReporting(state); UpdateDataandReport(state, OutputProcessor::TimeStepType::TimeStepZone); GatherBEPSResultsForTimestep(OutputProcessor::TimeStepType::TimeStepZone); - EXPECT_EQ(extLitUse * 9, gatherEndUseBEPS(1, endUseExteriorLights)); + EXPECT_EQ(extLitUse * 9, gatherEndUseBEPS(1, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights))); ResetBEPSGathering(); - EXPECT_EQ(0., gatherEndUseBEPS(1, endUseExteriorLights)); + EXPECT_EQ(0., gatherEndUseBEPS(1, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights))); UpdateMeterReporting(state); UpdateDataandReport(state, OutputProcessor::TimeStepType::TimeStepZone); GatherBEPSResultsForTimestep(OutputProcessor::TimeStepType::TimeStepZone); - EXPECT_EQ(extLitUse * 3, gatherEndUseBEPS(1, endUseExteriorLights)); + EXPECT_EQ(extLitUse * 3, gatherEndUseBEPS(1, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights))); } TEST_F(EnergyPlusFixture, OutputReportTabular_GatherPeakDemandForTimestep) @@ -7758,8 +7758,8 @@ TEST_F(SQLiteFixture, WriteSourceEnergyEndUseSummary_TestPerArea) { // Assume that we only have electricity with a value of 3.6e6 * 1e4 J =10.000 kWh. - // And that this only comes for a single end use endUseHeating=1 - OutputReportTabular::gatherEndUseBySourceBEPS(1, DataGlobalConstants::endUseHeating) = 3.6e10; + // And that this only comes for a single end use DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Heating)=1 + OutputReportTabular::gatherEndUseBySourceBEPS(1, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::Heating)) = 3.6e10; OutputReportTabular::gatherTotalsBySourceBEPS(1) = 3.6e10; Real64 eleckWh = 1e4; @@ -7917,31 +7917,31 @@ TEST_F(SQLiteFixture, OutputReportTabular_EndUseBySubcategorySQL) UpdateDataandReport(state, OutputProcessor::TimeStepType::TimeStepZone); GatherBEPSResultsForTimestep(OutputProcessor::TimeStepType::TimeStepZone); GatherPeakDemandForTimestep(OutputProcessor::TimeStepType::TimeStepZone); - EXPECT_NEAR(extLitUse * 3, gatherEndUseBEPS(1, DataGlobalConstants::endUseExteriorLights), 1.); + EXPECT_NEAR(extLitUse * 3, gatherEndUseBEPS(1, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights)), 1.); // General - EXPECT_NEAR(extLitUse * 2, gatherEndUseSubBEPS(1, DataGlobalConstants::endUseExteriorLights, 1), 1.); + EXPECT_NEAR(extLitUse * 2, gatherEndUseSubBEPS(1, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights), 1), 1.); // AnotherEndUseSubCat - EXPECT_NEAR(extLitUse * 1, gatherEndUseSubBEPS(2, DataGlobalConstants::endUseExteriorLights, 1), 1.); + EXPECT_NEAR(extLitUse * 1, gatherEndUseSubBEPS(2, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights), 1), 1.); UpdateMeterReporting(state); UpdateDataandReport(state, OutputProcessor::TimeStepType::TimeStepZone); GatherBEPSResultsForTimestep(OutputProcessor::TimeStepType::TimeStepZone); GatherPeakDemandForTimestep(OutputProcessor::TimeStepType::TimeStepZone); - EXPECT_NEAR(extLitUse * 6, gatherEndUseBEPS(1, DataGlobalConstants::endUseExteriorLights), 1.); + EXPECT_NEAR(extLitUse * 6, gatherEndUseBEPS(1, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights)), 1.); // General - EXPECT_NEAR(extLitUse * 4, gatherEndUseSubBEPS(1, DataGlobalConstants::endUseExteriorLights, 1), 1.); + EXPECT_NEAR(extLitUse * 4, gatherEndUseSubBEPS(1, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights), 1), 1.); // AnotherEndUseSubCat - EXPECT_NEAR(extLitUse * 2, gatherEndUseSubBEPS(2, DataGlobalConstants::endUseExteriorLights, 1), 1.); + EXPECT_NEAR(extLitUse * 2, gatherEndUseSubBEPS(2, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights), 1), 1.); UpdateMeterReporting(state); UpdateDataandReport(state, OutputProcessor::TimeStepType::TimeStepZone); GatherBEPSResultsForTimestep(OutputProcessor::TimeStepType::TimeStepZone); GatherPeakDemandForTimestep(OutputProcessor::TimeStepType::TimeStepZone); - EXPECT_NEAR(extLitUse * 9, gatherEndUseBEPS(1, DataGlobalConstants::endUseExteriorLights), 1.); + EXPECT_NEAR(extLitUse * 9, gatherEndUseBEPS(1, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights)), 1.); // General - EXPECT_NEAR(extLitUse * 6, gatherEndUseSubBEPS(1, DataGlobalConstants::endUseExteriorLights, 1), 1.); + EXPECT_NEAR(extLitUse * 6, gatherEndUseSubBEPS(1, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights), 1), 1.); // AnotherEndUseSubCat - EXPECT_NEAR(extLitUse * 3, gatherEndUseSubBEPS(2, DataGlobalConstants::endUseExteriorLights, 1), 1.); + EXPECT_NEAR(extLitUse * 3, gatherEndUseSubBEPS(2, DataGlobalConstants::iEndUse.at(DataGlobalConstants::EndUse::ExteriorLights), 1), 1.); OutputReportTabular::WriteBEPSTable(state); OutputReportTabular::WriteDemandEndUseSummary(state);